@wcstack/typescript 1.32.0 → 1.33.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.
@@ -1 +1 @@
1
- {"version":3,"file":"wcs-tsc.mjs","sources":["../../src/version.ts","../../src/cli/wcsTsc.ts"],"sourcesContent":["import pkg from \"../package.json\";\r\n\r\nexport const VERSION: string = pkg.version;\r\n","/**\r\n * wcsTsc.ts — the `wcs-tsc` command: `tsc` over `.html` files.\r\n *\r\n * wcs-tsc [--url-imports=any|error] [--wcs-defaults] [tsc arguments...]\r\n *\r\n * Every `<wcs-state>` inline `<script type=\"module\">` is mapped through the same\r\n * Volar language plugin the VS Code extension uses (dist/tsc-core.cjs, built from\r\n * vscode-wcs), so `this.coutn++` fails CI with a `file.html(line,col): error TS2339`\r\n * exactly where the editor underlines it. The mechanism is vue-tsc's:\r\n * `@volar/typescript`'s `runTsc` patches the `typescript/lib/tsc.js` the project\r\n * already has to accept `.html` and to build the program through the plugin.\r\n *\r\n * Options\r\n * --url-imports=any (default) treat every `https://` / `http://` module import\r\n * as `any` — buildless pages import from a CDN, and tsc has\r\n * nothing to resolve those against. `@wcstack/state` URL\r\n * imports are stripped by the plugin and typed by its preamble.\r\n * --url-imports=error leave URL imports alone (TS2307 for each).\r\n * --wcs-defaults when the project tsconfig lacks what the check needs\r\n * (`include` covering `**\\/*.html`, `noImplicitThis`, `allowJs`,\r\n * `checkJs`), run with a temporary config that extends it and\r\n * adds them, instead of only warning.\r\n *\r\n * Peers: `typescript` (required), `@volar/typescript` + `@volar/language-core`\r\n * (optional — only this command needs them). Resolved from the project first,\r\n * then from this package's own location.\r\n *\r\n * Exit codes: tsc's own (0 clean / 1 type errors / 2 usage) — plus 2 when the peers\r\n * are missing or the arguments are invalid.\r\n */\r\n\r\nimport { existsSync, mkdtempSync, unlinkSync, writeFileSync } from \"node:fs\";\r\nimport { createRequire } from \"node:module\";\r\nimport { tmpdir } from \"node:os\";\r\nimport { basename, dirname, isAbsolute, join, resolve } from \"node:path\";\r\nimport { fileURLToPath } from \"node:url\";\r\nimport { VERSION } from \"../version.js\";\r\n\r\nexport interface TscIo {\r\n readonly stdout: (text: string) => void;\r\n readonly stderr: (text: string) => void;\r\n readonly cwd: () => string;\r\n}\r\n\r\nexport interface TscArgs {\r\n readonly urlImports: \"any\" | \"error\";\r\n readonly wcsDefaults: boolean;\r\n readonly help: boolean;\r\n readonly version: boolean;\r\n /** Everything else, handed to tsc verbatim. */\r\n readonly tscArgs: readonly string[];\r\n readonly invalid: readonly string[];\r\n}\r\n\r\nconst USAGE =\r\n \"usage: wcs-tsc [--url-imports=any|error] [--wcs-defaults] [tsc arguments...]\\n\" +\r\n \" e.g. wcs-tsc --noEmit wcs-tsc -p tsconfig.json --noEmit\\n\";\r\n\r\nexport function parseTscArgs(argv: readonly string[]): TscArgs {\r\n let urlImports: TscArgs[\"urlImports\"] = \"any\";\r\n let wcsDefaults = false;\r\n let help = false;\r\n let version = false;\r\n const tscArgs: string[] = [];\r\n const invalid: string[] = [];\r\n for (const arg of argv) {\r\n if (arg.startsWith(\"--url-imports=\")) {\r\n const value = arg.slice(\"--url-imports=\".length);\r\n if (value === \"any\" || value === \"error\") urlImports = value;\r\n else invalid.push(arg);\r\n } else if (arg === \"--wcs-defaults\") wcsDefaults = true;\r\n else if (arg === \"--wcs-help\") help = true;\r\n else if (arg === \"--wcs-version\") version = true;\r\n else tscArgs.push(arg);\r\n }\r\n return { urlImports, wcsDefaults, help, version, tscArgs, invalid };\r\n}\r\n\r\n/** Resolve a module from the project (cwd) first, then from this package. */\r\nexport function resolveFromProject(id: string, cwd: string, fromUrl: string = import.meta.url): string | undefined {\r\n for (const base of [join(cwd, \"__wcs_tsc_resolve__.js\"), fromUrl]) {\r\n try {\r\n return createRequire(base).resolve(id);\r\n } catch {\r\n /* try the next base */\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\n/** The tsconfig tsc will read: `-p/--project` (a file or a directory), else ./tsconfig.json. */\r\nexport function findProjectConfig(tscArgs: readonly string[], cwd: string): { path: string; index: number } | undefined {\r\n for (let i = 0; i < tscArgs.length; i++) {\r\n const arg = tscArgs[i];\r\n let value: string | undefined;\r\n let index = i;\r\n if (arg === \"-p\" || arg === \"--project\") {\r\n value = tscArgs[i + 1];\r\n index = i + 1;\r\n } else if (arg.startsWith(\"--project=\") || arg.startsWith(\"-p=\")) {\r\n value = arg.slice(arg.indexOf(\"=\") + 1);\r\n }\r\n if (value === undefined) continue;\r\n let path = isAbsolute(value) ? value : resolve(cwd, value);\r\n if (existsSync(path) && !path.endsWith(\".json\")) path = join(path, \"tsconfig.json\");\r\n return { path, index };\r\n }\r\n const fallback = join(cwd, \"tsconfig.json\");\r\n return existsSync(fallback) ? { path: fallback, index: -1 } : undefined;\r\n}\r\n\r\nexport interface ConfigAudit {\r\n /** Human-readable names of what is missing (empty = ready). */\r\n readonly missing: readonly string[];\r\n readonly include: readonly string[] | undefined;\r\n readonly compilerOptions: Readonly<Record<string, unknown>>;\r\n /** No `target` / `lib` at all (tsc defaults to ES5, whose lib lacks the Map / Set / Promise types the `this` preamble uses). */\r\n readonly needsTarget: boolean;\r\n}\r\n\r\n/**\r\n * Check the project tsconfig for what the HTML check needs. `include` is only\r\n * checked when present (tsc's default `**\\/*` already picks `.html` up once the\r\n * extension is registered); a `files`-only config never sees HTML.\r\n */\r\nexport function auditConfig(configPath: string, ts: TypeScriptLike): ConfigAudit {\r\n const read = ts.readConfigFile(configPath, ts.sys.readFile);\r\n const raw = (read.config ?? {}) as { include?: unknown; files?: unknown; compilerOptions?: Record<string, unknown> };\r\n const parsed = ts.parseJsonConfigFileContent(read.config ?? {}, ts.sys, toPosix(dirname(configPath)), undefined, toPosix(configPath));\r\n const options = parsed.options as Record<string, unknown>;\r\n const missing: string[] = [];\r\n const include = Array.isArray(raw.include) ? (raw.include as string[]) : undefined;\r\n const coversHtml = (patterns: readonly string[]): boolean => patterns.some((p) => /\\.html?$|\\*\\*\\/\\*$|\\*$/.test(p) && !/\\.(ts|js|tsx|jsx|mts|cts|mjs|cjs)$/.test(p));\r\n if (include !== undefined && !coversHtml(include)) missing.push('include: \"**/*.html\"');\r\n else if (include === undefined && Array.isArray(raw.files)) missing.push('include: \"**/*.html\" (a files-only config never sees HTML)');\r\n // `strict: true` implies noImplicitThis unless it is explicitly turned off.\r\n const noImplicitThis = options.noImplicitThis ?? options.strict === true;\r\n if (noImplicitThis !== true) missing.push(\"compilerOptions.noImplicitThis: true\");\r\n if (options.allowJs !== true) missing.push(\"compilerOptions.allowJs: true\");\r\n if (options.checkJs !== true) missing.push(\"compilerOptions.checkJs: true\");\r\n // With neither target nor lib, tsc's ES5 default lib has no Map / Set / Promise:\r\n // the preamble's `_WcsThis<T>` degrades silently and `this.typo` stops being an error.\r\n const target = options.target as number | undefined;\r\n const needsTarget = options.lib === undefined && (target === undefined || target < ts.ScriptTarget.ES2015);\r\n if (needsTarget) missing.push('compilerOptions.target: \"ES2015\" or later (the this-typing preamble uses Map / Set / Promise)');\r\n return { missing, include, compilerOptions: raw.compilerOptions ?? {}, needsTarget };\r\n}\r\n\r\n/** Write a temporary config next to the project one that extends it with the missing pieces. */\r\nexport function writeDefaultsConfig(configPath: string, audit: ConfigAudit): string {\r\n const dir = dirname(configPath);\r\n const tempPath = join(dir, `.wcs-tsc.${process.pid}.tsconfig.json`);\r\n const include = audit.include !== undefined ? [...audit.include, \"**/*.html\"] : [\"**/*\", \"**/*.html\"];\r\n const config = {\r\n extends: `./${basename(configPath)}`,\r\n compilerOptions: {\r\n allowJs: true,\r\n checkJs: true,\r\n noImplicitThis: true,\r\n // only when the project set neither target nor lib — never override an explicit choice\r\n ...(audit.needsTarget ? { target: \"ESNext\" } : {}),\r\n },\r\n include,\r\n };\r\n writeFileSync(tempPath, JSON.stringify(config, null, 2), \"utf8\");\r\n return tempPath;\r\n}\r\n\r\n/** Ambient shorthand modules: every `http(s)://` import types as `any`. */\r\nexport function writeUrlImportsDeclaration(): string {\r\n const dir = mkdtempSync(join(tmpdir(), \"wcs-tsc-\"));\r\n const path = join(dir, \"url-imports.d.ts\");\r\n writeFileSync(path, `// wcs-tsc --url-imports=any: CDN module imports resolve to any.\\ndeclare module \"https://*\";\\ndeclare module \"http://*\";\\n`, \"utf8\");\r\n return path;\r\n}\r\n\r\nexport interface TypeScriptLike {\r\n readConfigFile(path: string, readFile: (path: string) => string | undefined): { config?: unknown; error?: unknown };\r\n parseJsonConfigFileContent(json: unknown, host: unknown, basePath: string, existing?: unknown, configFileName?: string): { options: unknown };\r\n sys: { readFile(path: string): string | undefined };\r\n ScriptTarget: { ES2015: number };\r\n}\r\n\r\nfunction toPosix(path: string): string {\r\n return path.replace(/\\\\/g, \"/\");\r\n}\r\n\r\nfunction tscCoreCandidates(fromUrl: string): string[] {\r\n const here = dirname(fileURLToPath(fromUrl));\r\n return [join(here, \"tsc-core.cjs\"), join(here, \"..\", \"dist\", \"tsc-core.cjs\"), join(here, \"..\", \"..\", \"dist\", \"tsc-core.cjs\")];\r\n}\r\n\r\n/** Module resolution / loading, injectable so the whole flow can be tested in-process. */\r\nexport interface MainDeps {\r\n readonly resolve: (id: string, cwd: string) => string | undefined;\r\n readonly load: (path: string) => unknown;\r\n}\r\n\r\n/* v8 ignore start -- the real resolver / loader; tests inject fakes to keep tsc from exiting the process */\r\nconst defaultDeps: MainDeps = {\r\n resolve: (id, cwd) => resolveFromProject(id, cwd),\r\n load: (path) => createRequire(import.meta.url)(path),\r\n};\r\n/* v8 ignore stop */\r\n\r\n/**\r\n * Prepare and run. Returns an exit code only on the paths that do not reach tsc;\r\n * tsc itself calls `process.exit` with its own code.\r\n */\r\nexport function main(argv: readonly string[], io: TscIo = defaultIo(), deps: MainDeps = defaultDeps): number {\r\n const args = parseTscArgs(argv);\r\n if (args.version) {\r\n io.stdout(`${VERSION}\\n`);\r\n return 0;\r\n }\r\n if (args.help) {\r\n io.stdout(USAGE);\r\n return 0;\r\n }\r\n if (args.invalid.length > 0) {\r\n io.stderr(`invalid option(s): ${args.invalid.join(\" \")}\\n${USAGE}`);\r\n return 2;\r\n }\r\n const cwd = io.cwd();\r\n\r\n const runTscPath = deps.resolve(\"@volar/typescript/lib/quickstart/runTsc.js\", cwd);\r\n if (runTscPath === undefined) {\r\n io.stderr(\"wcs-tsc needs @volar/typescript (an optional peer): npm i -D @volar/typescript@~2.4.0 @volar/language-core@~2.4.0\\n\");\r\n return 2;\r\n }\r\n const tscPath = deps.resolve(\"typescript/lib/tsc.js\", cwd);\r\n const tsApiPath = deps.resolve(\"typescript\", cwd);\r\n if (tscPath === undefined || tsApiPath === undefined) {\r\n io.stderr(\"wcs-tsc needs typescript (a peer): npm i -D typescript\\n\");\r\n return 2;\r\n }\r\n const corePath = tscCoreCandidates(import.meta.url).find((p) => existsSync(p));\r\n /* v8 ignore next 4 -- tests run after `npm run build`, so the bundle is always present */\r\n if (corePath === undefined) {\r\n io.stderr(\"wcs-tsc: dist/tsc-core.cjs not found — run `npm run build` in packages/typescript\\n\");\r\n return 2;\r\n }\r\n\r\n const ts = deps.load(tsApiPath) as TypeScriptLike;\r\n const tscArgs = [...args.tscArgs];\r\n const temporaries: string[] = [];\r\n\r\n const project = findProjectConfig(tscArgs, cwd);\r\n if (project !== undefined && existsSync(project.path)) {\r\n const audit = auditConfig(project.path, ts);\r\n if (audit.missing.length > 0) {\r\n if (args.wcsDefaults) {\r\n const tempConfig = writeDefaultsConfig(project.path, audit);\r\n temporaries.push(tempConfig);\r\n if (project.index === -1) tscArgs.push(\"-p\", tempConfig);\r\n else tscArgs[project.index] = tempConfig;\r\n io.stderr(`wcs-tsc: running with a temporary config that adds ${audit.missing.join(\", \")} (--wcs-defaults)\\n`);\r\n } else {\r\n io.stderr(`wcs-tsc: ${project.path} is missing ${audit.missing.join(\", \")} — HTML may not be checked; pass --wcs-defaults or add them\\n`);\r\n }\r\n }\r\n }\r\n\r\n const declaration = args.urlImports === \"any\" ? writeUrlImportsDeclaration() : undefined;\r\n if (declaration !== undefined) temporaries.push(declaration);\r\n\r\n const { createWcsLanguagePlugin } = deps.load(corePath) as {\r\n createWcsLanguagePlugin: (stateTagName?: string, options?: { mode: \"tsc\" }) => unknown;\r\n };\r\n const { runTsc } = deps.load(runTscPath) as {\r\n runTsc: (\r\n tscPath: string,\r\n options: { extraSupportedExtensions: string[]; extraExtensionsToRemove: string[] },\r\n getLanguagePlugins: (ts: unknown, options: { rootNames: readonly string[] }) => unknown[],\r\n ) => unknown;\r\n };\r\n\r\n const cleanup = (): void => {\r\n for (const file of temporaries.splice(0)) {\r\n /* v8 ignore next -- a temp file that vanished before cleanup is not an error */\r\n try { unlinkSync(file); } catch { /* best effort */ }\r\n }\r\n };\r\n process.once(\"exit\", cleanup);\r\n\r\n // tsc reads its arguments from process.argv when typescript/lib/tsc.js loads.\r\n process.argv = [process.argv[0], tscPath, ...tscArgs];\r\n runTsc(\r\n tscPath,\r\n { extraSupportedExtensions: [\".html\"], extraExtensionsToRemove: [] },\r\n (_ts, options) => {\r\n if (declaration !== undefined) (options.rootNames as string[]).push(declaration);\r\n // tsc mode: proxyCreateProgram supports one service script per file, so every\r\n // <wcs-state> block of a page is combined into one virtual TS module.\r\n return [createWcsLanguagePlugin(\"wcs-state\", { mode: \"tsc\" })];\r\n },\r\n );\r\n // Reached only when runTsc returns (tsc normally exits the process itself).\r\n cleanup();\r\n return 0;\r\n}\r\n\r\n/* v8 ignore start -- process plumbing; exercised by running the built bin */\r\nfunction defaultIo(): TscIo {\r\n return {\r\n stdout: (text) => process.stdout.write(text),\r\n stderr: (text) => process.stderr.write(text),\r\n cwd: () => process.cwd(),\r\n };\r\n}\r\n\r\nconst invokedAsBin = typeof process !== \"undefined\"\r\n && Array.isArray(process.argv)\r\n && /wcs-tsc(\\.mjs)?$/.test(process.argv[1] ?? \"\");\r\nif (invokedAsBin) {\r\n const code = main(process.argv.slice(2));\r\n if (code !== 0) process.exit(code);\r\n}\r\n/* v8 ignore stop */\r\n"],"names":[],"mappings":";;;;;;;;;;;AAEO,MAAM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KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AAC5C,QAAA,MAAM,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AAC5C,QAAA,GAAG,EAAE,MAAM,OAAO,CAAC,GAAG,EAAE;KACzB;AACH;AAEA,MAAM,YAAY,GAAG,OAAO,OAAO,KAAK;AACnC,OAAA,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI;AAC1B,OAAA,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACnD,IAAI,YAAY,EAAE;AAChB,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,IAAI,KAAK,CAAC;AAAE,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC;AACA;;"}
1
+ {"version":3,"file":"wcs-tsc.mjs","sources":["../../src/version.ts","../../src/cli/wcsTsc.ts"],"sourcesContent":["import pkg from \"../package.json\";\n\nexport const VERSION: string = pkg.version;\n","/**\n * wcsTsc.ts — the `wcs-tsc` command: `tsc` over `.html` files.\n *\n * wcs-tsc [--url-imports=any|error] [--wcs-defaults] [tsc arguments...]\n *\n * Every `<wcs-state>` inline `<script type=\"module\">` is mapped through the same\n * Volar language plugin the VS Code extension uses (dist/tsc-core.cjs, built from\n * vscode-wcs), so `this.coutn++` fails CI with a `file.html(line,col): error TS2339`\n * exactly where the editor underlines it. The mechanism is vue-tsc's:\n * `@volar/typescript`'s `runTsc` patches the `typescript/lib/tsc.js` the project\n * already has to accept `.html` and to build the program through the plugin.\n *\n * Options\n * --url-imports=any (default) treat every `https://` / `http://` module import\n * as `any` — buildless pages import from a CDN, and tsc has\n * nothing to resolve those against. `@wcstack/state` URL\n * imports are stripped by the plugin and typed by its preamble.\n * --url-imports=error leave URL imports alone (TS2307 for each).\n * --wcs-defaults when the project tsconfig lacks what the check needs\n * (`include` covering `**\\/*.html`, `noImplicitThis`, `allowJs`,\n * `checkJs`), run with a temporary config that extends it and\n * adds them, instead of only warning.\n *\n * Peers: `typescript` (required), `@volar/typescript` + `@volar/language-core`\n * (optional — only this command needs them). Resolved from the project first,\n * then from this package's own location.\n *\n * Exit codes: tsc's own (0 clean / 1 type errors / 2 usage) — plus 2 when the peers\n * are missing or the arguments are invalid.\n */\n\nimport { existsSync, mkdtempSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { tmpdir } from \"node:os\";\nimport { basename, dirname, isAbsolute, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { VERSION } from \"../version.js\";\n\nexport interface TscIo {\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n readonly cwd: () => string;\n}\n\nexport interface TscArgs {\n readonly urlImports: \"any\" | \"error\";\n readonly wcsDefaults: boolean;\n readonly help: boolean;\n readonly version: boolean;\n /** Everything else, handed to tsc verbatim. */\n readonly tscArgs: readonly string[];\n readonly invalid: readonly string[];\n}\n\nconst USAGE =\n \"usage: wcs-tsc [--url-imports=any|error] [--wcs-defaults] [tsc arguments...]\\n\" +\n \" e.g. wcs-tsc --noEmit wcs-tsc -p tsconfig.json --noEmit\\n\";\n\nexport function parseTscArgs(argv: readonly string[]): TscArgs {\n let urlImports: TscArgs[\"urlImports\"] = \"any\";\n let wcsDefaults = false;\n let help = false;\n let version = false;\n const tscArgs: string[] = [];\n const invalid: string[] = [];\n for (const arg of argv) {\n if (arg.startsWith(\"--url-imports=\")) {\n const value = arg.slice(\"--url-imports=\".length);\n if (value === \"any\" || value === \"error\") urlImports = value;\n else invalid.push(arg);\n } else if (arg === \"--wcs-defaults\") wcsDefaults = true;\n else if (arg === \"--wcs-help\") help = true;\n else if (arg === \"--wcs-version\") version = true;\n else tscArgs.push(arg);\n }\n return { urlImports, wcsDefaults, help, version, tscArgs, invalid };\n}\n\n/** Resolve a module from the project (cwd) first, then from this package. */\nexport function resolveFromProject(id: string, cwd: string, fromUrl: string = import.meta.url): string | undefined {\n for (const base of [join(cwd, \"__wcs_tsc_resolve__.js\"), fromUrl]) {\n try {\n return createRequire(base).resolve(id);\n } catch {\n /* try the next base */\n }\n }\n return undefined;\n}\n\n/** The tsconfig tsc will read: `-p/--project` (a file or a directory), else ./tsconfig.json. */\nexport function findProjectConfig(tscArgs: readonly string[], cwd: string): { path: string; index: number } | undefined {\n for (let i = 0; i < tscArgs.length; i++) {\n const arg = tscArgs[i];\n let value: string | undefined;\n let index = i;\n if (arg === \"-p\" || arg === \"--project\") {\n value = tscArgs[i + 1];\n index = i + 1;\n } else if (arg.startsWith(\"--project=\") || arg.startsWith(\"-p=\")) {\n value = arg.slice(arg.indexOf(\"=\") + 1);\n }\n if (value === undefined) continue;\n let path = isAbsolute(value) ? value : resolve(cwd, value);\n if (existsSync(path) && !path.endsWith(\".json\")) path = join(path, \"tsconfig.json\");\n return { path, index };\n }\n const fallback = join(cwd, \"tsconfig.json\");\n return existsSync(fallback) ? { path: fallback, index: -1 } : undefined;\n}\n\nexport interface ConfigAudit {\n /** Human-readable names of what is missing (empty = ready). */\n readonly missing: readonly string[];\n readonly include: readonly string[] | undefined;\n readonly compilerOptions: Readonly<Record<string, unknown>>;\n /** No `target` / `lib` at all (tsc defaults to ES5, whose lib lacks the Map / Set / Promise types the `this` preamble uses). */\n readonly needsTarget: boolean;\n}\n\n/**\n * Check the project tsconfig for what the HTML check needs. `include` is only\n * checked when present (tsc's default `**\\/*` already picks `.html` up once the\n * extension is registered); a `files`-only config never sees HTML.\n */\nexport function auditConfig(configPath: string, ts: TypeScriptLike): ConfigAudit {\n const read = ts.readConfigFile(configPath, ts.sys.readFile);\n const raw = (read.config ?? {}) as { include?: unknown; files?: unknown; compilerOptions?: Record<string, unknown> };\n const parsed = ts.parseJsonConfigFileContent(read.config ?? {}, ts.sys, toPosix(dirname(configPath)), undefined, toPosix(configPath));\n const options = parsed.options as Record<string, unknown>;\n const missing: string[] = [];\n const include = Array.isArray(raw.include) ? (raw.include as string[]) : undefined;\n const coversHtml = (patterns: readonly string[]): boolean => patterns.some((p) => /\\.html?$|\\*\\*\\/\\*$|\\*$/.test(p) && !/\\.(ts|js|tsx|jsx|mts|cts|mjs|cjs)$/.test(p));\n if (include !== undefined && !coversHtml(include)) missing.push('include: \"**/*.html\"');\n else if (include === undefined && Array.isArray(raw.files)) missing.push('include: \"**/*.html\" (a files-only config never sees HTML)');\n // `strict: true` implies noImplicitThis unless it is explicitly turned off.\n const noImplicitThis = options.noImplicitThis ?? options.strict === true;\n if (noImplicitThis !== true) missing.push(\"compilerOptions.noImplicitThis: true\");\n if (options.allowJs !== true) missing.push(\"compilerOptions.allowJs: true\");\n if (options.checkJs !== true) missing.push(\"compilerOptions.checkJs: true\");\n // With neither target nor lib, tsc's ES5 default lib has no Map / Set / Promise:\n // the preamble's `_WcsThis<T>` degrades silently and `this.typo` stops being an error.\n const target = options.target as number | undefined;\n const needsTarget = options.lib === undefined && (target === undefined || target < ts.ScriptTarget.ES2015);\n if (needsTarget) missing.push('compilerOptions.target: \"ES2015\" or later (the this-typing preamble uses Map / Set / Promise)');\n return { missing, include, compilerOptions: raw.compilerOptions ?? {}, needsTarget };\n}\n\n/** Write a temporary config next to the project one that extends it with the missing pieces. */\nexport function writeDefaultsConfig(configPath: string, audit: ConfigAudit): string {\n const dir = dirname(configPath);\n const tempPath = join(dir, `.wcs-tsc.${process.pid}.tsconfig.json`);\n const include = audit.include !== undefined ? [...audit.include, \"**/*.html\"] : [\"**/*\", \"**/*.html\"];\n const config = {\n extends: `./${basename(configPath)}`,\n compilerOptions: {\n allowJs: true,\n checkJs: true,\n noImplicitThis: true,\n // only when the project set neither target nor lib — never override an explicit choice\n ...(audit.needsTarget ? { target: \"ESNext\" } : {}),\n },\n include,\n };\n writeFileSync(tempPath, JSON.stringify(config, null, 2), \"utf8\");\n return tempPath;\n}\n\n/** Ambient shorthand modules: every `http(s)://` import types as `any`. */\nexport function writeUrlImportsDeclaration(): string {\n const dir = mkdtempSync(join(tmpdir(), \"wcs-tsc-\"));\n const path = join(dir, \"url-imports.d.ts\");\n writeFileSync(path, `// wcs-tsc --url-imports=any: CDN module imports resolve to any.\\ndeclare module \"https://*\";\\ndeclare module \"http://*\";\\n`, \"utf8\");\n return path;\n}\n\nexport interface TypeScriptLike {\n readConfigFile(path: string, readFile: (path: string) => string | undefined): { config?: unknown; error?: unknown };\n parseJsonConfigFileContent(json: unknown, host: unknown, basePath: string, existing?: unknown, configFileName?: string): { options: unknown };\n sys: { readFile(path: string): string | undefined };\n ScriptTarget: { ES2015: number };\n}\n\nfunction toPosix(path: string): string {\n return path.replace(/\\\\/g, \"/\");\n}\n\nfunction tscCoreCandidates(fromUrl: string): string[] {\n const here = dirname(fileURLToPath(fromUrl));\n return [join(here, \"tsc-core.cjs\"), join(here, \"..\", \"dist\", \"tsc-core.cjs\"), join(here, \"..\", \"..\", \"dist\", \"tsc-core.cjs\")];\n}\n\n/** Module resolution / loading, injectable so the whole flow can be tested in-process. */\nexport interface MainDeps {\n readonly resolve: (id: string, cwd: string) => string | undefined;\n readonly load: (path: string) => unknown;\n}\n\n/* v8 ignore start -- the real resolver / loader; tests inject fakes to keep tsc from exiting the process */\nconst defaultDeps: MainDeps = {\n resolve: (id, cwd) => resolveFromProject(id, cwd),\n load: (path) => createRequire(import.meta.url)(path),\n};\n/* v8 ignore stop */\n\n/**\n * Prepare and run. Returns an exit code only on the paths that do not reach tsc;\n * tsc itself calls `process.exit` with its own code.\n */\nexport function main(argv: readonly string[], io: TscIo = defaultIo(), deps: MainDeps = defaultDeps): number {\n const args = parseTscArgs(argv);\n if (args.version) {\n io.stdout(`${VERSION}\\n`);\n return 0;\n }\n if (args.help) {\n io.stdout(USAGE);\n return 0;\n }\n if (args.invalid.length > 0) {\n io.stderr(`invalid option(s): ${args.invalid.join(\" \")}\\n${USAGE}`);\n return 2;\n }\n const cwd = io.cwd();\n\n const runTscPath = deps.resolve(\"@volar/typescript/lib/quickstart/runTsc.js\", cwd);\n if (runTscPath === undefined) {\n io.stderr(\"wcs-tsc needs @volar/typescript (an optional peer): npm i -D @volar/typescript@~2.4.0 @volar/language-core@~2.4.0\\n\");\n return 2;\n }\n const tscPath = deps.resolve(\"typescript/lib/tsc.js\", cwd);\n const tsApiPath = deps.resolve(\"typescript\", cwd);\n if (tscPath === undefined || tsApiPath === undefined) {\n io.stderr(\"wcs-tsc needs typescript (a peer): npm i -D typescript\\n\");\n return 2;\n }\n const corePath = tscCoreCandidates(import.meta.url).find((p) => existsSync(p));\n /* v8 ignore next 4 -- tests run after `npm run build`, so the bundle is always present */\n if (corePath === undefined) {\n io.stderr(\"wcs-tsc: dist/tsc-core.cjs not found — run `npm run build` in packages/typescript\\n\");\n return 2;\n }\n\n const ts = deps.load(tsApiPath) as TypeScriptLike;\n const tscArgs = [...args.tscArgs];\n const temporaries: string[] = [];\n\n const project = findProjectConfig(tscArgs, cwd);\n if (project !== undefined && existsSync(project.path)) {\n const audit = auditConfig(project.path, ts);\n if (audit.missing.length > 0) {\n if (args.wcsDefaults) {\n const tempConfig = writeDefaultsConfig(project.path, audit);\n temporaries.push(tempConfig);\n if (project.index === -1) tscArgs.push(\"-p\", tempConfig);\n else tscArgs[project.index] = tempConfig;\n io.stderr(`wcs-tsc: running with a temporary config that adds ${audit.missing.join(\", \")} (--wcs-defaults)\\n`);\n } else {\n io.stderr(`wcs-tsc: ${project.path} is missing ${audit.missing.join(\", \")} — HTML may not be checked; pass --wcs-defaults or add them\\n`);\n }\n }\n }\n\n const declaration = args.urlImports === \"any\" ? writeUrlImportsDeclaration() : undefined;\n if (declaration !== undefined) temporaries.push(declaration);\n\n const { createWcsLanguagePlugin } = deps.load(corePath) as {\n createWcsLanguagePlugin: (stateTagName?: string, options?: { mode: \"tsc\" }) => unknown;\n };\n const { runTsc } = deps.load(runTscPath) as {\n runTsc: (\n tscPath: string,\n options: { extraSupportedExtensions: string[]; extraExtensionsToRemove: string[] },\n getLanguagePlugins: (ts: unknown, options: { rootNames: readonly string[] }) => unknown[],\n ) => unknown;\n };\n\n const cleanup = (): void => {\n for (const file of temporaries.splice(0)) {\n /* v8 ignore next -- a temp file that vanished before cleanup is not an error */\n try { unlinkSync(file); } catch { /* best effort */ }\n }\n };\n process.once(\"exit\", cleanup);\n\n // tsc reads its arguments from process.argv when typescript/lib/tsc.js loads.\n process.argv = [process.argv[0], tscPath, ...tscArgs];\n runTsc(\n tscPath,\n { extraSupportedExtensions: [\".html\"], extraExtensionsToRemove: [] },\n (_ts, options) => {\n if (declaration !== undefined) (options.rootNames as string[]).push(declaration);\n // tsc mode: proxyCreateProgram supports one service script per file, so every\n // <wcs-state> block of a page is combined into one virtual TS module.\n return [createWcsLanguagePlugin(\"wcs-state\", { mode: \"tsc\" })];\n },\n );\n // Reached only when runTsc returns (tsc normally exits the process itself).\n cleanup();\n return 0;\n}\n\n/* v8 ignore start -- process plumbing; exercised by running the built bin */\nfunction defaultIo(): TscIo {\n return {\n stdout: (text) => process.stdout.write(text),\n stderr: (text) => process.stderr.write(text),\n cwd: () => process.cwd(),\n };\n}\n\nconst invokedAsBin = typeof process !== \"undefined\"\n && Array.isArray(process.argv)\n && /wcs-tsc(\\.mjs)?$/.test(process.argv[1] ?? \"\");\nif (invokedAsBin) {\n const code = main(process.argv.slice(2));\n if (code !== 0) process.exit(code);\n}\n/* v8 ignore stop */\n"],"names":[],"mappings":";;;;;;;;;;;AAEO,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO;;ACF1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AAyBH,MAAM,KAAK,GACT,gFAAgF;AAChF,IAAA,6EAA6E;AAEzE,SAAU,YAAY,CAAC,IAAuB,EAAA;IAClD,IAAI,UAAU,GAA0B,KAAK;IAC7C,IAAI,WAAW,GAAG,KAAK;IACvB,IAAI,IAAI,GAAG,KAAK;IAChB,IAAI,OAAO,G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CAAC,OAAO,CAAC,IAAI;AAC1B,OAAA,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACnD,IAAI,YAAY,EAAE;AAChB,IAAA,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,IAAI,KAAK,CAAC;AAAE,QAAA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;AACpC;AACA;;"}
package/package.json CHANGED
@@ -1,84 +1,84 @@
1
- {
2
- "name": "@wcstack/typescript",
3
- "version": "1.32.0",
4
- "description": "TypeScript tooling for wcstack apps: wcs-schema generates the sidecar stateSchema from a typed state file, so wcs-validate checks data-wcs paths against real types in CI and every editor.",
5
- "type": "module",
6
- "main": "./dist/index.esm.js",
7
- "module": "./dist/index.esm.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.esm.js"
13
- }
14
- },
15
- "bin": {
16
- "wcs-schema": "./dist/wcs-schema.mjs",
17
- "wcs-tsc": "./dist/wcs-tsc.mjs"
18
- },
19
- "files": [
20
- "dist"
21
- ],
22
- "scripts": {
23
- "clean": "rimraf dist .tsc-out",
24
- "build": "rimraf dist .tsc-out && tsc && rollup -c && node scripts/build-schema-core.mjs",
25
- "test": "vitest run",
26
- "test:watch": "vitest",
27
- "test:coverage": "vitest run --coverage",
28
- "lint": "eslint src"
29
- },
30
- "keywords": [
31
- "web-components",
32
- "wcstack",
33
- "typescript",
34
- "json-schema",
35
- "state",
36
- "data-wcs",
37
- "cli",
38
- "static-analysis"
39
- ],
40
- "author": "mogera551",
41
- "homepage": "https://wcstack.github.io",
42
- "repository": {
43
- "type": "git",
44
- "url": "https://github.com/wcstack/wcstack.git",
45
- "directory": "packages/typescript"
46
- },
47
- "bugs": {
48
- "url": "https://github.com/wcstack/wcstack/issues"
49
- },
50
- "license": "MIT",
51
- "peerDependencies": {
52
- "@volar/language-core": "~2.4.0",
53
- "@volar/typescript": "~2.4.0",
54
- "typescript": ">=5.0"
55
- },
56
- "peerDependenciesMeta": {
57
- "@volar/language-core": {
58
- "optional": true
59
- },
60
- "@volar/typescript": {
61
- "optional": true
62
- }
63
- },
64
- "devDependencies": {
65
- "@eslint/js": "^9.39.1",
66
- "@volar/language-core": "~2.4.0",
67
- "@volar/typescript": "~2.4.0",
68
- "@rollup/plugin-json": "^6.1.0",
69
- "@rollup/plugin-typescript": "^11.1.6",
70
- "@types/node": "^22.10.0",
71
- "@typescript-eslint/eslint-plugin": "^8.33.1",
72
- "@typescript-eslint/parser": "^8.33.1",
73
- "@vitest/coverage-v8": "^4.0.15",
74
- "eslint": "^9.39.1",
75
- "globals": "^16.2.0",
76
- "rimraf": "^6.0.1",
77
- "rollup": "^4.22.4",
78
- "rollup-plugin-dts": "^6.1.1",
79
- "tslib": "^2.8.1",
80
- "typescript": "^5.9.3",
81
- "typescript-eslint": "^8.49.0",
82
- "vitest": "^4.0.15"
83
- }
84
- }
1
+ {
2
+ "name": "@wcstack/typescript",
3
+ "version": "1.33.0",
4
+ "description": "TypeScript tooling for wcstack apps: wcs-schema generates the sidecar stateSchema from a typed state file, so wcs-validate checks data-wcs paths against real types in CI and every editor.",
5
+ "type": "module",
6
+ "main": "./dist/index.esm.js",
7
+ "module": "./dist/index.esm.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.esm.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "wcs-schema": "./dist/wcs-schema.mjs",
17
+ "wcs-tsc": "./dist/wcs-tsc.mjs"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "clean": "rimraf dist .tsc-out",
24
+ "build": "rimraf dist .tsc-out && tsc && rollup -c && node scripts/build-schema-core.mjs",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "test:coverage": "vitest run --coverage",
28
+ "lint": "eslint src"
29
+ },
30
+ "keywords": [
31
+ "web-components",
32
+ "wcstack",
33
+ "typescript",
34
+ "json-schema",
35
+ "state",
36
+ "data-wcs",
37
+ "cli",
38
+ "static-analysis"
39
+ ],
40
+ "author": "mogera551",
41
+ "homepage": "https://wcstack.github.io",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/wcstack/wcstack.git",
45
+ "directory": "packages/typescript"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/wcstack/wcstack/issues"
49
+ },
50
+ "license": "MIT",
51
+ "peerDependencies": {
52
+ "@volar/language-core": "~2.4.0",
53
+ "@volar/typescript": "~2.4.0",
54
+ "typescript": ">=5.0"
55
+ },
56
+ "peerDependenciesMeta": {
57
+ "@volar/language-core": {
58
+ "optional": true
59
+ },
60
+ "@volar/typescript": {
61
+ "optional": true
62
+ }
63
+ },
64
+ "devDependencies": {
65
+ "@eslint/js": "^9.39.1",
66
+ "@volar/language-core": "~2.4.0",
67
+ "@volar/typescript": "~2.4.0",
68
+ "@rollup/plugin-json": "^6.1.0",
69
+ "@rollup/plugin-typescript": "^11.1.6",
70
+ "@types/node": "^22.10.0",
71
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
72
+ "@typescript-eslint/parser": "^8.33.1",
73
+ "@vitest/coverage-v8": "^4.0.15",
74
+ "eslint": "^9.39.1",
75
+ "globals": "^16.2.0",
76
+ "rimraf": "^6.0.1",
77
+ "rollup": "^4.22.4",
78
+ "rollup-plugin-dts": "^6.1.1",
79
+ "tslib": "^2.8.1",
80
+ "typescript": "^5.9.3",
81
+ "typescript-eslint": "^8.49.0",
82
+ "vitest": "^4.0.15"
83
+ }
84
+ }