@mionjs/devtools 0.8.10 → 0.13.2
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/LICENSE +1 -1
- package/README.md +34 -0
- package/dist/core/apply-edits.d.ts +8 -0
- package/dist/core/apply-edits.js +24 -0
- package/dist/core/apply-edits.js.map +1 -0
- package/dist/core/bundledApiStub.d.ts +4 -0
- package/dist/core/bundledApiStub.js +4 -0
- package/dist/core/bundledApiStub.js.map +1 -0
- package/dist/core/devReporter.d.ts +19 -0
- package/dist/core/devReporter.js +91 -0
- package/dist/core/devReporter.js.map +1 -0
- package/dist/core/diagnosticCatalog.d.ts +5 -0
- package/dist/core/diagnosticCatalog.js +18 -0
- package/dist/core/diagnosticCatalog.js.map +1 -0
- package/dist/core/downgradeErrors.d.ts +11 -0
- package/dist/core/downgradeErrors.js +34 -0
- package/dist/core/downgradeErrors.js.map +1 -0
- package/dist/core/edit-buffer.d.ts +26 -0
- package/dist/core/edit-buffer.js +209 -0
- package/dist/core/edit-buffer.js.map +1 -0
- package/dist/core/go-generated/diagnosticCatalog.generated.d.ts +9 -0
- package/dist/core/go-generated/diagnosticCatalog.generated.js +1008 -0
- package/dist/core/go-generated/diagnosticCatalog.generated.js.map +1 -0
- package/dist/core/go-generated/reflectionKind.generated.d.ts +60 -0
- package/dist/core/go-generated/reflectionKind.generated.js +60 -0
- package/dist/core/go-generated/reflectionKind.generated.js.map +1 -0
- package/dist/core/go-generated/runtypes-constants.generated.d.ts +197 -0
- package/dist/core/go-generated/runtypes-constants.generated.js +110 -0
- package/dist/core/go-generated/runtypes-constants.generated.js.map +1 -0
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.d.ts +3 -0
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.js +23 -0
- package/dist/core/go-generated/tsconfig-plugin-keys.generated.js.map +1 -0
- package/dist/core/groupedLog.d.ts +6 -0
- package/dist/core/groupedLog.js +163 -0
- package/dist/core/groupedLog.js.map +1 -0
- package/dist/core/levels.d.ts +6 -0
- package/dist/core/levels.js +22 -0
- package/dist/core/levels.js.map +1 -0
- package/dist/core/markerImports.d.ts +8 -0
- package/dist/core/markerImports.js +149 -0
- package/dist/core/markerImports.js.map +1 -0
- package/dist/core/option-guards.d.ts +4 -0
- package/dist/core/option-guards.js +12 -0
- package/dist/core/option-guards.js.map +1 -0
- package/dist/core/plugin-option-keys.d.ts +3 -0
- package/dist/core/plugin-option-keys.js +35 -0
- package/dist/core/plugin-option-keys.js.map +1 -0
- package/dist/core/protocol.d.ts +244 -0
- package/dist/core/protocol.js +23 -0
- package/dist/core/protocol.js.map +1 -0
- package/dist/core/resolver-client.d.ts +160 -0
- package/dist/core/resolver-client.js +354 -0
- package/dist/core/resolver-client.js.map +1 -0
- package/dist/core/scan-batcher.d.ts +6 -0
- package/dist/core/scan-batcher.js +36 -0
- package/dist/core/scan-batcher.js.map +1 -0
- package/dist/core/surface.d.ts +23 -0
- package/dist/core/surface.js +77 -0
- package/dist/core/surface.js.map +1 -0
- package/dist/core/type-deps.d.ts +11 -0
- package/dist/core/type-deps.js +72 -0
- package/dist/core/type-deps.js.map +1 -0
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/typescript-floor.d.ts +5 -0
- package/dist/core/typescript-floor.js +33 -0
- package/dist/core/typescript-floor.js.map +1 -0
- package/dist/core/unplugin.d.ts +67 -0
- package/dist/core/unplugin.js +636 -0
- package/dist/core/unplugin.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/diagnosticRouting.d.ts +28 -0
- package/dist/lint/diagnosticRouting.js +74 -0
- package/dist/lint/diagnosticRouting.js.map +1 -0
- package/dist/lint/index.d.ts +49 -0
- package/dist/lint/index.js +96 -0
- package/dist/lint/index.js.map +1 -0
- package/dist/lint/lint-worker.d.ts +2 -0
- package/dist/lint/lint-worker.js +116 -0
- package/dist/lint/lint-worker.js.map +1 -0
- package/dist/lint/prefilter.d.ts +7 -0
- package/dist/lint/prefilter.js +31 -0
- package/dist/lint/prefilter.js.map +1 -0
- package/dist/lint/session-protocol.d.ts +38 -0
- package/dist/lint/session-protocol.js +11 -0
- package/dist/lint/session-protocol.js.map +1 -0
- package/dist/lint/session.d.ts +27 -0
- package/dist/lint/session.js +149 -0
- package/dist/lint/session.js.map +1 -0
- package/dist/lint/spawn-shim.d.ts +2 -0
- package/dist/lint/spawn-shim.js +23 -0
- package/dist/lint/spawn-shim.js.map +1 -0
- package/dist/next/index.d.ts +11 -0
- package/dist/next/index.js +17 -0
- package/dist/next/index.js.map +1 -0
- package/dist/options.d.ts +29 -0
- package/dist/options.js +36 -0
- package/dist/options.js.map +1 -0
- package/dist/runtypes/bun.d.ts +25 -0
- package/dist/runtypes/bun.js +62 -0
- package/dist/runtypes/bun.js.map +1 -0
- package/dist/runtypes/esbuild.d.ts +4 -0
- package/dist/runtypes/esbuild.js +4 -0
- package/dist/runtypes/esbuild.js.map +1 -0
- package/dist/runtypes/next/broker.d.ts +15 -0
- package/dist/runtypes/next/broker.js +316 -0
- package/dist/runtypes/next/broker.js.map +1 -0
- package/dist/runtypes/next/index.d.ts +30 -0
- package/dist/runtypes/next/index.js +57 -0
- package/dist/runtypes/next/index.js.map +1 -0
- package/dist/runtypes/next/loader.d.ts +13 -0
- package/dist/runtypes/next/loader.js +64 -0
- package/dist/runtypes/next/loader.js.map +1 -0
- package/dist/runtypes/next/wire.d.ts +17 -0
- package/dist/runtypes/next/wire.js +15 -0
- package/dist/runtypes/next/wire.js.map +1 -0
- package/dist/runtypes/rolldown.d.ts +4 -0
- package/dist/runtypes/rolldown.js +4 -0
- package/dist/runtypes/rolldown.js.map +1 -0
- package/dist/runtypes/rollup.d.ts +4 -0
- package/dist/runtypes/rollup.js +4 -0
- package/dist/runtypes/rollup.js.map +1 -0
- package/dist/runtypes/rspack.d.ts +4 -0
- package/dist/runtypes/rspack.js +4 -0
- package/dist/runtypes/rspack.js.map +1 -0
- package/dist/runtypes/vite.d.ts +4 -0
- package/dist/runtypes/vite.js +4 -0
- package/dist/runtypes/vite.js.map +1 -0
- package/dist/runtypes/webpack.d.ts +4 -0
- package/dist/runtypes/webpack.js +4 -0
- package/dist/runtypes/webpack.js.map +1 -0
- package/dist/vite/buildEntries.d.ts +2 -0
- package/dist/vite/buildEntries.js +28 -0
- package/dist/vite/buildEntries.js.map +1 -0
- package/dist/vite/cjsPackageJsonPlugin.d.ts +3 -0
- package/dist/vite/cjsPackageJsonPlugin.js +12 -0
- package/dist/vite/cjsPackageJsonPlugin.js.map +1 -0
- package/dist/vite/index.d.ts +6 -0
- package/dist/vite/index.js +5 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/middlewareMode.d.ts +10 -0
- package/dist/vite/middlewareMode.js +227 -0
- package/dist/vite/middlewareMode.js.map +1 -0
- package/dist/vite/mionVitePlugin.d.ts +23 -0
- package/dist/vite/mionVitePlugin.js +115 -0
- package/dist/vite/mionVitePlugin.js.map +1 -0
- package/dist/vite/nodeWebBridge.d.ts +5 -0
- package/dist/vite/nodeWebBridge.js +59 -0
- package/dist/vite/nodeWebBridge.js.map +1 -0
- package/dist/vite/sfcTransform.d.ts +8 -0
- package/dist/vite/sfcTransform.js +142 -0
- package/dist/vite/sfcTransform.js.map +1 -0
- package/oxlint-recommended.json +11 -0
- package/package.json +91 -56
- package/build/eslint/cjs/index.cjs +0 -41
- package/build/eslint/cjs/index.cjs.map +0 -1
- package/build/eslint/cjs/package.json +0 -1
- package/build/eslint/cjs/src/eslint/index.cjs +0 -13
- package/build/eslint/cjs/src/eslint/index.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/index.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/index.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/enforce-type-imports.cjs +0 -121
- package/build/eslint/cjs/src/eslint/rules/enforce-type-imports.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/enforce-type-imports.d.ts +0 -8
- package/build/eslint/cjs/src/eslint/rules/enforce-type-imports.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/formatTypeNames.cjs +0 -71
- package/build/eslint/cjs/src/eslint/rules/formatTypeNames.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/formatTypeNames.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/formatTypeNames.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-mixed-union-properties.cjs +0 -220
- package/build/eslint/cjs/src/eslint/rules/no-mixed-union-properties.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-mixed-union-properties.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/no-mixed-union-properties.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-type-imports.cjs +0 -251
- package/build/eslint/cjs/src/eslint/rules/no-type-imports.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-type-imports.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/no-type-imports.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-typeof-runtype.cjs +0 -72
- package/build/eslint/cjs/src/eslint/rules/no-typeof-runtype.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-typeof-runtype.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/no-typeof-runtype.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-unreachable-union-types.cjs +0 -220
- package/build/eslint/cjs/src/eslint/rules/no-unreachable-union-types.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-unreachable-union-types.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/no-unreachable-union-types.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-vite-client.cjs +0 -71
- package/build/eslint/cjs/src/eslint/rules/no-vite-client.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/no-vite-client.d.ts +0 -5
- package/build/eslint/cjs/src/eslint/rules/no-vite-client.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/pure-functions.cjs +0 -346
- package/build/eslint/cjs/src/eslint/rules/pure-functions.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/pure-functions.d.ts +0 -5
- package/build/eslint/cjs/src/eslint/rules/pure-functions.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/strong-typed-routes.cjs +0 -328
- package/build/eslint/cjs/src/eslint/rules/strong-typed-routes.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/strong-typed-routes.d.ts +0 -5
- package/build/eslint/cjs/src/eslint/rules/strong-typed-routes.d.ts.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/type-formats-imports.cjs +0 -52
- package/build/eslint/cjs/src/eslint/rules/type-formats-imports.cjs.map +0 -1
- package/build/eslint/cjs/src/eslint/rules/type-formats-imports.d.ts +0 -4
- package/build/eslint/cjs/src/eslint/rules/type-formats-imports.d.ts.map +0 -1
- package/build/eslint/cjs/src/pureFns/purityRules.cjs +0 -67
- package/build/eslint/cjs/src/pureFns/purityRules.cjs.map +0 -1
- package/build/eslint/cjs/src/pureFns/purityRules.d.ts +0 -5
- package/build/eslint/cjs/src/pureFns/purityRules.d.ts.map +0 -1
- package/build/eslint/esm/index.js +0 -42
- package/build/eslint/esm/index.js.map +0 -1
- package/build/eslint/esm/src/eslint/index.d.ts +0 -4
- package/build/eslint/esm/src/eslint/index.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/index.js +0 -14
- package/build/eslint/esm/src/eslint/index.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/enforce-type-imports.d.ts +0 -8
- package/build/eslint/esm/src/eslint/rules/enforce-type-imports.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/enforce-type-imports.js +0 -122
- package/build/eslint/esm/src/eslint/rules/enforce-type-imports.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/formatTypeNames.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/formatTypeNames.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/formatTypeNames.js +0 -71
- package/build/eslint/esm/src/eslint/rules/formatTypeNames.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-mixed-union-properties.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/no-mixed-union-properties.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-mixed-union-properties.js +0 -221
- package/build/eslint/esm/src/eslint/rules/no-mixed-union-properties.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-type-imports.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/no-type-imports.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-type-imports.js +0 -252
- package/build/eslint/esm/src/eslint/rules/no-type-imports.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-typeof-runtype.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/no-typeof-runtype.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-typeof-runtype.js +0 -73
- package/build/eslint/esm/src/eslint/rules/no-typeof-runtype.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-unreachable-union-types.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/no-unreachable-union-types.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-unreachable-union-types.js +0 -221
- package/build/eslint/esm/src/eslint/rules/no-unreachable-union-types.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-vite-client.d.ts +0 -5
- package/build/eslint/esm/src/eslint/rules/no-vite-client.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/no-vite-client.js +0 -72
- package/build/eslint/esm/src/eslint/rules/no-vite-client.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/pure-functions.d.ts +0 -5
- package/build/eslint/esm/src/eslint/rules/pure-functions.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/pure-functions.js +0 -347
- package/build/eslint/esm/src/eslint/rules/pure-functions.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/strong-typed-routes.d.ts +0 -5
- package/build/eslint/esm/src/eslint/rules/strong-typed-routes.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/strong-typed-routes.js +0 -329
- package/build/eslint/esm/src/eslint/rules/strong-typed-routes.js.map +0 -1
- package/build/eslint/esm/src/eslint/rules/type-formats-imports.d.ts +0 -4
- package/build/eslint/esm/src/eslint/rules/type-formats-imports.d.ts.map +0 -1
- package/build/eslint/esm/src/eslint/rules/type-formats-imports.js +0 -53
- package/build/eslint/esm/src/eslint/rules/type-formats-imports.js.map +0 -1
- package/build/eslint/esm/src/pureFns/purityRules.d.ts +0 -5
- package/build/eslint/esm/src/pureFns/purityRules.d.ts.map +0 -1
- package/build/eslint/esm/src/pureFns/purityRules.js +0 -67
- package/build/eslint/esm/src/pureFns/purityRules.js.map +0 -1
- package/build/vite-plugin/cjs/index.cjs +0 -13
- package/build/vite-plugin/cjs/index.cjs.map +0 -1
- package/build/vite-plugin/cjs/package.json +0 -1
- package/build/vite-plugin/cjs/src/pureFns/purityRules.cjs +0 -65
- package/build/vite-plugin/cjs/src/pureFns/purityRules.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/pureFns/purityRules.d.ts +0 -5
- package/build/vite-plugin/cjs/src/pureFns/purityRules.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/aotCacheGenerator.cjs +0 -271
- package/build/vite-plugin/cjs/src/vite-plugin/aotCacheGenerator.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/aotCacheGenerator.d.ts +0 -32
- package/build/vite-plugin/cjs/src/vite-plugin/aotCacheGenerator.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/aotDiskCache.cjs +0 -135
- package/build/vite-plugin/cjs/src/vite-plugin/aotDiskCache.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/aotDiskCache.d.ts +0 -7
- package/build/vite-plugin/cjs/src/vite-plugin/aotDiskCache.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/cjsPackageJsonPlugin.cjs +0 -15
- package/build/vite-plugin/cjs/src/vite-plugin/cjsPackageJsonPlugin.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/cjsPackageJsonPlugin.d.ts +0 -3
- package/build/vite-plugin/cjs/src/vite-plugin/cjsPackageJsonPlugin.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/constants.cjs +0 -29
- package/build/vite-plugin/cjs/src/vite-plugin/constants.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/constants.d.ts +0 -13
- package/build/vite-plugin/cjs/src/vite-plugin/constants.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/extractPureFn.cjs +0 -628
- package/build/vite-plugin/cjs/src/vite-plugin/extractPureFn.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/extractPureFn.d.ts +0 -14
- package/build/vite-plugin/cjs/src/vite-plugin/extractPureFn.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/index.cjs +0 -13
- package/build/vite-plugin/cjs/src/vite-plugin/index.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/index.d.ts +0 -6
- package/build/vite-plugin/cjs/src/vite-plugin/index.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/mionVitePlugin.cjs +0 -511
- package/build/vite-plugin/cjs/src/vite-plugin/mionVitePlugin.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/mionVitePlugin.d.ts +0 -37
- package/build/vite-plugin/cjs/src/vite-plugin/mionVitePlugin.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/resolveModule.cjs +0 -55
- package/build/vite-plugin/cjs/src/vite-plugin/resolveModule.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/resolveModule.d.ts +0 -2
- package/build/vite-plugin/cjs/src/vite-plugin/resolveModule.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/transformers.cjs +0 -166
- package/build/vite-plugin/cjs/src/vite-plugin/transformers.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/transformers.d.ts +0 -11
- package/build/vite-plugin/cjs/src/vite-plugin/transformers.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/types.cjs +0 -2
- package/build/vite-plugin/cjs/src/vite-plugin/types.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/types.d.ts +0 -60
- package/build/vite-plugin/cjs/src/vite-plugin/types.d.ts.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/virtual-modules.d.cjs +0 -2
- package/build/vite-plugin/cjs/src/vite-plugin/virtual-modules.d.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/virtualModule.cjs +0 -69
- package/build/vite-plugin/cjs/src/vite-plugin/virtualModule.cjs.map +0 -1
- package/build/vite-plugin/cjs/src/vite-plugin/virtualModule.d.ts +0 -3
- package/build/vite-plugin/cjs/src/vite-plugin/virtualModule.d.ts.map +0 -1
- package/build/vite-plugin/esm/index.js +0 -13
- package/build/vite-plugin/esm/index.js.map +0 -1
- package/build/vite-plugin/esm/src/pureFns/purityRules.d.ts +0 -5
- package/build/vite-plugin/esm/src/pureFns/purityRules.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/pureFns/purityRules.js +0 -65
- package/build/vite-plugin/esm/src/pureFns/purityRules.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/aotCacheGenerator.d.ts +0 -32
- package/build/vite-plugin/esm/src/vite-plugin/aotCacheGenerator.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/aotCacheGenerator.js +0 -271
- package/build/vite-plugin/esm/src/vite-plugin/aotCacheGenerator.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/aotDiskCache.d.ts +0 -7
- package/build/vite-plugin/esm/src/vite-plugin/aotDiskCache.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/aotDiskCache.js +0 -134
- package/build/vite-plugin/esm/src/vite-plugin/aotDiskCache.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/cjsPackageJsonPlugin.d.ts +0 -3
- package/build/vite-plugin/esm/src/vite-plugin/cjsPackageJsonPlugin.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/cjsPackageJsonPlugin.js +0 -15
- package/build/vite-plugin/esm/src/vite-plugin/cjsPackageJsonPlugin.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/constants.d.ts +0 -13
- package/build/vite-plugin/esm/src/vite-plugin/constants.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/constants.js +0 -29
- package/build/vite-plugin/esm/src/vite-plugin/constants.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/extractPureFn.d.ts +0 -14
- package/build/vite-plugin/esm/src/vite-plugin/extractPureFn.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/extractPureFn.js +0 -611
- package/build/vite-plugin/esm/src/vite-plugin/extractPureFn.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/index.d.ts +0 -6
- package/build/vite-plugin/esm/src/vite-plugin/index.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/index.js +0 -13
- package/build/vite-plugin/esm/src/vite-plugin/index.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/mionVitePlugin.d.ts +0 -37
- package/build/vite-plugin/esm/src/vite-plugin/mionVitePlugin.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/mionVitePlugin.js +0 -493
- package/build/vite-plugin/esm/src/vite-plugin/mionVitePlugin.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/resolveModule.d.ts +0 -2
- package/build/vite-plugin/esm/src/vite-plugin/resolveModule.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/resolveModule.js +0 -33
- package/build/vite-plugin/esm/src/vite-plugin/resolveModule.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/transformers.d.ts +0 -11
- package/build/vite-plugin/esm/src/vite-plugin/transformers.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/transformers.js +0 -149
- package/build/vite-plugin/esm/src/vite-plugin/transformers.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/types.d.ts +0 -60
- package/build/vite-plugin/esm/src/vite-plugin/types.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/types.js +0 -2
- package/build/vite-plugin/esm/src/vite-plugin/types.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/virtual-modules.d.js +0 -2
- package/build/vite-plugin/esm/src/vite-plugin/virtual-modules.d.js.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/virtualModule.d.ts +0 -3
- package/build/vite-plugin/esm/src/vite-plugin/virtualModule.d.ts.map +0 -1
- package/build/vite-plugin/esm/src/vite-plugin/virtualModule.js +0 -69
- package/build/vite-plugin/esm/src/vite-plugin/virtualModule.js.map +0 -1
- package/src/eslint/index.ts +0 -53
- package/src/eslint/rules/enforce-type-imports.ts +0 -157
- package/src/eslint/rules/formatTypeNames.ts +0 -92
- package/src/eslint/rules/no-mixed-union-properties.ts +0 -276
- package/src/eslint/rules/no-type-imports.ts +0 -386
- package/src/eslint/rules/no-typeof-runtype.ts +0 -112
- package/src/eslint/rules/no-unreachable-union-types.ts +0 -357
- package/src/eslint/rules/no-vite-client.ts +0 -101
- package/src/eslint/rules/pure-functions.ts +0 -523
- package/src/eslint/rules/strong-typed-routes.ts +0 -537
- package/src/eslint/rules/type-formats-imports.ts +0 -73
- package/src/pureFns/purityRules.ts +0 -76
- package/src/vite-plugin/README.md +0 -399
- package/src/vite-plugin/aotCacheGenerator.ts +0 -397
- package/src/vite-plugin/aotDiskCache.ts +0 -193
- package/src/vite-plugin/cjsPackageJsonPlugin.ts +0 -21
- package/src/vite-plugin/constants.ts +0 -50
- package/src/vite-plugin/extractPureFn.ts +0 -845
- package/src/vite-plugin/index.ts +0 -27
- package/src/vite-plugin/mionVitePlugin.ts +0 -738
- package/src/vite-plugin/resolveModule.ts +0 -50
- package/src/vite-plugin/transformers.ts +0 -209
- package/src/vite-plugin/types.ts +0 -182
- package/src/vite-plugin/virtual-modules.d.ts +0 -48
- package/src/vite-plugin/virtualModule.ts +0 -94
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ServerPureFunctionsOptions, DeepkitTypeOptions, AOTCacheOptions, MionServerConfig } from './types.ts';
|
|
2
|
-
export interface MionPluginOptions {
|
|
3
|
-
serverPureFunctions?: ServerPureFunctionsOptions;
|
|
4
|
-
runTypes?: DeepkitTypeOptions;
|
|
5
|
-
aotCaches?: AOTCacheOptions | true;
|
|
6
|
-
server?: MionServerConfig;
|
|
7
|
-
}
|
|
8
|
-
export declare function mionVitePlugin(options: MionPluginOptions): {
|
|
9
|
-
name: string;
|
|
10
|
-
enforce: "pre";
|
|
11
|
-
config(config: any, env: any): void;
|
|
12
|
-
configResolved(config: any): void;
|
|
13
|
-
buildStart(): Promise<void>;
|
|
14
|
-
configureServer(server: any): void;
|
|
15
|
-
resolveId(id: any, importer: any): string | null;
|
|
16
|
-
load(id: any): Promise<string | {
|
|
17
|
-
code: string;
|
|
18
|
-
syntheticNamedExports: boolean;
|
|
19
|
-
} | null>;
|
|
20
|
-
transform(code: string, fileName: string): {
|
|
21
|
-
code: string;
|
|
22
|
-
map: string | undefined;
|
|
23
|
-
} | null;
|
|
24
|
-
buildEnd(): void;
|
|
25
|
-
closeBundle(): Promise<void>;
|
|
26
|
-
handleHotUpdate({ file, server }: {
|
|
27
|
-
file: any;
|
|
28
|
-
server: any;
|
|
29
|
-
}): any[] | undefined;
|
|
30
|
-
};
|
|
31
|
-
export declare function parseVueModuleId(id: string): {
|
|
32
|
-
basePath: string;
|
|
33
|
-
lang: string | null;
|
|
34
|
-
} | null;
|
|
35
|
-
export declare function isIncluded(filePath: string, include: string[], exclude: string[]): boolean;
|
|
36
|
-
export declare const serverReady: Promise<void>;
|
|
37
|
-
//# sourceMappingURL=mionVitePlugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mionVitePlugin.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/mionVitePlugin.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,0BAA0B,EAAmB,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAC,MAAM,YAAY,CAAC;AA2B9H,MAAM,WAAW,iBAAiB;IAE9B,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;IAEjD,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAEnC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAiCD,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB;;;;;;;;;;;;oBAoSjC,MAAM,YAAY,MAAM;;;;;;;;;;EA+L/C;AAQD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,GAAG,IAAI,CAQ3F;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAgB1F;AAwID,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,IAAI,CAAoC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const posix = require("path/posix");
|
|
26
|
-
const url = require("url");
|
|
27
|
-
async function resolveModule(moduleName, callerDir) {
|
|
28
|
-
const resolvedPath = moduleName.startsWith(".") && callerDir ? posix.resolve(callerDir, moduleName) : moduleName;
|
|
29
|
-
const metaResolve = getImportMetaResolve();
|
|
30
|
-
if (metaResolve) {
|
|
31
|
-
const resolved = await metaResolve(resolvedPath);
|
|
32
|
-
if (resolved) return resolved.startsWith("file:") ? url.fileURLToPath(resolved) : resolved;
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
if (typeof require !== "undefined" && typeof require.resolve === "function") return require.resolve(resolvedPath);
|
|
36
|
-
} catch {
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
const { createRequire } = await import("module");
|
|
40
|
-
const basePath = callerDir ? posix.resolve(callerDir, "noop.js") : posix.resolve(process.cwd(), "noop.js");
|
|
41
|
-
const requireFn = createRequire(basePath);
|
|
42
|
-
return requireFn.resolve(resolvedPath);
|
|
43
|
-
} catch (err) {
|
|
44
|
-
throw new Error(`Failed to resolve module "${moduleName}": ${err instanceof Error ? err.message : String(err)}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function getImportMetaResolve() {
|
|
48
|
-
try {
|
|
49
|
-
return new Function("specifier", "return import.meta.resolve?.(specifier);");
|
|
50
|
-
} catch {
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.resolveModule = resolveModule;
|
|
55
|
-
//# sourceMappingURL=resolveModule.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModule.cjs","sources":["../../../../../src/vite-plugin/resolveModule.ts"],"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\n/**\n * Inlined from @mionjs/core/src/utils.ts to avoid the vite plugin depending on core.\n * Keep in sync with the original implementation.\n */\n\nimport {resolve} from 'path/posix';\nimport {fileURLToPath} from 'url';\n\n/** Resolves a module path in both CJS and ESM environments. */\nexport async function resolveModule(moduleName: string, callerDir?: string): Promise<string> {\n const resolvedPath = moduleName.startsWith('.') && callerDir ? resolve(callerDir, moduleName) : moduleName;\n const metaResolve = getImportMetaResolve();\n if (metaResolve) {\n const resolved = await metaResolve(resolvedPath);\n if (resolved) return resolved.startsWith('file:') ? fileURLToPath(resolved) : resolved;\n }\n\n try {\n if (typeof require !== 'undefined' && typeof require.resolve === 'function') return require.resolve(resolvedPath);\n } catch {\n // Ignore and fall back to createRequire\n }\n\n try {\n const {createRequire} = await import('module');\n const basePath = callerDir ? resolve(callerDir, 'noop.js') : resolve(process.cwd(), 'noop.js');\n const requireFn = createRequire(basePath);\n return requireFn.resolve(resolvedPath);\n } catch (err) {\n throw new Error(`Failed to resolve module \"${moduleName}\": ${err instanceof Error ? err.message : String(err)}`);\n }\n}\n\nfunction getImportMetaResolve(): ((specifier: string) => string | Promise<string> | undefined) | undefined {\n try {\n // eslint-disable-next-line no-new-func\n return new Function('specifier', 'return import.meta.resolve?.(specifier);') as (\n specifier: string\n ) => string | Promise<string> | undefined;\n } catch {\n return undefined;\n }\n}\n"],"names":["resolve","fileURLToPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,eAAsB,cAAc,YAAoB,WAAqC;AACzF,QAAM,eAAe,WAAW,WAAW,GAAG,KAAK,YAAYA,cAAQ,WAAW,UAAU,IAAI;AAChG,QAAM,cAAc,qBAAA;AACpB,MAAI,aAAa;AACb,UAAM,WAAW,MAAM,YAAY,YAAY;AAC/C,QAAI,iBAAiB,SAAS,WAAW,OAAO,IAAIC,IAAAA,cAAc,QAAQ,IAAI;AAAA,EAClF;AAEA,MAAI;AACA,QAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,YAAY,WAAY,QAAO,QAAQ,QAAQ,YAAY;AAAA,EACpH,QAAQ;AAAA,EAER;AAEA,MAAI;AACA,UAAM,EAAC,cAAA,IAAiB,MAAM,OAAO,QAAQ;AAC7C,UAAM,WAAW,YAAYD,MAAAA,QAAQ,WAAW,SAAS,IAAIA,MAAAA,QAAQ,QAAQ,IAAA,GAAO,SAAS;AAC7F,UAAM,YAAY,cAAc,QAAQ;AACxC,WAAO,UAAU,QAAQ,YAAY;AAAA,EACzC,SAAS,KAAK;AACV,UAAM,IAAI,MAAM,6BAA6B,UAAU,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AAAA,EACnH;AACJ;AAEA,SAAS,uBAAkG;AACvG,MAAI;AAEA,WAAO,IAAI,SAAS,aAAa,0CAA0C;AAAA,EAG/E,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModule.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/resolveModule.ts"],"names":[],"mappings":"AAgBA,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB3F"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pluginutils = require("@rollup/pluginutils");
|
|
4
|
-
const ts = require("typescript");
|
|
5
|
-
const typeCompiler = require("@deepkit/type-compiler");
|
|
6
|
-
const src_vitePlugin_extractPureFn = require("./extractPureFn.cjs");
|
|
7
|
-
function _interopNamespaceDefault(e) {
|
|
8
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
-
if (e) {
|
|
10
|
-
for (const k in e) {
|
|
11
|
-
if (k !== "default") {
|
|
12
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: () => e[k]
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
n.default = e;
|
|
21
|
-
return Object.freeze(n);
|
|
22
|
-
}
|
|
23
|
-
const ts__namespace = /* @__PURE__ */ _interopNamespaceDefault(ts);
|
|
24
|
-
const requireToImport = (context) => ({
|
|
25
|
-
transformSourceFile(sf) {
|
|
26
|
-
const newStatements = [];
|
|
27
|
-
let changed = false;
|
|
28
|
-
for (const stmt of sf.statements) {
|
|
29
|
-
const converted = tryConvertRequireToImport(context.factory, stmt);
|
|
30
|
-
if (converted) {
|
|
31
|
-
newStatements.push(converted);
|
|
32
|
-
changed = true;
|
|
33
|
-
} else {
|
|
34
|
-
newStatements.push(stmt);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return changed ? context.factory.updateSourceFile(sf, newStatements) : sf;
|
|
38
|
-
},
|
|
39
|
-
transformBundle(b) {
|
|
40
|
-
return b;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
function tryConvertRequireToImport(f, stmt) {
|
|
44
|
-
if (!ts__namespace.isVariableStatement(stmt)) return void 0;
|
|
45
|
-
const decls = stmt.declarationList.declarations;
|
|
46
|
-
if (decls.length !== 1) return void 0;
|
|
47
|
-
const decl = decls[0];
|
|
48
|
-
if (!decl.initializer || !ts__namespace.isCallExpression(decl.initializer)) return void 0;
|
|
49
|
-
const callee = decl.initializer.expression;
|
|
50
|
-
if (!ts__namespace.isIdentifier(callee) || callee.text !== "require") return void 0;
|
|
51
|
-
if (decl.initializer.arguments.length !== 1) return void 0;
|
|
52
|
-
const specArg = decl.initializer.arguments[0];
|
|
53
|
-
if (!ts__namespace.isStringLiteral(specArg)) return void 0;
|
|
54
|
-
if (ts__namespace.isObjectBindingPattern(decl.name)) {
|
|
55
|
-
const specifiers = decl.name.elements.map(
|
|
56
|
-
(el) => f.createImportSpecifier(false, void 0, f.createIdentifier(el.name.text))
|
|
57
|
-
);
|
|
58
|
-
return f.createImportDeclaration(
|
|
59
|
-
void 0,
|
|
60
|
-
f.createImportClause(false, void 0, f.createNamedImports(specifiers)),
|
|
61
|
-
f.createStringLiteral(specArg.text)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
if (ts__namespace.isIdentifier(decl.name)) {
|
|
65
|
-
return f.createImportDeclaration(
|
|
66
|
-
void 0,
|
|
67
|
-
f.createImportClause(false, f.createIdentifier(decl.name.text), void 0),
|
|
68
|
-
f.createStringLiteral(specArg.text)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
return void 0;
|
|
72
|
-
}
|
|
73
|
-
function createDeepkitConfig(options = {}) {
|
|
74
|
-
const filter = pluginutils.createFilter(options.include ?? ["**/*.tsx", "**/*.ts"], options.exclude ?? "node_modules/**");
|
|
75
|
-
return {
|
|
76
|
-
filter: (fileName) => filter(fileName),
|
|
77
|
-
compilerOptions: {
|
|
78
|
-
target: ts__namespace.ScriptTarget.ESNext,
|
|
79
|
-
module: ts__namespace.ModuleKind.ESNext,
|
|
80
|
-
sourceMap: true,
|
|
81
|
-
configFilePath: options.tsConfig || process.cwd() + "/tsconfig.json",
|
|
82
|
-
...options.compilerOptions || {}
|
|
83
|
-
},
|
|
84
|
-
beforeTransformers: [typeCompiler.transformer],
|
|
85
|
-
afterTransformers: [typeCompiler.declarationTransformer, requireToImport]
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function createPureFnTransformerFactory(originalSource, filePath, collector, noViteClient = false) {
|
|
89
|
-
const hasPureServerFn = originalSource.includes("pureServerFn");
|
|
90
|
-
const hasFactory = originalSource.includes("registerPureFnFactory");
|
|
91
|
-
const hasMapFrom = originalSource.includes("mapFrom");
|
|
92
|
-
const pureServerFns = hasPureServerFn ? src_vitePlugin_extractPureFn.extractPureFnsFromSource(originalSource, filePath, "pureServerFn", noViteClient) : [];
|
|
93
|
-
const factoryFns = hasFactory ? src_vitePlugin_extractPureFn.extractPureFnsFromSource(originalSource, filePath, "registerPureFnFactory") : [];
|
|
94
|
-
const mapFromFns = hasMapFrom ? src_vitePlugin_extractPureFn.extractPureFnsFromSource(originalSource, filePath, "mapFrom", noViteClient) : [];
|
|
95
|
-
return (context) => {
|
|
96
|
-
let pureIdx = 0;
|
|
97
|
-
let factoryIdx = 0;
|
|
98
|
-
let mapFromIdx = 0;
|
|
99
|
-
function visitor(node) {
|
|
100
|
-
if (ts__namespace.isCallExpression(node)) {
|
|
101
|
-
const callee = node.expression;
|
|
102
|
-
if (ts__namespace.isIdentifier(callee)) {
|
|
103
|
-
if (callee.text === "pureServerFn" && pureIdx < pureServerFns.length) {
|
|
104
|
-
if (node.arguments.length >= 2) {
|
|
105
|
-
pureIdx++;
|
|
106
|
-
return ts__namespace.visitEachChild(node, visitor, context);
|
|
107
|
-
}
|
|
108
|
-
const data = pureServerFns[pureIdx++];
|
|
109
|
-
collector?.push(data);
|
|
110
|
-
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
111
|
-
...node.arguments,
|
|
112
|
-
context.factory.createStringLiteral(data.bodyHash)
|
|
113
|
-
]);
|
|
114
|
-
}
|
|
115
|
-
if (callee.text === "registerPureFnFactory" && factoryIdx < factoryFns.length) {
|
|
116
|
-
if (node.arguments.length >= 4) {
|
|
117
|
-
factoryIdx++;
|
|
118
|
-
return ts__namespace.visitEachChild(node, visitor, context);
|
|
119
|
-
}
|
|
120
|
-
const data = factoryFns[factoryIdx++];
|
|
121
|
-
collector?.push(data);
|
|
122
|
-
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
123
|
-
...node.arguments,
|
|
124
|
-
createParsedFactoryFnNode(context.factory, data)
|
|
125
|
-
]);
|
|
126
|
-
}
|
|
127
|
-
if (callee.text === "mapFrom" && mapFromIdx < mapFromFns.length) {
|
|
128
|
-
if (node.arguments.length >= 3) {
|
|
129
|
-
mapFromIdx++;
|
|
130
|
-
return ts__namespace.visitEachChild(node, visitor, context);
|
|
131
|
-
}
|
|
132
|
-
const data = mapFromFns[mapFromIdx++];
|
|
133
|
-
collector?.push(data);
|
|
134
|
-
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
135
|
-
...node.arguments,
|
|
136
|
-
context.factory.createStringLiteral(data.bodyHash)
|
|
137
|
-
]);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return ts__namespace.visitEachChild(node, visitor, context);
|
|
142
|
-
}
|
|
143
|
-
return {
|
|
144
|
-
transformSourceFile(sourceFile) {
|
|
145
|
-
if (pureServerFns.length === 0 && factoryFns.length === 0 && mapFromFns.length === 0) return sourceFile;
|
|
146
|
-
return ts__namespace.visitNode(sourceFile, visitor);
|
|
147
|
-
},
|
|
148
|
-
transformBundle(bundle) {
|
|
149
|
-
return bundle;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function createParsedFactoryFnNode(factory, data) {
|
|
155
|
-
return factory.createObjectLiteralExpression([
|
|
156
|
-
factory.createPropertyAssignment("bodyHash", factory.createStringLiteral(data.bodyHash)),
|
|
157
|
-
factory.createPropertyAssignment(
|
|
158
|
-
"paramNames",
|
|
159
|
-
factory.createArrayLiteralExpression(data.paramNames.map((n) => factory.createStringLiteral(n)))
|
|
160
|
-
),
|
|
161
|
-
factory.createPropertyAssignment("code", factory.createStringLiteral(data.fnBody))
|
|
162
|
-
]);
|
|
163
|
-
}
|
|
164
|
-
exports.createDeepkitConfig = createDeepkitConfig;
|
|
165
|
-
exports.createPureFnTransformerFactory = createPureFnTransformerFactory;
|
|
166
|
-
//# sourceMappingURL=transformers.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.cjs","sources":["../../../../../src/vite-plugin/transformers.ts"],"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\n// based on https://github.com/marcj/deepkit/blob/e7da3b48c50115d6e59e233eb9f018513d4d68ce/packages/vite/src/plugin.ts\n\nimport {createFilter} from '@rollup/pluginutils';\nimport * as ts from 'typescript';\nimport {transformer, declarationTransformer} from '@deepkit/type-compiler';\nimport {DeepkitTypeOptions, ExtractedPureFn} from './types.ts';\nimport {extractPureFnsFromSource} from './extractPureFn.ts';\n\n// ── Deepkit ─────────────────────────────────────────────────────────\n\n/** Deepkit configuration components for integration into the unified transform pipeline */\nexport interface DeepkitConfig {\n filter: (fileName: string) => boolean;\n compilerOptions: ts.CompilerOptions;\n beforeTransformers: ts.CustomTransformerFactory[];\n afterTransformers: ts.CustomTransformerFactory[];\n}\n\n/**\n * Post-deepkit transformer that converts require() calls back to import declarations.\n * Deepkit's getModuleType() reads tsconfig's module:NodeNext and falls back to 'cjs'\n * because ts.transpileModule doesn't set sourceFile.impliedNodeFormat. This causes\n * deepkit to emit `var {__ΩFoo} = require(\"./bar.ts\")` instead of ESM imports.\n * This transformer converts those back to `import {__ΩFoo} from \"./bar.ts\"` so Rollup\n * can properly resolve and rewrite the module specifiers.\n */\nconst requireToImport: ts.CustomTransformerFactory = (context: ts.TransformationContext): ts.CustomTransformer => ({\n transformSourceFile(sf: ts.SourceFile): ts.SourceFile {\n const newStatements: ts.Statement[] = [];\n let changed = false;\n for (const stmt of sf.statements) {\n const converted = tryConvertRequireToImport(context.factory, stmt);\n if (converted) {\n newStatements.push(converted);\n changed = true;\n } else {\n newStatements.push(stmt);\n }\n }\n return changed ? context.factory.updateSourceFile(sf, newStatements) : sf;\n },\n transformBundle(b: ts.Bundle): ts.Bundle {\n return b;\n },\n});\n\n/**\n * Converts CJS require patterns to ESM import declarations:\n * - `var {a, b} = require(\"./path\")` → `import {a, b} from \"./path\"`\n * - `var mod = require(\"./path\")` → `import mod from \"./path\"`\n */\nfunction tryConvertRequireToImport(f: ts.NodeFactory, stmt: ts.Statement): ts.ImportDeclaration | undefined {\n if (!ts.isVariableStatement(stmt)) return undefined;\n const decls = stmt.declarationList.declarations;\n if (decls.length !== 1) return undefined;\n const decl = decls[0];\n if (!decl.initializer || !ts.isCallExpression(decl.initializer)) return undefined;\n const callee = decl.initializer.expression;\n if (!ts.isIdentifier(callee) || callee.text !== 'require') return undefined;\n if (decl.initializer.arguments.length !== 1) return undefined;\n const specArg = decl.initializer.arguments[0];\n if (!ts.isStringLiteral(specArg)) return undefined;\n\n // var {a, b} = require(\"./path\") → import {a, b} from \"./path\"\n if (ts.isObjectBindingPattern(decl.name)) {\n const specifiers = decl.name.elements.map((el) =>\n f.createImportSpecifier(false, undefined, f.createIdentifier((el.name as ts.Identifier).text))\n );\n return f.createImportDeclaration(\n undefined,\n f.createImportClause(false, undefined, f.createNamedImports(specifiers)),\n f.createStringLiteral(specArg.text)\n );\n }\n\n // var mod = require(\"./path\") → import mod from \"./path\"\n if (ts.isIdentifier(decl.name)) {\n return f.createImportDeclaration(\n undefined,\n f.createImportClause(false, f.createIdentifier(decl.name.text), undefined),\n f.createStringLiteral(specArg.text)\n );\n }\n\n return undefined;\n}\n\n/** Creates deepkit config components that can be integrated into a unified ts.transpileModule call */\nexport function createDeepkitConfig(options: DeepkitTypeOptions = {}): DeepkitConfig {\n const filter = createFilter(options.include ?? ['**/*.tsx', '**/*.ts'], options.exclude ?? 'node_modules/**');\n return {\n filter: (fileName: string) => filter(fileName),\n compilerOptions: {\n target: ts.ScriptTarget.ESNext,\n module: ts.ModuleKind.ESNext,\n sourceMap: true,\n configFilePath: options.tsConfig || process.cwd() + '/tsconfig.json',\n ...(options.compilerOptions || {}),\n },\n beforeTransformers: [transformer],\n afterTransformers: [declarationTransformer, requireToImport],\n };\n}\n\n// ── Pure function transformer ───────────────────────────────────────\n\n/**\n * Creates a TypeScript CustomTransformerFactory that injects build-time data into pure function calls.\n * For pureServerFn(def): injects bodyHash as 2nd argument.\n * For registerPureFnFactory(ns, id, fn): injects ParsedFactoryFn as 4th argument.\n *\n * Pre-extracts data using existing extractPureFnsFromSource to ensure hash consistency\n * with the virtual module cache (same whole-file esbuild strip + JS AST path).\n */\nexport function createPureFnTransformerFactory(\n originalSource: string,\n filePath: string,\n collector?: ExtractedPureFn[],\n noViteClient = false\n): ts.CustomTransformerFactory {\n const hasPureServerFn = originalSource.includes('pureServerFn');\n const hasFactory = originalSource.includes('registerPureFnFactory');\n const hasMapFrom = originalSource.includes('mapFrom');\n\n const pureServerFns = hasPureServerFn ? extractPureFnsFromSource(originalSource, filePath, 'pureServerFn', noViteClient) : [];\n const factoryFns = hasFactory ? extractPureFnsFromSource(originalSource, filePath, 'registerPureFnFactory') : [];\n const mapFromFns = hasMapFrom ? extractPureFnsFromSource(originalSource, filePath, 'mapFrom', noViteClient) : [];\n\n return (context: ts.TransformationContext): ts.CustomTransformer => {\n let pureIdx = 0;\n let factoryIdx = 0;\n let mapFromIdx = 0;\n\n function visitor(node: ts.Node): ts.Node {\n if (ts.isCallExpression(node)) {\n const callee = node.expression;\n if (ts.isIdentifier(callee)) {\n if (callee.text === 'pureServerFn' && pureIdx < pureServerFns.length) {\n if (node.arguments.length >= 2) {\n pureIdx++;\n return ts.visitEachChild(node, visitor, context);\n }\n const data = pureServerFns[pureIdx++];\n collector?.push(data);\n return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [\n ...node.arguments,\n context.factory.createStringLiteral(data.bodyHash),\n ]);\n }\n if (callee.text === 'registerPureFnFactory' && factoryIdx < factoryFns.length) {\n if (node.arguments.length >= 4) {\n factoryIdx++;\n return ts.visitEachChild(node, visitor, context);\n }\n const data = factoryFns[factoryIdx++];\n collector?.push(data);\n return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [\n ...node.arguments,\n createParsedFactoryFnNode(context.factory, data),\n ]);\n }\n if (callee.text === 'mapFrom' && mapFromIdx < mapFromFns.length) {\n // mapFrom(source, mapper) -> mapFrom(source, mapper, 'bodyHash')\n if (node.arguments.length >= 3) {\n mapFromIdx++;\n return ts.visitEachChild(node, visitor, context);\n }\n const data = mapFromFns[mapFromIdx++];\n collector?.push(data);\n return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [\n ...node.arguments,\n context.factory.createStringLiteral(data.bodyHash),\n ]);\n }\n }\n }\n return ts.visitEachChild(node, visitor, context);\n }\n\n return {\n transformSourceFile(sourceFile: ts.SourceFile): ts.SourceFile {\n if (pureServerFns.length === 0 && factoryFns.length === 0 && mapFromFns.length === 0) return sourceFile;\n return ts.visitNode(sourceFile, visitor) as ts.SourceFile;\n },\n transformBundle(bundle: ts.Bundle): ts.Bundle {\n return bundle;\n },\n };\n };\n}\n\n/** Creates an AST node for {bodyHash: '...', paramNames: [...], code: '...'} */\nfunction createParsedFactoryFnNode(factory: ts.NodeFactory, data: ExtractedPureFn): ts.ObjectLiteralExpression {\n return factory.createObjectLiteralExpression([\n factory.createPropertyAssignment('bodyHash', factory.createStringLiteral(data.bodyHash)),\n factory.createPropertyAssignment(\n 'paramNames',\n factory.createArrayLiteralExpression(data.paramNames.map((n) => factory.createStringLiteral(n)))\n ),\n factory.createPropertyAssignment('code', factory.createStringLiteral(data.fnBody)),\n ]);\n}\n"],"names":["ts","createFilter","transformer","declarationTransformer","extractPureFnsFromSource"],"mappings":"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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DeepkitTypeOptions, ExtractedPureFn } from './types.ts';
|
|
2
|
-
import * as ts from 'typescript';
|
|
3
|
-
export interface DeepkitConfig {
|
|
4
|
-
filter: (fileName: string) => boolean;
|
|
5
|
-
compilerOptions: ts.CompilerOptions;
|
|
6
|
-
beforeTransformers: ts.CustomTransformerFactory[];
|
|
7
|
-
afterTransformers: ts.CustomTransformerFactory[];
|
|
8
|
-
}
|
|
9
|
-
export declare function createDeepkitConfig(options?: DeepkitTypeOptions): DeepkitConfig;
|
|
10
|
-
export declare function createPureFnTransformerFactory(originalSource: string, filePath: string, collector?: ExtractedPureFn[], noViteClient?: boolean): ts.CustomTransformerFactory;
|
|
11
|
-
//# sourceMappingURL=transformers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/transformers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AAM/D,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC;IACpC,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,EAAE,CAAC;IAClD,iBAAiB,EAAE,EAAE,CAAC,wBAAwB,EAAE,CAAC;CACpD;AAwED,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,kBAAuB,GAAG,aAAa,CAcnF;AAYD,wBAAgB,8BAA8B,CAC1C,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,eAAe,EAAE,EAC7B,YAAY,UAAQ,GACrB,EAAE,CAAC,wBAAwB,CAsE7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { CompilerOptions } from 'typescript';
|
|
2
|
-
export interface AOTCacheOptions {
|
|
3
|
-
excludedFns?: string[];
|
|
4
|
-
excludedPureFns?: string[];
|
|
5
|
-
cache?: boolean | string;
|
|
6
|
-
excludeReflection?: boolean;
|
|
7
|
-
customVirtualModuleId?: string;
|
|
8
|
-
isClient?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface MionServerConfig {
|
|
11
|
-
startScript: string;
|
|
12
|
-
viteConfig?: string;
|
|
13
|
-
runMode: 'buildOnly' | 'childProcess' | 'middleware';
|
|
14
|
-
waitTimeout?: number;
|
|
15
|
-
env?: Record<string, string>;
|
|
16
|
-
args?: string[];
|
|
17
|
-
}
|
|
18
|
-
export interface PureServerFnRegistryEntry {
|
|
19
|
-
readonly namespace: string;
|
|
20
|
-
readonly fnName: string;
|
|
21
|
-
readonly paramNames: string[];
|
|
22
|
-
readonly code: string;
|
|
23
|
-
readonly bodyHash: string;
|
|
24
|
-
readonly dependencies: Set<string>;
|
|
25
|
-
readonly isFactory: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface PureServerFnRegistry {
|
|
28
|
-
readonly version: string;
|
|
29
|
-
readonly entries: Record<string, PureServerFnRegistryEntry>;
|
|
30
|
-
}
|
|
31
|
-
export interface ServerPureFunctionsOptions {
|
|
32
|
-
clientSrcPath: string;
|
|
33
|
-
include?: string[];
|
|
34
|
-
exclude?: string[];
|
|
35
|
-
noViteClient?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface ExtractedPureFn {
|
|
38
|
-
namespace: string;
|
|
39
|
-
fnName: string;
|
|
40
|
-
paramNames: string[];
|
|
41
|
-
fnBody: string;
|
|
42
|
-
bodyHash: string;
|
|
43
|
-
dependencies: Set<string>;
|
|
44
|
-
sourceFile: string;
|
|
45
|
-
isFactory: boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface ParsedFactoryFn {
|
|
48
|
-
readonly bodyHash: string;
|
|
49
|
-
readonly paramNames: string[];
|
|
50
|
-
readonly code: string;
|
|
51
|
-
}
|
|
52
|
-
export type ReflectionMode = 'default' | 'explicit' | 'never';
|
|
53
|
-
export interface DeepkitTypeOptions {
|
|
54
|
-
include?: string | string[];
|
|
55
|
-
exclude?: string | string[];
|
|
56
|
-
tsConfig?: string;
|
|
57
|
-
reflection?: ReflectionMode;
|
|
58
|
-
compilerOptions?: CompilerOptions;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAG3C,MAAM,WAAW,eAAe;IAE5B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAGvB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAY3B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAWzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAa5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAO/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,gBAAgB;IAW7B,WAAW,EAAE,MAAM,CAAC;IAQpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAQpB,OAAO,EAAE,WAAW,GAAG,cAAc,GAAG,YAAY,CAAC;IAKrD,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAG7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAGD,MAAM,WAAW,yBAAyB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;CAC/D;AAGD,MAAM,WAAW,0BAA0B;IAEvC,aAAa,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAMnB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,eAAe;IAE5B,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,MAAM,CAAC;IAEjB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,eAAe;IAE5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAE9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAGD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAG9D,MAAM,WAAW,kBAAkB;IAE/B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAG5B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,UAAU,CAAC,EAAE,cAAc,CAAC;IAE5B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function generateServerPureFnsVirtualModule(extractedFns) {
|
|
4
|
-
const byNamespace = /* @__PURE__ */ new Map();
|
|
5
|
-
for (const fn of extractedFns) {
|
|
6
|
-
const list = byNamespace.get(fn.namespace) || [];
|
|
7
|
-
list.push(fn);
|
|
8
|
-
byNamespace.set(fn.namespace, list);
|
|
9
|
-
}
|
|
10
|
-
const namespaceEntries = [];
|
|
11
|
-
for (const [namespace, fns] of byNamespace) {
|
|
12
|
-
const fnEntries = fns.map((fn) => generateEntryCode(fn));
|
|
13
|
-
namespaceEntries.push(` ${JSON.stringify(namespace)}: {
|
|
14
|
-
${fnEntries.join(",\n")}
|
|
15
|
-
}`);
|
|
16
|
-
}
|
|
17
|
-
return `// Auto-generated by @mionjs/server-pure-functions
|
|
18
|
-
// Do not edit manually
|
|
19
|
-
|
|
20
|
-
export const serverPureFnsCache = {
|
|
21
|
-
${namespaceEntries.join(",\n")}
|
|
22
|
-
};
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
25
|
-
function generateEntryCode(fn) {
|
|
26
|
-
const paramsArray = fn.paramNames.map((p) => JSON.stringify(p)).join(", ");
|
|
27
|
-
const depsArray = [...fn.dependencies].map((d) => {
|
|
28
|
-
const parts = d.split("::");
|
|
29
|
-
return JSON.stringify(parts.length === 2 ? parts[1] : d);
|
|
30
|
-
});
|
|
31
|
-
const fnCode = fn.isFactory ? generateFactoryFn(fn) : generateDirectFn(fn);
|
|
32
|
-
const depsLine = depsArray.length > 0 ? `
|
|
33
|
-
pureFnDependencies: [${depsArray.join(", ")}],` : "";
|
|
34
|
-
return ` ${JSON.stringify(fn.fnName)}: {
|
|
35
|
-
namespace: ${JSON.stringify(fn.namespace)},
|
|
36
|
-
fnName: ${JSON.stringify(fn.fnName)},
|
|
37
|
-
paramNames: [${paramsArray}],
|
|
38
|
-
code: ${JSON.stringify(fn.fnBody)},
|
|
39
|
-
bodyHash: ${JSON.stringify(fn.bodyHash)},${depsLine}
|
|
40
|
-
isFactory: ${fn.isFactory},
|
|
41
|
-
${fnCode}
|
|
42
|
-
}`;
|
|
43
|
-
}
|
|
44
|
-
function generateDirectFn(fn) {
|
|
45
|
-
const params = fn.paramNames.join(", ");
|
|
46
|
-
const safeName = makeSafeFunctionName(fn.fnName);
|
|
47
|
-
return ` fn: function ${safeName}(${params}) {
|
|
48
|
-
${fn.fnBody}
|
|
49
|
-
},`;
|
|
50
|
-
}
|
|
51
|
-
function generateFactoryFn(fn) {
|
|
52
|
-
const params = fn.paramNames.join(", ");
|
|
53
|
-
const safeName = makeSafeFunctionName(fn.fnName);
|
|
54
|
-
return ` fn: undefined,
|
|
55
|
-
createFn: function ${safeName}(jitUtils) {
|
|
56
|
-
return (function factory(${params}) {
|
|
57
|
-
${fn.fnBody}
|
|
58
|
-
})(jitUtils);
|
|
59
|
-
},`;
|
|
60
|
-
}
|
|
61
|
-
function makeSafeFunctionName(name) {
|
|
62
|
-
const safe = name.replace(/[^a-zA-Z0-9_$]/g, "_");
|
|
63
|
-
if (/^[0-9]/.test(safe)) {
|
|
64
|
-
return "_" + safe;
|
|
65
|
-
}
|
|
66
|
-
return safe || "anonymous";
|
|
67
|
-
}
|
|
68
|
-
exports.generateServerPureFnsVirtualModule = generateServerPureFnsVirtualModule;
|
|
69
|
-
//# sourceMappingURL=virtualModule.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtualModule.cjs","sources":["../../../../../src/vite-plugin/virtualModule.ts"],"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 {ExtractedPureFn} from './types.ts';\n\n/** Generates the virtual module source code from extracted server pure functions */\nexport function generateServerPureFnsVirtualModule(extractedFns: ExtractedPureFn[]): string {\n // Group functions by namespace\n const byNamespace = new Map<string, ExtractedPureFn[]>();\n for (const fn of extractedFns) {\n const list = byNamespace.get(fn.namespace) || [];\n list.push(fn);\n byNamespace.set(fn.namespace, list);\n }\n\n // Generate nested namespace entries\n const namespaceEntries: string[] = [];\n for (const [namespace, fns] of byNamespace) {\n const fnEntries = fns.map((fn) => generateEntryCode(fn));\n namespaceEntries.push(` ${JSON.stringify(namespace)}: {\\n${fnEntries.join(',\\n')}\\n }`);\n }\n\n return `// Auto-generated by @mionjs/server-pure-functions\n// Do not edit manually\n\nexport const serverPureFnsCache = {\n${namespaceEntries.join(',\\n')}\n};\n`;\n}\n\n/** Generates the code for a single server pure function entry */\nfunction generateEntryCode(fn: ExtractedPureFn): string {\n const paramsArray = fn.paramNames.map((p) => JSON.stringify(p)).join(', ');\n\n // Convert dependencies from \"namespace::fnName\" to just \"fnName\" (same-namespace resolution)\n const depsArray = [...fn.dependencies].map((d) => {\n const parts = d.split('::');\n return JSON.stringify(parts.length === 2 ? parts[1] : d);\n });\n\n // Generate the function code\n const fnCode = fn.isFactory ? generateFactoryFn(fn) : generateDirectFn(fn);\n\n const depsLine = depsArray.length > 0 ? `\\n pureFnDependencies: [${depsArray.join(', ')}],` : '';\n\n return ` ${JSON.stringify(fn.fnName)}: {\n namespace: ${JSON.stringify(fn.namespace)},\n fnName: ${JSON.stringify(fn.fnName)},\n paramNames: [${paramsArray}],\n code: ${JSON.stringify(fn.fnBody)},\n bodyHash: ${JSON.stringify(fn.bodyHash)},${depsLine}\n isFactory: ${fn.isFactory},\n${fnCode}\n }`;\n}\n\n/** Generates a direct fn property for a regular pure function */\nfunction generateDirectFn(fn: ExtractedPureFn): string {\n const params = fn.paramNames.join(', ');\n const safeName = makeSafeFunctionName(fn.fnName);\n\n return ` fn: function ${safeName}(${params}) {\n ${fn.fnBody}\n },`;\n}\n\n/** Generates createFn + fn: undefined for a factory function */\nfunction generateFactoryFn(fn: ExtractedPureFn): string {\n const params = fn.paramNames.join(', ');\n const safeName = makeSafeFunctionName(fn.fnName);\n\n return ` fn: undefined,\n createFn: function ${safeName}(jitUtils) {\n return (function factory(${params}) {\n ${fn.fnBody}\n })(jitUtils);\n },`;\n}\n\n/** Makes a function name safe for use as a JavaScript identifier */\nfunction makeSafeFunctionName(name: string): string {\n // Replace any non-alphanumeric characters with underscores\n const safe = name.replace(/[^a-zA-Z0-9_$]/g, '_');\n // Ensure it starts with a letter or underscore\n if (/^[0-9]/.test(safe)) {\n return '_' + safe;\n }\n return safe || 'anonymous';\n}\n"],"names":[],"mappings":";;AAUO,SAAS,mCAAmC,cAAyC;AAExF,QAAM,kCAAkB,IAAA;AACxB,aAAW,MAAM,cAAc;AAC3B,UAAM,OAAO,YAAY,IAAI,GAAG,SAAS,KAAK,CAAA;AAC9C,SAAK,KAAK,EAAE;AACZ,gBAAY,IAAI,GAAG,WAAW,IAAI;AAAA,EACtC;AAGA,QAAM,mBAA6B,CAAA;AACnC,aAAW,CAAC,WAAW,GAAG,KAAK,aAAa;AACxC,UAAM,YAAY,IAAI,IAAI,CAAC,OAAO,kBAAkB,EAAE,CAAC;AACvD,qBAAiB,KAAK,OAAO,KAAK,UAAU,SAAS,CAAC;AAAA,EAAQ,UAAU,KAAK,KAAK,CAAC;AAAA,MAAS;AAAA,EAChG;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA,EAIT,iBAAiB,KAAK,KAAK,CAAC;AAAA;AAAA;AAG9B;AAGA,SAAS,kBAAkB,IAA6B;AACpD,QAAM,cAAc,GAAG,WAAW,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,EAAE,KAAK,IAAI;AAGzE,QAAM,YAAY,CAAC,GAAG,GAAG,YAAY,EAAE,IAAI,CAAC,MAAM;AAC9C,UAAM,QAAQ,EAAE,MAAM,IAAI;AAC1B,WAAO,KAAK,UAAU,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC;AAAA,EAC3D,CAAC;AAGD,QAAM,SAAS,GAAG,YAAY,kBAAkB,EAAE,IAAI,iBAAiB,EAAE;AAEzE,QAAM,WAAW,UAAU,SAAS,IAAI;AAAA,mCAAsC,UAAU,KAAK,IAAI,CAAC,OAAO;AAEzG,SAAO,WAAW,KAAK,UAAU,GAAG,MAAM,CAAC;AAAA,yBACtB,KAAK,UAAU,GAAG,SAAS,CAAC;AAAA,sBAC/B,KAAK,UAAU,GAAG,MAAM,CAAC;AAAA,2BACpB,WAAW;AAAA,oBAClB,KAAK,UAAU,GAAG,MAAM,CAAC;AAAA,wBACrB,KAAK,UAAU,GAAG,QAAQ,CAAC,IAAI,QAAQ;AAAA,yBACtC,GAAG,SAAS;AAAA,EACnC,MAAM;AAAA;AAER;AAGA,SAAS,iBAAiB,IAA6B;AACnD,QAAM,SAAS,GAAG,WAAW,KAAK,IAAI;AACtC,QAAM,WAAW,qBAAqB,GAAG,MAAM;AAE/C,SAAO,4BAA4B,QAAQ,IAAI,MAAM;AAAA,kBACvC,GAAG,MAAM;AAAA;AAE3B;AAGA,SAAS,kBAAkB,IAA6B;AACpD,QAAM,SAAS,GAAG,WAAW,KAAK,IAAI;AACtC,QAAM,WAAW,qBAAqB,GAAG,MAAM;AAE/C,SAAO;AAAA,iCACsB,QAAQ;AAAA,2CACE,MAAM;AAAA,sBAC3B,GAAG,MAAM;AAAA;AAAA;AAG/B;AAGA,SAAS,qBAAqB,MAAsB;AAEhD,QAAM,OAAO,KAAK,QAAQ,mBAAmB,GAAG;AAEhD,MAAI,SAAS,KAAK,IAAI,GAAG;AACrB,WAAO,MAAM;AAAA,EACjB;AACA,SAAO,QAAQ;AACnB;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtualModule.d.ts","sourceRoot":"","sources":["../../../../../src/vite-plugin/virtualModule.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAG3C,wBAAgB,kCAAkC,CAAC,YAAY,EAAE,eAAe,EAAE,GAAG,MAAM,CAuB1F"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { mionVitePlugin, serverReady } from "./src/vite-plugin/mionVitePlugin.js";
|
|
2
|
-
import { cjsPackageJsonPlugin } from "./src/vite-plugin/cjsPackageJsonPlugin.js";
|
|
3
|
-
import { VIRTUAL_AOT_JIT_FNS, VIRTUAL_AOT_PURE_FNS, VIRTUAL_AOT_ROUTER_CACHE, VIRTUAL_SERVER_PURE_FNS } from "./src/vite-plugin/constants.js";
|
|
4
|
-
export {
|
|
5
|
-
VIRTUAL_AOT_JIT_FNS,
|
|
6
|
-
VIRTUAL_AOT_PURE_FNS,
|
|
7
|
-
VIRTUAL_AOT_ROUTER_CACHE,
|
|
8
|
-
VIRTUAL_SERVER_PURE_FNS as VIRTUAL_PURE_FUNCTIONS,
|
|
9
|
-
cjsPackageJsonPlugin,
|
|
10
|
-
mionVitePlugin,
|
|
11
|
-
serverReady
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const ALLOWED_GLOBALS: Set<string>;
|
|
2
|
-
export declare const FORBIDDEN_IDENTIFIERS: Set<string>;
|
|
3
|
-
export declare const PURE_FN_CALL_NAMES: readonly ["pureServerFn", "registerPureFnFactory", "mapFrom"];
|
|
4
|
-
export declare const PURE_FN_SOURCE_PACKAGES: readonly ["@mionjs/core", "@mionjs/client"];
|
|
5
|
-
//# sourceMappingURL=purityRules.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"purityRules.d.ts","sourceRoot":"","sources":["../../../../../src/pureFns/purityRules.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,aAwC1B,CAAC;AAGH,eAAO,MAAM,qBAAqB,aAkBhC,CAAC;AAGH,eAAO,MAAM,kBAAkB,+DAAgE,CAAC;AAGhG,eAAO,MAAM,uBAAuB,6CAA8C,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const ALLOWED_GLOBALS = /* @__PURE__ */ new Set([
|
|
2
|
-
// Value types
|
|
3
|
-
"undefined",
|
|
4
|
-
"null",
|
|
5
|
-
"NaN",
|
|
6
|
-
"Infinity",
|
|
7
|
-
"true",
|
|
8
|
-
"false",
|
|
9
|
-
// Built-in constructors/objects
|
|
10
|
-
"Object",
|
|
11
|
-
"Array",
|
|
12
|
-
"String",
|
|
13
|
-
"Number",
|
|
14
|
-
"Boolean",
|
|
15
|
-
"Math",
|
|
16
|
-
"JSON",
|
|
17
|
-
"Date",
|
|
18
|
-
"RegExp",
|
|
19
|
-
"Map",
|
|
20
|
-
"Set",
|
|
21
|
-
"WeakMap",
|
|
22
|
-
"WeakSet",
|
|
23
|
-
"Symbol",
|
|
24
|
-
"BigInt",
|
|
25
|
-
"Promise",
|
|
26
|
-
"Error",
|
|
27
|
-
"TypeError",
|
|
28
|
-
"RangeError",
|
|
29
|
-
"parseInt",
|
|
30
|
-
"parseFloat",
|
|
31
|
-
"isNaN",
|
|
32
|
-
"isFinite",
|
|
33
|
-
"encodeURIComponent",
|
|
34
|
-
"decodeURIComponent",
|
|
35
|
-
"encodeURI",
|
|
36
|
-
"decodeURI",
|
|
37
|
-
// Common safe globals
|
|
38
|
-
"console",
|
|
39
|
-
"globalThis",
|
|
40
|
-
"Bun"
|
|
41
|
-
]);
|
|
42
|
-
const FORBIDDEN_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
43
|
-
"eval",
|
|
44
|
-
"Function",
|
|
45
|
-
"fetch",
|
|
46
|
-
"setTimeout",
|
|
47
|
-
"setInterval",
|
|
48
|
-
"clearTimeout",
|
|
49
|
-
"clearInterval",
|
|
50
|
-
"process",
|
|
51
|
-
"window",
|
|
52
|
-
"document",
|
|
53
|
-
"global",
|
|
54
|
-
"require",
|
|
55
|
-
"XMLHttpRequest",
|
|
56
|
-
"WebSocket",
|
|
57
|
-
"localStorage",
|
|
58
|
-
"sessionStorage",
|
|
59
|
-
"indexedDB"
|
|
60
|
-
]);
|
|
61
|
-
export {
|
|
62
|
-
ALLOWED_GLOBALS,
|
|
63
|
-
FORBIDDEN_IDENTIFIERS
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=purityRules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"purityRules.js","sources":["../../../../../src/pureFns/purityRules.ts"],"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\n/** Globals and built-ins that are allowed inside pure functions */\nexport const ALLOWED_GLOBALS = new Set([\n // Value types\n 'undefined',\n 'null',\n 'NaN',\n 'Infinity',\n 'true',\n 'false',\n // Built-in constructors/objects\n 'Object',\n 'Array',\n 'String',\n 'Number',\n 'Boolean',\n 'Math',\n 'JSON',\n 'Date',\n 'RegExp',\n 'Map',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n 'Symbol',\n 'BigInt',\n 'Promise',\n 'Error',\n 'TypeError',\n 'RangeError',\n 'parseInt',\n 'parseFloat',\n 'isNaN',\n 'isFinite',\n 'encodeURIComponent',\n 'decodeURIComponent',\n 'encodeURI',\n 'decodeURI',\n // Common safe globals\n 'console',\n 'globalThis',\n 'Bun',\n]);\n\n/** Forbidden identifiers that indicate impure operations in pure functions */\nexport const FORBIDDEN_IDENTIFIERS = new Set([\n 'eval',\n 'Function',\n 'fetch',\n 'setTimeout',\n 'setInterval',\n 'clearTimeout',\n 'clearInterval',\n 'process',\n 'window',\n 'document',\n 'global',\n 'require',\n 'XMLHttpRequest',\n 'WebSocket',\n 'localStorage',\n 'sessionStorage',\n 'indexedDB',\n]);\n\n/** The target function names that purity validation applies to */\nexport const PURE_FN_CALL_NAMES = ['pureServerFn', 'registerPureFnFactory', 'mapFrom'] as const;\n\n/** The packages that export the target pure function APIs */\nexport const PURE_FN_SOURCE_PACKAGES = ['@mionjs/core', '@mionjs/client'] as const;\n"],"names":[],"mappings":"AAQO,MAAM,sCAAsB,IAAI;AAAA;AAAA,EAEnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAGM,MAAM,4CAA4B,IAAI;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ChildProcess } from 'child_process';
|
|
2
|
-
import { MionServerConfig } from './types.ts';
|
|
3
|
-
export interface AOTCacheData {
|
|
4
|
-
jitFnsCode: string;
|
|
5
|
-
pureFnsCode: string;
|
|
6
|
-
routerCacheCode: string;
|
|
7
|
-
}
|
|
8
|
-
export interface AOTCacheResult {
|
|
9
|
-
data: AOTCacheData;
|
|
10
|
-
childProcess?: ChildProcess;
|
|
11
|
-
platformReady?: Promise<PlatformReadyData>;
|
|
12
|
-
}
|
|
13
|
-
export interface PlatformReadyData {
|
|
14
|
-
routerConfig: Record<string, unknown>;
|
|
15
|
-
platformConfig: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
export declare function generateAOTCaches(serverConfig: MionServerConfig, startScriptOverride?: string, isClient?: boolean): Promise<AOTCacheResult>;
|
|
18
|
-
export type ModuleLoader = (url: string) => Promise<Record<string, any>>;
|
|
19
|
-
export declare function loadSSRRouterAndGenerateAOTCaches(loadModule: ModuleLoader, startScript: string, isClient?: boolean): Promise<AOTCacheData>;
|
|
20
|
-
export declare function killPersistentChild(child: ChildProcess | null): Promise<void>;
|
|
21
|
-
export declare function logAOTCaches(data: AOTCacheData): void;
|
|
22
|
-
export declare function generateJitFnsModule(jitFnsCode: string): string;
|
|
23
|
-
export declare function generatePureFnsModule(pureFnsCode: string): string;
|
|
24
|
-
export declare function generateRouterCacheModule(routerCacheCode: string): string;
|
|
25
|
-
export declare function generateCombinedCachesModule(): string;
|
|
26
|
-
export declare function generateNoopModule(comment: string): string;
|
|
27
|
-
export declare function waitForPlatformReady(child: ChildProcess, timeoutMs?: number): Promise<{
|
|
28
|
-
routerConfig: Record<string, unknown>;
|
|
29
|
-
platformConfig: Record<string, unknown>;
|
|
30
|
-
}>;
|
|
31
|
-
export declare function generateNoopCombinedModule(): string;
|
|
32
|
-
//# sourceMappingURL=aotCacheGenerator.d.ts.map
|