@nativescript/vite 8.0.0-beta.0 → 8.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +35 -2
- package/configuration/angular.js +541 -216
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +227 -77
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +17 -96
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +58 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +15 -96
- package/configuration/typescript.js.map +1 -1
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/commonjs-plugins.d.ts +5 -2
- package/helpers/commonjs-plugins.js +126 -0
- package/helpers/commonjs-plugins.js.map +1 -1
- package/helpers/config-as-json.js +10 -0
- package/helpers/config-as-json.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +9 -6
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -4
- package/helpers/external-configs.js +63 -15
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +13 -0
- package/helpers/flavor.js +18 -1
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +117 -0
- package/helpers/global-defines.js +209 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/import-meta-path.d.ts +4 -0
- package/helpers/import-meta-path.js +5 -0
- package/helpers/import-meta-path.js.map +1 -0
- package/helpers/import-specifier.d.ts +1 -0
- package/helpers/import-specifier.js +18 -0
- package/helpers/import-specifier.js.map +1 -0
- package/helpers/init.js +6 -20
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +65 -4
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +8 -2
- package/helpers/main-entry.js +622 -120
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js +6 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.d.ts +13 -0
- package/helpers/nativeclass-transform.js +42 -131
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
- package/helpers/nativeclass-transformer-plugin.js +324 -37
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-external-urls.d.ts +32 -0
- package/helpers/ns-core-external-urls.js +107 -0
- package/helpers/ns-core-external-urls.js.map +1 -0
- package/helpers/ns-core-url.d.ts +106 -0
- package/helpers/ns-core-url.js +225 -0
- package/helpers/ns-core-url.js.map +1 -0
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/project.d.ts +35 -0
- package/helpers/project.js +120 -2
- package/helpers/project.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +32 -0
- package/helpers/ts-config-paths.js +156 -27
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +40 -19
- package/helpers/workers.js +312 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +95 -23
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +87 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +13 -0
- package/hmr/client/hmr-pending-overlay.js +41 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/hot-context.d.ts +67 -0
- package/hmr/client/hot-context.js +307 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +91 -1418
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +100 -0
- package/hmr/client/strategy-loader.js.map +1 -0
- package/hmr/client/update-pipeline.d.ts +27 -0
- package/hmr/client/update-pipeline.js +464 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +14 -1
- package/hmr/client/utils.js +265 -54
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +11 -0
- package/hmr/entry-runtime.js +566 -43
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/hmr/frameworks/angular/build/js-lexer.js +182 -0
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
- package/hmr/frameworks/angular/build/linker-stats.js +29 -0
- package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +2 -1
- package/hmr/frameworks/angular/client/index.js +637 -23
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +37 -6
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
- package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
- package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.js +697 -18
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/client/strategy.d.ts +12 -0
- package/hmr/frameworks/react/client/strategy.js +27 -0
- package/hmr/frameworks/react/client/strategy.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +230 -0
- package/hmr/frameworks/react/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
- package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
- package/hmr/frameworks/solid/client/app-runtime.js +252 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
- package/hmr/frameworks/solid/client/strategy.js +391 -0
- package/hmr/frameworks/solid/client/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +293 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
- package/hmr/frameworks/typescript/client/strategy.js +418 -0
- package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.js +48 -16
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +10 -1
- package/hmr/frameworks/vue/client/index.js +287 -562
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
- package/hmr/frameworks/vue/client/navigate-app.js +178 -0
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +152 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
- package/hmr/frameworks/vue/server/compiler.js +3 -1
- package/hmr/frameworks/vue/server/compiler.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +291 -7
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +131 -24
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -1
- package/hmr/helpers/vendor-rewrite.js +5 -3
- package/hmr/helpers/vendor-rewrite.js.map +1 -1
- package/hmr/server/boot-recording.d.ts +51 -0
- package/hmr/server/boot-recording.js +214 -0
- package/hmr/server/boot-recording.js.map +1 -0
- package/hmr/server/constants.d.ts +1 -0
- package/hmr/server/constants.js +21 -4
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/content-css-update.d.ts +54 -0
- package/hmr/server/content-css-update.js +78 -0
- package/hmr/server/content-css-update.js.map +1 -0
- package/hmr/server/core-bundle.d.ts +140 -0
- package/hmr/server/core-bundle.js +614 -0
- package/hmr/server/core-bundle.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +130 -4
- package/hmr/server/core-sanitize.js +393 -32
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/css-connect-sync.d.ts +28 -0
- package/hmr/server/css-connect-sync.js +59 -0
- package/hmr/server/css-connect-sync.js.map +1 -0
- package/hmr/server/css-device-module.d.ts +28 -0
- package/hmr/server/css-device-module.js +44 -0
- package/hmr/server/css-device-module.js.map +1 -0
- package/hmr/server/css-update-message.d.ts +23 -0
- package/hmr/server/css-update-message.js +41 -0
- package/hmr/server/css-update-message.js.map +1 -0
- package/hmr/server/deps-bundle.d.ts +233 -0
- package/hmr/server/deps-bundle.js +1022 -0
- package/hmr/server/deps-bundle.js.map +1 -0
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +182 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +215 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +99 -0
- package/hmr/server/import-map.js +294 -0
- package/hmr/server/import-map.js.map +1 -0
- package/hmr/server/index.d.ts +2 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/node-builtins-route.d.ts +12 -0
- package/hmr/server/node-builtins-route.js +86 -0
- package/hmr/server/node-builtins-route.js.map +1 -0
- package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
- package/hmr/server/ns-core-cjs-shape.js +271 -0
- package/hmr/server/ns-core-cjs-shape.js.map +1 -0
- package/hmr/server/ns-m-response-memo.d.ts +10 -0
- package/hmr/server/ns-m-response-memo.js +33 -0
- package/hmr/server/ns-m-response-memo.js.map +1 -0
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +39 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +44 -0
- package/hmr/server/process-code-for-device.js +834 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.d.ts +5 -0
- package/hmr/server/runtime-graph-filter.js +28 -0
- package/hmr/server/runtime-graph-filter.js.map +1 -0
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.d.ts +12 -0
- package/hmr/server/shared-transform-request.js +143 -0
- package/hmr/server/shared-transform-request.js.map +1 -0
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +22 -1
- package/hmr/server/vite-plugin.js +655 -58
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +68 -0
- package/hmr/server/websocket-core-bridge.js +370 -0
- package/hmr/server/websocket-core-bridge.js.map +1 -0
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-graph-upsert.d.ts +21 -0
- package/hmr/server/websocket-graph-upsert.js +33 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -0
- package/hmr/server/websocket-hmr-pending.d.ts +29 -0
- package/hmr/server/websocket-hmr-pending.js +33 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +80 -0
- package/hmr/server/websocket-hot-update.js +295 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +21 -0
- package/hmr/server/websocket-module-bindings.js +504 -0
- package/hmr/server/websocket-module-bindings.js.map +1 -0
- package/hmr/server/websocket-module-specifiers.d.ts +96 -0
- package/hmr/server/websocket-module-specifiers.js +819 -0
- package/hmr/server/websocket-module-specifiers.js.map +1 -0
- package/hmr/server/websocket-ns-core.d.ts +34 -0
- package/hmr/server/websocket-ns-core.js +414 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +163 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
- package/hmr/server/websocket-ns-m-paths.js +115 -0
- package/hmr/server/websocket-ns-m-paths.js.map +1 -0
- package/hmr/server/websocket-ns-m-request.d.ts +46 -0
- package/hmr/server/websocket-ns-m-request.js +197 -0
- package/hmr/server/websocket-ns-m-request.js.map +1 -0
- package/hmr/server/websocket-ns-m.d.ts +52 -0
- package/hmr/server/websocket-ns-m.js +590 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +89 -0
- package/hmr/server/websocket-served-module-helpers.js +935 -0
- package/hmr/server/websocket-served-module-helpers.js.map +1 -0
- package/hmr/server/websocket-txn.d.ts +6 -0
- package/hmr/server/websocket-txn.js +42 -0
- package/hmr/server/websocket-txn.js.map +1 -0
- package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
- package/hmr/server/websocket-vendor-unifier.js +46 -0
- package/hmr/server/websocket-vendor-unifier.js.map +1 -0
- package/hmr/server/websocket.d.ts +7 -17
- package/hmr/server/websocket.js +723 -5376
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +107 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/package-classifier.d.ts +9 -0
- package/hmr/shared/package-classifier.js +58 -0
- package/hmr/shared/package-classifier.js.map +1 -0
- package/hmr/shared/protocol.d.ts +157 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-complete.d.ts +14 -0
- package/hmr/shared/runtime/boot-complete.js +32 -0
- package/hmr/shared/runtime/boot-complete.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +134 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
- package/hmr/shared/runtime/boot-timeline.js +40 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
- package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
- package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
- package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
- package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
- package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
- package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
- package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
- package/hmr/shared/runtime/dev-overlay.js +292 -0
- package/hmr/shared/runtime/dev-overlay.js.map +1 -0
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
- package/hmr/shared/runtime/launch-bridge.js +98 -0
- package/hmr/shared/runtime/launch-bridge.js.map +1 -0
- package/hmr/shared/runtime/module-provenance.d.ts +1 -0
- package/hmr/shared/runtime/module-provenance.js +64 -0
- package/hmr/shared/runtime/module-provenance.js.map +1 -0
- package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
- package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
- package/hmr/shared/runtime/overlay-flag.js +34 -0
- package/hmr/shared/runtime/overlay-flag.js.map +1 -0
- package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
- package/hmr/shared/runtime/platform-polyfills.js +122 -0
- package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
- package/hmr/shared/runtime/root-placeholder.js +778 -83
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
- package/hmr/shared/runtime/session-bootstrap.js +350 -0
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
- package/hmr/shared/runtime/worker-tracking.js +114 -0
- package/hmr/shared/runtime/worker-tracking.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +12 -0
- package/hmr/shared/vendor/manifest.js +341 -545
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +118 -7
- package/hmr/shared/vendor/registry.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +76 -14
- package/runtime/core-aliases-early.js +103 -81
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +61 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/shims/solid-jsx-runtime.d.ts +7 -0
- package/shims/solid-jsx-runtime.js +17 -0
- package/shims/solid-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -189
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -4
- package/helpers/angular/shared-linker.js +0 -39
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.js.map +0 -1
- package/helpers/module-runner-patch.d.ts +0 -3
- package/helpers/module-runner-patch.js +0 -63
- package/helpers/module-runner-patch.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
- package/hmr/shared/runtime/http-only-boot.js +0 -124
- package/hmr/shared/runtime/http-only-boot.js.map +0 -1
- package/hmr/vendor-bootstrap.d.ts +0 -3
- package/hmr/vendor-bootstrap.js +0 -32
- package/hmr/vendor-bootstrap.js.map +0 -1
- package/shims/react-reconciler-constants.d.ts +0 -14
- package/shims/react-reconciler-constants.js +0 -21
- package/shims/react-reconciler-constants.js.map +0 -1
- package/shims/react-reconciler.d.ts +0 -8
- package/shims/react-reconciler.js +0 -15
- package/shims/react-reconciler.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { parse as babelParse } from '@babel/parser';
|
|
2
|
+
import traverse from '@babel/traverse';
|
|
3
|
+
import { sanitizeStrayCoreReferences } from './core-sanitize.js';
|
|
4
|
+
import { getMonorepoWorkspaceRoot } from '../../helpers/project.js';
|
|
5
|
+
import { isRuntimeGraphExcludedPath } from './runtime-graph-filter.js';
|
|
6
|
+
import { buildPiniaVendorShim, buildVueVendorShim } from './vendor-bare-module-shims.js';
|
|
7
|
+
import { collapseLegacyNsMTags } from './websocket-ns-m-paths.js';
|
|
8
|
+
import { createNsMRequestContext, resolveNsMTransformedModule } from './websocket-ns-m-request.js';
|
|
9
|
+
import { setDeviceModuleHeaders } from './route-helpers.js';
|
|
10
|
+
import { CSS_MODULE_RE, buildCssRegisterSnippetFromVar, normalizeCssForDevice } from './css-device-module.js';
|
|
11
|
+
import { assertNoOptimizedArtifacts, buildBootProgressSnippet, canonicalizeRtImports, classifyServedModule, dedupeRtNamedImportsAgainstDestructures, deduplicateLinkerImports, ensureDestructureCoreImports, ensureGuardPlainDynamicImports, ensureVariableDynamicImportHelper, expandStarExports, hoistTopLevelStaticImports, MODULE_IMPORT_ANALYSIS_PLUGINS, wrapCommonJsModuleForDevice } from './websocket-served-module-helpers.js';
|
|
12
|
+
import { cleanCode, collectImportDependencies, isWorkerEntryModuleId, processCodeForDevice, rewriteImports } from './websocket-device-transform.js';
|
|
13
|
+
import { REQUIRE_GUARD_SNIPPET } from './require-guard.js';
|
|
14
|
+
import { getServerOrigin } from './server-origin.js';
|
|
15
|
+
import { createNsMResponseMemo } from './ns-m-response-memo.js';
|
|
16
|
+
import { getSharedDepsBundleService, registerDepsBundleRoute } from './deps-bundle.js';
|
|
17
|
+
const babelTraverse = traverse?.default || traverse;
|
|
18
|
+
/**
|
|
19
|
+
* Registers the `/ns/m/*` device module server: the HTTP endpoint every
|
|
20
|
+
* NativeScript device uses to fetch app/source modules (and AnalogJS Angular
|
|
21
|
+
* `/@ng/component` live-reload requests) as device-ready ESM. This is the
|
|
22
|
+
* single hottest route in the HMR server.
|
|
23
|
+
*/
|
|
24
|
+
export function registerNsModuleServerRoute(server, options) {
|
|
25
|
+
// Final-response memo: repeat serves of an unchanged module (app restarts,
|
|
26
|
+
// concurrent graph-walk fetch waves) skip the whole post-processing
|
|
27
|
+
// pipeline. Keyed by a hash of Vite's transform output, so HMR edits
|
|
28
|
+
// invalidate implicitly. `NS_VITE_HMR_DISABLE_NSM_MEMO=1` opts out.
|
|
29
|
+
const memoDisabled = process.env.NS_VITE_HMR_DISABLE_NSM_MEMO === '1' || process.env.NS_VITE_HMR_DISABLE_NSM_MEMO === 'true';
|
|
30
|
+
const responseMemo = createNsMResponseMemo();
|
|
31
|
+
// Deps bundle (see deps-bundle.ts): once a boot recording exists, the
|
|
32
|
+
// recorded node_modules closure is served as ONE esbuild payload and the
|
|
33
|
+
// canonical /ns/m/node_modules/... URLs become thin registry shims.
|
|
34
|
+
const depsBundle = options.depsBundle !== undefined ? options.depsBundle : getSharedDepsBundleService(server);
|
|
35
|
+
if (depsBundle) {
|
|
36
|
+
registerDepsBundleRoute(server, depsBundle);
|
|
37
|
+
}
|
|
38
|
+
server.middlewares.use(async (req, res, next) => {
|
|
39
|
+
try {
|
|
40
|
+
const urlObj = new URL(req.url || '', 'http://localhost');
|
|
41
|
+
if (!urlObj.pathname.startsWith('/ns/m'))
|
|
42
|
+
return next();
|
|
43
|
+
// Closure deps injected by createHmrWebSocketPlugin (see websocket.ts).
|
|
44
|
+
const verbose = options.verbose;
|
|
45
|
+
const APP_VIRTUAL_WITH_SLASH = options.appVirtualWithSlash;
|
|
46
|
+
const sfcFileMap = options.sfcFileMap;
|
|
47
|
+
const depFileMap = options.depFileMap;
|
|
48
|
+
const sharedTransformRequest = options.sharedTransformRequest;
|
|
49
|
+
const ensureInitialGraphPopulationStarted = options.ensureInitialGraphPopulationStarted;
|
|
50
|
+
const strategy = options.getStrategy();
|
|
51
|
+
// Framework request interception, BEFORE spec resolution. Angular
|
|
52
|
+
// uses this to delegate AnalogJS `/@ng/component` live-reload
|
|
53
|
+
// fetches (with the boot-fetch gate and iOS empty-body guard —
|
|
54
|
+
// see frameworks/angular/server/ng-component-route.ts). Must run
|
|
55
|
+
// first: an intercepted request must not kick off graph
|
|
56
|
+
// population or the transform pipeline.
|
|
57
|
+
if (strategy?.interceptModuleRequest?.({
|
|
58
|
+
urlObj,
|
|
59
|
+
res,
|
|
60
|
+
next,
|
|
61
|
+
isLiveComponentUpdateFetch: options.isLiveAngularComponentUpdateFetch,
|
|
62
|
+
})) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// graphVersion starts at 1 and stays stable during cold boot (see
|
|
66
|
+
// `upsertGraphModule`'s bumpVersion option and the inline comment
|
|
67
|
+
// at the graphVersion declaration), so the initial population can
|
|
68
|
+
// run in the background without blocking the first response.
|
|
69
|
+
// `handleHotUpdate` awaits the same promise so the first HMR
|
|
70
|
+
// event still sees a fully populated graph.
|
|
71
|
+
ensureInitialGraphPopulationStarted(server);
|
|
72
|
+
// Cold-boot counting lives in the leading boot-trace middleware
|
|
73
|
+
// (see `configureServer` — it records the request and tracks
|
|
74
|
+
// finish() via res.on('close'/'finish')), not here: recording in
|
|
75
|
+
// this handler would miss the round-trip timing and per-route
|
|
76
|
+
// breakdowns.
|
|
77
|
+
setDeviceModuleHeaders(res);
|
|
78
|
+
// Inbound spec normalization is owned by createNsMRequestContext
|
|
79
|
+
// (websocket-ns-m-request.ts): query/path-style spec extraction,
|
|
80
|
+
// the anomalous-'@' and empty-spec stubs, legacy boot/HMR tag
|
|
81
|
+
// stripping, absolute-filesystem → project-relative mapping,
|
|
82
|
+
// `@/` aliasing, the blocked-device-import gate, and candidate
|
|
83
|
+
// expansion. Its specs pin all of it.
|
|
84
|
+
const serverRoot = (server.config?.root || process.cwd());
|
|
85
|
+
const monorepoWorkspaceRoot = getMonorepoWorkspaceRoot(serverRoot);
|
|
86
|
+
const contextResult = createNsMRequestContext(req.url || '', serverRoot, APP_VIRTUAL_WITH_SLASH, monorepoWorkspaceRoot);
|
|
87
|
+
if (contextResult.kind === 'next')
|
|
88
|
+
return next();
|
|
89
|
+
if (contextResult.kind === 'response') {
|
|
90
|
+
res.statusCode = contextResult.statusCode;
|
|
91
|
+
res.end(contextResult.code);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const requestContext = contextResult.value;
|
|
95
|
+
const spec = requestContext.spec;
|
|
96
|
+
// Serve Vite virtual modules (/@id/ prefix) directly — these are
|
|
97
|
+
// internal virtual modules (e.g., \0nsvite:nsconfig-json for
|
|
98
|
+
// ~/package.json) that don't exist on disk and must NOT run
|
|
99
|
+
// through the device post-processing pipeline below.
|
|
100
|
+
if (spec.startsWith('/@id/')) {
|
|
101
|
+
try {
|
|
102
|
+
// First try Vite's transform pipeline directly
|
|
103
|
+
const vr = await sharedTransformRequest(spec);
|
|
104
|
+
if (vr?.code) {
|
|
105
|
+
res.statusCode = 200;
|
|
106
|
+
res.end(vr.code);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch { }
|
|
111
|
+
try {
|
|
112
|
+
// Fallback: decode the virtual module ID (__x00__ → \0) and
|
|
113
|
+
// load through the plugin container directly
|
|
114
|
+
const rawId = spec.slice('/@id/'.length).replace(/__x00__/g, '\0');
|
|
115
|
+
const loadResult = await server.pluginContainer.load(rawId);
|
|
116
|
+
if (loadResult) {
|
|
117
|
+
const code = typeof loadResult === 'string' ? loadResult : loadResult.code;
|
|
118
|
+
if (code) {
|
|
119
|
+
res.statusCode = 200;
|
|
120
|
+
res.end(code);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch { }
|
|
126
|
+
}
|
|
127
|
+
// Worker-realm serves must NOT take the deps-bundle bridge: the
|
|
128
|
+
// bundle evaluates the full dependency closure in the worker realm,
|
|
129
|
+
// where Angular's injectables reject the entry evaluation
|
|
130
|
+
// ("_PlatformLocation needs to be compiled using the JIT compiler").
|
|
131
|
+
// Per-module serving gives the worker just the graphs it imports.
|
|
132
|
+
// A request belongs to a worker realm when it carries `?ns_worker=1`
|
|
133
|
+
// (propagated onto every /ns/m child specifier of a worker serve
|
|
134
|
+
// below) OR when it IS a worker entry by filename — the runtime's
|
|
135
|
+
// `new Worker(...)` fetch has no way to carry the marker itself.
|
|
136
|
+
const isWorkerRealmRequest = urlObj.searchParams.get('ns_worker') === '1' || isWorkerEntryModuleId(spec);
|
|
137
|
+
// Deps-bundle shim short-circuit: a bundled node_modules module is
|
|
138
|
+
// served as a thin registry shim (see deps-bundle.ts) — the whole
|
|
139
|
+
// transform pipeline below is skipped. Non-bundled specs (no
|
|
140
|
+
// recording yet, CJS files, build failure) fall through unchanged.
|
|
141
|
+
if (depsBundle && !isWorkerRealmRequest && spec.includes('/node_modules/')) {
|
|
142
|
+
const shim = depsBundle.getShimForSpec(spec);
|
|
143
|
+
if (shim) {
|
|
144
|
+
res.statusCode = 200;
|
|
145
|
+
res.end(shim);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// A JS/TS `import './x.css'` reaches the device as a module request;
|
|
150
|
+
// Vite's default CSS module needs a DOM, so it's a no-op on NativeScript.
|
|
151
|
+
// Compile via `?inline` (full postcss/sass/@import, no DOM side effect),
|
|
152
|
+
// register the result under the file's root-relative tag (matches the
|
|
153
|
+
// `.css` live-edit tag so edits replace, not stack), and re-export the
|
|
154
|
+
// string for `import css from './x.css'`. `app.css` has its own path.
|
|
155
|
+
if (CSS_MODULE_RE.test(spec)) {
|
|
156
|
+
try {
|
|
157
|
+
const inlineRes = await sharedTransformRequest(`${spec}?inline`);
|
|
158
|
+
const inlineCode = inlineRes?.code || '';
|
|
159
|
+
// `?inline` output is `export default "<compiled css>"`.
|
|
160
|
+
const m = inlineCode.match(/export\s+default\s+("(?:[^"\\]|\\.)*")\s*;?/s);
|
|
161
|
+
if (m) {
|
|
162
|
+
let css = '';
|
|
163
|
+
try {
|
|
164
|
+
css = JSON.parse(m[1]);
|
|
165
|
+
}
|
|
166
|
+
catch { }
|
|
167
|
+
css = normalizeCssForDevice(css);
|
|
168
|
+
const out = `// [ns:m][css] ${spec}\n` + `const __ns_css_text__ = ${JSON.stringify(css)};\n` + buildCssRegisterSnippetFromVar(spec, '__ns_css_text__') + `export default __ns_css_text__;\n`;
|
|
169
|
+
res.statusCode = 200;
|
|
170
|
+
res.end(out);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (verbose)
|
|
174
|
+
console.warn('[ns:m][css] unexpected ?inline output shape for', spec);
|
|
175
|
+
}
|
|
176
|
+
catch (cssErr) {
|
|
177
|
+
if (verbose)
|
|
178
|
+
console.warn('[ns:m][css] inline compile failed', spec, cssErr?.message);
|
|
179
|
+
}
|
|
180
|
+
// Fall through to default handling if inline compile produced nothing.
|
|
181
|
+
}
|
|
182
|
+
// Queue and dedupe transformRequest calls so heavy app graphs do not
|
|
183
|
+
// overwhelm Vite with concurrent work. Slow-transform warnings start only
|
|
184
|
+
// when the transform actually begins executing, and requests stay pending
|
|
185
|
+
// until Vite returns a real result.
|
|
186
|
+
const transformWithTimeout = async (url, timeoutMs = 120000) => {
|
|
187
|
+
const r = await sharedTransformRequest(url, timeoutMs);
|
|
188
|
+
// A type-only .ts module legitimately transforms to EMPTY code
|
|
189
|
+
// (e.g. a workspace lib's `interfaces.ts` holding only `export
|
|
190
|
+
// type ...`). Every candidate gate in the resolution pipeline
|
|
191
|
+
// tests `r?.code` truthiness, so '' would cascade through all
|
|
192
|
+
// fallbacks into a 404 "transform miss" — and one 404 in the
|
|
193
|
+
// entry graph fails the whole dev-session boot. Normalize to
|
|
194
|
+
// the canonical empty ESM module instead.
|
|
195
|
+
if (r && typeof r.code === 'string' && r.code.trim() === '') {
|
|
196
|
+
return { ...r, code: 'export {}\n' };
|
|
197
|
+
}
|
|
198
|
+
return r;
|
|
199
|
+
};
|
|
200
|
+
const resolvePluginContainerId = async (id) => {
|
|
201
|
+
try {
|
|
202
|
+
const resolved = await server.pluginContainer?.resolveId?.(id, undefined);
|
|
203
|
+
return typeof resolved === 'string' ? resolved : resolved?.id || null;
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const loadVirtualId = (id) => server.pluginContainer.load(id);
|
|
210
|
+
// Canonical "spec → transformed module" resolution
|
|
211
|
+
// (websocket-ns-m-request.ts): raw explicit JS read → transform
|
|
212
|
+
// candidates → resolveId → bare node_modules specifier →
|
|
213
|
+
// /@fs project+workspace roots → ?import hint.
|
|
214
|
+
const resolution = await resolveNsMTransformedModule({
|
|
215
|
+
context: requestContext,
|
|
216
|
+
transformRequest: transformWithTimeout,
|
|
217
|
+
resolveId: resolvePluginContainerId,
|
|
218
|
+
loadVirtualId,
|
|
219
|
+
});
|
|
220
|
+
let transformed = resolution.transformed;
|
|
221
|
+
const resolvedCandidate = resolution.resolvedCandidate;
|
|
222
|
+
// Solid HMR: patch the served `@solid-refresh` runtime so $$refreshESM
|
|
223
|
+
// applies registry updates inline on module re-evaluation. The full
|
|
224
|
+
// patch (and its server-side diagnostics) lives in the Solid strategy's
|
|
225
|
+
// `transformNodeModule` hook; every other flavor leaves the hook
|
|
226
|
+
// undefined, so this is a no-op for them.
|
|
227
|
+
try {
|
|
228
|
+
if (transformed?.code && strategy?.transformNodeModule) {
|
|
229
|
+
const patched = strategy.transformNodeModule(transformed.code, resolvedCandidate || spec || '', verbose);
|
|
230
|
+
if (patched !== transformed.code) {
|
|
231
|
+
// Work on a copy to avoid mutating Vite's cached TransformResult
|
|
232
|
+
transformed = { ...transformed, code: patched };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
catch { }
|
|
237
|
+
// NOTE: Path-based cache busting for /ns/m/* imports is applied in the
|
|
238
|
+
// finalize step below (after rewriteImports adds the /ns/m/ prefix).
|
|
239
|
+
// The block here only handles TypeScript-specific graph population.
|
|
240
|
+
try {
|
|
241
|
+
if (transformed?.code) {
|
|
242
|
+
const code = transformed.code;
|
|
243
|
+
// TypeScript-specific graph population: when TS flavor is active
|
|
244
|
+
// and this is an application module under the virtual app root,
|
|
245
|
+
// upsert it into the HMR graph so ns:hmr-full-graph is non-empty.
|
|
246
|
+
try {
|
|
247
|
+
if (strategy?.flavor === 'typescript' || strategy?.flavor === 'react') {
|
|
248
|
+
const id = (resolvedCandidate || spec).replace(/[?#].*$/, '');
|
|
249
|
+
// Only track app modules (under APP_VIRTUAL_WITH_SLASH) and ts/js/tsx/jsx/mjs.
|
|
250
|
+
const isApp = id.startsWith(APP_VIRTUAL_WITH_SLASH) || id.startsWith('/app/');
|
|
251
|
+
if (isApp && /\.(ts|tsx|js|jsx|mjs|mts|cts)$/i.test(id) && !isRuntimeGraphExcludedPath(id)) {
|
|
252
|
+
const deps = Array.from(collectImportDependencies(code, id));
|
|
253
|
+
if (verbose) {
|
|
254
|
+
console.log('[hmr-ws][ts-graph] candidate', { id, depsCount: deps.length });
|
|
255
|
+
}
|
|
256
|
+
// Serve-time warm-up: no live edit happened, so don't bump
|
|
257
|
+
// graphVersion.
|
|
258
|
+
options.upsertGraphModule(id, code, deps, { bumpVersion: false });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch { }
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch { }
|
|
266
|
+
// If transformRequest failed, handle bare-module vendor shims for 'vue' and 'pinia'
|
|
267
|
+
if (!transformed?.code) {
|
|
268
|
+
const bare = spec.startsWith('/') ? spec.slice(1) : spec;
|
|
269
|
+
const isBare = bare && !bare.includes('/') && !/\.(ts|tsx|js|jsx|mjs|mts|cts|vue)$/i.test(bare);
|
|
270
|
+
if (isBare && (bare === 'vue' || bare === 'nativescript-vue' || bare === 'pinia')) {
|
|
271
|
+
const pkg = bare;
|
|
272
|
+
let code = '';
|
|
273
|
+
if (pkg === 'vue' || pkg === 'nativescript-vue') {
|
|
274
|
+
code = buildVueVendorShim(pkg);
|
|
275
|
+
}
|
|
276
|
+
else if (pkg === 'pinia') {
|
|
277
|
+
code = buildPiniaVendorShim();
|
|
278
|
+
}
|
|
279
|
+
res.statusCode = 200;
|
|
280
|
+
res.end(code || 'export {}\n');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
// (Bare specifiers already went through resolveId in the
|
|
284
|
+
// resolution pipeline above — reaching here means a true miss.)
|
|
285
|
+
// Emit a module that throws with context for easier on-device debugging
|
|
286
|
+
try {
|
|
287
|
+
const tried = Array.from(new Set(requestContext.transformCandidates.length > 0 ? requestContext.transformCandidates : requestContext.candidates)).slice(0, 12);
|
|
288
|
+
const out = `// [ns:m] transform miss path=${spec} tried=${tried.length}\n` + `throw new Error(${JSON.stringify(`[ns/m] transform failed for ${spec} (tried ${tried.length} candidates).`)});\nexport {};\n`;
|
|
289
|
+
res.statusCode = 404;
|
|
290
|
+
res.end(out);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
res.statusCode = 404;
|
|
295
|
+
res.end('export {}\n');
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
// Final-response memo (see ns-m-response-memo.ts): identical
|
|
300
|
+
// (spec, transform output, context) → identical served body, so repeat
|
|
301
|
+
// serves skip the post-processing pipeline. The graph version in the
|
|
302
|
+
// context conservatively invalidates on any live edit — star-export
|
|
303
|
+
// expansion and the link-check read other modules, so this module's
|
|
304
|
+
// own transform hash is not sufficient.
|
|
305
|
+
// Worker-realm serves produce a DIFFERENT body (vendor imports as
|
|
306
|
+
// per-module HTTP + ns_worker marker propagation) — keep the two
|
|
307
|
+
// variants in separate memo slots.
|
|
308
|
+
const memoContext = `${strategy?.flavor || ''}|${getServerOrigin(server)}|${options.getGraphVersion()}|${resolvedCandidate || ''}|${isWorkerRealmRequest ? 'worker' : 'main'}`;
|
|
309
|
+
const memoKey = memoDisabled ? null : responseMemo.buildKey(spec, transformed.code, memoContext);
|
|
310
|
+
if (memoKey) {
|
|
311
|
+
const memoized = responseMemo.get(memoKey);
|
|
312
|
+
if (memoized !== undefined) {
|
|
313
|
+
res.statusCode = 200;
|
|
314
|
+
res.end(memoized);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
let code = transformed.code;
|
|
319
|
+
// Prepend guard to capture any URL-based require attempts
|
|
320
|
+
code = REQUIRE_GUARD_SNIPPET + code;
|
|
321
|
+
code = cleanCode(code, strategy);
|
|
322
|
+
// Library code (node_modules, monorepo core source, dist vite package)
|
|
323
|
+
// must skip the app-source passes inside processCodeForDevice (AST
|
|
324
|
+
// normalization, /ns/rt helper-alias injection). One classification
|
|
325
|
+
// point — see classifyServedModule for the full case list.
|
|
326
|
+
const isNodeMod = classifyServedModule(resolvedCandidate || spec) === 'library';
|
|
327
|
+
code = processCodeForDevice(code, false, true, isNodeMod, resolvedCandidate || spec, isWorkerRealmRequest ? { workerRealm: true } : undefined);
|
|
328
|
+
// import.meta.hot is JS-owned: cleanCode() strips Vite's browser
|
|
329
|
+
// __vite__createHotContext assignment and processCodeForDevice
|
|
330
|
+
// injects the NS hot-context prelude (globalThis.__NS_HOT_REGISTRY__,
|
|
331
|
+
// installed by the /__ns_dev__/client bootstrap) for app modules.
|
|
332
|
+
const projectRoot = server.config?.root || process.cwd();
|
|
333
|
+
const serverOrigin = getServerOrigin(server);
|
|
334
|
+
// Served-module import rewrite, routed through the active framework
|
|
335
|
+
// strategy. Angular overrides with its register-only entry pass
|
|
336
|
+
// (`rewriteServedModule`); every other flavor falls through to the shared
|
|
337
|
+
// `rewriteImports` default.
|
|
338
|
+
const servedModuleCtx = {
|
|
339
|
+
moduleId: resolvedCandidate || spec,
|
|
340
|
+
sfcFileMap,
|
|
341
|
+
depFileMap,
|
|
342
|
+
projectRoot,
|
|
343
|
+
serverOrigin,
|
|
344
|
+
verbose: !!verbose,
|
|
345
|
+
};
|
|
346
|
+
code = strategy?.rewriteServedModule ? strategy.rewriteServedModule(code, servedModuleCtx) : rewriteImports(code, servedModuleCtx.moduleId, sfcFileMap, depFileMap, projectRoot, !!verbose, undefined, serverOrigin, true);
|
|
347
|
+
// Expand `export * from "url"` into explicit named re-exports.
|
|
348
|
+
// NativeScript's HTTP ESM loader may not propagate star-re-exports across
|
|
349
|
+
// HTTP module boundaries (the namespace object gets direct exports but
|
|
350
|
+
// misses re-exported names). By expanding to `export { a, b } from "url"`,
|
|
351
|
+
// the engine sees explicit named exports and resolves them correctly.
|
|
352
|
+
try {
|
|
353
|
+
code = await expandStarExports(code, server, server.config?.root || process.cwd(), verbose, sharedTransformRequest, resolvedCandidate || spec);
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
if (verbose)
|
|
357
|
+
console.warn('[ns/m] export* expansion failed:', e?.message);
|
|
358
|
+
}
|
|
359
|
+
// Dedupe any /ns/rt named imports that duplicate destructured bindings off default /ns/rt
|
|
360
|
+
try {
|
|
361
|
+
code = dedupeRtNamedImportsAgainstDestructures(code);
|
|
362
|
+
}
|
|
363
|
+
catch { }
|
|
364
|
+
code = ensureVariableDynamicImportHelper(code);
|
|
365
|
+
// Final safety: guard any plain dynamic import(...) occurrences to reroute anomalous '@' specs
|
|
366
|
+
try {
|
|
367
|
+
code = ensureGuardPlainDynamicImports(code);
|
|
368
|
+
}
|
|
369
|
+
catch { }
|
|
370
|
+
// Extra hardening before the fast-fail assertion: run the
|
|
371
|
+
// consolidated stray-core-reference safety net. If any
|
|
372
|
+
// rewrite occurred, leave a diagnostic marker so the
|
|
373
|
+
// pipeline review log explains why the served code carries
|
|
374
|
+
// it.
|
|
375
|
+
try {
|
|
376
|
+
const __before = code;
|
|
377
|
+
code = sanitizeStrayCoreReferences(code);
|
|
378
|
+
if (code !== __before) {
|
|
379
|
+
code = `// [hmr-sanitize] core-literal->bridge\n` + code;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
catch { }
|
|
383
|
+
// Final pass: deduplicate/resolve any bare-specifier imports that slipped
|
|
384
|
+
// through the pipeline (e.g., extracted from JSDoc comments by import-splitting
|
|
385
|
+
// regexes, or injected by the Angular linker on already-resolved code).
|
|
386
|
+
try {
|
|
387
|
+
code = deduplicateLinkerImports(code);
|
|
388
|
+
}
|
|
389
|
+
catch { }
|
|
390
|
+
// CJS/UMD wrapping: if a module uses module.exports but has no ESM export default,
|
|
391
|
+
// wrap it with CJS shims so the device HTTP ESM loader can consume it.
|
|
392
|
+
// This handles npm packages that use CommonJS but aren't pre-bundled by Vite.
|
|
393
|
+
//
|
|
394
|
+
// Key constraints this must handle:
|
|
395
|
+
// - CJS modules often declare local vars with the same names as their exports
|
|
396
|
+
// (e.g. `function createLTTB() {...}; exports.createLTTB = createLTTB;`)
|
|
397
|
+
// so `export var { createLTTB }` would cause a duplicate declaration.
|
|
398
|
+
// - UMD modules reference `this` at top level (undefined in ESM) but
|
|
399
|
+
// typically fall back to `self` or `globalThis`.
|
|
400
|
+
// - `module`, `exports` must be shims since they don't exist in ESM.
|
|
401
|
+
try {
|
|
402
|
+
code = wrapCommonJsModuleForDevice(code, resolvedCandidate || null);
|
|
403
|
+
}
|
|
404
|
+
catch { }
|
|
405
|
+
try {
|
|
406
|
+
assertNoOptimizedArtifacts(code, `NS M ${resolvedCandidate || spec}`);
|
|
407
|
+
}
|
|
408
|
+
catch (e) {
|
|
409
|
+
res.statusCode = 500;
|
|
410
|
+
return void res.end(`throw new Error(${JSON.stringify(e?.message || String(e))});\nexport {};`);
|
|
411
|
+
}
|
|
412
|
+
// Framework export normalization (e.g. the Vue/Solid/TS `routes`
|
|
413
|
+
// default-export alias — see FrameworkServerStrategy.normalizeServedExports).
|
|
414
|
+
try {
|
|
415
|
+
code = strategy?.normalizeServedExports?.(code) ?? code;
|
|
416
|
+
}
|
|
417
|
+
catch { }
|
|
418
|
+
// Every emitted endpoint URL is CANONICAL (unversioned).
|
|
419
|
+
//
|
|
420
|
+
// Module identity is literally the URL — a versioned
|
|
421
|
+
// `/ns/rt/<ver>` / `/ns/core/<ver>` / `/ns/sfc/<ver>` would
|
|
422
|
+
// create a second module realm. `canonicalizeRtImports` and the
|
|
423
|
+
// strategy's `canonicalizeFrameworkImports` collapse any
|
|
424
|
+
// versioned form (stale cached device code) back to the single
|
|
425
|
+
// canonical URL.
|
|
426
|
+
try {
|
|
427
|
+
code = canonicalizeRtImports(code, getServerOrigin(server));
|
|
428
|
+
code = strategy.canonicalizeFrameworkImports?.(code, getServerOrigin(server)) ?? code;
|
|
429
|
+
}
|
|
430
|
+
catch { }
|
|
431
|
+
// `/ns/m` URL finalize step: collapse every emitted /ns/m URL form
|
|
432
|
+
// (static/side-effect/dynamic imports, new URL(...) shapes, SFC
|
|
433
|
+
// URLs) to the canonical stable form. Cache busting is driven by
|
|
434
|
+
// ns:module `invalidateModules` + the runtime's eviction nonce,
|
|
435
|
+
// not URL decoration — see websocket-ns-m-paths.ts.
|
|
436
|
+
try {
|
|
437
|
+
code = collapseLegacyNsMTags(code, 'outbound-served-code', getServerOrigin(server));
|
|
438
|
+
}
|
|
439
|
+
catch { }
|
|
440
|
+
// Final guard: eliminate any lingering named imports from /ns/core to avoid
|
|
441
|
+
// evaluation-time "does not provide an export named ..." in the device runtime.
|
|
442
|
+
try {
|
|
443
|
+
code = ensureDestructureCoreImports(code);
|
|
444
|
+
}
|
|
445
|
+
catch { }
|
|
446
|
+
// Boot-time module graph progress: while the app is still replacing
|
|
447
|
+
// the placeholder, emit lightweight progress updates as /ns/m app
|
|
448
|
+
// modules begin evaluating. The snippet is SELF-GATING (it no-ops
|
|
449
|
+
// once `__NS_HMR_BOOT_COMPLETE__` flips) so it is injected
|
|
450
|
+
// unconditionally — no boot-tagged URL needed. node_modules are
|
|
451
|
+
// deliberately skipped (the heartbeat's wall-clock axis covers
|
|
452
|
+
// vendor stretches; see startBootImportHeartbeat).
|
|
453
|
+
try {
|
|
454
|
+
if (!isNodeMod) {
|
|
455
|
+
const bootModuleLabel = String(spec || '').replace(/\\/g, '/');
|
|
456
|
+
const bootProgressSnippet = buildBootProgressSnippet(bootModuleLabel);
|
|
457
|
+
code = bootProgressSnippet + code;
|
|
458
|
+
code = hoistTopLevelStaticImports(code);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
catch { }
|
|
462
|
+
// Dev-only: link-check static imports to surface missing bindings early
|
|
463
|
+
try {
|
|
464
|
+
const devCheck = process.env.NODE_ENV !== 'production';
|
|
465
|
+
if (devCheck) {
|
|
466
|
+
const ast = babelParse(code, {
|
|
467
|
+
sourceType: 'module',
|
|
468
|
+
plugins: MODULE_IMPORT_ANALYSIS_PLUGINS,
|
|
469
|
+
});
|
|
470
|
+
const imports = [];
|
|
471
|
+
babelTraverse(ast, {
|
|
472
|
+
ImportDeclaration(p) {
|
|
473
|
+
const src = p.node.source.value;
|
|
474
|
+
if (typeof src !== 'string')
|
|
475
|
+
return;
|
|
476
|
+
const wantsDefault = p.node.specifiers.some((s) => s.type === 'ImportDefaultSpecifier');
|
|
477
|
+
imports.push({ src, wantsDefault });
|
|
478
|
+
},
|
|
479
|
+
});
|
|
480
|
+
// Resolve and verify each static import that asks for default
|
|
481
|
+
for (const imp of imports) {
|
|
482
|
+
if (!imp.wantsDefault)
|
|
483
|
+
continue;
|
|
484
|
+
// Only check our served endpoints and app modules
|
|
485
|
+
if (/^https?:\/\/[^\s]+\/ns\//.test(imp.src) || /^https?:\/\/[^\s]+\/.+/.test(imp.src)) {
|
|
486
|
+
const u = new URL(imp.src, 'http://localhost');
|
|
487
|
+
// Fetch target module's sanitized code using server.transformRequest or by routing through our own endpoints heuristically
|
|
488
|
+
let targetCode = '';
|
|
489
|
+
try {
|
|
490
|
+
if (u.pathname.startsWith('/ns/asm')) {
|
|
491
|
+
// Reconstruct: call our own assembler handler to get code (preferred)
|
|
492
|
+
const target = await server.transformRequest(imp.src.replace(/^https?:\/\/[^/]+/, ''));
|
|
493
|
+
targetCode = target?.code || '';
|
|
494
|
+
}
|
|
495
|
+
else if (u.pathname.startsWith('/ns/sfc')) {
|
|
496
|
+
// Delegator re-exports default from /ns/asm — skip; assembler will be checked when imported by upstream
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
else if (u.pathname.startsWith('/ns/m')) {
|
|
500
|
+
// Resolve the import target through the SAME
|
|
501
|
+
// canonical pipeline the /ns/m route itself uses
|
|
502
|
+
// (websocket-ns-m-request.ts) instead of a third
|
|
503
|
+
// hand-rolled copy of candidate expansion.
|
|
504
|
+
try {
|
|
505
|
+
const targetContextResult = createNsMRequestContext(u.pathname, serverRoot, APP_VIRTUAL_WITH_SLASH, monorepoWorkspaceRoot);
|
|
506
|
+
if (targetContextResult.kind === 'context') {
|
|
507
|
+
const targetResolution = await resolveNsMTransformedModule({
|
|
508
|
+
context: targetContextResult.value,
|
|
509
|
+
transformRequest: async (url) => {
|
|
510
|
+
try {
|
|
511
|
+
return await server.transformRequest(url);
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
resolveId: resolvePluginContainerId,
|
|
518
|
+
loadVirtualId,
|
|
519
|
+
});
|
|
520
|
+
targetCode = targetResolution.transformed?.code || '';
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
catch { }
|
|
524
|
+
}
|
|
525
|
+
else if (u.pathname.startsWith('/ns/rt') || u.pathname.startsWith('/ns/core')) {
|
|
526
|
+
// Bridges export named/default as needed; skip default check
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
catch { }
|
|
531
|
+
if (!targetCode)
|
|
532
|
+
continue;
|
|
533
|
+
const hasDefault = /\bexport\s+default\b/.test(targetCode) || /export\s*\{\s*default\s*(?:as\s*default)?\s*\}/.test(targetCode);
|
|
534
|
+
if (!hasDefault) {
|
|
535
|
+
// CJS/UMD modules won't have `export default` — they get CJS-wrapped
|
|
536
|
+
// by the serving pipeline. Only warn, don't fatally block the importer.
|
|
537
|
+
const hasCjsPattern = /\bmodule\s*\.\s*exports\b/.test(targetCode) || /\bexports\s*\.\s*\w/.test(targetCode);
|
|
538
|
+
if (hasCjsPattern) {
|
|
539
|
+
if (verbose) {
|
|
540
|
+
console.warn(`[ns:m][link-check] CJS module without export default: ${u.pathname} (will be CJS-wrapped at serve time)`);
|
|
541
|
+
}
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
const msg = `[link-check] Missing default export in ${u.pathname}${u.search} (imported by ${resolvedCandidate || spec})`;
|
|
545
|
+
// Emit a module that throws to surface the exact offender
|
|
546
|
+
res.statusCode = 200;
|
|
547
|
+
res.end(`throw new Error(${JSON.stringify(msg)});\nexport {};`);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
catch (eLC) {
|
|
555
|
+
if (verbose) {
|
|
556
|
+
console.warn('[ns:m][link-check] failed', eLC?.message || eLC);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
// Worker-realm marker propagation: every /ns/m child specifier in a
|
|
560
|
+
// `?ns_worker=1` response carries the marker too, so the ENTIRE
|
|
561
|
+
// worker module graph stays on per-module serving. Without this,
|
|
562
|
+
// a worker entry's transitive app modules (e.g. a utils barrel
|
|
563
|
+
// importing rxjs/@angular/core) resolve node_modules specs through
|
|
564
|
+
// the deps-bundle bridge, dragging the full dependency closure —
|
|
565
|
+
// Angular included — into the worker realm, where injectables
|
|
566
|
+
// reject the entry evaluation ("_PlatformLocation needs to be
|
|
567
|
+
// compiled using the JIT compiler").
|
|
568
|
+
if (isWorkerRealmRequest) {
|
|
569
|
+
code = code.replace(/((?:from\s*|import\s*\(?\s*|import\s+)["'])((?:https?:\/\/[^"']+)?\/ns\/m\/[^"']*?)(["'])/g, (full, pre, url, post) => {
|
|
570
|
+
if (/[?&]ns_worker=1/.test(url))
|
|
571
|
+
return full;
|
|
572
|
+
return `${pre}${url}${url.includes('?') ? '&' : '?'}ns_worker=1${post}`;
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
// Only fully successful serves are memoized — every early-return
|
|
576
|
+
// above (link-check throw module, 404 stubs, 500s) stays uncached.
|
|
577
|
+
if (memoKey) {
|
|
578
|
+
responseMemo.set(memoKey, code);
|
|
579
|
+
}
|
|
580
|
+
res.statusCode = 200;
|
|
581
|
+
res.end(code);
|
|
582
|
+
}
|
|
583
|
+
catch (e) {
|
|
584
|
+
console.warn('[sfc-asm] error serving', req.url, e && e.message ? e.message : e);
|
|
585
|
+
res.statusCode = 500;
|
|
586
|
+
res.end('export {}\n');
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
//# sourceMappingURL=websocket-ns-m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-ns-m.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-ns-m.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,qB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