Skip to content

Feat/barrel import contract#268

Open
mhewson wants to merge 8 commits intonextfrom
feat/barrel-import-contract
Open

Feat/barrel import contract#268
mhewson wants to merge 8 commits intonextfrom
feat/barrel-import-contract

Conversation

@mhewson
Copy link
Copy Markdown
Member

@mhewson mhewson commented Apr 21, 2026

No description provided.

mhewson added 3 commits April 20, 2026 17:04
- Remove all future-state sections (TokenDictionary, Barrel) from consumer docs
- Simplify maturity note to reflect current production-ready APIs
- Align Storybook and markdown documentation for consistency
- Remove legacy .d.mts migration section from Storybook guide
- Focus docs on theme-scoped module imports currently available
- remove legacy cdr-tokens.d.mts generation and exports
- make /types and /docsite/types type-only entrypoints
- generate and validate NodeNext-compatible barrel declarations
- align ADR, consumer docs, and Storybook guidance for type vs runtime imports
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR formalizes a stable, theme-scoped TypeScript “barrel import” contract for token consumers by generating /types entrypoints, updating package exports accordingly, and removing the legacy monolithic cdr-tokens.d.mts declaration output.

Changes:

  • Add a Style Dictionary action to generate dist/<theme>/types/index.d.ts (+ index.mjs) barrels and run it as part of the types platform build.
  • Update package.json exports to introduce ./types and ./docsite/types, and remove legacy cdr-tokens.d.mts outputs/validation entries.
  • Add consumer-facing documentation + Storybook guide describing the new TypeScript contract and migration direction.

Reviewed changes

Copilot reviewed 10 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
validate-structure.json Updates expected dist structure: removes legacy .d.mts and adds new /types/index.* barrels.
style-dictionary/configs/types.ts Runs the new generate-types-barrel action for the types platform.
style-dictionary/configs/js.ts Stops generating the legacy root cdr-tokens.d.mts declaration file.
style-dictionary/build.ts Registers the new generate-types-barrel Style Dictionary action.
style-dictionary/actions/generate-types-barrel.ts Implements generation of index.d.ts/index.mjs barrels by globbing built outputs.
package.json Adds ./types and ./docsite/types export entrypoints; removes root/runtime types wiring.
docs/CONSUMER_TYPESCRIPT_CONTRACT.md Adds canonical docs describing the supported TypeScript consumer API surface.
stories/ConsumerTypeScriptContract.stories.ts Adds Storybook page documenting the consumer TypeScript contract with examples.
adr/0002-typescript-pipeline-and-consumer-types.md Adds ADR capturing the architecture, public API, and deprecation direction.
README.md Links the new consumer contract doc + ADR.
dist/rei-dot-com/types/index.d.ts / index.mjs Adds generated rei-dot-com type barrels.
dist/docsite/types/index.d.ts / index.mjs Adds generated docsite type barrels.
dist/*/js/cdr-tokens.d.mts Removes legacy monolithic TS declaration outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread style-dictionary/actions/generate-types-barrel.ts
mhewson added 4 commits April 21, 2026 09:39
- generate cdr-tokens.d.ts for rei-dot-com and docsite runtime bundles
- wire exports['.'] and exports['./docsite'] types metadata
- restore top-level package types field for runtime consumers
- refresh validate-structure snapshot for new declaration outputs
- add ticket draft for .d.mts declaration migration work
- link follow-up ticket from ADR 0002 future direction
- link follow-up ticket from Storybook consumer contract guide
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 26 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread style-dictionary/filters/foundations/breakpoint-tokens.ts Outdated
Comment thread style-dictionary/filters/foundations/breakpoint-tokens.test.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 26 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread stories/ConsumerTypeScriptContract.stories.ts
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.

4 participants