@nativescript/vite 8.0.0-beta.0 → 8.0.0-dev.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 +89 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +35 -2
- package/configuration/angular.js +541 -216
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +228 -78
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +17 -96
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +58 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +15 -96
- package/configuration/typescript.js.map +1 -1
- package/framework.d.ts +22 -0
- package/framework.js +18 -0
- package/framework.js.map +1 -0
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/commonjs-plugins.d.ts +5 -2
- package/helpers/commonjs-plugins.js +126 -0
- package/helpers/commonjs-plugins.js.map +1 -1
- package/helpers/config-as-json.js +10 -0
- package/helpers/config-as-json.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +9 -6
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -4
- package/helpers/external-configs.js +63 -15
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +31 -0
- package/helpers/flavor.js +53 -2
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +118 -0
- package/helpers/global-defines.js +214 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/import-meta-path.d.ts +4 -0
- package/helpers/import-meta-path.js +5 -0
- package/helpers/import-meta-path.js.map +1 -0
- package/helpers/import-specifier.d.ts +1 -0
- package/helpers/import-specifier.js +18 -0
- package/helpers/import-specifier.js.map +1 -0
- package/helpers/init.js +24 -26
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +12 -1
- package/helpers/logging.js +81 -5
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +8 -2
- package/helpers/main-entry.js +622 -120
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js +6 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.d.ts +13 -0
- package/helpers/nativeclass-transform.js +42 -131
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
- package/helpers/nativeclass-transformer-plugin.js +324 -37
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-external-urls.d.ts +32 -0
- package/helpers/ns-core-external-urls.js +107 -0
- package/helpers/ns-core-external-urls.js.map +1 -0
- package/helpers/ns-core-url.d.ts +106 -0
- package/helpers/ns-core-url.js +225 -0
- package/helpers/ns-core-url.js.map +1 -0
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/project.d.ts +35 -0
- package/helpers/project.js +120 -2
- package/helpers/project.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +32 -0
- package/helpers/ts-config-paths.js +156 -27
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +3 -3
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +40 -19
- package/helpers/workers.js +312 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +95 -23
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +117 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/framework.d.ts +31 -0
- package/hmr/client/framework.js +17 -0
- package/hmr/client/framework.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +13 -0
- package/hmr/client/hmr-pending-overlay.js +41 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/hot-context.d.ts +89 -0
- package/hmr/client/hot-context.js +404 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +91 -1418
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +136 -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 +489 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +14 -1
- package/hmr/client/utils.js +265 -54
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +11 -0
- package/hmr/entry-runtime.js +566 -43
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/framework-flavors.d.ts +59 -0
- package/hmr/framework-flavors.js +108 -0
- package/hmr/framework-flavors.js.map +1 -0
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/hmr/frameworks/angular/build/js-lexer.js +182 -0
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
- package/hmr/frameworks/angular/build/linker-stats.js +29 -0
- package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +2 -1
- package/hmr/frameworks/angular/client/index.js +637 -23
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +37 -6
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
- package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
- package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.js +697 -18
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/client/strategy.d.ts +12 -0
- package/hmr/frameworks/react/client/strategy.js +27 -0
- package/hmr/frameworks/react/client/strategy.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +230 -0
- package/hmr/frameworks/react/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
- package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
- package/hmr/frameworks/solid/client/app-runtime.js +252 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
- package/hmr/frameworks/solid/client/strategy.js +391 -0
- package/hmr/frameworks/solid/client/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +293 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
- package/hmr/frameworks/typescript/client/strategy.js +418 -0
- package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.js +48 -16
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +10 -1
- package/hmr/frameworks/vue/client/index.js +287 -562
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
- package/hmr/frameworks/vue/client/navigate-app.js +178 -0
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +152 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
- package/hmr/frameworks/vue/server/compiler.js +3 -1
- package/hmr/frameworks/vue/server/compiler.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +291 -7
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +131 -24
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -1
- package/hmr/helpers/vendor-rewrite.js +5 -3
- package/hmr/helpers/vendor-rewrite.js.map +1 -1
- package/hmr/server/boot-recording.d.ts +51 -0
- package/hmr/server/boot-recording.js +214 -0
- package/hmr/server/boot-recording.js.map +1 -0
- package/hmr/server/constants.d.ts +1 -0
- package/hmr/server/constants.js +21 -4
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/content-css-update.d.ts +54 -0
- package/hmr/server/content-css-update.js +78 -0
- package/hmr/server/content-css-update.js.map +1 -0
- package/hmr/server/core-bundle.d.ts +140 -0
- package/hmr/server/core-bundle.js +614 -0
- package/hmr/server/core-bundle.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +130 -4
- package/hmr/server/core-sanitize.js +393 -32
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/css-connect-sync.d.ts +28 -0
- package/hmr/server/css-connect-sync.js +59 -0
- package/hmr/server/css-connect-sync.js.map +1 -0
- package/hmr/server/css-device-module.d.ts +28 -0
- package/hmr/server/css-device-module.js +44 -0
- package/hmr/server/css-device-module.js.map +1 -0
- package/hmr/server/css-update-message.d.ts +23 -0
- package/hmr/server/css-update-message.js +41 -0
- package/hmr/server/css-update-message.js.map +1 -0
- package/hmr/server/deps-bundle.d.ts +233 -0
- package/hmr/server/deps-bundle.js +1022 -0
- package/hmr/server/deps-bundle.js.map +1 -0
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +182 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +215 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +99 -0
- package/hmr/server/import-map.js +294 -0
- package/hmr/server/import-map.js.map +1 -0
- package/hmr/server/index.d.ts +2 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/node-builtins-route.d.ts +12 -0
- package/hmr/server/node-builtins-route.js +86 -0
- package/hmr/server/node-builtins-route.js.map +1 -0
- package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
- package/hmr/server/ns-core-cjs-shape.js +271 -0
- package/hmr/server/ns-core-cjs-shape.js.map +1 -0
- package/hmr/server/ns-m-response-memo.d.ts +10 -0
- package/hmr/server/ns-m-response-memo.js +33 -0
- package/hmr/server/ns-m-response-memo.js.map +1 -0
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +39 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +54 -0
- package/hmr/server/process-code-for-device.js +832 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.d.ts +5 -0
- package/hmr/server/runtime-graph-filter.js +28 -0
- package/hmr/server/runtime-graph-filter.js.map +1 -0
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.d.ts +12 -0
- package/hmr/server/shared-transform-request.js +143 -0
- package/hmr/server/shared-transform-request.js.map +1 -0
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +22 -1
- package/hmr/server/vite-plugin.js +655 -58
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +68 -0
- package/hmr/server/websocket-core-bridge.js +370 -0
- package/hmr/server/websocket-core-bridge.js.map +1 -0
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-graph-upsert.d.ts +21 -0
- package/hmr/server/websocket-graph-upsert.js +33 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -0
- package/hmr/server/websocket-hmr-pending.d.ts +29 -0
- package/hmr/server/websocket-hmr-pending.js +33 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +80 -0
- package/hmr/server/websocket-hot-update.js +299 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +21 -0
- package/hmr/server/websocket-module-bindings.js +504 -0
- package/hmr/server/websocket-module-bindings.js.map +1 -0
- package/hmr/server/websocket-module-specifiers.d.ts +98 -0
- package/hmr/server/websocket-module-specifiers.js +832 -0
- package/hmr/server/websocket-module-specifiers.js.map +1 -0
- package/hmr/server/websocket-ns-core.d.ts +34 -0
- package/hmr/server/websocket-ns-core.js +414 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +163 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
- package/hmr/server/websocket-ns-m-paths.js +115 -0
- package/hmr/server/websocket-ns-m-paths.js.map +1 -0
- package/hmr/server/websocket-ns-m-request.d.ts +46 -0
- package/hmr/server/websocket-ns-m-request.js +197 -0
- package/hmr/server/websocket-ns-m-request.js.map +1 -0
- package/hmr/server/websocket-ns-m.d.ts +52 -0
- package/hmr/server/websocket-ns-m.js +592 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +98 -0
- package/hmr/server/websocket-served-module-helpers.js +948 -0
- package/hmr/server/websocket-served-module-helpers.js.map +1 -0
- package/hmr/server/websocket-txn.d.ts +6 -0
- package/hmr/server/websocket-txn.js +42 -0
- package/hmr/server/websocket-txn.js.map +1 -0
- package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
- package/hmr/server/websocket-vendor-unifier.js +46 -0
- package/hmr/server/websocket-vendor-unifier.js.map +1 -0
- package/hmr/server/websocket.d.ts +6 -17
- package/hmr/server/websocket.js +723 -5376
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +108 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/package-classifier.d.ts +9 -0
- package/hmr/shared/package-classifier.js +58 -0
- package/hmr/shared/package-classifier.js.map +1 -0
- package/hmr/shared/protocol.d.ts +157 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-complete.d.ts +14 -0
- package/hmr/shared/runtime/boot-complete.js +32 -0
- package/hmr/shared/runtime/boot-complete.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +134 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
- package/hmr/shared/runtime/boot-timeline.js +40 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
- package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
- package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
- package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
- package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
- package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
- package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
- package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
- package/hmr/shared/runtime/dev-overlay.js +292 -0
- package/hmr/shared/runtime/dev-overlay.js.map +1 -0
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
- package/hmr/shared/runtime/launch-bridge.js +98 -0
- package/hmr/shared/runtime/launch-bridge.js.map +1 -0
- package/hmr/shared/runtime/module-provenance.d.ts +1 -0
- package/hmr/shared/runtime/module-provenance.js +64 -0
- package/hmr/shared/runtime/module-provenance.js.map +1 -0
- package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
- package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
- package/hmr/shared/runtime/overlay-flag.js +34 -0
- package/hmr/shared/runtime/overlay-flag.js.map +1 -0
- package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
- package/hmr/shared/runtime/platform-polyfills.js +122 -0
- package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
- package/hmr/shared/runtime/root-placeholder.js +778 -83
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
- package/hmr/shared/runtime/session-bootstrap.js +350 -0
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
- package/hmr/shared/runtime/worker-tracking.js +114 -0
- package/hmr/shared/runtime/worker-tracking.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +12 -0
- package/hmr/shared/vendor/manifest.js +341 -545
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +118 -7
- package/hmr/shared/vendor/registry.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +83 -14
- package/runtime/core-aliases-early.js +103 -81
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +61 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/shims/solid-jsx-runtime.d.ts +7 -0
- package/shims/solid-jsx-runtime.js +17 -0
- package/shims/solid-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -189
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -4
- package/helpers/angular/shared-linker.js +0 -39
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.js.map +0 -1
- package/helpers/module-runner-patch.d.ts +0 -3
- package/helpers/module-runner-patch.js +0 -63
- package/helpers/module-runner-patch.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
- package/hmr/shared/runtime/http-only-boot.js +0 -124
- package/hmr/shared/runtime/http-only-boot.js.map +0 -1
- package/hmr/vendor-bootstrap.d.ts +0 -3
- package/hmr/vendor-bootstrap.js +0 -32
- package/hmr/vendor-bootstrap.js.map +0 -1
- package/shims/react-reconciler-constants.d.ts +0 -14
- package/shims/react-reconciler-constants.js +0 -21
- package/shims/react-reconciler-constants.js.map +0 -1
- package/shims/react-reconciler.d.ts +0 -8
- package/shims/react-reconciler.js +0 -15
- package/shims/react-reconciler.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-platform-aliases.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/package-platform-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"package-platform-aliases.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/package-platform-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAEnF,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;AAEzC,MAAM,UAAU,6BAA6B,CAAC,IAAoG;IACjJ,uEAAuE;IACvE,MAAM,WAAW,GAAG,CAAC,e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AI,CAAC;oBACJ,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;oBACzE,uDAAuD;oBACvD,MAAM,GAAG,GAAG,+BAA+B,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAC1F,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;wBACzB,OAAO,CAAC,GAAG,CAAC,qBAAqB,WAAW,OAAO,GAAG,EAAE,CAAC,CAAC;oBAC3D,CAAC;oBACD,OAAO,GAAG,CAAC;gBACZ,CAAC;gBAAC,MAAM,CAAC;oBACR,wCAAwC;oBACxC,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC,CAAC,EAAE,CAAC;YAEL,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;QACjB,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-types.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/platform-types.ts"],"names":[],"mappings":""}
|
|
@@ -5,7 +5,23 @@ interface PostCssConfigOptions {
|
|
|
5
5
|
postcssImport: any;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Builds PostCSS configuration with platform
|
|
8
|
+
* Builds PostCSS configuration with a platform-aware postcss-import fallback.
|
|
9
|
+
*
|
|
10
|
+
* Reality check under Vite 8: whenever the compiled CSS still contains
|
|
11
|
+
* `@import`, Vite UNSHIFTS its own bundled postcss-import ahead of every
|
|
12
|
+
* user plugin in this config — so by the time these plugins run, the import
|
|
13
|
+
* rules have already been inlined (or the build already failed on an
|
|
14
|
+
* unresolvable specifier). Platform-variant rewriting (`foo.css` →
|
|
15
|
+
* `foo.ios.css`) therefore happens BEFORE Vite sees the CSS:
|
|
16
|
+
* - module pipeline: the `ns-css-platform` plugin's transform hook
|
|
17
|
+
* - direct `preprocessCSS()` callers: `rewritePlatformCssImports()`
|
|
18
|
+
* (both in helpers/css-platform-plugin.ts)
|
|
19
|
+
* A previous `ns-postcss-platform-import-rewrite` plugin here duplicated that
|
|
20
|
+
* rewrite at the postcss layer; it was unreachable and has been removed.
|
|
21
|
+
*
|
|
22
|
+
* The postcss-import fallback below is retained as defense-in-depth for
|
|
23
|
+
* preprocessor outputs (sass passes `@import "*.css"` through untouched) in
|
|
24
|
+
* case an app's plugin order ever bypasses Vite's internal inliner.
|
|
9
25
|
*/
|
|
10
26
|
export declare function createPostCssConfig(opts: PostCssConfigOptions): "./postcss.config.js" | {
|
|
11
27
|
plugins: any[];
|
|
@@ -2,7 +2,23 @@ import path from 'path';
|
|
|
2
2
|
import { existsSync, readFileSync } from 'fs';
|
|
3
3
|
import { findPackageInNodeModules } from './module-resolution.js';
|
|
4
4
|
/**
|
|
5
|
-
* Builds PostCSS configuration with platform
|
|
5
|
+
* Builds PostCSS configuration with a platform-aware postcss-import fallback.
|
|
6
|
+
*
|
|
7
|
+
* Reality check under Vite 8: whenever the compiled CSS still contains
|
|
8
|
+
* `@import`, Vite UNSHIFTS its own bundled postcss-import ahead of every
|
|
9
|
+
* user plugin in this config — so by the time these plugins run, the import
|
|
10
|
+
* rules have already been inlined (or the build already failed on an
|
|
11
|
+
* unresolvable specifier). Platform-variant rewriting (`foo.css` →
|
|
12
|
+
* `foo.ios.css`) therefore happens BEFORE Vite sees the CSS:
|
|
13
|
+
* - module pipeline: the `ns-css-platform` plugin's transform hook
|
|
14
|
+
* - direct `preprocessCSS()` callers: `rewritePlatformCssImports()`
|
|
15
|
+
* (both in helpers/css-platform-plugin.ts)
|
|
16
|
+
* A previous `ns-postcss-platform-import-rewrite` plugin here duplicated that
|
|
17
|
+
* rewrite at the postcss layer; it was unreachable and has been removed.
|
|
18
|
+
*
|
|
19
|
+
* The postcss-import fallback below is retained as defense-in-depth for
|
|
20
|
+
* preprocessor outputs (sass passes `@import "*.css"` through untouched) in
|
|
21
|
+
* case an app's plugin order ever bypasses Vite's internal inliner.
|
|
6
22
|
*/
|
|
7
23
|
export function createPostCssConfig(opts) {
|
|
8
24
|
const { platform, projectRoot, themeCoreRoot, postcssImport } = opts;
|
|
@@ -10,44 +26,11 @@ export function createPostCssConfig(opts) {
|
|
|
10
26
|
return './postcss.config.js';
|
|
11
27
|
return {
|
|
12
28
|
plugins: [
|
|
13
|
-
{
|
|
14
|
-
postcssPlugin: 'ns-postcss-platform-import-rewrite',
|
|
15
|
-
Once(root) {
|
|
16
|
-
try {
|
|
17
|
-
const currentFile = root?.source?.input?.file;
|
|
18
|
-
if (!currentFile)
|
|
19
|
-
return;
|
|
20
|
-
const currentDir = path.dirname(currentFile);
|
|
21
|
-
root.walkAtRules('import', (rule) => {
|
|
22
|
-
const m = /^\s*(?:url\()?["]?([^"')]+)["]?\)?/.exec(rule.params || '');
|
|
23
|
-
if (!m)
|
|
24
|
-
return;
|
|
25
|
-
const spec = m[1];
|
|
26
|
-
if (!spec || !(spec.startsWith('.') || spec.startsWith('/')))
|
|
27
|
-
return;
|
|
28
|
-
if (!spec.endsWith('.css'))
|
|
29
|
-
return;
|
|
30
|
-
const abs = path.isAbsolute(spec) ? spec : path.resolve(currentDir, spec);
|
|
31
|
-
if (existsSync(abs))
|
|
32
|
-
return;
|
|
33
|
-
const ext = platform === 'android' ? '.android.css' : '.ios.css';
|
|
34
|
-
const alt = abs.replace(/\.css$/, ext);
|
|
35
|
-
if (existsSync(alt)) {
|
|
36
|
-
let rel = path.relative(currentDir, alt).replace(/\\/g, '/');
|
|
37
|
-
if (!rel.startsWith('.'))
|
|
38
|
-
rel = './' + rel;
|
|
39
|
-
rule.params = rule.params.replace(spec, rel);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
catch { }
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
29
|
postcssImport({
|
|
47
30
|
resolve(id, basedir) {
|
|
48
31
|
if (id.startsWith('.') || id.startsWith('/')) {
|
|
49
32
|
const cleanBasedir = basedir ? basedir.split('?')[0] : basedir;
|
|
50
|
-
|
|
33
|
+
const abs = path.resolve(cleanBasedir || '', id);
|
|
51
34
|
if (!existsSync(abs) && /\.css$/.test(abs)) {
|
|
52
35
|
const platformExt = platform === 'android' ? '.android.css' : '.ios.css';
|
|
53
36
|
const alt = abs.replace(/\.css$/, platformExt);
|
|
@@ -60,8 +43,8 @@ export function createPostCssConfig(opts) {
|
|
|
60
43
|
const pkgRoot = themeCoreRoot || findPackageInNodeModules('nativescript-theme-core', projectRoot);
|
|
61
44
|
if (!pkgRoot)
|
|
62
45
|
return id;
|
|
63
|
-
|
|
64
|
-
|
|
46
|
+
const rel = id.substring('nativescript-theme-core/'.length);
|
|
47
|
+
const target = path.join(pkgRoot, rel);
|
|
65
48
|
if (/^css\/.+\.css$/.test(rel)) {
|
|
66
49
|
const platformExt = platform === 'android' ? '.android.css' : '.ios.css';
|
|
67
50
|
const base = target.replace(/\.css$/, '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcss-platform-config.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/postcss-platform-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AASlE
|
|
1
|
+
{"version":3,"file":"postcss-platform-config.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/postcss-platform-config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AASlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU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B,CAAC;aACD,CAAC;SACF;KACD,CAAC;AACH,CAAC"}
|
package/helpers/project.d.ts
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
export declare function getProjectRootPath(): string;
|
|
2
|
+
/**
|
|
3
|
+
* Walk up from `start` looking for the nearest monorepo workspace root.
|
|
4
|
+
*
|
|
5
|
+
* Returns the absolute path of the workspace root, or `null` if none of
|
|
6
|
+
* the supported markers are found before reaching the filesystem root. The
|
|
7
|
+
* search returns the FIRST matching ancestor — so a deeply nested app dir
|
|
8
|
+
* inside an Nx monorepo that happens to also live inside a parent pnpm
|
|
9
|
+
* workspace returns the Nx root (closer to the app) rather than the outer
|
|
10
|
+
* pnpm one. This matches Vite's own `searchForWorkspaceRoot` behaviour.
|
|
11
|
+
*
|
|
12
|
+
* Recognized markers (see {@link MONOREPO_WORKSPACE_MARKERS}):
|
|
13
|
+
* - `pnpm-workspace.yaml` / `pnpm-workspace.yml`
|
|
14
|
+
* - `lerna.json`
|
|
15
|
+
* - `nx.json` (Nx)
|
|
16
|
+
* - `rush.json` (Rush)
|
|
17
|
+
* - `turbo.json` (Turborepo)
|
|
18
|
+
* - `deno.json` / `deno.jsonc` containing a `workspace` field
|
|
19
|
+
* - `package.json` containing a `workspaces` field (npm/yarn workspaces)
|
|
20
|
+
*/
|
|
21
|
+
export declare function findMonorepoWorkspaceRoot(start?: string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Memoized variant of {@link findMonorepoWorkspaceRoot}.
|
|
24
|
+
*
|
|
25
|
+
* The dev server resolves hoisted `node_modules/<pkg>/...` candidates on
|
|
26
|
+
* every `/ns/m/` request, and each lookup walks the directory tree once
|
|
27
|
+
* doing `existsSync` calls. Since the workspace layout doesn't change at
|
|
28
|
+
* runtime, the result is safe to cache per `start` directory for the
|
|
29
|
+
* lifetime of the dev server process.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getMonorepoWorkspaceRoot(start?: string): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Clear the {@link getMonorepoWorkspaceRoot} memoization cache. Intended
|
|
34
|
+
* for tests that mutate the filesystem inside a temp dir between calls.
|
|
35
|
+
*/
|
|
36
|
+
export declare function clearMonorepoWorkspaceRootCache(): void;
|
|
2
37
|
export declare const __dirname: string;
|
|
3
38
|
interface IPackageJson {
|
|
4
39
|
name?: string;
|
package/helpers/project.js
CHANGED
|
@@ -1,10 +1,128 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { resolve } from 'path';
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
|
+
import { dirname, join, resolve } from 'path';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
5
5
|
export function getProjectRootPath() {
|
|
6
6
|
return process.cwd();
|
|
7
7
|
}
|
|
8
|
+
// Markers that indicate the directory is a monorepo workspace root. Vite's
|
|
9
|
+
// own `searchForWorkspaceRoot` only knows about pnpm/lerna/yarn|npm
|
|
10
|
+
// `workspaces` and Deno; this list extends it to cover popular JS/TS
|
|
11
|
+
// monorepo tools (Nx, Rush, Turborepo) and any future tool by simply adding
|
|
12
|
+
// a marker file name. The order doesn't matter — we return the first
|
|
13
|
+
// ancestor that has any one of them.
|
|
14
|
+
//
|
|
15
|
+
// Why this matters: when an app lives at `apps/<name>/` inside a monorepo,
|
|
16
|
+
// `process.cwd()` (and therefore Vite's `config.root`) is the app dir. The
|
|
17
|
+
// hoisted `node_modules/` is at the workspace root. If Vite's default
|
|
18
|
+
// `fs.allow` doesn't reach that high, every transform-time fs read of a
|
|
19
|
+
// hoisted package fails with `Failed to load url … Does the file exist?`
|
|
20
|
+
// even though the file is right there on disk. The fix is to widen
|
|
21
|
+
// `server.fs.allow` to the detected workspace root.
|
|
22
|
+
const MONOREPO_WORKSPACE_MARKERS = [
|
|
23
|
+
// Standard JS package-manager workspace files (pnpm/yarn-classic/lerna).
|
|
24
|
+
'pnpm-workspace.yaml',
|
|
25
|
+
'pnpm-workspace.yml',
|
|
26
|
+
'lerna.json',
|
|
27
|
+
// Build orchestrators that are monorepo-by-design.
|
|
28
|
+
'nx.json',
|
|
29
|
+
'rush.json',
|
|
30
|
+
'turbo.json',
|
|
31
|
+
// Deno workspaces.
|
|
32
|
+
'deno.json',
|
|
33
|
+
'deno.jsonc',
|
|
34
|
+
];
|
|
35
|
+
function packageJsonHasWorkspaces(dir) {
|
|
36
|
+
const pkgPath = join(dir, 'package.json');
|
|
37
|
+
if (!existsSync(pkgPath))
|
|
38
|
+
return false;
|
|
39
|
+
try {
|
|
40
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
41
|
+
return !!(pkg && pkg.workspaces);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function denoConfigHasWorkspace(dir) {
|
|
48
|
+
for (const name of ['deno.json', 'deno.jsonc']) {
|
|
49
|
+
const p = join(dir, name);
|
|
50
|
+
if (!existsSync(p))
|
|
51
|
+
continue;
|
|
52
|
+
try {
|
|
53
|
+
const cfg = JSON.parse(readFileSync(p, 'utf-8'));
|
|
54
|
+
if (cfg && cfg.workspace)
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
catch { }
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Walk up from `start` looking for the nearest monorepo workspace root.
|
|
63
|
+
*
|
|
64
|
+
* Returns the absolute path of the workspace root, or `null` if none of
|
|
65
|
+
* the supported markers are found before reaching the filesystem root. The
|
|
66
|
+
* search returns the FIRST matching ancestor — so a deeply nested app dir
|
|
67
|
+
* inside an Nx monorepo that happens to also live inside a parent pnpm
|
|
68
|
+
* workspace returns the Nx root (closer to the app) rather than the outer
|
|
69
|
+
* pnpm one. This matches Vite's own `searchForWorkspaceRoot` behaviour.
|
|
70
|
+
*
|
|
71
|
+
* Recognized markers (see {@link MONOREPO_WORKSPACE_MARKERS}):
|
|
72
|
+
* - `pnpm-workspace.yaml` / `pnpm-workspace.yml`
|
|
73
|
+
* - `lerna.json`
|
|
74
|
+
* - `nx.json` (Nx)
|
|
75
|
+
* - `rush.json` (Rush)
|
|
76
|
+
* - `turbo.json` (Turborepo)
|
|
77
|
+
* - `deno.json` / `deno.jsonc` containing a `workspace` field
|
|
78
|
+
* - `package.json` containing a `workspaces` field (npm/yarn workspaces)
|
|
79
|
+
*/
|
|
80
|
+
export function findMonorepoWorkspaceRoot(start = getProjectRootPath()) {
|
|
81
|
+
let current = resolve(start);
|
|
82
|
+
while (true) {
|
|
83
|
+
for (const marker of MONOREPO_WORKSPACE_MARKERS) {
|
|
84
|
+
if (marker.startsWith('deno.')) {
|
|
85
|
+
if (denoConfigHasWorkspace(current))
|
|
86
|
+
return current;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (existsSync(join(current, marker)))
|
|
90
|
+
return current;
|
|
91
|
+
}
|
|
92
|
+
if (packageJsonHasWorkspaces(current))
|
|
93
|
+
return current;
|
|
94
|
+
const parent = dirname(current);
|
|
95
|
+
if (!parent || parent === current)
|
|
96
|
+
return null;
|
|
97
|
+
current = parent;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const monorepoWorkspaceRootCache = new Map();
|
|
101
|
+
/**
|
|
102
|
+
* Memoized variant of {@link findMonorepoWorkspaceRoot}.
|
|
103
|
+
*
|
|
104
|
+
* The dev server resolves hoisted `node_modules/<pkg>/...` candidates on
|
|
105
|
+
* every `/ns/m/` request, and each lookup walks the directory tree once
|
|
106
|
+
* doing `existsSync` calls. Since the workspace layout doesn't change at
|
|
107
|
+
* runtime, the result is safe to cache per `start` directory for the
|
|
108
|
+
* lifetime of the dev server process.
|
|
109
|
+
*/
|
|
110
|
+
export function getMonorepoWorkspaceRoot(start = getProjectRootPath()) {
|
|
111
|
+
const key = resolve(start);
|
|
112
|
+
if (monorepoWorkspaceRootCache.has(key)) {
|
|
113
|
+
return monorepoWorkspaceRootCache.get(key) ?? null;
|
|
114
|
+
}
|
|
115
|
+
const result = findMonorepoWorkspaceRoot(key);
|
|
116
|
+
monorepoWorkspaceRootCache.set(key, result);
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Clear the {@link getMonorepoWorkspaceRoot} memoization cache. Intended
|
|
121
|
+
* for tests that mutate the filesystem inside a temp dir between calls.
|
|
122
|
+
*/
|
|
123
|
+
export function clearMonorepoWorkspaceRootCache() {
|
|
124
|
+
monorepoWorkspaceRootCache.clear();
|
|
125
|
+
}
|
|
8
126
|
// Get current directory for ES modules (equivalent to __dirname)
|
|
9
127
|
export const __dirname = import.meta.dirname;
|
|
10
128
|
/**
|
package/helpers/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,UAAU,kBAAkB;IACjC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACtB,CAAC;AAED,2EAA2E;AAC3E,oEAAoE;AACpE,qEAAqE;AACrE,4EAA4E;AAC5E,qEAAqE;AACrE,qCAAqC;AACrC,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AACtE,wEAAwE;AACxE,yEAAyE;AACzE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AM,CAAC,IAAI,CAAC,OAAO,CAAC;AAc7C;;GAEG;AACH,MAAM,UAAU,cAAc;IAC7B,OAAO,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAiB,CAAC;AACpE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAClD,OAAO,OAAO,CAAC,kBAAkB,EAAE,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,sBAAsB;IACrC,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AACxH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a resolved package directory and its `package.json` `main` field, return
|
|
3
|
+
* the platform-specific entry file to use (as a `normalizeModuleId`-canonical
|
|
4
|
+
* absolute id), or `null` when no platform rewrite applies and normal resolution
|
|
5
|
+
* should handle it.
|
|
6
|
+
*
|
|
7
|
+
* Shared by the two `enforce:'pre'` package resolvers (`nativescript-package-resolver`
|
|
8
|
+
* and `package-platform-aliases`) so the main-field platform-variant rules live
|
|
9
|
+
* in one place.
|
|
10
|
+
*
|
|
11
|
+
* Two cases (behavior preserved from the original inline implementations):
|
|
12
|
+
* 1. `main` is extensionless → prefer `<main>.<platform>.js`, else `<main>.js`.
|
|
13
|
+
* 2. `main` has an extension but the file is missing → try `<base>.<platform><ext>`.
|
|
14
|
+
*
|
|
15
|
+
* Note: when an extension-bearing `main` file DOES exist, this returns `null`
|
|
16
|
+
* (the generic file wins) even if a `<base>.<platform><ext>` sibling exists.
|
|
17
|
+
* That is the current, intentional-for-now behavior; revisiting it is tracked
|
|
18
|
+
* separately (it would change resolution for packages shipping both).
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveMainFieldPlatformVariant(packagePath: string, mainField: string | undefined | null, platform: string): string | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { normalizeModuleId } from './normalize-id.js';
|
|
4
|
+
/**
|
|
5
|
+
* Given a resolved package directory and its `package.json` `main` field, return
|
|
6
|
+
* the platform-specific entry file to use (as a `normalizeModuleId`-canonical
|
|
7
|
+
* absolute id), or `null` when no platform rewrite applies and normal resolution
|
|
8
|
+
* should handle it.
|
|
9
|
+
*
|
|
10
|
+
* Shared by the two `enforce:'pre'` package resolvers (`nativescript-package-resolver`
|
|
11
|
+
* and `package-platform-aliases`) so the main-field platform-variant rules live
|
|
12
|
+
* in one place.
|
|
13
|
+
*
|
|
14
|
+
* Two cases (behavior preserved from the original inline implementations):
|
|
15
|
+
* 1. `main` is extensionless → prefer `<main>.<platform>.js`, else `<main>.js`.
|
|
16
|
+
* 2. `main` has an extension but the file is missing → try `<base>.<platform><ext>`.
|
|
17
|
+
*
|
|
18
|
+
* Note: when an extension-bearing `main` file DOES exist, this returns `null`
|
|
19
|
+
* (the generic file wins) even if a `<base>.<platform><ext>` sibling exists.
|
|
20
|
+
* That is the current, intentional-for-now behavior; revisiting it is tracked
|
|
21
|
+
* separately (it would change resolution for packages shipping both).
|
|
22
|
+
*/
|
|
23
|
+
export function resolveMainFieldPlatformVariant(packagePath, mainField, platform) {
|
|
24
|
+
if (!mainField)
|
|
25
|
+
return null;
|
|
26
|
+
const mainFilePath = path.join(packagePath, mainField);
|
|
27
|
+
// Case 1: extensionless main — add platform/.js extensions.
|
|
28
|
+
if (!mainField.includes('.')) {
|
|
29
|
+
const platformFile = path.join(packagePath, `${mainField}.${platform}.js`);
|
|
30
|
+
if (fs.existsSync(platformFile))
|
|
31
|
+
return normalizeModuleId(platformFile);
|
|
32
|
+
const jsFile = path.join(packagePath, `${mainField}.js`);
|
|
33
|
+
if (fs.existsSync(jsFile))
|
|
34
|
+
return normalizeModuleId(jsFile);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// Case 2: main has an extension but the file is missing — look for a platform variant.
|
|
38
|
+
if (!fs.existsSync(mainFilePath)) {
|
|
39
|
+
const ext = path.extname(mainField);
|
|
40
|
+
const baseName = mainField.slice(0, -ext.length);
|
|
41
|
+
const platformFile = path.join(packagePath, `${baseName}.${platform}${ext}`);
|
|
42
|
+
if (fs.existsSync(platformFile))
|
|
43
|
+
return normalizeModuleId(platformFile);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
// Main file exists — let normal resolution handle it.
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=resolve-main-field-platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-main-field-platform.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/resolve-main-field-platform.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,+BAA+B,CAAC,WAAmB,EAAE,SAAoC,EAAE,QAAgB;IAC1H,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEvD,4DAA4D;IAC5D,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,SAAS,IAAI,QAAQ,KAAK,CAAC,CAAC;QAC3E,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,SAAS,KAAK,CAAC,CAAC;QACzD,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACb,CAAC;IAED,uFAAuF;IACvF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,QAAQ,IAAI,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC;QAC7E,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;IACb,CAAC;IAED,sDAAsD;IACtD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/helpers/resolver.js
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import { resolveNativeScriptPlatformFile } from './utils.js';
|
|
3
|
+
import { normalizeModuleId } from './normalize-id.js';
|
|
4
|
+
const normalizeImporterId = (importer) => {
|
|
5
|
+
const cleanImporter = importer.split('?', 1)[0];
|
|
6
|
+
if (!cleanImporter.startsWith('/@fs/')) {
|
|
7
|
+
return cleanImporter;
|
|
8
|
+
}
|
|
9
|
+
return /^\/\@fs\/[A-Za-z]:/.test(cleanImporter) ? cleanImporter.slice('/@fs/'.length) : cleanImporter.slice('/@fs'.length);
|
|
10
|
+
};
|
|
3
11
|
export default function NativeScriptPlugin(options) {
|
|
4
12
|
return {
|
|
5
13
|
name: 'vite:nativescript',
|
|
14
|
+
enforce: 'pre',
|
|
6
15
|
resolveId(source, importer) {
|
|
7
16
|
const platform = options.platform;
|
|
8
17
|
if (!platform || !importer || source.startsWith('.') === false) {
|
|
9
18
|
return null;
|
|
10
19
|
}
|
|
11
|
-
const resolved = path.resolve(path.dirname(importer), source);
|
|
20
|
+
const resolved = path.resolve(path.dirname(normalizeImporterId(importer)), source);
|
|
12
21
|
const extVariants = ['.ts', '.js'];
|
|
13
22
|
for (const ext of extVariants) {
|
|
14
23
|
const file = resolveNativeScriptPlatformFile(resolved + ext, platform);
|
|
15
24
|
if (file) {
|
|
16
|
-
|
|
25
|
+
// Canonicalize before handing the id to Rolldown. `path.resolve`
|
|
26
|
+
// emits backslashes on Windows; the @nativescript/core alias and
|
|
27
|
+
// Vite's own resolver emit forward slashes. Returning the raw
|
|
28
|
+
// backslash form here makes Rolldown treat the same core file as a
|
|
29
|
+
// second module, double-evaluating widthProperty.register. No-op on
|
|
30
|
+
// POSIX. See normalize-id.ts for the full rationale.
|
|
31
|
+
return normalizeModuleId(file);
|
|
17
32
|
}
|
|
18
33
|
}
|
|
19
34
|
return null;
|
package/helpers/resolver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/resolver.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/resolver.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAU,EAAE;IACxD,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,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CAAC;QACb,CAAC;QAED,SAAS,CAAC,IAAI,EAAE,EAAE;YACjB,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzB,+EAA+E;gBAC/E,OAAO;oBACN,IAAI;oBACJ,GAAG,EAAE,IAAI;iBACT,CAAC;YACH,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -99,7 +99,7 @@ export function createThemeCoreCssFallbackPlugin(themeCoreRoot, projectRoot, pla
|
|
|
99
99
|
if (idx === -1)
|
|
100
100
|
return null;
|
|
101
101
|
const rel = id.substring(idx + 'nativescript-theme-core/'.length);
|
|
102
|
-
|
|
102
|
+
const target = path.join(pkgRoot, rel);
|
|
103
103
|
try {
|
|
104
104
|
if (existsSync(target)) {
|
|
105
105
|
return readFileSync(target, 'utf-8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-core-plugins.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/theme-core-plugins.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,aAAiC,EAAE,QAAgB;IAC7F,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,OA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C,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC;oBACzE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,WAAW,CAAC;oBAC/B,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;wBACrB,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;oBACnC,CAAC;gBACF,CAAC;YACF,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Absolute directory roots that the project's tsconfig `paths` aliases point at.
|
|
4
|
+
*
|
|
5
|
+
* Used to scope HMR to configured shared libraries in a monorepo: a file only
|
|
6
|
+
* triggers an update if it lives under the app source dir or one of these
|
|
7
|
+
* alias roots. When an alias targets a file (e.g. `@org/lib -> libs/lib/src/index.ts`)
|
|
8
|
+
* the file's directory is returned so sibling source files in that library are
|
|
9
|
+
* also in scope. Wildcard aliases (`@org/* -> libs/*`) contribute their resolved
|
|
10
|
+
* base directory (`libs`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTsConfigAliasRoots(opts: {
|
|
13
|
+
paths?: Record<string, string[]>;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
}): string[];
|
|
16
|
+
export declare function createTsConfigSpecifierResolver(opts: {
|
|
17
|
+
paths: Record<string, string[]>;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
platform: string;
|
|
20
|
+
verbose?: boolean;
|
|
21
|
+
}): ((source: string) => string | null) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Vite `resolveId` plugin that maps tsconfig `paths` aliases to absolute module
|
|
24
|
+
* ids. Thin wrapper over `createTsConfigSpecifierResolver`.
|
|
25
|
+
*/
|
|
2
26
|
export declare function createTsConfigPathsResolver(opts: {
|
|
3
27
|
paths: Record<string, string[]>;
|
|
4
28
|
baseUrl: string;
|
|
5
29
|
platform: string;
|
|
6
30
|
verbose?: boolean;
|
|
7
31
|
}): Plugin | undefined;
|
|
32
|
+
export declare function resolveProjectTsAlias(spec: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve an aliased specifier to a POSIX, project-root-relative path
|
|
35
|
+
* (`@present/components/ui/BasePage.vue` → `/src/presentation/components/ui/BasePage.vue`) —
|
|
36
|
+
* the form the HMR SFC routes use as their on-disk `base`. Returns `null` when
|
|
37
|
+
* the alias doesn't match or resolves outside the project root.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveProjectTsAliasRelative(spec: string, projectRoot: string): string | null;
|
|
8
40
|
type TsConfigOptions = {
|
|
9
41
|
platform: string;
|
|
10
42
|
verbose?: boolean;
|