@nativescript/vite 8.0.0-alpha.4 → 8.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -11
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +376 -165
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +256 -30
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +12 -90
- package/configuration/javascript.js.map +1 -1
- package/configuration/solid.js +33 -4
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +10 -90
- package/configuration/typescript.js.map +1 -1
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-state.d.ts +8 -0
- package/helpers/app-css-state.js +8 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/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 +692 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.js +1 -1
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +54 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/global-defines.d.ts +128 -0
- package/helpers/global-defines.js +174 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/init.js +0 -18
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +65 -4
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +3 -1
- package/helpers/main-entry.js +444 -50
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.js +5 -6
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +157 -14
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-url.d.ts +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 +14 -0
- package/helpers/ts-config-paths.js +90 -9
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js.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.js +1 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/workers.d.ts +20 -19
- package/helpers/workers.js +624 -4
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +50 -26
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +79 -0
- package/hmr/client/framework-client-strategy.js +19 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +13 -0
- package/hmr/client/hmr-pending-overlay.js +60 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/index.js +787 -211
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +7 -1
- package/hmr/client/utils.js +207 -29
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +256 -69
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +109 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +1 -0
- package/hmr/frameworks/angular/client/index.js +803 -21
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +1 -4
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/strategy.js +460 -12
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/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/server/strategy.js +291 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/server/strategy.js +38 -14
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +36 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +8 -0
- package/hmr/frameworks/vue/client/index.js +56 -243
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +157 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +459 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +278 -1
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +77 -10
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/server/constants.js +20 -5
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/core-sanitize.d.ts +90 -7
- package/hmr/server/core-sanitize.js +211 -56
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +369 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +108 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +214 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +11 -2
- package/hmr/server/import-map.js +95 -44
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/ns-core-cjs-shape.d.ts +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-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +38 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +14 -0
- package/hmr/server/process-code-for-device.js +702 -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 +600 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +83 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +13 -7
- package/hmr/server/shared-transform-request.js.map +1 -1
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.js +72 -42
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +45 -6
- package/hmr/server/websocket-core-bridge.js +81 -77
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-css-hot-update.d.ts +33 -0
- package/hmr/server/websocket-css-hot-update.js +65 -0
- package/hmr/server/websocket-css-hot-update.js.map +1 -0
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-graph-upsert.d.ts +15 -0
- package/hmr/server/websocket-graph-upsert.js +20 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -1
- package/hmr/server/websocket-hmr-pending.d.ts +37 -0
- package/hmr/server/websocket-hmr-pending.js +55 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +77 -0
- package/hmr/server/websocket-hot-update.js +360 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +50 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.js +3 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -2
- package/hmr/server/websocket-module-specifiers.js +203 -20
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +21 -0
- package/hmr/server/websocket-ns-core.js +311 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +164 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +1 -1
- package/hmr/server/websocket-ns-m-paths.js +58 -13
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +11 -1
- package/hmr/server/websocket-ns-m-request.js +18 -25
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +33 -0
- package/hmr/server/websocket-ns-m.js +752 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +82 -0
- package/hmr/server/websocket-served-module-helpers.js +879 -0
- package/hmr/server/websocket-served-module-helpers.js.map +1 -0
- package/hmr/server/websocket-txn.js +2 -8
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +8 -39
- package/hmr/server/websocket.js +514 -4030
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +118 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +145 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +133 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
- package/hmr/shared/runtime/boot-timeline.js +42 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +75 -26
- package/hmr/shared/runtime/dev-overlay.js +992 -261
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/http-only-boot.js +7 -6
- package/hmr/shared/runtime/http-only-boot.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.js +371 -197
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +168 -4
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +512 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +1 -7
- package/hmr/shared/vendor/manifest.js +102 -741
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +16 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +203 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/hmr/vendor-bootstrap.d.ts +1 -3
- package/hmr/vendor-bootstrap.js +4 -6
- package/hmr/vendor-bootstrap.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +55 -11
- package/runtime/core-aliases-early.js +25 -55
- package/runtime/core-aliases-early.js.map +1 -1
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -194
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -11
- package/helpers/angular/shared-linker.js +0 -75
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
- package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js +0 -239
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -32
- package/hmr/server/websocket-ns-m-finalize.js +0 -73
- package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
- package/hmr/server/websocket-runtime-compat.d.ts +0 -19
- package/hmr/server/websocket-runtime-compat.js +0 -286
- package/hmr/server/websocket-runtime-compat.js.map +0 -1
- package/hmr/server/websocket-vue-sfc.d.ts +0 -35
- package/hmr/server/websocket-vue-sfc.js +0 -1116
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Defines which files HMR is allowed to react to; an allowlist driven by the
|
|
2
|
+
// project's own configuration.
|
|
3
|
+
import { getProjectAppAbsolutePath } from './utils.js';
|
|
4
|
+
import { getTsConfigAliasRoots } from './ts-config-paths.js';
|
|
5
|
+
import { normalizeModuleId } from './normalize-id.js';
|
|
6
|
+
// Canonical root form: forward slashes, uppercase Windows drive, no trailing slash.
|
|
7
|
+
function asRoot(p) {
|
|
8
|
+
return normalizeModuleId(String(p || '')).replace(/\/+$/, '');
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Absolute directories HMR is allowed to react to:
|
|
12
|
+
* - the app source dir (`appPath`, default `src`)
|
|
13
|
+
* - shared-library roots from tsconfig `paths` (monorepo libs)
|
|
14
|
+
*
|
|
15
|
+
* Pass the project's tsconfig data (`{ paths, baseUrl }` from `getTsConfigData`)
|
|
16
|
+
* to include configured workspace libraries. Always includes the app source dir.
|
|
17
|
+
*/
|
|
18
|
+
export function getHmrSourceRoots(tsConfig) {
|
|
19
|
+
const roots = new Set();
|
|
20
|
+
const appDir = asRoot(getProjectAppAbsolutePath());
|
|
21
|
+
if (appDir)
|
|
22
|
+
roots.add(appDir);
|
|
23
|
+
for (const aliasRoot of getTsConfigAliasRoots({ paths: tsConfig?.paths, baseUrl: tsConfig?.baseUrl })) {
|
|
24
|
+
const r = asRoot(aliasRoot);
|
|
25
|
+
if (r)
|
|
26
|
+
roots.add(r);
|
|
27
|
+
}
|
|
28
|
+
return [...roots];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* True when `file` lives inside one of the HMR source roots (app source dir or a
|
|
32
|
+
* configured shared-library root). Accepts absolute paths with either separator
|
|
33
|
+
* style and strips any query/hash suffix (`…/app.component.ts?ngResource`).
|
|
34
|
+
*/
|
|
35
|
+
export function isWithinHmrScope(file, roots) {
|
|
36
|
+
if (!file || !roots || roots.length === 0)
|
|
37
|
+
return false;
|
|
38
|
+
const f = normalizeModuleId(String(file).replace(/[?#].*$/, ''));
|
|
39
|
+
for (const root of roots) {
|
|
40
|
+
if (!root)
|
|
41
|
+
continue;
|
|
42
|
+
if (f === root || f.startsWith(root + '/'))
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Minimal glob list for `server.watch.ignored`. This is a *performance* guard,
|
|
49
|
+
* NOT the correctness gate (that's the {@link isWithinHmrScope} allowlist applied
|
|
50
|
+
* in `handleHotUpdate`). It keeps chokidar from walking the large native/generated
|
|
51
|
+
* trees that live under the app root. Vite already ignores `node_modules` and
|
|
52
|
+
* `.git` by default; these are the NativeScript-specific additions.
|
|
53
|
+
*/
|
|
54
|
+
export function getHmrWatchIgnoreGlobs(distOutputFolder) {
|
|
55
|
+
const globs = ['**/platforms/**', '**/hooks/**', '**/App_Resources/**', '**/.ns-vite-build/**'];
|
|
56
|
+
if (distOutputFolder) {
|
|
57
|
+
const clean = distOutputFolder
|
|
58
|
+
.replace(/\\/g, '/')
|
|
59
|
+
.replace(/^\.\/+/, '')
|
|
60
|
+
.replace(/\/+$/, '');
|
|
61
|
+
if (clean && clean !== '.ns-vite-build') {
|
|
62
|
+
globs.push(`**/${clean}/**`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return globs;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=hmr-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr-scope.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/hmr-scope.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,+BAA+B;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,oFAAoF;AACpF,SAAS,MAAM,CAAC,CAAS;IACxB,OAAO,iBAA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U,sBAAsB,CAAC,gBAAyB;IAC/D,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;IAChG,IAAI,gBAAgB,EAAE,CAAC;QACtB,MAAM,KAAK,GAAG,gBAAgB;aAC5B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;aACrB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACtB,IAAI,KAAK,IAAI,KAAK,KAAK,gBAAgB,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/helpers/init.js
CHANGED
|
@@ -4,10 +4,6 @@ import { createRequire } from 'node:module';
|
|
|
4
4
|
import { determineProjectFlavor } from './flavor.js';
|
|
5
5
|
import { getProjectFilePath, getProjectRootPath } from './project.js';
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
|
-
const DEV_DEPS = {
|
|
8
|
-
concurrently: '^9.0.0',
|
|
9
|
-
'wait-on': '^9.0.0',
|
|
10
|
-
};
|
|
11
7
|
const RUNTIME_DEPS = {
|
|
12
8
|
'@valor/nativescript-websockets': '^2.0.2',
|
|
13
9
|
};
|
|
@@ -22,23 +18,10 @@ function writePackageJson(pkg) {
|
|
|
22
18
|
}
|
|
23
19
|
function ensureDependencies(pkg) {
|
|
24
20
|
pkg.dependencies = pkg.dependencies ?? {};
|
|
25
|
-
pkg.devDependencies = pkg.devDependencies ?? {};
|
|
26
|
-
for (const [name, version] of Object.entries(DEV_DEPS)) {
|
|
27
|
-
pkg.devDependencies[name] = version;
|
|
28
|
-
}
|
|
29
21
|
for (const [name, version] of Object.entries(RUNTIME_DEPS)) {
|
|
30
22
|
pkg.dependencies[name] = version;
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
|
-
function ensureScripts(pkg) {
|
|
34
|
-
pkg.scripts = pkg.scripts ?? {};
|
|
35
|
-
pkg.scripts['dev:ios'] = 'concurrently -k -n vite,ns "npm run dev:server:ios" "wait-on tcp:5173 && npm run ios"';
|
|
36
|
-
pkg.scripts['dev:android'] = 'concurrently -k -n vite,ns "npm run dev:server:android" "wait-on tcp:5173 && npm run android"';
|
|
37
|
-
pkg.scripts['dev:server:ios'] = 'vite serve -- --env.ios --env.hmr';
|
|
38
|
-
pkg.scripts['dev:server:android'] = 'vite serve -- --env.android --env.hmr';
|
|
39
|
-
pkg.scripts['ios'] = 'ns debug ios';
|
|
40
|
-
pkg.scripts['android'] = 'ns debug android';
|
|
41
|
-
}
|
|
42
25
|
function ensureGitignore() {
|
|
43
26
|
const root = getProjectRootPath();
|
|
44
27
|
const gitignorePath = path.join(root, '.gitignore');
|
|
@@ -110,7 +93,6 @@ function ensureViteConfig() {
|
|
|
110
93
|
export async function runInit() {
|
|
111
94
|
const pkg = readPackageJson();
|
|
112
95
|
ensureDependencies(pkg);
|
|
113
|
-
ensureScripts(pkg);
|
|
114
96
|
writePackageJson(pkg);
|
|
115
97
|
ensureGitignore();
|
|
116
98
|
ensureViteConfig();
|
package/helpers/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAW/C,MAAM,
|
|
1
|
+
{"version":3,"file":"init.js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qB;aACjC,CAAC;QACH,KAAK,YAAY;YAChB,OAAO;gBACN,UAAU,EAAE,mEAAmE;gBAC/E,UAAU,EAAE,4BAA4B;aACxC,CAAC;QACH,KAAK,YAAY,CAAC;QAClB;YACC,OAAO;gBACN,UAAU,EAAE,mEAAmE;gBAC/E,UAAU,EAAE,4BAA4B;aACxC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,IAAI,GAAG,kBAAkB,EAAE,CAAC;IAClC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACzD,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO;IACR,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,yCAAyC,UAAU,kDAAkD,UAAU,MAAM,CAAC;IACvI,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO;IAC5B,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxB,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtB,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;AAC9E,CAAC"}
|
package/helpers/logging.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ type ResolveOptions = {
|
|
|
10
10
|
export declare function resolveVerboseFlag(options?: ResolveOptions): boolean;
|
|
11
11
|
export declare function clearVerboseCache(): void;
|
|
12
12
|
export declare function createFilteredViteLogger(): Logger;
|
|
13
|
+
export declare function shouldSuppressViteWarning(msg: string): boolean;
|
|
13
14
|
export {};
|
package/helpers/logging.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLogger } from 'vite';
|
|
2
|
+
import { getGlobalScope } from '../hmr/shared/runtime/global-scope.js';
|
|
2
3
|
const GLOBAL_VERBOSE_FLAG = '__NS_ENV_VERBOSE__';
|
|
3
4
|
const ENV_VERBOSE_KEYS = ['NS_VITE_VERBOSE', 'NS_ENV_VERBOSE', 'NS_VERBOSE', 'VERBOSE', 'VITE_DEBUG_LOGS', 'DEBUG'];
|
|
4
5
|
let cachedVerbose;
|
|
@@ -37,7 +38,7 @@ export function resolveVerboseFlag(options = {}) {
|
|
|
37
38
|
}
|
|
38
39
|
if (resolved === undefined && options.useGlobalFlag !== false) {
|
|
39
40
|
try {
|
|
40
|
-
const globalVerbose =
|
|
41
|
+
const globalVerbose = getGlobalScope()?.[GLOBAL_VERBOSE_FLAG];
|
|
41
42
|
const coerced = coerceBoolean(globalVerbose);
|
|
42
43
|
if (typeof coerced === 'boolean') {
|
|
43
44
|
resolved = coerced;
|
|
@@ -72,9 +73,19 @@ export function clearVerboseCache() {
|
|
|
72
73
|
// expected given NativeScript's virtual vendor bundling strategy.
|
|
73
74
|
// Currently filters:
|
|
74
75
|
// - Sourcemap missing source files (common in published packages)
|
|
76
|
+
// - Sourcemap source paths that walk outside the published package (the map
|
|
77
|
+
// was generated in a monorepo and still references workspace paths the
|
|
78
|
+
// consumer's node_modules doesn't have)
|
|
79
|
+
// - Sidecar `.js.map` files listed in a `//# sourceMappingURL=` comment that
|
|
80
|
+
// were not published alongside the `.js` file
|
|
75
81
|
// - Eval usage attributed to the virtual "@nativescript/vendor" module
|
|
76
82
|
// - License/annotation position warnings for the vendor bundle
|
|
83
|
+
// - Analog Angular optimizer/router plugins that never emit sourcemaps
|
|
77
84
|
// Extend this list cautiously; prefer documenting each suppression reason.
|
|
85
|
+
//
|
|
86
|
+
// All matching uses `.includes()` (never `.startsWith()`) because Vite wraps
|
|
87
|
+
// some warnings in picocolors ANSI escape sequences before handing them to
|
|
88
|
+
// the logger, which would defeat `startsWith`-style probes on TTY output.
|
|
78
89
|
export function createFilteredViteLogger() {
|
|
79
90
|
const baseLogger = createLogger(undefined, { allowClearScreen: true });
|
|
80
91
|
return {
|
|
@@ -93,9 +104,32 @@ export function createFilteredViteLogger() {
|
|
|
93
104
|
},
|
|
94
105
|
};
|
|
95
106
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
// Exported for unit tests. Keep this function pure so the test suite can
|
|
108
|
+
// exercise every suppression pattern without instantiating a real logger.
|
|
109
|
+
export function shouldSuppressViteWarning(msg) {
|
|
110
|
+
// Missing sourcemap original sources (kept as-is — published packages
|
|
111
|
+
// frequently drop a few `sources[n]` entries during transpile).
|
|
112
|
+
if (msg.includes('Sourcemap for ') && msg.includes('missing source files')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
// Cross-package sourcemap path. Emitted for every `@nativescript/core`
|
|
116
|
+
// file at dev-server startup when the consumer has the published
|
|
117
|
+
// package installed: the shipped `.js.map` still references the
|
|
118
|
+
// original monorepo `packages/core/**` path, which does not exist in
|
|
119
|
+
// the consumer's node_modules. There is nothing we (or the app
|
|
120
|
+
// author) can do about this short of republishing core with relative
|
|
121
|
+
// sources — silently dropping it is correct.
|
|
122
|
+
if (msg.includes('Sourcemap for ') && msg.includes('points to a source file outside its package')) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
// Missing sidecar .js.map file. A couple of community packages
|
|
126
|
+
// (e.g. `@nativescript-community/observable`) ship the `.js` with a
|
|
127
|
+
// `//# sourceMappingURL=foo.js.map` footer but never include the
|
|
128
|
+
// actual map. Vite's sourcemap loader then retries the ENOENT on
|
|
129
|
+
// every request, flooding the terminal. We cannot resolve the
|
|
130
|
+
// missing file, so suppressing the warn-level diagnostic is the
|
|
131
|
+
// least invasive fix.
|
|
132
|
+
if (msg.includes('Failed to load source map for')) {
|
|
99
133
|
return true;
|
|
100
134
|
}
|
|
101
135
|
// Vendor eval usage (third-party libs aggregated); benign
|
|
@@ -110,6 +144,33 @@ function shouldSuppressViteWarning(msg) {
|
|
|
110
144
|
if (msg.includes('Sourcemap is likely to be incorrect') && (msg.includes('analogjs-router-optimization') || msg.includes('@analogjs/vite-plugin-angular-optimizer'))) {
|
|
111
145
|
return true;
|
|
112
146
|
}
|
|
147
|
+
// "contains Angular decorators but is not in the TypeScript program."
|
|
148
|
+
//
|
|
149
|
+
// Emitted by `@analogjs/vite-plugin-angular` for any `.ts` file that
|
|
150
|
+
// has an Angular decorator (`@Injectable`, `@Component`, etc.) but
|
|
151
|
+
// isn't reachable from Angular's tsconfig program — typically because
|
|
152
|
+
// the file is dynamically imported, lives outside `tsconfig.app.json`'s
|
|
153
|
+
// `include` glob, or is loaded via a non-Angular code path
|
|
154
|
+
// (e.g. `import('./service.ts')` inside a Vite-only utility).
|
|
155
|
+
//
|
|
156
|
+
// In practice these files compile fine via our `tsFallbackTransformPlugin`
|
|
157
|
+
// (which type-strips them through Vite's oxc transformer at request
|
|
158
|
+
// time, see `helpers/workers.ts`'s ANGULAR_DECORATOR_RE skip-guard for
|
|
159
|
+
// the matching policy). Decorator metadata isn't generated for them
|
|
160
|
+
// because they're not in the Angular program — but that's exactly the
|
|
161
|
+
// expected outcome for files that don't need DI or template binding.
|
|
162
|
+
//
|
|
163
|
+
// The warning appears once per offending file at every cold boot of
|
|
164
|
+
// the dev server (50+ lines for a real app), drowning out signal
|
|
165
|
+
// without ever pointing at an actionable problem. Suppressing it
|
|
166
|
+
// matches the working contract `tsFallbackTransformPlugin`
|
|
167
|
+
// established. If a user actually does intend a file to be in the
|
|
168
|
+
// Angular program, they'll notice via Angular's own runtime errors
|
|
169
|
+
// (missing providers, unresolved templates) — which we never
|
|
170
|
+
// suppress.
|
|
171
|
+
if (msg.includes('@analogjs/vite-plugin-angular') && msg.includes('contains Angular decorators but is not in the TypeScript program')) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
113
174
|
return false;
|
|
114
175
|
}
|
|
115
176
|
//# sourceMappingURL=logging.js.map
|
package/helpers/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAYpH,IAAI,aAAkC,CAAC;AAEvC,SAAS,aAAa,CAAC,KAAgB;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,KAAK,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAC;QAClC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACnE,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,CA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IACD,wDAAwD;IACxD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,qDAAqD,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC;QAC1M,OAAO,IAAI,CAAC;IACb,CAAC;IACD,kGAAkG;IAClG,IAAI,GAAG,CAAC,QAAQ,CAAC,qCAAqC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,8BAA8B,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,yCAAyC,CAAC,CAAC,EAAE,CAAC;QACtK,OAAO,IAAI,CAAC;IACb,CAAC;IACD,sEAAsE;IACtE,EAAE;IACF,qEAAqE;IACrE,mEAAmE;IACnE,sEAAsE;IACtE,wEAAwE;IACxE,2DAA2D;IAC3D,8DAA8D;IAC9D,EAAE;IACF,2EAA2E;IAC3E,oEAAoE;IACpE,uEAAuE;IACvE,oEAAoE;IACpE,sEAAsE;IACtE,qEAAqE;IACrE,EAAE;IACF,oEAAoE;IACpE,iEAAiE;IACjE,iEAAiE;IACjE,2DAA2D;IAC3D,kEAAkE;IAClE,mEAAmE;IACnE,6DAA6D;IAC7D,YAAY;IACZ,IAAI,GAAG,CAAC,QAAQ,CAAC,+BAA+B,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,kEAAkE,CAAC,EAAE,CAAC;QACvI,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/helpers/main-entry.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type ResolvedConfig } from 'vite';
|
|
1
|
+
import { type ResolvedConfig, type ViteDevServer } from 'vite';
|
|
2
2
|
export declare function mainEntryPlugin(opts: {
|
|
3
3
|
platform: 'ios' | 'android' | 'visionos';
|
|
4
4
|
isDevMode: boolean;
|
|
5
5
|
verbose: boolean;
|
|
6
6
|
hmrActive: boolean;
|
|
7
7
|
useHttps: boolean;
|
|
8
|
+
flavor?: string;
|
|
8
9
|
}): {
|
|
9
10
|
name: string;
|
|
10
11
|
configResolved(config: ResolvedConfig): void;
|
|
12
|
+
configureServer(server: ViteDevServer): void;
|
|
11
13
|
resolveId(id: string): string;
|
|
12
14
|
load(id: string): Promise<{
|
|
13
15
|
code: string;
|