@nativescript/vite 8.0.0-alpha.5 → 8.0.0-alpha.50
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 +51 -11
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +376 -165
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +241 -51
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +14 -93
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +51 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +12 -93
- 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-state.d.ts +8 -0
- package/helpers/app-css-state.js +8 -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/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.js +1 -1
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/global-defines.d.ts +142 -0
- package/helpers/global-defines.js +213 -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/init.js +0 -18
- 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 +3 -1
- package/helpers/main-entry.js +301 -53
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.js +5 -6
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +157 -14
- 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-url.d.ts +29 -7
- package/helpers/ns-core-url.js +69 -12
- package/helpers/ns-core-url.js.map +1 -1
- 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 +14 -0
- package/helpers/ts-config-paths.js +90 -9
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js +2 -2
- 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/workers.d.ts +20 -19
- package/helpers/workers.js +624 -4
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +50 -26
- 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 +79 -0
- package/hmr/client/framework-client-strategy.js +19 -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 +60 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/index.js +891 -220
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +7 -1
- package/hmr/client/utils.js +207 -29
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +256 -69
- 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 +109 -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/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- 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/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- package/hmr/frameworks/angular/build/js-lexer.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.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.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/client/index.d.ts +1 -0
- package/hmr/frameworks/angular/client/index.js +859 -21
- 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 +1 -4
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/strategy.js +460 -12
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +150 -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 +54 -0
- package/hmr/frameworks/solid/client/app-runtime.js +184 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +291 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/server/strategy.js +38 -14
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +36 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +8 -0
- package/hmr/frameworks/vue/client/index.js +56 -243
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +157 -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 +142 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -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 +459 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -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 +278 -1
- 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 +77 -10
- 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/server/constants.js +20 -5
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/core-sanitize.d.ts +86 -7
- package/hmr/server/core-sanitize.js +170 -45
- package/hmr/server/core-sanitize.js.map +1 -1
- 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 +108 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +214 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +11 -2
- package/hmr/server/import-map.js +92 -45
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
- package/hmr/server/ns-core-cjs-shape.js +4 -6
- package/hmr/server/ns-core-cjs-shape.js.map +1 -1
- 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 +38 -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 +14 -0
- package/hmr/server/process-code-for-device.js +699 -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 +630 -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/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +83 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +13 -7
- package/hmr/server/shared-transform-request.js.map +1 -1
- 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.js +78 -42
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +45 -4
- package/hmr/server/websocket-core-bridge.js +50 -48
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-css-hot-update.d.ts +33 -0
- package/hmr/server/websocket-css-hot-update.js +65 -0
- package/hmr/server/websocket-css-hot-update.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 +15 -0
- package/hmr/server/websocket-graph-upsert.js +20 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -1
- package/hmr/server/websocket-hmr-pending.d.ts +37 -0
- package/hmr/server/websocket-hmr-pending.js +55 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +77 -0
- package/hmr/server/websocket-hot-update.js +360 -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 +50 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.js +3 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -2
- package/hmr/server/websocket-module-specifiers.js +191 -20
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +21 -0
- package/hmr/server/websocket-ns-core.js +311 -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 +164 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +1 -1
- package/hmr/server/websocket-ns-m-paths.js +58 -13
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +11 -1
- package/hmr/server/websocket-ns-m-request.js +18 -25
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +33 -0
- package/hmr/server/websocket-ns-m.js +752 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +49 -3
- package/hmr/server/websocket-served-module-helpers.js +403 -87
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +2 -8
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +8 -39
- package/hmr/server/websocket.js +608 -6300
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +118 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +145 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.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 +133 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
- package/hmr/shared/runtime/boot-timeline.js +42 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- 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.d.ts +119 -26
- package/hmr/shared/runtime/dev-overlay.js +1196 -262
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- 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/http-only-boot.js +7 -6
- package/hmr/shared/runtime/http-only-boot.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- 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.js +393 -200
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +168 -4
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +549 -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 +1 -7
- package/hmr/shared/vendor/manifest.js +84 -819
- package/hmr/shared/vendor/manifest.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 +38 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +296 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/hmr/vendor-bootstrap.d.ts +1 -3
- package/hmr/vendor-bootstrap.js +4 -6
- package/hmr/vendor-bootstrap.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +61 -11
- package/runtime/core-aliases-early.js +25 -55
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +37 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -194
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -11
- package/helpers/angular/shared-linker.js +0 -75
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
- package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.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/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js +0 -239
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
- package/hmr/server/websocket-ns-m-finalize.js +0 -88
- package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
- package/hmr/server/websocket-runtime-compat.d.ts +0 -19
- package/hmr/server/websocket-runtime-compat.js +0 -286
- package/hmr/server/websocket-runtime-compat.js.map +0 -1
- package/hmr/server/websocket-vue-sfc.d.ts +0 -27
- package/hmr/server/websocket-vue-sfc.js +0 -1117
- package/hmr/server/websocket-vue-sfc.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
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -1,23 +1,225 @@
|
|
|
1
1
|
import { getProjectAppPath, getProjectAppVirtualPath } from './utils.js';
|
|
2
2
|
const APP_ROOT_DIR = getProjectAppPath();
|
|
3
3
|
const APP_ROOT_VIRTUAL = getProjectAppVirtualPath();
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Opt-out flag for the HMR-applying progress overlay.
|
|
6
|
+
*
|
|
7
|
+
* Default: enabled. Set `NS_VITE_PROGRESS_OVERLAY=0` (or `false`) in
|
|
8
|
+
* the environment to suppress the overlay if a developer finds it
|
|
9
|
+
* distracting. We accept the same falsy spellings webpack-era tooling
|
|
10
|
+
* used (`0`, `false`, `off`, `no`) and treat anything else as
|
|
11
|
+
* enabled-by-default; this avoids surprising users who pass quoted
|
|
12
|
+
* truthy strings ("1", "true").
|
|
13
|
+
*/
|
|
14
|
+
export function isHmrProgressOverlayEnabled(env = process.env) {
|
|
15
|
+
const raw = (env.NS_VITE_PROGRESS_OVERLAY ?? '').toString().trim().toLowerCase();
|
|
16
|
+
if (!raw)
|
|
17
|
+
return true;
|
|
18
|
+
return !['0', 'false', 'off', 'no'].includes(raw);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Kickstart-eligibility threshold for the parallel HMR prefetch
|
|
22
|
+
* (`__nsKickstartHmrPrefetch`).
|
|
23
|
+
*
|
|
24
|
+
* Why a threshold exists. The kickstart fetches the SERVER-computed
|
|
25
|
+
* inverse-dep closure (`evictPaths`) in parallel before V8 starts
|
|
26
|
+
* its module walk, which is a clean win when the closure size is
|
|
27
|
+
* close to what V8 will actually re-evaluate on the next import. For
|
|
28
|
+
* a typical Angular component edit (`*.component.ts` / `.html`) the
|
|
29
|
+
* closure contains ~5–30 modules and almost all of them sit on the
|
|
30
|
+
* live forward path from the entry, so fan-out beats sequential
|
|
31
|
+
* `HttpFetchText` calls by 3–5×.
|
|
32
|
+
*
|
|
33
|
+
* The picture inverts for `.ts` files with deep inverse-dep fan-in
|
|
34
|
+
* (constants files, design-system enums, shared utilities). The
|
|
35
|
+
* server faithfully reports the entire inverse closure (often
|
|
36
|
+
* 100–300 importers), but V8's forward walk on re-import only
|
|
37
|
+
* re-evaluates the ~20–30 modules that sit on the currently-rendered
|
|
38
|
+
* route's path. The kickstart's parallel wave then over-fetches the
|
|
39
|
+
* other ~70–270 importers — and Vite's single-threaded transform
|
|
40
|
+
* pipeline cannot keep up with 16-way concurrent demand, so each
|
|
41
|
+
* fetch's tail latency balloons. Net result: a "should-be-200ms"
|
|
42
|
+
* HMR cycle becomes 6+ seconds.
|
|
43
|
+
*
|
|
44
|
+
* The threshold short-circuits the kickstart when `evictPaths.length`
|
|
45
|
+
* exceeds the configured cap. The HMR cycle still completes
|
|
46
|
+
* correctly — V8 falls back to per-module synchronous fetches.
|
|
47
|
+
*
|
|
48
|
+
* Default: 32. Empirically chosen so component-shaped closures
|
|
49
|
+
* (typically 5–30) keep the kickstart speed-up while wide-fan-in
|
|
50
|
+
* leaf edits (typically 100+) skip it. Override with
|
|
51
|
+
* `NS_VITE_KICKSTART_MAX_URLS=N` (any non-negative integer) — `0`
|
|
52
|
+
* disables the kickstart entirely; `Infinity` removes the cap.
|
|
53
|
+
*/
|
|
54
|
+
export const HMR_KICKSTART_DEFAULT_MAX_URLS = 32;
|
|
55
|
+
export function resolveHmrKickstartMaxUrls(env = process.env) {
|
|
56
|
+
const raw = (env.NS_VITE_KICKSTART_MAX_URLS ?? '').toString().trim();
|
|
57
|
+
if (!raw)
|
|
58
|
+
return HMR_KICKSTART_DEFAULT_MAX_URLS;
|
|
59
|
+
const lower = raw.toLowerCase();
|
|
60
|
+
if (lower === 'infinity' || lower === 'unlimited' || lower === 'none') {
|
|
61
|
+
return Number.POSITIVE_INFINITY;
|
|
62
|
+
}
|
|
63
|
+
const parsed = Number(raw);
|
|
64
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
65
|
+
return HMR_KICKSTART_DEFAULT_MAX_URLS;
|
|
66
|
+
}
|
|
67
|
+
return Math.floor(parsed);
|
|
68
|
+
}
|
|
69
|
+
export function getRuntimeDefineValues(opts) {
|
|
70
|
+
const platform = opts.platform || '';
|
|
5
71
|
return {
|
|
6
|
-
|
|
7
|
-
__ANDROID__:
|
|
8
|
-
__IOS__:
|
|
9
|
-
__VISIONOS__:
|
|
10
|
-
__APPLE__:
|
|
11
|
-
__DEV__: JSON.stringify(opts.targetMode === 'development'),
|
|
72
|
+
__DEV__: !!opts.isDevMode,
|
|
73
|
+
__ANDROID__: platform === 'android',
|
|
74
|
+
__IOS__: platform === 'ios',
|
|
75
|
+
__VISIONOS__: platform === 'visionos',
|
|
76
|
+
__APPLE__: platform === 'ios' || platform === 'visionos',
|
|
12
77
|
__COMMONJS__: false,
|
|
13
78
|
__NS_WEBPACK__: false,
|
|
14
|
-
__NS_ENV_VERBOSE__:
|
|
15
|
-
__NS_TARGET_FLAVOR__: JSON.stringify(opts.flavor),
|
|
16
|
-
__CSS_PARSER__: JSON.stringify('css-tree'),
|
|
79
|
+
__NS_ENV_VERBOSE__: !!opts.verbose,
|
|
17
80
|
__UI_USE_XML_PARSER__: true,
|
|
18
81
|
__UI_USE_EXTERNAL_RENDERER__: false,
|
|
19
|
-
|
|
82
|
+
__CSS_PARSER__: 'css-tree',
|
|
20
83
|
__TEST__: false,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The COMPLETE set of globals the bundle entry's defines-seed module must
|
|
88
|
+
* plant. Superset of {@link getRuntimeDefineValues}: also carries every
|
|
89
|
+
* `__NS_*__` value that raw-served runtime files consume. Vite's `define`
|
|
90
|
+
* substitution never reaches those files (the HMR client and framework
|
|
91
|
+
* clients are served raw from node_modules/dist), so any define they read
|
|
92
|
+
* MUST also exist on globalThis or its build-time fallback silently wins —
|
|
93
|
+
* which is how `NS_VITE_PROGRESS_OVERLAY=0` and `NS_VITE_KICKSTART_MAX_URLS`
|
|
94
|
+
* historically never reached the device, and how '/src'-defaulted app roots
|
|
95
|
+
* broke 'app/'-rooted projects. Rule: add a define consumed by client code →
|
|
96
|
+
* add it HERE, and read it with a `globalThis` fallback at the consumer.
|
|
97
|
+
*/
|
|
98
|
+
export function getRuntimeSeedValues(opts) {
|
|
99
|
+
return {
|
|
100
|
+
...getRuntimeDefineValues(opts),
|
|
101
|
+
// Runtime flavor for the raw-served HMR client's TARGET_FLAVOR resolution.
|
|
102
|
+
__NS_TARGET_FLAVOR__: opts.flavor,
|
|
103
|
+
// App-root virtual path — every served-id → moduleName mapping (frame
|
|
104
|
+
// navigation targets, modal re-present matching) depends on this.
|
|
105
|
+
__NS_APP_ROOT_DIR__: APP_ROOT_DIR,
|
|
106
|
+
__NS_APP_ROOT_VIRTUAL__: APP_ROOT_VIRTUAL,
|
|
107
|
+
// HMR-applying overlay opt-out (NS_VITE_PROGRESS_OVERLAY=0).
|
|
108
|
+
__NS_HMR_PROGRESS_OVERLAY_ENABLED__: isHmrProgressOverlayEnabled(),
|
|
109
|
+
// Kickstart eviction-set cap (NS_VITE_KICKSTART_MAX_URLS) — may be
|
|
110
|
+
// Infinity; buildGlobalSeedStatements serializes it explicitly.
|
|
111
|
+
__NS_HMR_KICKSTART_MAX_URLS__: resolveHmrKickstartMaxUrls(),
|
|
112
|
+
__CI__: !!opts.isCI,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Unconditional `globalThis.<key> = <value>;` statements — the bundle entry's
|
|
117
|
+
* defines-seed module body (evaluates as a leaf before any sibling import).
|
|
118
|
+
* Accepts the full seed map; `Infinity` is serialized explicitly because
|
|
119
|
+
* `JSON.stringify(Infinity)` is the string "null".
|
|
120
|
+
*/
|
|
121
|
+
export function buildGlobalSeedStatements(values) {
|
|
122
|
+
return Object.entries(values).map(([key, value]) => `globalThis.${key} = ${typeof value === 'number' && !Number.isFinite(value) ? 'Infinity' : JSON.stringify(value)};`);
|
|
123
|
+
}
|
|
124
|
+
/** @deprecated kept for callers of the platform-only subset; prefer buildGlobalSeedStatements(getRuntimeSeedValues(...)) */
|
|
125
|
+
export function buildDefineSeedStatements(values) {
|
|
126
|
+
return buildGlobalSeedStatements(values);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Guarded seed for the dev server's per-module prelude. Under HMR the bundle's
|
|
130
|
+
* externalized core URL imports evaluate BEFORE the bundle body (ESM: imports
|
|
131
|
+
* run before the importer), so the unconditional seed above has NOT run when
|
|
132
|
+
* the HTTP core graph instantiates. Whichever served module evaluates first
|
|
133
|
+
* runs this and seeds globalThis with the correct platform; later modules and
|
|
134
|
+
* the bundle seed see it already set and no-op.
|
|
135
|
+
*/
|
|
136
|
+
export function buildGuardedDefineSeedStatement(values) {
|
|
137
|
+
return `if (globalThis.__IOS__ === undefined && globalThis.__ANDROID__ === undefined) { globalThis.__ANDROID__ = ${values.__ANDROID__}; globalThis.__IOS__ = ${values.__IOS__}; globalThis.__VISIONOS__ = ${values.__VISIONOS__}; globalThis.__APPLE__ = ${values.__APPLE__}; }\nif (globalThis.__DEV__ === undefined) { globalThis.__DEV__ = ${values.__DEV__}; }`;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* `const <key> = globalThis.<key> !== undefined ? globalThis.<key> : <canonical>;`
|
|
141
|
+
* shim statements injected at the top of every HTTP-served module. The
|
|
142
|
+
* fallbacks are the canonical values themselves, so a module snapshots correct
|
|
143
|
+
* platform flags even if it evaluates before ANY seed has run.
|
|
144
|
+
*/
|
|
145
|
+
export function buildDefineShimStatements(values) {
|
|
146
|
+
return Object.entries(values).map(([key, value]) => `const ${key} = globalThis.${key} !== undefined ? globalThis.${key} : ${JSON.stringify(value)};`);
|
|
147
|
+
}
|
|
148
|
+
// ── User-configured `__FOO__` defines ─────────────────────────────────────────
|
|
149
|
+
// An app may add its own `__FOO__`-style entries to Vite `config.define`
|
|
150
|
+
// (e.g. `__NS_NATIVE_OVERRIDES__`). In a production bundle Vite text-substitutes
|
|
151
|
+
// them, but NS's HMR pipeline serves raw modules where that substitution never
|
|
152
|
+
// runs — and the AST normalizer then mis-reads the free `__FOO__` identifier as
|
|
153
|
+
// an `/ns/rt` helper and binds it from the runtime bridge (which doesn't export
|
|
154
|
+
// it) → `undefined` under HMR while the bundle had the real value. Emitting a
|
|
155
|
+
// per-module const shim (exactly like the builtin defines above) gives the
|
|
156
|
+
// identifier a binding the normalizer leaves alone AND the correct value, so HMR
|
|
157
|
+
// matches the bundle. Captured from the resolved config in `configResolved`.
|
|
158
|
+
const USER_DEFINE_IDENTIFIER_RE = /^__[A-Za-z0-9_]+__$/;
|
|
159
|
+
let userDefineEntries = [];
|
|
160
|
+
/**
|
|
161
|
+
* Record the app's `__FOO__`-style `define` entries from the resolved Vite
|
|
162
|
+
* config. Non-identifier keys (`process.env.X`, `global.isIOS`, `import.meta.*`)
|
|
163
|
+
* are ignored — only bare `__FOO__` identifiers can appear free in app code and
|
|
164
|
+
* get mis-bound. Vite `define` VALUES are JS-expression strings (e.g. `"true"`),
|
|
165
|
+
* so they pass through verbatim; a non-string value is JSON-encoded defensively.
|
|
166
|
+
*/
|
|
167
|
+
export function setUserDefineEntries(define) {
|
|
168
|
+
const entries = [];
|
|
169
|
+
if (define) {
|
|
170
|
+
for (const [key, value] of Object.entries(define)) {
|
|
171
|
+
if (!USER_DEFINE_IDENTIFIER_RE.test(key))
|
|
172
|
+
continue;
|
|
173
|
+
entries.push([key, typeof value === 'string' ? value : JSON.stringify(value)]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
userDefineEntries = entries;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Per-module const shims for the captured user defines. `excludeKeys` are the
|
|
180
|
+
* builtin defines already shimmed by {@link buildDefineShimStatements} — skipped
|
|
181
|
+
* here so we never emit a duplicate `const` (a syntax error).
|
|
182
|
+
*/
|
|
183
|
+
export function buildUserDefineShimStatements(excludeKeys = []) {
|
|
184
|
+
const exclude = new Set(excludeKeys);
|
|
185
|
+
return userDefineEntries.filter(([key]) => !exclude.has(key)).map(([key, expr]) => `const ${key} = globalThis.${key} !== undefined ? globalThis.${key} : (${expr});`);
|
|
186
|
+
}
|
|
187
|
+
export function getGlobalDefines(opts) {
|
|
188
|
+
const values = getRuntimeDefineValues({ platform: opts.platform, isDevMode: opts.targetMode === 'development', verbose: opts.verbose });
|
|
189
|
+
return {
|
|
190
|
+
// Define platform flags for runtime checks
|
|
191
|
+
__ANDROID__: JSON.stringify(values.__ANDROID__),
|
|
192
|
+
__IOS__: JSON.stringify(values.__IOS__),
|
|
193
|
+
__VISIONOS__: JSON.stringify(values.__VISIONOS__),
|
|
194
|
+
__APPLE__: JSON.stringify(values.__APPLE__),
|
|
195
|
+
'global.isAndroid': JSON.stringify(values.__ANDROID__),
|
|
196
|
+
'global.isIOS': JSON.stringify(values.__APPLE__),
|
|
197
|
+
__DEV__: JSON.stringify(values.__DEV__),
|
|
198
|
+
__COMMONJS__: values.__COMMONJS__,
|
|
199
|
+
__NS_WEBPACK__: values.__NS_WEBPACK__,
|
|
200
|
+
// webpack exposes `__non_webpack_require__` (its APIPlugin) as the native,
|
|
201
|
+
// non-bundler require. Some NativeScript plugins (e.g. @nativescript/firebase-core's
|
|
202
|
+
// Android config reader) reference it unguarded. Map it to the runtime's
|
|
203
|
+
// global require so those plugins work under Vite/Rolldown too. Raw
|
|
204
|
+
// expression (NOT JSON.stringified) so it substitutes as code, not a string.
|
|
205
|
+
__non_webpack_require__: 'globalThis.require',
|
|
206
|
+
__NS_ENV_VERBOSE__: JSON.stringify(values.__NS_ENV_VERBOSE__),
|
|
207
|
+
__NS_TARGET_FLAVOR__: JSON.stringify(opts.flavor),
|
|
208
|
+
// whether to show the HMR in-progress overlay.
|
|
209
|
+
__NS_HMR_PROGRESS_OVERLAY_ENABLED__: JSON.stringify(isHmrProgressOverlayEnabled()),
|
|
210
|
+
// Eviction-set size cap for the parallel HMR kickstart.
|
|
211
|
+
// `JSON.stringify(Number.POSITIVE_INFINITY)` is the string
|
|
212
|
+
// "null", so we serialize Infinity ourselves to keep the
|
|
213
|
+
// build-time literal readable in source maps.
|
|
214
|
+
__NS_HMR_KICKSTART_MAX_URLS__: (() => {
|
|
215
|
+
const n = resolveHmrKickstartMaxUrls();
|
|
216
|
+
return Number.isFinite(n) ? String(n) : 'Infinity';
|
|
217
|
+
})(),
|
|
218
|
+
__CSS_PARSER__: JSON.stringify(values.__CSS_PARSER__),
|
|
219
|
+
__UI_USE_XML_PARSER__: values.__UI_USE_XML_PARSER__,
|
|
220
|
+
__UI_USE_EXTERNAL_RENDERER__: values.__UI_USE_EXTERNAL_RENDERER__,
|
|
221
|
+
// various ecosystems use this global (react for example)
|
|
222
|
+
__TEST__: values.__TEST__,
|
|
21
223
|
// determine if running in CI environment
|
|
22
224
|
__CI__: JSON.stringify(!!opts.isCI),
|
|
23
225
|
__NS_APP_ROOT_DIR__: JSON.stringify(APP_ROOT_DIR),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-defines.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/global-defines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,YAAY,GAAG,iBAAiB,EAAE,CAAC;AACzC,MAAM,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAEpD,MAAM,UA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CAAC,QAAQ;QACzB,yCAAyC;QACzC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACnC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;QACjD,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;QACzD,2FAA2F;QAC3F,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;KACxG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute directories HMR is allowed to react to:
|
|
3
|
+
* - the app source dir (`appPath`, default `src`)
|
|
4
|
+
* - shared-library roots from tsconfig `paths` (monorepo libs)
|
|
5
|
+
*
|
|
6
|
+
* Pass the project's tsconfig data (`{ paths, baseUrl }` from `getTsConfigData`)
|
|
7
|
+
* to include configured workspace libraries. Always includes the app source dir.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getHmrSourceRoots(tsConfig?: {
|
|
10
|
+
paths?: Record<string, string[]>;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}): string[];
|
|
13
|
+
/**
|
|
14
|
+
* True when `file` lives inside one of the HMR source roots (app source dir or a
|
|
15
|
+
* configured shared-library root). Accepts absolute paths with either separator
|
|
16
|
+
* style and strips any query/hash suffix (`…/app.component.ts?ngResource`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function isWithinHmrScope(file: string, roots: string[]): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Minimal glob list for `server.watch.ignored`. This is a *performance* guard,
|
|
21
|
+
* NOT the correctness gate (that's the {@link isWithinHmrScope} allowlist applied
|
|
22
|
+
* in `handleHotUpdate`). It keeps chokidar from walking the large native/generated
|
|
23
|
+
* trees that live under the app root. Vite already ignores `node_modules` and
|
|
24
|
+
* `.git` by default; these are the NativeScript-specific additions.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getHmrWatchIgnoreGlobs(distOutputFolder?: string): string[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Defines which files HMR is allowed to react to; an allowlist driven by the
|
|
2
|
+
// project's own configuration.
|
|
3
|
+
import { getProjectAppAbsolutePath } from './utils.js';
|
|
4
|
+
import { getTsConfigAliasRoots } from './ts-config-paths.js';
|
|
5
|
+
import { normalizeModuleId } from './normalize-id.js';
|
|
6
|
+
// Canonical root form: forward slashes, uppercase Windows drive, no trailing slash.
|
|
7
|
+
function asRoot(p) {
|
|
8
|
+
return normalizeModuleId(String(p || '')).replace(/\/+$/, '');
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Absolute directories HMR is allowed to react to:
|
|
12
|
+
* - the app source dir (`appPath`, default `src`)
|
|
13
|
+
* - shared-library roots from tsconfig `paths` (monorepo libs)
|
|
14
|
+
*
|
|
15
|
+
* Pass the project's tsconfig data (`{ paths, baseUrl }` from `getTsConfigData`)
|
|
16
|
+
* to include configured workspace libraries. Always includes the app source dir.
|
|
17
|
+
*/
|
|
18
|
+
export function getHmrSourceRoots(tsConfig) {
|
|
19
|
+
const roots = new Set();
|
|
20
|
+
const appDir = asRoot(getProjectAppAbsolutePath());
|
|
21
|
+
if (appDir)
|
|
22
|
+
roots.add(appDir);
|
|
23
|
+
for (const aliasRoot of getTsConfigAliasRoots({ paths: tsConfig?.paths, baseUrl: tsConfig?.baseUrl })) {
|
|
24
|
+
const r = asRoot(aliasRoot);
|
|
25
|
+
if (r)
|
|
26
|
+
roots.add(r);
|
|
27
|
+
}
|
|
28
|
+
return [...roots];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* True when `file` lives inside one of the HMR source roots (app source dir or a
|
|
32
|
+
* configured shared-library root). Accepts absolute paths with either separator
|
|
33
|
+
* style and strips any query/hash suffix (`…/app.component.ts?ngResource`).
|
|
34
|
+
*/
|
|
35
|
+
export function isWithinHmrScope(file, roots) {
|
|
36
|
+
if (!file || !roots || roots.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
const f = normalizeModuleId(String(file).replace(/[?#].*$/, ''));
|
|
39
|
+
for (const root of roots) {
|
|
40
|
+
if (!root)
|
|
41
|
+
continue;
|
|
42
|
+
if (f === root || f.startsWith(root + '/'))
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Minimal glob list for `server.watch.ignored`. This is a *performance* guard,
|
|
49
|
+
* NOT the correctness gate (that's the {@link isWithinHmrScope} allowlist applied
|
|
50
|
+
* in `handleHotUpdate`). It keeps chokidar from walking the large native/generated
|
|
51
|
+
* trees that live under the app root. Vite already ignores `node_modules` and
|
|
52
|
+
* `.git` by default; these are the NativeScript-specific additions.
|
|
53
|
+
*/
|
|
54
|
+
export function getHmrWatchIgnoreGlobs(distOutputFolder) {
|
|
55
|
+
const globs = ['**/platforms/**', '**/hooks/**', '**/App_Resources/**', '**/.ns-vite-build/**'];
|
|
56
|
+
if (distOutputFolder) {
|
|
57
|
+
const clean = distOutputFolder
|
|
58
|
+
.replace(/\\/g, '/')
|
|
59
|
+
.replace(/^\.\/+/, '')
|
|
60
|
+
.replace(/\/+$/, '');
|
|
61
|
+
if (clean && clean !== '.ns-vite-build') {
|
|
62
|
+
globs.push(`**/${clean}/**`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return globs;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=hmr-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-scope.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/hmr-scope.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,+BAA+B;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAA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GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;IACzD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,gBAAyB;IAC/D,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IAChG,IAAI,gBAAgB,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,gBAAgB;aAC5B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;aACrB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACtB,IAAI,KAAK,IAAI,KAAK,KAAK,gBAAgB,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/helpers/init.js
CHANGED
|
@@ -4,10 +4,6 @@ import { createRequire } from 'node:module';
|
|
|
4
4
|
import { determineProjectFlavor } from './flavor.js';
|
|
5
5
|
import { getProjectFilePath, getProjectRootPath } from './project.js';
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
|
-
const DEV_DEPS = {
|
|
8
|
-
concurrently: '^9.0.0',
|
|
9
|
-
'wait-on': '^9.0.0',
|
|
10
|
-
};
|
|
11
7
|
const RUNTIME_DEPS = {
|
|
12
8
|
'@valor/nativescript-websockets': '^2.0.2',
|
|
13
9
|
};
|
|
@@ -22,23 +18,10 @@ function writePackageJson(pkg) {
|
|
|
22
18
|
}
|
|
23
19
|
function ensureDependencies(pkg) {
|
|
24
20
|
pkg.dependencies = pkg.dependencies ?? {};
|
|
25
|
-
pkg.devDependencies = pkg.devDependencies ?? {};
|
|
26
|
-
for (const [name, version] of Object.entries(DEV_DEPS)) {
|
|
27
|
-
pkg.devDependencies[name] = version;
|
|
28
|
-
}
|
|
29
21
|
for (const [name, version] of Object.entries(RUNTIME_DEPS)) {
|
|
30
22
|
pkg.dependencies[name] = version;
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
|
-
function ensureScripts(pkg) {
|
|
34
|
-
pkg.scripts = pkg.scripts ?? {};
|
|
35
|
-
pkg.scripts['dev:ios'] = 'concurrently -k -n vite,ns "npm run dev:server:ios" "wait-on tcp:5173 && npm run ios"';
|
|
36
|
-
pkg.scripts['dev:android'] = 'concurrently -k -n vite,ns "npm run dev:server:android" "wait-on tcp:5173 && npm run android"';
|
|
37
|
-
pkg.scripts['dev:server:ios'] = 'vite serve -- --env.ios --env.hmr';
|
|
38
|
-
pkg.scripts['dev:server:android'] = 'vite serve -- --env.android --env.hmr';
|
|
39
|
-
pkg.scripts['ios'] = 'ns debug ios';
|
|
40
|
-
pkg.scripts['android'] = 'ns debug android';
|
|
41
|
-
}
|
|
42
25
|
function ensureGitignore() {
|
|
43
26
|
const root = getProjectRootPath();
|
|
44
27
|
const gitignorePath = path.join(root, '.gitignore');
|
|
@@ -110,7 +93,6 @@ function ensureViteConfig() {
|
|
|
110
93
|
export async function runInit() {
|
|
111
94
|
const pkg = readPackageJson();
|
|
112
95
|
ensureDependencies(pkg);
|
|
113
|
-
ensureScripts(pkg);
|
|
114
96
|
writePackageJson(pkg);
|
|
115
97
|
ensureGitignore();
|
|
116
98
|
ensureViteConfig();
|
package/helpers/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AA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: ResolveOptions): boolean;
|
|
11
11
|
export declare function clearVerboseCache(): void;
|
|
12
12
|
export declare function createFilteredViteLogger(): Logger;
|
|
13
|
+
export declare function shouldSuppressViteWarning(msg: string): boolean;
|
|
13
14
|
export {};
|
package/helpers/logging.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLogger } from 'vite';
|
|
2
|
+
import { getGlobalScope } from '../hmr/shared/runtime/global-scope.js';
|
|
2
3
|
const GLOBAL_VERBOSE_FLAG = '__NS_ENV_VERBOSE__';
|
|
3
4
|
const ENV_VERBOSE_KEYS = ['NS_VITE_VERBOSE', 'NS_ENV_VERBOSE', 'NS_VERBOSE', 'VERBOSE', 'VITE_DEBUG_LOGS', 'DEBUG'];
|
|
4
5
|
let cachedVerbose;
|
|
@@ -37,7 +38,7 @@ export function resolveVerboseFlag(options = {}) {
|
|
|
37
38
|
}
|
|
38
39
|
if (resolved === undefined && options.useGlobalFlag !== false) {
|
|
39
40
|
try {
|
|
40
|
-
const globalVerbose =
|
|
41
|
+
const globalVerbose = getGlobalScope()?.[GLOBAL_VERBOSE_FLAG];
|
|
41
42
|
const coerced = coerceBoolean(globalVerbose);
|
|
42
43
|
if (typeof coerced === 'boolean') {
|
|
43
44
|
resolved = coerced;
|
|
@@ -72,9 +73,19 @@ export function clearVerboseCache() {
|
|
|
72
73
|
// expected given NativeScript's virtual vendor bundling strategy.
|
|
73
74
|
// Currently filters:
|
|
74
75
|
// - Sourcemap missing source files (common in published packages)
|
|
76
|
+
// - Sourcemap source paths that walk outside the published package (the map
|
|
77
|
+
// was generated in a monorepo and still references workspace paths the
|
|
78
|
+
// consumer's node_modules doesn't have)
|
|
79
|
+
// - Sidecar `.js.map` files listed in a `//# sourceMappingURL=` comment that
|
|
80
|
+
// were not published alongside the `.js` file
|
|
75
81
|
// - Eval usage attributed to the virtual "@nativescript/vendor" module
|
|
76
82
|
// - License/annotation position warnings for the vendor bundle
|
|
83
|
+
// - Analog Angular optimizer/router plugins that never emit sourcemaps
|
|
77
84
|
// Extend this list cautiously; prefer documenting each suppression reason.
|
|
85
|
+
//
|
|
86
|
+
// All matching uses `.includes()` (never `.startsWith()`) because Vite wraps
|
|
87
|
+
// some warnings in picocolors ANSI escape sequences before handing them to
|
|
88
|
+
// the logger, which would defeat `startsWith`-style probes on TTY output.
|
|
78
89
|
export function createFilteredViteLogger() {
|
|
79
90
|
const baseLogger = createLogger(undefined, { allowClearScreen: true });
|
|
80
91
|
return {
|
|
@@ -93,9 +104,32 @@ export function createFilteredViteLogger() {
|
|
|
93
104
|
},
|
|
94
105
|
};
|
|
95
106
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
// Exported for unit tests. Keep this function pure so the test suite can
|
|
108
|
+
// exercise every suppression pattern without instantiating a real logger.
|
|
109
|
+
export function shouldSuppressViteWarning(msg) {
|
|
110
|
+
// Missing sourcemap original sources (kept as-is — published packages
|
|
111
|
+
// frequently drop a few `sources[n]` entries during transpile).
|
|
112
|
+
if (msg.includes('Sourcemap for ') && msg.includes('missing source files')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
// Cross-package sourcemap path. Emitted for every `@nativescript/core`
|
|
116
|
+
// file at dev-server startup when the consumer has the published
|
|
117
|
+
// package installed: the shipped `.js.map` still references the
|
|
118
|
+
// original monorepo `packages/core/**` path, which does not exist in
|
|
119
|
+
// the consumer's node_modules. There is nothing we (or the app
|
|
120
|
+
// author) can do about this short of republishing core with relative
|
|
121
|
+
// sources — silently dropping it is correct.
|
|
122
|
+
if (msg.includes('Sourcemap for ') && msg.includes('points to a source file outside its package')) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
// Missing sidecar .js.map file. A couple of community packages
|
|
126
|
+
// (e.g. `@nativescript-community/observable`) ship the `.js` with a
|
|
127
|
+
// `//# sourceMappingURL=foo.js.map` footer but never include the
|
|
128
|
+
// actual map. Vite's sourcemap loader then retries the ENOENT on
|
|
129
|
+
// every request, flooding the terminal. We cannot resolve the
|
|
130
|
+
// missing file, so suppressing the warn-level diagnostic is the
|
|
131
|
+
// least invasive fix.
|
|
132
|
+
if (msg.includes('Failed to load source map for')) {
|
|
99
133
|
return true;
|
|
100
134
|
}
|
|
101
135
|
// Vendor eval usage (third-party libs aggregated); benign
|
|
@@ -110,6 +144,33 @@ function shouldSuppressViteWarning(msg) {
|
|
|
110
144
|
if (msg.includes('Sourcemap is likely to be incorrect') && (msg.includes('analogjs-router-optimization') || msg.includes('@analogjs/vite-plugin-angular-optimizer'))) {
|
|
111
145
|
return true;
|
|
112
146
|
}
|
|
147
|
+
// "contains Angular decorators but is not in the TypeScript program."
|
|
148
|
+
//
|
|
149
|
+
// Emitted by `@analogjs/vite-plugin-angular` for any `.ts` file that
|
|
150
|
+
// has an Angular decorator (`@Injectable`, `@Component`, etc.) but
|
|
151
|
+
// isn't reachable from Angular's tsconfig program — typically because
|
|
152
|
+
// the file is dynamically imported, lives outside `tsconfig.app.json`'s
|
|
153
|
+
// `include` glob, or is loaded via a non-Angular code path
|
|
154
|
+
// (e.g. `import('./service.ts')` inside a Vite-only utility).
|
|
155
|
+
//
|
|
156
|
+
// In practice these files compile fine via our `tsFallbackTransformPlugin`
|
|
157
|
+
// (which type-strips them through Vite's oxc transformer at request
|
|
158
|
+
// time, see `helpers/workers.ts`'s ANGULAR_DECORATOR_RE skip-guard for
|
|
159
|
+
// the matching policy). Decorator metadata isn't generated for them
|
|
160
|
+
// because they're not in the Angular program — but that's exactly the
|
|
161
|
+
// expected outcome for files that don't need DI or template binding.
|
|
162
|
+
//
|
|
163
|
+
// The warning appears once per offending file at every cold boot of
|
|
164
|
+
// the dev server (50+ lines for a real app), drowning out signal
|
|
165
|
+
// without ever pointing at an actionable problem. Suppressing it
|
|
166
|
+
// matches the working contract `tsFallbackTransformPlugin`
|
|
167
|
+
// established. If a user actually does intend a file to be in the
|
|
168
|
+
// Angular program, they'll notice via Angular's own runtime errors
|
|
169
|
+
// (missing providers, unresolved templates) — which we never
|
|
170
|
+
// suppress.
|
|
171
|
+
if (msg.includes('@analogjs/vite-plugin-angular') && msg.includes('contains Angular decorators but is not in the TypeScript program')) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
113
174
|
return false;
|
|
114
175
|
}
|
|
115
176
|
//# sourceMappingURL=logging.js.map
|
package/helpers/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAYpH,IAAI,aAAkC,CAAC;AAEvC,SAAS,aAAa,CAAC,KAAgB;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,KAAK,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAC;QAClC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EA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ResolvedConfig, type ViteDevServer } from 'vite';
|
|
2
2
|
export declare function mainEntryPlugin(opts: {
|
|
3
3
|
platform: 'ios' | 'android' | 'visionos';
|
|
4
4
|
isDevMode: boolean;
|
|
5
5
|
verbose: boolean;
|
|
6
6
|
hmrActive: boolean;
|
|
7
7
|
useHttps: boolean;
|
|
8
|
+
flavor?: string;
|
|
8
9
|
}): {
|
|
9
10
|
name: string;
|
|
10
11
|
configResolved(config: ResolvedConfig): void;
|
|
12
|
+
configureServer(server: ViteDevServer): void;
|
|
11
13
|
resolveId(id: string): string;
|
|
12
14
|
load(id: string): Promise<{
|
|
13
15
|
code: string;
|