@nativescript/vite 8.0.0-alpha.9 → 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 +34 -1
- package/configuration/angular.js +196 -217
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +151 -103
- 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 +11 -92
- 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/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 +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/flavor.d.ts +13 -0
- package/helpers/flavor.js +18 -1
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +99 -33
- package/helpers/global-defines.js +187 -66
- 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 +6 -20
- package/helpers/init.js.map +1 -1
- package/helpers/logging.js +29 -1
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +293 -40
- 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 +37 -7
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.js +8 -3
- 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 +26 -3
- package/helpers/ns-core-url.js +66 -8
- 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/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 +143 -62
- 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 +33 -0
- package/helpers/workers.js +237 -10
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +63 -32
- 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 +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -11
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- 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 +70 -1970
- 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 +9 -1
- package/hmr/client/utils.js +117 -97
- 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 +2 -1
- package/hmr/entry-runtime.js +279 -44
- 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/{helpers/angular → hmr/frameworks/angular/build}/inject-component-hmr-registration.js +2 -70
- 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/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.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/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/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 +0 -1
- package/hmr/frameworks/angular/client/index.js +360 -194
- 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/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 +668 -13
- 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 +27 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +179 -107
- 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 +40 -14
- 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 +270 -521
- 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 +109 -14
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- 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.js +7 -1
- 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 +86 -7
- package/hmr/server/core-sanitize.js +155 -37
- 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 +57 -23
- package/hmr/server/import-map.js +142 -70
- 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/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-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 +1 -1
- package/hmr/server/perf-instrumentation.js +3 -1
- package/hmr/server/perf-instrumentation.js.map +1 -1
- 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.js +8 -1
- package/hmr/server/runtime-graph-filter.js.map +1 -1
- 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.js +1 -2
- package/hmr/server/shared-transform-request.js.map +1 -1
- 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 +1 -0
- package/hmr/server/vite-plugin.js +211 -53
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +51 -4
- package/hmr/server/websocket-core-bridge.js +62 -49
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- 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-hmr-pending.d.ts +2 -16
- package/hmr/server/websocket-hmr-pending.js +0 -22
- package/hmr/server/websocket-hmr-pending.js.map +1 -1
- 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 +15 -0
- package/hmr/server/websocket-module-bindings.js +36 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +0 -5
- package/hmr/server/websocket-module-specifiers.js +29 -30
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- 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 -3
- package/hmr/server/websocket-ns-m-paths.js +98 -75
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +2 -1
- package/hmr/server/websocket-ns-m-request.js +3 -2
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- 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 +56 -3
- package/hmr/server/websocket-served-module-helpers.js +444 -140
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +6 -9
- 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 +7 -40
- package/hmr/server/websocket.js +661 -6751
- 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/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 +1 -1
- package/hmr/shared/runtime/boot-timeline.js +8 -19
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +58 -25
- package/hmr/shared/runtime/browser-runtime-contract.js +21 -9
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- 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 +23 -69
- package/hmr/shared/runtime/dev-overlay.js +67 -1011
- 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/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.js +3 -2
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- 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/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 +382 -157
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +209 -54
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +2 -1
- 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 +10 -35
- package/hmr/shared/vendor/manifest.js +154 -978
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +14 -0
- 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/package.json +63 -13
- package/runtime/core-aliases-early.js +11 -16
- 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/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -185
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inject-component-hmr-registration.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.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 -114
- 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.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 -287
- 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 -1069
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -2
- package/hmr/shared/runtime/http-only-boot.js +0 -171
- 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
- /package/{helpers/angular → hmr/frameworks/angular/build}/inject-component-hmr-registration.d.ts +0 -0
- /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/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/util.js +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { mergeConfig } from 'vite';
|
|
2
|
-
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
2
|
import { baseConfig } from './base.js';
|
|
5
|
-
import {
|
|
3
|
+
import { resolvePlatform } from '../helpers/cli-flags.js';
|
|
6
4
|
import { getProjectAppPath } from '../helpers/utils.js';
|
|
5
|
+
import { createXmlLoaderPlugin, shouldExcludePlatformFile, toContextImportSpecifier, walkAppFiles } from '../helpers/bundler-context.js';
|
|
7
6
|
/**
|
|
8
7
|
* Registers bundler modules for plain JavaScript apps (no .ts files),
|
|
9
8
|
* mimicking webpack's require.context used by NativeScript's XML builder.
|
|
@@ -13,9 +12,7 @@ import { getProjectAppPath } from '../helpers/utils.js';
|
|
|
13
12
|
function createBundlerContextPlugin() {
|
|
14
13
|
const VIRTUAL_ID = 'virtual:ns-bundler-context';
|
|
15
14
|
const RESOLVED_ID = '\0' + VIRTUAL_ID;
|
|
16
|
-
const
|
|
17
|
-
const flags = getCliFlags();
|
|
18
|
-
const platform = flags.android ? 'android' : flags.ios ? 'ios' : flags.visionos ? 'visionos' : undefined;
|
|
15
|
+
const platform = resolvePlatform();
|
|
19
16
|
const appRoot = getProjectAppPath();
|
|
20
17
|
const appRootPrefix = `${appRoot}/`;
|
|
21
18
|
return {
|
|
@@ -30,56 +27,9 @@ function createBundlerContextPlugin() {
|
|
|
30
27
|
if (id !== RESOLVED_ID)
|
|
31
28
|
return null;
|
|
32
29
|
// Build a platform-filtered static module registry at build time using recursive fs walk (no fast-glob dependency).
|
|
33
|
-
const roots = [appRoot];
|
|
34
30
|
const styleExtsSet = new Set(['css', 'scss', 'less', 'sass']);
|
|
35
|
-
function walk(dir, out) {
|
|
36
|
-
let entries = [];
|
|
37
|
-
try {
|
|
38
|
-
entries = readdirSync(dir);
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return out;
|
|
42
|
-
}
|
|
43
|
-
for (const entry of entries) {
|
|
44
|
-
const full = path.posix.join(dir, entry);
|
|
45
|
-
let st;
|
|
46
|
-
try {
|
|
47
|
-
st = statSync(full);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (st.isDirectory())
|
|
53
|
-
walk(full, out);
|
|
54
|
-
else
|
|
55
|
-
out.push(full);
|
|
56
|
-
}
|
|
57
|
-
return out;
|
|
58
|
-
}
|
|
59
31
|
function enumerate(filter) {
|
|
60
|
-
|
|
61
|
-
for (const r of roots)
|
|
62
|
-
walk(r, files);
|
|
63
|
-
return files.filter((f) => filter(f.split('.').pop() || ''));
|
|
64
|
-
}
|
|
65
|
-
function shouldExcludeAbsolute(p) {
|
|
66
|
-
const file = p.split('/').pop() || '';
|
|
67
|
-
if (file.startsWith('_'))
|
|
68
|
-
return true;
|
|
69
|
-
if (/\.d\.ts$/.test(p))
|
|
70
|
-
return true;
|
|
71
|
-
if (/([.-]worker)\.(ts|js)$/.test(file))
|
|
72
|
-
return true;
|
|
73
|
-
const isAndroidTagged = /\.android\./.test(p);
|
|
74
|
-
const isIosTagged = /\.ios\./.test(p) || /\.visionos\./.test(p);
|
|
75
|
-
if (platform === 'android' && isIosTagged)
|
|
76
|
-
return true;
|
|
77
|
-
if ((platform === 'ios' || platform === 'visionos') && isAndroidTagged)
|
|
78
|
-
return true;
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
function toImportSpecifier(abs) {
|
|
82
|
-
return '/' + abs.replace(/^\/+/, '');
|
|
32
|
+
return walkAppFiles(appRoot).filter((f) => filter(f.split('.').pop() || ''));
|
|
83
33
|
}
|
|
84
34
|
function toCtxKey(abs) {
|
|
85
35
|
let rel = abs;
|
|
@@ -87,12 +37,14 @@ function createBundlerContextPlugin() {
|
|
|
87
37
|
rel = rel.slice(appRootPrefix.length);
|
|
88
38
|
return './' + rel;
|
|
89
39
|
}
|
|
40
|
+
const shouldExcludeAbsolute = (p) => shouldExcludePlatformFile(p, platform);
|
|
41
|
+
const toImportSpecifier = toContextImportSpecifier;
|
|
90
42
|
const xmlFiles = enumerate((ext) => ext === 'xml').filter((f) => !shouldExcludeAbsolute(f));
|
|
91
43
|
const styleFiles = enumerate((ext) => styleExtsSet.has(ext)).filter((f) => !shouldExcludeAbsolute(f));
|
|
92
44
|
const jsFiles = enumerate((ext) => ext === 'js').filter((f) => !shouldExcludeAbsolute(f));
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
45
|
+
const importLines = [];
|
|
46
|
+
const registryEntries = [];
|
|
47
|
+
const moduleMapLines = [];
|
|
96
48
|
let index = 0;
|
|
97
49
|
function pushImport(abs, raw) {
|
|
98
50
|
const id = `__m${index++}`;
|
|
@@ -108,45 +60,14 @@ function createBundlerContextPlugin() {
|
|
|
108
60
|
const code = `// Generated virtual bundler context (platform=${platform || 'unknown'})\n${importLines.join('\n')}\n(function(){\n const registry = new Map();\n const all = {};\n ${moduleMapLines.join('\n ')}\n ${registryEntries.join('\n ')}\n function context(key){\n const real = registry.get(key);\n if(!real) throw new Error('[ns-vite] Module not found in context: '+key);\n return all[real];\n }\n context.keys = function(){ return Array.from(registry.keys()); };\n const g = (typeof globalThis !== 'undefined' ? globalThis : (typeof global !== 'undefined' ? global : {}));\n if(g && typeof g.registerBundlerModules === 'function'){ g.registerBundlerModules(context); } else { setTimeout(()=>{ try { g.registerBundlerModules && g.registerBundlerModules(context); } catch{} },0); }\n})();`;
|
|
109
61
|
return { code, map: null };
|
|
110
62
|
},
|
|
111
|
-
transform(code, id) {
|
|
112
|
-
// Inject our registration immediately after bundle-entry-points import
|
|
113
|
-
if (id === ENTRY_ID || id.endsWith('virtual:entry-with-polyfills')) {
|
|
114
|
-
const marker = "import '@nativescript/core/bundle-entry-points';";
|
|
115
|
-
if (code.includes(marker)) {
|
|
116
|
-
return {
|
|
117
|
-
code: code.replace(marker, `${marker}\n// Ensure style system is initialized before any UI component modules register CSS properties\nimport '@nativescript/core/ui/styling/style';\nimport '@nativescript/core/ui/styling/style-properties';\nimport 'virtual:ns-bundler-context';\n// Patch CSS accessors to be resilient to early default initializations before style exists\n(function(){\n try {\n const __ui = (global.loadModule ? global.loadModule('@nativescript/core/ui') : (global.require ? global.require('@nativescript/core/ui') : null));\n if (__ui && __ui.View) {\n const View = __ui.View;\n const props = ['order','flexGrow','flexShrink','flexWrapBefore','alignSelf'];\n for (const p of props) {\n const d = Object.getOwnPropertyDescriptor(View.prototype, p);\n if (d && typeof d.set === 'function') {\n const origSet = d.set;\n Object.defineProperty(View.prototype, p, {\n configurable: true,\n enumerable: d.enumerable,\n get: d.get,\n set(value){\n if (value === undefined || value === null) return;\n if (!this || !this._style) {\n try { if (this && !this._style) this._style = this.style; } catch(_) {}\n if (!this || !this._style) return;\n }\n return origSet.call(this, value);\n }\n });\n }\n }\n }\n } catch(_) {}\n})();\n// Vite adjustment: register short core UI element module names (e.g. Frame, StackLayout)\n// Some XML builder paths attempt to load 'Frame' directly instead of the barrel.\n// We expose individual element names so global.loadModule('Frame') works.\ntry {\n const __ui = (global.loadModule ? global.loadModule('@nativescript/core/ui') : (global.require ? global.require('@nativescript/core/ui') : null));\n if (__ui && global.registerModule) {\n const existsFn = global.moduleExists ? (n) => global.moduleExists(n) : () => false;\n Object.keys(__ui).forEach(k => {\n if (k && k[0] === k[0].toUpperCase() && !existsFn(k)) {\n try {\n global.registerModule(k, () => ({ [k]: __ui[k] }));\n } catch (e) { /* swallow */ }\n }\n });\n }\n} catch(e) { /* ignore */ }\n`),
|
|
118
|
-
map: null,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return null;
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function createXmlLoaderPlugin() {
|
|
127
|
-
return {
|
|
128
|
-
name: 'ns-xml-loader-js',
|
|
129
|
-
enforce: 'pre',
|
|
130
|
-
load(id) {
|
|
131
|
-
if (!id.endsWith('.xml'))
|
|
132
|
-
return null;
|
|
133
|
-
try {
|
|
134
|
-
const src = readFileSync(id, 'utf-8');
|
|
135
|
-
const xml = JSON.stringify(src)
|
|
136
|
-
.replace(/\u2028/g, '\\u2028')
|
|
137
|
-
.replace(/\u2029/g, '\\u2029');
|
|
138
|
-
const code = `const ___XML___ = ${xml};\nexport default ___XML___;`;
|
|
139
|
-
return { code, map: null };
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
63
|
};
|
|
146
64
|
}
|
|
147
65
|
export const javascriptConfig = ({ mode }) => {
|
|
148
|
-
|
|
149
|
-
|
|
66
|
+
// Declare the flavor explicitly (like every other config) so baseConfig's
|
|
67
|
+
// flavor — which gates the virtual:ns-ui-registration plugin paired with
|
|
68
|
+
// the entry's import emission — never depends on deps-based detection.
|
|
69
|
+
return mergeConfig(baseConfig({ mode, flavor: 'javascript' }), {
|
|
70
|
+
plugins: [createXmlLoaderPlugin('ns-xml-loader-js'), createBundlerContextPlugin()],
|
|
150
71
|
});
|
|
151
72
|
};
|
|
152
73
|
//# sourceMappingURL=javascript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascript.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/javascript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgC,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"javascript.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/javascript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgC,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAwB,qBAAqB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE/J;;;;;GAKG;AACH,SAAS,0BAA0B;IAClC,MAAM,UAAU,GAAG,4BAA4B,CAAC;IAChD,MAAM,WAAW,GAAG,IAAI,GAAG,UAAU,CAAC;IACtC,MAAM,QAAQ,GAAoB,eAAe,EAAE,CAAC;IACpD,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IACpC,MAAM,aAAa,GAAG,GAAG,OAAO,GAAG,CAAC;IAEpC,OAAO;QACN,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,KAAK;QACd,SAAS,CAAC,EAAE;YACX,IAAI,EAAE,KAAK,UAAU;gBAAE,OAAO,WAAW,CAAC;YAC1C,OAAO,IAAI,CAAC;QACb,CAAC;QACD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AE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YAC/C,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YAC7C,MAAM,IAAI,GAAG,kDAAkD,QAAQ,IAAI,SAAS,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,uEAAuE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,ujBAAujB,CAAC;YAC7yB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAS,CAAC;QACnC,CAAC;KACD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,EAAc,EAAE;IACxD,0EAA0E;IAC1E,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE;QAC9D,OAAO,EAAE,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,CAAC;KAClF,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/configuration/react.js
CHANGED
|
@@ -6,82 +6,50 @@ import { baseConfig } from './base.js';
|
|
|
6
6
|
import { getTypeCheckPlugins } from '../helpers/typescript-check.js';
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
8
|
const __dirname = dirname(__filename);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
// NativeScript-safe automatic-JSX runtime shim (see shims/react-jsx-runtime.ts).
|
|
10
|
+
// react/jsx-runtime + react/jsx-dev-runtime are CJS modules whose named exports
|
|
11
|
+
// the dev server's raw `/ns/m` serving can't statically detect, so the device
|
|
12
|
+
// fails with "does not provide an export named 'jsx'". The shim reimplements the
|
|
13
|
+
// runtime on React.createElement and exposes explicit named exports.
|
|
14
|
+
const jsxRuntimeShimPath = resolve(dirname(__dirname), 'shims', 'react-jsx-runtime.js');
|
|
15
|
+
// React for NativeScript renders through DOMiNATIVE via the
|
|
16
|
+
// `@nativescript-community/react` renderer (a react-reconciler host config that
|
|
17
|
+
// drives dominative's DOM — the React analog of `@nativescript-community/solid-js`).
|
|
18
|
+
// So, unlike the native-element `react-nativescript` path, there is NO
|
|
19
|
+
// `react-dom -> react-nativescript` aliasing here: the web markup renders as-is
|
|
20
|
+
// through dominative + masonkit, exactly like the Solid flavor.
|
|
21
|
+
//
|
|
22
|
+
// `react` must resolve as a single instance (see the `case 'react'` note in
|
|
23
|
+
// base.ts → `disableOptimizeDeps`): two copies would split the hooks dispatcher
|
|
24
|
+
// and silently break hooks/context.
|
|
25
|
+
export const reactConfig = ({ mode }, options = {}) => {
|
|
26
|
+
return mergeConfig(baseConfig({ mode, flavor: 'react' }), {
|
|
27
|
+
plugins: [
|
|
28
|
+
...getTypeCheckPlugins('react', options.typeCheck),
|
|
29
|
+
{
|
|
30
|
+
...alias({
|
|
31
|
+
entries: {
|
|
32
|
+
// Automatic JSX runtime → NS-safe shim (must come before any
|
|
33
|
+
// broad `react` entry so it isn't prefix-matched away).
|
|
34
|
+
'react/jsx-runtime': jsxRuntimeShimPath,
|
|
35
|
+
'react/jsx-dev-runtime': jsxRuntimeShimPath,
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
enforce: 'pre',
|
|
27
39
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
name: 'react-nativescript-resolver',
|
|
33
|
-
resolveId(id) {
|
|
34
|
-
// Ensure React core exports are properly resolved
|
|
35
|
-
if (id === 'react') {
|
|
36
|
-
return { id: 'react', external: false };
|
|
37
|
-
}
|
|
40
|
+
],
|
|
41
|
+
esbuild: {
|
|
42
|
+
jsx: 'automatic',
|
|
43
|
+
jsxImportSource: 'react',
|
|
38
44
|
},
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// Explicitly export the commonly used React APIs
|
|
47
|
-
export const {
|
|
48
|
-
Component,
|
|
49
|
-
PureComponent,
|
|
50
|
-
Fragment,
|
|
51
|
-
createElement,
|
|
52
|
-
createRef,
|
|
53
|
-
forwardRef,
|
|
54
|
-
useState,
|
|
55
|
-
useEffect,
|
|
56
|
-
useContext,
|
|
57
|
-
useReducer,
|
|
58
|
-
useCallback,
|
|
59
|
-
useMemo,
|
|
60
|
-
useRef,
|
|
61
|
-
useImperativeHandle,
|
|
62
|
-
useLayoutEffect,
|
|
63
|
-
useDebugValue,
|
|
64
|
-
createContext,
|
|
65
|
-
Children,
|
|
66
|
-
cloneElement,
|
|
67
|
-
isValidElement,
|
|
68
|
-
version,
|
|
69
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
70
|
-
} = React;
|
|
71
|
-
|
|
72
|
-
// Export everything else
|
|
73
|
-
export * from 'react/index.js';
|
|
74
|
-
|
|
75
|
-
// Default export
|
|
76
|
-
export default React;
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
45
|
+
optimizeDeps: {
|
|
46
|
+
// `module` / `node:module` are aliased to local polyfills (see base.ts);
|
|
47
|
+
// keep them out of the depscanner. Also exclude the renderer entry so the
|
|
48
|
+
// device's `/ns/m` loader resolves it through normal resolution rather
|
|
49
|
+
// than a pre-bundle URL that the package `exports` map can't serve there
|
|
50
|
+
// (mirrors Solid excluding `@nativescript/vite/solid-bootstrap`).
|
|
51
|
+
exclude: ['module', 'node:module', '@nativescript-community/react'],
|
|
79
52
|
},
|
|
80
|
-
},
|
|
81
|
-
];
|
|
82
|
-
export const reactConfig = ({ mode }, options = {}) => {
|
|
83
|
-
return mergeConfig(baseConfig({ mode, flavor: 'react' }), {
|
|
84
|
-
plugins: [...getTypeCheckPlugins('react', options.typeCheck), ...plugins],
|
|
85
53
|
});
|
|
86
54
|
};
|
|
87
55
|
//# sourceMappingURL=react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAmB,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAgC,MAAM,gCAAgC,CAAC;AAEnG,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAmB,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAgC,MAAM,gCAAgC,CAAC;AAEnG,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,iFAAiF;AACjF,qEAAqE;AACrE,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,sBAAsB,CAAC,CAAC;AAExF,4DAA4D;AAC5D,gFAAgF;AAChF,qFAAqF;AACrF,uEAAuE;AACvE,gFAAgF;AAChF,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,oCAAoC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,UAAmC,EAAE,EAAc,EAAE;IAC1F,OAAO,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE;QACzD,OAAO,EAAE;YACR,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;YAClD;gBACC,GAAG,KAAK,CAAC;oBACR,OAAO,EAAE;wBACR,6DAA6D;wBAC7D,wDAAwD;wBACxD,mBAAmB,EAAE,kBAAkB;wBACvC,uBAAuB,EAAE,kBAAkB;qBAC3C;iBACD,CAAC;gBACF,OAAO,EAAE,KAAc;aACvB;SACD;QACD,OAAO,EAAE;YACR,GAAG,EAAE,WAAW;YAChB,eAAe,EAAE,OAAO;SACxB;QACD,YAAY,EAAE;YACb,yEAAyE;YACzE,0EAA0E;YAC1E,uEAAuE;YACvE,yEAAyE;YACzE,kEAAkE;YAClE,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,+BAA+B,CAAC;SACnE;KACD,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
package/configuration/solid.js
CHANGED
|
@@ -3,19 +3,22 @@ import path from 'path';
|
|
|
3
3
|
import alias from '@rollup/plugin-alias';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { dirname, resolve } from 'node:path';
|
|
6
|
-
import { getProjectRootPath } from '../helpers/project.js';
|
|
6
|
+
import { findMonorepoWorkspaceRoot, getProjectRootPath } from '../helpers/project.js';
|
|
7
7
|
import { mergeConfig } from 'vite';
|
|
8
8
|
import { baseConfig } from './base.js';
|
|
9
9
|
import { getTypeCheckPlugins } from '../helpers/typescript-check.js';
|
|
10
|
+
import { findSolidPackagesShippingJsx } from '../hmr/frameworks/solid/build/solid-jsx-deps.js';
|
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
12
|
const __dirname = dirname(__filename);
|
|
12
13
|
const projectRoot = getProjectRootPath();
|
|
13
14
|
const solidPath = path.resolve(projectRoot, 'node_modules/solid-js');
|
|
14
|
-
const prod = !!process.env.production;
|
|
15
15
|
// Built-in JSX runtime shim — maps automatic JSX transform's jsx() to
|
|
16
16
|
// Solid's createComponent() without pulling in the web renderer (solid-js/h).
|
|
17
17
|
const jsxRuntimeShimPath = resolve(dirname(__dirname), 'shims', 'solid-jsx-runtime.js');
|
|
18
|
-
|
|
18
|
+
// Build the Solid plugin stack for a given build kind. `prod` is derived from
|
|
19
|
+
// Vite's `mode` inside the factory (NOT a non-standard `process.env.production`),
|
|
20
|
+
// so a production build resolves Solid's prod bundles and disables dev/hot.
|
|
21
|
+
const buildSolidPlugins = (prod) => [
|
|
19
22
|
{
|
|
20
23
|
...alias({
|
|
21
24
|
entries: {
|
|
@@ -37,8 +40,18 @@ const plugins = [
|
|
|
37
40
|
solid({
|
|
38
41
|
// Configure for development
|
|
39
42
|
dev: !prod,
|
|
40
|
-
//
|
|
41
|
-
|
|
43
|
+
// solid-refresh's `import.meta.hot`-based component HMR is intentionally
|
|
44
|
+
// left OFF. NativeScript drives HMR through its own dev-server runtime,
|
|
45
|
+
// and solid-refresh additionally rewrites `export function Foo()` into a
|
|
46
|
+
// non-hoisted `export const Foo = _$$component(...)`. That breaks the
|
|
47
|
+
// canonical TanStack Router file-route pattern —
|
|
48
|
+
// `export const Route = createFileRoute('/')({ component: App })`
|
|
49
|
+
// declared above `function App() {}` — which then throws
|
|
50
|
+
// "Cannot access 'App' before initialization" (a TDZ error) during module
|
|
51
|
+
// evaluation and aborts the dev session. Solid dev mode (`dev`) stays on
|
|
52
|
+
// for reactivity warnings; module-level HMR still works via the
|
|
53
|
+
// NativeScript runtime.
|
|
54
|
+
hot: false,
|
|
42
55
|
// Configure solid compiler options for NativeScript
|
|
43
56
|
solid: {
|
|
44
57
|
// Use universal instead of dom for NativeScript compatibility
|
|
@@ -50,8 +63,40 @@ const plugins = [
|
|
|
50
63
|
}),
|
|
51
64
|
];
|
|
52
65
|
export const solidConfig = ({ mode }, options = {}) => {
|
|
66
|
+
const prod = mode !== 'development';
|
|
67
|
+
const projectRoot = getProjectRootPath();
|
|
68
|
+
const monorepoRoot = findMonorepoWorkspaceRoot(projectRoot);
|
|
69
|
+
// Any Solid library that ships `.jsx`/`.tsx` files in its published
|
|
70
|
+
// output (e.g. `solid-navigation`'s `dist/src/*.jsx`) MUST bypass
|
|
71
|
+
// Vite's depscanner. The depscanner concatenates the package into
|
|
72
|
+
// `node_modules/.vite/deps/<pkg>.js` with the JSX preserved, then
|
|
73
|
+
// `vite:import-analysis` hits the first JSX expression and aborts the
|
|
74
|
+
// dev server with `Failed to parse source for import analysis…`. The
|
|
75
|
+
// `vite-plugin-solid` `transform` hook only runs on ids ending in
|
|
76
|
+
// `.jsx`/`.tsx`, so it never sees the pre-bundled `.js` to fix it.
|
|
77
|
+
// Excluding these packages routes them through the normal serve
|
|
78
|
+
// pipeline, where the original `.jsx` ids match the Solid plugin's
|
|
79
|
+
// filter. See `hmr/frameworks/solid/build/solid-jsx-deps.ts` for the detection rules.
|
|
80
|
+
const solidJsxPackages = findSolidPackagesShippingJsx(projectRoot, monorepoRoot);
|
|
53
81
|
return mergeConfig(baseConfig({ mode, flavor: 'solid' }), {
|
|
54
|
-
plugins: [...getTypeCheckPlugins('solid', options.typeCheck), ...
|
|
82
|
+
plugins: [...getTypeCheckPlugins('solid', options.typeCheck), ...buildSolidPlugins(prod)],
|
|
83
|
+
optimizeDeps: {
|
|
84
|
+
// Defense-in-depth: keep `module` / `node:module` out of the
|
|
85
|
+
// depscanner's pre-bundle set even if a downstream config swaps
|
|
86
|
+
// out the base `optimizeDeps.exclude`. The root rationale (and the
|
|
87
|
+
// canonical exclude list) lives in `configuration/base.ts`; see
|
|
88
|
+
// the comment above `optimizeDepsExclude` there for the full
|
|
89
|
+
// css-tree → createRequire → HMR rewrite chain that necessitates
|
|
90
|
+
// this. Vite's `mergeConfig` concatenates `exclude` arrays, so
|
|
91
|
+
// duplicating these here is harmless.
|
|
92
|
+
//
|
|
93
|
+
// Also exclude our own Solid HMR runtime helper. If the depscanner
|
|
94
|
+
// pre-bundles `@nativescript/vite/solid-bootstrap`, the device's /ns/m
|
|
95
|
+
// loader serves the bare specifier (which the package `exports`
|
|
96
|
+
// subpath map doesn't resolve there) and 404s. Excluding it routes
|
|
97
|
+
// the import through normal resolution → the real file is served.
|
|
98
|
+
exclude: ['module', 'node:module', '@nativescript/vite/solid-bootstrap', ...solidJsxPackages],
|
|
99
|
+
},
|
|
55
100
|
});
|
|
56
101
|
};
|
|
57
102
|
//# sourceMappingURL=solid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/solid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"solid.js","sourceRoot":"","sources":["../../../../packages/v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E,kEAAkE;IAClE,mEAAmE;IACnE,gEAAgE;IAChE,mEAAmE;IACnE,sFAAsF;IACtF,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACjF,OAAO,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE;QACzD,OAAO,EAAE,CAAC,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACzF,YAAY,EAAE;YACb,6DAA6D;YAC7D,gEAAgE;YAChE,mEAAmE;YACnE,gEAAgE;YAChE,6DAA6D;YAC7D,iEAAiE;YACjE,+DAA+D;YAC/D,sCAAsC;YACtC,EAAE;YACF,mEAAmE;YACnE,uEAAuE;YACvE,gEAAgE;YAChE,mEAAmE;YACnE,kEAAkE;YAClE,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,oCAAoC,EAAE,GAAG,gBAAgB,CAAC;SAC7F;KACD,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { mergeConfig } from 'vite';
|
|
2
|
-
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { baseConfig } from './base.js';
|
|
5
|
-
import {
|
|
4
|
+
import { resolvePlatform } from '../helpers/cli-flags.js';
|
|
6
5
|
import { getPackageJson, getProjectFilePath, getProjectRootPath } from '../helpers/project.js';
|
|
7
6
|
import { getProjectAppPath } from '../helpers/utils.js';
|
|
8
7
|
import { getTypeCheckPlugins } from '../helpers/typescript-check.js';
|
|
8
|
+
import { createXmlLoaderPlugin, shouldExcludePlatformFile, toContextImportSpecifier, walkAppFiles } from '../helpers/bundler-context.js';
|
|
9
9
|
/**
|
|
10
10
|
* TypeScript + XML NativeScript Vite configuration.
|
|
11
11
|
* Adds a virtual require.context style registry (xml, js, ts, css, scss) similar to webpack5.
|
|
@@ -14,8 +14,7 @@ import { getTypeCheckPlugins } from '../helpers/typescript-check.js';
|
|
|
14
14
|
function createBundlerContextPlugin() {
|
|
15
15
|
const VIRTUAL_ID = 'virtual:ns-bundler-context';
|
|
16
16
|
const RESOLVED_ID = '\0' + VIRTUAL_ID;
|
|
17
|
-
const
|
|
18
|
-
const platform = flags.android ? 'android' : flags.ios ? 'ios' : flags.visionos ? 'visionos' : undefined;
|
|
17
|
+
const platform = resolvePlatform();
|
|
19
18
|
// Determine the app's declared main entry to avoid eagerly importing it (which would execute Application.run too early)
|
|
20
19
|
const projectRoot = getProjectRootPath();
|
|
21
20
|
const pkg = getPackageJson();
|
|
@@ -41,56 +40,7 @@ function createBundlerContextPlugin() {
|
|
|
41
40
|
return null;
|
|
42
41
|
// Build platform-filtered static module registry similar to webpack's require.context.
|
|
43
42
|
// Generic: only XML, styles and their paired code-behind files. Test/app specific additions belong in app vite.config.ts.
|
|
44
|
-
const
|
|
45
|
-
function walk(dir, out) {
|
|
46
|
-
let entries = [];
|
|
47
|
-
try {
|
|
48
|
-
entries = readdirSync(dir);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return out;
|
|
52
|
-
}
|
|
53
|
-
for (const entry of entries) {
|
|
54
|
-
const full = path.posix.join(dir, entry);
|
|
55
|
-
let st;
|
|
56
|
-
try {
|
|
57
|
-
st = statSync(full);
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
if (st.isDirectory())
|
|
63
|
-
walk(full, out);
|
|
64
|
-
else
|
|
65
|
-
out.push(full);
|
|
66
|
-
}
|
|
67
|
-
return out;
|
|
68
|
-
}
|
|
69
|
-
function listAll() {
|
|
70
|
-
const files = [];
|
|
71
|
-
for (const r of roots)
|
|
72
|
-
walk(r, files);
|
|
73
|
-
return files;
|
|
74
|
-
}
|
|
75
|
-
function shouldExcludeAbsolute(p) {
|
|
76
|
-
const file = p.split('/').pop() || '';
|
|
77
|
-
if (file.startsWith('_'))
|
|
78
|
-
return true;
|
|
79
|
-
if (/\.d\.ts$/.test(p))
|
|
80
|
-
return true;
|
|
81
|
-
if (/([.-]worker)\.(ts|js)$/.test(file))
|
|
82
|
-
return true;
|
|
83
|
-
const isAndroidTagged = /\.android\./.test(p);
|
|
84
|
-
const isIosTagged = /\.ios\./.test(p) || /\.visionos\./.test(p);
|
|
85
|
-
if (platform === 'android' && isIosTagged)
|
|
86
|
-
return true;
|
|
87
|
-
if (['ios', 'visionos'].includes(platform) && isAndroidTagged)
|
|
88
|
-
return true;
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
function toImportSpecifier(abs) {
|
|
92
|
-
return '/' + abs.replace(/^\/+/, '');
|
|
93
|
-
}
|
|
43
|
+
const toImportSpecifier = toContextImportSpecifier;
|
|
94
44
|
function toCtxKey(abs) {
|
|
95
45
|
let rel = abs;
|
|
96
46
|
if (rel.startsWith(appRootPrefix))
|
|
@@ -99,7 +49,7 @@ function createBundlerContextPlugin() {
|
|
|
99
49
|
rel = rel.slice('packages/core/src/'.length);
|
|
100
50
|
return './' + rel;
|
|
101
51
|
}
|
|
102
|
-
const allFiles =
|
|
52
|
+
const allFiles = walkAppFiles(appRoot).filter((f) => !shouldExcludePlatformFile(f, platform));
|
|
103
53
|
const xmlFiles = allFiles.filter((f) => f.endsWith('.xml'));
|
|
104
54
|
const styleFiles = allFiles.filter((f) => /\.(css|scss|less|sass)$/.test(f));
|
|
105
55
|
// Import only code-behind files paired with XML (mirrors webpack's contextual resolution)
|
|
@@ -114,9 +64,9 @@ function createBundlerContextPlugin() {
|
|
|
114
64
|
codeFiles.push(jsCandidate);
|
|
115
65
|
}
|
|
116
66
|
// Do not include additional modules beyond XML-paired code-behind to avoid early side effects.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
67
|
+
const importLines = [];
|
|
68
|
+
const registryEntries = [];
|
|
69
|
+
const moduleMapLines = [];
|
|
120
70
|
let index = 0;
|
|
121
71
|
function pushImport(abs, raw) {
|
|
122
72
|
const idLocal = `__m${index++}`;
|
|
@@ -134,44 +84,13 @@ function createBundlerContextPlugin() {
|
|
|
134
84
|
const code = `// Generated virtual bundler context (platform=${platform || 'unknown'})\n${importLines.join('\n')}\n(function(){\n const registry = new Map();\n const all = {};\n ${moduleMapLines.join('\n ')}\n ${registryEntries.join('\n ')}\n function context(key){\n const real = registry.get(key);\n if(!real) throw new Error('[ns-vite] Module not found in context: '+key);\n return all[real];\n }\n context.keys = function(){ return Array.from(registry.keys()); };\n // Register modules now with extension map so .ts/.scss nicknames resolve like webpack\n try { if (global.registerBundlerModules) { global.registerBundlerModules(context, { '.ts': '.js', '.scss': '.css', '.sass': '.css', '.less': '.css' }); } } catch(e) { console.warn('[ns-vite] registerBundlerModules error', e); }\n // Safety: ensure main-page nickname exists if XML present\n try {\n const hasMainPageXml = context.keys().some(k => /(^\\.\\/?main-page\\.xml$|\\/main-page\\.xml$)/.test(k));\n if (hasMainPageXml && global.moduleExists && !global.moduleExists('main-page') && global.registerBundlerModules) {\n global.registerBundlerModules(context, { '.ts': '.js', '.scss': '.css', '.sass': '.css', '.less': '.css' });\n }\n } catch(_) {}\n})();`;
|
|
135
85
|
return { code, map: null };
|
|
136
86
|
},
|
|
137
|
-
transform(code, id) {
|
|
138
|
-
// Ensure style system is initialized before any UI component modules register CSS properties
|
|
139
|
-
// and ensure the bundler context is imported early in the virtual entry (parity with JS config)
|
|
140
|
-
if (id.endsWith('virtual:entry-with-polyfills')) {
|
|
141
|
-
const marker = "import '@nativescript/core/bundle-entry-points';";
|
|
142
|
-
if (code.includes(marker)) {
|
|
143
|
-
const injected = `${marker}\nimport '@nativescript/core/ui/styling/style';\nimport '@nativescript/core/ui/styling/style-properties';\nimport * as __nsCoreUi from '@nativescript/core/ui';\nimport 'virtual:ns-bundler-context';\n(function(){\n try {\n const __ui = __nsCoreUi;\n if (global.registerModule) {\n const existsFn = global.moduleExists ? (n) => global.moduleExists(n) : () => false;\n if (!existsFn('@nativescript/core/ui')) {\n try { global.registerModule('@nativescript/core/ui', () => __ui); } catch(_) {}\n }\n Object.keys(__ui || {}).forEach(k => {\n if (k && k[0] === k[0].toUpperCase() && !existsFn(k)) {\n try { global.registerModule(k, () => ({ [k]: __ui[k] })); } catch(_) {}\n }\n });\n }\n if (__ui && __ui.View) {\n const View = __ui.View;\n const props = ['order','flexGrow','flexShrink','flexWrapBefore','alignSelf'];\n for (const p of props) {\n const d = Object.getOwnPropertyDescriptor(View.prototype, p);\n if (d && typeof d.set === 'function') {\n const origSet = d.set;\n Object.defineProperty(View.prototype, p, {\n configurable: true,\n enumerable: d.enumerable,\n get: d.get,\n set(value){\n if (value === undefined || value === null) return;\n if (!this || !this._style) {\n try { if (this && !this._style) this._style = this.style; } catch(_) {}\n if (!this || !this._style) return;\n }\n return origSet.call(this, value);\n }\n });\n }\n }\n // Force layout invalidation for alignment/visibility/size property changes \n const forceProps = ['horizontalAlignment','verticalAlignment','visibility','height','width'];\n for (const p of forceProps) {\n const d = Object.getOwnPropertyDescriptor(View.prototype, p);\n if (d && typeof d.set === 'function') {\n const orig = d.set;\n Object.defineProperty(View.prototype, p, {\n configurable: true,\n enumerable: d.enumerable,\n get: d.get,\n set(value){\n const prev = this[p];\n try { orig.call(this, value); } finally {\n if (prev !== value) { try { this && this.requestLayout && this.requestLayout(); } catch(_) {} }\n }\n }\n });\n }\n }\n }\n } catch(_) {}\n})();\n`;
|
|
144
|
-
return { code: code.replace(marker, injected), map: null };
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return null;
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function createXmlLoaderPlugin() {
|
|
152
|
-
return {
|
|
153
|
-
name: 'ns-xml-loader-ts',
|
|
154
|
-
enforce: 'pre',
|
|
155
|
-
load(id) {
|
|
156
|
-
if (!id.endsWith('.xml'))
|
|
157
|
-
return null;
|
|
158
|
-
try {
|
|
159
|
-
const src = readFileSync(id, 'utf-8');
|
|
160
|
-
const xml = JSON.stringify(src)
|
|
161
|
-
.replace(/\u2028/g, '\\u2028')
|
|
162
|
-
.replace(/\u2029/g, '\\u2029');
|
|
163
|
-
const code = `const ___XML___ = ${xml};\nexport default ___XML___;`;
|
|
164
|
-
return { code, map: null };
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
87
|
};
|
|
171
88
|
}
|
|
172
89
|
export const typescriptConfig = ({ mode }, options = {}) => {
|
|
90
|
+
// Note: the virtual:ns-ui-registration plugin is registered by baseConfig
|
|
91
|
+
// from the declared flavor, paired with the entry import emission.
|
|
173
92
|
return mergeConfig(baseConfig({ mode, flavor: 'typescript' }), {
|
|
174
|
-
plugins: [...getTypeCheckPlugins('typescript', options.typeCheck), createXmlLoaderPlugin(), createBundlerContextPlugin()],
|
|
93
|
+
plugins: [...getTypeCheckPlugins('typescript', options.typeCheck), createXmlLoaderPlugin('ns-xml-loader-ts'), createBundlerContextPlugin()],
|
|
175
94
|
});
|
|
176
95
|
};
|
|
177
96
|
//# sourceMappingURL=typescript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgC,MAAM,MAAM,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../packages/vite/configuration/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgC,MAAM,MAAM,CAAC;AACjE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAA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
|
import type { Plugin } from 'vite';
|
|
2
|
+
import type { Platform } from './platform-types.js';
|
|
2
3
|
export interface AppComponentsOptions {
|
|
3
4
|
/**
|
|
4
5
|
* List of app component paths (relative to project root).
|
|
@@ -6,7 +7,7 @@ export interface AppComponentsOptions {
|
|
|
6
7
|
* Example: ['./app/custom-activity.android.ts', './app/custom-application.android.ts']
|
|
7
8
|
*/
|
|
8
9
|
appComponents?: string[];
|
|
9
|
-
platform:
|
|
10
|
+
platform: Platform;
|
|
10
11
|
verbose?: boolean;
|
|
11
12
|
}
|
|
12
13
|
/**
|