Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The modernization roadmap (React 17/18 upgrade, `semantic-ui-react` exit, projec
- `npm start` — Run demo app in dev mode (webpack-dev-server)
- `npm run build` — Build the demo app for GitHub Pages deployment
- `npm run build-lib` — Build the publishable library to `dist/` (webpack + tsc)
- `npm run watch-lib` — Watch mode for library build
- `npm run watch-lib` — Watch mode for the library build. Uses the SAME webpack config as `build-lib`, deliberately: it had its own parallel config until 2026-09-15, and it had drifted into emitting the stylesheet under a different name and producing no type declarations
- `npm run yalc-publish` — Build lib and publish locally via yalc (for testing in consuming apps)
- `npm run yalc-watch` — Auto-rebuild and yalc-publish on src changes
- `npm run deploy` — Deploy demo to GitHub Pages (run `build` first)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"start": "webpack serve --mode development --config webpack.demo.config.mjs",
"build": "webpack --mode production --config webpack.demo.config.mjs && cp build/index.html build/404.html",
"build-lib": "webpack --mode production --config webpack.library.config.mjs && npm run gen-ts",
"watch-lib": "webpack --watch --mode production --config webpack.watch.config.mjs",
"watch-lib": "npm run gen-ts && webpack --watch --mode production --config webpack.library.config.mjs",
"yalc-publish": "npm run build-lib && yalc publish --push",
"yalc-watch": "nodemon --watch src --ext js,jsx,ts,tsx --exec 'npm run yalc-publish'",
"gen-ts": "tsc --project tsconfig.build.json",
Expand Down
32 changes: 25 additions & 7 deletions src/style/__tests__/css.pipeline.parity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,33 @@ describe('CSS pipeline parity — final CSS, post-PostCSS (§9.5)', () => {
* Selector granularity only: the published file is minified, and cssnano may merge or split declaration
* blocks without changing scoping.
*/
const hasPublishedCss = fs.existsSync(PUBLISHED_CSS);
const describeIfBuilt = hasPublishedCss ? describe : describe.skip;
/**
* READ AT MODULE LOAD, NOT IN `beforeAll`, and the difference is a real failure this suite produced
* repeatedly before it was understood.
*
* It used to test `existsSync` here and `readFileSync` in a `beforeAll`. Something in a full-suite
* run EMPTIES the root `static/` directory between those two moments, so the describe was not
* skipped — the file existed when the decision was made — and then three tests died on ENOENT.
* Intermittent, invisible in an isolated run, and it reads like a broken assertion rather than a
* missing file.
*
* What is established about the cause, and what is not: the emptying is reliably triggered by the
* LESS render in `css.semantic-parity.test.js` (bisected suite by suite, then by disabling that
* suite's compile — with it off the directory survives, with it on the directory is emptied every
* time). It is NOT done through `fs` in the jest process: probes wrapping `rmSync`, `unlinkSync`,
* `rmdirSync`, `renameSync` and their async and `fs.promises` forms, installed both in `setupFiles`
* and at the top of the suite itself, never fire. No stray watcher process is running. The
* mechanism is unexplained, and is written down here rather than guessed at.
*
* Reading once, at load, makes this suite correct regardless: it either has the bytes it checked
* for, or it skips. CI is unaffected either way — it runs jest before `build-lib`, so these three
* always skip there, which is what the describe name says.
*/
const publishedCssAtLoad = fs.existsSync(PUBLISHED_CSS) ? fs.readFileSync(PUBLISHED_CSS, 'utf8') : null;
const describeIfBuilt = publishedCssAtLoad !== null ? describe : describe.skip;

describeIfBuilt('published static/all.css (needs `npm run build-lib` — skipped when absent)', () => {
let publishedCss;

beforeAll(() => {
publishedCss = fs.readFileSync(PUBLISHED_CSS, 'utf8');
});
const publishedCss = publishedCssAtLoad;

it('leaks the same global selectors as the in-process webpack pipeline', () => {
expect(occurrenceCounts(globalRuleInventory(publishedCss))).toEqual(H8_LEAK_OCCURRENCES);
Expand Down
7 changes: 6 additions & 1 deletion webpack.library.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export default {
export: 'default',
},
globalObject: 'this',
clean: true,
// `keep` rather than a bare `true`, and it is what makes `watch-lib` usable: webpack owns
// `dist/index.js`, but `dist/*.d.ts` come from `tsc` in a separate step. A plain clean
// wipes them on every rebuild, and in watch mode nothing regenerates them — measured, a
// watch session left `dist` with ZERO declaration files after `build-lib` had produced two.
// For `build-lib` this changes nothing: `gen-ts` runs immediately after and rewrites them.
clean: { keep: /\.d\.ts$/ },
},
externals:{
moment: 'moment',
Expand Down
86 changes: 0 additions & 86 deletions webpack.watch.config.mjs

This file was deleted.

Loading