@warlock.js/core 5.34.3 → 5.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/esm/cli/cli-commands.manager.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/add.command.mjs +1 -0
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/build.command.mjs +30 -3
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +1 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
- package/esm/cli/commands/check.command.mjs +5 -0
- package/esm/cli/commands/check.command.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +21 -0
- package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain.command.mjs +14 -4
- package/esm/cli/commands/explain.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generate.command.mjs +19 -1
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/web.generator.mjs +169 -0
- package/esm/cli/commands/generate/generators/web.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/web-stubs.mjs +231 -0
- package/esm/cli/commands/generate/templates/web-stubs.mjs.map +1 -0
- package/esm/cli/commands/inspect/inspect-command.action.mjs +4 -3
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- package/esm/cli/commands/inspect.command.mjs +13 -8
- package/esm/cli/commands/inspect.command.mjs.map +1 -1
- package/esm/cli/commands/mcp/mcp-command.action.mjs +1 -1
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +2 -0
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/load-config-files.mjs +4 -0
- package/esm/config/load-config-files.mjs.map +1 -1
- package/esm/dev-server/file-event-handler.mjs +11 -1
- package/esm/dev-server/file-event-handler.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +1 -1
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-manager.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +16 -1
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +13 -4
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs +21 -9
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
- package/esm/dev-server/loader/register-loader.mjs +31 -12
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +14 -0
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/special-file-patterns.mjs +4 -1
- package/esm/dev-server/special-file-patterns.mjs.map +1 -1
- package/esm/e2e/index.d.mts +2 -2
- package/esm/e2e/page.d.mts +6 -1
- package/esm/e2e/page.d.mts.map +1 -1
- package/esm/e2e/page.mjs +36 -1
- package/esm/e2e/page.mjs.map +1 -1
- package/esm/e2e/types.d.mts +31 -0
- package/esm/e2e/types.d.mts.map +1 -1
- package/esm/e2e/types.mjs.map +1 -1
- package/esm/errors/error-codes.d.mts +48 -0
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/error-codes.mjs +48 -0
- package/esm/errors/error-codes.mjs.map +1 -1
- package/esm/errors/index.d.mts +2 -2
- package/esm/errors/index.mjs +2 -2
- package/esm/generations/add-command.action.mjs +2 -0
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/design-system-payload.mjs +53 -0
- package/esm/generations/design-system-payload.mjs.map +1 -0
- package/esm/generations/features/design-system.feature.mjs +38 -0
- package/esm/generations/features/design-system.feature.mjs.map +1 -0
- package/esm/generations/features/index.mjs +3 -1
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +13 -2
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +48 -13
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/stubs.mjs +9 -5
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/error-mapper.d.mts +1 -1
- package/esm/http/error-mapper.mjs +3 -3
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/error-response.d.mts +3 -0
- package/esm/http/error-response.d.mts.map +1 -1
- package/esm/http/error-response.mjs +8 -2
- package/esm/http/error-response.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +8 -0
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +13 -1
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/index.d.mts +3 -2
- package/esm/http/index.mjs +3 -2
- package/esm/http/list-endpoint.d.mts +35 -0
- package/esm/http/list-endpoint.d.mts.map +1 -0
- package/esm/http/list-endpoint.mjs +28 -0
- package/esm/http/list-endpoint.mjs.map +1 -0
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +12 -2
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/server.mjs +1 -1
- package/esm/index.d.mts +8 -6
- package/esm/index.mjs +3 -2
- package/esm/openapi/security.mjs +12 -4
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +2 -0
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/build-budgets.d.mts +46 -0
- package/esm/production/build-budgets.d.mts.map +1 -0
- package/esm/production/build-budgets.mjs +109 -0
- package/esm/production/build-budgets.mjs.map +1 -0
- package/esm/production/production-builder.mjs +13 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +1 -1
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/restful/restful.d.mts +1 -1
- package/esm/tests/fakes/storage-fake.d.mts +3 -1
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +3 -3
- package/esm/tests/fakes/storage-fake.mjs.map +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +3 -1
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +3 -2
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +4 -2
- package/esm/tests/index.mjs +3 -1
- package/esm/tests/load-unit-config.mjs +24 -0
- package/esm/tests/load-unit-config.mjs.map +1 -0
- package/esm/tests/response-contract.d.mts +32 -0
- package/esm/tests/response-contract.d.mts.map +1 -0
- package/esm/tests/response-contract.mjs +116 -0
- package/esm/tests/response-contract.mjs.map +1 -0
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +10 -2
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs.map +1 -1
- package/esm/tests/test-locales.mjs +33 -0
- package/esm/tests/test-locales.mjs.map +1 -0
- package/esm/tests/test-runtime-scope.d.mts +15 -0
- package/esm/tests/test-runtime-scope.d.mts.map +1 -0
- package/esm/tests/test-runtime-scope.mjs +80 -0
- package/esm/tests/test-runtime-scope.mjs.map +1 -0
- package/esm/tests/vitest-setup.d.mts +13 -3
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +146 -18
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/check/affected-files.d.mts +5 -0
- package/esm/tooling/check/affected-files.d.mts.map +1 -0
- package/esm/tooling/check/affected-files.mjs +56 -0
- package/esm/tooling/check/affected-files.mjs.map +1 -0
- package/esm/tooling/check/changed-files.d.mts +2 -0
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +2 -1
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +48 -6
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/fixes.d.mts +8 -0
- package/esm/tooling/check/fixes.d.mts.map +1 -0
- package/esm/tooling/check/fixes.mjs +31 -0
- package/esm/tooling/check/fixes.mjs.map +1 -0
- package/esm/tooling/check/index.d.mts +12 -0
- package/esm/tooling/check/index.mjs +3 -2
- package/esm/tooling/check/run-check.d.mts +2 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-check.mjs +20 -4
- package/esm/tooling/check/run-check.mjs.map +1 -1
- package/esm/tooling/check/run-tests.mjs +1 -1
- package/esm/tooling/check/source-ast.d.mts +1 -0
- package/esm/tooling/check/web-conventions.d.mts +10 -0
- package/esm/tooling/check/web-conventions.d.mts.map +1 -0
- package/esm/tooling/check/web-conventions.mjs +126 -0
- package/esm/tooling/check/web-conventions.mjs.map +1 -0
- package/esm/tooling/index.d.mts +7 -2
- package/esm/tooling/index.mjs +4 -2
- package/esm/tooling/inspect/collect-files.mjs +172 -0
- package/esm/tooling/inspect/collect-files.mjs.map +1 -0
- package/esm/tooling/inspect/collect-pages.mjs +3 -2
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/collect-routes.mjs.map +1 -1
- package/esm/tooling/inspect/explain-file.d.mts +12 -0
- package/esm/tooling/inspect/explain-file.d.mts.map +1 -0
- package/esm/tooling/inspect/explain-file.mjs +45 -0
- package/esm/tooling/inspect/explain-file.mjs.map +1 -0
- package/esm/tooling/inspect/index.d.mts +3 -2
- package/esm/tooling/inspect/index.mjs +2 -1
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-app.mjs +9 -3
- package/esm/tooling/inspect/inspect-app.mjs.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.mjs +34 -1
- package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +17 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.mjs +2 -1
- package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +8 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/problem.d.mts +4 -0
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/problem.mjs +1 -0
- package/esm/tooling/problem.mjs.map +1 -1
- package/esm/tooling/syntax/ast.d.mts +2 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +5 -1
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- package/esm/vite/index.d.mts +3 -1
- package/esm/vite/index.mjs +3 -1
- package/esm/vite/test-setup-reporter.d.mts +16 -0
- package/esm/vite/test-setup-reporter.d.mts.map +1 -0
- package/esm/vite/test-setup-reporter.mjs +55 -0
- package/esm/vite/test-setup-reporter.mjs.map +1 -0
- package/esm/vite/test-workers.d.mts +5 -0
- package/esm/vite/test-workers.d.mts.map +1 -0
- package/esm/vite/test-workers.mjs +38 -0
- package/esm/vite/test-workers.mjs.map +1 -0
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/types.d.mts +3 -0
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/llms-full.txt +763 -9
- package/llms.txt +2 -0
- package/package.json +15 -14
- package/schemas/inspect-report.schema.json +47 -1
- package/skills/build-budgets/SKILL.md +51 -0
- package/skills/build-restful/SKILL.md +56 -0
- package/skills/configure-app/SKILL.md +7 -0
- package/skills/create-module/SKILL.md +9 -0
- package/skills/generate-web-ui/SKILL.md +71 -0
- package/skills/index.md +2 -2
- package/skills/run-app/SKILL.md +1 -1
- package/skills/send-mail/SKILL.md +25 -0
- package/skills/send-response/SKILL.md +50 -0
- package/skills/test-browser/SKILL.md +53 -0
- package/skills/test-http/SKILL.md +91 -0
- package/skills/test-service/SKILL.md +161 -3
- package/skills/upgrade-from-5-29/SKILL.md +18 -0
- package/skills/use-localization/SKILL.md +21 -0
- package/skills/warlock-check/SKILL.md +72 -1
- package/skills/warlock-inspect/SKILL.md +45 -2
- package/skills/warlock-mcp/SKILL.md +4 -0
- package/skills/write-cli-command/SKILL.md +18 -0
- package/esm/production/build-app-production.mjs +0 -14
- package/esm/production/build-app-production.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-typecheck.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/typecheck/run-typecheck.ts"],"sourcesContent":["import { existsSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\nimport { CompilerSession, runCompiler, type CompilerDiagnostic } from \"../typescript/compiler\";\n\nexport type TypecheckOptions = {\n cwd?: string;\n project?: string;\n files?: readonly string[];\n buildInfoFile?: string;\n};\nexport type TypecheckResult = {\n ok: boolean;\n mode: \"program\" | \"files\";\n files: string[] | null;\n checkedFiles: number;\n problems: ToolingProblem[];\n durationMs: number;\n buildInfoFile: string | null;\n};\nexport const DEFAULT_TYPECHECK_BUILD_INFO = path.join(\".warlock\", \"cache\", \"typecheck.tsbuildinfo\");\nconst toPosix = (file: string) => file.split(path.sep).join(\"/\");\nfunction isProjectFile(file: string, root: string, declarations = true): boolean {\n return (\n file.startsWith(root + path.sep) &&\n !file.split(path.sep).includes(\"node_modules\") &&\n (declarations || !file.endsWith(\".d.ts\"))\n );\n}\nexport function diagnosticToProblem(\n diagnostic: CompilerDiagnostic,\n cwd: string,\n code: \"WL7101\" | \"WL7102\" = \"WL7101\",\n): ToolingProblem {\n return createProblem({\n code,\n source: \"typescript\",\n severity: diagnostic.severity,\n message: diagnostic.message,\n file: diagnostic.fileName ? toPosix(path.relative(cwd, diagnostic.fileName)) : null,\n line: diagnostic.fileName ? diagnostic.line : null,\n column: diagnostic.fileName ? diagnostic.column : null,\n rule: `TS${diagnostic.code}`,\n });\n}\n\n/** Resolve direct importers with the native checker, including package exports and aliases. */\nexport function directImporters(\n session: CompilerSession,\n targets: ReadonlySet<string>,\n root: string,\n): Set<string> {\n const importers = new Set<string>();\n for (const file of session.fileNames) {\n if (!isProjectFile(file, root, false) || targets.has(file)) continue;\n if (session.importFiles(file).some((imported) => targets.has(path.resolve(imported))))\n importers.add(file);\n }\n return importers;\n}\n\n/** TypeScript 7's native incremental compiler owns build state; changed mode filters its diagnostics. */\nexport function runTypecheck(options: TypecheckOptions = {}): TypecheckResult {\n const startedAt = Date.now();\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const configPath = path.resolve(cwd, options.project ?? \"tsconfig.json\");\n const result = (\n problems: ToolingProblem[],\n rest: Partial<TypecheckResult> = {},\n ): TypecheckResult => ({\n ok: !problems.some((problem) => problem.severity === \"error\"),\n mode: options.files ? \"files\" : \"program\",\n files: null,\n checkedFiles: 0,\n problems,\n durationMs: Date.now() - startedAt,\n buildInfoFile: null,\n ...rest,\n });\n if (!existsSync(configPath))\n return result([\n createProblem({\n code: \"WL7102\",\n source: \"typescript\",\n message: `No TypeScript config at ${toPosix(path.relative(cwd, configPath)) || configPath}.`,\n file: toPosix(path.relative(cwd, configPath)),\n }),\n ]);\n const buildInfoFile = path.resolve(cwd, options.buildInfoFile ?? DEFAULT_TYPECHECK_BUILD_INFO);\n mkdirSync(path.dirname(buildInfoFile), { recursive: true });\n const compiled = runCompiler(cwd, [\n \"-p\",\n configPath,\n \"--noEmit\",\n \"--incremental\",\n \"--tsBuildInfoFile\",\n buildInfoFile,\n \"--composite\",\n \"false\",\n \"--emitDeclarationOnly\",\n \"false\",\n \"--listFiles\",\n ]);\n const sources = compiled.output\n .split(/\\r?\\n/)\n .map((line) => (path.isAbsolute(line) ? line : \"\"))\n .filter((file) => isProjectFile(file, cwd));\n const wanted = options.files\n ? new Set(options.files.map((file) => path.resolve(cwd, file)))\n : null;\n if (wanted) {\n const session = new CompilerSession(cwd, configPath);\n try {\n for (const
|
|
1
|
+
{"version":3,"file":"run-typecheck.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/typecheck/run-typecheck.ts"],"sourcesContent":["import { existsSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\nimport { CompilerSession, runCompiler, type CompilerDiagnostic } from \"../typescript/compiler\";\n\nexport type TypecheckOptions = {\n cwd?: string;\n project?: string;\n files?: readonly string[];\n buildInfoFile?: string;\n};\nexport type TypecheckResult = {\n ok: boolean;\n mode: \"program\" | \"files\";\n files: string[] | null;\n checkedFiles: number;\n problems: ToolingProblem[];\n durationMs: number;\n buildInfoFile: string | null;\n};\nexport const DEFAULT_TYPECHECK_BUILD_INFO = path.join(\".warlock\", \"cache\", \"typecheck.tsbuildinfo\");\nconst toPosix = (file: string) => file.split(path.sep).join(\"/\");\nfunction isProjectFile(file: string, root: string, declarations = true): boolean {\n return (\n file.startsWith(root + path.sep) &&\n !file.split(path.sep).includes(\"node_modules\") &&\n (declarations || !file.endsWith(\".d.ts\"))\n );\n}\nexport function diagnosticToProblem(\n diagnostic: CompilerDiagnostic,\n cwd: string,\n code: \"WL7101\" | \"WL7102\" = \"WL7101\",\n): ToolingProblem {\n return createProblem({\n code,\n source: \"typescript\",\n severity: diagnostic.severity,\n message: diagnostic.message,\n file: diagnostic.fileName ? toPosix(path.relative(cwd, diagnostic.fileName)) : null,\n line: diagnostic.fileName ? diagnostic.line : null,\n column: diagnostic.fileName ? diagnostic.column : null,\n rule: `TS${diagnostic.code}`,\n });\n}\n\n/** Resolve direct importers with the native checker, including package exports and aliases. */\nexport function directImporters(\n session: CompilerSession,\n targets: ReadonlySet<string>,\n root: string,\n): Set<string> {\n const importers = new Set<string>();\n for (const file of session.fileNames) {\n if (!isProjectFile(file, root, false) || targets.has(file)) continue;\n if (session.importFiles(file).some((imported) => targets.has(path.resolve(imported))))\n importers.add(file);\n }\n return importers;\n}\n\n/** TypeScript 7's native incremental compiler owns build state; changed mode filters its diagnostics. */\nexport function runTypecheck(options: TypecheckOptions = {}): TypecheckResult {\n const startedAt = Date.now();\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const configPath = path.resolve(cwd, options.project ?? \"tsconfig.json\");\n const result = (\n problems: ToolingProblem[],\n rest: Partial<TypecheckResult> = {},\n ): TypecheckResult => ({\n ok: !problems.some((problem) => problem.severity === \"error\"),\n mode: options.files ? \"files\" : \"program\",\n files: null,\n checkedFiles: 0,\n problems,\n durationMs: Date.now() - startedAt,\n buildInfoFile: null,\n ...rest,\n });\n if (!existsSync(configPath))\n return result([\n createProblem({\n code: \"WL7102\",\n source: \"typescript\",\n message: `No TypeScript config at ${toPosix(path.relative(cwd, configPath)) || configPath}.`,\n file: toPosix(path.relative(cwd, configPath)),\n }),\n ]);\n const buildInfoFile = path.resolve(cwd, options.buildInfoFile ?? DEFAULT_TYPECHECK_BUILD_INFO);\n mkdirSync(path.dirname(buildInfoFile), { recursive: true });\n const compiled = runCompiler(cwd, [\n \"-p\",\n configPath,\n \"--noEmit\",\n \"--incremental\",\n \"--tsBuildInfoFile\",\n buildInfoFile,\n \"--composite\",\n \"false\",\n \"--emitDeclarationOnly\",\n \"false\",\n \"--listFiles\",\n ]);\n const sources = compiled.output\n .split(/\\r?\\n/)\n .map((line) => (path.isAbsolute(line) ? line : \"\"))\n .filter((file) => isProjectFile(file, cwd));\n const wanted = options.files\n ? new Set(options.files.map((file) => path.resolve(cwd, file)))\n : null;\n if (wanted) {\n const session = new CompilerSession(cwd, configPath);\n try {\n for (;;) {\n const importers = directImporters(session, wanted, cwd);\n if (!importers.size) break;\n for (const file of importers) wanted.add(file);\n }\n } finally {\n session.close();\n }\n }\n const checked = sources.filter((file) => !wanted || wanted.has(file));\n const configCodes = new Set([18002, 18003]);\n const problems = [...compiled.diagnostics]\n .sort((a, b) => Number(b.fileName === configPath) - Number(a.fileName === configPath))\n .filter(\n (diagnostic) =>\n !diagnostic.fileName ||\n diagnostic.fileName === configPath ||\n (isProjectFile(diagnostic.fileName, cwd) && (!wanted || wanted.has(diagnostic.fileName))),\n )\n .map((diagnostic) =>\n diagnosticToProblem(\n diagnostic,\n cwd,\n !diagnostic.fileName ||\n diagnostic.fileName === configPath ||\n configCodes.has(diagnostic.code)\n ? \"WL7102\"\n : \"WL7101\",\n ),\n );\n return result(problems, {\n files: wanted ? checked.map((file) => toPosix(path.relative(cwd, file))).sort() : null,\n checkedFiles: checked.length,\n buildInfoFile: existsSync(buildInfoFile) ? buildInfoFile : null,\n });\n}\n"],"mappings":"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"}
|
package/esm/vite/index.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { DecoratorLoweringPlugin, lowerStage3Decorators } from "./lower-stage3-decorators.mjs";
|
|
2
|
-
|
|
2
|
+
import { recommendedTestWorkers } from "./test-workers.mjs";
|
|
3
|
+
import { TestSetupReporter } from "./test-setup-reporter.mjs";
|
|
4
|
+
export { DecoratorLoweringPlugin, TestSetupReporter, lowerStage3Decorators, recommendedTestWorkers };
|
package/esm/vite/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { lowerStage3Decorators } from "./lower-stage3-decorators.mjs";
|
|
2
|
+
import { recommendedTestWorkers } from "./test-workers.mjs";
|
|
3
|
+
import { TestSetupReporter } from "./test-setup-reporter.mjs";
|
|
2
4
|
|
|
3
|
-
export { lowerStage3Decorators };
|
|
5
|
+
export { TestSetupReporter, lowerStage3Decorators, recommendedTestWorkers };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../../packages/core/src/vite/test-setup-reporter.d.ts
|
|
2
|
+
/** Vitest reporter shape, with no runtime dependency on Vitest in the config helper. */
|
|
3
|
+
export declare class TestSetupReporter {
|
|
4
|
+
private files;
|
|
5
|
+
private bootstraps;
|
|
6
|
+
private workers;
|
|
7
|
+
private totals;
|
|
8
|
+
private shutdowns;
|
|
9
|
+
onTestRunStart(): void;
|
|
10
|
+
onUserConsoleLog(log: {
|
|
11
|
+
content: string;
|
|
12
|
+
}): void;
|
|
13
|
+
onTestRunEnd(): void;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=test-setup-reporter.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup-reporter.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/vite/test-setup-reporter.ts"],"mappings":";;qBACa;UACH;UACA;UACA;UACA;UACA;EAED;EAQA,iBAAiB;IAAO;;EA6BxB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region ../../packages/core/src/vite/test-setup-reporter.ts
|
|
2
|
+
/** Vitest reporter shape, with no runtime dependency on Vitest in the config helper. */
|
|
3
|
+
var TestSetupReporter = class {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.files = 0;
|
|
6
|
+
this.bootstraps = 0;
|
|
7
|
+
this.workers = /* @__PURE__ */ new Set();
|
|
8
|
+
this.totals = {};
|
|
9
|
+
this.shutdowns = /* @__PURE__ */ new Map();
|
|
10
|
+
}
|
|
11
|
+
onTestRunStart() {
|
|
12
|
+
this.files = 0;
|
|
13
|
+
this.bootstraps = 0;
|
|
14
|
+
this.workers.clear();
|
|
15
|
+
this.totals = {};
|
|
16
|
+
this.shutdowns.clear();
|
|
17
|
+
}
|
|
18
|
+
onUserConsoleLog(log) {
|
|
19
|
+
for (const line of log.content.split("\n")) {
|
|
20
|
+
const file = line.startsWith("[warlock:test] file=");
|
|
21
|
+
const summary = line.startsWith("[warlock:test] summary ");
|
|
22
|
+
if (!file && !summary) continue;
|
|
23
|
+
const marker = line.lastIndexOf("pid=");
|
|
24
|
+
if (marker === -1) continue;
|
|
25
|
+
const [pid, ...parts] = line.slice(marker + 4).trim().split(/\s+/);
|
|
26
|
+
if (!pid || !/^\d+$/.test(pid)) continue;
|
|
27
|
+
const steps = {};
|
|
28
|
+
for (const part of parts) {
|
|
29
|
+
const match = /^([a-zA-Z]+)=(\d+(?:\.\d+)?)ms$/.exec(part);
|
|
30
|
+
if (match?.[1] && match[2]) steps[match[1]] = Number(match[2]);
|
|
31
|
+
}
|
|
32
|
+
if (summary) {
|
|
33
|
+
if (steps.shutdown !== void 0) this.shutdowns.set(pid, steps.shutdown);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
this.workers.add(pid);
|
|
37
|
+
this.files += 1;
|
|
38
|
+
if (steps.bootstrap !== void 0) this.bootstraps += 1;
|
|
39
|
+
for (const [step, ms] of Object.entries(steps)) this.totals[step] = (this.totals[step] ?? 0) + ms;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
onTestRunEnd() {
|
|
43
|
+
if (!this.files) return;
|
|
44
|
+
const shutdown = [...this.shutdowns.values()].reduce((sum, ms) => sum + ms, 0);
|
|
45
|
+
const steps = Object.entries({
|
|
46
|
+
...this.totals,
|
|
47
|
+
shutdown
|
|
48
|
+
}).map(([step, ms]) => `${step}=${ms.toFixed(2)}ms`).join(" ");
|
|
49
|
+
console.info(`[warlock:test] run summary files=${this.files} workers=${this.workers.size} bootstraps=${this.bootstraps} ${steps}`);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { TestSetupReporter };
|
|
55
|
+
//# sourceMappingURL=test-setup-reporter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup-reporter.mjs","names":[],"sources":["../../../../../../../../packages/core/src/vite/test-setup-reporter.ts"],"sourcesContent":["/** Vitest reporter shape, with no runtime dependency on Vitest in the config helper. */\nexport class TestSetupReporter {\n private files = 0;\n private bootstraps = 0;\n private workers = new Set<string>();\n private totals: Record<string, number> = {};\n private shutdowns = new Map<string, number>();\n\n public onTestRunStart(): void {\n this.files = 0;\n this.bootstraps = 0;\n this.workers.clear();\n this.totals = {};\n this.shutdowns.clear();\n }\n\n public onUserConsoleLog(log: { content: string }): void {\n for (const line of log.content.split(\"\\n\")) {\n const file = line.startsWith(\"[warlock:test] file=\");\n const summary = line.startsWith(\"[warlock:test] summary \");\n if (!file && !summary) continue;\n const marker = line.lastIndexOf(\"pid=\");\n if (marker === -1) continue;\n const [pid, ...parts] = line\n .slice(marker + 4)\n .trim()\n .split(/\\s+/);\n if (!pid || !/^\\d+$/.test(pid)) continue;\n const steps: Record<string, number> = {};\n for (const part of parts) {\n const match = /^([a-zA-Z]+)=(\\d+(?:\\.\\d+)?)ms$/.exec(part);\n if (match?.[1] && match[2]) steps[match[1]] = Number(match[2]);\n }\n if (summary) {\n if (steps.shutdown !== undefined) this.shutdowns.set(pid, steps.shutdown);\n continue;\n }\n this.workers.add(pid);\n this.files += 1;\n if (steps.bootstrap !== undefined) this.bootstraps += 1;\n for (const [step, ms] of Object.entries(steps))\n this.totals[step] = (this.totals[step] ?? 0) + ms;\n }\n }\n\n public onTestRunEnd(): void {\n if (!this.files) return;\n const shutdown = [...this.shutdowns.values()].reduce((sum, ms) => sum + ms, 0);\n const steps = Object.entries({ ...this.totals, shutdown })\n .map(([step, ms]) => `${step}=${ms.toFixed(2)}ms`)\n .join(\" \");\n console.info(\n `[warlock:test] run summary files=${this.files} workers=${this.workers.size} bootstraps=${this.bootstraps} ${steps}`,\n );\n }\n}\n"],"mappings":";;AACA,IAAa,oBAAb,MAA+B;;eACb;oBACK;iCACH,IAAI,IAAY;gBACO,CAAC;mCACtB,IAAI,IAAoB;;CAE5C,AAAO,iBAAuB;EAC5B,KAAK,QAAQ;EACb,KAAK,aAAa;EAClB,KAAK,QAAQ,MAAM;EACnB,KAAK,SAAS,CAAC;EACf,KAAK,UAAU,MAAM;CACvB;CAEA,AAAO,iBAAiB,KAAgC;EACtD,KAAK,MAAM,QAAQ,IAAI,QAAQ,MAAM,IAAI,GAAG;GAC1C,MAAM,OAAO,KAAK,WAAW,sBAAsB;GACnD,MAAM,UAAU,KAAK,WAAW,yBAAyB;GACzD,IAAI,CAAC,QAAQ,CAAC,SAAS;GACvB,MAAM,SAAS,KAAK,YAAY,MAAM;GACtC,IAAI,WAAW,IAAI;GACnB,MAAM,CAAC,KAAK,GAAG,SAAS,KACrB,MAAM,SAAS,CAAC,CAAC,CACjB,KAAK,CAAC,CACN,MAAM,KAAK;GACd,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,GAAG,GAAG;GAChC,MAAM,QAAgC,CAAC;GACvC,KAAK,MAAM,QAAQ,OAAO;IACxB,MAAM,QAAQ,kCAAkC,KAAK,IAAI;IACzD,IAAI,QAAQ,MAAM,MAAM,IAAI,MAAM,MAAM,MAAM,OAAO,MAAM,EAAE;GAC/D;GACA,IAAI,SAAS;IACX,IAAI,MAAM,aAAa,QAAW,KAAK,UAAU,IAAI,KAAK,MAAM,QAAQ;IACxE;GACF;GACA,KAAK,QAAQ,IAAI,GAAG;GACpB,KAAK,SAAS;GACd,IAAI,MAAM,cAAc,QAAW,KAAK,cAAc;GACtD,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,KAAK,GAC3C,KAAK,OAAO,SAAS,KAAK,OAAO,SAAS,KAAK;EACnD;CACF;CAEA,AAAO,eAAqB;EAC1B,IAAI,CAAC,KAAK,OAAO;EACjB,MAAM,WAAW,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,MAAM,IAAI,CAAC;EAC7E,MAAM,QAAQ,OAAO,QAAQ;GAAE,GAAG,KAAK;GAAQ;EAAS,CAAC,CAAC,CACvD,KAAK,CAAC,MAAM,QAAQ,GAAG,KAAK,GAAG,GAAG,QAAQ,CAAC,EAAE,GAAG,CAAC,CACjD,KAAK,GAAG;EACX,QAAQ,KACN,oCAAoC,KAAK,MAAM,WAAW,KAAK,QAAQ,KAAK,cAAc,KAAK,WAAW,GAAG,OAC/G;CACF;AACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region ../../packages/core/src/vite/test-workers.d.ts
|
|
2
|
+
/** Limit Vitest forks to both CPU affinity and the tightest visible cgroup v2 quota. */
|
|
3
|
+
export declare function recommendedTestWorkers(parallelism?: number, read?: (file: string) => string): number;
|
|
4
|
+
//#endregion
|
|
5
|
+
//# sourceMappingURL=test-workers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-workers.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/vite/test-workers.ts"],"mappings":";;wBAqBgB,uBACd,sBACA,QAAO"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { availableParallelism } from "node:os";
|
|
4
|
+
|
|
5
|
+
//#region ../../packages/core/src/vite/test-workers.ts
|
|
6
|
+
/** cgroup v2 cpu.max: quota microseconds / period microseconds; round down to avoid oversubscription. */
|
|
7
|
+
function cpuQuotaWorkers(value) {
|
|
8
|
+
const [quota, period] = value.trim().split(/\s+/);
|
|
9
|
+
if (quota === "max") return void 0;
|
|
10
|
+
const quotaNumber = Number(quota);
|
|
11
|
+
const periodNumber = Number(period);
|
|
12
|
+
if (!Number.isFinite(quotaNumber) || !Number.isFinite(periodNumber) || quotaNumber <= 0 || periodNumber <= 0) return void 0;
|
|
13
|
+
return Math.max(1, Math.floor(quotaNumber / periodNumber));
|
|
14
|
+
}
|
|
15
|
+
/** Limit Vitest forks to both CPU affinity and the tightest visible cgroup v2 quota. */
|
|
16
|
+
function recommendedTestWorkers(parallelism = availableParallelism(), read = (file) => readFileSync(file, "utf8")) {
|
|
17
|
+
let workers = Math.max(1, Math.floor(parallelism));
|
|
18
|
+
const root = "/sys/fs/cgroup";
|
|
19
|
+
let directory = root;
|
|
20
|
+
try {
|
|
21
|
+
const entry = read("/proc/self/cgroup").split("\n").find((line) => line.startsWith("0::"));
|
|
22
|
+
if (entry) directory = path.resolve(root, `.${entry.slice(3)}`);
|
|
23
|
+
if (directory !== root && !directory.startsWith(`${root}/`)) directory = root;
|
|
24
|
+
} catch {}
|
|
25
|
+
for (;;) {
|
|
26
|
+
try {
|
|
27
|
+
const quota = cpuQuotaWorkers(read(path.join(directory, "cpu.max")));
|
|
28
|
+
if (quota !== void 0) workers = Math.min(workers, quota);
|
|
29
|
+
} catch {}
|
|
30
|
+
if (directory === root) break;
|
|
31
|
+
directory = path.dirname(directory);
|
|
32
|
+
}
|
|
33
|
+
return workers;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { cpuQuotaWorkers, recommendedTestWorkers };
|
|
38
|
+
//# sourceMappingURL=test-workers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-workers.mjs","names":[],"sources":["../../../../../../../../packages/core/src/vite/test-workers.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { availableParallelism } from \"node:os\";\nimport path from \"node:path\";\n\n/** cgroup v2 cpu.max: quota microseconds / period microseconds; round down to avoid oversubscription. */\nexport function cpuQuotaWorkers(value: string): number | undefined {\n const [quota, period] = value.trim().split(/\\s+/);\n if (quota === \"max\") return undefined;\n const quotaNumber = Number(quota);\n const periodNumber = Number(period);\n if (\n !Number.isFinite(quotaNumber) ||\n !Number.isFinite(periodNumber) ||\n quotaNumber <= 0 ||\n periodNumber <= 0\n )\n return undefined;\n return Math.max(1, Math.floor(quotaNumber / periodNumber));\n}\n\n/** Limit Vitest forks to both CPU affinity and the tightest visible cgroup v2 quota. */\nexport function recommendedTestWorkers(\n parallelism = availableParallelism(),\n read: (file: string) => string = (file) => readFileSync(file, \"utf8\"),\n): number {\n let workers = Math.max(1, Math.floor(parallelism));\n const root = \"/sys/fs/cgroup\";\n let directory = root;\n try {\n const entry = read(\"/proc/self/cgroup\")\n .split(\"\\n\")\n .find((line) => line.startsWith(\"0::\"));\n if (entry) directory = path.resolve(root, `.${entry.slice(3)}`);\n if (directory !== root && !directory.startsWith(`${root}/`)) directory = root;\n } catch {\n /* Non-Linux hosts use CPU affinity. */\n }\n for (;;) {\n try {\n const quota = cpuQuotaWorkers(read(path.join(directory, \"cpu.max\")));\n if (quota !== undefined) workers = Math.min(workers, quota);\n } catch {\n /* Missing/unreadable quotas do not replace the affinity limit. */\n }\n if (directory === root) break;\n directory = path.dirname(directory);\n }\n return workers;\n}\n"],"mappings":";;;;;;AAKA,SAAgB,gBAAgB,OAAmC;CACjE,MAAM,CAAC,OAAO,UAAU,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK;CAChD,IAAI,UAAU,OAAO,OAAO;CAC5B,MAAM,cAAc,OAAO,KAAK;CAChC,MAAM,eAAe,OAAO,MAAM;CAClC,IACE,CAAC,OAAO,SAAS,WAAW,KAC5B,CAAC,OAAO,SAAS,YAAY,KAC7B,eAAe,KACf,gBAAgB,GAEhB,OAAO;CACT,OAAO,KAAK,IAAI,GAAG,KAAK,MAAM,cAAc,YAAY,CAAC;AAC3D;;AAGA,SAAgB,uBACd,cAAc,qBAAqB,GACnC,QAAkC,SAAS,aAAa,MAAM,MAAM,GAC5D;CACR,IAAI,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,WAAW,CAAC;CACjD,MAAM,OAAO;CACb,IAAI,YAAY;CAChB,IAAI;EACF,MAAM,QAAQ,KAAK,mBAAmB,CAAC,CACpC,MAAM,IAAI,CAAC,CACX,MAAM,SAAS,KAAK,WAAW,KAAK,CAAC;EACxC,IAAI,OAAO,YAAY,KAAK,QAAQ,MAAM,IAAI,MAAM,MAAM,CAAC,GAAG;EAC9D,IAAI,cAAc,QAAQ,CAAC,UAAU,WAAW,GAAG,KAAK,EAAE,GAAG,YAAY;CAC3E,QAAQ,CAER;CACA,SAAS;EACP,IAAI;GACF,MAAM,QAAQ,gBAAgB,KAAK,KAAK,KAAK,WAAW,SAAS,CAAC,CAAC;GACnE,IAAI,UAAU,QAAW,UAAU,KAAK,IAAI,SAAS,KAAK;EAC5D,QAAQ,CAER;EACA,IAAI,cAAc,MAAM;EACxB,YAAY,KAAK,QAAQ,SAAS;CACpC;CACA,OAAO;AACT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { BudgetPage, BudgetViolation, BuildBudgetReport, BuildBudgets, PageBudget } from "../production/build-budgets.mjs";
|
|
1
2
|
import { WarlockConfig } from "./types.mjs";
|
|
2
3
|
import { defineConfig } from "./define-config.mjs";
|
|
3
4
|
import { WarlockConfigManager, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, warlockConfigManager } from "./warlock-config.manager.mjs";
|
|
4
|
-
export { WarlockConfig, WarlockConfigManager, defineConfig, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, warlockConfigManager };
|
|
5
|
+
export { type BudgetPage, type BudgetViolation, type BuildBudgetReport, type BuildBudgets, type PageBudget, WarlockConfig, WarlockConfigManager, defineConfig, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, warlockConfigManager };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BuildBudgets } from "../production/build-budgets.mjs";
|
|
1
2
|
import { BuiltInHealthCheckerOptions, FileHealthCheckerContract } from "../dev-server/health-checker/file-health-checker.contract.mjs";
|
|
2
3
|
import { Connector } from "../connectors/types.mjs";
|
|
3
4
|
import { CLICommand } from "../commands/cli-command.mjs";
|
|
@@ -45,6 +46,8 @@ export type WarlockConfig = {
|
|
|
45
46
|
* @default dist
|
|
46
47
|
*/
|
|
47
48
|
outdir?: string;
|
|
49
|
+
/** Per-page compressed client asset limits. Omit for reporting only. */
|
|
50
|
+
budgets?: BuildBudgets;
|
|
48
51
|
/**
|
|
49
52
|
* Alias for {@link outdir}.
|
|
50
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/warlock-config/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/warlock-config/types.ts"],"mappings":";;;;;;;;;;;;YAeY;;;;EAIV;;;;IAIE;;;;IAIA;;;;IAIA;;;;;;;;;;;;;EAcF,QAAQ,KAAK;;;;;;IAMX;;IAEA,UAAU;;;;;;;;;;;IAWV;;;;;;IAMA;;;;;;;IAOA;;;;;;;;;;;;;;;;;IAiBA;;;;;;;;;;;;;;;;IAgBA;;;;;;IAMA;;;;;;IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BF,aAAa;;;;EAKb;IACE,WAAW;;;;;EAMb;;;;IAIE;;;;;;MAME;;;;;;MAMA;;;;;;IAMF,iBAAiB,8BAA8B;;;;;IAK/C;;;;;;;;;IASA;;;;;;;;;IASA;;;;;;;;;;IAUA;;;;;;;;;;;;IAYA;;;;;;;;;;IAUA;;;;;;;;;IASA;;MAIM;;MAEA;;MAEA;;;;;;EAOR;;;;;;;;;;;;;;;;;;IAkBE,aAAa,MAAM;;;;;;;;EASrB;;;;;;;;;IASE;;;;;;;;IASA"}
|