@zappdev/cli 0.1.0 → 0.1.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.
- package/dist/zapp-cli.js +8 -22
- package/package.json +1 -1
- package/src/init.ts +4 -4
- package/src/zapp-cli.ts +2 -20
package/dist/zapp-cli.js
CHANGED
|
@@ -8928,11 +8928,11 @@ var runInit = async ({
|
|
|
8928
8928
|
console.error(`Warning: Could not read ${pkgPath}`);
|
|
8929
8929
|
}
|
|
8930
8930
|
const devDeps = pkgObj.devDependencies ?? {};
|
|
8931
|
-
devDeps["@
|
|
8932
|
-
devDeps["@
|
|
8931
|
+
devDeps["@zappdev/cli"] = "latest";
|
|
8932
|
+
devDeps["@zappdev/vite"] = "latest";
|
|
8933
8933
|
pkgObj.devDependencies = devDeps;
|
|
8934
8934
|
const deps = pkgObj.dependencies ?? {};
|
|
8935
|
-
deps["@
|
|
8935
|
+
deps["@zappdev/runtime"] = "latest";
|
|
8936
8936
|
pkgObj.dependencies = deps;
|
|
8937
8937
|
await Bun.write(pkgPath, JSON.stringify(pkgObj, null, 2));
|
|
8938
8938
|
await Bun.write(path7.join(zappDir, "app.zc"), `import "app/app.zc";
|
|
@@ -8959,7 +8959,7 @@ fn run_app() -> int {
|
|
|
8959
8959
|
return app.run();
|
|
8960
8960
|
}
|
|
8961
8961
|
`);
|
|
8962
|
-
await Bun.write(path7.join(zappDir, "zapp.config.ts"), `import { defineConfig } from "@
|
|
8962
|
+
await Bun.write(path7.join(zappDir, "zapp.config.ts"), `import { defineConfig } from "@zappdev/cli/config";
|
|
8963
8963
|
|
|
8964
8964
|
export default defineConfig({
|
|
8965
8965
|
name: "${name}",
|
|
@@ -9341,10 +9341,6 @@ var commonOptions = {
|
|
|
9341
9341
|
type: "string",
|
|
9342
9342
|
describe: "Override output binary path"
|
|
9343
9343
|
},
|
|
9344
|
-
backend: {
|
|
9345
|
-
type: "string",
|
|
9346
|
-
describe: "Backend script path"
|
|
9347
|
-
},
|
|
9348
9344
|
"log-level": {
|
|
9349
9345
|
type: "string",
|
|
9350
9346
|
choices: VALID_LOG_LEVELS,
|
|
@@ -9366,18 +9362,10 @@ var cli = yargs_default(hideBin(process8.argv)).scriptName("zapp").usage("zapp <
|
|
|
9366
9362
|
name: argv.name,
|
|
9367
9363
|
template: argv.template
|
|
9368
9364
|
});
|
|
9369
|
-
}).command("dev", "Run Vite + native app together", (yargs) => yargs.option("root", commonOptions.root).option("frontend", commonOptions.frontend).option("input", commonOptions.input).option("out", commonOptions.out).option("
|
|
9365
|
+
}).command("dev", "Run Vite + native app together", (yargs) => yargs.option("root", commonOptions.root).option("frontend", commonOptions.frontend).option("input", commonOptions.input).option("out", commonOptions.out).option("log-level", commonOptions["log-level"]).option("dev-url", {
|
|
9370
9366
|
type: "string",
|
|
9371
9367
|
default: "http://localhost:5173",
|
|
9372
9368
|
describe: "Dev server URL"
|
|
9373
|
-
}).option("brotli", {
|
|
9374
|
-
type: "boolean",
|
|
9375
|
-
default: false,
|
|
9376
|
-
describe: "Brotli-compress embedded assets"
|
|
9377
|
-
}).option("embed-assets", {
|
|
9378
|
-
type: "boolean",
|
|
9379
|
-
default: false,
|
|
9380
|
-
describe: "Embed assets in binary (default: false for dev)"
|
|
9381
9369
|
}), async (argv) => {
|
|
9382
9370
|
checkPrerequisites();
|
|
9383
9371
|
const root = path11.resolve(cwd, argv.root);
|
|
@@ -9391,13 +9379,12 @@ var cli = yargs_default(hideBin(process8.argv)).scriptName("zapp").usage("zapp <
|
|
|
9391
9379
|
buildFile,
|
|
9392
9380
|
nativeOut,
|
|
9393
9381
|
devUrl: argv["dev-url"],
|
|
9394
|
-
withBrotli:
|
|
9395
|
-
embedAssets:
|
|
9396
|
-
backendScript: argv.backend,
|
|
9382
|
+
withBrotli: false,
|
|
9383
|
+
embedAssets: false,
|
|
9397
9384
|
logLevel: argv["log-level"],
|
|
9398
9385
|
config
|
|
9399
9386
|
});
|
|
9400
|
-
}).command("build", "Build frontend assets + native binary", (yargs) => yargs.option("root", commonOptions.root).option("frontend", commonOptions.frontend).option("input", commonOptions.input).option("out", commonOptions.out).option("
|
|
9387
|
+
}).command("build", "Build frontend assets + native binary", (yargs) => yargs.option("root", commonOptions.root).option("frontend", commonOptions.frontend).option("input", commonOptions.input).option("out", commonOptions.out).option("log-level", commonOptions["log-level"]).option("asset-dir", {
|
|
9401
9388
|
type: "string",
|
|
9402
9389
|
default: "dist",
|
|
9403
9390
|
describe: "Asset directory"
|
|
@@ -9427,7 +9414,6 @@ var cli = yargs_default(hideBin(process8.argv)).scriptName("zapp").usage("zapp <
|
|
|
9427
9414
|
withBrotli: argv.brotli,
|
|
9428
9415
|
embedAssets,
|
|
9429
9416
|
isDebug: argv.debug,
|
|
9430
|
-
backendScript: argv.backend,
|
|
9431
9417
|
logLevel: argv["log-level"],
|
|
9432
9418
|
config
|
|
9433
9419
|
});
|
package/package.json
CHANGED
package/src/init.ts
CHANGED
|
@@ -41,12 +41,12 @@ export const runInit = async ({
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const devDeps = (pkgObj.devDependencies ?? {}) as Record<string, string>;
|
|
44
|
-
devDeps["@
|
|
45
|
-
devDeps["@
|
|
44
|
+
devDeps["@zappdev/cli"] = "latest";
|
|
45
|
+
devDeps["@zappdev/vite"] = "latest";
|
|
46
46
|
pkgObj.devDependencies = devDeps;
|
|
47
47
|
|
|
48
48
|
const deps = (pkgObj.dependencies ?? {}) as Record<string, string>;
|
|
49
|
-
deps["@
|
|
49
|
+
deps["@zappdev/runtime"] = "latest";
|
|
50
50
|
pkgObj.dependencies = deps;
|
|
51
51
|
|
|
52
52
|
await Bun.write(pkgPath, JSON.stringify(pkgObj, null, 2));
|
|
@@ -78,7 +78,7 @@ fn run_app() -> int {
|
|
|
78
78
|
`);
|
|
79
79
|
|
|
80
80
|
// --- Zapp config ---
|
|
81
|
-
await Bun.write(path.join(zappDir, "zapp.config.ts"), `import { defineConfig } from "@
|
|
81
|
+
await Bun.write(path.join(zappDir, "zapp.config.ts"), `import { defineConfig } from "@zappdev/cli/config";
|
|
82
82
|
|
|
83
83
|
export default defineConfig({
|
|
84
84
|
name: "${name}",
|
package/src/zapp-cli.ts
CHANGED
|
@@ -46,10 +46,6 @@ const commonOptions = {
|
|
|
46
46
|
type: "string" as const,
|
|
47
47
|
describe: "Override output binary path",
|
|
48
48
|
},
|
|
49
|
-
backend: {
|
|
50
|
-
type: "string" as const,
|
|
51
|
-
describe: "Backend script path",
|
|
52
|
-
},
|
|
53
49
|
"log-level": {
|
|
54
50
|
type: "string" as const,
|
|
55
51
|
choices: VALID_LOG_LEVELS,
|
|
@@ -96,22 +92,11 @@ const cli = yargs(hideBin(process.argv))
|
|
|
96
92
|
.option("frontend", commonOptions.frontend)
|
|
97
93
|
.option("input", commonOptions.input)
|
|
98
94
|
.option("out", commonOptions.out)
|
|
99
|
-
.option("backend", commonOptions.backend)
|
|
100
95
|
.option("log-level", commonOptions["log-level"])
|
|
101
96
|
.option("dev-url", {
|
|
102
97
|
type: "string",
|
|
103
98
|
default: "http://localhost:5173",
|
|
104
99
|
describe: "Dev server URL",
|
|
105
|
-
})
|
|
106
|
-
.option("brotli", {
|
|
107
|
-
type: "boolean",
|
|
108
|
-
default: false,
|
|
109
|
-
describe: "Brotli-compress embedded assets",
|
|
110
|
-
})
|
|
111
|
-
.option("embed-assets", {
|
|
112
|
-
type: "boolean",
|
|
113
|
-
default: false,
|
|
114
|
-
describe: "Embed assets in binary (default: false for dev)",
|
|
115
100
|
}),
|
|
116
101
|
async (argv) => {
|
|
117
102
|
checkPrerequisites();
|
|
@@ -129,9 +114,8 @@ const cli = yargs(hideBin(process.argv))
|
|
|
129
114
|
buildFile,
|
|
130
115
|
nativeOut,
|
|
131
116
|
devUrl: argv["dev-url"],
|
|
132
|
-
withBrotli:
|
|
133
|
-
embedAssets:
|
|
134
|
-
backendScript: argv.backend,
|
|
117
|
+
withBrotli: false,
|
|
118
|
+
embedAssets: false,
|
|
135
119
|
logLevel: argv["log-level"] as LogLevel | undefined,
|
|
136
120
|
config,
|
|
137
121
|
});
|
|
@@ -146,7 +130,6 @@ const cli = yargs(hideBin(process.argv))
|
|
|
146
130
|
.option("frontend", commonOptions.frontend)
|
|
147
131
|
.option("input", commonOptions.input)
|
|
148
132
|
.option("out", commonOptions.out)
|
|
149
|
-
.option("backend", commonOptions.backend)
|
|
150
133
|
.option("log-level", commonOptions["log-level"])
|
|
151
134
|
.option("asset-dir", {
|
|
152
135
|
type: "string",
|
|
@@ -186,7 +169,6 @@ const cli = yargs(hideBin(process.argv))
|
|
|
186
169
|
withBrotli: argv.brotli,
|
|
187
170
|
embedAssets,
|
|
188
171
|
isDebug: argv.debug,
|
|
189
|
-
backendScript: argv.backend,
|
|
190
172
|
logLevel: argv["log-level"] as LogLevel | undefined,
|
|
191
173
|
config,
|
|
192
174
|
});
|