@nanobpm/urban 0.11.1 → 0.12.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/dist/cli.js +12 -5
- package/package.json +2 -2
- package/src/cli.ts +10 -5
package/dist/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ function readVersion() {
|
|
|
27
27
|
}
|
|
28
28
|
const VERSION = readVersion();
|
|
29
29
|
function parse(argv) {
|
|
30
|
-
const f = { root: ".", manifest: "nano.app.json", check: false, help: false, version: false, _: [] };
|
|
30
|
+
const f = { root: ".", manifest: "nano.app.json", check: false, deno: false, help: false, version: false, _: [] };
|
|
31
31
|
const need = (i, flag) => {
|
|
32
32
|
const v = argv[i];
|
|
33
33
|
if (v === undefined || v.startsWith("-"))
|
|
@@ -42,6 +42,10 @@ function parse(argv) {
|
|
|
42
42
|
f.version = true;
|
|
43
43
|
else if (a === "--check")
|
|
44
44
|
f.check = true;
|
|
45
|
+
else if (a === "--deno")
|
|
46
|
+
f.deno = true;
|
|
47
|
+
else if (a === "--")
|
|
48
|
+
continue; // tolerate a bare "--" some runners inject (not an option terminator here)
|
|
45
49
|
else if (a === "--root")
|
|
46
50
|
f.root = need(++i, a);
|
|
47
51
|
else if (a === "--manifest")
|
|
@@ -64,7 +68,7 @@ function parse(argv) {
|
|
|
64
68
|
const USAGE = `urban — build and run Urban apps (nano.app.json)
|
|
65
69
|
|
|
66
70
|
Usage:
|
|
67
|
-
urban new <name> [--root <path>] scaffold a new Urban app
|
|
71
|
+
urban new <name> [--root <path>] [--deno] scaffold a new Urban app
|
|
68
72
|
urban check validate the manifest
|
|
69
73
|
urban gen [--check] derive artifacts (migrations, worker-io)
|
|
70
74
|
urban run materialize + serve the app
|
|
@@ -138,13 +142,16 @@ async function cmdDeploy(f) {
|
|
|
138
142
|
async function cmdNew(f) {
|
|
139
143
|
const name = f._[1];
|
|
140
144
|
if (!name) {
|
|
141
|
-
console.error("usage: urban new <name> [--root <path>]");
|
|
145
|
+
console.error("usage: urban new <name> [--root <path>] [--deno]");
|
|
142
146
|
return 1;
|
|
143
147
|
}
|
|
144
148
|
const dir = f.root !== "." ? f.root : `./${slugify(name)}`;
|
|
145
|
-
const res = await scaffold({ name, dir });
|
|
149
|
+
const res = await scaffold({ name, dir, deno: f.deno });
|
|
146
150
|
console.log(`✔ scaffolded "${res.id}" in ${res.dir} (${res.files.length} files)`);
|
|
147
|
-
console.log(` cd ${res.dir}
|
|
151
|
+
console.log(` cd ${res.dir}`);
|
|
152
|
+
console.log(` npm install && npm start`);
|
|
153
|
+
if (f.deno)
|
|
154
|
+
console.log(` # or on Deno: deno task start`);
|
|
148
155
|
return 0;
|
|
149
156
|
}
|
|
150
157
|
export async function main(argv) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/urban",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Urban: build and run code-first apps on Nano — runtime, derivation toolkit, and CLI in one. Author durable processes with @nanobpm/workflow (defineFlow), a typed datasource, forms, triggers and surfaces from a nano.app.json manifest, on Node or Deno.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@nanobpm/nano-sdk": "^1.2.0",
|
|
62
62
|
"@nanobpm/workflow": "^0.7.0",
|
|
63
63
|
"bpmn-auto-layout": "^2.0.0-alpha.2",
|
|
64
|
-
"create-urban-app": "^0.
|
|
64
|
+
"create-urban-app": "^0.3.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/node": "^22.20.1",
|
package/src/cli.ts
CHANGED
|
@@ -40,13 +40,14 @@ interface Flags {
|
|
|
40
40
|
manifest: string;
|
|
41
41
|
port?: number;
|
|
42
42
|
check: boolean;
|
|
43
|
+
deno: boolean;
|
|
43
44
|
help: boolean;
|
|
44
45
|
version: boolean;
|
|
45
46
|
_: string[];
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
function parse(argv: string[]): Flags {
|
|
49
|
-
const f: Flags = { root: ".", manifest: "nano.app.json", check: false, help: false, version: false, _: [] };
|
|
50
|
+
const f: Flags = { root: ".", manifest: "nano.app.json", check: false, deno: false, help: false, version: false, _: [] };
|
|
50
51
|
const need = (i: number, flag: string): string => {
|
|
51
52
|
const v = argv[i];
|
|
52
53
|
if (v === undefined || v.startsWith("-")) throw new Error(`flag ${flag} requires a value`);
|
|
@@ -57,6 +58,8 @@ function parse(argv: string[]): Flags {
|
|
|
57
58
|
if (a === "-h" || a === "--help") f.help = true;
|
|
58
59
|
else if (a === "-v" || a === "--version") f.version = true;
|
|
59
60
|
else if (a === "--check") f.check = true;
|
|
61
|
+
else if (a === "--deno") f.deno = true;
|
|
62
|
+
else if (a === "--") continue; // tolerate a bare "--" some runners inject (not an option terminator here)
|
|
60
63
|
else if (a === "--root") f.root = need(++i, a);
|
|
61
64
|
else if (a === "--manifest") f.manifest = need(++i, a);
|
|
62
65
|
else if (a === "--port") {
|
|
@@ -75,7 +78,7 @@ function parse(argv: string[]): Flags {
|
|
|
75
78
|
const USAGE = `urban — build and run Urban apps (nano.app.json)
|
|
76
79
|
|
|
77
80
|
Usage:
|
|
78
|
-
urban new <name> [--root <path>] scaffold a new Urban app
|
|
81
|
+
urban new <name> [--root <path>] [--deno] scaffold a new Urban app
|
|
79
82
|
urban check validate the manifest
|
|
80
83
|
urban gen [--check] derive artifacts (migrations, worker-io)
|
|
81
84
|
urban run materialize + serve the app
|
|
@@ -151,13 +154,15 @@ async function cmdDeploy(f: Flags): Promise<number> {
|
|
|
151
154
|
async function cmdNew(f: Flags): Promise<number> {
|
|
152
155
|
const name = f._[1];
|
|
153
156
|
if (!name) {
|
|
154
|
-
console.error("usage: urban new <name> [--root <path>]");
|
|
157
|
+
console.error("usage: urban new <name> [--root <path>] [--deno]");
|
|
155
158
|
return 1;
|
|
156
159
|
}
|
|
157
160
|
const dir = f.root !== "." ? f.root : `./${slugify(name)}`;
|
|
158
|
-
const res = await scaffold({ name, dir });
|
|
161
|
+
const res = await scaffold({ name, dir, deno: f.deno });
|
|
159
162
|
console.log(`✔ scaffolded "${res.id}" in ${res.dir} (${res.files.length} files)`);
|
|
160
|
-
console.log(` cd ${res.dir}
|
|
163
|
+
console.log(` cd ${res.dir}`);
|
|
164
|
+
console.log(` npm install && npm start`);
|
|
165
|
+
if (f.deno) console.log(` # or on Deno: deno task start`);
|
|
161
166
|
return 0;
|
|
162
167
|
}
|
|
163
168
|
|