@nativescript/vite 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/bin/cli.cjs +32 -0
  2. package/package.json +1 -1
package/bin/cli.cjs ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Small CommonJS launcher that forwards to the ESM library's init helper.
4
+ // This allows `npx @nativescript/vite init` to work reliably across npm versions.
5
+
6
+ (async () => {
7
+ try {
8
+ const mod = await import('../dist/index.cjs').catch(async () => import('../index.js'));
9
+ if (process.argv[2] === 'init') {
10
+ if (typeof mod.runInit === 'function') {
11
+ await mod.runInit();
12
+ } else if (mod && mod.helpers && typeof mod.helpers.runInit === 'function') {
13
+ await mod.helpers.runInit();
14
+ } else if (mod && mod.default && typeof mod.default.runInit === 'function') {
15
+ await mod.default.runInit();
16
+ } else {
17
+ const initMod = await import('../helpers/init.js');
18
+ if (typeof initMod.runInit === 'function') {
19
+ await initMod.runInit();
20
+ } else {
21
+ console.error('[@nativescript/vite] `runInit` not found in helpers.');
22
+ process.exitCode = 1;
23
+ }
24
+ }
25
+ } else {
26
+ console.log('Usage: npx @nativescript/vite init');
27
+ }
28
+ } catch (err) {
29
+ console.error('[@nativescript/vite] CLI failed:', err && err.message ? err.message : err);
30
+ process.exitCode = 1;
31
+ }
32
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/vite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Vite for NativeScript",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",