Skip to content

Use rimraf in openui-cli template build script#627

Merged
vishxrad merged 2 commits into
thesysdev:mainfrom
lesbass:fix/use-rimraf-in-cli-build
Jun 10, 2026
Merged

Use rimraf in openui-cli template build script#627
vishxrad merged 2 commits into
thesysdev:mainfrom
lesbass:fix/use-rimraf-in-cli-build

Conversation

@lesbass

@lesbass lesbass commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces fs.rmSync with rimrafSync in packages/openui-cli/scripts/build-templates.js for consistency with the react-ui and browser-bundle packages, which already use rimraf.

Fixes #625

Changes

  • packages/openui-cli/package.json: Added rimraf (^5.0.7) as a dev dependency, matching the version used by react-ui and browser-bundle.
  • packages/openui-cli/scripts/build-templates.js: Replaced fs.rmSync(destDir, { recursive: true, force: true }) with rimrafSync(destDir). Template copy behavior is preserved.

Verification

pnpm install --filter @openuidev/cli
pnpm --filter @openuidev/cli build

Build succeeds and the template output at dist/templates/openui-chat is created correctly.

Note: The pnpm-lock.yaml will need to be regenerated with the project's pinned pnpm version. I excluded it from this PR to avoid unrelated lockfile churn from pnpm version differences.

Replace fs.rmSync with rimrafSync in build-templates.js for
consistency with react-ui and browser-bundle packages.

Fixes #625
vishxrad
vishxrad previously approved these changes Jun 10, 2026

@vishxrad vishxrad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. CI is failing because pnpm-lock.yaml is out of date. Could you regenerate it using the build workflow’s pinned pnpm version (9.0.6), commit it, and push the update?

@vishxrad vishxrad merged commit 6d58ff3 into thesysdev:main Jun 10, 2026
1 check passed
ankit-thesys added a commit that referenced this pull request Jun 10, 2026
….0.8

Version bumps for the first publish since 2026-05-20 (4b663b9):

- @openuidev/react-ui 0.11.8 -> 0.12.0 (minor): component CSS now ships
  in `@layer openui` (#589/#621) and react-syntax-highlighter moved to
  ^16.1.1 (#577, fixes prismjs CVE-2024-53382)
- @openuidev/lang-core 0.2.5 -> 0.2.6 (patch): parser preserves markdown
  fences and comments inside string props (#605)
- @openuidev/cli 0.0.7 -> 0.0.8 (patch): cross-platform template build
  (#601, #627); no functional changes to the published CLI

Remaining packages have no consumer-visible changes since the last
publish and are not republished; the lang wrappers pick up lang-core
0.2.6 transitively via their ^0.2.5 ranges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ankit-thesys added a commit that referenced this pull request Jun 16, 2026
* chore(release): bump react-ui to 0.12.0, lang-core to 0.2.6, cli to 0.0.8

Version bumps for the first publish since 2026-05-20 (4b663b9):

- @openuidev/react-ui 0.11.8 -> 0.12.0 (minor): component CSS now ships
  in `@layer openui` (#589/#621) and react-syntax-highlighter moved to
  ^16.1.1 (#577, fixes prismjs CVE-2024-53382)
- @openuidev/lang-core 0.2.5 -> 0.2.6 (patch): parser preserves markdown
  fences and comments inside string props (#605)
- @openuidev/cli 0.0.7 -> 0.0.8 (patch): cross-platform template build
  (#601, #627); no functional changes to the published CLI

Remaining packages have no consumer-visible changes since the last
publish and are not republished; the lang wrappers pick up lang-core
0.2.6 transitively via their ^0.2.5 ranges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(react-ui): strip leading BOM before wrapping CSS in @layer openui

Sass emits a UTF-8 BOM for compressed output containing non-ASCII
characters. At byte 0 the CSS decoder strips it, but wrapInLayer()
concatenated the layer prelude in front of it, pushing the BOM inside
the block where U+FEFF parses as an identifier: `:root` becomes a
type selector that matches nothing, silently killing the first rule.

In the packed 0.12.0 tarball this dropped the entire :root theme-token
block of dist/components/index.css (and the first rule of
dist/styles/index.css and markDownRenderer.css). Verified in Chrome:
the BOM-poisoned rule does not apply; subsequent rules are unaffected.

Strip the BOM before wrapping. Repacked tarball now has 0 BOMs across
all 171 shipped CSS files and the :root block parses correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(react-ui): strip leading BOM from unlayered default CSS

The opt-in re-land (#631) only strips the BOM when wrapping the layered
mirror, so Sass's compressed-mode BOM leaked into the unlayered defaults
(components.css, styles/index.css, markDownRenderer.css). A leading BOM is
harmless to browsers but breaks the package's zero-BOM contract and would
become fatal if those files were ever wrapped. cp-css.js now strips it from
the unlayered output, and check-css-artifacts.js asserts the unlayered
exports are BOM-free too (the guard previously only checked the layered mirror).

Root cause is on main (#631's cp-css.js) — flagged for a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

Use rimraf in openui-cli template build script

2 participants