@thelacanians/vue-native-cli 0.3.0 → 0.4.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/dist/cli.js +52 -5
  2. package/package.json +5 -2
package/dist/cli.js CHANGED
@@ -34,12 +34,12 @@ Creating Vue Native project: ${pc.bold(name)} (template: ${template})
34
34
  typecheck: "tsc --noEmit"
35
35
  },
36
36
  dependencies: {
37
- "@thelacanians/vue-native-runtime": "^0.3.0",
38
- "@thelacanians/vue-native-navigation": "^0.3.0",
37
+ "@thelacanians/vue-native-runtime": "^0.4.0",
38
+ "@thelacanians/vue-native-navigation": "^0.4.0",
39
39
  "vue": "^3.5.0"
40
40
  },
41
41
  devDependencies: {
42
- "@thelacanians/vue-native-vite-plugin": "^0.3.0",
42
+ "@thelacanians/vue-native-vite-plugin": "^0.4.0",
43
43
  "@vitejs/plugin-vue": "^5.0.0",
44
44
  "vite": "^6.1.0",
45
45
  "typescript": "^5.7.0"
@@ -149,6 +149,15 @@ targets:
149
149
  <string>UIInterfaceOrientationLandscapeLeft</string>
150
150
  <string>UIInterfaceOrientationLandscapeRight</string>
151
151
  </array>
152
+ <!-- Uncomment the privacy descriptions for features your app uses -->
153
+ <!-- <key>NSCameraUsageDescription</key><string>This app needs camera access</string> -->
154
+ <!-- <key>NSMicrophoneUsageDescription</key><string>This app needs microphone access</string> -->
155
+ <!-- <key>NSLocationWhenInUseUsageDescription</key><string>This app needs your location</string> -->
156
+ <!-- <key>NSPhotoLibraryUsageDescription</key><string>This app needs photo library access</string> -->
157
+ <!-- <key>NSContactsUsageDescription</key><string>This app needs contacts access</string> -->
158
+ <!-- <key>NSCalendarsUsageDescription</key><string>This app needs calendar access</string> -->
159
+ <!-- <key>NSBluetoothAlwaysUsageDescription</key><string>This app needs Bluetooth access</string> -->
160
+ <!-- <key>NSFaceIDUsageDescription</key><string>This app uses Face ID for authentication</string> -->
152
161
  </dict>
153
162
  </plist>
154
163
  `);
@@ -289,7 +298,7 @@ dependencies {
289
298
  android:label="${name}"
290
299
  android:supportsRtl="true"
291
300
  android:theme="@style/Theme.AppCompat.Light.NoActionBar"
292
- android:usesCleartextTraffic="true">
301
+ android:networkSecurityConfig="@xml/network_security_config">
293
302
  <activity
294
303
  android:name=".MainActivity"
295
304
  android:exported="true">
@@ -300,6 +309,17 @@ dependencies {
300
309
  </activity>
301
310
  </application>
302
311
  </manifest>
312
+ `);
313
+ const androidResXmlDir = join(androidSrcDir, "res", "xml");
314
+ await mkdir(androidResXmlDir, { recursive: true });
315
+ await writeFile(join(androidResXmlDir, "network_security_config.xml"), `<?xml version="1.0" encoding="utf-8"?>
316
+ <network-security-config>
317
+ <domain-config cleartextTrafficPermitted="true">
318
+ <domain includeSubdomains="true">localhost</domain>
319
+ <domain includeSubdomains="true">127.0.0.1</domain>
320
+ <domain includeSubdomains="true">10.0.2.2</domain>
321
+ </domain-config>
322
+ </network-security-config>
303
323
  `);
304
324
  await writeFile(join(androidKotlinDir, "MainActivity.kt"), `package ${androidPkg}
305
325
 
@@ -356,6 +376,15 @@ local.properties
356
376
  *.apk
357
377
  *.aab
358
378
  .DS_Store
379
+
380
+ # Environment & secrets
381
+ .env
382
+ .env.local
383
+ .env.*.local
384
+ *.pem
385
+ *.key
386
+ *.keystore
387
+ *.jks
359
388
  `);
360
389
  console.log(pc.green(" Project created successfully!\n"));
361
390
  console.log(pc.white(" Next steps:\n"));
@@ -796,7 +825,13 @@ var devCommand = new Command2("dev").description("Start the Vue Native dev serve
796
825
  }
797
826
  console.log();
798
827
  }
799
- const wss = new WebSocketServer({ port });
828
+ const wss = new WebSocketServer({
829
+ port,
830
+ verifyClient: (info) => {
831
+ const addr = info.req.socket.remoteAddress;
832
+ return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
833
+ }
834
+ });
800
835
  const clients = /* @__PURE__ */ new Set();
801
836
  wss.on("connection", (ws) => {
802
837
  clients.add(ws);
@@ -1086,6 +1121,14 @@ function runAndroid(cwd, options) {
1086
1121
  env: { ...process.env }
1087
1122
  }
1088
1123
  );
1124
+ const cleanupGradle = () => {
1125
+ if (gradle && !gradle.killed) {
1126
+ gradle.kill();
1127
+ }
1128
+ };
1129
+ process.on("exit", cleanupGradle);
1130
+ process.on("SIGINT", cleanupGradle);
1131
+ process.on("SIGTERM", cleanupGradle);
1089
1132
  gradle.stdout?.on("data", (data) => {
1090
1133
  const text = data.toString().trim();
1091
1134
  if (text) {
@@ -1098,6 +1141,10 @@ function runAndroid(cwd, options) {
1098
1141
  console.log(pc3.red(` ${text}`));
1099
1142
  }
1100
1143
  });
1144
+ gradle.on("error", (err) => {
1145
+ console.error(pc3.red(` Gradle process error: ${err.message}`));
1146
+ cleanupGradle();
1147
+ });
1101
1148
  gradle.on("close", (code) => {
1102
1149
  if (code !== 0) {
1103
1150
  console.error(pc3.red(` \u2717 Gradle build failed (exit code ${code})`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thelacanians/vue-native-cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI for creating and running Vue Native apps",
5
5
  "license": "MIT",
6
6
  "author": "Vue Native Contributors",
@@ -24,6 +24,8 @@
24
24
  "scripts": {
25
25
  "build": "tsup",
26
26
  "dev": "tsup --watch",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest",
27
29
  "typecheck": "tsc --noEmit",
28
30
  "clean": "rm -rf dist"
29
31
  },
@@ -37,6 +39,7 @@
37
39
  "@types/ws": "^8.5.13",
38
40
  "@types/node": "^22.0.0",
39
41
  "tsup": "^8.4.0",
40
- "typescript": "^5.7.0"
42
+ "typescript": "^5.7.0",
43
+ "vitest": "^4.0.18"
41
44
  }
42
45
  }