@nativescript/vite 8.0.0-alpha.2 → 8.0.0-alpha.21
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/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +380 -34
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +171 -7
- package/configuration/base.js.map +1 -1
- package/configuration/solid.js +27 -1
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +1 -1
- package/configuration/typescript.js.map +1 -1
- package/helpers/angular/angular-linker.js +3 -12
- package/helpers/angular/angular-linker.js.map +1 -1
- package/helpers/angular/inject-component-hmr-registration.d.ts +112 -0
- package/helpers/angular/inject-component-hmr-registration.js +359 -0
- package/helpers/angular/inject-component-hmr-registration.js.map +1 -0
- package/helpers/angular/inject-hmr-vite-ignore.d.ts +75 -0
- package/helpers/angular/inject-hmr-vite-ignore.js +288 -0
- package/helpers/angular/inject-hmr-vite-ignore.js.map +1 -0
- package/helpers/angular/util.d.ts +1 -0
- package/helpers/angular/util.js +88 -0
- package/helpers/angular/util.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/dev-host.d.ts +274 -0
- package/helpers/dev-host.js +491 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/global-defines.d.ts +51 -0
- package/helpers/global-defines.js +77 -0
- package/helpers/global-defines.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +63 -3
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +3 -1
- package/helpers/main-entry.js +450 -125
- package/helpers/main-entry.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/ns-core-url.d.ts +88 -0
- package/helpers/ns-core-url.js +191 -0
- package/helpers/ns-core-url.js.map +1 -0
- package/helpers/prelink-angular.js +1 -4
- package/helpers/prelink-angular.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/resolver.js +9 -1
- package/helpers/resolver.js.map +1 -1
- package/helpers/solid-jsx-deps.d.ts +15 -0
- package/helpers/solid-jsx-deps.js +178 -0
- package/helpers/solid-jsx-deps.js.map +1 -0
- package/helpers/ts-config-paths.js +50 -2
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/workers.d.ts +20 -19
- package/helpers/workers.js +620 -3
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +1 -0
- package/hmr/client/css-handler.js +34 -5
- 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/hmr-pending-overlay.d.ts +27 -0
- package/hmr/client/hmr-pending-overlay.js +50 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/index.js +491 -34
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +5 -0
- package/hmr/client/utils.js +283 -12
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/vue-sfc-update-overlay.d.ts +82 -0
- package/hmr/client/vue-sfc-update-overlay.js +133 -0
- package/hmr/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +253 -66
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/client/index.d.ts +3 -1
- package/hmr/frameworks/angular/client/index.js +802 -10
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- 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 +30 -6
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/server/strategy.js +8 -2
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/index.js +30 -45
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/helpers/ast-normalizer.js +52 -5
- 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 +13 -4
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/core-sanitize.d.ts +93 -8
- package/hmr/server/core-sanitize.js +222 -49
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/import-map.js +80 -22
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.d.ts +2 -1
- 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/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +195 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/runtime-graph-filter.d.ts +5 -0
- package/hmr/server/runtime-graph-filter.js +21 -0
- package/hmr/server/runtime-graph-filter.js.map +1 -0
- package/hmr/server/shared-transform-request.d.ts +12 -0
- package/hmr/server/shared-transform-request.js +144 -0
- package/hmr/server/shared-transform-request.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +21 -1
- package/hmr/server/vite-plugin.js +497 -58
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-angular-entry.d.ts +2 -0
- package/hmr/server/websocket-angular-entry.js +68 -0
- package/hmr/server/websocket-angular-entry.js.map +1 -0
- package/hmr/server/websocket-angular-hot-update.d.ts +78 -0
- package/hmr/server/websocket-angular-hot-update.js +413 -0
- package/hmr/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/server/websocket-core-bridge.d.ts +58 -0
- package/hmr/server/websocket-core-bridge.js +368 -0
- package/hmr/server/websocket-core-bridge.js.map +1 -0
- 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-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 +43 -0
- package/hmr/server/websocket-hmr-pending.js +55 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +6 -0
- package/hmr/server/websocket-module-bindings.js +471 -0
- package/hmr/server/websocket-module-bindings.js.map +1 -0
- package/hmr/server/websocket-module-specifiers.d.ts +101 -0
- package/hmr/server/websocket-module-specifiers.js +820 -0
- package/hmr/server/websocket-module-specifiers.js.map +1 -0
- package/hmr/server/websocket-ns-m-finalize.d.ts +22 -0
- package/hmr/server/websocket-ns-m-finalize.js +88 -0
- package/hmr/server/websocket-ns-m-finalize.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +3 -0
- package/hmr/server/websocket-ns-m-paths.js +92 -0
- package/hmr/server/websocket-ns-m-paths.js.map +1 -0
- package/hmr/server/websocket-ns-m-request.d.ts +45 -0
- package/hmr/server/websocket-ns-m-request.js +196 -0
- package/hmr/server/websocket-ns-m-request.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +36 -0
- package/hmr/server/websocket-served-module-helpers.js +644 -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 +45 -0
- package/hmr/server/websocket-txn.js.map +1 -0
- package/hmr/server/websocket-vendor-unifier.d.ts +10 -0
- package/hmr/server/websocket-vendor-unifier.js +51 -0
- package/hmr/server/websocket-vendor-unifier.js.map +1 -0
- package/hmr/server/websocket-vue-sfc.d.ts +26 -0
- package/hmr/server/websocket-vue-sfc.js +1053 -0
- package/hmr/server/websocket-vue-sfc.js.map +1 -0
- package/hmr/server/websocket.d.ts +58 -75
- package/hmr/server/websocket.js +2232 -1802
- package/hmr/server/websocket.js.map +1 -1
- 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/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 +40 -0
- package/hmr/shared/runtime/boot-progress.js +128 -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 +52 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +64 -0
- package/hmr/shared/runtime/browser-runtime-contract.js +54 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +78 -3
- package/hmr/shared/runtime/dev-overlay.js +1094 -26
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +1 -4
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
- package/hmr/shared/runtime/root-placeholder.js +1019 -151
- 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 +309 -0
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.js +1 -9
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +32 -0
- package/hmr/shared/vendor/manifest.js +411 -46
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +9 -1
- package/runtime/core-aliases-early.js +94 -67
- package/runtime/core-aliases-early.js.map +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { VendorManifest } from '../shared/vendor/manifest.js';
|
|
2
|
+
export declare function extractVitePrebundleId(spec: string): string | null;
|
|
3
|
+
export declare function getFlattenedManifestMap(manifest: VendorManifest): Map<string, string>;
|
|
4
|
+
export declare function normalizeNativeScriptCoreSpecifier(spec: string): string;
|
|
5
|
+
export declare function normalizeNodeModulesSpecifier(spec: string): string | null;
|
|
6
|
+
export declare function isEsmFrameworkPackageSpecifier(spec: string): boolean;
|
|
7
|
+
export declare function isCoreGlobalsReference(spec: string): boolean;
|
|
8
|
+
export declare function isNativeScriptCoreModule(spec: string): boolean;
|
|
9
|
+
export declare function isNativeScriptPluginModule(spec: string): boolean;
|
|
10
|
+
export declare function getBlockedDeviceNodeModulesReason(spec: string): string | null;
|
|
11
|
+
export declare function isLikelyNativeScriptRuntimePluginSpecifier(spec: string, projectRoot?: string): boolean;
|
|
12
|
+
export declare function isLikelyNativeScriptPluginSpecifier(spec: string, projectRoot?: string): boolean;
|
|
13
|
+
export declare function tryReadRawExplicitJavaScriptModule(spec: string, projectRoot: string): {
|
|
14
|
+
code: string;
|
|
15
|
+
resolvedId: string;
|
|
16
|
+
} | null;
|
|
17
|
+
export declare function stripDecoratedServePrefixes(spec: string): {
|
|
18
|
+
cleanedSpec: string;
|
|
19
|
+
bootTaggedRequest: boolean;
|
|
20
|
+
forcedVer: string | null;
|
|
21
|
+
};
|
|
22
|
+
export declare function resolveVendorFromCandidate(specifier: string | null | undefined): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a candidate URL ('/node_modules/...', '/@fs/...', or an
|
|
25
|
+
* absolute fs path) to a real file on disk under one of the allowed
|
|
26
|
+
* roots, returning the absolute fs path or `null`.
|
|
27
|
+
*
|
|
28
|
+
* `workspaceRoot` is consulted ONLY when the candidate cannot be
|
|
29
|
+
* resolved under `projectRoot` — this keeps the existing app-local
|
|
30
|
+
* behaviour identical and adds a fallback for monorepos where
|
|
31
|
+
* `node_modules/` is hoisted above the app dir (Nx, Rush, Turborepo,
|
|
32
|
+
* etc.). Without this fallback, every `/ns/m/node_modules/<hoisted-pkg>`
|
|
33
|
+
* request to the dev server's bridge fails with a "transform miss"
|
|
34
|
+
* 404 even though the file is right there at the workspace root.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveCandidateFilePath(candidate: string, projectRoot: string, workspaceRoot?: string | null): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Rewrite a `/@fs/<abs-path>` URL into a `/ns/m/<rel>` URL so the chain
|
|
39
|
+
* stays inside our HMR pipeline.
|
|
40
|
+
*
|
|
41
|
+
* Vite's transform output emits `/@fs/<abs-path>` for any module whose
|
|
42
|
+
* resolved id lives outside the configured `root` — including hoisted
|
|
43
|
+
* `node_modules/<pkg>/...` entries and workspace libraries in monorepos
|
|
44
|
+
* (Nx, Rush, Turborepo, pnpm/yarn/npm workspaces, etc.). If we leave
|
|
45
|
+
* those URLs untouched, the device fetches them through Vite's standard
|
|
46
|
+
* middleware which does NOT apply our CJS/UMD-wrapping pipeline; UMD
|
|
47
|
+
* modules like papaparse then crash because top-level `this` is
|
|
48
|
+
* `undefined` in ESM context (the `(function(root, factory) { ... })(this,
|
|
49
|
+
* function moduleFactory() { ... })` IIFE passes `undefined` as `root`
|
|
50
|
+
* and the third branch tries to do `undefined.Papa = factory()`).
|
|
51
|
+
*
|
|
52
|
+
* The conversion preserves any `?...` / `#...` suffix and tries roots in
|
|
53
|
+
* this order:
|
|
54
|
+
* 1. `projectRoot` — app-local files; mirrors the URL shape we already
|
|
55
|
+
* emit for relative imports under the app's own dir.
|
|
56
|
+
* 2. `workspaceRoot` — hoisted `node_modules` and monorepo workspace
|
|
57
|
+
* libs. The `/ns/m/` handler resolves these via its
|
|
58
|
+
* `buildFsCandidate` fallback that probes both roots.
|
|
59
|
+
*
|
|
60
|
+
* Returns `null` when the absolute path is outside both roots; the
|
|
61
|
+
* caller should then leave the original `/@fs/` URL alone (defensive).
|
|
62
|
+
*/
|
|
63
|
+
export declare function rewriteFsAbsoluteToNsM(spec: string, projectRoot: string, workspaceRoot?: string | null): string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Filter `candidates` (variations of `spec` with different extensions /
|
|
66
|
+
* `index.*`) down to those that exist on disk under `projectRoot` or
|
|
67
|
+
* `workspaceRoot`. Workspace-root-only matches are rewritten to their
|
|
68
|
+
* `/@fs/<abs-path>` form so the downstream `transformRequest` call can
|
|
69
|
+
* load them directly without having to go through Vite's bare-specifier
|
|
70
|
+
* resolver — which is gated by the package's `package.json#exports`
|
|
71
|
+
* field and refuses internal sub-paths even when the file is on disk
|
|
72
|
+
* (e.g. `css-tree/lib/syntax/index.js`).
|
|
73
|
+
*
|
|
74
|
+
* Candidates whose real path (after symlink resolution) lives OUTSIDE
|
|
75
|
+
* any `node_modules` directory are also rewritten to `/@fs/<real-path>`.
|
|
76
|
+
* Vite's built-in esbuild transform plugin excludes `node_modules` paths
|
|
77
|
+
* from TS->JS conversion, so a workspace TypeScript package re-exposed
|
|
78
|
+
* via `node_modules/<scope>/<pkg>` (a common monorepo pattern: e.g.
|
|
79
|
+
* `node_modules/@blackout/plugins -> ../../plugins/src`) would otherwise
|
|
80
|
+
* be served as raw TypeScript and fail at the device with `Missing
|
|
81
|
+
* initializer in const declaration` on type annotations like
|
|
82
|
+
* `export const X: string = '...'`. Routing through the realpath makes
|
|
83
|
+
* Vite see a non-`node_modules` path and the TS transform applies.
|
|
84
|
+
*
|
|
85
|
+
* App-local candidates whose real path is also app-local are returned
|
|
86
|
+
* unchanged so existing behaviour is preserved bit-for-bit.
|
|
87
|
+
*/
|
|
88
|
+
export declare function filterExistingNodeModulesTransformCandidates(spec: string, candidates: string[], projectRoot: string, workspaceRoot?: string | null): string[];
|
|
89
|
+
export declare function viteDepsPathToBareSpecifier(depPath: string): string | null;
|
|
90
|
+
export declare function resolveNodeModulesPackageBoundary(nodeModulesSpec: string, projectRoot: string): {
|
|
91
|
+
packageName: string;
|
|
92
|
+
subpath: string;
|
|
93
|
+
};
|
|
94
|
+
export declare function resolveInternalRuntimePluginBareSpecifier(spec: string, projectRoot: string): string | null;
|
|
95
|
+
export declare function shouldPreserveBareRuntimePluginSubpathImport(spec: string, projectRoot: string): boolean;
|
|
96
|
+
export declare function resolveVendorRouting(nodeModulesSpec: string, projectRoot: string): {
|
|
97
|
+
route: 'vendor';
|
|
98
|
+
bareSpec: string;
|
|
99
|
+
} | {
|
|
100
|
+
route: 'http';
|
|
101
|
+
} | null;
|