@nativescript/vite 0.0.1 → 1.0.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/LICENSE +19 -0
- package/README.md +81 -0
- package/{dist/configuration → configuration}/angular.d.ts +1 -1
- package/configuration/angular.js +371 -0
- package/configuration/angular.js.map +1 -0
- package/configuration/base.d.ts +5 -0
- package/configuration/base.js +491 -0
- package/configuration/base.js.map +1 -0
- package/configuration/javascript.d.ts +4 -0
- package/configuration/javascript.js +152 -0
- package/configuration/javascript.js.map +1 -0
- package/{dist/configuration → configuration}/react.d.ts +1 -1
- package/{dist/configuration → configuration}/react.js +18 -17
- package/configuration/react.js.map +1 -0
- package/{dist/configuration → configuration}/solid.d.ts +1 -1
- package/{dist/configuration → configuration}/solid.js +17 -16
- package/configuration/solid.js.map +1 -0
- package/configuration/typescript.d.ts +4 -0
- package/configuration/typescript.js +176 -0
- package/configuration/typescript.js.map +1 -0
- package/{dist/configuration → configuration}/vue.d.ts +1 -1
- package/configuration/vue.js +163 -0
- package/configuration/vue.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +13 -0
- package/helpers/angular/angular-linker.js +189 -0
- package/helpers/angular/angular-linker.js.map +1 -0
- package/helpers/angular/shared-linker.d.ts +4 -0
- package/helpers/angular/shared-linker.js +39 -0
- package/helpers/angular/shared-linker.js.map +1 -0
- package/helpers/angular/util.d.ts +1 -0
- package/helpers/angular/util.js +67 -0
- package/helpers/angular/util.js.map +1 -0
- package/helpers/cli-flags.d.ts +1 -0
- package/helpers/cli-flags.js +15 -0
- package/helpers/cli-flags.js.map +1 -0
- package/{dist/helpers → helpers}/commonjs-plugins.js +14 -13
- package/helpers/commonjs-plugins.js.map +1 -0
- package/{dist/helpers → helpers}/config-as-json.d.ts +1 -1
- package/{dist/helpers → helpers}/config-as-json.js +7 -6
- package/helpers/config-as-json.js.map +1 -0
- package/helpers/css-platform-plugin.d.ts +10 -0
- package/helpers/css-platform-plugin.js +76 -0
- package/helpers/css-platform-plugin.js.map +1 -0
- package/helpers/css-tree.js +22 -0
- package/helpers/css-tree.js.map +1 -0
- package/{dist/helpers → helpers}/dynamic-import-plugin.js +8 -7
- package/helpers/dynamic-import-plugin.js.map +1 -0
- package/helpers/esbuild-platform-resolver.d.ts +14 -0
- package/helpers/esbuild-platform-resolver.js +93 -0
- package/helpers/esbuild-platform-resolver.js.map +1 -0
- package/helpers/external-configs.d.ts +6 -0
- package/helpers/external-configs.js +34 -0
- package/helpers/external-configs.js.map +1 -0
- package/{dist/helpers → helpers}/flavor.d.ts +1 -0
- package/helpers/flavor.js +51 -0
- package/helpers/flavor.js.map +1 -0
- package/helpers/global-defines.d.ts +25 -0
- package/helpers/global-defines.js +29 -0
- package/helpers/global-defines.js.map +1 -0
- package/helpers/init.d.ts +1 -0
- package/helpers/init.js +119 -0
- package/helpers/init.js.map +1 -0
- package/helpers/logging.d.ts +13 -0
- package/helpers/logging.js +115 -0
- package/helpers/logging.js.map +1 -0
- package/helpers/main-entry.d.ts +10 -0
- package/helpers/main-entry.js +223 -0
- package/helpers/main-entry.js.map +1 -0
- package/{dist/helpers → helpers}/module-resolution.js +4 -3
- package/helpers/module-resolution.js.map +1 -0
- package/helpers/module-runner-patch.d.ts +3 -0
- package/helpers/module-runner-patch.js +63 -0
- package/helpers/module-runner-patch.js.map +1 -0
- package/helpers/nativeclass-transform.d.ts +7 -0
- package/helpers/nativeclass-transform.js +158 -0
- package/helpers/nativeclass-transform.js.map +1 -0
- package/helpers/nativeclass-transformer-plugin.d.ts +5 -0
- package/helpers/nativeclass-transformer-plugin.js +23 -0
- package/helpers/nativeclass-transformer-plugin.js.map +1 -0
- package/{dist/helpers → helpers}/nativescript-package-resolver.js +18 -17
- package/helpers/nativescript-package-resolver.js.map +1 -0
- package/helpers/ns-cli-plugins.d.ts +14 -0
- package/helpers/ns-cli-plugins.js +165 -0
- package/helpers/ns-cli-plugins.js.map +1 -0
- package/helpers/package-platform-aliases.d.ts +10 -0
- package/{dist/helpers → helpers}/package-platform-aliases.js +19 -23
- package/helpers/package-platform-aliases.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +13 -0
- package/helpers/postcss-platform-config.js +97 -0
- package/helpers/postcss-platform-config.js.map +1 -0
- package/helpers/prelink-angular.d.ts +2 -0
- package/helpers/prelink-angular.js +117 -0
- package/helpers/prelink-angular.js.map +1 -0
- package/helpers/preserve-imports.d.ts +2 -0
- package/helpers/preserve-imports.js +38 -0
- package/helpers/preserve-imports.js.map +1 -0
- package/{dist/helpers → helpers}/project.js +2 -4
- package/helpers/project.js.map +1 -0
- package/helpers/resolver.d.ts +4 -0
- package/{dist/helpers → helpers}/resolver.js +7 -6
- package/helpers/resolver.js.map +1 -0
- package/helpers/theme-core-plugins.d.ts +14 -0
- package/helpers/theme-core-plugins.js +121 -0
- package/helpers/theme-core-plugins.js.map +1 -0
- package/helpers/ts-config-paths.d.ts +10 -0
- package/{dist/helpers → helpers}/ts-config-paths.js +73 -72
- package/helpers/ts-config-paths.js.map +1 -0
- package/{dist/helpers → helpers}/utils.d.ts +10 -0
- package/helpers/utils.js +143 -0
- package/helpers/utils.js.map +1 -0
- package/{dist/helpers → helpers}/workers.js +15 -16
- package/helpers/workers.js.map +1 -0
- package/hmr/client/css-handler.d.ts +4 -0
- package/hmr/client/css-handler.js +78 -0
- package/hmr/client/css-handler.js.map +1 -0
- package/hmr/client/index.d.ts +13 -0
- package/hmr/client/index.js +1723 -0
- package/hmr/client/index.js.map +1 -0
- package/hmr/client/utils.d.ts +38 -0
- package/hmr/client/utils.js +426 -0
- package/hmr/client/utils.js.map +1 -0
- package/hmr/entry-runtime.d.ts +8 -0
- package/hmr/entry-runtime.js +135 -0
- package/hmr/entry-runtime.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +8 -0
- package/hmr/frameworks/angular/client/index.js +59 -0
- package/hmr/frameworks/angular/client/index.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.d.ts +1 -0
- package/hmr/frameworks/angular/server/linker.js +101 -0
- package/hmr/frameworks/angular/server/linker.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.d.ts +2 -0
- package/hmr/frameworks/angular/server/strategy.js +187 -0
- package/hmr/frameworks/angular/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.d.ts +2 -0
- package/hmr/frameworks/solid/server/strategy.js +56 -0
- package/hmr/frameworks/solid/server/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.d.ts +2 -0
- package/hmr/frameworks/typescript/server/strategy.js +125 -0
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +22 -0
- package/hmr/frameworks/vue/client/index.js +1541 -0
- package/hmr/frameworks/vue/client/index.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +11 -0
- package/hmr/frameworks/vue/server/compiler.js +26 -0
- package/hmr/frameworks/vue/server/compiler.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-transforms.d.ts +14 -0
- package/hmr/frameworks/vue/server/sfc-transforms.js +282 -0
- package/hmr/frameworks/vue/server/sfc-transforms.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +2 -0
- package/hmr/frameworks/vue/server/strategy.js +272 -0
- package/hmr/frameworks/vue/server/strategy.js.map +1 -0
- package/hmr/helpers/ast-extract.d.ts +6 -0
- package/hmr/helpers/ast-extract.js +72 -0
- package/hmr/helpers/ast-extract.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +7 -0
- package/hmr/helpers/ast-normalizer.js +772 -0
- package/hmr/helpers/ast-normalizer.js.map +1 -0
- package/hmr/helpers/babel.d.ts +3 -0
- package/hmr/helpers/babel.js +17 -0
- package/hmr/helpers/babel.js.map +1 -0
- package/hmr/helpers/sanitize.d.ts +6 -0
- package/hmr/helpers/sanitize.js +55 -0
- package/hmr/helpers/sanitize.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -0
- package/hmr/helpers/vendor-rewrite.js +35 -0
- package/hmr/helpers/vendor-rewrite.js.map +1 -0
- package/hmr/server/compiler.d.ts +2 -0
- package/hmr/server/compiler.js +75 -0
- package/hmr/server/compiler.js.map +1 -0
- package/hmr/server/constants.d.ts +14 -0
- package/hmr/server/constants.js +23 -0
- package/hmr/server/constants.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +32 -0
- package/hmr/server/core-sanitize.js +134 -0
- package/hmr/server/core-sanitize.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +68 -0
- package/hmr/server/framework-strategy.js +2 -0
- package/hmr/server/framework-strategy.js.map +1 -0
- package/hmr/server/index.d.ts +5 -0
- package/hmr/server/index.js +23 -0
- package/hmr/server/index.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +5 -0
- package/hmr/server/vite-plugin.js +44 -0
- package/hmr/server/vite-plugin.js.map +1 -0
- package/hmr/server/websocket.d.ts +21 -0
- package/hmr/server/websocket.js +5619 -0
- package/hmr/server/websocket.js.map +1 -0
- package/hmr/shared/runtime/http-only-boot.d.ts +1 -0
- package/hmr/shared/runtime/http-only-boot.js +107 -0
- package/hmr/shared/runtime/http-only-boot.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
- package/hmr/shared/runtime/root-placeholder.js +142 -0
- package/hmr/shared/runtime/root-placeholder.js.map +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.d.ts +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.js +134 -0
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +9 -0
- package/hmr/shared/vendor/manifest-loader.js +38 -0
- package/hmr/shared/vendor/manifest-loader.js.map +1 -0
- package/hmr/shared/vendor/manifest.d.ts +35 -0
- package/hmr/shared/vendor/manifest.js +811 -0
- package/hmr/shared/vendor/manifest.js.map +1 -0
- package/hmr/shared/vendor/registry.d.ts +9 -0
- package/hmr/shared/vendor/registry.js +62 -0
- package/hmr/shared/vendor/registry.js.map +1 -0
- package/hmr/vendor-bootstrap.d.ts +3 -0
- package/hmr/vendor-bootstrap.js +32 -0
- package/hmr/vendor-bootstrap.js.map +1 -0
- package/{dist/index.d.ts → index.d.ts} +2 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/package.json +42 -30
- package/{dist/polyfills → polyfills}/mdn-data-at-rules.js +1 -0
- package/polyfills/mdn-data-at-rules.js.map +1 -0
- package/{dist/polyfills → polyfills}/mdn-data-properties.js +1 -0
- package/polyfills/mdn-data-properties.js.map +1 -0
- package/{dist/polyfills → polyfills}/mdn-data-syntaxes.js +1 -0
- package/polyfills/mdn-data-syntaxes.js.map +1 -0
- package/{dist/polyfills → polyfills}/module.js +1 -0
- package/polyfills/module.js.map +1 -0
- package/runtime/core-aliases-early.d.ts +1 -0
- package/runtime/core-aliases-early.js +334 -0
- package/runtime/core-aliases-early.js.map +1 -0
- package/shims/angular-animations-stub.d.ts +68 -0
- package/shims/angular-animations-stub.js +140 -0
- package/shims/angular-animations-stub.js.map +1 -0
- package/shims/node-module.d.ts +5 -0
- package/shims/node-module.js +13 -0
- package/shims/node-module.js.map +1 -0
- package/{dist/shims → shims}/react-reconciler-constants.js +2 -1
- package/shims/react-reconciler-constants.js.map +1 -0
- package/{dist/shims → shims}/react-reconciler.js +1 -0
- package/shims/react-reconciler.js.map +1 -0
- package/{dist/shims → shims}/set-value.js +5 -1
- package/shims/set-value.js.map +1 -0
- package/transformers/NativeClass/index.d.ts +2 -0
- package/transformers/NativeClass/index.js +222 -0
- package/transformers/NativeClass/index.js.map +1 -0
- package/dist/configuration/angular.js +0 -30
- package/dist/configuration/base.d.ts +0 -13
- package/dist/configuration/base.js +0 -228
- package/dist/configuration/old-without-merge-base.d.ts +0 -13
- package/dist/configuration/old-without-merge-base.js +0 -249
- package/dist/configuration/vue.js +0 -45
- package/dist/helpers/css-tree.js +0 -21
- package/dist/helpers/flavor.js +0 -40
- package/dist/helpers/global-defines.d.ts +0 -14
- package/dist/helpers/global-defines.js +0 -18
- package/dist/helpers/main-entry.d.ts +0 -5
- package/dist/helpers/main-entry.js +0 -75
- package/dist/helpers/ns-cli-plugins.d.ts +0 -17
- package/dist/helpers/ns-cli-plugins.js +0 -128
- package/dist/helpers/package-platform-aliases.d.ts +0 -4
- package/dist/helpers/resolver.d.ts +0 -4
- package/dist/helpers/ts-config-paths.d.ts +0 -4
- package/dist/helpers/utils.js +0 -94
- package/dist/hmr/hmr-angular.d.ts +0 -1
- package/dist/hmr/hmr-angular.js +0 -34
- package/dist/hmr/hmr-bridge.d.ts +0 -18
- package/dist/hmr/hmr-bridge.js +0 -154
- package/dist/hmr/hmr-client.d.ts +0 -5
- package/dist/hmr/hmr-client.js +0 -93
- package/dist/hmr/hmr-server.d.ts +0 -20
- package/dist/hmr/hmr-server.js +0 -179
- package/dist/index.js +0 -5
- package/dist/transformers/NativeClass/index.d.ts +0 -5
- package/dist/transformers/NativeClass/index.js +0 -46
- /package/{dist/helpers → helpers}/commonjs-plugins.d.ts +0 -0
- /package/{dist/helpers → helpers}/css-tree.d.ts +0 -0
- /package/{dist/helpers → helpers}/dynamic-import-plugin.d.ts +0 -0
- /package/{dist/helpers → helpers}/module-resolution.d.ts +0 -0
- /package/{dist/helpers → helpers}/nativescript-package-resolver.d.ts +0 -0
- /package/{dist/helpers → helpers}/project.d.ts +0 -0
- /package/{dist/helpers → helpers}/workers.d.ts +0 -0
- /package/{dist/polyfills → polyfills}/mdn-data-at-rules.d.ts +0 -0
- /package/{dist/polyfills → polyfills}/mdn-data-properties.d.ts +0 -0
- /package/{dist/polyfills → polyfills}/mdn-data-syntaxes.d.ts +0 -0
- /package/{dist/polyfills → polyfills}/module.d.ts +0 -0
- /package/{dist/shims → shims}/react-reconciler-constants.d.ts +0 -0
- /package/{dist/shims → shims}/react-reconciler.d.ts +0 -0
- /package/{dist/shims → shims}/set-value.d.ts +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Root placeholder installer used during dev HMR until HTTP ESM loads.
|
|
2
|
+
export function installRootPlaceholder(verbose) {
|
|
3
|
+
const g = globalThis;
|
|
4
|
+
if (g['__NS_DEV_PLACEHOLDER_ROOT_EARLY__'])
|
|
5
|
+
return;
|
|
6
|
+
g['__NS_DEV_PLACEHOLDER_ROOT_EARLY__'] = true;
|
|
7
|
+
try {
|
|
8
|
+
const getCore = (name) => {
|
|
9
|
+
try {
|
|
10
|
+
const reg = g.__nsVendorRegistry;
|
|
11
|
+
const req = reg?.get ? g.__nsVendorRequire || g.__nsRequire || g.require : g.__nsRequire || g.require;
|
|
12
|
+
let mod = null;
|
|
13
|
+
if (reg && reg.has('@nativescript/core'))
|
|
14
|
+
mod = reg.get('@nativescript/core');
|
|
15
|
+
else if (typeof req === 'function') {
|
|
16
|
+
try {
|
|
17
|
+
mod = req('@nativescript/core');
|
|
18
|
+
}
|
|
19
|
+
catch { }
|
|
20
|
+
}
|
|
21
|
+
const ns = (mod && (mod.default ?? mod)) || mod;
|
|
22
|
+
if (name === 'Application' && ns && (ns.Application || ns))
|
|
23
|
+
return ns.Application || ns;
|
|
24
|
+
if (ns && ns[name])
|
|
25
|
+
return ns[name];
|
|
26
|
+
}
|
|
27
|
+
catch { }
|
|
28
|
+
try {
|
|
29
|
+
const nr = g.__nativeRequire;
|
|
30
|
+
if (typeof nr === 'function') {
|
|
31
|
+
try {
|
|
32
|
+
const mod = nr('@nativescript/core', '/');
|
|
33
|
+
const ns = (mod && (mod.default ?? mod)) || mod;
|
|
34
|
+
if (name === 'Application' && ns && (ns.Application || ns))
|
|
35
|
+
return ns.Application || ns;
|
|
36
|
+
if (ns && ns[name])
|
|
37
|
+
return ns[name];
|
|
38
|
+
}
|
|
39
|
+
catch { }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch { }
|
|
43
|
+
return undefined;
|
|
44
|
+
};
|
|
45
|
+
const Application = getCore('Application');
|
|
46
|
+
const Frame = getCore('Frame');
|
|
47
|
+
const Page = getCore('Page');
|
|
48
|
+
const Label = getCore('Label');
|
|
49
|
+
if (!Application || !Frame || !Page || !Label) {
|
|
50
|
+
try {
|
|
51
|
+
console.warn('[ns-entry] (early) core classes unavailable for placeholder');
|
|
52
|
+
}
|
|
53
|
+
catch { }
|
|
54
|
+
}
|
|
55
|
+
const __ns_launch_handler = (args) => {
|
|
56
|
+
try {
|
|
57
|
+
const prev = args?.root;
|
|
58
|
+
if (verbose)
|
|
59
|
+
console.info('[ns-entry] (early) launchEvent fired; existing root:', !!prev);
|
|
60
|
+
if (!prev && Frame && Page && Label) {
|
|
61
|
+
const page = new Page();
|
|
62
|
+
page.actionBarHidden = true;
|
|
63
|
+
const label = new Label();
|
|
64
|
+
label.text = 'Starting NativeScript + Vite dev server…';
|
|
65
|
+
label.textAlignment = 'center';
|
|
66
|
+
label.padding = 12;
|
|
67
|
+
page.content = label;
|
|
68
|
+
const frame = new Frame();
|
|
69
|
+
frame.navigate({ create: () => page, clearHistory: true, animated: false });
|
|
70
|
+
try {
|
|
71
|
+
frame.__ns_dev_placeholder = true;
|
|
72
|
+
page.__ns_dev_placeholder = true;
|
|
73
|
+
g['__NS_DEV_PLACEHOLDER_ROOT_VIEW__'] = frame;
|
|
74
|
+
}
|
|
75
|
+
catch { }
|
|
76
|
+
if (args)
|
|
77
|
+
args.root = frame;
|
|
78
|
+
if (verbose)
|
|
79
|
+
console.info('[ns-entry] (early) temporary root provided via launch args');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
try {
|
|
84
|
+
console.error('[ns-entry] (early) temp root error', e);
|
|
85
|
+
}
|
|
86
|
+
catch { }
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
g['__NS_DEV_LAUNCH_HANDLER__'] = __ns_launch_handler;
|
|
91
|
+
}
|
|
92
|
+
catch { }
|
|
93
|
+
try {
|
|
94
|
+
if (!g['__NS_DEV_LAUNCH_ATTACHED__'] && Application && Application.on) {
|
|
95
|
+
Application.on(Application.launchEvent, __ns_launch_handler);
|
|
96
|
+
g['__NS_DEV_LAUNCH_ATTACHED__'] = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch { }
|
|
100
|
+
try {
|
|
101
|
+
g['__NS_DEV_RESTORE_PLACEHOLDER__'] = () => {
|
|
102
|
+
try {
|
|
103
|
+
if (g['__NS_DEV_LAUNCH_HANDLER__'] && Application && Application.off) {
|
|
104
|
+
Application.off(Application.launchEvent, g['__NS_DEV_LAUNCH_HANDLER__']);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch { }
|
|
108
|
+
// Clear flags and drop any retained placeholder Frame reference
|
|
109
|
+
try {
|
|
110
|
+
delete g['__NS_DEV_PLACEHOLDER_ROOT_EARLY__'];
|
|
111
|
+
}
|
|
112
|
+
catch { }
|
|
113
|
+
try {
|
|
114
|
+
delete g['__NS_DEV_LAUNCH_ATTACHED__'];
|
|
115
|
+
}
|
|
116
|
+
catch { }
|
|
117
|
+
try {
|
|
118
|
+
const fr = g['__NS_DEV_PLACEHOLDER_ROOT_VIEW__'];
|
|
119
|
+
if (fr && typeof fr._removeFromSuperview === 'function') {
|
|
120
|
+
try {
|
|
121
|
+
fr._removeFromSuperview();
|
|
122
|
+
}
|
|
123
|
+
catch { }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch { }
|
|
127
|
+
try {
|
|
128
|
+
delete g['__NS_DEV_PLACEHOLDER_ROOT_VIEW__'];
|
|
129
|
+
}
|
|
130
|
+
catch { }
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch { }
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
try {
|
|
137
|
+
console.error('[ns-entry] (early) failed to install launchEvent handler', e);
|
|
138
|
+
}
|
|
139
|
+
catch { }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=root-placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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EAAE,CAAC;wBACzD,IAAI,CAAC;4BACJ,EAAE,CAAC,oBAAoB,EAAE,CAAC;wBAC3B,CAAC;wBAAC,MAAM,CAAC,CAAA,CAAC;oBACX,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;gBACV,IAAI,CAAC;oBACJ,OAAO,CAAC,CAAC,kCAAkC,CAAC,CAAC;gBAC9C,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;YACX,CAAC,CAAC;QACH,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,IAAI,CAAC;YACJ,OAAO,CAAC,KAAK,CAAC,0DAA0D,EAAE,CAAC,CAAC,CAAC;QAC9E,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installVendorBootstrap(vendorManifest: any, __nsVendorModuleMap: Record<string, any>, verbose?: boolean): void;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Vendor bootstrap runtime installer. This runs on device (virtual entry) and must avoid
|
|
2
|
+
// define-transform pitfalls (no dot-notation writes on globalThis; use defineProperty or bracket form).
|
|
3
|
+
export function installVendorBootstrap(vendorManifest, __nsVendorModuleMap, verbose) {
|
|
4
|
+
const g = globalThis;
|
|
5
|
+
const setGlobal = (k, v) => {
|
|
6
|
+
try {
|
|
7
|
+
Object.defineProperty(g, k, { value: v, configurable: true, writable: true });
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
try {
|
|
11
|
+
g[k] = v;
|
|
12
|
+
}
|
|
13
|
+
catch { }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const manifest = vendorManifest ?? {};
|
|
17
|
+
let registry = g['__nsVendorRegistry'];
|
|
18
|
+
if (!registry)
|
|
19
|
+
setGlobal('__nsVendorRegistry', (registry = new Map()));
|
|
20
|
+
const aliases = new Map(Object.entries(manifest.aliases ?? {}));
|
|
21
|
+
const modules = __nsVendorModuleMap ?? {};
|
|
22
|
+
const previousHash = g['__nsVendorHash'];
|
|
23
|
+
if (previousHash === manifest.hash && registry.size > 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
registry.clear();
|
|
27
|
+
try {
|
|
28
|
+
setGlobal('__nsVendorHash', manifest.hash);
|
|
29
|
+
}
|
|
30
|
+
catch { }
|
|
31
|
+
try {
|
|
32
|
+
setGlobal('__nsVendorManifest', manifest);
|
|
33
|
+
}
|
|
34
|
+
catch { }
|
|
35
|
+
for (const id of Object.keys(modules)) {
|
|
36
|
+
if (!aliases.has(id))
|
|
37
|
+
aliases.set(id, id);
|
|
38
|
+
}
|
|
39
|
+
for (const [id, mod] of Object.entries(modules)) {
|
|
40
|
+
registry.set(id, mod);
|
|
41
|
+
}
|
|
42
|
+
const baseRequire = typeof g.require === 'function' ? g.require.bind(g) : undefined;
|
|
43
|
+
if (!g['__nsBaseRequire'] && baseRequire) {
|
|
44
|
+
try {
|
|
45
|
+
setGlobal('__nsBaseRequire', baseRequire);
|
|
46
|
+
}
|
|
47
|
+
catch { }
|
|
48
|
+
}
|
|
49
|
+
const resolve = (id) => {
|
|
50
|
+
const normalized = String(id ?? '').replace(/[?#].*$/, '');
|
|
51
|
+
if (registry.has(normalized))
|
|
52
|
+
return normalized;
|
|
53
|
+
if (modules[normalized])
|
|
54
|
+
return normalized;
|
|
55
|
+
// direct alias
|
|
56
|
+
const direct = aliases.get(normalized);
|
|
57
|
+
if (direct)
|
|
58
|
+
return direct;
|
|
59
|
+
// normalize slashes for alias lookups
|
|
60
|
+
const slashNorm = normalized.replace(/\\/g, '/');
|
|
61
|
+
const aliasNormalized = aliases.get(slashNorm) || aliases.get(slashNorm);
|
|
62
|
+
if (aliasNormalized)
|
|
63
|
+
return aliasNormalized;
|
|
64
|
+
return normalized;
|
|
65
|
+
};
|
|
66
|
+
try {
|
|
67
|
+
setGlobal('__nsResolveVendor', resolve);
|
|
68
|
+
}
|
|
69
|
+
catch { }
|
|
70
|
+
const ensureModule = (id) => {
|
|
71
|
+
const canonical = resolve(id);
|
|
72
|
+
if (registry.has(canonical))
|
|
73
|
+
return registry.get(canonical);
|
|
74
|
+
if (modules[canonical]) {
|
|
75
|
+
const mod = modules[canonical];
|
|
76
|
+
registry.set(canonical, mod);
|
|
77
|
+
return mod;
|
|
78
|
+
}
|
|
79
|
+
const late = typeof g['__nsBaseRequire'] === 'function' ? g['__nsBaseRequire'] : typeof g.require === 'function' ? g.require.bind(g) : undefined;
|
|
80
|
+
if (late)
|
|
81
|
+
return late(id);
|
|
82
|
+
throw new Error('[ns-vendor] Module not available: ' + id + ' (canonical: ' + canonical + ')');
|
|
83
|
+
};
|
|
84
|
+
const existingNsRequire = g['__nsRequire'];
|
|
85
|
+
try {
|
|
86
|
+
setGlobal('__nsRequire', typeof existingNsRequire === 'function'
|
|
87
|
+
? (id) => {
|
|
88
|
+
try {
|
|
89
|
+
return ensureModule(id);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
try {
|
|
93
|
+
return existingNsRequire(id);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
const late = typeof g['__nsBaseRequire'] === 'function' ? g['__nsBaseRequire'] : typeof g.require === 'function' ? g.require.bind(g) : undefined;
|
|
97
|
+
if (late)
|
|
98
|
+
return late(id);
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
: ensureModule);
|
|
104
|
+
}
|
|
105
|
+
catch { }
|
|
106
|
+
try {
|
|
107
|
+
setGlobal('__nsVendorAliases', aliases);
|
|
108
|
+
}
|
|
109
|
+
catch { }
|
|
110
|
+
try {
|
|
111
|
+
setGlobal('require', g['__nsRequire']);
|
|
112
|
+
}
|
|
113
|
+
catch { }
|
|
114
|
+
try {
|
|
115
|
+
setGlobal('__nsRequireIsShim', true);
|
|
116
|
+
}
|
|
117
|
+
catch { }
|
|
118
|
+
try {
|
|
119
|
+
setGlobal('__nsVendorRequire', g['__nsRequire']);
|
|
120
|
+
}
|
|
121
|
+
catch { }
|
|
122
|
+
if (verbose) {
|
|
123
|
+
try {
|
|
124
|
+
console.info('[ns-entry] vendor manifest applied', (g['__nsVendorManifest'] || {}).hash);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
try {
|
|
128
|
+
console.info('[ns-entry] vendor manifest applied');
|
|
129
|
+
}
|
|
130
|
+
catch { }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=vendor-bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor-bootstrap.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/vendor-bootstrap.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wGAAwG;AACxG,MAAM,UAAU,sBAAsB,CAAC,cAAmB,EAAE,mBAAwC,EAAE,OAAiB;IACtH,MAAM,CAAC,GAAQ,UAAiB,CAAC;IACjC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,CAAM,EAAE,EAAE;QACvC,IAAI,CAAC;YACJ,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/E,CAAC;QAAC,MAAM,CAAC;YACR,IAAI,CAAC;gBACJ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACV,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACX,CAAC;IACF,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,IAAI,EAAE,CAAC;IACtC,IAAI,QAAQ,GAAqB,CAAC,CAAC,oBAAoB,CAAC,CAAC;IACzD,IAAI,CAAC,QAAQ;QAAE,SAAS,CAAC,oBAAoB,EAAE,CAAC,QAAQ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AI,IAAI;4BAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;wBAC1B,MAAM,KAAK,CAAC;oBACb,CAAC;gBACF,CAAC;YACF,CAAC;YACF,CAAC,CAAC,YAAY,CACf,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,IAAI,CAAC;QACJ,SAAS,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,SAAS,CAAC,mBAAmB,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,CAAC;YACJ,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1F,CAAC;QAAC,MAAM,CAAC;YACR,IAAI,CAAC;gBACJ,OAAO,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;YACpD,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACX,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VendorManifest } from './manifest.js';
|
|
2
|
+
/**
|
|
3
|
+
* Attempt to load a previously generated vendor manifest from the NativeScript
|
|
4
|
+
* pre-bundled output directory (.ns-vite-build/ns-vendor-manifest.json).
|
|
5
|
+
* This allows the dev HMR WebSocket plugin to bootstrap vendor awareness even
|
|
6
|
+
* before a fresh dev-server generation path runs (helpful when the app was
|
|
7
|
+
* launched from a prebuilt bundle and HMR attaches later).
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadPrebuiltVendorManifest(projectRoot: string, verbose?: boolean): VendorManifest | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { registerVendorManifest } from './registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* Attempt to load a previously generated vendor manifest from the NativeScript
|
|
6
|
+
* pre-bundled output directory (.ns-vite-build/ns-vendor-manifest.json).
|
|
7
|
+
* This allows the dev HMR WebSocket plugin to bootstrap vendor awareness even
|
|
8
|
+
* before a fresh dev-server generation path runs (helpful when the app was
|
|
9
|
+
* launched from a prebuilt bundle and HMR attaches later).
|
|
10
|
+
*/
|
|
11
|
+
export function loadPrebuiltVendorManifest(projectRoot, verbose = false) {
|
|
12
|
+
try {
|
|
13
|
+
const buildDir = path.join(projectRoot, '.ns-vite-build');
|
|
14
|
+
const manifestPath = path.join(buildDir, 'ns-vendor-manifest.json');
|
|
15
|
+
if (!existsSync(manifestPath)) {
|
|
16
|
+
if (verbose) {
|
|
17
|
+
console.log('[vendor-loader] No prebuilt vendor manifest at', manifestPath);
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const raw = readFileSync(manifestPath, 'utf8');
|
|
22
|
+
const json = JSON.parse(raw);
|
|
23
|
+
if (json && json.modules) {
|
|
24
|
+
registerVendorManifest(json);
|
|
25
|
+
if (verbose) {
|
|
26
|
+
console.log('[vendor-loader] Loaded prebuilt vendor manifest with', Object.keys(json.modules).length, 'modules');
|
|
27
|
+
}
|
|
28
|
+
// Expose globally (node side) for easier inspection in dev tools.
|
|
29
|
+
globalThis.__NS_VENDOR_MANIFEST__ = json;
|
|
30
|
+
return json;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
console.warn('[vendor-loader] Failed to load vendor manifest:', e);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=manifest-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-loader.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/vendor/manifest-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,WAAmB,EAAE,OAAO,GAAG,KAAK;IAC9E,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAC;QACpE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC/B,IAAI,OAAO,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,gDAAgD,EAAE,YAAY,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC;QACD,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAmB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC1B,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,OAAO,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,sDAAsD,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAClH,CAAC;YACD,kEAAkE;YACjE,UAAkB,CAAC,sBAAsB,GAAG,IAAI,CAAC;YAClD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
interface VendorManifestModuleEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
exports: Record<string, boolean>;
|
|
5
|
+
}
|
|
6
|
+
interface VendorManifest {
|
|
7
|
+
version: number;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
hash: string;
|
|
10
|
+
modules: Record<string, VendorManifestModuleEntry>;
|
|
11
|
+
aliases: Record<string, string>;
|
|
12
|
+
}
|
|
13
|
+
interface VendorBundleResult {
|
|
14
|
+
code: string;
|
|
15
|
+
manifest: VendorManifest;
|
|
16
|
+
entries: string[];
|
|
17
|
+
}
|
|
18
|
+
interface VendorManifestPluginOptions {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
platform: string;
|
|
21
|
+
mode: 'development' | 'production';
|
|
22
|
+
verbose?: boolean;
|
|
23
|
+
emitAssets?: boolean;
|
|
24
|
+
flavor?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const VENDOR_MANIFEST_ID = "@nativescript/vendor-manifest";
|
|
27
|
+
export declare const VENDOR_MANIFEST_VIRTUAL_ID: string;
|
|
28
|
+
export declare const VENDOR_BUNDLE_ID = "@nativescript/vendor";
|
|
29
|
+
export declare const VENDOR_BUNDLE_VIRTUAL_ID: string;
|
|
30
|
+
export declare const SERVER_VENDOR_PATH = "/@nativescript/vendor.mjs";
|
|
31
|
+
export declare const SERVER_MANIFEST_PATH = "/@nativescript/vendor-manifest.json";
|
|
32
|
+
export declare const DEFAULT_VENDOR_FILENAME = "ns-vendor.mjs";
|
|
33
|
+
export declare const DEFAULT_MANIFEST_FILENAME = "ns-vendor-manifest.json";
|
|
34
|
+
export declare function vendorManifestPlugin(options: VendorManifestPluginOptions): Plugin;
|
|
35
|
+
export type { VendorManifest, VendorManifestModuleEntry, VendorBundleResult };
|