@mauroandre/velojs 0.0.44 → 0.0.46
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 +39 -34
- package/dist/hooks.js +68 -71
- package/dist/init.d.ts +3 -1
- package/dist/init.js +42 -28
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { spawnSync as
|
|
1
|
+
import { spawnSync as a } from "node:child_process";
|
|
2
2
|
import { join as n, resolve as u } from "node:path";
|
|
3
3
|
import p from "node:fs";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const t = process.argv.slice(2), c = t[0], v = (s, e = []) => {
|
|
5
|
+
const o = a(s, e, {
|
|
6
6
|
stdio: "inherit",
|
|
7
7
|
cwd: process.cwd()
|
|
8
8
|
});
|
|
9
|
-
process.exit(
|
|
9
|
+
process.exit(o.status ?? 0);
|
|
10
10
|
}, m = () => {
|
|
11
|
-
v("npx", ["vite", ...
|
|
12
|
-
},
|
|
13
|
-
const
|
|
11
|
+
v("npx", ["vite", ...t.slice(1)]);
|
|
12
|
+
}, f = (s) => {
|
|
13
|
+
const e = Date.now().toString(36), o = {
|
|
14
14
|
...process.env,
|
|
15
|
-
VELO_BUILD_HASH:
|
|
16
|
-
...
|
|
15
|
+
VELO_BUILD_HASH: e,
|
|
16
|
+
...s ? { VELO_STATIC: "1" } : {}
|
|
17
17
|
};
|
|
18
18
|
console.log("Building client...");
|
|
19
|
-
const r =
|
|
19
|
+
const r = a("npx", ["vite", "build"], {
|
|
20
20
|
stdio: "inherit",
|
|
21
21
|
cwd: process.cwd(),
|
|
22
|
-
env:
|
|
22
|
+
env: o
|
|
23
23
|
});
|
|
24
24
|
r.status !== 0 && (console.error("Client build failed. Aborting."), process.exit(r.status ?? 1)), console.log("Building server...");
|
|
25
|
-
const i =
|
|
25
|
+
const i = a("npx", ["vite", "build", "--mode", "server"], {
|
|
26
26
|
stdio: "inherit",
|
|
27
27
|
cwd: process.cwd(),
|
|
28
|
-
env:
|
|
28
|
+
env: o
|
|
29
29
|
});
|
|
30
|
-
i.status !== 0 && (console.error("Server build failed. Aborting."), process.exit(i.status ?? 1)), console.log("Build complete!"),
|
|
31
|
-
},
|
|
30
|
+
i.status !== 0 && (console.error("Server build failed. Aborting."), process.exit(i.status ?? 1)), console.log("Build complete!"), s && j();
|
|
31
|
+
}, j = async () => {
|
|
32
32
|
process.env.NODE_ENV = "production", process.env.VELO_STATIC = "1";
|
|
33
|
-
const
|
|
34
|
-
(!
|
|
33
|
+
const e = await import(u(process.cwd(), "dist/server.js")), o = e.default, r = e.routes;
|
|
34
|
+
(!o || !r) && (console.error("Failed to load app or routes from dist/server.js"), process.exit(1));
|
|
35
35
|
const { generateStatic: i } = await import("./static.js");
|
|
36
|
-
await i(
|
|
37
|
-
},
|
|
36
|
+
await i(o, r);
|
|
37
|
+
}, b = () => {
|
|
38
38
|
process.env.NODE_ENV = "production";
|
|
39
|
-
const
|
|
40
|
-
v("node", [
|
|
39
|
+
const s = u(process.cwd(), "dist/server.js");
|
|
40
|
+
v("node", [s]);
|
|
41
41
|
}, d = () => {
|
|
42
42
|
console.log(`
|
|
43
43
|
VeloJS CLI
|
|
@@ -46,7 +46,7 @@ Usage:
|
|
|
46
46
|
velojs <command>
|
|
47
47
|
|
|
48
48
|
Commands:
|
|
49
|
-
init Create a new VeloJS project
|
|
49
|
+
init Create a new VeloJS project (fails only on file conflicts; --force overwrites)
|
|
50
50
|
dev Start development server
|
|
51
51
|
build Build for production (client + server)
|
|
52
52
|
build --static Build as static site (HTML + JSON)
|
|
@@ -65,30 +65,35 @@ Examples:
|
|
|
65
65
|
velojs graph --view
|
|
66
66
|
`);
|
|
67
67
|
};
|
|
68
|
-
switch (
|
|
68
|
+
switch (c) {
|
|
69
69
|
case "init": {
|
|
70
|
-
const { runInit:
|
|
71
|
-
|
|
70
|
+
const { runInit: s } = await import("./init.js");
|
|
71
|
+
try {
|
|
72
|
+
const e = t[1] && !t[1].startsWith("-") ? t[1] : void 0;
|
|
73
|
+
await s(e, { force: t.includes("--force") });
|
|
74
|
+
} catch (e) {
|
|
75
|
+
console.error(e.message), process.exit(1);
|
|
76
|
+
}
|
|
72
77
|
break;
|
|
73
78
|
}
|
|
74
79
|
case "dev":
|
|
75
80
|
m();
|
|
76
81
|
break;
|
|
77
82
|
case "build": {
|
|
78
|
-
const
|
|
79
|
-
|
|
83
|
+
const s = t.includes("--static");
|
|
84
|
+
f(s);
|
|
80
85
|
break;
|
|
81
86
|
}
|
|
82
87
|
case "start":
|
|
83
|
-
|
|
88
|
+
b();
|
|
84
89
|
break;
|
|
85
90
|
case "graph": {
|
|
86
|
-
const { buildGraph:
|
|
91
|
+
const { buildGraph: s } = await import("./graph.js"), e = process.cwd(), o = t[1] && !t[1].startsWith("-") ? t[1] : null, r = n(e, o ?? "app"), i = s(r), l = n(e, ".velojs");
|
|
87
92
|
p.mkdirSync(l, { recursive: !0 });
|
|
88
|
-
const
|
|
89
|
-
if (p.writeFileSync(
|
|
90
|
-
const { serveGraphViewer:
|
|
91
|
-
console.log(`Graph viewer running at ${
|
|
93
|
+
const g = n(l, "graph.json");
|
|
94
|
+
if (p.writeFileSync(g, JSON.stringify(i)), console.log("Graph written to .velojs/graph.json"), t.includes("--view")) {
|
|
95
|
+
const { serveGraphViewer: h } = await import("./graph-viewer.js"), w = await h(e);
|
|
96
|
+
console.log(`Graph viewer running at ${w} (Ctrl+C to stop)`);
|
|
92
97
|
}
|
|
93
98
|
break;
|
|
94
99
|
}
|
|
@@ -98,5 +103,5 @@ switch (a) {
|
|
|
98
103
|
d();
|
|
99
104
|
break;
|
|
100
105
|
default:
|
|
101
|
-
|
|
106
|
+
c && console.error(`Unknown command: ${c}`), d(), process.exit(1);
|
|
102
107
|
}
|
package/dist/hooks.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { signal as
|
|
2
|
-
import { useEffect as E, useRef as
|
|
3
|
-
import { useLocation as
|
|
4
|
-
import { refetchModule as
|
|
5
|
-
import { __veloUpdatePending as
|
|
6
|
-
function
|
|
1
|
+
import { signal as S, useSignal as c } from "@preact/signals";
|
|
2
|
+
import { useEffect as E, useRef as w } from "preact/hooks";
|
|
3
|
+
import { useLocation as D, useParams as $, useSearch as C } from "wouter-preact";
|
|
4
|
+
import { refetchModule as L, loaderLoading as m, loaderEntry as N } from "./loader-store.js";
|
|
5
|
+
import { __veloUpdatePending as z } from "./loader-store.js";
|
|
6
|
+
function U(e) {
|
|
7
7
|
const n = e.value;
|
|
8
8
|
n === null || typeof n != "object" || (e.value = Array.isArray(n) ? [...n] : { ...n });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function W(e) {
|
|
11
11
|
return typeof window > "u" ? {
|
|
12
12
|
data: {
|
|
13
13
|
get value() {
|
|
14
14
|
return e ? globalThis.__veloServerData?.getStore?.()?.[e] ?? null : null;
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
loading:
|
|
17
|
+
loading: S(!1),
|
|
18
18
|
refetch: () => {
|
|
19
19
|
}
|
|
20
20
|
} : e ? {
|
|
21
21
|
data: N(e),
|
|
22
|
-
loading:
|
|
23
|
-
refetch: () =>
|
|
24
|
-
} : { data:
|
|
22
|
+
loading: m(e),
|
|
23
|
+
refetch: () => L(e)
|
|
24
|
+
} : { data: S(null), loading: S(!1), refetch: () => {
|
|
25
25
|
} };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function j(e, n) {
|
|
28
28
|
let t, r;
|
|
29
29
|
if (Array.isArray(e) ? r = e : (t = e, r = n), typeof window > "u") {
|
|
30
|
-
let
|
|
30
|
+
let g = null;
|
|
31
31
|
if (t) {
|
|
32
32
|
const h = globalThis.__veloServerData?.getStore?.();
|
|
33
|
-
h?.[t] && (
|
|
33
|
+
h?.[t] && (g = h[t]);
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
|
-
data: c(
|
|
36
|
+
data: c(g),
|
|
37
37
|
loading: c(!1),
|
|
38
38
|
refetch: () => {
|
|
39
39
|
}
|
|
@@ -42,108 +42,105 @@ function W(e, n) {
|
|
|
42
42
|
if (!t)
|
|
43
43
|
return { data: c(null), loading: c(!1), refetch: () => {
|
|
44
44
|
} };
|
|
45
|
-
const
|
|
45
|
+
const o = N(t), a = m(t), u = () => L(t), d = w(!0);
|
|
46
46
|
return E(() => {
|
|
47
|
-
d.current && (d.current = !1,
|
|
48
|
-
}, r ?? []), { data:
|
|
47
|
+
d.current && (d.current = !1, o.value !== null) || u();
|
|
48
|
+
}, r ?? []), { data: o, loading: a, refetch: u };
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const [, e] =
|
|
50
|
+
function J() {
|
|
51
|
+
const [, e] = D();
|
|
52
52
|
return e;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__params ?? {} :
|
|
54
|
+
function M() {
|
|
55
|
+
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__params ?? {} : $();
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function q() {
|
|
58
58
|
if (typeof window > "u")
|
|
59
59
|
return globalThis.__veloServerData?.getStore?.()?.__query ?? {};
|
|
60
|
-
const e =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return n.forEach((r, a) => {
|
|
65
|
-
t[a] = r;
|
|
66
|
-
}), t;
|
|
60
|
+
const e = C(), n = {};
|
|
61
|
+
return new URLSearchParams(e).forEach((t, r) => {
|
|
62
|
+
n[r] = t;
|
|
63
|
+
}), n;
|
|
67
64
|
}
|
|
68
|
-
function
|
|
69
|
-
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__pathname ?? "/" : (
|
|
65
|
+
function x() {
|
|
66
|
+
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__pathname ?? "/" : (D(), window.location.pathname);
|
|
70
67
|
}
|
|
71
|
-
function
|
|
72
|
-
const t = c(null), r = c(null),
|
|
68
|
+
function G(e, n = {}) {
|
|
69
|
+
const t = c(null), r = c(null), o = c(!1), a = c(null), { channel: u, enabled: d = !0 } = n;
|
|
73
70
|
return E(() => {
|
|
74
71
|
if (typeof window > "u" || !d) return;
|
|
75
72
|
if (!e.__path) {
|
|
76
73
|
console.warn("[velojs] useEventStream: stream has no __path");
|
|
77
74
|
return;
|
|
78
75
|
}
|
|
79
|
-
t.value = null, r.value = null,
|
|
80
|
-
const
|
|
76
|
+
t.value = null, r.value = null, o.value = !1, a.value = null;
|
|
77
|
+
const g = u ? `${e.__path}?channel=${encodeURIComponent(u)}` : e.__path, s = new EventSource(g);
|
|
81
78
|
return s.addEventListener("snapshot", (h) => {
|
|
82
79
|
try {
|
|
83
80
|
r.value = JSON.parse(h.data);
|
|
84
|
-
} catch (
|
|
85
|
-
|
|
81
|
+
} catch (_) {
|
|
82
|
+
a.value = _;
|
|
86
83
|
}
|
|
87
84
|
}), s.addEventListener("message", (h) => {
|
|
88
85
|
try {
|
|
89
86
|
t.value = JSON.parse(h.data);
|
|
90
|
-
} catch (
|
|
91
|
-
|
|
87
|
+
} catch (_) {
|
|
88
|
+
a.value = _;
|
|
92
89
|
}
|
|
93
90
|
}), s.addEventListener("heartbeat", () => {
|
|
94
91
|
}), s.addEventListener("close", () => {
|
|
95
|
-
|
|
92
|
+
o.value = !0, s.close();
|
|
96
93
|
}), s.addEventListener("error", () => {
|
|
97
|
-
s.readyState === EventSource.CLOSED && (
|
|
94
|
+
s.readyState === EventSource.CLOSED && (o.value = !0);
|
|
98
95
|
}), () => {
|
|
99
96
|
s.close();
|
|
100
97
|
};
|
|
101
|
-
}, [e, u, d]), { data: t, snapshot: r, closed:
|
|
98
|
+
}, [e, u, d]), { data: t, snapshot: r, closed: o, error: a };
|
|
102
99
|
}
|
|
103
|
-
function
|
|
104
|
-
const t = c("connecting"), r = c(null),
|
|
100
|
+
function B(e, n = {}) {
|
|
101
|
+
const t = c("connecting"), r = c(null), o = c(null), a = w(null), u = w([]), { channel: d, onMessage: g, onOpen: s, onClose: h, onError: _, enabled: b = !0 } = n;
|
|
105
102
|
return E(() => {
|
|
106
|
-
if (typeof window > "u" || !
|
|
103
|
+
if (typeof window > "u" || !b) return;
|
|
107
104
|
if (!e.__path) {
|
|
108
105
|
console.warn("[velojs] useSocket: stub has no __path");
|
|
109
106
|
return;
|
|
110
107
|
}
|
|
111
|
-
t.value = "connecting", r.value = null,
|
|
108
|
+
t.value = "connecting", r.value = null, o.value = null;
|
|
112
109
|
const v = `${window.location.protocol === "https:" ? "wss:" : "ws:"}//${window.location.host}`, i = d ? `${v}${e.__path}?channel=${encodeURIComponent(d)}` : `${v}${e.__path}`, f = new WebSocket(i);
|
|
113
|
-
return f.binaryType = "arraybuffer",
|
|
110
|
+
return f.binaryType = "arraybuffer", a.current = f, f.addEventListener("open", () => {
|
|
114
111
|
t.value = "open";
|
|
115
112
|
const l = u.current;
|
|
116
113
|
u.current = [];
|
|
117
|
-
for (const
|
|
114
|
+
for (const y of l)
|
|
118
115
|
try {
|
|
119
|
-
f.send(
|
|
116
|
+
f.send(y);
|
|
120
117
|
} catch {
|
|
121
118
|
}
|
|
122
119
|
s?.();
|
|
123
120
|
}), f.addEventListener("message", (l) => {
|
|
124
|
-
let
|
|
121
|
+
let y;
|
|
125
122
|
if (typeof l.data == "string")
|
|
126
|
-
|
|
123
|
+
y = l.data;
|
|
127
124
|
else if (l.data instanceof ArrayBuffer)
|
|
128
|
-
|
|
125
|
+
y = new Uint8Array(l.data);
|
|
129
126
|
else
|
|
130
127
|
return;
|
|
131
|
-
r.value =
|
|
128
|
+
r.value = y, g?.(y);
|
|
132
129
|
}), f.addEventListener("close", (l) => {
|
|
133
|
-
t.value = "closed",
|
|
130
|
+
t.value = "closed", a.current = null, h?.(l);
|
|
134
131
|
}), f.addEventListener("error", (l) => {
|
|
135
|
-
|
|
132
|
+
o.value = l, _?.(l);
|
|
136
133
|
}), () => {
|
|
137
|
-
|
|
134
|
+
a.current = null;
|
|
138
135
|
try {
|
|
139
136
|
(f.readyState === WebSocket.OPEN || f.readyState === WebSocket.CONNECTING) && f.close();
|
|
140
137
|
} catch {
|
|
141
138
|
}
|
|
142
139
|
};
|
|
143
|
-
}, [e.__path, d,
|
|
140
|
+
}, [e.__path, d, b]), { send: (p) => {
|
|
144
141
|
let v;
|
|
145
142
|
typeof p == "string" || p instanceof Uint8Array ? v = p : v = JSON.stringify(p);
|
|
146
|
-
const i =
|
|
143
|
+
const i = a.current;
|
|
147
144
|
if (i && i.readyState === WebSocket.OPEN)
|
|
148
145
|
try {
|
|
149
146
|
i.send(v);
|
|
@@ -151,23 +148,23 @@ function x(e, n = {}) {
|
|
|
151
148
|
}
|
|
152
149
|
else i && i.readyState === WebSocket.CONNECTING && u.current.push(v);
|
|
153
150
|
}, close: (p, v) => {
|
|
154
|
-
const i =
|
|
151
|
+
const i = a.current;
|
|
155
152
|
if (i)
|
|
156
153
|
try {
|
|
157
154
|
i.close(p, v);
|
|
158
155
|
} catch {
|
|
159
156
|
}
|
|
160
|
-
}, status: t, lastMessage: r, error:
|
|
157
|
+
}, status: t, lastMessage: r, error: o };
|
|
161
158
|
}
|
|
162
159
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
160
|
+
W as Loader,
|
|
161
|
+
z as __veloUpdatePending,
|
|
162
|
+
U as touch,
|
|
163
|
+
G as useEventStream,
|
|
164
|
+
j as useLoader,
|
|
165
|
+
J as useNavigate,
|
|
166
|
+
M as useParams,
|
|
167
|
+
x as usePathname,
|
|
168
|
+
q as useQuery,
|
|
169
|
+
B as useSocket
|
|
173
170
|
};
|
package/dist/init.d.ts
CHANGED
package/dist/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { fileURLToPath as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return JSON.parse(
|
|
1
|
+
import e from "node:fs";
|
|
2
|
+
import o from "node:path";
|
|
3
|
+
import { fileURLToPath as x } from "node:url";
|
|
4
|
+
const r = "@mauroandre/velojs";
|
|
5
|
+
function v() {
|
|
6
|
+
const n = o.dirname(x(import.meta.url)), p = o.resolve(n, "../package.json");
|
|
7
|
+
return JSON.parse(e.readFileSync(p, "utf-8")).version;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const g = {
|
|
10
10
|
".gitignore": `# Dependencies
|
|
11
11
|
node_modules/
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ dist/
|
|
|
26
26
|
"start": "velojs start"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"${
|
|
29
|
+
"${r}": "^${v()}"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "latest",
|
|
@@ -34,7 +34,7 @@ dist/
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
`,
|
|
37
|
-
"vite.config.ts": `import { veloPlugin } from "${
|
|
37
|
+
"vite.config.ts": `import { veloPlugin } from "${r}/vite";
|
|
38
38
|
|
|
39
39
|
export default { plugins: [veloPlugin()] };
|
|
40
40
|
`,
|
|
@@ -59,7 +59,7 @@ export default { plugins: [veloPlugin()] };
|
|
|
59
59
|
"exclude": ["node_modules", "dist"]
|
|
60
60
|
}
|
|
61
61
|
`,
|
|
62
|
-
"app/routes.tsx": `import type { AppRoutes } from "${
|
|
62
|
+
"app/routes.tsx": `import type { AppRoutes } from "${r}";
|
|
63
63
|
|
|
64
64
|
import * as Root from "./client-root.js";
|
|
65
65
|
import * as Home from "./pages/Home.js";
|
|
@@ -79,11 +79,11 @@ export default [
|
|
|
79
79
|
`,
|
|
80
80
|
"app/server.tsx": `// Server initialization
|
|
81
81
|
// Use this file to set up server-side logic:
|
|
82
|
-
// import { addRoutes, onServer } from "${
|
|
82
|
+
// import { addRoutes, onServer } from "${r}/server";
|
|
83
83
|
`,
|
|
84
84
|
"app/client.tsx": `import "./styles/global.css";
|
|
85
85
|
`,
|
|
86
|
-
"app/client-root.tsx": `import { Scripts } from "${
|
|
86
|
+
"app/client-root.tsx": `import { Scripts } from "${r}";
|
|
87
87
|
|
|
88
88
|
interface RootProps {
|
|
89
89
|
children: preact.ComponentChildren;
|
|
@@ -147,25 +147,39 @@ a:hover {
|
|
|
147
147
|
};
|
|
148
148
|
`
|
|
149
149
|
};
|
|
150
|
-
async function
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
async function b(n, p) {
|
|
151
|
+
const s = n ? o.resolve(process.cwd(), n) : process.cwd(), a = o.basename(s);
|
|
152
|
+
e.existsSync(s) || e.mkdirSync(s, { recursive: !0 });
|
|
153
|
+
const d = Object.keys(g).filter(
|
|
154
|
+
(t) => t !== ".gitignore" && e.existsSync(o.join(s, t))
|
|
155
|
+
);
|
|
156
|
+
if (d.length > 0 && !p?.force)
|
|
157
|
+
throw new Error(
|
|
158
|
+
`Cannot init in "${a}": these files already exist and would be overwritten:
|
|
159
|
+
` + d.map((t) => ` ${t}`).join(`
|
|
160
|
+
`) + "\nMove them away, or run `velojs init --force` to overwrite."
|
|
161
|
+
);
|
|
162
|
+
for (const [t, l] of Object.entries(g)) {
|
|
163
|
+
const i = o.join(s, t), m = o.dirname(i);
|
|
164
|
+
if (e.existsSync(m) || e.mkdirSync(m, { recursive: !0 }), t === ".gitignore" && e.existsSync(i)) {
|
|
165
|
+
const h = e.readFileSync(i, "utf-8"), u = l.split(`
|
|
166
|
+
`).filter((c) => c && !c.startsWith("#") && !h.includes(c));
|
|
167
|
+
u.length > 0 && e.appendFileSync(i, `
|
|
168
|
+
# VeloJS
|
|
169
|
+
${u.join(`
|
|
170
|
+
`)}
|
|
171
|
+
`);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const f = t === "package.json" ? l.replace("my-velojs-app", a) : l;
|
|
175
|
+
e.writeFileSync(i, f);
|
|
162
176
|
}
|
|
163
177
|
console.log(`
|
|
164
|
-
Project created in ${
|
|
178
|
+
Project created in ${n ? a : "current directory"}!
|
|
165
179
|
`), console.log(`Next steps:
|
|
166
|
-
`),
|
|
180
|
+
`), n && console.log(` cd ${a}`), console.log(" npm install"), console.log(` npx velojs dev
|
|
167
181
|
`);
|
|
168
182
|
}
|
|
169
183
|
export {
|
|
170
|
-
|
|
184
|
+
b as runInit
|
|
171
185
|
};
|