@mionjs/devtools 0.13.2 → 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.
Files changed (89) hide show
  1. package/README.md +4 -4
  2. package/dist/core/apply-edits.d.ts +1 -1
  3. package/dist/core/apply-edits.js +2 -3
  4. package/dist/core/apply-edits.js.map +1 -1
  5. package/dist/core/bundledApiStub.js.map +1 -1
  6. package/dist/core/devReporter.js.map +1 -1
  7. package/dist/core/diagnosticCatalog.js.map +1 -1
  8. package/dist/core/downgradeErrors.js.map +1 -1
  9. package/dist/core/edit-buffer.d.ts +0 -2
  10. package/dist/core/edit-buffer.js +1 -8
  11. package/dist/core/edit-buffer.js.map +1 -1
  12. package/dist/core/go-generated/diagnosticCatalog.generated.js +6 -1
  13. package/dist/core/go-generated/diagnosticCatalog.generated.js.map +1 -1
  14. package/dist/core/go-generated/reflectionKind.generated.js.map +1 -1
  15. package/dist/core/go-generated/runtypes-constants.generated.d.ts +1 -1
  16. package/dist/core/go-generated/runtypes-constants.generated.js +1 -1
  17. package/dist/core/go-generated/runtypes-constants.generated.js.map +1 -1
  18. package/dist/core/go-generated/tsconfig-plugin-keys.generated.d.ts +1 -1
  19. package/dist/core/go-generated/tsconfig-plugin-keys.generated.js +1 -0
  20. package/dist/core/go-generated/tsconfig-plugin-keys.generated.js.map +1 -1
  21. package/dist/core/groupedLog.js.map +1 -1
  22. package/dist/core/levels.js.map +1 -1
  23. package/dist/core/markerImports.js.map +1 -1
  24. package/dist/core/option-guards.js.map +1 -1
  25. package/dist/core/plugin-option-keys.js +1 -0
  26. package/dist/core/plugin-option-keys.js.map +1 -1
  27. package/dist/core/protocol.d.ts +2 -0
  28. package/dist/core/protocol.js.map +1 -1
  29. package/dist/core/resolver-client.d.ts +4 -0
  30. package/dist/core/resolver-client.js +26 -4
  31. package/dist/core/resolver-client.js.map +1 -1
  32. package/dist/core/scan-batcher.js.map +1 -1
  33. package/dist/core/surface.js.map +1 -1
  34. package/dist/core/type-deps.js.map +1 -1
  35. package/dist/core/types.d.ts +8 -0
  36. package/dist/core/types.js.map +1 -1
  37. package/dist/core/typescript-floor.js.map +1 -1
  38. package/dist/core/unplugin.d.ts +1 -0
  39. package/dist/core/unplugin.js +63 -10
  40. package/dist/core/unplugin.js.map +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/lint/diagnosticRouting.js.map +1 -1
  43. package/dist/lint/index.js.map +1 -1
  44. package/dist/lint/lint-worker.js +11 -6
  45. package/dist/lint/lint-worker.js.map +1 -1
  46. package/dist/lint/prefilter.js.map +1 -1
  47. package/dist/lint/session-protocol.js.map +1 -1
  48. package/dist/lint/session.js.map +1 -1
  49. package/dist/lint/spawn-shim.js.map +1 -1
  50. package/dist/lint/vueSfc.d.ts +9 -0
  51. package/dist/lint/vueSfc.js +112 -0
  52. package/dist/lint/vueSfc.js.map +1 -0
  53. package/dist/options.js.map +1 -1
  54. package/dist/runtypes/bun.js.map +1 -1
  55. package/dist/runtypes/esbuild.js.map +1 -1
  56. package/dist/runtypes/next/broker.js +13 -13
  57. package/dist/runtypes/next/broker.js.map +1 -1
  58. package/dist/runtypes/next/index.d.ts +0 -1
  59. package/dist/runtypes/next/index.js +2 -0
  60. package/dist/runtypes/next/index.js.map +1 -1
  61. package/dist/runtypes/next/loader.js.map +1 -1
  62. package/dist/runtypes/next/wire.js.map +1 -1
  63. package/dist/runtypes/rolldown.js.map +1 -1
  64. package/dist/runtypes/rollup.js.map +1 -1
  65. package/dist/runtypes/rspack.js.map +1 -1
  66. package/dist/runtypes/vite.js.map +1 -1
  67. package/dist/runtypes/webpack.js.map +1 -1
  68. package/dist/vite/buildEntries.js +14 -11
  69. package/dist/vite/buildEntries.js.map +1 -1
  70. package/dist/vite/index.d.ts +0 -1
  71. package/dist/vite/index.js +0 -1
  72. package/dist/vite/index.js.map +1 -1
  73. package/dist/vite/middlewareMode.d.ts +3 -2
  74. package/dist/vite/middlewareMode.js +73 -59
  75. package/dist/vite/middlewareMode.js.map +1 -1
  76. package/dist/vite/mionVitePlugin.d.ts +0 -1
  77. package/dist/vite/mionVitePlugin.js +28 -8
  78. package/dist/vite/mionVitePlugin.js.map +1 -1
  79. package/dist/vite/nodeWebBridge.js.map +1 -1
  80. package/dist/vite/sfcTransform.d.ts +1 -0
  81. package/dist/vite/sfcTransform.js +17 -7
  82. package/dist/vite/sfcTransform.js.map +1 -1
  83. package/package.json +8 -13
  84. package/dist/next/index.d.ts +0 -11
  85. package/dist/next/index.js +0 -17
  86. package/dist/next/index.js.map +0 -1
  87. package/dist/vite/cjsPackageJsonPlugin.d.ts +0 -3
  88. package/dist/vite/cjsPackageJsonPlugin.js +0 -12
  89. package/dist/vite/cjsPackageJsonPlugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nodeWebBridge.js","sourceRoot":"","sources":["../../src/vite/nodeWebBridge.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAoB,EAAE,QAAQ,GAAG,KAAK;IAC3E,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;;YAClE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,WAAW,CAAC;IAC7C,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CA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,CAAC,SAAS,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;YAClC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC;YAC7B,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/* ########\n * 2026 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport type {IncomingMessage, ServerResponse} from 'node:http';\n\n// ############# node <-> web request bridge (dev server only) #############\n// Vite's dev-server middleware layer is connect, node (req, res), in EVERY runtime: vite runs under bun\n// because bun implements node:http, while mounting vite's middlewares inside Bun.serve is the direction that\n// does not (oven-sh/bun#12212). So a fetch-style mion adapter is bridged the way the ecosystem does it,\n// @hono/vite-dev-server through @hono/node-server's getRequestListener. Dev-only, so the request body is\n// buffered rather than streamed, as packages/platform-vercel/src/devServer.ts already does.\n\nexport async function nodeRequestToWeb(req: IncomingMessage, isSecure = false): Promise<Request> {\n const headers = new Headers();\n for (const [key, value] of Object.entries(req.headers)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) value.forEach((v) => headers.append(key, v));\n else headers.set(key, value);\n }\n const host = req.headers.host || 'localhost';\n const url = `${isSecure ? 'https' : 'http'}://${host}${req.url || '/'}`;\n const method = req.method || 'GET';\n // GET/HEAD must carry no body — passing one to Request() throws.\n const body = method === 'GET' || method === 'HEAD' ? undefined : await readBody(req);\n return new Request(url, {method, headers, body});\n}\n\nexport async function writeWebResponseToNode(webResponse: Response, res: ServerResponse): Promise<void> {\n res.statusCode = webResponse.status;\n // set-cookie is the one header that legitimately repeats, and Headers merges it into one comma-joined\n // value browsers read as a single malformed cookie.\n const setCookie = webResponse.headers.getSetCookie?.() ?? [];\n if (setCookie.length) res.setHeader('set-cookie', setCookie);\n webResponse.headers.forEach((value, key) => {\n if (key.toLowerCase() === 'set-cookie') return;\n res.setHeader(key, value);\n });\n if (!webResponse.body) {\n res.end();\n return;\n }\n res.end(Buffer.from(await webResponse.arrayBuffer()));\n}\n\nexport async function serveFetchHandler(\n handler: (req: Request) => Response | Promise<Response>,\n req: IncomingMessage,\n res: ServerResponse,\n isSecure?: boolean\n): Promise<void> {\n const webResponse = await handler(await nodeRequestToWeb(req, isSecure));\n await writeWebResponseToNode(webResponse, res);\n}\n\n/** Copied into a Uint8Array backed by a plain ArrayBuffer: node's Buffer, and any ArrayBufferLike-backed\n * view, is not accepted as a BodyInit under the DOM lib settings a consuming tsconfig may well be on. */\nfunction readBody(req: IncomingMessage): Promise<Uint8Array<ArrayBuffer> | undefined> {\n return new Promise((resolve, reject) => {\n const chunks: Buffer[] = [];\n let size = 0;\n req.on('data', (chunk) => {\n chunks.push(chunk as Buffer);\n size += (chunk as Buffer).byteLength;\n });\n req.on('error', reject);\n req.on('end', () => {\n if (!size) return resolve(undefined);\n const body = new Uint8Array(size);\n let offset = 0;\n for (const chunk of chunks) {\n body.set(chunk, offset);\n offset += chunk.byteLength;\n }\n resolve(body);\n });\n });\n}\n"]}
@@ -5,4 +5,5 @@ export interface VirtualSiteMap {
5
5
  }
6
6
  export declare function createVirtualSiteMap(): VirtualSiteMap;
7
7
  export declare function mionSfcPlugins(rt: Plugin | undefined, inject?: boolean, virtualSites?: VirtualSiteMap): Plugin[];
8
+ export declare function foldImportBlock(source: string, transformed: string): string;
8
9
  //# sourceMappingURL=sfcTransform.d.ts.map
@@ -63,6 +63,13 @@ export function mionSfcPlugins(rt, inject = true, virtualSites) {
63
63
  const injector = {
64
64
  name: 'mion-sfc',
65
65
  enforce: 'pre',
66
+ configureVitest(context) {
67
+ const digest = rt?.rtCacheDigest;
68
+ const define = context.defineCacheKeyGenerator ?? context.experimental_defineCacheKeyGenerator;
69
+ if (typeof digest !== 'function')
70
+ return;
71
+ define?.(({ id, sourceCode }) => (id.split('?')[0].endsWith('.vue') && MARKER_PROBE.test(sourceCode) ? digest() : undefined));
72
+ },
66
73
  configResolved(config) {
67
74
  root = config.root;
68
75
  vuePlugins = config.plugins.filter((plugin) => plugin.name === VUE_PLUGIN_NAME);
@@ -129,14 +136,17 @@ function bareVueFile(id) {
129
136
  return undefined;
130
137
  return file;
131
138
  }
132
- function foldImportBlock(source, transformed) {
133
- const extra = transformed.split('\n').length - source.split('\n').length;
139
+ export function foldImportBlock(source, transformed) {
140
+ const sourceLines = source.split('\n');
141
+ const lines = transformed.split('\n');
142
+ const extra = lines.length - sourceLines.length;
134
143
  if (extra <= 0)
135
144
  return transformed;
136
- const lines = transformed.split('\n');
137
- const importBlock = lines.slice(0, extra).join(' ');
138
- const rest = lines.slice(extra);
139
- rest[0] = `${importBlock} ${rest[0]}`;
140
- return rest.join('\n');
145
+ let first = 0;
146
+ while (first < sourceLines.length - 1 && lines[first] === sourceLines[first])
147
+ first++;
148
+ const importBlock = lines.slice(first, first + extra).join(' ');
149
+ lines.splice(first, extra + 1, `${importBlock} ${lines[first + extra]}`);
150
+ return lines.join('\n');
141
151
  }
142
152
  //# sourceMappingURL=sfcTransform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sfcTransform.js","sourceRoot":"","sources":["../../src/vite/sfcTransform.ts"],"names":[],"mappings":"AAOA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AA6B1C,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAGpD,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAG7C,MAAM,eAAe,GAAG,UAAU,CAAC;AAYnC,MAAM,UAAU,oBAAoB;IAClC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAIzC,MAAM,GAAG,GAAG,CAAC,IAA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,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAID,SAAS,WAAW,CAAC,EAAU;IAC7B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACpE,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,WAAmB;IACjE,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAChD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IACnC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,CAAC;IACtF,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,WAAW,IAAI,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACzE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/* ########\n * 2026 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport path from 'node:path';\nimport {createRequire} from 'node:module';\nimport type {Plugin} from 'vite';\nimport type {VitestCacheContext} from '../core/types.ts';\n\n// ############# Vue SFC support #############\n// The core only transforms plain TS/JS ids, and it cannot transform a module that exists nowhere on disk,\n// which is exactly what an SFC's <script> is: a marker call in one silently failed at RUNTIME instead. So the\n// script is REGISTERED under a virtual path first (setSources + scanFiles + generate, the same thing\n// src/lint/lint-worker.ts does with the text ESLint hands it) and then transformed under that path. The virtual\n// path sits NEXT TO the .vue file, so the relative import the transform emits resolves from the .vue module\n// unchanged. This runs BEFORE @vitejs/plugin-vue: plugin-vue's `compileScript` is SYNCHRONOUS and the resolver\n// round-trip is not, and everything after plugin-vue sees a script whose generics and type imports esbuild\n// has already erased. plugin-vue then compiles a script that already carries its compiled fns.\n\n/** Structural subset of @vue/compiler-sfc that this file uses (borrowed from plugin-vue). */\ninterface SfcBlock {\n content: string;\n lang?: string;\n src?: string;\n loc: {start: {offset: number}; end: {offset: number}};\n}\ninterface SfcParseResult {\n descriptor: {script: SfcBlock | null; scriptSetup: SfcBlock | null};\n}\ninterface SfcCompiler {\n parse(source: string, options?: {filename?: string}): SfcParseResult;\n}\n\n/** Cheap gate before any parsing, mirroring the core's own marker probes: an SFC with no mion code costs\n * one regex and nothing else. */\nconst MARKER_PROBE = /['\"]@mionjs\\/|registerPureFn/;\n/** With BOTH <script> and <script setup>, the two are registered as ONE module so a type declared in one\n * resolves for a marker call in the other (Vue merges them too). A comment line is never edited. */\nconst BLOCK_SPLIT = '\\n// #mion-sfc-block\\n';\n\n/** Vue's plugin, whose resolved compiler is borrowed so parsing uses the project's own @vue/compiler-sfc. */\nconst VUE_PLUGIN_NAME = 'vite:vue';\n\n/** Maps the virtual script path an SFC is registered under back to the real `.vue` file. */\nexport interface VirtualSiteMap {\n /** Records that `virtualPath` stands in for `realFile`. */\n register(virtualPath: string, realFile: string): void;\n /** The real module id for a site file, or undefined when it is already real. */\n resolve(siteFile: string): string | undefined;\n}\n\n/** The virtual->real map, shared because it has to exist BEFORE the mion plugin is constructed (the handler\n * is one of its options) and before the SFC pass runs (it fills the map), so neither can own it. */\nexport function createVirtualSiteMap(): VirtualSiteMap {\n const toReal = new Map<string, string>();\n // Normalise BOTH separators, not just this platform's: the virtual path is built from a vite id and the\n // site files come from the resolver's own program paths, so keying on `path.sep` alone leaves the match\n // dependent on which side used which separator. A miss here is silent, the .vue file just stays stale.\n const key = (file: string): string => file.replace(/\\\\/g, '/');\n return {\n register(virtualPath, realFile) {\n toReal.set(key(virtualPath), realFile);\n },\n resolve(siteFile) {\n return toReal.get(key(siteFile));\n },\n };\n}\n\n/** The injector (before plugin-vue) and the audit (after it). The audit is wired even when the injector is\n * off: an SFC shipping a marker with no compiled fns is the silent failure this feature exists to end. */\nexport function mionSfcPlugins(rt: Plugin | undefined, inject = true, virtualSites?: VirtualSiteMap): Plugin[] {\n let root = '';\n let vuePlugins: {api?: {options?: {compiler?: SfcCompiler}}}[] = [];\n let fallbackCompiler: SfcCompiler | undefined;\n const warned = new Set<string>();\n /** Files this run injected into, so the audit only reports what really slipped through. */\n const injected = new Set<string>();\n\n const warnOnce = (key: string, message: string): void => {\n if (warned.has(key)) return;\n warned.add(key);\n console.warn(`[mion] ${message}`);\n };\n\n /** plugin-vue's own compiler first (the version the project compiles with), then a resolve from the root. */\n const resolveCompiler = (): SfcCompiler | undefined => {\n for (const plugin of vuePlugins) {\n const compiler = plugin.api?.options?.compiler;\n if (compiler?.parse) return compiler;\n }\n if (fallbackCompiler) return fallbackCompiler;\n try {\n const require = createRequire(path.join(root || process.cwd(), 'index.js'));\n fallbackCompiler = require('vue/compiler-sfc') as SfcCompiler;\n } catch {\n return undefined;\n }\n return fallbackCompiler;\n };\n\n /** `rtHotUpdate` is the documented escape hatch for a host with no HMR hook of its own: it takes\n * {file, content} pairs and runs setSources → scanFiles → generate, which is all it takes to make a source\n * that exists nowhere on disk visible to the resolver. `handleHotUpdate` reaches the same leaf and is kept\n * as a fallback so an older plugin still works. */\n async function injectFns(ctx: unknown, source: string, virtualPath: string): Promise<string | undefined> {\n const plugin = rt as unknown as Record<string, any>;\n const absorb = plugin?.rtHotUpdate;\n const legacyRegister = plugin?.handleHotUpdate ?? plugin?.vite?.handleHotUpdate;\n if ((typeof absorb !== 'function' && typeof legacyRegister !== 'function') || typeof plugin?.transform !== 'function') {\n warnOnce('no-delegate', `the mion plugin exposes no transform/rtHotUpdate — Vue SFCs cannot be type-transformed.`);\n return undefined;\n }\n if (typeof absorb === 'function') await absorb(ctx, [{file: virtualPath, content: source}]);\n else await legacyRegister.call(ctx, {file: virtualPath, read: async () => source, modules: [], timestamp: 0});\n const result = await plugin.transform.call(ctx, source, virtualPath);\n const code = typeof result === 'string' ? result : result?.code;\n return typeof code === 'string' ? foldImportBlock(source, code) : undefined;\n }\n\n const injector: Plugin & {configureVitest: (context: VitestCacheContext) => void} = {\n name: 'mion-sfc',\n // before @vitejs/plugin-vue: it is the last point where the script still carries its types\n enforce: 'pre',\n\n // Its output follows the program like the core transform's, so it takes the core's Vitest cache digest.\n configureVitest(context: VitestCacheContext) {\n const digest = (rt as {rtCacheDigest?: () => string | false} | undefined)?.rtCacheDigest;\n const define = context.defineCacheKeyGenerator ?? context.experimental_defineCacheKeyGenerator;\n if (typeof digest !== 'function') return;\n define?.(({id, sourceCode}) => (id.split('?')[0].endsWith('.vue') && MARKER_PROBE.test(sourceCode) ? digest() : undefined));\n },\n\n configResolved(config) {\n root = config.root;\n vuePlugins = config.plugins.filter((plugin) => plugin.name === VUE_PLUGIN_NAME) as typeof vuePlugins;\n },\n\n async transform(code, id) {\n const file = bareVueFile(id);\n if (!file || !MARKER_PROBE.test(code)) return null;\n const relative = path.relative(root, file);\n if (relative.startsWith('..') || path.isAbsolute(relative)) {\n warnOnce(file, `${file} is outside the vite root, so its typed mion code cannot be transformed.`);\n return null;\n }\n const compiler = resolveCompiler();\n if (!compiler) {\n warnOnce('no-compiler', `@vue/compiler-sfc is not resolvable, so typed mion code in .vue files is NOT transformed.`);\n return null;\n }\n\n const {descriptor} = compiler.parse(code, {filename: file});\n // `src` blocks point at a real file the resolver already sees through the program.\n const blocks = [descriptor.script, descriptor.scriptSetup].filter((b): b is SfcBlock => !!b && !b.src);\n if (!blocks.length) return null;\n\n const lang = blocks.find((block) => block.lang)?.lang ?? 'js';\n const virtualPath = `${file}.${lang}`;\n // Record the stand-in BEFORE delegating: stale site files are reported under the virtual path while the\n // module vite serves is `file`, and without the mapping a .vue file keeps serving the old shape's\n // validator after a type edit that the project's .ts files recover from.\n virtualSites?.register(virtualPath, file);\n const source = blocks.map((block) => block.content).join(BLOCK_SPLIT);\n const result = await injectFns(this, source, virtualPath);\n if (!result) return null;\n\n const parts = result.split(BLOCK_SPLIT);\n if (parts.length !== blocks.length) {\n warnOnce(`${file}:split`, `could not map the transformed script back onto ${file} — leaving it untransformed.`);\n return null;\n }\n // last block first: splicing from the end keeps the earlier block's offsets valid\n let next = code;\n for (let index = blocks.length - 1; index >= 0; index--) {\n const block = blocks[index];\n next = next.slice(0, block.loc.start.offset) + parts[index] + next.slice(block.loc.end.offset);\n }\n injected.add(file);\n return {code: next, map: null};\n },\n };\n\n // Silence is the defect this feature fixes, so a marker reaching the browser without its compiled fns must\n // be audible whatever the cause: plugin ordering, a plugin-vue change, an SFC shape the injector skipped.\n const audit: Plugin = {\n name: 'mion-sfc-audit',\n enforce: 'post',\n\n transform(code, id) {\n const file = bareVueFile(id);\n if (!file || injected.has(file) || !MARKER_PROBE.test(code)) return null;\n if (code.includes('__rt_')) return null;\n warnOnce(\n `${file}:audit`,\n `${file} calls a mion marker but was compiled WITHOUT its generated functions. ` +\n `They would fail at runtime. Make sure @vitejs/plugin-vue is in this vite config and that no ` +\n `plugin transforms .vue files before mion does.`\n );\n return null;\n },\n };\n\n return inject ? [injector, audit] : [audit];\n}\n\n/** The SFC module itself — not `?vue&type=…` sub-requests, and not framework passes like Nuxt's\n * `?macro=true`, which are separate transforms of the same file. */\nfunction bareVueFile(id: string): string | undefined {\n const [file, query] = id.split('?');\n if (query !== undefined || !file.endsWith('.vue')) return undefined;\n return file;\n}\n\n/** Keeps the SAME line count, or plugin-vue's source map breaks; the block may sit below a directive prologue. */\nexport function foldImportBlock(source: string, transformed: string): string {\n const sourceLines = source.split('\\n');\n const lines = transformed.split('\\n');\n const extra = lines.length - sourceLines.length;\n if (extra <= 0) return transformed;\n let first = 0;\n while (first < sourceLines.length - 1 && lines[first] === sourceLines[first]) first++;\n const importBlock = lines.slice(first, first + extra).join(' ');\n lines.splice(first, extra + 1, `${importBlock} ${lines[first + extra]}`);\n return lines.join('\\n');\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mionjs/devtools",
3
- "version": "0.13.2",
4
- "description": "mion devtools: the build transform (Vite/Rollup/Rolldown/webpack/Rspack/esbuild/Bun/Next-Turbopack) that rewrites mion RunTypes marker calls, the mion Vite and Next presets, and the OXlint/ESLint plugin.",
3
+ "version": "0.14.0",
4
+ "description": "mion devtools: the build transform (Vite/Rollup/Rolldown/webpack/Rspack/esbuild/Bun/Next-Turbopack) that rewrites mion RunTypes marker calls, the mion Vite preset, and the OXlint/ESLint plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "ma jerez",
@@ -31,10 +31,6 @@
31
31
  "types": "./dist/vite/index.d.ts",
32
32
  "import": "./dist/vite/index.js"
33
33
  },
34
- "./next": {
35
- "types": "./dist/next/index.d.ts",
36
- "import": "./dist/next/index.js"
37
- },
38
34
  "./eslint": {
39
35
  "types": "./dist/lint/index.d.ts",
40
36
  "import": "./dist/lint/index.js"
@@ -90,7 +86,7 @@
90
86
  "publishConfig": {
91
87
  "access": "public"
92
88
  },
93
- "homepage": "https://mion.pages.dev",
89
+ "homepage": "https://mion.io",
94
90
  "bugs": {
95
91
  "url": "https://github.com/MionKit/mion/issues"
96
92
  },
@@ -103,21 +99,20 @@
103
99
  "unplugin": "3.3.0"
104
100
  },
105
101
  "peerDependencies": {
106
- "typescript": ">=6.0.0",
107
102
  "vite": ">=5.0.0",
108
- "@mionjs/bin-compiler": "0.13.2"
103
+ "@mionjs/bin-compiler": "0.14.0"
109
104
  },
110
105
  "peerDependenciesMeta": {
111
- "typescript": {
112
- "optional": true
113
- },
114
106
  "vite": {
115
107
  "optional": true
116
108
  }
117
109
  },
118
110
  "devDependencies": {
119
111
  "vite": "8.0.16",
120
- "@mionjs/bin-compiler": "0.13.2"
112
+ "@mionjs/bin-compiler": "0.14.0"
113
+ },
114
+ "engines": {
115
+ "node": ">=24"
121
116
  },
122
117
  "scripts": {
123
118
  "build": "tsc --build tsconfig.build.json",
@@ -1,11 +0,0 @@
1
- import { type NextOptions } from '../runtypes/next/index.ts';
2
- import { type MionPresetOptions } from '../options.ts';
3
- export type { NextOptions };
4
- export { isTurbopack, ownsBroker, runTypesTurbopackRules, socketPathFor, startBroker, RUNTYPES_LOADER, } from '../runtypes/next/index.ts';
5
- export interface MionNextOptions extends MionPresetOptions {
6
- cwd?: string;
7
- }
8
- type NextConfigLike = Record<string, unknown>;
9
- export declare function withMion(nextConfig?: NextConfigLike, options?: MionNextOptions): Promise<NextConfigLike>;
10
- export default withMion;
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,17 +0,0 @@
1
- import { withRunTypes } from "../runtypes/next/index.js";
2
- import { toRunTypesOptions } from "../options.js";
3
- export { isTurbopack, ownsBroker, runTypesTurbopackRules, socketPathFor, startBroker, RUNTYPES_LOADER, } from "../runtypes/next/index.js";
4
- export async function withMion(nextConfig = {}, options = {}) {
5
- if (options.server !== undefined) {
6
- throw new Error(`[withMion] there is no \`server\` option: Next runs its own dev server and builds your API route ` +
7
- `with everything else. Serve the API from an \`app/api/[...mion]/route.ts\` handler.`);
8
- }
9
- const root = options.cwd ?? process.cwd();
10
- const resolverOptions = {
11
- ...toRunTypesOptions(options),
12
- cwd: root,
13
- };
14
- return withRunTypes(nextConfig, resolverOptions);
15
- }
16
- export default withMion;
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAC,YAAY,EAAmB,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAyB,MAAM,eAAe,CAAC;AAGxE,OAAO,EACL,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAsBnC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,aAA6B,EAAE,EAAE,UAA2B,EAAE;IAC3F,IAAK,OAAmC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CACb,mGAAmG;YACjG,qFAAqF,CACxF,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1C,MAAM,eAAe,GAAgB;QACnC,GAAG,iBAAiB,CAAC,OAAO,CAAC;QAC7B,GAAG,EAAE,IAAI;KACV,CAAC;IACF,OAAO,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AACnD,CAAC;AAED,eAAe,QAAQ,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export declare function cjsPackageJsonPlugin(...cjsDirs: string[]): Plugin;
3
- //# sourceMappingURL=cjsPackageJsonPlugin.d.ts.map
@@ -1,12 +0,0 @@
1
- import { writeFileSync } from 'fs';
2
- export function cjsPackageJsonPlugin(...cjsDirs) {
3
- return {
4
- name: 'cjs-package-json',
5
- closeBundle() {
6
- for (const dir of cjsDirs) {
7
- writeFileSync(`${dir}/package.json`, '{"type":"commonjs"}\n');
8
- }
9
- },
10
- };
11
- }
12
- //# sourceMappingURL=cjsPackageJsonPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cjsPackageJsonPlugin.js","sourceRoot":"","sources":["../../src/vite/cjsPackageJsonPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,aAAa,EAAC,MAAM,IAAI,CAAC;AAGjC,MAAM,UAAU,oBAAoB,CAAC,GAAG,OAAiB;IACvD,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,WAAW;YACT,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;gBAC1B,aAAa,CAAC,GAAG,GAAG,eAAe,EAAE,uBAAuB,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}