Skip to content

Commit b117bf6

Browse files
committed
chore: untrack generated CSS
1 parent e6a2cab commit b117bf6

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.cache
22
.DS_Store
33
.eslintcache
4+
.generated
45
.idea
56
*.log
67
*.tgz

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The `pnpm test` script intentionally runs `build` first so `tsnapi` snapshots co
3434

3535
`pnpm typecheck` runs `scripts/verify-typecheck-coverage.ts` first - it fails the command (and CI, since CI just runs `pnpm typecheck`) if any workspace package has a `tsconfig.json` but no `typecheck` script, so a new package can't silently join the same blind spot. A package that genuinely can't typecheck yet needs a documented exception in that script, not a missing script.
3636

37+
Ahead-of-time build artifacts that live under `src/` - the shadow-root stylesheets in `packages/hub-ui/src/client/.generated/` and `packages/json-render-ui/src/.generated/` - are **generated, not committed** (`.generated` is gitignored). Each owning package builds its own with `pnpm run build:css`, and three things guarantee the file is on disk before anything imports it: the root `postinstall` runs `turbo run build:css`, the Turbo `typecheck` task depends on both `build:css` tasks, and each package's `build` script chains `build:css` first. A new generated-under-`src` artifact follows the same shape - its own build script, declared `outputs` in `turbo.json`, and a `typecheck` dependency - rather than being checked in, since a minified single-line blob conflicts on every concurrent edit.
38+
3739
`pnpm knip` finds unused files, dependencies, and exports across every workspace (config in `knip.jsonc`). It runs against source directly - no prior build needed. Most workspaces need no configuration; `knip.jsonc` only carries per-workspace overrides for cases knip's defaults can't infer on their own: a package's non-`index.ts` `exports` subpaths (knip's package.json→`dist`→`src` source mapping needs a workspace `tsconfig.json` `outDir`, which conflicts with this repo's cross-workspace `src/*.ts` imports, so multi-entry packages list their `exports`-mapped entry files explicitly instead - keep that list in sync with each `tsdown.config.ts`), config files knip's plugins don't discover in a nested location (a Next.js app rooted below the workspace root, `storybook-solidjs-vite` not matching the Storybook plugin trigger), and dependencies referenced dynamically outside its static import graph (icon collections consumed by UnoCSS at build time, plugin packages loaded via a runtime `import()` string). Prefer fixing the underlying gap or a scoped `ignoreDependencies`/`entry` override over a blanket `ignore`.
3840

3941
## Conventions

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"bugs": "https://github.com/devframes/devframe/issues",
1616
"scripts": {
1717
"build": "turbo run build --concurrency=3",
18+
"build:css": "turbo run build:css",
1819
"ci:build": "tsx scripts/ci-retry.ts pnpm run build",
1920
"watch": "turbo watch build --concurrency=3",
2021
"play": "tsx scripts/play.ts",
@@ -33,7 +34,7 @@
3334
"release": "bumpp -r",
3435
"typecheck": "pnpm run verify:typecheck-coverage && turbo run typecheck",
3536
"verify:typecheck-coverage": "tsx scripts/verify-typecheck-coverage.ts",
36-
"postinstall": "npx simple-git-hooks && skills-npm"
37+
"postinstall": "npx simple-git-hooks && skills-npm && pnpm run build:css"
3738
},
3839
"devDependencies": {
3940
"@antfu/design": "catalog:frontend",

packages/hub-ui/src/client/.generated/css.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/json-render-ui/src/.generated/css.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

turbo.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
"globalDependencies": ["pnpm-lock.yaml", "tsconfig.base.json"],
44
"tasks": {
55
"typecheck": {
6-
"dependsOn": ["^typecheck"]
6+
"dependsOn": ["^typecheck", "@devframes/hub-ui#build:css", "@devframes/json-render-ui#build:css"]
7+
},
8+
"@devframes/hub-ui#build:css": {
9+
"outputLogs": "new-only",
10+
"outputs": ["src/client/.generated/**"]
11+
},
12+
"@devframes/json-render-ui#build:css": {
13+
"outputLogs": "new-only",
14+
"outputs": ["src/.generated/**"]
715
},
816
"devframe#build": {
917
"outputLogs": "new-only",

0 commit comments

Comments
 (0)