Skip to content

[BREAKINGCHANGE] update design-tokens CJS output and verbatimModuleSyntax imports - #300

Merged
jgbernalp merged 1 commit into
perses:ui-customizationfrom
zhuje:fix/design-tokens-cjs-and-type-imports
Sep 17, 2026
Merged

jgbernalp merged 1 commit into
perses:ui-customizationfrom
zhuje:fix/design-tokens-cjs-and-type-imports

Conversation

@zhuje

@zhuje zhuje commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • design-tokens still had a build:cjs script pointing at .cjs.swcrc, which was deleted in [BREAKINGCHANGE] Upgrade to Node 24 (LTS) and remove CommonJS [BREAKINGCHANGE] Upgrade to Node 24 (LTS) and remove CommonJS #248's Node 24/CommonJS-removal migration for every other package. This broke npm run build for the whole workspace. Removed the CJS output/exports/main reference so design-tokens matches the rest of the monorepo.
  • Fixed 28 pre-existing verbatimModuleSyntax TypeScript errors across 9 files in components by splitting mixed value/type imports from react into separate import / import type statements, matching the codebase convention.
  • Regenerated package-lock.json, which had been corrupted by an npm 10.x bug (67 missing package entries, plus an incorrect darwin-only OS restriction on web-worker that broke Linux CI installs). Also added the missing "type": "module" to design-tokens/package.json (it was the only workspace without it, which broke its Vitest config loading) and fixed the remaining mixed value/type imports in design-tokens and 6 more components files that the original verbatimModuleSyntax fix missed.

@zhuje
zhuje requested a review from a team as a code owner September 16, 2026 19:16
@zhuje
zhuje force-pushed the fix/design-tokens-cjs-and-type-imports branch from d575458 to 5195064 Compare September 16, 2026 19:51
… and remove CommonJS

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
@zhuje
zhuje force-pushed the fix/design-tokens-cjs-and-type-imports branch from 5195064 to 54c1dc7 Compare September 16, 2026 19:53
@zhuje zhuje changed the title fix(build): design-tokens CJS output and verbatimModuleSyntax imports [BREAKINGCHANGE] design-tokens CJS output and verbatimModuleSyntax imports Sep 16, 2026
@zhuje
zhuje changed the base branch from ui-customization to main September 16, 2026 20:05
@zhuje
zhuje changed the base branch from main to ui-customization September 16, 2026 20:07
@zhuje
zhuje force-pushed the fix/design-tokens-cjs-and-type-imports branch from 09c0869 to 54c1dc7 Compare September 16, 2026 20:37
@zhuje zhuje changed the title [BREAKINGCHANGE] design-tokens CJS output and verbatimModuleSyntax imports [BREAKINGCHANGE] update design-tokens CJS output and verbatimModuleSyntax imports Sep 16, 2026
@jgbernalp
jgbernalp merged commit dcb031e into perses:ui-customization Sep 17, 2026
23 checks passed
zhuje added a commit to zhuje/shared that referenced this pull request Sep 17, 2026
… and remove CommonJS (perses#300)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
zhuje added a commit to zhuje/shared that referenced this pull request Sep 22, 2026
… and remove CommonJS (perses#300)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
zhuje added a commit that referenced this pull request Sep 23, 2026
… and remove CommonJS (#300)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
jgbernalp pushed a commit that referenced this pull request Oct 13, 2026
… and remove CommonJS (#300)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
jgbernalp added a commit that referenced this pull request Oct 13, 2026
* [FEATURE] create @perses-dev/design-tokens package (#198)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [FEATURE] UI Customization. Add next component directory with Button and Alert primitives (#213)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [FEATURE] UI Customization: Component Provider  (#241)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [BREAKINGCHANGE] Update files to align with PR#248 Upgrade to Node 24 and remove CommonJS (#300)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] UI Customization. Update package-lock.json for to align with Node updates

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Regenerate package-lock.json after rebase onto main

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [FEATURE] UI Customization. Add Divider primitive (#318)

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [FEATURE] UI customization. Add Box primitive component

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Update package.json so design-tokens are a dependency

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Address comments. Move spacing functions to their own file. Update Box.tsx, Box.test.tsx and Box.stories.tsx to improve how props are checked and applied

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Update package-lock.json after rebase onto ui-customization

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE]  Use CSS classes for Box spacing

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [FEATURE] Add Box primitive component

  Add a reusable Box primitive with token-based padding, margin, gap,
  and common layout props.

  Add reusable spacing utility styles and responsive spacing support
  through shared primitive system utilities.

  Add Box stories and focused tests.

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Address comments
 - Exported the shared responsive stylesheet from @perses-dev/components.
 - Renamed responsive CSS variables from --ps-box-* to generic --ps-
    responsive-*, so the responsive utility can be reused by future layout
    primitives.
- Updated the responsive stylesheet and Box test to use the new variable
    names.
- Simplified spacing CSS by removing intermediate --ps-spacing-value-*
    variables and referencing Perses spacing tokens directly.

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] Guard Object.entries against undefined in responsive helpers

Addresses react-doctor no-object-keys-values-entries-on-maybe-undefined
(#352 (comment)).
The value is already narrowed by isResponsiveValue, but the linter does
not follow custom type guards, so add a `?? {}` fallback.

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* [IGNORE] remove unnecessary coalescing

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* [IGNORE] categorize properties for reuse, add story Sample helper, refactor box stories

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* [IGNORE] remove oxlint ignore

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* [IGNORE] regenerate package-lock.json

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* [IGNORE] adjust sample to include code snippets

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* [IGNORE] fix lint error

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

---------

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
Co-authored-by: Gabriel Bernal <gbernal@redhat.com>
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.

2 participants