XiaoDaiGua-Ray 22dfe441e0
feat(layout): add a composable workspace designer
Add layout registration, visual editing, and source generation.

Preserve embedded pages and wait for asynchronous layout renderers.

Add workspace lint and formatting commands.
2026-12-01 17:34:27 +08:00

23 lines
5.1 KiB
Markdown

# Workspaces, type checking, builds, and CI
Use this topic for dependencies, public exports, aliases, auto-imports, production builds, or deployment configuration. Runtime requirements come from [.nvmrc](../../.nvmrc) and the [root manifest](../../package.json).
| Question | Read first | Follow through |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Workspace and dependency boundaries | [pnpm workspace](../../pnpm-workspace.yaml), [lockfile](../../pnpm-lock.yaml), [workspace ownership](../../docs/architecture.md#workspaces) | [Package-boundary check](../../scripts/check-package-boundaries.mjs), [environment check](../../scripts/doctor.mjs) |
| Path aliases, type checking, and auto-imports | [TypeScript project graph](../../docs/architecture.md#typescript-project-configuration), [shared configuration](../../tsconfig.base.json), [Vite aliases](../../vite.custom.config.ts) | [Plugin configuration](../../vite.plugin.config.ts), [generated declarations](../../unplugin), [Vitest configuration](../../vitest.config.ts) |
| Build entry points, deployment base, and SEO | [Application Vite configuration](../../vite.config.ts), [deployment configuration](../../vite.custom.config.ts), [site metadata](../../vite-helper/site-seo.ts) | [Documentation configuration](../../apps/docs/.vitepress/config.mts), [artifact assembly](../../scripts/assemble-pages.mjs), [deployment conventions](../../docs/architecture.md#deployment-and-search-discovery) |
| CI, container images, and release artifacts | [GitHub Actions](../../.github/workflows/ci.yaml), [Dockerfile](../../Dockerfile), [Compose](../../docker-compose.yml) | [Full verification workflow](../../harness/README.md), [toolchain history](../../docs/toolchain-upgrade.md) |
Each workspace's `package.json#exports` defines its public exports. Compare Vite, TypeScript, and Vitest resolution when changing aliases. Update generated declarations through configuration. When publishing the combined site, check both the admin and documentation bases.
Run `pnpm test:<suite>` from the root for a single suite under `__test__`, such as `pnpm test:hooks`. `pnpm test:utils` runs the utility suites together. `pnpm test:all` runs all Vitest tests once. Use `pnpm test:run <path>` for an individual test file.
`pnpm lint` checks resolved `@deprecated` usages in TypeScript, TSX, JavaScript scripts, and Vue script blocks. ESLint uses the existing workspace TypeScript projects and the [script lint project](../../tsconfig.eslint-scripts.json). Use `void 0` for runtime values and `undefined` in type annotations.
Run `pnpm lint:fix` for ESLint autofixes across the workspace. Use `pnpm lint:fix <file> [...]` to limit fixes to existing individual files. In file mode, the command rejects directories and patterns. The commit hook passes staged code files to the same fixer. The local rule fixes reads of the built-in runtime value. Type positions keep `undefined`. Rename shadowing bindings by hand. [ESLint rule](../../scripts/eslint-rules/no-undefined.mjs)
`pnpm fix` runs ESLint followed by Prettier across the workspace. Use `pnpm <workspace>:fix` for a single workspace, `pnpm packages:fix` for all shared packages, or `pnpm fix <directory>` for a specific directory. Run `pnpm format:fix` for Prettier alone, including Markdown and JSON. The combined command returns a nonzero status if ESLint still reports errors or warnings after the fixes. [Root scripts](../../package.json)
Targeted verification: `pnpm harness verify toolchain` runs package-boundary and type checks. For changes to dependencies, public exports, or build configuration, run `pnpm harness verify all` once at completion using the [verification scope](../README.md#choosing-the-verification-scope). Preview affected entry points when build artifacts or deployment paths change. Toolchain prose alone does not trigger these runtime checks. Passing targeted checks does not prove CI, Docker, or production publication succeeded.