Skip to content

chore: split create-files.mjs into icons.mjs and barrels.mjs, as pnpm generate - #992

Open
aklkv wants to merge 1 commit into
refactor/charts-barrelfrom
chore/split-create-files
Open

aklkv wants to merge 1 commit into
refactor/charts-barrelfrom
chore/split-create-files

Conversation

@aklkv

@aklkv aklkv commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #991 (on #990, #988, #987 and #986): merge those first, then retarget this to main.

create-files.mjs did two unrelated jobs, so it's split in two:

  • scripts/icons.mjs writes an Ember component for each @carbon/icons icon into src/components/icons/, and their module declarations into unpublished-development-types/carbon-icons.d.ts.
  • scripts/barrels.mjs writes the four barrels: src/components.ts, src/ai-chat.ts, src/charts.ts and src/icons.ts.

The scripts that write source files now share a generate prefix, apart from build, which writes dist/:

Before After
create-autogenerated-files generate (runs generate:icons, then generate:barrels)
create-skill-references (scripts/create-skill-references.mjs) generate:skill-references (scripts/skill-references.mjs)

CI, prepack, AGENTS.md, CONTRIBUTING.md and the parity agent's prompt use the new names.

The icon barrel now goes through the same writeBarrel as the others, in place of its own copy of the naming code, and gains the duplicate-name check. barrels.mjs fails, rather than writing an empty icon barrel, if it runs before icons.mjs.

Verified

Running the old and new scripts gives byte-for-byte the same output: the four barrels, the type declarations and all 2,760 icon files.

@aklkv aklkv added the internal label Oct 11, 2026
@aklkv aklkv self-assigned this Oct 11, 2026
@aklkv
aklkv requested a review from patricklx October 11, 2026 22:14
…m generate`

create-files.mjs did two unrelated jobs. icons.mjs now writes the icon
components from @carbon/icons and their module declarations; barrels.mjs
writes the four barrels (components, ai-chat, charts and icons).

The scripts that write source files share a `generate` prefix, apart
from `build`, which writes dist/:

- `generate` runs `generate:icons`, then `generate:barrels` (was
  `create-autogenerated-files`)
- `generate:skill-references` (was `create-skill-references`; the script
  is now scripts/skill-references.mjs)

CI, prepack, AGENTS.md, CONTRIBUTING.md and the parity agent's prompt use
the new names.

The icon barrel now goes through the same writeBarrel as the others, in
place of its own copy of the naming code, and gains the duplicate-name
check. All the generated files are byte-for-byte the same as before.
barrels.mjs fails, rather than writing an empty icon barrel, if it runs
before icons.mjs.

Signed-off-by: Alexey Kulakov <uni_que@me.com>
@aklkv
aklkv force-pushed the chore/split-create-files branch from 4ef2c0e to 9245b8e Compare October 11, 2026 22:32
@aklkv aklkv changed the title chore: split create-files.mjs into icons.mjs and barrels.mjs chore: split create-files.mjs into icons.mjs and barrels.mjs, as pnpm generate Oct 11, 2026
@aklkv
aklkv added this pull request to stack #989 October 11, 2026 22:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants