mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
* feat(guard): catch @ts-nocheck files with unresolved relative imports `// @ts-nocheck` disables all type checking for a file, including TS2307 "Cannot find module". That silently hides broken relative imports: a barrel move or file rename can leave a @ts-nocheck module importing a path that no longer resolves, and `pnpm typecheck` stays green while the module fails to load at runtime. tsc also never verifies the specifier of a dynamic import() even in a fully-checked file. Add a guard check (wired into `pnpm guard` and its unit-test list) that re-establishes the one guarantee @ts-nocheck removes: every relative import / export-from / import-type / dynamic import() specifier in a @ts-nocheck TypeScript source must resolve to a real module on disk. NodeNext .js -> .ts mapping, extensionless directory-index barrels, and asset extensions are all handled; string literals in comments/expressions are ignored (AST-based). Clean on the current tree: 33 @ts-nocheck files, 0 violations. * fix(guard): resolve .mjs/.cjs imports extension-specifically Review follow-up (#5164): resolvesRelativeSpecifier mapped .js/.mjs/.cjs to one broad candidate list, so `import './x.mjs'` passed whenever `x.ts` existed and `./x.cjs` whenever `x.ts`/`x.mts` existed — but NodeNext emits .mjs only from .mts and .cjs only from .cts (a same-basename .ts emits .js), so those imports fail at runtime. That was a false negative in the guard's core promise. Split candidates by requested JS extension: .js -> [.ts,.tsx,.js,.jsx], .jsx -> [.tsx,.jsx], .mjs -> [.mts,.mjs], .cjs -> [.cts,.cjs]. Add fixture assertions for the accepted matches and the rejected .mjs/.cjs mismatches. --------- Co-authored-by: LA <la@LAs-MacBook-Pro.lan>
69 lines
2.8 KiB
JSON
69 lines
2.8 KiB
JSON
{
|
|
"name": "open-design",
|
|
"version": "0.14.2",
|
|
"private": true,
|
|
"packageManager": "pnpm@10.33.2",
|
|
"type": "module",
|
|
"description": "Local-first design product: detects your installed code-agent CLI, runs design skills + design systems, streams artifacts into a sandboxed preview.",
|
|
"license": "Apache-2.0",
|
|
"bin": {
|
|
"od": "./apps/daemon/bin/od.mjs"
|
|
},
|
|
"scripts": {
|
|
"postinstall": "node ./scripts/postinstall.mjs",
|
|
"tools-dev": "pnpm exec tools-dev",
|
|
"tools-pack": "pnpm exec tools-pack",
|
|
"tools-release": "pnpm exec tools-release",
|
|
"tools-serve": "pnpm exec tools-serve",
|
|
"nix:update-hash": "node --experimental-strip-types ./scripts/update-nix-pnpm-deps-hash.ts",
|
|
"guard": "tsx ./scripts/guard.ts && node --import tsx --test scripts/style-policy.test.ts scripts/product-neutrality.test.ts scripts/web-import-isolation.test.ts scripts/check-cross-app-imports.test.ts scripts/check-ts-nocheck-imports.test.ts scripts/approve-fork-pr-workflows.test.ts scripts/lint-craft-references.test.ts scripts/check-design-system-manifests.test.ts scripts/check-plugin-preview-manifest.test.ts",
|
|
"lint:craft": "tsx ./scripts/lint-craft-references.ts",
|
|
"i18n:check": "tsx ./scripts/i18n-check.ts",
|
|
"i18n:coverage": "tsx ./scripts/i18n-coverage-report.ts",
|
|
"sync:community-pets": "node --experimental-strip-types scripts/sync-community-pets.ts",
|
|
"bake:community-pets": "node --experimental-strip-types scripts/bake-community-pets.ts",
|
|
"seed:test-projects": "node --experimental-strip-types scripts/seed-test-projects.ts",
|
|
"seed:curated-design-skills": "node --experimental-strip-types scripts/seed-curated-design-skills.ts",
|
|
"backfill:failed-runs": "node --experimental-strip-types scripts/backfill-failed-runs-with-artifacts.ts",
|
|
"typecheck": "pnpm -r --workspace-concurrency=4 --if-present run typecheck && tsc -p scripts/tsconfig.json --noEmit"
|
|
},
|
|
"devDependencies": {
|
|
"@open-design/components": "workspace:*",
|
|
"@open-design/daemon": "workspace:*",
|
|
"@open-design/tools-dev": "workspace:*",
|
|
"@open-design/tools-pack": "workspace:*",
|
|
"@open-design/tools-release": "workspace:*",
|
|
"@open-design/tools-serve": "workspace:*",
|
|
"@types/node": "20.19.39",
|
|
"tsx": "4.22.3",
|
|
"typescript": "5.9.3"
|
|
},
|
|
"engines": {
|
|
"node": "~24",
|
|
"pnpm": ">=10.33.2 <11"
|
|
},
|
|
"pnpm": {
|
|
"overrides": {
|
|
"brace-expansion": "5.0.6",
|
|
"devalue": "5.8.1",
|
|
"fast-uri": "3.1.2",
|
|
"hono": "4.12.19",
|
|
"ip-address": "10.2.0",
|
|
"postcss": "8.5.15",
|
|
"protobufjs": "8.4.0",
|
|
"qs": "6.15.2",
|
|
"tmp": "0.2.7",
|
|
"yaml": "2.9.0"
|
|
},
|
|
"onlyBuiltDependencies": [
|
|
"better-sqlite3",
|
|
"core-js",
|
|
"electron",
|
|
"electron-winstaller",
|
|
"esbuild",
|
|
"protobufjs",
|
|
"sharp"
|
|
]
|
|
}
|
|
}
|