Skip to content

πŸ“¦ Release @webref/[email protected] #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 20, 2025

⚠ NEVER add commits to this pull request.

πŸ€– This pull request was automatically created to facilitate human review of @webref/css changes triggered by curated data at 5f1516f.

🧐 Please review the diff below and version numbers. If all looks good, merge this pull request to release the changes to npm.

πŸ“¦ Latest released @webref/css package was v6.23.1. Merging this pull request will release v7.0.3-alpha. Make sure that the bump is the right one for the changes.

✍ If any change needs to be made before release, do not add a commit to this pull request. Changes should rather be handled in a separate pull request and pushed to the main branch. You may leave this pull request open in the meantime, or close it. The pre-release job will automatically update this pull request or create a new one once the updates have made their way to the main branch.

πŸ›ˆ The actual change introduced by this pull request is a version bump in packages/css/package.json. You do not need to review that change. The bumped version is not the version that will be released when this pull request is merged, but rather the version that will be released next time.

Static file(s) changed:
+ README.md

New repo files that are not yet in the released package:
+ css.json

Released package files that no longer exist in the repo:
- CSS.json
- SVG.json
- compat.json
- compositing.json
- css-align.json
- css-anchor-position.json
- css-animations-2.json
- css-animations.json
- css-backgrounds-4.json
- css-backgrounds.json
- css-borders.json
- css-box.json
- css-break.json
- css-cascade-6.json
- css-cascade.json
- css-color-5.json
- css-color-6.json
- css-color-adjust.json
- css-color-hdr.json
- css-color.json
- css-conditional-4.json
- css-conditional-5.json
- css-conditional.json
- css-contain.json
- css-content.json
- css-counter-styles.json
- css-display.json
- css-easing.json
- css-env.json
- css-exclusions.json
- css-extensions.json
- css-flexbox.json
- css-fonts-5.json
- css-fonts.json
- css-forms.json
- css-gaps.json
- css-gcpm-4.json
- css-gcpm.json
- css-grid-3.json
- css-grid.json
- css-images-4.json
- css-images-5.json
- css-images.json
- css-inline.json
- css-layout-api.json
- css-line-grid.json
- css-link-params.json
- css-lists.json
- css-logical.json
- css-masking.json
- css-mixins.json
- css-multicol.json
- css-namespaces.json
- css-nav.json
- css-nesting.json
- css-overflow-4.json
- css-overflow-5.json
- css-overflow.json
- css-overscroll.json
- css-page-floats.json
- css-page.json
- css-paint-api.json
- css-position-4.json
- css-position.json
- css-properties-values-api.json
- css-pseudo.json
- css-regions.json
- css-rhythm.json
- css-round-display.json
- css-ruby.json
- css-scoping.json
- css-scroll-anchoring.json
- css-scroll-snap-2.json
- css-scroll-snap.json
- css-scrollbars.json
- css-shadow-parts.json
- css-shapes-2.json
- css-shapes.json
- css-size-adjust.json
- css-sizing-4.json
- css-sizing.json
- css-speech.json
- css-syntax.json
- css-tables.json
- css-text-4.json
- css-text-decor-4.json
- css-text-decor.json
- css-text.json
- css-transforms-2.json
- css-transforms.json
- css-transitions-2.json
- css-transitions.json
- css-ui.json
- css-values-5.json
- css-values.json
- css-variables.json
- css-view-transitions-2.json
- css-view-transitions.json
- css-viewport.json
- css-will-change.json
- css-writing-modes.json
- fill-stroke.json
- filter-effects-2.json
- filter-effects.json
- html.json
- mathml-core.json
- mediaqueries-5.json
- mediaqueries.json
- motion.json
- pointer-animations.json
- scroll-animations.json
- selectors-5.json
- selectors.json
- svg-strokes.json
- upgrade-insecure-requests.json
- webvtt.json
- webxr-dom-overlays.json

diff --ignore-trailing-space '--exclude=package.json' '--exclude=README.md' '--exclude=CHANGELOG.md' '--unified=3' webref/node_modules/@webref/css/index.js packages/css/index.js
--- webref/node_modules/@webref/css/index.js
+++ packages/css/index.js
@@ -2,15 +2,31 @@
 const path = require('path');
 
 async function listAll({folder = __dirname} = {}) {
-  const all = {};
-  const files = await fs.readdir(folder);
-  for (const f of files) {
-    if (f.endsWith('.json') && f !== 'package.json') {
-      const text = await fs.readFile(path.join(folder, f), 'utf8');
-      all[path.basename(f, '.json')] = JSON.parse(text);
+  const json = await fs.readFile(path.join(folder, 'css.json'), 'utf8');
+  return JSON.parse(json);
+}
+
+async function index({folder = __dirname} = {}) {
+  const nonIndexed = await listAll(folder);
+  const indexed = {};
+  for (const [category, features] of Object.entries(nonIndexed)) {
+    indexed[category] = {};
+    for (const feature of features) {
+      // A handful of features have different definitions for different scopes.
+      // When that happens, the feature identifier needs to be disambiguated.
+      let id = feature.name;
+      let dupl = null;
+      if (feature.for) {
+        dupl = features.find(f => f !== feature && f.name === feature.name);
+      }
+      if (dupl) {
+        // Note: scopes of different definitions are necessarily disjoint
+        id += ' for ' + feature.for[0];
+      }
+      indexed[category][id] = feature;
     }
   }
-  return all;
+  return indexed;
 }
 
-module.exports = {listAll};
+module.exports = {listAll, index};

@github-actions github-actions bot force-pushed the release-css-20250620185254962 branch 5 times, most recently from 5d50f20 to 1a7e306 Compare June 22, 2025 00:55
@github-actions github-actions bot force-pushed the release-css-20250620185254962 branch from 1a7e306 to 15922e4 Compare June 22, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants