@mionjs/devtools 0.13.0 → 0.14.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/README.md +4 -4
- package/dist/core/apply-edits.d.ts +1 -1
- package/dist/core/apply-edits.js +2 -3
- package/dist/core/apply-edits.js.map +1 -1
- package/dist/core/bundledApiStub.js.map +1 -1
- package/dist/core/devReporter.js.map +1 -1
- package/dist/core/diagnosticCatalog.js.map +1 -1
- package/dist/core/downgradeErrors.js.map +1 -1
- package/dist/core/edit-buffer.d.ts +0 -2
- package/dist/core/edit-buffer.js +1 -8
- package/dist/core/edit-buffer.js.map +1 -1
- package/dist/core/go-generated/diagnosticCatalog.generated.js +6 -1
- package/dist/core/go-generated/diagnosticCatalog.generated.js.map +1 -1
- package/dist/core/go-generated/reflectionKind.generated.js.map +1 -1
- package/dist/core/go-generated/runtypes-constants.generated.d.ts +1 -1
- package/dist/core/go-generated/runtypes-constants.generated.js +1 -1
- package/dist/core/go-generated/runtypes-constants.generated.js.map +1 -1
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.d.ts +1 -1
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.js +1 -0
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.js.map +1 -1
- package/dist/core/groupedLog.js.map +1 -1
- package/dist/core/levels.js.map +1 -1
- package/dist/core/markerImports.js.map +1 -1
- package/dist/core/option-guards.js.map +1 -1
- package/dist/core/plugin-option-keys.js +1 -0
- package/dist/core/plugin-option-keys.js.map +1 -1
- package/dist/core/protocol.d.ts +2 -0
- package/dist/core/protocol.js.map +1 -1
- package/dist/core/resolver-client.d.ts +4 -0
- package/dist/core/resolver-client.js +26 -4
- package/dist/core/resolver-client.js.map +1 -1
- package/dist/core/scan-batcher.js.map +1 -1
- package/dist/core/surface.js.map +1 -1
- package/dist/core/type-deps.js.map +1 -1
- package/dist/core/types.d.ts +8 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/typescript-floor.js.map +1 -1
- package/dist/core/unplugin.d.ts +1 -0
- package/dist/core/unplugin.js +63 -10
- package/dist/core/unplugin.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lint/diagnosticRouting.js.map +1 -1
- package/dist/lint/index.js.map +1 -1
- package/dist/lint/lint-worker.js +11 -6
- package/dist/lint/lint-worker.js.map +1 -1
- package/dist/lint/prefilter.js.map +1 -1
- package/dist/lint/session-protocol.js.map +1 -1
- package/dist/lint/session.js.map +1 -1
- package/dist/lint/spawn-shim.js.map +1 -1
- package/dist/lint/vueSfc.d.ts +9 -0
- package/dist/lint/vueSfc.js +112 -0
- package/dist/lint/vueSfc.js.map +1 -0
- package/dist/options.js.map +1 -1
- package/dist/runtypes/bun.js.map +1 -1
- package/dist/runtypes/esbuild.js.map +1 -1
- package/dist/runtypes/next/broker.js +13 -13
- package/dist/runtypes/next/broker.js.map +1 -1
- package/dist/runtypes/next/index.d.ts +0 -1
- package/dist/runtypes/next/index.js +2 -0
- package/dist/runtypes/next/index.js.map +1 -1
- package/dist/runtypes/next/loader.js.map +1 -1
- package/dist/runtypes/next/wire.js.map +1 -1
- package/dist/runtypes/rolldown.js.map +1 -1
- package/dist/runtypes/rollup.js.map +1 -1
- package/dist/runtypes/rspack.js.map +1 -1
- package/dist/runtypes/vite.js.map +1 -1
- package/dist/runtypes/webpack.js.map +1 -1
- package/dist/vite/buildEntries.js +14 -11
- package/dist/vite/buildEntries.js.map +1 -1
- package/dist/vite/index.d.ts +0 -1
- package/dist/vite/index.js +0 -1
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/middlewareMode.d.ts +3 -2
- package/dist/vite/middlewareMode.js +73 -59
- package/dist/vite/middlewareMode.js.map +1 -1
- package/dist/vite/mionVitePlugin.d.ts +0 -1
- package/dist/vite/mionVitePlugin.js +28 -8
- package/dist/vite/mionVitePlugin.js.map +1 -1
- package/dist/vite/nodeWebBridge.js.map +1 -1
- package/dist/vite/sfcTransform.d.ts +1 -0
- package/dist/vite/sfcTransform.js +17 -7
- package/dist/vite/sfcTransform.js.map +1 -1
- package/package.json +8 -13
- package/dist/next/index.d.ts +0 -11
- package/dist/next/index.js +0 -17
- package/dist/next/index.js.map +0 -1
- package/dist/vite/cjsPackageJsonPlugin.d.ts +0 -3
- package/dist/vite/cjsPackageJsonPlugin.js +0 -12
- package/dist/vite/cjsPackageJsonPlugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-deps.js","sourceRoot":"","sources":["../../src/core/type-deps.ts"],"names":[],"mappings":"AAKA,OAAO,IAAI,MAAM,WAAW,CAAC;AAiB7B,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,GAAW;IAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACnE,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAE7C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE/C,SAAS,MAAM,CAAC,OAAe;QAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU;gBAAE,SAAS;YAC1B,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC;gBAAE,OAAO,CAAC,M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YACvB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;YAC9B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;gBAC3B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;gBAClD,IAAI,CAAC,UAAU;oBAAE,SAAS;gBAC1B,KAAK,MAAM,QAAQ,IAAI,UAAU;oBAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACvD,CAAC;YACD,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;QAED,cAAc;YACZ,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpC,CAAC;QAED,gBAAgB;YACd,MAAM,GAAG,GAAa,EAAE,CAAC;YACzB,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC;gBACvC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;oBAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1C,CAAC;YACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,CAAC,QAAQ;YACb,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,CAAC;YAChB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAED,KAAK;YACH,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// The type-dependency index: which site files reflect a type declared in which source file, and so\n// must be re-transformed when it changes. Every host funnels through the plugin's `transform` hook,\n// the Next broker included (it calls the same hook over its socket), so every bundler gets one index\n// built the same way. Paths are normalised to absolute forward-slashed form because the shapes differ:\n// the resolver reports absolute program paths, Vite absolute ids, the plugin's bookkeeping is relative.\nimport path from 'node:path';\n\nexport interface TypeDepsIndex {\n /** Records the files declaring the types `siteFile` reflects, replacing any previous record for it. */\n record(siteFile: string, deps: readonly string[] | undefined): void;\n /** Site files whose reflected types are declared in any of `changed`. */\n affectedSiteFiles(changed: readonly string[]): string[];\n /** Every site file the index has a record for, whatever its deps. */\n knownSiteFiles(): string[];\n /** Site files we transformed but got no deps for — the ones a coarse fallback still has to cover. */\n unknownSiteFiles(): string[];\n /** Drops a site file's record (it stopped carrying sites, or was deleted). */\n forget(siteFile: string): void;\n clear(): void;\n}\n\n/** Absolute + forward-slashed, so the same file compares equal across hosts. */\nexport function depKey(file: string, cwd: string): string {\n const abs = path.isAbsolute(file) ? file : path.resolve(cwd, file);\n return abs.split(path.sep).join('/');\n}\n\nexport function createTypeDepsIndex(cwd: string): TypeDepsIndex {\n // siteFile -> its type files; an empty set means transformed but nothing reported (`unknownSiteFiles`).\n const forward = new Map<string, Set<string>>();\n // typeFile -> its site files; kept alongside `forward` so a change lookup is O(1), not a scan per edit.\n const reverse = new Map<string, Set<string>>();\n\n function unlink(siteKey: string): void {\n const previous = forward.get(siteKey);\n if (!previous) return;\n for (const dep of previous) {\n const dependents = reverse.get(dep);\n if (!dependents) continue;\n dependents.delete(siteKey);\n if (dependents.size === 0) reverse.delete(dep);\n }\n }\n\n return {\n record(siteFile, deps) {\n const siteKey = depKey(siteFile, cwd);\n // Re-recording REPLACES, or an edit to a since-removed dependency re-transforms the file forever.\n unlink(siteKey);\n const next = new Set<string>();\n for (const dep of deps ?? []) next.add(depKey(dep, cwd));\n forward.set(siteKey, next);\n for (const dep of next) {\n let dependents = reverse.get(dep);\n if (!dependents) {\n dependents = new Set<string>();\n reverse.set(dep, dependents);\n }\n dependents.add(siteKey);\n }\n },\n\n affectedSiteFiles(changed) {\n const out = new Set<string>();\n for (const file of changed) {\n const dependents = reverse.get(depKey(file, cwd));\n if (!dependents) continue;\n for (const siteFile of dependents) out.add(siteFile);\n }\n return [...out].sort();\n },\n\n knownSiteFiles() {\n return [...forward.keys()].sort();\n },\n\n unknownSiteFiles() {\n const out: string[] = [];\n for (const [siteFile, deps] of forward) {\n if (deps.size === 0) out.push(siteFile);\n }\n return out.sort();\n },\n\n forget(siteFile) {\n const siteKey = depKey(siteFile, cwd);\n unlink(siteKey);\n forward.delete(siteKey);\n },\n\n clear() {\n forward.clear();\n reverse.clear();\n },\n };\n}\n"]}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -10,4 +10,12 @@ export interface GroupedEntry extends Pick<Diagnostic, 'severity' | 'site' | 're
|
|
|
10
10
|
slots?: readonly string[];
|
|
11
11
|
args?: readonly string[];
|
|
12
12
|
}
|
|
13
|
+
export type CacheKeyGenerator = (context: {
|
|
14
|
+
id: string;
|
|
15
|
+
sourceCode: string;
|
|
16
|
+
}) => string | false | undefined;
|
|
17
|
+
export interface VitestCacheContext {
|
|
18
|
+
defineCacheKeyGenerator?: (generator: CacheKeyGenerator) => void;
|
|
19
|
+
experimental_defineCacheKeyGenerator?: (generator: CacheKeyGenerator) => void;
|
|
20
|
+
}
|
|
13
21
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {Diagnostic} from './protocol.ts';\n\nexport type LogStyle = 'grouped' | 'lines';\n\nexport interface Finding {\n diagnostic: Diagnostic;\n downgraded: boolean;\n}\n\n// Twin of Go diagnostics.GroupedEntry; template carries `{slot}` names when slots is set, else the finished text.\nexport interface GroupedEntry extends Pick<Diagnostic, 'severity' | 'site' | 'related' | 'downgraded'> {\n name: string;\n template: string;\n slots?: readonly string[];\n args?: readonly string[];\n}\n\n// The slice of Vitest's `configureVitest` context the cache key needs, kept here so devtools never imports vitest.\nexport type CacheKeyGenerator = (context: {id: string; sourceCode: string}) => string | false | undefined;\nexport interface VitestCacheContext {\n defineCacheKeyGenerator?: (generator: CacheKeyGenerator) => void;\n experimental_defineCacheKeyGenerator?: (generator: CacheKeyGenerator) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-floor.js","sourceRoot":"","sources":["../../src/core/typescript-floor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript-floor.js","sourceRoot":"","sources":["../../src/core/typescript-floor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAGxC,IAAI,cAAc,GAAG,KAAK,CAAC;AAG3B,MAAM,UAAU,gCAAgC;IAC9C,cAAc,GAAG,KAAK,CAAC;AACzB,CAAC;AAID,MAAM,UAAU,0BAA0B,CAAC,GAAW;IACpD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QACrG,OAAO,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAKD,MAAM,UAAU,wBAAwB,CAAC,GAAW,EAAE,UAAkB,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI;IAC3F,IAAI,cAAc;QAAE,OAAO;IAC3B,cAAc,GAAG,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO;IAClC,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,sBAAsB;QAAE,OAAO;IACvE,IAAI,CACF,GAAG,UAAU,gBAAgB,OAAO,oCAAoC,sBAAsB,QAAQ;QACpG,4EAA4E;QAC5E,sEAAsE,CACzE,CAAC;AACJ,CAAC","sourcesContent":["// A build-time notice of the consumer's TypeScript floor. No peer range backs it: devtools never loads\n// TypeScript, so any version installs. Deliberately off the public surface.\n\nimport fs from 'node:fs';\nimport {createRequire} from 'node:module';\nimport path from 'node:path';\n\n// Oldest major whose tsconfig the bundled compiler reads as that version's editor does.\nexport const TYPESCRIPT_FLOOR_MAJOR = 6;\n\n// Once per process, not per build: a monorepo runs several plugin containers against one install.\nlet alreadyChecked = false;\n\n// resetTypeScriptFloorCheckForTest clears the once-per-process latch. Tests only.\nexport function resetTypeScriptFloorCheckForTest(): void {\n alreadyChecked = false;\n}\n\n// installedTypeScriptVersion resolves from the consumer's cwd, so a workspace gets ITS copy rather than\n// whichever one sits beside this plugin. Undefined is a normal setup: the resolver carries its own.\nexport function installedTypeScriptVersion(cwd: string): string | undefined {\n try {\n const resolveFrom = createRequire(path.join(cwd, 'noop.js'));\n const manifest = JSON.parse(fs.readFileSync(resolveFrom.resolve('typescript/package.json'), 'utf8'));\n return typeof manifest.version === 'string' ? manifest.version : undefined;\n } catch {\n return undefined;\n }\n}\n\n// warnBelowTypeScriptFloor never throws and never fails a build: type resolution runs on this package's\n// OWN compiler, so an older one cannot break it. All it can do is write a tsconfig the resolver reads\n// differently than the editor does, which is worth a log line and nothing more.\nexport function warnBelowTypeScriptFloor(cwd: string, pluginName: string, warn = console.warn): void {\n if (alreadyChecked) return;\n alreadyChecked = true;\n const version = installedTypeScriptVersion(cwd);\n if (version === undefined) return;\n const major = Number.parseInt(version, 10);\n if (!Number.isFinite(major) || major >= TYPESCRIPT_FLOOR_MAJOR) return;\n warn(\n `${pluginName}: TypeScript ${version} is below the supported floor of ${TYPESCRIPT_FLOOR_MAJOR}.0.0. ` +\n `Type resolution uses this package's own compiler, so builds keep working, ` +\n `but your tsconfig may be read differently than your editor reads it.`\n );\n}\n"]}
|
package/dist/core/unplugin.d.ts
CHANGED
package/dist/core/unplugin.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -16,6 +17,7 @@ import { haltError, hostHalt, hostWarn, printFindings, surfaceDiagnostics } from
|
|
|
16
17
|
import { DevReporter } from "./devReporter.js";
|
|
17
18
|
import { createTypeDepsIndex, depKey } from "./type-deps.js";
|
|
18
19
|
import { warnBelowTypeScriptFloor } from "./typescript-floor.js";
|
|
20
|
+
const VIRTUAL_SFC_SCRIPT = /\.vue\.[mc]?[jt]sx?$/;
|
|
19
21
|
export const PLUGIN_NAME = '@mionjs/devtools';
|
|
20
22
|
const BUNDLED_API_ID = '#bundled-api';
|
|
21
23
|
const bundledApiStubPath = () => {
|
|
@@ -50,7 +52,9 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
50
52
|
let resolver = null;
|
|
51
53
|
let activeBuilds = 0;
|
|
52
54
|
let siteFiles = new Set();
|
|
55
|
+
let cacheDigest;
|
|
53
56
|
let cwdAbs = '';
|
|
57
|
+
let realCwdAbs = '';
|
|
54
58
|
let genDirAbs = '';
|
|
55
59
|
let pureFnArtifact = {};
|
|
56
60
|
let viteRoot = '';
|
|
@@ -66,6 +70,7 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
66
70
|
if (resolver)
|
|
67
71
|
return;
|
|
68
72
|
cwdAbs = path.resolve(options.cwd ?? (viteRoot || process.cwd()));
|
|
73
|
+
realCwdAbs = fs.existsSync(cwdAbs) ? fs.realpathSync(cwdAbs) : cwdAbs;
|
|
69
74
|
genDirAbs = options.genDir ? path.resolve(cwdAbs, options.genDir) : '';
|
|
70
75
|
assertValidModuleMode(options.moduleMode);
|
|
71
76
|
assertValidClientRoutes(options.clientRoutes);
|
|
@@ -81,6 +86,7 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
81
86
|
...(options.hashLength !== undefined ? { hashLength: options.hashLength } : {}),
|
|
82
87
|
...(options.patternSampleCount !== undefined ? { patternSampleCount: options.patternSampleCount } : {}),
|
|
83
88
|
...(options.patternSampleRetries !== undefined ? { patternSampleRetries: options.patternSampleRetries } : {}),
|
|
89
|
+
...(options.maxUnknownKeys !== undefined ? { maxUnknownKeys: options.maxUnknownKeys } : {}),
|
|
84
90
|
...(options.jsonMaxBytes !== undefined ? { jsonMaxBytes: options.jsonMaxBytes } : {}),
|
|
85
91
|
...(options.markers?.packages?.length ? { markerPackages: options.markers.packages } : {}),
|
|
86
92
|
...(options.markers?.checkPackage === false ? { markerPackageCheck: false } : {}),
|
|
@@ -134,6 +140,12 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
134
140
|
const rel = path.isAbsolute(file) ? path.relative(cwdAbs || process.cwd(), file) : file;
|
|
135
141
|
return rel.split(path.sep).join('/');
|
|
136
142
|
}
|
|
143
|
+
function failOnSymlinkedSite(id) {
|
|
144
|
+
if (realCwdAbs === cwdAbs || !siteFiles.has(siteKey(path.relative(realCwdAbs, id))))
|
|
145
|
+
return;
|
|
146
|
+
throw new Error(`@mionjs/devtools: cannot rewrite the mion calls in ${id}. The project path ${cwdAbs} goes through a symlink, ` +
|
|
147
|
+
`but the bundler loads real paths. Build from ${realCwdAbs} instead.`);
|
|
148
|
+
}
|
|
137
149
|
function surfaceNewErrors(ctx, diagnostics, activeFile) {
|
|
138
150
|
const cwd = cwdAbs || process.cwd();
|
|
139
151
|
if (isDevServer()) {
|
|
@@ -196,7 +208,7 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
196
208
|
}
|
|
197
209
|
declareTypeDeps(ctx, rel, fileResult.typeDeps);
|
|
198
210
|
try {
|
|
199
|
-
const applied = applyEdits(rel, code, fileResult.importBlock ?? '', fileResult.edits ?? []);
|
|
211
|
+
const applied = applyEdits(rel, code, fileResult.importBlock ?? '', fileResult.importAt ?? 0, fileResult.edits ?? []);
|
|
200
212
|
return { code: applied.code, map: applied.map };
|
|
201
213
|
}
|
|
202
214
|
catch (error) {
|
|
@@ -286,6 +298,32 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
286
298
|
pureFnArtifact = gen.pureFnArtifact;
|
|
287
299
|
return gen;
|
|
288
300
|
}
|
|
301
|
+
function digestOf(gen) {
|
|
302
|
+
if (!gen.programHash)
|
|
303
|
+
return undefined;
|
|
304
|
+
const hash = createHash('sha256');
|
|
305
|
+
for (const part of [gen.programHash, ...[...gen.modules].sort(), ...[...gen.siteFiles].sort(), gen.batchesModule]) {
|
|
306
|
+
hash.update(part).update('\0');
|
|
307
|
+
}
|
|
308
|
+
hash.update(JSON.stringify(options) ?? '');
|
|
309
|
+
return hash.digest('hex');
|
|
310
|
+
}
|
|
311
|
+
function mayTransform(code, id) {
|
|
312
|
+
if (!/\.[mc]?[jt]sx?$/.test(id))
|
|
313
|
+
return false;
|
|
314
|
+
const rel = path.relative(cwdAbs || process.cwd(), id);
|
|
315
|
+
return siteFiles.has(siteKey(rel)) || mayHoldMarkerCalls(code, id, options.markers) || mayHoldDrizzleSchemas(code);
|
|
316
|
+
}
|
|
317
|
+
const cacheKeyFor = ({ id, sourceCode }) => {
|
|
318
|
+
if (!/\.[mc]?[jt]sx?$/.test(id))
|
|
319
|
+
return undefined;
|
|
320
|
+
if (!resolver || !cacheDigest)
|
|
321
|
+
return false;
|
|
322
|
+
return mayTransform(sourceCode, id) ? cacheDigest : undefined;
|
|
323
|
+
};
|
|
324
|
+
function configureVitest(context) {
|
|
325
|
+
(context.defineCacheKeyGenerator ?? context.experimental_defineCacheKeyGenerator)?.(cacheKeyFor);
|
|
326
|
+
}
|
|
289
327
|
async function writePureFnArtifact(dir) {
|
|
290
328
|
if (!dir)
|
|
291
329
|
return;
|
|
@@ -398,6 +436,9 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
398
436
|
sourceOverlay.set(overlayKey(rels[index]), update.content);
|
|
399
437
|
});
|
|
400
438
|
const sources = Object.fromEntries(sourceOverlay);
|
|
439
|
+
const editsProgram = relevant.some((update) => !VIRTUAL_SFC_SCRIPT.test(update.file));
|
|
440
|
+
if (editsProgram)
|
|
441
|
+
cacheDigest = undefined;
|
|
401
442
|
if (Object.keys(sources).length > 0) {
|
|
402
443
|
try {
|
|
403
444
|
await resolver.setSources(sources);
|
|
@@ -433,6 +474,8 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
433
474
|
options.onBatchReport(result.batchSites ?? [], 'update', relevant.map((update) => path.resolve(update.file)));
|
|
434
475
|
try {
|
|
435
476
|
const gen = await regenerate();
|
|
477
|
+
if (editsProgram)
|
|
478
|
+
cacheDigest = digestOf(gen);
|
|
436
479
|
for (const file of gen.siteFiles)
|
|
437
480
|
siteFiles.add(siteKey(file));
|
|
438
481
|
reportGenerate(gen);
|
|
@@ -489,6 +532,7 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
489
532
|
rtHotUpdate: applyHotUpdate,
|
|
490
533
|
rtWritePureFnArtifact: writePureFnArtifact,
|
|
491
534
|
rtGenDir: () => genDirAbs,
|
|
535
|
+
rtCacheDigest: () => (resolver && cacheDigest) || false,
|
|
492
536
|
enforce: 'pre',
|
|
493
537
|
async buildStart() {
|
|
494
538
|
activeBuilds += 1;
|
|
@@ -497,6 +541,7 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
497
541
|
const gen = await regenerate();
|
|
498
542
|
if (gen.outDir)
|
|
499
543
|
genDirAbs = gen.outDir;
|
|
544
|
+
cacheDigest = digestOf(gen);
|
|
500
545
|
downgrade = resolveDowngradeErrors(options.downgradeErrors ?? gen.downgradeErrors);
|
|
501
546
|
showInfo = resolveShowInfo(options.levels ?? gen.levels);
|
|
502
547
|
grouped = resolveGrouped(options.logStyle ?? gen.logStyle);
|
|
@@ -538,23 +583,24 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
538
583
|
async transform(code, id) {
|
|
539
584
|
if (!resolver)
|
|
540
585
|
return null;
|
|
541
|
-
if (
|
|
586
|
+
if (!mayTransform(code, id)) {
|
|
587
|
+
failOnSymlinkedSite(id);
|
|
542
588
|
return null;
|
|
589
|
+
}
|
|
543
590
|
const rel = path.relative(cwdAbs || process.cwd(), id);
|
|
544
591
|
const inSiteSet = siteFiles.has(siteKey(rel));
|
|
545
|
-
if (!inSiteSet && !mayHoldMarkerCalls(code, id, options.markers) && !mayHoldDrizzleSchemas(code))
|
|
546
|
-
return null;
|
|
547
592
|
try {
|
|
548
593
|
return await (transformMode === 'edits' ? transformViaEdits(this, rel, code) : transformViaGo(this, rel, { code }));
|
|
549
594
|
}
|
|
550
595
|
catch (error) {
|
|
551
|
-
if (
|
|
552
|
-
|
|
553
|
-
|
|
596
|
+
if (inSiteSet || !(error instanceof Error && error.message.includes('source file not in program')))
|
|
597
|
+
throw error;
|
|
598
|
+
failOnSymlinkedSite(id);
|
|
599
|
+
return null;
|
|
554
600
|
}
|
|
555
601
|
},
|
|
556
|
-
rollup: { writeBundle: writeArtifactForOutput },
|
|
557
|
-
rolldown: { writeBundle: writeArtifactForOutput },
|
|
602
|
+
rollup: { writeBundle: writeArtifactForOutput, configureVitest },
|
|
603
|
+
rolldown: { writeBundle: writeArtifactForOutput, configureVitest },
|
|
558
604
|
esbuild: {
|
|
559
605
|
setup(build) {
|
|
560
606
|
build.onEnd(() => writePureFnArtifact(outputDirOf(build.initialOptions)));
|
|
@@ -569,7 +615,14 @@ export const unplugin = createUnplugin((rawOptions, meta) => {
|
|
|
569
615
|
},
|
|
570
616
|
},
|
|
571
617
|
vite: {
|
|
572
|
-
|
|
618
|
+
configureVitest,
|
|
619
|
+
writeBundle(output, bundle) {
|
|
620
|
+
const config = this.environment?.config;
|
|
621
|
+
const isApp = config?.consumer === 'client' && !config.build?.lib && Object.keys(bundle).some((file) => file.endsWith('.html'));
|
|
622
|
+
if (isApp)
|
|
623
|
+
return;
|
|
624
|
+
return writePureFnArtifact(outputDirOf(output));
|
|
625
|
+
},
|
|
573
626
|
buildApp: {
|
|
574
627
|
order: 'post',
|
|
575
628
|
async handler(builder) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.js","sourceRoot":"","sources":["../../src/core/unplugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,cAAc,EAAC,MAAM,UAAU,CAAC;AACxC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAC,cAAc,EAAsB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,KAAK,EAAmD,MAAM,eAAe,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAqC,MAAM,gDAAgD,CAAC;AACxH,OAAO,EAAC,uBAAuB,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AA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,CAAC;AAEH,eAAe,QAAQ,CAAC;AAExB,OAAO,EAAC,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAGnE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,GAEd,MAAM,gDAAgD,CAAC","sourcesContent":["import {createHash} from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {createUnplugin} from 'unplugin';\nimport {getExePath} from '@mionjs/bin-compiler';\nimport {DIAGNOSTIC_CATALOG} from './go-generated/diagnosticCatalog.generated.ts';\nimport {ResolverClient, type GenerateResult} from './resolver-client.ts';\nimport {applyEdits, sourceHash} from './apply-edits.ts';\nimport {Level, type BatchSite, type Diagnostic, type PureFnSite} from './protocol.ts';\nimport {PURE_FN_ARTIFACT_DIR, type ClientRoutes, type ModuleMode} from './go-generated/runtypes-constants.generated.ts';\nimport {assertValidClientRoutes, assertValidModuleMode} from './option-guards.ts';\nimport {mayHoldDrizzleSchemas, mayHoldMarkerCalls} from './markerImports.ts';\nimport {isDowngraded, resolveDowngradeErrors, DOWNGRADE_ALL, type DowngradeSet} from './downgradeErrors.ts';\nimport {LEVELS_ALL, resolveGrouped, resolveShowInfo} from './levels.ts';\nimport {haltError, hostHalt, hostWarn, printFindings, surfaceDiagnostics, type HostContext} from './surface.ts';\nimport type {CacheKeyGenerator, Finding, LogStyle, VitestCacheContext} from './types.ts';\nimport {DevReporter} from './devReporter.ts';\nimport {createTypeDepsIndex, depKey} from './type-deps.ts';\nimport {warnBelowTypeScriptFloor} from './typescript-floor.ts';\n\n// The path the Vue pass registers an SFC's <script> under: `Comp.vue.ts` next to `Comp.vue`.\nconst VIRTUAL_SFC_SCRIPT = /\\.vue\\.[mc]?[jt]sx?$/;\n\n// Host-facing plugin name, shared by every adapter entry (the bun one needs it before it builds the inner plugin).\nexport const PLUGIN_NAME = '@mionjs/devtools';\n\n// Shares the SHAPE of the tsconfig `i18n` plugin entry but drives a different lane: the plugin's\n// per-locale translation-mirror auto-sync. `strict` is accepted for shape-parity and never gated on.\nexport interface EnrichI18nSyncOptions {\n sourceLocale?: string;\n locales?: string[];\n strict?: boolean;\n}\n\n// Opt-in (default OFF): from dev/watch, the committed mirrors under <genDir>/enriched/** get the same\n// value-preserving scaffold + reconcile `mion enrich --update` does, never translated content, never an LLM.\n// A production build never writes; it runs a read-only gate that warns and fails on a stale, missing or unfilled mirror.\nexport interface EnrichSyncOptions {\n // FriendlyText mirrors, under <genDir>/enriched/friendly/.\n friendly?: boolean;\n // MockData mirrors, under <genDir>/enriched/mock/.\n mock?: boolean;\n // Presence enables per-locale mirrors under <genDir>/enriched/i18n/<locale>/ — SCAFFOLD + SYNC only.\n i18n?: EnrichI18nSyncOptions;\n // Defaults to \"any enrich family enabled\", since the mirrors are write-only outputs.\n // false restores reloads for debugging; true suppresses even with auto-gen off (hand / CLI edits during a dev run).\n suppressHmr?: boolean;\n}\n\n/** What one generate produced, as handed to `onGenerate`. Paths are absolute. */\nexport interface GenerateInfo {\n outDir: string;\n // `<outDir>/rpc/batches.generated.js`, or '' when no batch table was written.\n batchesModule: string;\n routerInitFiles: string[];\n}\n\n// The host-plugin surface. tsconfig's `mion` plugin entry is the canonical home of the PROJECT knobs\n// (emitMode, moduleMode, inlineMode, hashLength, parallelScan/Render, singleThreaded); set here they\n// override one build, tsc-style. `binary` / `cwd` / `tsconfig` / `genDir` have no tsconfig equivalent.\nexport interface PluginOptions {\n // Defaults to the host platform's prebuilt binary via the `@mionjs/bin-compiler` launcher.\n // Set it only to point at a custom or local build — in-repo development passes `mion-bin/mion`.\n binary?: string;\n // Project root (where tsconfig.json lives). Defaults to Vite's resolved root, else process.cwd().\n cwd?: string;\n // Relative to cwd; unset, searched upward from cwd like tsc.\n tsconfig?: string;\n // Default 'bundle'; 'fetch' fetches every route. Same key as tsconfig `clientRoutes` and CLI `--client-routes`.\n // Under 'bundle', a route the build did not see is reported, and fetched only if the client sets up `useFetchMetadata`.\n clientRoutes?: ClientRoutes;\n // Generated-output root, relative to cwd: cache modules under `<genDir>/types/` (gitignored), committed\n // enrichment under `<genDir>/enriched/`. Omitted, the resolver infers `<srcDir>/.mion` from the tsconfig.\n // It lives in the project rather than node_modules so a dev watcher sees regenerated modules.\n genDir?: string;\n // What each RT cache entry ships in its code/factory slots:\n // - 'code' (default): body string only; `materializeRTFn` rebuilds the factory via `new Function` on first lookup.\n // - 'functions': live factory only, for runtimes that disallow `new Function` (WorkerD, CSP without `unsafe-eval`).\n // - 'both': code string AND factory; test setups use it so suites cover both materialisation paths.\n // - 'ts': what 'both' ships, written as typed `.ts` modules with one type module per type id.\n emitMode?: 'code' | 'functions' | 'both' | 'ts';\n // Project-wide defaults for the per-call-site ValidateOptions bag, merged per field (a per-call option wins).\n // - numberMode: the base `number` check — 'isFinite' (default; rejects NaN/Infinity), 'typeof' (accepts\n // them), or 'notNaN' (rejects NaN, accepts Infinity). Eases migration from a looser library.\n validate?: {numberMode?: 'isFinite' | 'typeof' | 'notNaN'};\n // NB: there is deliberately NO cacheDir option. The on-disk RT artifact cache (under node_modules/.cache/mion,\n // separate from `genDir`) follows the project's tsconfig `incremental` / `composite` switch.\n // (The internal MION_CACHE_DIR env var overrides it for tests / direct use.)\n //\n // Pass `false` to force the serial marker scan / entry collection (--no-parallel-scan / --no-parallel-render).\n // Output is equivalent either way — these exist for benchmarking baselines and debugging.\n parallelScan?: boolean;\n parallelRender?: boolean;\n // Force single-checker, fully-serial scan/render. Output is equivalent; the child is lighter.\n // Overrides the tsconfig `singleThreaded` in EITHER direction (--single-threaded / --no-single-threaded).\n singleThreaded?: boolean;\n // Length of the short structural-hash ids in generated names (--hash-length; undefined = the binary\n // default, 7). Canonical home is the tsconfig `hashLength` knob; set here it overrides one build.\n hashLength?: number;\n // mockSamples generated for a format pattern that declares none (--pattern-sample-count; undefined = 100;\n // 0 makes a sample-less pattern a build error). The pool re-rolls every build unless a literal mock seed pins it.\n // Canonical home is the tsconfig `patternSampleCount` knob.\n patternSampleCount?: number;\n // Per-sample draw multiplier (--pattern-sample-retries; undefined = 10): the budget is\n // patternSampleCount × patternSampleRetries draws before a pattern is declared ungeneratable.\n // Raise it for heavily constrained patterns. Canonical home is the tsconfig `patternSampleRetries` knob.\n patternSampleRetries?: number;\n // Internal, undocumented (--max-unknown-keys; undefined = 10): unknown-key errors a strict errors fn lists per object\n // before one `tooManyUnknownKeys` entry. Canonical home is the tsconfig `maxUnknownKeys` knob.\n maxUnknownKeys?: number;\n // Emit, on every reflection root whose type is fully bounded, the largest compact-JSON size a valid value\n // can have, which a framework turns into per-route request and response limits. On by default; `false`\n // emits none, so a project that keeps its own limits pays nothing. Canonical home is the tsconfig `jsonMaxBytes` key.\n jsonMaxBytes?: boolean;\n // Which packages may declare the marker types, so a library can ship the brands itself instead of\n // depending on mion just for types. Canonical home is the tsconfig `markers` key.\n // packages — extra package names. Additive: '@mionjs/run-types' stays accepted, and the list is\n // UNIONED with the tsconfig `markers.packages` entry rather than replacing it.\n // checkPackage — false drops the package check, matching a marker on its type NAME alone, so a local\n // `type InjectRunTypeId<T> = …` drives rewrites too.\n markers?: {packages?: string[]; checkPackage?: boolean};\n // How cache entries group into modules:\n // 'default' — runtype nodes ride one data module per source file (`rt/<hash>`), rows several files reach\n // one shared module (`rt/shared/<hash>`); every fn-family / composite / pure-fn entry is its\n // own module. Best chunk-splitting granularity.\n // 'allSingle' — one module per fn family (`fns/<tag>`), one `pf` pure-fn bundle, one runtypes module for\n // the whole program. Fewest requests; family bundles re-fetch wholesale on type edits.\n // 'allModules' — per-entry fn modules AND per-node runtype modules. Escape hatch; measurably slower\n // on dense reflection graphs.\n moduleMode?: ModuleMode;\n // Child-inlining policy:\n // 'default' — the name rule: UNNAMED compounds (arrays, tuples, object literals, unions, classes)\n // inline into their parents (statement bodies hoist to per-factory context fns); NAMED\n // types (alias/interface) and circular types stay external as dedupe-worthy shared\n // entries. Date/Temporal builtins always inline (atomic emits).\n // 'allInternal' — name-blind: everything except circular types inlines, at the cost of duplicating\n // shapes shared across roots.\n inlineMode?: 'default' | 'allInternal';\n // How the per-file rewrite crosses the wire. Host-level: it must never fold into a disk-cache\n // fingerprint, the artifacts are identical either way.\n // 'edits' (default) — the plugin applies the resolver's edit list and generates the source map JS-side.\n // O(sites) on the wire, so it wins the dev loop on large / many-marker files. Requires\n // pristine source (run this plugin first among enforce:'pre'); on drift it re-syncs and warns.\n // 'go' — the resolver returns the whole rewritten file + source map. Heavier wire, but the only\n // option for a non-JS / plugin-free host, and the safe fallback when an upstream pre-plugin\n // rewrites the source before us.\n transformMode?: 'go' | 'edits';\n // 'go' mode only — default true (self-contained maps). False drops `sourcesContent`: the bundler composes\n // the chained map and fills original content itself, trimming the heaviest single wire item.\n // No effect in 'edits' mode (the FE generates its own map).\n sourcesContent?: boolean;\n // Error-severity diagnostics fail the build/transform in every build lane, matching the documented\n // contract (\"Error = will throw at runtime, build must fail\"); a DEV SERVER is the one lane a\n // RuntimeError never halts (see `devServer`). This names the codes to report as WARNINGS instead, so a\n // project blocked on one finding keeps failing on every other; the finding is still printed, which is\n // the difference between unblocking and hiding.\n //\n // `'*'` (and `['*']`) downgrades the lot: the adoption setting, for a project that cannot yet name the\n // codes it has not met. Naming codes is what to reach for once they are known.\n //\n // For a bad call site in your OWN source prefer a comment on the line above it, precise and reported\n // when unused: `@mion-expect-error` removes the finding, `@mion-downgrade-error` keeps it printing and\n // stops it halting. This option is for findings you cannot annotate — raised inside a dependency, or\n // carrying no source line at all.\n //\n // Pure-fn extraction errors halt regardless, `'*'` included: files-mode has no fallback for a failed\n // generation. HMR updates never hard-fail mid-edit either way; the halt re-applies on the next run.\n downgradeErrors?: string[] | typeof DOWNGRADE_ALL;\n // Unset hides Info findings, `'all'` prints them; never changes what halts. Overrides the tsconfig plugin key.\n levels?: typeof LEVELS_ALL;\n // Unset or `'grouped'` groups findings by name, each message once; `'lines'` prints one each. Overrides tsconfig.\n logStyle?: LogStyle;\n // JS runtime the resolver runs format-pattern checks on (--js-runtime); defaults to this plugin's own\n // process.execPath, so the serve lane needs no configuration. Host-specific like `binary` — no tsconfig key.\n jsRuntime?: string;\n // Unref the resolver child so it never holds the host process open. Host bootstrap — no tsconfig key.\n // Set by @mionjs/devtools/runtypes/bun for Bun's RUNTIME loader, which keeps one resolver for the whole\n // process and gets no buildEnd, so a `bun run` script would otherwise hang forever on the live child.\n // Leave it off for a bundler host, where a pending resolver read can be the build's only live handle\n // and an unref'd child would let the process exit mid-build.\n detachResolver?: boolean;\n // Whether this host is a DEV SERVER, the one lane a RuntimeError never halts: it is reported and the\n // generated function throws when called. Every build lane halts on it, so a production bundle never\n // ships one. A fatal Error halts everywhere regardless: no code was produced for that piece.\n //\n // Vite fills it in from its resolved config (`serve`, and not vitest's `test` mode: a test run is a\n // build lane). The Next broker, which has no config hook, sets it from `next dev`. No tsconfig key.\n devServer?: boolean;\n // The structured, layout-independent record of every pure fn this build generated (call-site span,\n // callee attribution, registry key, entry payload), for host tooling that relocates pure-fn bodies\n // across bundles (mion's cross-bundle serverMapFrom transport). Where the report goes:\n // - `'file'` → `<genDir>/types/pure-fns-report.json` on every generate. The path is hardcoded, like\n // every path under genDir, so it inherits types/'s gitignore + regenerate lifecycle.\n // For plugin-free / separate-process / CLI-batch consumers; `onPureFnReport` also fires.\n // - `'callback'` → in-process to `onPureFnReport` only, no file.\n // - `false` / unset → off. Providing `onPureFnReport` without setting this implies `'callback'`;\n // an explicit `false` wins and nothing fires.\n // Both channels carry identical records, and the shape is identical across every `moduleMode`.\n pureFnReport?: 'file' | 'callback' | false;\n // Fires on EVERY adapter (it rides the universal buildStart hook): once with the whole-program report\n // (phase 'build'), and under Vite's HMR again with the changed file's delta (phase 'update').\n // Fires whenever the report is on; setting it with `pureFnReport` unset implies 'callback' (data, no file).\n onPureFnReport?: (sites: PureFnSite[], phase: 'build' | 'update') => void;\n // One record per `batch([...])` call site the build read (ordered route ids, `inputFrom()` mappings, the\n // injected batch id), so the server build can register each plan under the id the client bundle carries.\n // Same phases and hook as `onPureFnReport`, and setting it turns the report data on the same way\n // (`pureFnReport` still decides whether the JSON file is written); the id is injected regardless.\n // On 'update', `scannedFiles` lists the files the scan covered (absolute paths), so a consumer\n // can drop the batches those files no longer define: an empty `sites` is a real answer there.\n onBatchReport?: (sites: BatchSite[], phase: 'build' | 'update', scannedFiles?: string[]) => void;\n // Fired after an incremental update, with the site files whose injected fns just changed — the ones the\n // host must re-transform so they stop serving a validator for the previous shape.\n //\n // The plugin already invalidates what it can resolve itself (Vite's module graph), so a plain bundler\n // host needs nothing here. This exists because NOT EVERY SITE FILE IS A REAL MODULE: sources registered\n // through `setSources` may be virtual — mion registers a Vue SFC's <script> as `Comp.vue.ts` while the\n // module Vite serves is `Comp.vue`, so the set is REPORTED and the host maps its virtual paths back.\n //\n // Paths are absolute and forward-slashed.\n onSiteFilesChanged?: (siteFiles: string[]) => void;\n // Fired after every generate; a host re-transforms router-init modules loaded before the batch module appeared.\n onGenerate?: (info: GenerateInfo) => void;\n // Enrichment auto-sync (opt-in, default OFF). Bundler-plugin-only, a host/dev-loop behavior, so it has\n // no tsconfig counterpart. See EnrichSyncOptions.\n enrich?: EnrichSyncOptions;\n}\n\n// ONE unplugin factory behind every bundler entry point (@mionjs/devtools/runtypes/vite, /rollup, /webpack,\n// /rspack, /esbuild are `unplugin.<bundler>` from this instance). Files-mode: the resolver writes the cache\n// modules to real files under <genDir>/types/ at buildStart and the transform injects relative imports, so\n// every bundler resolves them natively, no virtual-module hooks. Vite-only hooks ride the `vite` escape hatch.\n\n/** The registration lane @mionjs/client imports through; answered with a real file rather than a `load`\n * hook, which would change how esbuild and Bun read every other file too. */\nconst BUNDLED_API_ID = '#bundled-api';\nconst bundledApiStubPath = (): string => {\n const here = path.dirname(fileURLToPath(import.meta.url));\n const compiled = path.join(here, 'bundledApiStub.js');\n return fs.existsSync(compiled) ? compiled : path.join(here, 'bundledApiStub.ts');\n};\n\nexport const unplugin = createUnplugin<PluginOptions | undefined>((rawOptions, meta) => {\n const options = rawOptions ?? {};\n // Validated below at the host boundary, so a config typo fails loudly.\n const transformMode: 'go' | 'edits' = options.transformMode ?? 'edits';\n // Precedence is tsc-style: the explicit plugin option wins, else the tsconfig `downgradeErrors` echoed on\n // the generate response (adopted in buildStart below), else nothing downgraded. Seeded from the option\n // alone so the transform lane behaves even if buildStart never ran on this host.\n let downgrade: DowngradeSet = resolveDowngradeErrors(options.downgradeErrors);\n // Same precedence as downgrade: the option, else the tsconfig echo adopted in buildStart.\n let showInfo = resolveShowInfo(options.levels);\n let grouped = resolveGrouped(options.logStyle);\n // An explicit `false` wins even when a handler is set; a handler with no setting means 'callback'.\n const reportMode: 'file' | 'callback' | false =\n options.pureFnReport ?? (options.onPureFnReport || options.onBatchReport ? 'callback' : false);\n if (reportMode !== false && reportMode !== 'file' && reportMode !== 'callback') {\n throw new Error(\n `[@mionjs/devtools] unknown pureFnReport ${JSON.stringify(options.pureFnReport)} — expected 'file' | 'callback' | false`\n );\n }\n // reportEnabled turns the report DATA on (the callback source, and the file's precondition).\n const reportEnabled: boolean = reportMode !== false;\n const writeReportFile: boolean = reportMode === 'file';\n if (transformMode !== 'go' && transformMode !== 'edits') {\n throw new Error(\n `[@mionjs/devtools] unknown transformMode ${JSON.stringify(options.transformMode)} — expected 'go' | 'edits'`\n );\n }\n // The i18n object's PRESENCE, not a flag inside it, enables per-locale translation-mirror sync.\n const enrichOptions = options.enrich;\n const enrichFriendly = enrichOptions?.friendly === true;\n const enrichMock = enrichOptions?.mock === true;\n const enrichI18n = enrichOptions?.i18n;\n const enrichI18nEnabled = enrichI18n !== undefined;\n const enrichLocales = enrichI18n?.locales ?? [];\n const enrichSourceLocale = enrichI18n?.sourceLocale;\n const anyEnrichFamily = enrichFriendly || enrichMock || enrichI18nEnabled;\n // The mirrors are write-only outputs, so any enrich family on suppresses HMR unless suppressHmr says otherwise.\n const suppressEnrichHmr = enrichOptions?.suppressHmr ?? anyEnrichFamily;\n let resolver: ResolverClient | null = null;\n // Live buildStart/buildEnd pairs across this instance's plugin containers (vite spawns one per\n // environment); the shared resolver closes only when the LAST container tears down — see buildEnd.\n let activeBuilds = 0;\n // The transform gate: cwd-relative, forward-slashed paths of every file the scan found marker sites in.\n // Rebuilt from generate()'s siteFiles at buildStart, kept current per-file by handleHotUpdate.\n let siteFiles = new Set<string>();\n // Vitest cache key for files the transform may rewrite; unset until buildStart and while an edit rebuilds: no caching.\n let cacheDigest: string | undefined;\n let cwdAbs = '';\n let realCwdAbs = '';\n // The resolved output root (<cwd>/.mion by default); modules land under <genDirAbs>/types.\n let genDirAbs = '';\n // Held until writePureFnArtifact: generate runs at buildStart, before a bundler empties its output dir.\n let pureFnArtifact: Record<string, string> = {};\n // Stays empty under every other bundler (no equivalent hook), where ensureResolver falls back to cwd.\n let viteRoot = '';\n // Empty under every other bundler. Gates enrichment auto-sync: 'serve' WRITES the mirrors, anything\n // else runs the read-only drift gate, since a production build must never mutate committed source.\n let viteCommand = '';\n // Vitest runs the serve command in `test` mode, and a test run is a build lane, not a dev server.\n let viteMode = '';\n // The dev server's logger; its `warn` takes `clear: false`, where a plugin's this.warn clears the terminal.\n let viteLogger: {warn: (message: string, options?: {clear?: boolean; timestamp?: boolean}) => void} | undefined;\n // The lane question for RuntimeErrors (see PluginOptions.devServer): halting everywhere but here.\n const isDevServer = (): boolean => options.devServer ?? (viteCommand === 'serve' && viteMode !== 'test');\n // A RuntimeError spares only the dev server, where the generated function throws when called.\n const halts = (diagnostic: Diagnostic): boolean =>\n diagnostic.level === Level.Error || (diagnostic.level === Level.RuntimeError && !isDevServer());\n const devPrint = (block: string): void =>\n viteLogger ? viteLogger.warn(block, {clear: false, timestamp: true}) : console.warn(`[@mionjs/devtools] ${block}`);\n const devReporter = new DevReporter(\n devPrint,\n () => cwdAbs || process.cwd(),\n () => grouped\n );\n // A regenerate failure mid-edit must neither stop the dev server nor pass silently.\n const devRegenerateFailed = (error: unknown): void =>\n devPrint(`@mionjs/devtools: regenerating after an edit failed: ${error instanceof Error ? error.message : String(error)}`);\n\n // Idempotent, and called from two places: under Vite configResolved calls it early (to capture Vite's\n // resolved root), under every other bundler buildStart does.\n function ensureResolver() {\n if (resolver) return;\n cwdAbs = path.resolve(options.cwd ?? (viteRoot || process.cwd()));\n realCwdAbs = fs.existsSync(cwdAbs) ? fs.realpathSync(cwdAbs) : cwdAbs;\n // Empty when unset: no dep to parse tsconfig, so Go owns the <srcDir>/.mion default and echoes it from generate().\n genDirAbs = options.genDir ? path.resolve(cwdAbs, options.genDir) : '';\n // Forward knobs below ONLY when set: unset falls to the tsconfig mion plugin entry, then the binary default.\n // Surface a config typo at the host boundary (the binary validates the merged value too).\n assertValidModuleMode(options.moduleMode);\n assertValidClientRoutes(options.clientRoutes);\n // getExePath throws with a clear message when no platform binary is installed.\n const binaryPath = options.binary ?? getExePath();\n // Only an explicit tsconfig: Go hard errors on a missing or broken one; unset, it searches upward from cwd like tsc.\n resolver = new ResolverClient(binaryPath, cwdAbs, options.tsconfig ?? '', {\n ...(options.emitMode ? {emitMode: options.emitMode} : {}),\n ...(options.validate?.numberMode ? {numberMode: options.validate.numberMode} : {}),\n ...(options.inlineMode ? {inlineMode: options.inlineMode} : {}),\n ...(options.parallelScan !== undefined ? {parallelScan: options.parallelScan} : {}),\n ...(options.parallelRender !== undefined ? {parallelRender: options.parallelRender} : {}),\n ...(options.moduleMode ? {moduleMode: options.moduleMode} : {}),\n ...(options.singleThreaded !== undefined ? {singleThreaded: options.singleThreaded} : {}),\n ...(options.hashLength !== undefined ? {hashLength: options.hashLength} : {}),\n ...(options.patternSampleCount !== undefined ? {patternSampleCount: options.patternSampleCount} : {}),\n ...(options.patternSampleRetries !== undefined ? {patternSampleRetries: options.patternSampleRetries} : {}),\n ...(options.maxUnknownKeys !== undefined ? {maxUnknownKeys: options.maxUnknownKeys} : {}),\n ...(options.jsonMaxBytes !== undefined ? {jsonMaxBytes: options.jsonMaxBytes} : {}),\n ...(options.markers?.packages?.length ? {markerPackages: options.markers.packages} : {}),\n ...(options.markers?.checkPackage === false ? {markerPackageCheck: false} : {}),\n ...(options.jsRuntime ? {jsRuntime: options.jsRuntime} : {}),\n // Report on the wire for both 'file' and 'callback'; the JSON file only for 'file'.\n ...(reportEnabled ? {pureFnReportWire: true} : {}),\n ...(writeReportFile ? {pureFnReportFile: true} : {}),\n // Session config the wire does not carry: genDir rides --gen-dir so EVERY op roots identically.\n // transformRelative: generated modules are real files; locales/sourceLocale default from the tsconfig i18n block.\n ...(genDirAbs ? {genDir: genDirAbs} : {}),\n ...(options.clientRoutes ? {clientRoutes: options.clientRoutes} : {}),\n transformRelative: true,\n ...(options.sourcesContent === false ? {omitSourcesContent: true} : {}),\n ...(enrichFriendly ? {enrichFriendly: true} : {}),\n ...(enrichMock ? {enrichMock: true} : {}),\n ...(enrichI18nEnabled ? {enrichI18n: true} : {}),\n ...(enrichLocales.length > 0 ? {enrichLocales} : {}),\n ...(enrichSourceLocale ? {enrichSourceLocale} : {}),\n });\n // The resolver stays usable, and losing the parent closes its stdin so the Go serve loop exits on EOF.\n if (options.detachResolver) resolver.unref();\n }\n\n // Site file -> the files declaring the types it reflects, and the reverse. Fed by every transform (the\n // Next broker included, since it drives the same hook), read by the incremental-update path. See type-deps.ts.\n const typeDeps = createTypeDepsIndex(cwdAbs || process.cwd());\n\n // `addWatchFile` is unplugin's universal shape (rollup/vite's addWatchFile, the webpack/rspack loader's\n // addDependency), so this one call is what gives webpack, rspack, rollup, rolldown, esbuild, bun and\n // `vite build --watch` an edge they never had. Vite's dev server ignores it for src-module HMR, which is\n // why handleHotUpdate additionally invalidates through the module graph.\n function declareTypeDeps(ctx: any, rel: string, deps: string[] | undefined): void {\n // The index records EVERY dep, virtual ones included: they are real edges for invalidation, even when\n // no bundler can watch them.\n typeDeps.record(rel, deps);\n if (!deps || deps.length === 0) return;\n for (const dep of deps) {\n // ⚠️ Only deps that EXIST ON DISK. A dep can sit on a virtual path (a Vue SFC's <script> registered\n // as `Comp.vue.ts`), and Vite's dev-mode addWatchFile records it as an extra IMPORT of the module\n // being transformed, failing the request with \"Failed to resolve import ./Comp.vue.ts\".\n if (!fileExists(dep)) continue;\n try {\n ctx.addWatchFile?.(dep);\n } catch {\n // A host that exposes the hook but rejects the path (outside its root) must not break the build.\n }\n }\n }\n\n // Memoized because a dev session re-transforms constantly and each transform declares the same deps.\n // Entries are never evicted: a dep that vanishes stops mattering the moment the file naming it is\n // re-transformed, which is when the resolver stops reporting it.\n const fileExistsCache = new Map<string, boolean>();\n function fileExists(file: string): boolean {\n const cached = fileExistsCache.get(file);\n if (cached !== undefined) return cached;\n let exists = false;\n try {\n exists = fs.existsSync(file);\n } catch {\n exists = false;\n }\n fileExistsCache.set(file, exists);\n return exists;\n }\n\n // The resolver reports absolute scan paths while per-file ops and the transform hook use cwd-relative\n // ids; both collapse to one cwd-relative, forward-slashed key so membership checks match.\n function siteKey(file: string): string {\n const rel = path.isAbsolute(file) ? path.relative(cwdAbs || process.cwd(), file) : file;\n return rel.split(path.sep).join('/');\n }\n\n // Hosts load real paths, so a program spelled through a symlinked cwd misses them and silently loses rewrites.\n function failOnSymlinkedSite(id: string): void {\n if (realCwdAbs === cwdAbs || !siteFiles.has(siteKey(path.relative(realCwdAbs, id)))) return;\n throw new Error(\n `@mionjs/devtools: cannot rewrite the mion calls in ${id}. The project path ${cwdAbs} goes through a symlink, ` +\n `but the bundler loads real paths. Build from ${realCwdAbs} instead.`\n );\n }\n\n // A file the buildStart scan couldn't have seen can introduce NEW error-level diagnostics (warnings were\n // already surfaced program-wide). Same lane rule as buildStart: a fatal Error fails the transform\n // everywhere, a RuntimeError everywhere but the dev server.\n function surfaceNewErrors(ctx: HostContext, diagnostics: Diagnostic[], activeFile: string): void {\n const cwd = cwdAbs || process.cwd();\n if (isDevServer()) {\n // Thrown unprinted, as the host prints the throw; generate's whole-program Errors throw from their file too.\n const fatal = devReporter.fatalIn(activeFile, diagnostics);\n devReporter.add(\n diagnostics.filter((diagnostic) => diagnostic.level !== Level.Error),\n downgrade\n );\n if (fatal.length > 0) hostHalt(ctx, haltError(fatal[0], fatal.length, activeFile, cwd));\n return;\n }\n const errors = diagnostics.filter(\n (diagnostic) => diagnostic.level === Level.Error || diagnostic.level === Level.RuntimeError\n );\n surfaceDiagnostics(ctx, errors, {halts, downgrade, activeFile, cwd, grouped});\n }\n\n // The 'go'-mode path, and the safe fallback for 'edits' mode when the source-consistency guard fails.\n // driftCheck is passed only when 'go' is the PRIMARY mode: 'go' rebuilds from the resolver's view and so\n // silently clobbers an upstream enforce:'pre' plugin's edit, and the returned sourceHash at least warns.\n async function transformViaGo(ctx: any, rel: string, driftCheck?: {code: string}) {\n const result = await resolver!.transform([rel]);\n // A file outside the buildStart Program may add types or pure fns, whose modules must be on disk\n // before the bundler resolves the injected imports.\n if (result.addedRunTypes || result.addedPureFns) await regenerate();\n surfaceNewErrors(ctx, result.diagnostics ?? [], rel);\n if (result.sites.length === 0 && (result.replacements?.length ?? 0) === 0) return null;\n const fileResult = result.transformed[rel];\n if (!fileResult || typeof fileResult.code !== 'string') return null;\n declareTypeDeps(ctx, rel, fileResult.typeDeps);\n if (driftCheck && fileResult.sourceHash !== undefined && fileResult.sourceHash !== sourceHash(driftCheck.code)) {\n hostWarn(\n ctx,\n `@mionjs/devtools: transform 'go' source drift on ${rel} — the rewrite was applied to the resolver's copy, not the source another plugin handed us. ` +\n `Order @mionjs/devtools first among enforce:'pre' plugins so it sees pristine source.`\n );\n }\n // The wire SourceMap is structurally valid but typed `sources: (string|null)[]` where the bundler\n // input wants string[], hence the cast.\n return {code: fileResult.code, map: (fileResult.map ?? undefined) as any};\n }\n\n // The 'edits'-mode path. Its source-consistency guard protects against an upstream pre-plugin that edited\n // the source out from under the resolver's byte offsets: on a hash mismatch the source is re-uploaded and\n // re-requested once, and if it still diverges, or the applier throws, it falls back to 'go' mode.\n async function transformViaEdits(ctx: any, rel: string, code: string) {\n const incomingHash = sourceHash(code);\n let result = await resolver!.transform([rel], {emitEdits: true});\n if (result.addedRunTypes || result.addedPureFns) await regenerate();\n surfaceNewErrors(ctx, result.diagnostics ?? [], rel);\n if (result.sites.length === 0 && (result.replacements?.length ?? 0) === 0) return null;\n let fileResult = result.transformed[rel];\n if (!fileResult) return null;\n\n if (fileResult.sourceHash !== undefined && fileResult.sourceHash !== incomingHash) {\n hostWarn(\n ctx,\n `@mionjs/devtools: transform 'edits' source drift on ${rel} — re-syncing via setSources. ` +\n `An enforce:'pre' plugin likely edited this file before @mionjs/devtools; order @mionjs/devtools first to avoid the extra round-trip.`\n );\n try {\n await resolver!.setSources({[rel]: code});\n result = await resolver!.transform([rel], {emitEdits: true});\n if (result.addedRunTypes || result.addedPureFns) await regenerate();\n } catch {\n return transformViaGo(ctx, rel);\n }\n // Outside the try: a halt must throw, never fall back to 'go' mode.\n surfaceNewErrors(ctx, result.diagnostics ?? [], rel);\n if (result.sites.length === 0 && (result.replacements?.length ?? 0) === 0) return null;\n fileResult = result.transformed[rel];\n // Still divergent after a fresh upload — bail to 'go' mode for correctness.\n if (!fileResult || (fileResult.sourceHash !== undefined && fileResult.sourceHash !== incomingHash)) {\n return transformViaGo(ctx, rel);\n }\n }\n\n declareTypeDeps(ctx, rel, fileResult.typeDeps);\n\n try {\n const applied = applyEdits(rel, code, fileResult.importBlock ?? '', fileResult.importAt ?? 0, fileResult.edits ?? []);\n return {code: applied.code, map: applied.map as any};\n } catch (error) {\n // A malformed edit set (should be impossible) must not break the build.\n hostWarn(ctx, `@mionjs/devtools: 'edits' apply failed on ${rel} (${String(error)}) — falling back to 'go' mode.`);\n return transformViaGo(ctx, rel);\n }\n }\n\n // Write-only-on-change, so a converged mirror never churns the watcher, and best-effort per file, since\n // one write failure must not tear down the dev loop. The created / updated split feeds the first-sync summary.\n async function writeMirrorFiles(\n files: {path: string; content: string; added?: boolean}[]\n ): Promise<{created: number; updated: number}> {\n let created = 0;\n let updated = 0;\n for (const file of files) {\n try {\n const existing = await fs.promises.readFile(file.path, 'utf8').catch(() => null);\n if (existing === file.content) continue;\n await fs.promises.mkdir(path.dirname(file.path), {recursive: true});\n await fs.promises.writeFile(file.path, file.content);\n if (file.added) created += 1;\n else updated += 1;\n } catch {\n // best-effort; keep going with the remaining mirrors\n }\n }\n return {created, updated};\n }\n\n // Scaffolds + reconciles the demanded mirrors for `files`, the whole program when [] is passed. The wire\n // carries only the files: which families / locales to sync is the resolver session's spawn-time config.\n // The daemon enriches every EXPORTED type a file declares that a marker call also demands.\n // Dev/watch only (a production build takes the read-only drift gate), and never throws.\n async function syncEnrich(files: string[]): Promise<void> {\n if (!resolver || !anyEnrichFamily) return;\n try {\n const result = await resolver.enrich(files);\n const written = await writeMirrorFiles(result.files);\n // Only the whole-program pass speaks, so a fresh opt-in is never a silent burst of new files;\n // per-file HMR syncs stay quiet, the diff in the editor being the feedback there.\n if (files.length === 0 && written.created + written.updated > 0) {\n console.log(\n `[@mionjs/devtools] enrich sync: scaffolded ${written.created} new mirror file(s), reconciled ${written.updated} — review & commit; fill the blanks before a production build (its completeness gate fails on unfilled scaffolds).`\n );\n }\n } catch {\n // A resolver hiccup mid-edit heals on the next pass — swallow it.\n }\n }\n\n // The production-build lane, the plugin analog of the CLI `enrich --require-complete`: the committed\n // enrichment must be IN SYNC and COMPLETE, checked WITHOUT writing, since mutating committed source\n // mid-build would break reproducibility. Two halves, both warning and both failing the build:\n //\n // - DRIFT: an on-disk mirror missing or differing from the freshly computed one.\n // - INCOMPLETE or STALE: unfilled @todo scaffolds, blank values (empty label / message / pool) and\n // parked @rtOrphan carcasses — the daemon's hygiene findings.\n //\n // Dev/watch takes syncEnrich instead, which writes the scaffolds and tolerates the blanks.\n async function enrichDriftGate(ctx: any): Promise<void> {\n if (!resolver || !anyEnrichFamily) return;\n let stale: string[];\n let incomplete: Diagnostic[];\n try {\n const result = await resolver.enrich([]);\n stale = [];\n for (const file of result.files) {\n const existing = await fs.promises.readFile(file.path, 'utf8').catch(() => null);\n if (existing !== file.content) stale.push(file.path);\n }\n // EVERY hygiene finding is kept, with no level filter: these codes are all LevelWarning (a mirror\n // with a blank label still runs), so filtering by level silently let the @rtOrphan carcasses\n // through. Downgraded ones stay too — a downgrade lowers a finding, it never hides it; only the\n // halt count below drops them.\n incomplete = result.diagnostics ?? [];\n } catch {\n return;\n }\n if (stale.length === 0 && incomplete.length === 0) return;\n for (const stalePath of stale) {\n hostWarn(\n ctx,\n `@mionjs/devtools: enrichment mirror out of date or missing: ${stalePath} — run \\`mion enrich --update\\` and commit it.`\n );\n }\n let fatal = 0;\n const findings: Finding[] = [];\n for (const diagnostic of incomplete) {\n // isDowngraded never lowers a completeness Warning, yet it halts here, so apply `downgradeErrors` by code or `*`.\n const standDown =\n isDowngraded(downgrade, diagnostic) ||\n (DIAGNOSTIC_CATALOG[diagnostic.code]?.completeness === true && (downgrade.all || downgrade.codes.has(diagnostic.code)));\n findings.push({diagnostic, downgraded: standDown});\n if (!standDown) fatal += 1;\n }\n printFindings(ctx, findings, grouped, cwdAbs || process.cwd());\n // The stale-mirror half carries no diagnostic code, so only the wildcard lowers it.\n const staleCount = downgrade.all ? 0 : stale.length;\n if (staleCount === 0 && fatal === 0) return;\n const parts: string[] = [];\n if (staleCount > 0) parts.push(`${staleCount} out of date or missing`);\n if (fatal > 0) parts.push(`${fatal} incomplete or stale (unfilled @todo / blank value / @rtOrphan carcass)`);\n hostHalt(\n ctx,\n new Error(\n `@mionjs/devtools: enrichment is not production-ready — ${parts.join(', ')}. ` +\n `Run \\`mion enrich --update\\`, fill the blanks, and commit. (mirrors are never written during a production build)`\n )\n );\n }\n\n // Every generate goes through here, so the artifact always tracks the last whole-program render.\n async function regenerate(): Promise<GenerateResult> {\n const gen = await resolver!.generate();\n pureFnArtifact = gen.pureFnArtifact;\n return gen;\n }\n\n // Transform output follows the whole program, the generated module set and the options, never the file alone.\n function digestOf(gen: GenerateResult): string | undefined {\n if (!gen.programHash) return undefined;\n const hash = createHash('sha256');\n for (const part of [gen.programHash, ...[...gen.modules].sort(), ...[...gen.siteFiles].sort(), gen.batchesModule]) {\n hash.update(part).update('\\0');\n }\n // Functions drop out: callbacks only observe, they never change what the transform writes.\n hash.update(JSON.stringify(options) ?? '');\n return hash.digest('hex');\n }\n\n // The transform's own gate, so a file the transform leaves alone keeps Vitest's plain key.\n function mayTransform(code: string, id: string): boolean {\n if (!/\\.[mc]?[jt]sx?$/.test(id)) return false;\n const rel = path.relative(cwdAbs || process.cwd(), id);\n return siteFiles.has(siteKey(rel)) || mayHoldMarkerCalls(code, id, options.markers) || mayHoldDrizzleSchemas(code);\n }\n\n // Vitest's `defineCacheKeyGenerator` contract: a string joins the key, false skips the disk cache, undefined adds nothing.\n // Before the first generate the site set is empty, so a wrapper call site would pass for untouched: skip them all.\n const cacheKeyFor: CacheKeyGenerator = ({id, sourceCode}) => {\n if (!/\\.[mc]?[jt]sx?$/.test(id)) return undefined;\n if (!resolver || !cacheDigest) return false;\n return mayTransform(sourceCode, id) ? cacheDigest : undefined;\n };\n\n // Vitest reads this off any plugin in the config; Vitest 4 named the registrar `experimental_`.\n function configureVitest(context: VitestCacheContext): void {\n (context.defineCacheKeyGenerator ?? context.experimental_defineCacheKeyGenerator)?.(cacheKeyFor);\n }\n\n // `<dir>/mion-pure-fns/` is the build's alone; a file with unchanged bytes is skipped so a watch build is not retriggered.\n // Each bundler's own post-bundle hook calls it, since unplugin's arg-less writeBundle carries no output dir.\n async function writePureFnArtifact(dir: string): Promise<void> {\n if (!dir) return;\n const artifactDir = path.join(dir, PURE_FN_ARTIFACT_DIR);\n const files = Object.keys(pureFnArtifact);\n if (files.length === 0) {\n await fs.promises.rm(artifactDir, {recursive: true, force: true});\n return;\n }\n const live = new Set<string>();\n for (const rel of files) {\n const target = path.join(artifactDir, ...rel.split('/'));\n live.add(target);\n const content = pureFnArtifact[rel];\n const existing = await fs.promises.readFile(target, 'utf8').catch(() => null);\n if (existing === content) continue;\n await fs.promises.mkdir(path.dirname(target), {recursive: true});\n await fs.promises.writeFile(target, content);\n }\n await pruneArtifactDir(artifactDir, live);\n }\n\n async function pruneArtifactDir(dir: string, live: Set<string>): Promise<boolean> {\n let empty = true;\n for (const entry of await fs.promises.readdir(dir, {withFileTypes: true})) {\n const target = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (await pruneArtifactDir(target, live)) await fs.promises.rmdir(target);\n else empty = false;\n } else if (live.has(target)) empty = false;\n else await fs.promises.rm(target, {force: true});\n }\n return empty;\n }\n\n function outputDirOf(output: {dir?: string; file?: string; outdir?: string; outfile?: string; absWorkingDir?: string}): string {\n const base = output.absWorkingDir ?? process.cwd();\n const dir = output.dir ?? output.outdir;\n if (dir) return path.resolve(base, dir);\n const file = output.file ?? output.outfile;\n return file ? path.dirname(path.resolve(base, file)) : '';\n }\n\n // Fires once per output, so every output dir gets a copy.\n async function writeArtifactForOutput(this: unknown, output: {dir?: string; file?: string}): Promise<void> {\n await writePureFnArtifact(outputDirOf(output));\n }\n\n // afterEmit runs once the bundle is on disk.\n function writeArtifactAfterEmit(compiler: {\n options: {output: {path?: string}};\n hooks: {afterEmit: {tapPromise: (name: string, fn: () => Promise<void>) => void}};\n }): void {\n compiler.hooks.afterEmit.tapPromise(PLUGIN_NAME, () => writePureFnArtifact(compiler.options.output.path ?? ''));\n }\n\n function reportGenerate(gen: GenerateResult): void {\n options.onGenerate?.({\n outDir: gen.outDir,\n batchesModule: gen.batchesModule,\n routerInitFiles: gen.routerInitFiles.map((file) => path.resolve(file)),\n });\n }\n\n // The in-memory mirror of the project's sources, seeded on the FIRST incremental update rather than at\n // buildStart, which would tax every production build for something only a watch session needs.\n const sourceOverlay = new Map<string, string>();\n let overlaySeeded = false;\n\n function overlayKey(rel: string): string {\n return rel.split(path.sep).join('/');\n }\n\n function seedOverlay(): void {\n if (overlaySeeded) return;\n overlaySeeded = true;\n const skip = new Set(['node_modules', '.git', '.next', 'dist', 'coverage']);\n const walk = (dir: string): void => {\n let entries: fs.Dirent[];\n try {\n entries = fs.readdirSync(dir, {withFileTypes: true});\n } catch {\n return;\n }\n for (const entry of entries) {\n if (skip.has(entry.name)) continue;\n const full = path.join(dir, entry.name);\n if (genDirAbs && full === genDirAbs) continue;\n if (entry.isDirectory()) {\n walk(full);\n continue;\n }\n if (!/\\.[mc]?[jt]sx?$/.test(entry.name)) continue;\n try {\n sourceOverlay.set(overlayKey(path.relative(cwdAbs, full)), fs.readFileSync(full, 'utf8'));\n } catch {\n // unreadable file — leave it to the on-disk program\n }\n }\n };\n walk(cwdAbs || process.cwd());\n }\n\n // The SHARED incremental-update leaf: Vite's handleHotUpdate and the Next broker's watcher both call it,\n // so the two hosts can never drift in how an edit is absorbed.\n //\n // Taking a BATCH is load-bearing, not a convenience: one file at a time means one setSources + generate\n // PER FILE, and each rewrite is a window in which a module another file's rewrite already imports is\n // briefly absent from disk, where a bundler fails with \"can't resolve <hash>.js\".\n async function applyHotUpdate(ctx: any, updates: {file: string; content?: string}[]): Promise<string[]> {\n if (!resolver) return [];\n const relevant = updates.filter((update) => /\\.[mc]?[jt]sx?$/.test(update.file));\n if (relevant.length === 0) return [];\n const rels = relevant.map((update) => path.relative(cwdAbs || process.cwd(), update.file));\n\n // setSources gets the WHOLE overlay, never just the edited files: OpSetSources REPLACES the overlay and\n // rebuilds the Program against exactly what it is handed, so pushing one file collapses the Program to\n // that file. The next generate() then DELETES every other entry's module from disk, and any other\n // marker file fails with \"source file not in program\" (measured: a 63-module project down to 2).\n seedOverlay();\n relevant.forEach((update, index) => {\n if (typeof update.content === 'string') sourceOverlay.set(overlayKey(rels[index]), update.content);\n });\n const sources: Record<string, string> = Object.fromEntries(sourceOverlay);\n // A Vue SFC script at its virtual path is no edit: the Vue pass registers one for every .vue it transforms.\n // A real edit clears the digest until its generate, so no fetch caches against the old program.\n const editsProgram = relevant.some((update) => !VIRTUAL_SFC_SCRIPT.test(update.file));\n if (editsProgram) cacheDigest = undefined;\n if (Object.keys(sources).length > 0) {\n try {\n await resolver.setSources(sources);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n // config-tsconfig-not-loaded is the project tsconfig refusing to load, worth saying out loud rather than skipping\n // updates silently; the daemon re-parses on the next edit, so a fix needs no dev-server restart.\n if (message.includes('config-tsconfig-not-loaded')) console.error(`[@mionjs/devtools] HMR update skipped — ${message}`);\n // Otherwise the changed file is outside the resolver's known set (a config file, say): nothing was\n // regenerated, so nothing went stale.\n return [];\n }\n }\n\n let result;\n try {\n result = await resolver.scanFiles(rels);\n } catch {\n return [];\n }\n // Keeps the transform gate current: an edit may add a file's first marker site (a file created after\n // buildStart enters the set here) or remove its last. A file counts when it carries a runtype site, a\n // pure-fn replacement OR a batch site, since a file whose only markers are `batch()` calls is\n // rewritten too (its id splice).\n const withSites = new Set([\n ...(result.sites ?? []).map((site) => siteKey(site.file)),\n ...(result.replacements ?? []).map((replacement) => siteKey(replacement.file)),\n ...(result.batchSites ?? []).map((site) => siteKey(site.file)),\n ]);\n for (const rel of rels) {\n if (withSites.has(siteKey(rel))) siteFiles.add(siteKey(rel));\n else siteFiles.delete(siteKey(rel));\n }\n // Fired before regenerating, so an in-process consumer learns of a body edit as it happens; the JSON\n // file is rewritten by the generate() below.\n if (reportEnabled && options.onPureFnReport && result.pureFnSites) options.onPureFnReport(result.pureFnSites, 'update');\n // The batch lane fires on EVERY update, empty list included: the wire omits an empty list,\n // and \"this file defines no batch any more\" is exactly what the consumer must hear.\n if (reportEnabled && options.onBatchReport)\n options.onBatchReport(\n result.batchSites ?? [],\n 'update',\n relevant.map((update) => path.resolve(update.file))\n );\n // Regenerate so any new/changed modules hit disk before anything resolves them.\n try {\n const gen = await regenerate();\n if (editsProgram) cacheDigest = digestOf(gen);\n // The whole-program echo keeps a file in the gate whose only rewrite the per-file scan cannot see:\n // a router-init module gets the batch import appended at transform time, never a scan site, so the\n // loop above would have just dropped it.\n for (const file of gen.siteFiles) siteFiles.add(siteKey(file));\n reportGenerate(gen);\n // generate's list includes the edited file's scan, so it is the one the dev reporter reads.\n if (isDevServer()) devReporter.update(gen.diagnostics ?? [], downgrade);\n } catch (error) {\n // The edited file's own scan findings still print.\n if (isDevServer()) {\n devRegenerateFailed(error);\n devReporter.add(result.diagnostics ?? [], downgrade);\n }\n }\n\n // AFTER generate, so the resolver's Program already reflects the edit.\n if (anyEnrichFamily) await syncEnrich(rels);\n\n // The Vue SFC pass of a build drives this leaf too.\n if (!isDevServer())\n surfaceDiagnostics(ctx, result.diagnostics ?? [], {\n halts: () => false,\n downgrade,\n showInfo,\n cwd: cwdAbs || process.cwd(),\n grouped,\n });\n\n const stale = staleSiteFiles(relevant.map((update) => update.file));\n // Reported from the SHARED leaf, so the contract does not depend on which host drove the update.\n if (stale.length > 0 && options.onSiteFilesChanged) {\n try {\n options.onSiteFilesChanged(stale);\n } catch (error) {\n hostWarn(ctx, `@mionjs/devtools: onSiteFilesChanged threw — ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n return stale;\n }\n\n // Which ALREADY-TRANSFORMED files now serve a validator for a type that just changed. The bundler cannot\n // work this out: the edge from the using file to the type file is erased (`import type`, or an import\n // used only in type position) or never existed (an ambient `.d.ts`).\n //\n // The edited files are excluded because the host invalidates those on its own.\n //\n // ⚠️ A file transformed but holding no deps is UNKNOWN, never \"no deps\" — the resolver may predate the\n // field, or have reported nothing for a type it could not attribute. Those files join the stale set, so\n // the worst case degrades to re-transforming every marker-bearing file, not to a stale validator.\n function staleSiteFiles(changed: string[]): string[] {\n const edited = new Set(changed.map((file) => depKey(file, cwdAbs || process.cwd())));\n const stale = new Set<string>();\n for (const siteFile of typeDeps.affectedSiteFiles(changed)) stale.add(siteFile);\n for (const siteFile of typeDeps.unknownSiteFiles()) stale.add(siteFile);\n for (const file of edited) stale.delete(file);\n return [...stale].sort();\n }\n\n // <genDirAbs>/enriched/ is the committed mirror tree the plugin writes (and the CLI or a developer may\n // hand-edit); its changes are write-only outputs, which handleHotUpdate suppresses HMR for.\n function isUnderEnrichedDir(file: string): boolean {\n if (!genDirAbs) return false;\n const enrichedRoot = path.join(genDirAbs, 'enriched');\n const rel = path.relative(enrichedRoot, path.resolve(file));\n return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));\n }\n\n return {\n name: PLUGIN_NAME,\n // Not an unplugin hook: the escape hatch a host with no HMR hook of its own\n // uses to absorb an edit. Turbopack gives loaders no update callback, so the\n // Next broker watches the source tree and calls this itself.\n rtHotUpdate: applyHotUpdate,\n // Not an unplugin hook either: Turbopack has no post-bundle hook, so the Next broker writes the artifact itself.\n rtWritePureFnArtifact: writePureFnArtifact,\n // Not an unplugin hook: the Next broker cannot infer the resolved genDir it keeps its stamp in.\n rtGenDir: (): string => genDirAbs,\n // Not an unplugin hook: the Vue pass keys the `.vue` files it rewrites with the same digest (false: none yet).\n rtCacheDigest: (): string | false => (resolver && cacheDigest) || false,\n // Must run BEFORE vite/esbuild's built-in TypeScript transform: the resolver returns byte offsets into\n // the ORIGINAL source, so code with its type syntax already stripped puts every offset past the new EOF.\n enforce: 'pre' as const,\n\n // Generates the WHOLE program's cache modules to disk before any module resolution runs, so every\n // relative import the transform injects already resolves to a real file. Under Vite, configResolved\n // spawned the resolver earlier, so ensureResolver is a no-op here.\n async buildStart(this: any) {\n // Counted BEFORE any await: a sibling container's buildEnd must never observe a zero count while\n // this container's startup work is running.\n activeBuilds += 1;\n warnBelowTypeScriptFloor(options.cwd ?? process.cwd(), PLUGIN_NAME);\n ensureResolver();\n // The echoed root is adopted because the resolver's inferred <srcDir>/.mion cannot be computed here,\n // and the enriched-dir HMR suppression needs it. The VCS-hygiene files (per-folder READMEs, the\n // types/.gitignore) are written by the Go side inside generate, so the CLI compile lane gets them too.\n const gen = await regenerate();\n if (gen.outDir) genDirAbs = gen.outDir;\n cacheDigest = digestOf(gen);\n // Adopting the echo under the explicit option is how a tsconfig-only setting reaches this dependency-free host.\n downgrade = resolveDowngradeErrors(options.downgradeErrors ?? gen.downgradeErrors);\n showInfo = resolveShowInfo(options.levels ?? gen.levels);\n grouped = resolveGrouped(options.logStyle ?? gen.logStyle);\n // A universal hook, so every adapter gets the report; a watch-mode rebuild re-runs buildStart and\n // re-fires 'build' with the fresh one.\n if (reportEnabled && options.onPureFnReport) options.onPureFnReport(gen.pureFnSites ?? [], 'build');\n if (reportEnabled && options.onBatchReport) options.onBatchReport(gen.batchSites ?? [], 'build');\n // The scan's site-file set is the transform gate, wrapper call sites included.\n // Rebuilt rather than merged, so a watch-mode rebuild drops files whose sites are gone.\n siteFiles = new Set(gen.siteFiles.map(siteKey));\n reportGenerate(gen);\n // A fatal Error ALWAYS halts and no setting reaches it: the build produced no code for the thing (no\n // cache entry, no injected id, no extracted body), so carrying on would ship a call that throws.\n // Every RuntimeError halts per the downgradeErrors contract in a build lane and only reports on a dev\n // server. The split is the LEVEL, never the diagnostic family: a fatal marker or batch code is not\n // pure-fn, and a purity violation still ships the compiled body, so it is a RuntimeError.\n if (isDevServer()) devReporter.update(gen.diagnostics ?? [], downgrade);\n else surfaceDiagnostics(this, gen.diagnostics ?? [], {halts, downgrade, showInfo, cwd: cwdAbs || process.cwd(), grouped});\n // Dev/watch WRITES the mirrors up front, a whole-program pass so they exist before the first edit;\n // every other lane (a production build, a non-Vite bundler) takes the read-only drift gate instead.\n if (anyEnrichFamily) {\n if (viteCommand === 'serve') await syncEnrich([]);\n else await enrichDriftGate(this);\n }\n },\n\n // buildEnd fires once per plugin CONTAINER and one instance (one resolver child) serves several: vite\n // runs a container per environment, and hosts like vitest close them at different times. Closing on the\n // FIRST buildEnd killed the shared child under the others' in-flight requests (\"generate: resolver\n // exited\"), so the close waits for the LAST. Nulling it lets a later buildStart respawn.\n buildEnd() {\n if (activeBuilds > 0) activeBuilds -= 1;\n if (activeBuilds > 0) return;\n resolver?.close();\n resolver = null;\n },\n\n // esbuild has NO transform phase: unplugin emulates one with onLoad, which reads the file and guesses\n // a loader from the extension. Without this filter that guess is `js` for every extension esbuild\n // would have loaded some other way, so adding this plugin made a build fail to PARSE a `.sql` or\n // `.graphql` file. Rollup and vite are unaffected, so it is one filter for all hosts.\n transformInclude(id: string) {\n return /\\.[mc]?[jt]sx?$/.test(id);\n },\n\n // NEVER declared on bun: unplugin registers one `onResolve({filter: /.*/})` for the whole plugin as soon\n // as any resolveId hook exists, and bun's loader then fails every module this plugin returns null for,\n // entry point included. The stub is only a size win, so bun keeps the real module.\n ...(meta.framework !== 'bun' && options.clientRoutes === 'fetch'\n ? {\n // nothing injected reaches a dispatch point, so stubbing the dead registration lane drops core's marker reflection too\n resolveId(id: string) {\n return id === BUNDLED_API_ID ? bundledApiStubPath() : null;\n },\n }\n : {}),\n\n async transform(this: any, code: string, id: string) {\n if (!resolver) return null;\n // Wrapper sites need no configuration; new files use the linter’s text gate until the next scan.\n if (!mayTransform(code, id)) {\n failOnSymlinkedSite(id);\n return null;\n }\n const rel = path.relative(cwdAbs || process.cwd(), id);\n const inSiteSet = siteFiles.has(siteKey(rel));\n\n try {\n // `await` keeps rejections in this catch; returning the promise would bypass it.\n return await (transformMode === 'edits' ? transformViaEdits(this, rel, code) : transformViaGo(this, rel, {code}));\n } catch (error) {\n // Text gates can admit non-program files; a site-set file must still fail or real injections would be lost.\n if (inSiteSet || !(error instanceof Error && error.message.includes('source file not in program'))) throw error;\n failOnSymlinkedSite(id);\n return null;\n }\n },\n\n rollup: {writeBundle: writeArtifactForOutput, configureVitest},\n rolldown: {writeBundle: writeArtifactForOutput, configureVitest},\n esbuild: {\n setup(build: {\n initialOptions: {outdir?: string; outfile?: string; absWorkingDir?: string};\n onEnd: (callback: () => Promise<void>) => void;\n }) {\n build.onEnd(() => writePureFnArtifact(outputDirOf(build.initialOptions)));\n },\n },\n webpack: writeArtifactAfterEmit,\n rspack: writeArtifactAfterEmit,\n bun: {\n setup(build: {config?: {outdir?: string}; onEnd?: (callback: () => Promise<void>) => void}) {\n // The runtime loader (`--preload`) has no bundle, so no onEnd.\n if (typeof build.onEnd === 'function')\n build.onEnd(() => writePureFnArtifact(outputDirOf({outdir: build.config?.outdir})));\n },\n },\n\n vite: {\n configureVitest,\n\n writeBundle(output, bundle) {\n // The artifact feeds a consumer's compiler; a client output with a page is an app, served as is.\n const config = this.environment?.config;\n const isApp =\n config?.consumer === 'client' && !config.build?.lib && Object.keys(bundle).some((file) => file.endsWith('.html'));\n if (isApp) return;\n return writePureFnArtifact(outputDirOf(output));\n },\n\n // An APP build (`vite build` with a `builder` block) builds its environments SEQUENTIALLY, so each\n // buildEnd would drop the refcount to zero and make the next buildStart respawn the resolver, a\n // second full program scan of an unchanged program. One reference held across the whole app build\n // keeps it to one resolver.\n //\n // The `isBuilt` guard is Vite's own, so a host or plugin that already built the environments is left\n // alone (as is every legacy single-environment build, which never calls this hook).\n buildApp: {\n order: 'post' as const,\n async handler(builder: any) {\n const environments: {isBuilt?: boolean}[] = Object.values(builder?.environments ?? {});\n if (environments.length === 0 || environments.some((environment) => environment.isBuilt)) return;\n activeBuilds += 1;\n try {\n for (const environment of environments) await builder.build(environment);\n } finally {\n activeBuilds -= 1;\n if (activeBuilds <= 0) {\n resolver?.close();\n resolver = null;\n }\n }\n },\n },\n\n // The resolver is spawned eagerly here because the marker package's vitest relies on it existing as\n // soon as the workspace project initialises, before any test transform.\n configResolved(cfg: {root: string; command?: string; mode?: string; logger?: typeof viteLogger}) {\n viteRoot = cfg.root;\n viteLogger = cfg.logger;\n if (cfg.command) viteCommand = cfg.command;\n if (cfg.mode) viteMode = cfg.mode;\n ensureResolver();\n },\n\n // The HMR pivot: pushing the new contents into the resolver rebuilds the whole Program, the biggest\n // HMR cost. Generated module names are content-addressed and written only-on-change, so the watcher\n // reloads exactly the modules whose bytes moved and the re-transformed user file imports any new ones.\n async handleHotUpdate(this: any, ctx: any) {\n if (!resolver) return;\n const file: string = ctx.file;\n if (!file) return;\n // A change under <genDir>/enriched/** is the plugin's own mirror write (or a hand / CLI edit), so\n // reloading nothing is what keeps the auto-sync writes out of a reload loop.\n if (suppressEnrichHmr && isUnderEnrichedDir(file)) return [];\n if (!/\\.[mc]?[jt]sx?$/.test(file)) return;\n const content = typeof ctx.read === 'function' ? await ctx.read() : undefined;\n const stale = await applyHotUpdate(this, [{file, content}]);\n if (stale.length === 0) return;\n\n // applyHotUpdate already reported the set through onSiteFilesChanged, which is what a host with\n // VIRTUAL sources (mion's `Comp.vue.ts` for a Vue SFC's <script>) relies on, since those never\n // appear in the module graph below. What is left here is what this plugin can resolve itself:\n // returning the modules updates exactly these on top of the ones Vite worked out for the edited\n // file. A stale site file with no module here is either not yet served or virtual.\n const graph = ctx.server?.moduleGraph;\n if (!graph?.getModulesByFile) return;\n const modules = new Map<unknown, unknown>();\n for (const existing of ctx.modules ?? []) modules.set(existing, existing);\n for (const siteFile of stale) {\n for (const mod of graph.getModulesByFile(siteFile) ?? []) {\n graph.invalidateModule?.(mod);\n modules.set(mod, mod);\n }\n }\n return [...modules.values()] as any;\n },\n },\n };\n});\n\nexport default unplugin;\n\nexport {formatDowngraded, formatTscDiagnostic} from './surface.ts';\nexport type {PluginOptions as Options};\nexport type {BatchMapping, BatchSite, PureFnSite} from './protocol.ts';\nexport {\n ENTRY_MODULE_PREFIX,\n ENTRY_MODULE_SUFFIX,\n ENTRY_BINDING_PREFIX,\n CACHE_MODULES,\n type CacheModuleSettings,\n} from './go-generated/runtypes-constants.generated.ts';\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC","sourcesContent":["// Root entry, bundler-agnostic; per-bundler entries live at @mionjs/devtools/runtypes/*, the lint plugin at ./eslint.\nexport * from './core/unplugin.ts';\nexport {default} from './core/unplugin.ts';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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OAAO,IAAI,gBAAgB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC9G,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAID,SAAS,OAAO,CAAC,IAAoB;IACnC,MAAM,GAAG,GAAY;QACnB,KAAK,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAC;KACnF,CAAC;IACF,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClG,GAAG,CAAC,GAAG,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAC,CAAC;IACvE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Transport-agnostic mapping from the resolver's wire diagnostics to lint reports: the RULE each belongs to,\n// the rendered message, and the 0-based-column loc lint APIs expect. The OXlint/ESLint plugin entry (index.ts)\n// is one sink over this module; another transport reuses it unchanged.\n\nimport path from 'node:path';\nimport {DIAGNOSTIC_CATALOG, renderHeadline} from '../core/diagnosticCatalog.ts';\nimport {DOWNGRADED_NOTE} from '../core/downgradeErrors.ts';\nimport {Level, type Diagnostic, type DiagnosticSite} from '../core/protocol.ts';\n\n// One rule per LEVEL, never per topic: a per-topic rule's severity could disagree with the level the checker gave.\n// A finding is changed with directive comments or tsconfig `downgradeErrors`, which the build reads too.\nexport type RuleName = 'error' | 'runtime-error' | 'warning' | 'info';\n\n// index.ts builds `rules` and `recommended` from this table, so nothing lists the rules twice.\nexport interface RuleSpec {\n readonly name: RuleName;\n readonly default: 'error' | 'warn' | 'off';\n readonly description: string;\n}\n\nexport const RULE_SPECS: readonly RuleSpec[] = [\n {\n name: 'error',\n default: 'error',\n description:\n 'Every mion Error: the build produced no code for the call, so it stops everywhere, the dev server included. Also reports a tsconfig that does not load and a checker that cannot run',\n },\n {\n name: 'runtime-error',\n default: 'error',\n description:\n 'Every mion RuntimeError: the build produced code that throws or no longer checks what you asked for. Every build stops on it; a dev server prints it and keeps running. A comment or `downgradeErrors` can lower it to a warning',\n },\n {\n name: 'warning',\n default: 'warn',\n description:\n 'Every mion Warning (the code works, but may surprise you), plus every error a `@mion-downgrade-error` comment or the tsconfig `downgradeErrors` lowered, marked `(downgraded)`',\n },\n {\n name: 'info',\n default: 'off',\n description:\n 'Every mion Info message: documented behaviour or advice, such as a member left out of a validator because it holds no data. Off by default, like in the build',\n },\n];\n\nexport const ALL_RULE_NAMES: readonly RuleName[] = RULE_SPECS.map((spec) => spec.name);\n\n// LintLoc is the report location: 1-based line, 0-based column, the ESLint/OXlint convention; wire sites are\n// 1-based on both.\nexport interface LintLoc {\n start: {line: number; column: number};\n end?: {line: number; column: number};\n}\n\n// LintReport is one routed diagnostic, ready for `context.report`.\nexport interface LintReport {\n ruleName: RuleName;\n message: string;\n loc: LintLoc;\n}\n\n// A report carries no file, so a finding anchored elsewhere would land at this file's positions.\nexport function anchoredIn(diagnostic: Diagnostic, file: string): boolean {\n return Boolean(diagnostic.site.filePath) && path.resolve(diagnostic.site.filePath) === path.resolve(file);\n}\n\n// Never returns null: an unknown code still reports with the fallback message, so nothing is silently dropped.\nexport function routeDiagnostic(diagnostic: Diagnostic): LintReport {\n return {\n ruleName: ruleNameFor(diagnostic),\n message: renderMessage(diagnostic),\n loc: lintLoc(diagnostic.site),\n };\n}\n\n// A downgraded error is a warning, as the build prints it.\nfunction ruleNameFor(diagnostic: Diagnostic): RuleName {\n if (diagnostic.downgraded) return 'warning';\n switch (diagnostic.level) {\n case Level.Warning:\n return 'warning';\n case Level.Info:\n return 'info';\n case Level.RuntimeError:\n return 'runtime-error';\n default:\n return 'error';\n }\n}\n\n// renderMessage prefixes the stable code (so users can look it up or disable-comment it) and appends related\n// locations inline, lint reports having no related-location field. The unknown-code arm is unreachable in a\n// released install (binary and catalog publish together) but a locally built mion-bin/mion can run ahead of it.\nexport function renderMessage(diagnostic: Diagnostic): string {\n const known = diagnostic.code in DIAGNOSTIC_CATALOG;\n const headline = known\n ? renderHeadline(diagnostic.code, diagnostic.args)\n : '(message unavailable — regenerate the catalog via `pnpm miondevx core codegen diag`)';\n let message = `[${diagnostic.code}] ${headline}`;\n if (diagnostic.downgraded) message += ` ${DOWNGRADED_NOTE}`;\n for (const related of diagnostic.related ?? []) {\n message += `\\n related: ${related.filePath}(${related.startLine},${related.startCol}): ${related.message}`;\n }\n return message;\n}\n\n// lintLoc converts a 1-based wire site to 0-based columns. A site missing an end keeps a start-only loc; an\n// unanchored one clamps to 1:0 so the report still lands in the file.\nfunction lintLoc(site: DiagnosticSite): LintLoc {\n const loc: LintLoc = {\n start: {line: Math.max(1, site.startLine), column: Math.max(0, site.startCol - 1)},\n };\n if (site.endLine && site.endCol && (site.endLine > site.startLine || site.endCol > site.startCol)) {\n loc.end = {line: site.endLine, column: Math.max(0, site.endCol - 1)};\n }\n return loc;\n}\n"]}
|