@ttsc/lint 0.24.0 → 0.25.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/lib/index.d.ts CHANGED
@@ -69,4 +69,4 @@ export default function createTtscPlugin(context: TtscPluginFactoryContext<ITtsc
69
69
  * template consumes its own escapes, so reading this file's text instead would
70
70
  * check characters no consumer ever sees.
71
71
  */
72
- export declare const TTSX_EXTRACTOR_SCRIPT = "// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport * as fs from \"node:fs\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { Buffer } from \"node:buffer\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { createHash } from \"node:crypto\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { createRequire, registerHooks } from \"node:module\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport * as path from \"node:path\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nconst configUrl = %CONFIG_IMPORT%;\nconst outputPath = %CONFIG_OUTPUT%;\nconst resolutionRoot = path.resolve(%CONFIG_ROOT%);\nconst requireFromConfig = createRequire(configUrl);\nconst CONFIG_KEYS = new Set<string>([\n \"files\",\n \"ignores\",\n \"extends\",\n \"plugins\",\n \"rules\",\n \"format\",\n]);\nconst dependencies = new Map<string, {\n digest: string;\n kind: \"directory\" | \"file\" | \"optional-file\";\n path: string;\n owners: Set<string>;\n}>();\nconst graphNodes = new Map<string, string>();\nconst graphEdges: Array<{\n child: string;\n packageBoundary: boolean;\n parent: string;\n}> = [];\nconst configLocation = fileURLToPath(configUrl);\n// Every spelling of this config the module system might key an edge under.\n//\n// Which one it uses is not knowable from here, and guessing has failed in both\n// directions. A path handed in by another producer can be escaped by a rule\n// Node does not share. Node respells a resolved file module through its real\n// path unless \"--preserve-symlinks\" is set, so a config reached through a\n// symlinked directory is keyed by its target. And a Windows 8.3 short name is\n// not a symlink: fs.realpathSync expands it, the module resolver does not, so\n// asking the volume there produces a spelling no edge carries.\n//\n// A seed that names a URL no edge was keyed under sits on a node with no\n// outgoing edges, the walk ends immediately, and every dependency recorded\n// after the first import is demoted from watch to cache. That failure is\n// silent: the build still succeeds and simply stops reacting. Seeding every\n// spelling costs one extra queue entry and cannot be wrong.\nconst configUrlSpellings = [\n ...new Set([\n configUrl,\n pathToFileURL(configLocation).href,\n pathToFileURL(realConfigLocation()).href,\n ]),\n];\nfor (const spelling of configUrlSpellings) {\n graphNodes.set(spelling, configLocation);\n}\nrecordDependency(\n \"file\",\n configLocation,\n createHash(\"sha256\").update(fs.readFileSync(configLocation)).digest(\"hex\"),\n configUrlSpellings,\n);\nrecordPackageManifests(configLocation, configUrlSpellings);\n\ndeclare const process: {\n cwd(): string;\n platform: string;\n stdout: { write(value: string): void };\n stderr: { write(value: string): void };\n exit(code?: number): never;\n};\n\nconst hooks = registerHooks({\n resolve(specifier, context, nextResolve) {\n const resolved = nextResolve(specifier, context);\n if (typeof resolved.url !== \"string\" || !resolved.url.startsWith(\"file:\")) {\n return resolved;\n }\n const url = new URL(resolved.url).href;\n const parent = context.parentURL && new URL(context.parentURL).href;\n const location = fileURLToPath(url);\n // The entry is recognized by what was asked for, not only by what came\n // back. A module URL is assigned by whoever loaded it: a compiling loader\n // can serve the config from its emitted output, and a platform can hand\n // back a different spelling of the same file. Either way the URL bears no\n // resemblance to the one this process was given, so the config's own\n // imports would be rejected here \u2014 their parent is a URL no node was\n // recorded under \u2014 and the graph would collapse to the records made before\n // the first import. The request itself is unambiguous, so it decides.\n const entry =\n specifier === configUrl ||\n url === new URL(configUrl).href ||\n samePhysicalPath(location, configLocation);\n if (!entry && (parent === undefined || !graphNodes.has(parent))) {\n return resolved;\n }\n graphNodes.set(url, location);\n if (parent !== undefined) {\n graphEdges.push({\n child: url,\n packageBoundary:\n pathHasNodeModules(location) && !isLocalModuleSpecifier(specifier),\n parent,\n });\n recordResolutionTopology(\n specifier,\n parent,\n url,\n location,\n context.conditions,\n );\n }\n try {\n recordDependency(\n \"file\",\n location,\n createHash(\"sha256\").update(fs.readFileSync(location)).digest(\"hex\"),\n [url],\n );\n } catch {\n // The evaluator remains authoritative for the load error. An unreadable\n // dependency simply makes this result non-cacheable in the parent.\n recordDependency(\"file\", location, \"\", [url]);\n }\n return resolved;\n },\n});\n\ntry {\n const importedConfig = configLocation.toLowerCase().endsWith(\".json\")\n ? JSON.parse(fs.readFileSync(configLocation, \"utf8\").replace(/^\uFEFF/, \"\"))\n : await import(configUrl);\n const current = await resolveConfig(importedConfig, true);\n const pluginMaps = collectPluginObjects(current);\n const entries: Array<{ namespace: string; source: string }> = [];\n for (const map of pluginMaps) {\n for (const [namespace, value] of Object.entries(map)) {\n const source = extractPluginSource(value);\n if (source === undefined || source.length === 0) {\n throw new Error(\n `contributor ${JSON.stringify(namespace)} must resolve to an object with a non-empty \"source\" string`,\n );\n }\n entries.push({ namespace, source });\n }\n }\n fs.writeFileSync(outputPath, JSON.stringify({\n dependencies: finalizeDependencies(),\n entries,\n }), \"utf8\");\n} catch (error) {\n process.stderr.write(error instanceof Error && error.stack ? error.stack : String(error));\n process.exit(1);\n} finally {\n hooks.deregister();\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\";\n}\n\nfunction recordDependency(\n kind: \"directory\" | \"file\" | \"optional-file\",\n location: string,\n digest: string,\n owners: readonly string[],\n): void {\n const key = kind + \"\\0\" + location;\n const previous = dependencies.get(key);\n const mergedOwners = previous?.owners ?? new Set<string>();\n for (const owner of owners) mergedOwners.add(owner);\n dependencies.set(key, {\n digest: previous !== undefined && previous.digest !== digest ? \"\" : digest,\n kind,\n owners: mergedOwners,\n path: location,\n });\n}\n\nfunction isLocalModuleSpecifier(specifier: string): boolean {\n return specifier.startsWith(\".\") ||\n specifier.startsWith(\"/\") ||\n specifier.startsWith(\"file:\") ||\n /^[A-Za-z]:[\\\\/]/.test(specifier);\n}\n\nfunction pathHasNodeModules(location: string): boolean {\n return location.replaceAll(\"\\\\\", \"/\").split(\"/\").includes(\"node_modules\");\n}\n\nfunction recordResolutionTopology(\n specifier: string,\n parentUrl: string,\n childUrl: string,\n childLocation: string,\n conditions: readonly string[],\n): void {\n const owners = [parentUrl, childUrl];\n const parentLocation = graphNodes.get(parentUrl);\n if (parentLocation !== undefined && isLocalModuleSpecifier(specifier)) {\n recordDirectoryDependency(path.dirname(parentLocation), owners);\n }\n recordDirectoryDependency(path.dirname(childLocation), owners);\n recordPackageManifests(childLocation, owners);\n if (parentLocation !== undefined && !isLocalModuleSpecifier(specifier)) {\n recordNodeModulesSearchDirectories(\n parentLocation,\n specifier,\n childLocation,\n owners,\n conditions,\n );\n }\n}\n\nfunction recordDirectoryDependency(\n location: string,\n owners: readonly string[],\n): void {\n try {\n recordDependency(\"directory\", location, directoryDigest(location), owners);\n } catch {\n recordDependency(\"directory\", location, \"\", owners);\n }\n}\n\nfunction directoryDigest(location: string): string {\n const entries: Buffer[] = [];\n if (process.platform === \"win32\") {\n for (const entry of fs.readdirSync(location, { withFileTypes: true })) {\n let target = Buffer.alloc(0);\n if (entry.isSymbolicLink()) {\n try {\n target = Buffer.from(\n fs.readlinkSync(path.join(location, entry.name)),\n \"utf8\",\n );\n } catch {\n target = Buffer.from(\"<unreadable>\");\n }\n }\n entries.push(directoryDigestRecord(Buffer.from(entry.name), entry, target));\n }\n } else {\n for (const entry of fs.readdirSync(location, {\n encoding: \"buffer\",\n withFileTypes: true,\n })) {\n let target = Buffer.alloc(0);\n if (entry.isSymbolicLink()) {\n try {\n target = fs.readlinkSync(\n Buffer.concat([\n Buffer.from(location),\n Buffer.from(path.sep),\n entry.name,\n ]),\n { encoding: \"buffer\" },\n );\n } catch {\n target = Buffer.from(\"<unreadable>\");\n }\n }\n entries.push(directoryDigestRecord(entry.name, entry, target));\n }\n }\n entries.sort(Buffer.compare);\n const serialized = Buffer.concat(\n entries.flatMap((entry, index) =>\n index === 0 ? [entry] : [Buffer.from([0]), entry],\n ),\n );\n return createHash(\"sha256\").update(serialized).digest(\"hex\");\n}\n\nfunction directoryDigestRecord(\n name: Buffer,\n entry: {\n isDirectory(): boolean;\n isFile(): boolean;\n isSymbolicLink(): boolean;\n },\n target: Buffer,\n): Buffer {\n const kind = entry.isDirectory()\n ? \"directory\"\n : entry.isFile()\n ? \"file\"\n : entry.isSymbolicLink()\n ? \"symlink\"\n : \"other\";\n return Buffer.concat([name, Buffer.from(\"\\0\" + kind + \"\\0\"), target]);\n}\n\nfunction optionalFileDigest(location: string): string {\n try {\n if (fs.statSync(location).isFile()) {\n return createHash(\"sha256\")\n .update(Buffer.concat([Buffer.from(\"file\\0\"), fs.readFileSync(location)]))\n .digest(\"hex\");\n }\n } catch {\n // Missing, unreadable, and non-file candidates share the absent state.\n }\n return createHash(\"sha256\").update(\"missing\\0\").digest(\"hex\");\n}\n\nfunction recordOptionalFileDependency(\n location: string,\n owners: readonly string[],\n): boolean {\n try {\n if (fs.statSync(location).isFile()) {\n recordDependency(\n \"file\",\n location,\n createHash(\"sha256\").update(fs.readFileSync(location)).digest(\"hex\"),\n owners,\n );\n return true;\n }\n } catch {\n // The exact missing path remains a dependency of the resolution result.\n }\n recordDependency(\"optional-file\", location, optionalFileDigest(location), owners);\n return false;\n}\n\nfunction recordPackageManifests(\n location: string,\n owners: readonly string[],\n): void {\n let current = path.dirname(location);\n while (true) {\n const manifest = path.join(current, \"package.json\");\n if (recordOptionalFileDependency(manifest, owners)) return;\n const parent = path.dirname(current);\n if (parent === current || path.basename(current) === \"node_modules\") return;\n current = parent;\n }\n}\n\nfunction recordNodeModulesSearchDirectories(\n parentLocation: string,\n specifier: string,\n childLocation: string,\n owners: readonly string[],\n conditions: readonly string[],\n): void {\n const packageName = modulePackageName(specifier);\n const scope =\n specifier.startsWith(\"@\") && specifier.includes(\"/\")\n ? specifier.slice(0, specifier.indexOf(\"/\"))\n : undefined;\n let current = path.dirname(parentLocation);\n while (true) {\n // A newly created nearer node_modules directory can shadow the package\n // selected by this evaluation, so missing search levels are dependencies.\n recordDirectoryDependency(current, owners);\n const modules = path.join(current, \"node_modules\");\n try {\n if (fs.statSync(modules).isDirectory()) {\n recordDirectoryDependency(modules, owners);\n if (scope !== undefined) {\n const scoped = path.join(modules, scope);\n try {\n if (fs.statSync(scoped).isDirectory()) {\n recordDirectoryDependency(scoped, owners);\n }\n } catch {\n // The directory digest of node_modules records a missing scope.\n }\n }\n if (packageName !== undefined) {\n const selected = recordPackageCandidateTopology(\n modules,\n packageName,\n specifier,\n childLocation,\n owners,\n conditions,\n );\n if (\n selected ||\n resolvedPackageContains(modules, packageName, childLocation)\n ) {\n return;\n }\n }\n }\n } catch {\n // Missing search levels do not participate in the current resolution.\n }\n if (\n packageName === undefined &&\n samePhysicalPath(current, resolutionRoot)\n ) {\n return;\n }\n const parent = path.dirname(current);\n if (parent === current) return;\n current = parent;\n }\n}\n\nfunction recordPackageCandidateTopology(\n modules: string,\n packageName: string,\n specifier: string,\n childLocation: string,\n owners: readonly string[],\n conditions: readonly string[],\n): boolean {\n const packageRoot = path.join(modules, packageName);\n try {\n if (!fs.statSync(packageRoot).isDirectory()) return false;\n } catch {\n return false;\n }\n const subpath = specifier\n .slice(packageName.length)\n .replace(/^[/\\\\]+/, \"\");\n const rootTopology = recordPackageRootTopology(\n packageRoot,\n owners,\n subpath === \"\",\n subpath === \"\" ? \".\" : \"./\" + subpath.replaceAll(\"\\\\\", \"/\"),\n childLocation,\n conditions,\n );\n if (subpath !== \"\" && !rootTopology.hasExports) {\n return (\n recordPackageSubpathTopology(\n packageRoot,\n subpath,\n childLocation,\n owners,\n ) || rootTopology.selected\n );\n }\n return rootTopology.selected;\n}\n\nfunction recordPackageRootTopology(\n packageRoot: string,\n owners: readonly string[],\n useMain: boolean,\n packageSubpath: string,\n childLocation: string,\n conditions: readonly string[],\n): { hasExports: boolean; selected: boolean } {\n const normalizedRoot = path.resolve(packageRoot);\n const manifest = path.join(normalizedRoot, \"package.json\");\n const legacySelected = (): boolean =>\n useMain &&\n packagePathCandidateMatchesChild(normalizedRoot, childLocation, true);\n if (!recordOptionalFileDependency(manifest, owners)) {\n const selected = legacySelected();\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return { hasExports: false, selected };\n }\n try {\n const value = JSON.parse(fs.readFileSync(manifest, \"utf8\"));\n if (value !== null && typeof value === \"object\") {\n const metadata = value as Record<string, unknown>;\n const hasExports =\n metadata.exports !== undefined && metadata.exports !== null;\n if (hasExports) {\n const target = selectPackageExportsTarget(\n metadata.exports,\n packageSubpath,\n new Set(conditions),\n );\n const candidate =\n typeof target === \"string\"\n ? packageExportsTarget(normalizedRoot, target)\n : undefined;\n const selected =\n candidate !== undefined &&\n packagePathCandidateMatchesChild(\n candidate,\n childLocation,\n false,\n );\n if (selected) {\n recordPackagePathCandidate(candidate, owners);\n } else if (candidate !== undefined) {\n // A nearer package the search skipped starts winning the moment its\n // own active target appears, and neither the parent node_modules\n // listing nor the manifest changes when only that file is created.\n recordOptionalFileDependency(candidate, owners);\n }\n return { hasExports: true, selected };\n }\n let selected = legacySelected();\n if (useMain && typeof metadata.main === \"string\") {\n // CommonJS main is a legacy path, not an exports target. Node resolves\n // it literally and permits absolute paths and paths outside the package.\n const main = path.resolve(normalizedRoot, metadata.main);\n recordPackagePathCandidate(main, owners);\n selected =\n packagePathCandidateMatchesChild(main, childLocation, true) ||\n selected;\n }\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return {\n hasExports: false,\n selected,\n };\n }\n } catch {\n // Node owns malformed-manifest diagnostics; the manifest digest is enough\n // to invalidate this evaluation when its contents change.\n }\n const selected = legacySelected();\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return { hasExports: false, selected };\n}\n\n// recordPackageIndexCandidates pins the LOAD_INDEX fallbacks of a package root\n// this resolution walked past without selecting. An empty package directory, or\n// one whose manifest declares no usable entry, becomes resolvable as soon as one\n// of these files exists, and that creation changes neither the parent directory\n// listing nor the manifest digest already recorded for the candidate.\nfunction recordPackageIndexCandidates(\n packageRoot: string,\n useMain: boolean,\n owners: readonly string[],\n): void {\n if (!useMain) return;\n for (const name of [\"index.js\", \"index.json\", \"index.node\"]) {\n recordOptionalFileDependency(path.join(packageRoot, name), owners);\n }\n}\n\nfunction selectPackageExportsTarget(\n exportsValue: unknown,\n packageSubpath: string,\n conditions: ReadonlySet<string>,\n): string | null | undefined {\n let mappings: unknown = exportsValue;\n if (\n typeof mappings === \"string\" ||\n Array.isArray(mappings) ||\n (isObject(mappings) &&\n Object.keys(mappings).every((key) => !key.startsWith(\".\")))\n ) {\n if (packageSubpath !== \".\") return undefined;\n return selectPackageTarget(mappings, \"\", false, conditions);\n }\n if (!isObject(mappings)) return undefined;\n if (\n Object.prototype.hasOwnProperty.call(mappings, packageSubpath) &&\n !packageSubpath.includes(\"*\") &&\n !packageSubpath.endsWith(\"/\")\n ) {\n return selectPackageTarget(\n mappings[packageSubpath],\n \"\",\n false,\n conditions,\n );\n }\n let bestMatch = \"\";\n let bestSubpath = \"\";\n for (const key of Object.keys(mappings)) {\n const wildcard = key.indexOf(\"*\");\n if (\n wildcard === -1 ||\n key.lastIndexOf(\"*\") !== wildcard ||\n !packageSubpath.startsWith(key.slice(0, wildcard))\n ) {\n continue;\n }\n const trailer = key.slice(wildcard + 1);\n if (\n packageSubpath.length < key.length ||\n !packageSubpath.endsWith(trailer) ||\n packagePatternKeyCompare(bestMatch, key) !== 1\n ) {\n continue;\n }\n bestMatch = key;\n bestSubpath = packageSubpath.slice(\n wildcard,\n packageSubpath.length - trailer.length,\n );\n }\n return bestMatch === \"\"\n ? undefined\n : selectPackageTarget(\n mappings[bestMatch],\n bestSubpath,\n true,\n conditions,\n );\n}\n\nfunction selectPackageTarget(\n target: unknown,\n subpath: string,\n pattern: boolean,\n conditions: ReadonlySet<string>,\n): string | null | undefined {\n if (typeof target === \"string\") {\n const selected = pattern ? target.replaceAll(\"*\", subpath) : target;\n return validPackageExportsTarget(selected) ? selected : undefined;\n }\n if (Array.isArray(target)) {\n for (const item of target) {\n const selected = selectPackageTarget(\n item,\n subpath,\n pattern,\n conditions,\n );\n if (selected !== undefined && selected !== null) return selected;\n }\n return null;\n }\n if (isObject(target)) {\n for (const [condition, value] of Object.entries(target)) {\n if (condition !== \"default\" && !conditions.has(condition)) continue;\n const selected = selectPackageTarget(\n value,\n subpath,\n pattern,\n conditions,\n );\n if (selected !== undefined) return selected;\n }\n return undefined;\n }\n return target === null ? null : undefined;\n}\n\nfunction packagePatternKeyCompare(left: string, right: string): number {\n const leftWildcard = left.indexOf(\"*\");\n const rightWildcard = right.indexOf(\"*\");\n const leftBase =\n leftWildcard === -1 ? left.length : leftWildcard + 1;\n const rightBase =\n rightWildcard === -1 ? right.length : rightWildcard + 1;\n if (leftBase > rightBase) return -1;\n if (rightBase > leftBase) return 1;\n if (leftWildcard === -1) return 1;\n if (rightWildcard === -1) return -1;\n if (left.length > right.length) return -1;\n if (right.length > left.length) return 1;\n return 0;\n}\n\nfunction packageExportsTarget(\n packageRoot: string,\n target: string,\n): string | undefined {\n if (!validPackageExportsTarget(target)) return undefined;\n try {\n // Node resolves an exports target as a URL against the package manifest,\n // so percent escapes, query strings, and fragments all take part in the\n // path it finally loads. Joining the raw target by hand diverges from that\n // whenever the target is anything but a plain relative path, and a target\n // Node resolves while this model rejects loses the selected file's\n // fingerprint, leaving a retargeted symlink cached as fresh.\n const packageUrl = pathToFileURL(path.join(packageRoot, \"package.json\"));\n const resolved = new URL(target, packageUrl);\n const packagePath = new URL(\".\", packageUrl).pathname;\n if (!resolved.pathname.startsWith(packagePath)) return undefined;\n return fileURLToPath(resolved);\n } catch {\n return undefined;\n }\n}\n\nfunction validPackageExportsTarget(target: string): boolean {\n if (!target.startsWith(\"./\") || /%2f|%5c/i.test(target)) return false;\n const components = target\n .slice(2)\n .replaceAll(\"\\\\\", \"/\")\n .split(\"/\");\n if (\n components.some(\n (component) => {\n try {\n const decoded = decodeURIComponent(component);\n return (\n decoded === \".\" ||\n decoded === \"..\" ||\n decoded.includes(\"/\") ||\n decoded.includes(\"\\\\\") ||\n decoded.toLowerCase() === \"node_modules\"\n );\n } catch {\n return true;\n }\n },\n )\n ) {\n return false;\n }\n return true;\n}\n\nfunction packagePathCandidateMatchesChild(\n candidate: string,\n childLocation: string,\n legacy: boolean,\n): boolean {\n let child: string;\n try {\n child = fs.realpathSync.native(childLocation);\n } catch {\n child = path.resolve(childLocation);\n }\n const candidates = legacy\n ? [\n candidate,\n candidate + \".js\",\n candidate + \".json\",\n candidate + \".node\",\n path.join(candidate, \"index.js\"),\n path.join(candidate, \"index.json\"),\n path.join(candidate, \"index.node\"),\n ]\n : [candidate];\n return candidates.some((location) => {\n try {\n return sameResolutionPath(fs.realpathSync.native(location), child);\n } catch {\n return false;\n }\n });\n}\n\nfunction recordPackageSubpathTopology(\n packageRoot: string,\n subpath: string,\n childLocation: string,\n owners: readonly string[],\n): boolean {\n const candidate = boundedPackageTarget(packageRoot, subpath);\n if (candidate === undefined) return false;\n recordPackagePathCandidate(candidate, owners);\n let selected = packagePathCandidateMatchesChild(\n candidate,\n childLocation,\n true,\n );\n try {\n if (!fs.statSync(candidate).isDirectory()) return selected;\n } catch {\n return selected;\n }\n const manifest = path.join(candidate, \"package.json\");\n if (!recordOptionalFileDependency(manifest, owners)) return selected;\n try {\n const value = JSON.parse(fs.readFileSync(manifest, \"utf8\"));\n if (value !== null && typeof value === \"object\") {\n const metadata = value as Record<string, unknown>;\n if (typeof metadata.main === \"string\") {\n const main = path.resolve(candidate, metadata.main);\n recordPackagePathCandidate(main, owners);\n selected =\n packagePathCandidateMatchesChild(main, childLocation, true) ||\n selected;\n }\n }\n } catch {\n // Node owns malformed nested-package diagnostics.\n }\n return selected;\n}\n\nfunction boundedPackageTarget(\n packageRoot: string,\n target: string,\n): string | undefined {\n const candidate = path.resolve(packageRoot, target);\n const relative = path.relative(packageRoot, candidate);\n if (\n relative === \"..\" ||\n relative.startsWith(\"..\" + path.sep) ||\n path.isAbsolute(relative)\n ) {\n return undefined;\n }\n return candidate;\n}\n\nfunction recordPackagePathCandidate(\n candidate: string,\n owners: readonly string[],\n visited: Set<string> = new Set(),\n depth = 0,\n): void {\n const normalized = path.resolve(candidate);\n // The depth bound owns termination. A platform-wide case fold would merge\n // paths that differ only by case, which a per-directory case-sensitive\n // Windows tree keeps distinct, and would truncate a valid symlink chain.\n if (depth >= 64 || visited.has(normalized)) return;\n visited.add(normalized);\n const parsed = path.parse(normalized);\n const components = normalized\n .slice(parsed.root.length)\n .split(path.sep)\n .filter(Boolean);\n let current = parsed.root;\n for (let index = 0; index < components.length; index++) {\n const component = components[index];\n const next = path.join(current, component);\n let entry: ReturnType<typeof fs.lstatSync>;\n try {\n entry = fs.lstatSync(next);\n } catch {\n recordDirectoryDependency(current, owners);\n return;\n }\n if (entry.isSymbolicLink()) {\n // The containing directory digest carries the raw link target.\n recordDirectoryDependency(current, owners);\n try {\n const target = fs.readlinkSync(next);\n const remainder = components.slice(index + 1);\n recordPackagePathCandidate(\n path.join(\n path.resolve(current, target),\n ...remainder,\n ),\n owners,\n visited,\n depth + 1,\n );\n } catch {\n // The lexical link record already carries the unreadable state.\n }\n }\n let isDirectory = entry.isDirectory();\n if (entry.isSymbolicLink()) {\n try {\n isDirectory = fs.statSync(next).isDirectory();\n } catch {\n return;\n }\n }\n if (index === components.length - 1) {\n recordDirectoryDependency(isDirectory ? next : current, owners);\n return;\n }\n if (!isDirectory) {\n recordDirectoryDependency(current, owners);\n return;\n }\n current = next;\n }\n recordDirectoryDependency(current, owners);\n}\n\nfunction modulePackageName(specifier: string): string | undefined {\n if (specifier.startsWith(\"@\")) {\n const components = specifier.split(\"/\");\n return components.length >= 2\n ? components[0] + \"/\" + components[1]\n : undefined;\n }\n const [name] = specifier.split(\"/\");\n return name && !name.startsWith(\"#\") ? name : undefined;\n}\n\nfunction resolvedPackageContains(\n modules: string,\n packageName: string,\n childLocation: string,\n): boolean {\n try {\n const packageRoot = fs.realpathSync(path.join(modules, packageName));\n const relative = path.relative(\n packageRoot,\n fs.realpathSync(childLocation),\n );\n return (\n relative === \"\" ||\n (relative !== \"..\" &&\n !relative.startsWith(\"..\" + path.sep) &&\n !path.isAbsolute(relative))\n );\n } catch {\n return false;\n }\n}\n\nfunction sameResolutionPath(left: string, right: string): boolean {\n return path.relative(left, right) === \"\";\n}\n\nfunction samePhysicalPath(left: string, right: string): boolean {\n try {\n return sameResolutionPath(realPath(left), realPath(right));\n } catch {\n // Fall back to the spellings themselves, folding case the way the platform\n // does. On the entry gate a false negative is catastrophic \u2014 the config\n // stops being recognized and its whole graph collapses \u2014 while a false\n // positive only over-includes, so the degradation has to lean toward \"same\n // file\". A drive-letter or component case difference is the ordinary\n // Windows situation; a per-directory case-sensitive tree is the rare one.\n return sameResolutionPath(left, right);\n }\n}\n\n/**\n * The config's real path, or its declared one when the volume will not say.\n *\n * A config can disappear between the host reading it and this loader starting,\n * and a throw here would replace a precise report from the import below with a\n * crash in bookkeeping. Seeding lexically instead only risks the demotion this\n * value exists to prevent, on a file that is already gone.\n */\nfunction realConfigLocation(): string {\n try {\n return realPath(configLocation);\n } catch {\n return configLocation;\n }\n}\n\nfunction realPath(location: string): string {\n return fs.realpathSync.native\n ? fs.realpathSync.native(location)\n : fs.realpathSync(location);\n}\n\nfunction finalizeDependencies(): Array<{\n digest: string;\n kind: \"directory\" | \"file\" | \"optional-file\";\n path: string;\n scope: \"cache\" | \"watch\";\n}> {\n const watched = graphWatchReachability();\n return [...dependencies.values()].map(({ owners, ...dependency }) => ({\n ...dependency,\n scope: [...owners].some((owner) => watched.has(owner))\n ? \"watch\"\n : \"cache\",\n }));\n}\n\nfunction graphWatchReachability(): Set<string> {\n const adjacency = new Map<string, typeof graphEdges>();\n for (const edge of graphEdges) {\n const outgoing = adjacency.get(edge.parent) ?? [];\n outgoing.push(edge);\n adjacency.set(edge.parent, outgoing);\n }\n const queue: Array<{ url: string; watched: boolean }> =\n configUrlSpellings.map((url) => ({ url, watched: true }));\n const visited = new Set<string>();\n const watched = new Set<string>();\n while (queue.length !== 0) {\n const state = queue.shift()!;\n const key = state.url + \"\\0\" + (state.watched ? \"1\" : \"0\");\n if (visited.has(key)) continue;\n visited.add(key);\n if (state.watched) watched.add(state.url);\n for (const edge of adjacency.get(state.url) ?? []) {\n const childLocation = graphNodes.get(edge.child);\n const childWatched = edge.packageBoundary\n ? false\n : childLocation !== undefined && !pathHasNodeModules(childLocation)\n ? true\n : state.watched;\n queue.push({ url: edge.child, watched: childWatched });\n }\n }\n return watched;\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nasync function resolveConfig(value: unknown, allowNamedConfig: boolean): Promise<unknown> {\n let current = value;\n for (let i = 0; i < 8; i++) {\n if (typeof current === \"function\") {\n current = await (current as () => unknown | Promise<unknown>)();\n allowNamedConfig = false;\n continue;\n }\n if (isObject(current) && !Array.isArray(current)) {\n if (hasOwn(current, \"default\")) {\n const defaultValue = current.default;\n if (isModuleNamespace(current) || !hasConfigKey(current)) {\n current = defaultValue;\n allowNamedConfig = false;\n continue;\n }\n const normalizedDefault = await resolveConfig(defaultValue, false);\n if (isObject(normalizedDefault) && !Array.isArray(normalizedDefault)) {\n current = mergeConfigObjects(normalizedDefault, current);\n allowNamedConfig = false;\n continue;\n }\n }\n if (allowNamedConfig && hasOwn(current, \"config\")) {\n current = current.config;\n allowNamedConfig = false;\n continue;\n }\n }\n break;\n }\n return current;\n}\n\nfunction isModuleNamespace(value: Record<string, unknown>): boolean {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n}\n\nfunction hasConfigKey(value: Record<string, unknown>): boolean {\n for (const key of CONFIG_KEYS) {\n if (hasOwn(value, key)) {\n return true;\n }\n }\n return false;\n}\n\nfunction mergeConfigObjects(\n base: Record<string, unknown>,\n override: Record<string, unknown>,\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of CONFIG_KEYS) {\n if (hasOwn(base, key)) {\n out[key] = base[key];\n }\n }\n for (const key of CONFIG_KEYS) {\n if (hasOwn(override, key)) {\n out[key] = override[key];\n }\n }\n return out;\n}\n\nfunction collectPluginObjects(value: unknown): Array<Record<string, unknown>> {\n const out: Array<Record<string, unknown>> = [];\n visit(value);\n return out;\n\n function visit(node: unknown): void {\n if (Array.isArray(node)) {\n for (const item of node) visit(item);\n return;\n }\n if (!isObject(node)) return;\n if (hasOwn(node, \"plugins\") && isObject(node.plugins)) {\n out.push(node.plugins as Record<string, unknown>);\n }\n }\n}\n\nfunction extractPluginSource(value: unknown): string | undefined {\n if (typeof value === \"string\") {\n value = requireFromConfig(value);\n }\n if (!isObject(value)) return undefined;\n // ESM-from-CJS interop wraps CJS modules' `exports.default` so the\n // plugin object can land under a `.default` indirection. Walk a few\n // hops so contributors authored as `export default plugin` and\n // contributors authored as plain `module.exports = plugin` both\n // resolve identically.\n let current: Record<string, unknown> = value;\n // 8 hops to match the outer-process unwrapDefault helper; previously\n // 4, which silently misrouted deeply re-exported plugins while\n // unwrapDefault would have unwrapped them.\n for (let i = 0; i < 8; i++) {\n if (typeof current.source === \"string\") break;\n const next = current.default;\n if (!isObject(next)) break;\n current = next;\n }\n const source = current.source;\n return typeof source === \"string\" ? source : undefined;\n}\n";
72
+ export declare const TTSX_EXTRACTOR_SCRIPT = "// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport * as fs from \"node:fs\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { Buffer } from \"node:buffer\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { createHash } from \"node:crypto\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { createRequire, registerHooks } from \"node:module\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport * as path from \"node:path\";\n// @ts-ignore -- internal loader must not require user-installed Node typings.\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nconst configUrl = %CONFIG_IMPORT%;\nconst outputPath = %CONFIG_OUTPUT%;\nconst resolutionRoot = path.resolve(%CONFIG_ROOT%);\nconst requireFromConfig = createRequire(configUrl);\nconst CONFIG_KEYS = new Set<string>([\n \"files\",\n \"ignores\",\n \"extends\",\n \"plugins\",\n \"rules\",\n \"format\",\n]);\nconst dependencies = new Map<string, {\n digest: string;\n kind: \"directory\" | \"file\" | \"optional-file\";\n path: string;\n owners: Set<string>;\n}>();\nconst graphNodes = new Map<string, string>();\nconst graphEdges: Array<{\n child: string;\n packageBoundary: boolean;\n parent: string;\n}> = [];\nconst configLocation = fileURLToPath(configUrl);\n// Every spelling of this config the module system might key an edge under.\n//\n// Which one it uses is not knowable from here, and guessing has failed in both\n// directions. A path handed in by another producer can be escaped by a rule\n// Node does not share. Node respells a resolved file module through its real\n// path unless \"--preserve-symlinks\" is set, so a config reached through a\n// symlinked directory is keyed by its target. And a Windows 8.3 short name is\n// not a symlink: fs.realpathSync expands it, the module resolver does not, so\n// asking the volume there produces a spelling no edge carries.\n//\n// A seed that names a URL no edge was keyed under sits on a node with no\n// outgoing edges, the walk ends immediately, and every dependency recorded\n// after the first import is demoted from watch to cache. That failure is\n// silent: the build still succeeds and simply stops reacting. Seeding every\n// spelling costs one extra queue entry and cannot be wrong.\nconst configUrlSpellings = [\n ...new Set([\n configUrl,\n pathToFileURL(configLocation).href,\n pathToFileURL(realConfigLocation()).href,\n ]),\n];\nfor (const spelling of configUrlSpellings) {\n graphNodes.set(spelling, configLocation);\n}\nrecordDependency(\n \"file\",\n configLocation,\n createHash(\"sha256\").update(fs.readFileSync(configLocation)).digest(\"hex\"),\n configUrlSpellings,\n);\nrecordPackageManifests(configLocation, configUrlSpellings);\n\ndeclare const process: {\n cwd(): string;\n platform: string;\n stdout: { write(value: string): void };\n stderr: { write(value: string): void };\n exit(code?: number): never;\n};\n\nconst hooks = registerHooks({\n resolve(specifier, context, nextResolve) {\n const resolved = nextResolve(specifier, context);\n if (typeof resolved.url !== \"string\" || !resolved.url.startsWith(\"file:\")) {\n return resolved;\n }\n const url = new URL(resolved.url).href;\n const parent = context.parentURL && new URL(context.parentURL).href;\n const location = fileURLToPath(url);\n // The entry is recognized by what was asked for, not only by what came\n // back. A module URL is assigned by whoever loaded it: a compiling loader\n // can serve the config from its emitted output, and a platform can hand\n // back a different spelling of the same file. Either way the URL bears no\n // resemblance to the one this process was given, so the config's own\n // imports would be rejected here \u2014 their parent is a URL no node was\n // recorded under \u2014 and the graph would collapse to the records made before\n // the first import. The request itself is unambiguous, so it decides.\n const entry =\n specifier === configUrl ||\n url === new URL(configUrl).href ||\n samePhysicalPath(location, configLocation);\n if (!entry && (parent === undefined || !graphNodes.has(parent))) {\n return resolved;\n }\n graphNodes.set(url, location);\n if (parent !== undefined) {\n graphEdges.push({\n child: url,\n packageBoundary:\n pathHasNodeModules(location) && !isLocalModuleSpecifier(specifier),\n parent,\n });\n recordResolutionTopology(\n specifier,\n parent,\n url,\n location,\n context.conditions,\n );\n }\n try {\n recordDependency(\n \"file\",\n location,\n createHash(\"sha256\").update(fs.readFileSync(location)).digest(\"hex\"),\n [url],\n );\n } catch {\n // The evaluator remains authoritative for the load error. An unreadable\n // dependency simply makes this result non-cacheable in the parent.\n recordDependency(\"file\", location, \"\", [url]);\n }\n return resolved;\n },\n});\n\n// Wrapped and settled explicitly rather than written as a top-level await.\n// The loader tsconfig's \"module\" now follows the config's own package, and\n// TS1378 rejects top-level await under a CommonJS module option however this\n// .mts file emits. The trailing catch is what a top-level await gave for\n// free: without it a throw from the finally would leave the promise\n// unsettled instead of failing the load.\n(async () => {\n try {\n const importedConfig = configLocation.toLowerCase().endsWith(\".json\")\n ? JSON.parse(fs.readFileSync(configLocation, \"utf8\").replace(/^\uFEFF/, \"\"))\n : await import(configUrl);\n const current = await resolveConfig(importedConfig, true);\n const pluginMaps = collectPluginObjects(current);\n const entries: Array<{ namespace: string; source: string }> = [];\n for (const map of pluginMaps) {\n for (const [namespace, value] of Object.entries(map)) {\n const source = extractPluginSource(value);\n if (source === undefined || source.length === 0) {\n throw new Error(\n `contributor ${JSON.stringify(namespace)} must resolve to an object with a non-empty \"source\" string`,\n );\n }\n entries.push({ namespace, source });\n }\n }\n fs.writeFileSync(outputPath, JSON.stringify({\n dependencies: finalizeDependencies(),\n entries,\n }), \"utf8\");\n } catch (error) {\n reportLoaderFailure(error);\n } finally {\n hooks.deregister();\n }\n})().catch((error) => {\n // Reached only when the finally above throws: the catch already ends the\n // process, so this is the deregistration's own failure, not the config's.\n reportLoaderFailure(error);\n});\n\n// reportLoaderFailure ends this loader on an error it can name, on both of the\n// channels the parent uses.\n//\n// The stack is for a reader and streams to stderr as it is written. The reason\n// is a fact about the user's config that a caller has to act on, so it travels\n// as data through the result file the parent already reads. Only a well-formed\n// envelope is honoured there, so a partially written or unrelated file leaves\n// the process status to speak for itself.\nfunction reportLoaderFailure(error: unknown): never {\n // The trailing newline ends the stack as a line of its own. Without it the\n // parent's own message, written to this same stream, starts mid-line.\n process.stderr.write((error instanceof Error && error.stack ? error.stack : String(error)) + \"\\n\");\n try {\n fs.writeFileSync(\n outputPath,\n JSON.stringify({ __ttscLoaderError: error instanceof Error ? error.message : String(error) }),\n \"utf8\",\n );\n } catch {\n // A reason that cannot be written leaves the exit status as the report.\n }\n return process.exit(1);\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\";\n}\n\nfunction recordDependency(\n kind: \"directory\" | \"file\" | \"optional-file\",\n location: string,\n digest: string,\n owners: readonly string[],\n): void {\n const key = kind + \"\\0\" + location;\n const previous = dependencies.get(key);\n const mergedOwners = previous?.owners ?? new Set<string>();\n for (const owner of owners) mergedOwners.add(owner);\n dependencies.set(key, {\n digest: previous !== undefined && previous.digest !== digest ? \"\" : digest,\n kind,\n owners: mergedOwners,\n path: location,\n });\n}\n\nfunction isLocalModuleSpecifier(specifier: string): boolean {\n return specifier.startsWith(\".\") ||\n specifier.startsWith(\"/\") ||\n specifier.startsWith(\"file:\") ||\n /^[A-Za-z]:[\\\\/]/.test(specifier);\n}\n\nfunction pathHasNodeModules(location: string): boolean {\n return location.replaceAll(\"\\\\\", \"/\").split(\"/\").includes(\"node_modules\");\n}\n\nfunction recordResolutionTopology(\n specifier: string,\n parentUrl: string,\n childUrl: string,\n childLocation: string,\n conditions: readonly string[],\n): void {\n const owners = [parentUrl, childUrl];\n const parentLocation = graphNodes.get(parentUrl);\n if (parentLocation !== undefined && isLocalModuleSpecifier(specifier)) {\n recordDirectoryDependency(path.dirname(parentLocation), owners);\n }\n recordDirectoryDependency(path.dirname(childLocation), owners);\n recordPackageManifests(childLocation, owners);\n if (parentLocation !== undefined && !isLocalModuleSpecifier(specifier)) {\n recordNodeModulesSearchDirectories(\n parentLocation,\n specifier,\n childLocation,\n owners,\n conditions,\n );\n }\n}\n\nfunction recordDirectoryDependency(\n location: string,\n owners: readonly string[],\n): void {\n try {\n recordDependency(\"directory\", location, directoryDigest(location), owners);\n } catch {\n recordDependency(\"directory\", location, \"\", owners);\n }\n}\n\nfunction directoryDigest(location: string): string {\n const entries: Buffer[] = [];\n if (process.platform === \"win32\") {\n for (const entry of fs.readdirSync(location, { withFileTypes: true })) {\n let target = Buffer.alloc(0);\n if (entry.isSymbolicLink()) {\n try {\n target = Buffer.from(\n fs.readlinkSync(path.join(location, entry.name)),\n \"utf8\",\n );\n } catch {\n target = Buffer.from(\"<unreadable>\");\n }\n }\n entries.push(directoryDigestRecord(Buffer.from(entry.name), entry, target));\n }\n } else {\n for (const entry of fs.readdirSync(location, {\n encoding: \"buffer\",\n withFileTypes: true,\n })) {\n let target = Buffer.alloc(0);\n if (entry.isSymbolicLink()) {\n try {\n target = fs.readlinkSync(\n Buffer.concat([\n Buffer.from(location),\n Buffer.from(path.sep),\n entry.name,\n ]),\n { encoding: \"buffer\" },\n );\n } catch {\n target = Buffer.from(\"<unreadable>\");\n }\n }\n entries.push(directoryDigestRecord(entry.name, entry, target));\n }\n }\n entries.sort(Buffer.compare);\n const serialized = Buffer.concat(\n entries.flatMap((entry, index) =>\n index === 0 ? [entry] : [Buffer.from([0]), entry],\n ),\n );\n return createHash(\"sha256\").update(serialized).digest(\"hex\");\n}\n\nfunction directoryDigestRecord(\n name: Buffer,\n entry: {\n isDirectory(): boolean;\n isFile(): boolean;\n isSymbolicLink(): boolean;\n },\n target: Buffer,\n): Buffer {\n const kind = entry.isDirectory()\n ? \"directory\"\n : entry.isFile()\n ? \"file\"\n : entry.isSymbolicLink()\n ? \"symlink\"\n : \"other\";\n return Buffer.concat([name, Buffer.from(\"\\0\" + kind + \"\\0\"), target]);\n}\n\nfunction optionalFileDigest(location: string): string {\n try {\n if (fs.statSync(location).isFile()) {\n return createHash(\"sha256\")\n .update(Buffer.concat([Buffer.from(\"file\\0\"), fs.readFileSync(location)]))\n .digest(\"hex\");\n }\n } catch {\n // Missing, unreadable, and non-file candidates share the absent state.\n }\n return createHash(\"sha256\").update(\"missing\\0\").digest(\"hex\");\n}\n\nfunction recordOptionalFileDependency(\n location: string,\n owners: readonly string[],\n): boolean {\n try {\n if (fs.statSync(location).isFile()) {\n recordDependency(\n \"file\",\n location,\n createHash(\"sha256\").update(fs.readFileSync(location)).digest(\"hex\"),\n owners,\n );\n return true;\n }\n } catch {\n // The exact missing path remains a dependency of the resolution result.\n }\n recordDependency(\"optional-file\", location, optionalFileDigest(location), owners);\n return false;\n}\n\nfunction recordPackageManifests(\n location: string,\n owners: readonly string[],\n): void {\n let current = path.dirname(location);\n while (true) {\n const manifest = path.join(current, \"package.json\");\n if (recordOptionalFileDependency(manifest, owners)) return;\n const parent = path.dirname(current);\n if (parent === current || path.basename(current) === \"node_modules\") return;\n current = parent;\n }\n}\n\nfunction recordNodeModulesSearchDirectories(\n parentLocation: string,\n specifier: string,\n childLocation: string,\n owners: readonly string[],\n conditions: readonly string[],\n): void {\n const packageName = modulePackageName(specifier);\n const scope =\n specifier.startsWith(\"@\") && specifier.includes(\"/\")\n ? specifier.slice(0, specifier.indexOf(\"/\"))\n : undefined;\n let current = path.dirname(parentLocation);\n while (true) {\n // A newly created nearer node_modules directory can shadow the package\n // selected by this evaluation, so missing search levels are dependencies.\n recordDirectoryDependency(current, owners);\n const modules = path.join(current, \"node_modules\");\n try {\n if (fs.statSync(modules).isDirectory()) {\n recordDirectoryDependency(modules, owners);\n if (scope !== undefined) {\n const scoped = path.join(modules, scope);\n try {\n if (fs.statSync(scoped).isDirectory()) {\n recordDirectoryDependency(scoped, owners);\n }\n } catch {\n // The directory digest of node_modules records a missing scope.\n }\n }\n if (packageName !== undefined) {\n const selected = recordPackageCandidateTopology(\n modules,\n packageName,\n specifier,\n childLocation,\n owners,\n conditions,\n );\n if (\n selected ||\n resolvedPackageContains(modules, packageName, childLocation)\n ) {\n return;\n }\n }\n }\n } catch {\n // Missing search levels do not participate in the current resolution.\n }\n if (\n packageName === undefined &&\n samePhysicalPath(current, resolutionRoot)\n ) {\n return;\n }\n const parent = path.dirname(current);\n if (parent === current) return;\n current = parent;\n }\n}\n\nfunction recordPackageCandidateTopology(\n modules: string,\n packageName: string,\n specifier: string,\n childLocation: string,\n owners: readonly string[],\n conditions: readonly string[],\n): boolean {\n const packageRoot = path.join(modules, packageName);\n try {\n if (!fs.statSync(packageRoot).isDirectory()) return false;\n } catch {\n return false;\n }\n const subpath = specifier\n .slice(packageName.length)\n .replace(/^[/\\\\]+/, \"\");\n const rootTopology = recordPackageRootTopology(\n packageRoot,\n owners,\n subpath === \"\",\n subpath === \"\" ? \".\" : \"./\" + subpath.replaceAll(\"\\\\\", \"/\"),\n childLocation,\n conditions,\n );\n if (subpath !== \"\" && !rootTopology.hasExports) {\n return (\n recordPackageSubpathTopology(\n packageRoot,\n subpath,\n childLocation,\n owners,\n ) || rootTopology.selected\n );\n }\n return rootTopology.selected;\n}\n\nfunction recordPackageRootTopology(\n packageRoot: string,\n owners: readonly string[],\n useMain: boolean,\n packageSubpath: string,\n childLocation: string,\n conditions: readonly string[],\n): { hasExports: boolean; selected: boolean } {\n const normalizedRoot = path.resolve(packageRoot);\n const manifest = path.join(normalizedRoot, \"package.json\");\n const legacySelected = (): boolean =>\n useMain &&\n packagePathCandidateMatchesChild(normalizedRoot, childLocation, true);\n if (!recordOptionalFileDependency(manifest, owners)) {\n const selected = legacySelected();\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return { hasExports: false, selected };\n }\n try {\n const value = JSON.parse(fs.readFileSync(manifest, \"utf8\"));\n if (value !== null && typeof value === \"object\") {\n const metadata = value as Record<string, unknown>;\n const hasExports =\n metadata.exports !== undefined && metadata.exports !== null;\n if (hasExports) {\n const target = selectPackageExportsTarget(\n metadata.exports,\n packageSubpath,\n new Set(conditions),\n );\n const candidate =\n typeof target === \"string\"\n ? packageExportsTarget(normalizedRoot, target)\n : undefined;\n const selected =\n candidate !== undefined &&\n packagePathCandidateMatchesChild(\n candidate,\n childLocation,\n false,\n );\n if (selected) {\n recordPackagePathCandidate(candidate, owners);\n } else if (candidate !== undefined) {\n // A nearer package the search skipped starts winning the moment its\n // own active target appears, and neither the parent node_modules\n // listing nor the manifest changes when only that file is created.\n recordOptionalFileDependency(candidate, owners);\n }\n return { hasExports: true, selected };\n }\n let selected = legacySelected();\n if (useMain && typeof metadata.main === \"string\") {\n // CommonJS main is a legacy path, not an exports target. Node resolves\n // it literally and permits absolute paths and paths outside the package.\n const main = path.resolve(normalizedRoot, metadata.main);\n recordPackagePathCandidate(main, owners);\n selected =\n packagePathCandidateMatchesChild(main, childLocation, true) ||\n selected;\n }\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return {\n hasExports: false,\n selected,\n };\n }\n } catch {\n // Node owns malformed-manifest diagnostics; the manifest digest is enough\n // to invalidate this evaluation when its contents change.\n }\n const selected = legacySelected();\n if (!selected) {\n recordPackageIndexCandidates(normalizedRoot, useMain, owners);\n }\n return { hasExports: false, selected };\n}\n\n// recordPackageIndexCandidates pins the LOAD_INDEX fallbacks of a package root\n// this resolution walked past without selecting. An empty package directory, or\n// one whose manifest declares no usable entry, becomes resolvable as soon as one\n// of these files exists, and that creation changes neither the parent directory\n// listing nor the manifest digest already recorded for the candidate.\nfunction recordPackageIndexCandidates(\n packageRoot: string,\n useMain: boolean,\n owners: readonly string[],\n): void {\n if (!useMain) return;\n for (const name of [\"index.js\", \"index.json\", \"index.node\"]) {\n recordOptionalFileDependency(path.join(packageRoot, name), owners);\n }\n}\n\nfunction selectPackageExportsTarget(\n exportsValue: unknown,\n packageSubpath: string,\n conditions: ReadonlySet<string>,\n): string | null | undefined {\n let mappings: unknown = exportsValue;\n if (\n typeof mappings === \"string\" ||\n Array.isArray(mappings) ||\n (isObject(mappings) &&\n Object.keys(mappings).every((key) => !key.startsWith(\".\")))\n ) {\n if (packageSubpath !== \".\") return undefined;\n return selectPackageTarget(mappings, \"\", false, conditions);\n }\n if (!isObject(mappings)) return undefined;\n if (\n Object.prototype.hasOwnProperty.call(mappings, packageSubpath) &&\n !packageSubpath.includes(\"*\") &&\n !packageSubpath.endsWith(\"/\")\n ) {\n return selectPackageTarget(\n mappings[packageSubpath],\n \"\",\n false,\n conditions,\n );\n }\n let bestMatch = \"\";\n let bestSubpath = \"\";\n for (const key of Object.keys(mappings)) {\n const wildcard = key.indexOf(\"*\");\n if (\n wildcard === -1 ||\n key.lastIndexOf(\"*\") !== wildcard ||\n !packageSubpath.startsWith(key.slice(0, wildcard))\n ) {\n continue;\n }\n const trailer = key.slice(wildcard + 1);\n if (\n packageSubpath.length < key.length ||\n !packageSubpath.endsWith(trailer) ||\n packagePatternKeyCompare(bestMatch, key) !== 1\n ) {\n continue;\n }\n bestMatch = key;\n bestSubpath = packageSubpath.slice(\n wildcard,\n packageSubpath.length - trailer.length,\n );\n }\n return bestMatch === \"\"\n ? undefined\n : selectPackageTarget(\n mappings[bestMatch],\n bestSubpath,\n true,\n conditions,\n );\n}\n\nfunction selectPackageTarget(\n target: unknown,\n subpath: string,\n pattern: boolean,\n conditions: ReadonlySet<string>,\n): string | null | undefined {\n if (typeof target === \"string\") {\n const selected = pattern ? target.replaceAll(\"*\", subpath) : target;\n return validPackageExportsTarget(selected) ? selected : undefined;\n }\n if (Array.isArray(target)) {\n for (const item of target) {\n const selected = selectPackageTarget(\n item,\n subpath,\n pattern,\n conditions,\n );\n if (selected !== undefined && selected !== null) return selected;\n }\n return null;\n }\n if (isObject(target)) {\n for (const [condition, value] of Object.entries(target)) {\n if (condition !== \"default\" && !conditions.has(condition)) continue;\n const selected = selectPackageTarget(\n value,\n subpath,\n pattern,\n conditions,\n );\n if (selected !== undefined) return selected;\n }\n return undefined;\n }\n return target === null ? null : undefined;\n}\n\nfunction packagePatternKeyCompare(left: string, right: string): number {\n const leftWildcard = left.indexOf(\"*\");\n const rightWildcard = right.indexOf(\"*\");\n const leftBase =\n leftWildcard === -1 ? left.length : leftWildcard + 1;\n const rightBase =\n rightWildcard === -1 ? right.length : rightWildcard + 1;\n if (leftBase > rightBase) return -1;\n if (rightBase > leftBase) return 1;\n if (leftWildcard === -1) return 1;\n if (rightWildcard === -1) return -1;\n if (left.length > right.length) return -1;\n if (right.length > left.length) return 1;\n return 0;\n}\n\nfunction packageExportsTarget(\n packageRoot: string,\n target: string,\n): string | undefined {\n if (!validPackageExportsTarget(target)) return undefined;\n try {\n // Node resolves an exports target as a URL against the package manifest,\n // so percent escapes, query strings, and fragments all take part in the\n // path it finally loads. Joining the raw target by hand diverges from that\n // whenever the target is anything but a plain relative path, and a target\n // Node resolves while this model rejects loses the selected file's\n // fingerprint, leaving a retargeted symlink cached as fresh.\n const packageUrl = pathToFileURL(path.join(packageRoot, \"package.json\"));\n const resolved = new URL(target, packageUrl);\n const packagePath = new URL(\".\", packageUrl).pathname;\n if (!resolved.pathname.startsWith(packagePath)) return undefined;\n return fileURLToPath(resolved);\n } catch {\n return undefined;\n }\n}\n\nfunction validPackageExportsTarget(target: string): boolean {\n if (!target.startsWith(\"./\") || /%2f|%5c/i.test(target)) return false;\n const components = target\n .slice(2)\n .replaceAll(\"\\\\\", \"/\")\n .split(\"/\");\n if (\n components.some(\n (component) => {\n try {\n const decoded = decodeURIComponent(component);\n return (\n decoded === \".\" ||\n decoded === \"..\" ||\n decoded.includes(\"/\") ||\n decoded.includes(\"\\\\\") ||\n decoded.toLowerCase() === \"node_modules\"\n );\n } catch {\n return true;\n }\n },\n )\n ) {\n return false;\n }\n return true;\n}\n\nfunction packagePathCandidateMatchesChild(\n candidate: string,\n childLocation: string,\n legacy: boolean,\n): boolean {\n let child: string;\n try {\n child = fs.realpathSync.native(childLocation);\n } catch {\n child = path.resolve(childLocation);\n }\n const candidates = legacy\n ? [\n candidate,\n candidate + \".js\",\n candidate + \".json\",\n candidate + \".node\",\n path.join(candidate, \"index.js\"),\n path.join(candidate, \"index.json\"),\n path.join(candidate, \"index.node\"),\n ]\n : [candidate];\n return candidates.some((location) => {\n try {\n return sameResolutionPath(fs.realpathSync.native(location), child);\n } catch {\n return false;\n }\n });\n}\n\nfunction recordPackageSubpathTopology(\n packageRoot: string,\n subpath: string,\n childLocation: string,\n owners: readonly string[],\n): boolean {\n const candidate = boundedPackageTarget(packageRoot, subpath);\n if (candidate === undefined) return false;\n recordPackagePathCandidate(candidate, owners);\n let selected = packagePathCandidateMatchesChild(\n candidate,\n childLocation,\n true,\n );\n try {\n if (!fs.statSync(candidate).isDirectory()) return selected;\n } catch {\n return selected;\n }\n const manifest = path.join(candidate, \"package.json\");\n if (!recordOptionalFileDependency(manifest, owners)) return selected;\n try {\n const value = JSON.parse(fs.readFileSync(manifest, \"utf8\"));\n if (value !== null && typeof value === \"object\") {\n const metadata = value as Record<string, unknown>;\n if (typeof metadata.main === \"string\") {\n const main = path.resolve(candidate, metadata.main);\n recordPackagePathCandidate(main, owners);\n selected =\n packagePathCandidateMatchesChild(main, childLocation, true) ||\n selected;\n }\n }\n } catch {\n // Node owns malformed nested-package diagnostics.\n }\n return selected;\n}\n\nfunction boundedPackageTarget(\n packageRoot: string,\n target: string,\n): string | undefined {\n const candidate = path.resolve(packageRoot, target);\n const relative = path.relative(packageRoot, candidate);\n if (\n relative === \"..\" ||\n relative.startsWith(\"..\" + path.sep) ||\n path.isAbsolute(relative)\n ) {\n return undefined;\n }\n return candidate;\n}\n\nfunction recordPackagePathCandidate(\n candidate: string,\n owners: readonly string[],\n visited: Set<string> = new Set(),\n depth = 0,\n): void {\n const normalized = path.resolve(candidate);\n // The depth bound owns termination. A platform-wide case fold would merge\n // paths that differ only by case, which a per-directory case-sensitive\n // Windows tree keeps distinct, and would truncate a valid symlink chain.\n if (depth >= 64 || visited.has(normalized)) return;\n visited.add(normalized);\n const parsed = path.parse(normalized);\n const components = normalized\n .slice(parsed.root.length)\n .split(path.sep)\n .filter(Boolean);\n let current = parsed.root;\n for (let index = 0; index < components.length; index++) {\n const component = components[index];\n const next = path.join(current, component);\n let entry: ReturnType<typeof fs.lstatSync>;\n try {\n entry = fs.lstatSync(next);\n } catch {\n recordDirectoryDependency(current, owners);\n return;\n }\n if (entry.isSymbolicLink()) {\n // The containing directory digest carries the raw link target.\n recordDirectoryDependency(current, owners);\n try {\n const target = fs.readlinkSync(next);\n const remainder = components.slice(index + 1);\n recordPackagePathCandidate(\n path.join(\n path.resolve(current, target),\n ...remainder,\n ),\n owners,\n visited,\n depth + 1,\n );\n } catch {\n // The lexical link record already carries the unreadable state.\n }\n }\n let isDirectory = entry.isDirectory();\n if (entry.isSymbolicLink()) {\n try {\n isDirectory = fs.statSync(next).isDirectory();\n } catch {\n return;\n }\n }\n if (index === components.length - 1) {\n recordDirectoryDependency(isDirectory ? next : current, owners);\n return;\n }\n if (!isDirectory) {\n recordDirectoryDependency(current, owners);\n return;\n }\n current = next;\n }\n recordDirectoryDependency(current, owners);\n}\n\nfunction modulePackageName(specifier: string): string | undefined {\n if (specifier.startsWith(\"@\")) {\n const components = specifier.split(\"/\");\n return components.length >= 2\n ? components[0] + \"/\" + components[1]\n : undefined;\n }\n const [name] = specifier.split(\"/\");\n return name && !name.startsWith(\"#\") ? name : undefined;\n}\n\nfunction resolvedPackageContains(\n modules: string,\n packageName: string,\n childLocation: string,\n): boolean {\n try {\n const packageRoot = fs.realpathSync(path.join(modules, packageName));\n const relative = path.relative(\n packageRoot,\n fs.realpathSync(childLocation),\n );\n return (\n relative === \"\" ||\n (relative !== \"..\" &&\n !relative.startsWith(\"..\" + path.sep) &&\n !path.isAbsolute(relative))\n );\n } catch {\n return false;\n }\n}\n\nfunction sameResolutionPath(left: string, right: string): boolean {\n return path.relative(left, right) === \"\";\n}\n\nfunction samePhysicalPath(left: string, right: string): boolean {\n try {\n return sameResolutionPath(realPath(left), realPath(right));\n } catch {\n // Fall back to the spellings themselves, folding case the way the platform\n // does. On the entry gate a false negative is catastrophic \u2014 the config\n // stops being recognized and its whole graph collapses \u2014 while a false\n // positive only over-includes, so the degradation has to lean toward \"same\n // file\". A drive-letter or component case difference is the ordinary\n // Windows situation; a per-directory case-sensitive tree is the rare one.\n return sameResolutionPath(left, right);\n }\n}\n\n/**\n * The config's real path, or its declared one when the volume will not say.\n *\n * A config can disappear between the host reading it and this loader starting,\n * and a throw here would replace a precise report from the import below with a\n * crash in bookkeeping. Seeding lexically instead only risks the demotion this\n * value exists to prevent, on a file that is already gone.\n */\nfunction realConfigLocation(): string {\n try {\n return realPath(configLocation);\n } catch {\n return configLocation;\n }\n}\n\nfunction realPath(location: string): string {\n return fs.realpathSync.native\n ? fs.realpathSync.native(location)\n : fs.realpathSync(location);\n}\n\nfunction finalizeDependencies(): Array<{\n digest: string;\n kind: \"directory\" | \"file\" | \"optional-file\";\n path: string;\n scope: \"cache\" | \"watch\";\n}> {\n const watched = graphWatchReachability();\n return [...dependencies.values()].map(({ owners, ...dependency }) => ({\n ...dependency,\n scope: [...owners].some((owner) => watched.has(owner))\n ? \"watch\"\n : \"cache\",\n }));\n}\n\nfunction graphWatchReachability(): Set<string> {\n const adjacency = new Map<string, typeof graphEdges>();\n for (const edge of graphEdges) {\n const outgoing = adjacency.get(edge.parent) ?? [];\n outgoing.push(edge);\n adjacency.set(edge.parent, outgoing);\n }\n const queue: Array<{ url: string; watched: boolean }> =\n configUrlSpellings.map((url) => ({ url, watched: true }));\n const visited = new Set<string>();\n const watched = new Set<string>();\n while (queue.length !== 0) {\n const state = queue.shift()!;\n const key = state.url + \"\\0\" + (state.watched ? \"1\" : \"0\");\n if (visited.has(key)) continue;\n visited.add(key);\n if (state.watched) watched.add(state.url);\n for (const edge of adjacency.get(state.url) ?? []) {\n const childLocation = graphNodes.get(edge.child);\n const childWatched = edge.packageBoundary\n ? false\n : childLocation !== undefined && !pathHasNodeModules(childLocation)\n ? true\n : state.watched;\n queue.push({ url: edge.child, watched: childWatched });\n }\n }\n return watched;\n}\n\nfunction hasOwn(value: Record<string, unknown>, key: string): boolean {\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nasync function resolveConfig(value: unknown, allowNamedConfig: boolean): Promise<unknown> {\n let current = value;\n for (let i = 0; i < 8; i++) {\n if (typeof current === \"function\") {\n current = await (current as () => unknown | Promise<unknown>)();\n allowNamedConfig = false;\n continue;\n }\n if (isObject(current) && !Array.isArray(current)) {\n if (hasOwn(current, \"default\")) {\n const defaultValue = current.default;\n if (isModuleNamespace(current) || !hasConfigKey(current)) {\n current = defaultValue;\n allowNamedConfig = false;\n continue;\n }\n const normalizedDefault = await resolveConfig(defaultValue, false);\n if (isObject(normalizedDefault) && !Array.isArray(normalizedDefault)) {\n current = mergeConfigObjects(normalizedDefault, current);\n allowNamedConfig = false;\n continue;\n }\n }\n if (allowNamedConfig && hasOwn(current, \"config\")) {\n current = current.config;\n allowNamedConfig = false;\n continue;\n }\n }\n break;\n }\n return current;\n}\n\nfunction isModuleNamespace(value: Record<string, unknown>): boolean {\n return Object.prototype.toString.call(value) === \"[object Module]\";\n}\n\nfunction hasConfigKey(value: Record<string, unknown>): boolean {\n for (const key of CONFIG_KEYS) {\n if (hasOwn(value, key)) {\n return true;\n }\n }\n return false;\n}\n\nfunction mergeConfigObjects(\n base: Record<string, unknown>,\n override: Record<string, unknown>,\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const key of CONFIG_KEYS) {\n if (hasOwn(base, key)) {\n out[key] = base[key];\n }\n }\n for (const key of CONFIG_KEYS) {\n if (hasOwn(override, key)) {\n out[key] = override[key];\n }\n }\n return out;\n}\n\nfunction collectPluginObjects(value: unknown): Array<Record<string, unknown>> {\n const out: Array<Record<string, unknown>> = [];\n visit(value);\n return out;\n\n function visit(node: unknown): void {\n if (Array.isArray(node)) {\n for (const item of node) visit(item);\n return;\n }\n if (!isObject(node)) return;\n if (hasOwn(node, \"plugins\") && isObject(node.plugins)) {\n out.push(node.plugins as Record<string, unknown>);\n }\n }\n}\n\nfunction extractPluginSource(value: unknown): string | undefined {\n if (typeof value === \"string\") {\n value = requireFromConfig(value);\n }\n if (!isObject(value)) return undefined;\n // ESM-from-CJS interop wraps CJS modules' `exports.default` so the\n // plugin object can land under a `.default` indirection. Walk a few\n // hops so contributors authored as `export default plugin` and\n // contributors authored as plain `module.exports = plugin` both\n // resolve identically.\n let current: Record<string, unknown> = value;\n // 8 hops to match the outer-process unwrapDefault helper; previously\n // 4, which silently misrouted deeply re-exported plugins while\n // unwrapDefault would have unwrapped them.\n for (let i = 0; i < 8; i++) {\n if (typeof current.source === \"string\") break;\n const next = current.default;\n if (!isObject(next)) break;\n current = next;\n }\n const source = current.source;\n return typeof source === \"string\" ? source : undefined;\n}\n";
package/lib/index.js CHANGED
@@ -525,33 +525,68 @@ const hooks = registerHooks({
525
525
  },
526
526
  });
527
527
 
528
- try {
529
- const importedConfig = configLocation.toLowerCase().endsWith(".json")
530
- ? JSON.parse(fs.readFileSync(configLocation, "utf8").replace(/^\uFEFF/, ""))
531
- : await import(configUrl);
532
- const current = await resolveConfig(importedConfig, true);
533
- const pluginMaps = collectPluginObjects(current);
534
- const entries: Array<{ namespace: string; source: string }> = [];
535
- for (const map of pluginMaps) {
536
- for (const [namespace, value] of Object.entries(map)) {
537
- const source = extractPluginSource(value);
538
- if (source === undefined || source.length === 0) {
539
- throw new Error(
540
- \`contributor \${JSON.stringify(namespace)} must resolve to an object with a non-empty "source" string\`,
541
- );
528
+ // Wrapped and settled explicitly rather than written as a top-level await.
529
+ // The loader tsconfig's "module" now follows the config's own package, and
530
+ // TS1378 rejects top-level await under a CommonJS module option however this
531
+ // .mts file emits. The trailing catch is what a top-level await gave for
532
+ // free: without it a throw from the finally would leave the promise
533
+ // unsettled instead of failing the load.
534
+ (async () => {
535
+ try {
536
+ const importedConfig = configLocation.toLowerCase().endsWith(".json")
537
+ ? JSON.parse(fs.readFileSync(configLocation, "utf8").replace(/^\uFEFF/, ""))
538
+ : await import(configUrl);
539
+ const current = await resolveConfig(importedConfig, true);
540
+ const pluginMaps = collectPluginObjects(current);
541
+ const entries: Array<{ namespace: string; source: string }> = [];
542
+ for (const map of pluginMaps) {
543
+ for (const [namespace, value] of Object.entries(map)) {
544
+ const source = extractPluginSource(value);
545
+ if (source === undefined || source.length === 0) {
546
+ throw new Error(
547
+ \`contributor \${JSON.stringify(namespace)} must resolve to an object with a non-empty "source" string\`,
548
+ );
549
+ }
550
+ entries.push({ namespace, source });
542
551
  }
543
- entries.push({ namespace, source });
544
552
  }
553
+ fs.writeFileSync(outputPath, JSON.stringify({
554
+ dependencies: finalizeDependencies(),
555
+ entries,
556
+ }), "utf8");
557
+ } catch (error) {
558
+ reportLoaderFailure(error);
559
+ } finally {
560
+ hooks.deregister();
561
+ }
562
+ })().catch((error) => {
563
+ // Reached only when the finally above throws: the catch already ends the
564
+ // process, so this is the deregistration's own failure, not the config's.
565
+ reportLoaderFailure(error);
566
+ });
567
+
568
+ // reportLoaderFailure ends this loader on an error it can name, on both of the
569
+ // channels the parent uses.
570
+ //
571
+ // The stack is for a reader and streams to stderr as it is written. The reason
572
+ // is a fact about the user's config that a caller has to act on, so it travels
573
+ // as data through the result file the parent already reads. Only a well-formed
574
+ // envelope is honoured there, so a partially written or unrelated file leaves
575
+ // the process status to speak for itself.
576
+ function reportLoaderFailure(error: unknown): never {
577
+ // The trailing newline ends the stack as a line of its own. Without it the
578
+ // parent's own message, written to this same stream, starts mid-line.
579
+ process.stderr.write((error instanceof Error && error.stack ? error.stack : String(error)) + "\\n");
580
+ try {
581
+ fs.writeFileSync(
582
+ outputPath,
583
+ JSON.stringify({ __ttscLoaderError: error instanceof Error ? error.message : String(error) }),
584
+ "utf8",
585
+ );
586
+ } catch {
587
+ // A reason that cannot be written leaves the exit status as the report.
545
588
  }
546
- fs.writeFileSync(outputPath, JSON.stringify({
547
- dependencies: finalizeDependencies(),
548
- entries,
549
- }), "utf8");
550
- } catch (error) {
551
- process.stderr.write(error instanceof Error && error.stack ? error.stack : String(error));
552
- process.exit(1);
553
- } finally {
554
- hooks.deregister();
589
+ return process.exit(1);
555
590
  }
556
591
 
557
592
  function isObject(value: unknown): value is Record<string, unknown> {
@@ -1575,7 +1610,13 @@ function evaluateTtsxConfigPlugins(configPath, context) {
1575
1610
  allowImportingTsExtensions: true,
1576
1611
  allowJs: true,
1577
1612
  checkJs: false,
1578
- module: "ESNext",
1613
+ // The config is a Node module, so Node's rule decides its format:
1614
+ // the nearest `package.json` `type` above it. Hardcoding one answer
1615
+ // ran every ambiguous `.ts` config as ESM and broke `__dirname` in
1616
+ // an ordinary CommonJS package (#1068). `moduleResolution` stays
1617
+ // `bundler`, which tsgo accepts for both kinds, so extensionless
1618
+ // relative imports keep resolving either way.
1619
+ module: configModuleOption(configPath),
1579
1620
  moduleResolution: "bundler",
1580
1621
  noImplicitAny: false,
1581
1622
  outDir: node_path_1.default.join(tempDir, "out").replace(/\\/g, "/"),
@@ -1584,6 +1625,12 @@ function evaluateTtsxConfigPlugins(configPath, context) {
1584
1625
  skipLibCheck: true,
1585
1626
  strict: false,
1586
1627
  target: "ES2022",
1628
+ // TypeScript 7 includes no ambient type package unless `types` asks
1629
+ // for it, and this Program extends nothing, so without the wildcard
1630
+ // a config could not name a single Node global (#1068). The loader
1631
+ // directory links the config's nearest `node_modules`, so the
1632
+ // default `typeRoots` walk finds exactly what the project installed.
1633
+ types: ["*"],
1587
1634
  },
1588
1635
  files: [
1589
1636
  loaderPath.replace(/\\/g, "/"),
@@ -1616,26 +1663,29 @@ function evaluateTtsxConfigPlugins(configPath, context) {
1616
1663
  }
1617
1664
  const env = {
1618
1665
  ...nodeConfigLoaderEnv(configPath),
1619
- ...(0, configEvaluatorFailure_1.configEvaluatorBoundaryEnvironment)(),
1620
1666
  };
1621
1667
  const command = ttsxThroughNodeIfNeeded(ttsxBinary);
1622
1668
  const result = (0, node_child_process_1.spawnSync)(command.binary, [...command.prefix, ...args], {
1623
1669
  cwd: tempDir,
1624
1670
  env,
1625
- encoding: "utf8",
1626
- ...configEvaluatorFailure_1.CONFIG_EVALUATOR_PROCESS_OPTIONS,
1627
- stdio: [
1628
- "ignore",
1629
- "pipe",
1630
- "pipe",
1631
- ...Array.from({ length: configEvaluatorFailure_1.CONFIG_EVALUATOR_STATUS_FD - 2 }, () => "pipe"),
1632
- ],
1671
+ // Both child streams are human output, and they go straight to this
1672
+ // process's stderr as they are written. Nothing is collected here: the
1673
+ // parent's stdout is reserved for compiler JSON and LSP frames, and
1674
+ // buffering the child only to replay it afterwards is what forced an
1675
+ // invented output ceiling and made a long evaluation print nothing at all.
1676
+ stdio: ["ignore", 2, 2],
1633
1677
  windowsHide: true,
1634
1678
  });
1635
- forwardConfigEvaluatorStreams(result.stdout, result.stderr);
1636
1679
  const processFailure = (0, configEvaluatorFailure_1.configEvaluatorProcessFailure)(result, configPath);
1637
- if (processFailure)
1638
- throw processFailure;
1680
+ if (processFailure) {
1681
+ // The evaluator's stack already reached the user's stderr as it ran. What
1682
+ // it could not put there is a reason a caller can act on, so that arrives
1683
+ // through the result file instead.
1684
+ const reason = (0, configEvaluatorFailure_1.configEvaluatorFailureReason)(outputPath);
1685
+ throw reason === ""
1686
+ ? processFailure
1687
+ : new Error(`${processFailure.message}\n${reason}`);
1688
+ }
1639
1689
  let payload;
1640
1690
  try {
1641
1691
  payload = JSON.parse(node_fs_1.default.readFileSync(outputPath, "utf8"));
@@ -1678,17 +1728,9 @@ function evaluateTtsxConfigPlugins(configPath, context) {
1678
1728
  return { dependencies, entries };
1679
1729
  }
1680
1730
  finally {
1681
- node_fs_1.default.rmSync(tempDir, { recursive: true, force: true });
1731
+ removeEvaluationTempDir(tempDir);
1682
1732
  }
1683
1733
  }
1684
- function forwardConfigEvaluatorStreams(stdout, stderr) {
1685
- // Both child streams are human output. Parent stdout is reserved for compiler
1686
- // JSON or LSP frames, so even a user console.log is redirected.
1687
- if (stdout)
1688
- process.stderr.write(stdout);
1689
- if (stderr)
1690
- process.stderr.write(stderr);
1691
- }
1692
1734
  // ────────────────────────────────────────────────────────────────────────────
1693
1735
  // Config cache (shared with the Go sidecar — packages/lint/linthost/config.go)
1694
1736
  // ────────────────────────────────────────────────────────────────────────────
@@ -2019,6 +2061,63 @@ function findNearestNodeModules(start) {
2019
2061
  dir = parent;
2020
2062
  }
2021
2063
  }
2064
+ /**
2065
+ * The loader tsconfig's `module` for a given config file: the module kind Node
2066
+ * would give the file itself.
2067
+ *
2068
+ * An explicit `.cts`/`.cjs` or `.mts`/`.mjs` extension already decides the emit
2069
+ * format on its own, so those keep the ES-module setting and let the extension
2070
+ * win — the same precedence tsgo applies. Everything ambiguous walks up for the
2071
+ * nearest `package.json` `type`, exactly as Node does when it loads the file.
2072
+ */
2073
+ function configModuleOption(configPath) {
2074
+ const extension = node_path_1.default.extname(configPath).toLowerCase();
2075
+ if (extension !== ".ts" && extension !== ".tsx" && extension !== ".js") {
2076
+ return "ESNext";
2077
+ }
2078
+ return nearestPackageType(configPath) === "commonjs" ? "CommonJS" : "ESNext";
2079
+ }
2080
+ /**
2081
+ * Nearest `package.json` `"type"` at or above `configPath`, mirroring Node's
2082
+ * package-scope lookup: the walk stops at the **first** manifest it finds, and
2083
+ * a manifest that declares no `"type"` means CommonJS rather than a reason to
2084
+ * keep climbing. Reaching the filesystem root without any manifest also means
2085
+ * CommonJS.
2086
+ */
2087
+ function nearestPackageType(configPath) {
2088
+ let dir = node_path_1.default.dirname(node_path_1.default.resolve(configPath));
2089
+ for (;;) {
2090
+ // One read rather than a stat-then-read: an unreadable entry and a missing
2091
+ // one are the same answer here — keep walking — and the Go loaders resolve
2092
+ // it the same way, so the four implementations of this rule cannot drift.
2093
+ let raw;
2094
+ try {
2095
+ raw = node_fs_1.default.readFileSync(node_path_1.default.join(dir, "package.json"), "utf8");
2096
+ }
2097
+ catch {
2098
+ raw = undefined;
2099
+ }
2100
+ if (raw !== undefined) {
2101
+ try {
2102
+ const manifest = JSON.parse(raw);
2103
+ const type = typeof manifest === "object" && manifest !== null
2104
+ ? manifest.type
2105
+ : undefined;
2106
+ return type === "module" ? "module" : "commonjs";
2107
+ }
2108
+ catch {
2109
+ // A manifest that does not parse still bounds the package scope; Node
2110
+ // refuses to look past it, and CommonJS is the format it defaults to.
2111
+ return "commonjs";
2112
+ }
2113
+ }
2114
+ const parent = node_path_1.default.dirname(dir);
2115
+ if (parent === dir) {
2116
+ return "commonjs";
2117
+ }
2118
+ dir = parent;
2119
+ }
2120
+ }
2022
2121
  function linkNearestNodeModules(tempDir, sourceDir) {
2023
2122
  const nodeModules = findNearestNodeModules(sourceDir);
2024
2123
  if (!nodeModules)
@@ -2142,4 +2241,20 @@ function ttsxThroughNodeIfNeeded(binary) {
2142
2241
  }
2143
2242
  return { binary, prefix: [] };
2144
2243
  }
2244
+ /**
2245
+ * Remove an evaluation temp directory without letting cleanup replace a result.
2246
+ *
2247
+ * This runs from a `finally`, so a throw here would surface instead of the
2248
+ * evaluation's own outcome — and on Windows a grandchild that inherited a
2249
+ * handle, or a scanner holding the file, can make removal fail. Leaving bytes
2250
+ * in the system temp directory is by far the lesser outcome.
2251
+ */
2252
+ function removeEvaluationTempDir(directory) {
2253
+ try {
2254
+ node_fs_1.default.rmSync(directory, { force: true, recursive: true });
2255
+ }
2256
+ catch {
2257
+ // Best effort.
2258
+ }
2259
+ }
2145
2260
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 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