fa008b4728
## What We have unified the unit + integration test, lint, and typecheck configuration across `packages/twenty-apps/internal` and `packages/twenty-apps/public`. This PR updates the `create-twenty-app` scaffolded project template so a freshly generated app complies with that same setup. ### Scaffold template changes (`packages/create-twenty-app/src/constants/template/`) - **`package.json`**: add `typecheck` (`tsgo --noEmit -p tsconfig.spec.json`) and `test:unit` scripts; add `@typescript/native-preview` + `vite-tsconfig-paths` devDeps; bump `vitest` → `^4.0.0` and `packageManager` → `yarn@4.13.0`. - **`vitest.config.ts`**: resolve path aliases via the `vite-tsconfig-paths` plugin (matching the unified apps) instead of the ad-hoc `resolve.tsconfigPaths`. - **`vitest.unit.config.ts`** (new): unit test config targeting `src/**/*.test.ts`, identical to existing apps. - **`tsconfig.json`**: `moduleResolution: node → bundler`, `target: es2018 → es2020`. - **`src/__tests__/application-config.test.ts`** (new): a sample unit test so a fresh scaffold's `test:unit` passes out of the box. - **`.github/workflows/ci.yml`**: run Lint → Typecheck → Unit tests alongside the integration tests, mirroring the central `ci-twenty-apps.yaml` pipeline. - **`README.md`**: document the new `lint` / `typecheck` / `test:unit` commands. ### CLI package changes - **`tsconfig.json` / `tsconfig.lib.json`**: exclude the new `template/vitest.unit.config.ts` from the CLI's own typecheck/build (just like the existing `vitest.config.ts` exclusion) — its `vitest` / `vite-tsconfig-paths` imports aren't deps of the CLI package. ## Notes - The template's committed `yarn.lock` is an intentional empty seed; the scaffold runs `yarn install` at creation time, so the new deps regenerate cleanly — no lockfile change needed. - The sample unit test asserts `typeof APP_DESCRIPTION === 'string'` (not truthiness) because the description is optional at scaffold time and can be empty. https://claude.ai/code/session_01XiJpkiQG3TiDjKncx2XSQq --- _Generated by [Claude Code](https://claude.ai/code/session_01XiJpkiQG3TiDjKncx2XSQq)_ <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22128?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
34 lines
795 B
JSON
34 lines
795 B
JSON
{
|
|
"extends": "../../tsconfig.base.json",
|
|
"compilerOptions": {
|
|
"allowJs": false,
|
|
"esModuleInterop": false,
|
|
"allowSyntheticDefaultImports": true,
|
|
"strictNullChecks": true,
|
|
"alwaysStrict": true,
|
|
"noImplicitAny": true,
|
|
"strictBindCallApply": false,
|
|
"noEmit": true,
|
|
"types": ["jest", "node"],
|
|
"paths": {
|
|
"@/*": ["./src/*"],
|
|
"package.json": ["./package.json"]
|
|
},
|
|
"jsx": "react"
|
|
},
|
|
"include": [
|
|
"src/**/*.ts",
|
|
"src/**/*.tsx",
|
|
"src/**/*.d.ts",
|
|
"**/__mocks__/**/*",
|
|
"vite.config.ts",
|
|
"jest.config.mjs"
|
|
],
|
|
"exclude": [
|
|
"src/constants/template/vitest.config.ts",
|
|
"src/constants/template/vitest.unit.config.ts",
|
|
"src/constants/template/src/**",
|
|
"src/constants/template/tsconfig.spec.json"
|
|
]
|
|
}
|