@thelacanians/vue-native-cli 0.6.4 → 0.6.5
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/dist/cli.js +19 -14
- package/native/android/VueNativeCore/build.gradle.kts +15 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { program } from "commander";
|
|
5
5
|
import pc6 from "picocolors";
|
|
6
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
7
|
+
import { dirname as dirname2, join as join7 } from "path";
|
|
8
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
6
9
|
|
|
7
10
|
// src/commands/build.ts
|
|
8
11
|
import { Command } from "commander";
|
|
@@ -346,28 +349,28 @@ import { join as join3, dirname } from "path";
|
|
|
346
349
|
import { fileURLToPath } from "url";
|
|
347
350
|
import { existsSync as existsSync3, readFileSync } from "fs";
|
|
348
351
|
import pc2 from "picocolors";
|
|
349
|
-
var VERSION = "0.6.2";
|
|
350
352
|
function getTemplateVersions() {
|
|
351
353
|
try {
|
|
352
|
-
const
|
|
353
|
-
const
|
|
354
|
-
const
|
|
355
|
-
const
|
|
356
|
-
const viteVuePluginDevDep = pkg.devDependencies?.["@vitejs/plugin-vue"];
|
|
354
|
+
const cliDir2 = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
355
|
+
const pkg2 = JSON.parse(readFileSync(join3(cliDir2, "package.json"), "utf8"));
|
|
356
|
+
const viteDevDep = pkg2.devDependencies?.vite;
|
|
357
|
+
const viteVuePluginDevDep = pkg2.devDependencies?.["@vitejs/plugin-vue"];
|
|
357
358
|
return {
|
|
358
|
-
|
|
359
|
+
NATIVE_VERSION: pkg2.version,
|
|
360
|
+
JS_PACKAGE_VERSION: `^${pkg2.version}`,
|
|
359
361
|
VITE_PLUGIN_VUE_VERSION: viteVuePluginDevDep ?? "^6.0.5",
|
|
360
362
|
VITE_VERSION: viteDevDep ?? "^8.0.0"
|
|
361
363
|
};
|
|
362
364
|
} catch {
|
|
363
365
|
return {
|
|
364
|
-
|
|
366
|
+
NATIVE_VERSION: "0.0.0",
|
|
367
|
+
JS_PACKAGE_VERSION: "^0.0.0",
|
|
365
368
|
VITE_PLUGIN_VUE_VERSION: "^6.0.5",
|
|
366
369
|
VITE_VERSION: "^8.0.0"
|
|
367
370
|
};
|
|
368
371
|
}
|
|
369
372
|
}
|
|
370
|
-
var { JS_PACKAGE_VERSION, VITE_PLUGIN_VUE_VERSION, VITE_VERSION } = getTemplateVersions();
|
|
373
|
+
var { NATIVE_VERSION, JS_PACKAGE_VERSION, VITE_PLUGIN_VUE_VERSION, VITE_VERSION } = getTemplateVersions();
|
|
371
374
|
var VALID_NAME = /^[a-zA-Z0-9_-]+$/i;
|
|
372
375
|
var createCommand = new Command2("create").description("Create a new Vue Native project").argument("<name>", "project name").option("-t, --template <template>", "project template (blank, tabs, drawer)", "blank").action(async (name, options) => {
|
|
373
376
|
const template = options.template;
|
|
@@ -450,7 +453,7 @@ options:
|
|
|
450
453
|
packages:
|
|
451
454
|
VueNativeCore:
|
|
452
455
|
url: https://github.com/abdul-hamid-achik/vue-native
|
|
453
|
-
from: "${
|
|
456
|
+
from: "${NATIVE_VERSION}"
|
|
454
457
|
|
|
455
458
|
targets:
|
|
456
459
|
${xcodeProjectName}:
|
|
@@ -679,7 +682,7 @@ android {
|
|
|
679
682
|
}
|
|
680
683
|
|
|
681
684
|
dependencies {
|
|
682
|
-
implementation("com.vuenative:core:${
|
|
685
|
+
implementation("com.vuenative:core:${NATIVE_VERSION}")
|
|
683
686
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
|
684
687
|
implementation("com.google.android.material:material:1.12.0")
|
|
685
688
|
implementation("androidx.core:core-ktx:1.15.0")
|
|
@@ -818,8 +821,8 @@ local.properties
|
|
|
818
821
|
*.keystore
|
|
819
822
|
*.jks
|
|
820
823
|
`);
|
|
821
|
-
const
|
|
822
|
-
const bundledNative = join3(
|
|
824
|
+
const cliDir2 = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
825
|
+
const bundledNative = join3(cliDir2, "native");
|
|
823
826
|
if (existsSync3(bundledNative)) {
|
|
824
827
|
const nativeDir = join3(dir, "native");
|
|
825
828
|
await cp(bundledNative, nativeDir, { recursive: true });
|
|
@@ -1880,7 +1883,9 @@ var generateCommand = new Command5("generate").description("Generate native code
|
|
|
1880
1883
|
});
|
|
1881
1884
|
|
|
1882
1885
|
// src/cli.ts
|
|
1883
|
-
|
|
1886
|
+
var cliDir = dirname2(fileURLToPath2(import.meta.url));
|
|
1887
|
+
var pkg = JSON.parse(readFileSync3(join7(cliDir, "..", "package.json"), "utf8"));
|
|
1888
|
+
program.name("vue-native").description("Vue Native \u2014 build native iOS and Android apps with Vue.js").version(pkg.version);
|
|
1884
1889
|
program.addCommand(buildCommand);
|
|
1885
1890
|
program.addCommand(createCommand);
|
|
1886
1891
|
program.addCommand(devCommand);
|
|
@@ -5,6 +5,20 @@ plugins {
|
|
|
5
5
|
id("org.jlleitschuh.gradle.ktlint")
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
// Single source of truth for the published version: packages/runtime/package.json.
|
|
9
|
+
// Falls back to 0.0.0-SNAPSHOT when the JS workspace isn't present (standalone Android builds).
|
|
10
|
+
val publishedVersion: String = run {
|
|
11
|
+
val pkgJson = rootProject.file("../../packages/runtime/package.json")
|
|
12
|
+
if (!pkgJson.exists()) {
|
|
13
|
+
"0.0.0-SNAPSHOT"
|
|
14
|
+
} else {
|
|
15
|
+
Regex("\"version\"\\s*:\\s*\"([^\"]+)\"")
|
|
16
|
+
.find(pkgJson.readText())
|
|
17
|
+
?.groupValues?.get(1)
|
|
18
|
+
?: "0.0.0-SNAPSHOT"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
android {
|
|
9
23
|
namespace = "com.vuenative.core"
|
|
10
24
|
compileSdk = 35
|
|
@@ -119,7 +133,7 @@ afterEvaluate {
|
|
|
119
133
|
create<MavenPublication>("release") {
|
|
120
134
|
groupId = "com.vuenative"
|
|
121
135
|
artifactId = "core"
|
|
122
|
-
version =
|
|
136
|
+
version = publishedVersion
|
|
123
137
|
from(components["release"])
|
|
124
138
|
}
|
|
125
139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thelacanians/vue-native-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "CLI for creating and running Vue Native apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vue Native Contributors",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"native"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"prebuild": "rm -rf native &&
|
|
29
|
+
"prebuild": "rm -rf native && rsync -a --exclude='.build/' --exclude='build/' --exclude='.gradle/' --exclude='.swiftpm/' --exclude='DerivedData/' --exclude='node_modules/' --exclude='.idea/' --exclude='build-tools/' --exclude='platform-tools/' --exclude='platforms/' --exclude='licenses/' --exclude='*.xcuserdata' --exclude='*.xcuserstate' --exclude='local.properties' --exclude='*.aar' --exclude='*.apk' --exclude='*.aab' ../../native/ native/",
|
|
30
30
|
"build": "tsup",
|
|
31
31
|
"dev": "tsup --watch",
|
|
32
32
|
"test": "vitest run",
|