dinou 9.0.0 → 9.0.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [9.0.2] - 2026-10-27
9
+
10
+ ### Performance
11
+ - **Direct NODE_OPTIONS Injection in Unvendorized Mode (`-u`)**: Injected `--conditions=unvendorized` directly into `process.env.NODE_OPTIONS` from `dinou/cli.js` when launching child commands. Downstream build scripts and adapters (`ensureVendorMode()`) now detect active unvendorized resolution on their very first boot, completely eliminating intermediate Node.js child process re-spawns and shaving ~700–1000 ms off production builds and dev server cold starts.
12
+
13
+ ## [9.0.1] - 2026-10-27
14
+
15
+ ### Fixed
16
+ - **CLI Unvendorized Mode Path Resolution and Command Rewriting (`-u`)**: Fixed an issue in `dinou/cli.js` where running in unvendorized mode (`-u` / `--unvendorized` / `DINOU_UNVENDORIZED=true`) inside directories containing spaces caused the flag to be incorrectly injected within directory paths, resulting in `MODULE_NOT_FOUND` errors. The internal command parser now reliably handles double-quoted paths and compound command chains (`&&`, `||`, `;`), ensuring robust and idempotent `-u` flag placement across all child Node processes.
17
+
8
18
  ## [9.0.0] - 2026-10-25
9
19
 
10
20
  ### Added
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # **Dinou**
2
2
 
3
- [![Documentation](https://img.shields.io/badge/docs-dinou.dev-blue?style=flat-square)](https://dinou.dev) [![Version](https://img.shields.io/badge/version-9.0.0-orange?style=flat-square)](https://www.npmjs.com/package/dinou)
3
+ [![Documentation](https://img.shields.io/badge/docs-dinou.dev-blue?style=flat-square)](https://dinou.dev) [![Version](https://img.shields.io/badge/version-9.0.2-orange?style=flat-square)](https://www.npmjs.com/package/dinou)
4
4
 
5
5
  ### **Full-Stack React 19 Framework**
6
6
 
package/cli.js CHANGED
@@ -1,525 +1,531 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from "node:fs";
4
- import { program } from "commander";
5
- import { execSync } from "node:child_process";
6
- import path from "node:path";
7
- import { fileURLToPath } from "node:url";
8
-
9
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
- const dinouPath = fs.existsSync(path.resolve(__dirname, "dinou")) ? path.resolve(__dirname, "dinou") : __dirname;
11
- const projectRoot = process.cwd();
12
-
13
- // Global CLI options for Dinou v9 (Dual-Mode Vendoring)
14
- program
15
- .name("dinou")
16
- .description("Full-stack React 19 framework with native RSC, progressive streaming, and dual-mode vendoring")
17
- .version("9.0.0")
18
- .option("-u, --unvendorized", "Run with standard node_modules dependencies instead of pre-bundled vendor packages");
19
-
20
- const isUnvendorizedRequested = () =>
21
- process.argv.includes("-u") ||
22
- process.argv.includes("--unvendorized") ||
23
- process.env.DINOU_UNVENDORIZED === "true" ||
24
- process.env.DINOU_UNVENDORIZED === "1" ||
25
- Boolean(program.opts?.().unvendorized);
26
-
27
- const pathKey = Object.keys(process.env).find((k) => k.toLowerCase() === "path") || "PATH";
28
- const projectBin = path.join(projectRoot, "node_modules", ".bin");
29
- const dinouBin = path.join(dinouPath, "node_modules", ".bin");
30
- const extendedPath = [projectBin, dinouBin, process.env[pathKey]].filter(Boolean).join(path.delimiter);
31
-
32
- const runCommand = (command, options = {}) => {
33
- try {
34
- const unvendorized = isUnvendorizedRequested();
35
- const env = {
36
- ...process.env,
37
- [pathKey]: extendedPath,
38
- Path: extendedPath,
39
- PATH: extendedPath,
40
- ...(unvendorized ? { DINOU_UNVENDORIZED: "true" } : {}),
41
- ...(options.env || {}),
42
- };
43
-
44
- let finalCommand = command;
45
- if (unvendorized) {
46
- finalCommand = finalCommand.replace(/(node\s+[^\s&|]+(?:\.js|\.mjs)?)(?!\s+-u)/g, "$1 -u");
47
- }
48
-
49
- execSync(finalCommand, { stdio: "inherit", cwd: projectRoot, ...options, env });
50
- } catch (error) {
51
- console.error(`Error executing "${command}":`, error.message);
52
- process.exit(1);
53
- }
54
- };
55
-
56
- // Helper paths
57
- const p = (rel) => `"${path.join(dinouPath, rel).replaceAll("\\", "/")}"`;
58
-
59
- // --- DEV ---
60
-
61
- program
62
- .command("dev")
63
- .description("Start development server with Esbuild")
64
- .action(() => {
65
- runCommand(`cross-env DINOU_BUILD_TOOL=esbuild node ${p("node/dev.js")}`);
66
- });
67
-
68
- program
69
- .command("dev:esbuild")
70
- .description("Start development server with Esbuild")
71
- .action(() => {
72
- runCommand(`cross-env DINOU_BUILD_TOOL=esbuild node ${p("node/dev.js")}`);
73
- });
74
-
75
- program
76
- .command("dev:rollup")
77
- .description("Start development server with Rollup")
78
- .action(() => {
79
- runCommand(`cross-env DINOU_BUILD_TOOL=rollup node ${p("node/dev.js")}`);
80
- });
81
-
82
- program
83
- .command("dev:webpack")
84
- .description("Start development server with Webpack")
85
- .action(() => {
86
- runCommand(`cross-env DINOU_BUILD_TOOL=webpack node ${p("node/dev.js")}`);
87
- });
88
-
89
- // --- NODE (BUILD & START) ---
90
-
91
- program
92
- .command("build")
93
- .description("Build the app for Node.js production (using esbuild)")
94
- .action(() => {
95
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
96
- });
97
-
98
- program
99
- .command("build:node")
100
- .description("Build the app for Node.js production (using esbuild)")
101
- .action(() => {
102
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
103
- });
104
-
105
- program
106
- .command("build:node:esbuild")
107
- .description("Build the app for Node.js with Esbuild")
108
- .action(() => {
109
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
110
- });
111
-
112
- program
113
- .command("build:node:rollup")
114
- .description("Build the app for Node.js with Rollup")
115
- .action(() => {
116
- runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("node/build.js")}`);
117
- });
118
-
119
- program
120
- .command("build:node:webpack")
121
- .description("Build the app for Node.js with Webpack")
122
- .action(() => {
123
- runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack node ${p("node/build.js")}`);
124
- });
125
-
126
- program
127
- .command("start")
128
- .description("Start the app in production mode (Node.js)")
129
- .action(() => {
130
- runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
131
- });
132
-
133
- program
134
- .command("start:node")
135
- .description("Start the app in production mode (Node.js)")
136
- .action(() => {
137
- runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
138
- });
139
-
140
- program
141
- .command("start:node:esbuild")
142
- .description("Start the app in production mode (Esbuild build)")
143
- .action(() => {
144
- runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
145
- });
146
-
147
- program
148
- .command("start:node:rollup")
149
- .description("Start the app in production mode (Rollup build)")
150
- .action(() => {
151
- runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
152
- });
153
-
154
- program
155
- .command("start:node:webpack")
156
- .description("Start the app in production mode (Webpack build)")
157
- .action(() => {
158
- runCommand(`cross-env NODE_ENV=production DINOU_BUILD_TOOL=webpack node ${p("adapters/node.js")}`);
159
- });
160
-
161
- // --- NODE (COMPILE VIA BUN) ---
162
-
163
- const nodeTargets = [
164
- { name: "", flags: "", outfile: "dist/server" },
165
- { name: ":linux", flags: "--target=bun-linux-x64 ", outfile: "dist/server-linux" },
166
- { name: ":linux_arm", flags: "--target=bun-linux-arm64 ", outfile: "dist/server-linux-arm" },
167
- { name: ":mac", flags: "--target=bun-darwin-arm64 ", outfile: "dist/server-mac" },
168
- { name: ":win", flags: "--target=bun-windows-x64 ", outfile: "dist/server-win" },
169
- ];
170
-
171
- const runNodeBuild = (bundler) => {
172
- const bundlerCmd = bundler === "rollup"
173
- ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
174
- : bundler === "webpack"
175
- ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
176
- : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
177
-
178
- const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
179
- return `${bundlerCmd} && ${envPrefix}node ${p("node/build.js")}`;
180
- };
181
-
182
- for (const t of nodeTargets) {
183
- for (const b of ["esbuild", "rollup", "webpack"]) {
184
- const cmdNames = b === "esbuild"
185
- ? [`build:node:compile${t.name}`, `build:node:compile${t.name}:esbuild`]
186
- : [`build:node:compile${t.name}:${b}`];
187
- for (const cmdName of cmdNames) {
188
- program
189
- .command(cmdName)
190
- .description(`Compile standalone Node.js server executable with Bun (${t.name || "host"}, ${b})`)
191
- .action(() => {
192
- runCommand(`${runNodeBuild(b)} && bun build --compile ${t.flags}.dinou/node/server.mjs --outfile ${t.outfile}`);
193
- });
194
- }
195
- }
196
- }
197
-
198
- // --- NODE (PURE BUN RUNNER COMPILE) ---
199
-
200
- const runNodePureBuild = (bundler) => {
201
- if (bundler === "rollup") {
202
- return `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && bun ${p("node/build.js")}`;
203
- }
204
- if (bundler === "webpack") {
205
- return `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack bun ${p("node/build.js")}`;
206
- }
207
- return `cross-env NODE_ENV=production bun ${p("esbuild/build.js")} && bun ${p("node/build.js")}`;
208
- };
209
-
210
- program
211
- .command("build:node:pure")
212
- .description("Build the app for Node.js with 100% Bun (using esbuild)")
213
- .action(() => { runCommand(runNodePureBuild("esbuild")); });
214
-
215
- program
216
- .command("build:node:pure:esbuild")
217
- .description("Build the app for Node.js with 100% Bun (Esbuild)")
218
- .action(() => { runCommand(runNodePureBuild("esbuild")); });
219
-
220
- program
221
- .command("build:node:pure:rollup")
222
- .description("Build the app for Node.js with 100% Bun (Rollup)")
223
- .action(() => { runCommand(runNodePureBuild("rollup")); });
224
-
225
- program
226
- .command("build:node:pure:webpack")
227
- .description("Build the app for Node.js with 100% Bun (Webpack)")
228
- .action(() => { runCommand(runNodePureBuild("webpack")); });
229
-
230
- for (const t of nodeTargets) {
231
- for (const b of ["esbuild", "rollup", "webpack"]) {
232
- const cmdNames = b === "esbuild"
233
- ? [`build:node:pure:compile${t.name}`, `build:node:pure:compile${t.name}:esbuild`]
234
- : [`build:node:pure:compile${t.name}:${b}`];
235
- for (const cmdName of cmdNames) {
236
- program
237
- .command(cmdName)
238
- .description(`Compile standalone Node.js server executable with 100% Bun (${t.name || "host"}, ${b})`)
239
- .action(() => {
240
- runCommand(`${runNodePureBuild(b)} && bun build --compile ${t.flags}.dinou/node/server.mjs --outfile ${t.outfile}`);
241
- });
242
- }
243
- }
244
- }
245
-
246
- // --- CLOUDFLARE WORKERS ---
247
-
248
- program
249
- .command("build:cloudflare")
250
- .description("Build the app for Cloudflare Workers (using esbuild)")
251
- .action(() => {
252
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("cloudflare/build.js")}`);
253
- });
254
-
255
- program
256
- .command("build:cloudflare:esbuild")
257
- .description("Build the app for Cloudflare Workers with Esbuild")
258
- .action(() => {
259
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("cloudflare/build.js")}`);
260
- });
261
-
262
- program
263
- .command("build:cloudflare:rollup")
264
- .description("Build the app for Cloudflare Workers with Rollup")
265
- .action(() => {
266
- runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("cloudflare/build.js")}`);
267
- });
268
-
269
- program
270
- .command("build:cloudflare:webpack")
271
- .description("Build the app for Cloudflare Workers with Webpack")
272
- .action(() => {
273
- runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack node ${p("cloudflare/build.js")}`);
274
- });
275
-
276
- // --- DENO DEPLOY / EDGE ---
277
-
278
- const runDenoBuild = (bundler) => {
279
- const bundlerCmd = bundler === "rollup"
280
- ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
281
- : bundler === "webpack"
282
- ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
283
- : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
284
-
285
- const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
286
- return `${bundlerCmd} && ${envPrefix}node ${p("deno/build.js")} && deno run --unstable-kv --allow-net --allow-read --allow-write --allow-env ${p("deno/seed-kv.js")}`;
287
- };
288
-
289
- program
290
- .command("build:deno")
291
- .description("Build the app for Deno Deploy / Edge (using esbuild)")
292
- .action(() => { runCommand(runDenoBuild("esbuild")); });
293
-
294
- program
295
- .command("build:deno:esbuild")
296
- .description("Build the app for Deno Deploy with Esbuild")
297
- .action(() => { runCommand(runDenoBuild("esbuild")); });
298
-
299
- program
300
- .command("build:deno:rollup")
301
- .description("Build the app for Deno Deploy with Rollup")
302
- .action(() => { runCommand(runDenoBuild("rollup")); });
303
-
304
- program
305
- .command("build:deno:webpack")
306
- .description("Build the app for Deno Deploy with Webpack")
307
- .action(() => { runCommand(runDenoBuild("webpack")); });
308
-
309
- program
310
- .command("start:deno")
311
- .description("Start the app in production mode with Deno")
312
- .action(() => {
313
- runCommand(`deno run --unstable-kv --allow-net --allow-read --allow-write --allow-env --allow-sys ${p("adapters/deno.js")}`);
314
- });
315
-
316
- // Deno compile commands
317
- const denoTargets = [
318
- { name: "", flags: "", outfile: "dist/deno-server" },
319
- { name: ":linux", flags: "--target x86_64-unknown-linux-gnu ", outfile: "dist/deno-server-linux" },
320
- { name: ":linux_arm", flags: "--target aarch64-unknown-linux-gnu ", outfile: "dist/deno-server-linux-arm" },
321
- { name: ":mac", flags: "--target aarch64-apple-darwin ", outfile: "dist/deno-server-mac" },
322
- { name: ":win", flags: "--target x86_64-pc-windows-msvc ", outfile: "dist/deno-server-win" },
323
- ];
324
-
325
- for (const t of denoTargets) {
326
- for (const b of ["esbuild", "rollup", "webpack"]) {
327
- const cmdNames = b === "esbuild"
328
- ? [`build:deno:compile${t.name}`, `build:deno:compile${t.name}:esbuild`]
329
- : [`build:deno:compile${t.name}:${b}`];
330
- for (const cmdName of cmdNames) {
331
- program
332
- .command(cmdName)
333
- .description(`Compile standalone Deno executable (${t.name || "host"}, ${b})`)
334
- .action(() => {
335
- runCommand(`${runDenoBuild(b)} && deno compile ${t.flags}--no-check --no-config --allow-net --allow-read --allow-write --allow-env --allow-sys --output ${t.outfile} .dinou/deno/main.js`);
336
- });
337
- }
338
- }
339
- }
340
-
341
- // --- BUN (STANDARD) ---
342
-
343
- const runBunBuild = (bundler) => {
344
- const bundlerCmd = bundler === "rollup"
345
- ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
346
- : bundler === "webpack"
347
- ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
348
- : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
349
-
350
- const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
351
- return `${bundlerCmd} && ${envPrefix}node ${p("bun/build.js")}`;
352
- };
353
-
354
- program
355
- .command("build:bun")
356
- .description("Build the app for Bun (using esbuild)")
357
- .action(() => { runCommand(runBunBuild("esbuild")); });
358
-
359
- program
360
- .command("build:bun:esbuild")
361
- .description("Build the app for Bun with Esbuild")
362
- .action(() => { runCommand(runBunBuild("esbuild")); });
363
-
364
- program
365
- .command("build:bun:rollup")
366
- .description("Build the app for Bun with Rollup")
367
- .action(() => { runCommand(runBunBuild("rollup")); });
368
-
369
- program
370
- .command("build:bun:webpack")
371
- .description("Build the app for Bun with Webpack")
372
- .action(() => { runCommand(runBunBuild("webpack")); });
373
-
374
- program
375
- .command("start:bun")
376
- .description("Start the app in production mode with Bun")
377
- .action(() => {
378
- runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
379
- });
380
-
381
- program
382
- .command("start:bun:esbuild")
383
- .description("Start the app in production mode with Bun (Esbuild)")
384
- .action(() => {
385
- runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
386
- });
387
-
388
- program
389
- .command("start:bun:rollup")
390
- .description("Start the app in production mode with Bun (Rollup)")
391
- .action(() => {
392
- runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
393
- });
394
-
395
- program
396
- .command("start:bun:webpack")
397
- .description("Start the app in production mode with Bun (Webpack)")
398
- .action(() => {
399
- runCommand(`cross-env NODE_ENV=production DINOU_BUILD_TOOL=webpack bun ${p("adapters/bun.js")}`);
400
- });
401
-
402
- const bunTargets = [
403
- { name: "", flags: "", outfile: "dist/server" },
404
- { name: ":linux", flags: "--target=bun-linux-x64 ", outfile: "dist/server-linux" },
405
- { name: ":linux_arm", flags: "--target=bun-linux-arm64 ", outfile: "dist/server-linux-arm" },
406
- { name: ":mac", flags: "--target=bun-darwin-arm64 ", outfile: "dist/server-mac" },
407
- { name: ":win", flags: "--target=bun-windows-x64 ", outfile: "dist/server-win" },
408
- ];
409
-
410
- for (const t of bunTargets) {
411
- for (const b of ["esbuild", "rollup", "webpack"]) {
412
- const cmdNames = b === "esbuild"
413
- ? [`build:bun:compile${t.name}`, `build:bun:compile${t.name}:esbuild`]
414
- : [`build:bun:compile${t.name}:${b}`];
415
- for (const cmdName of cmdNames) {
416
- program
417
- .command(cmdName)
418
- .description(`Compile standalone Bun executable (${t.name || "host"}, ${b})`)
419
- .action(() => {
420
- runCommand(`${runBunBuild(b)} && bun build --compile ${t.flags}.dinou/bun/server.js --outfile ${t.outfile}`);
421
- });
422
- }
423
- }
424
- }
425
-
426
- // --- BUN (PURE) ---
427
-
428
- const runBunPureBuild = (bundler) => {
429
- if (bundler === "rollup") {
430
- return `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && bun ${p("bun/build.js")}`;
431
- }
432
- if (bundler === "webpack") {
433
- return `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack bun ${p("bun/build.js")}`;
434
- }
435
- return `cross-env NODE_ENV=production bun ${p("esbuild/build.js")} && bun ${p("bun/build.js")}`;
436
- };
437
-
438
- program
439
- .command("build:bun:pure")
440
- .description("Build the app with 100% Bun (using esbuild)")
441
- .action(() => { runCommand(runBunPureBuild("esbuild")); });
442
-
443
- program
444
- .command("build:bun:pure:esbuild")
445
- .description("Build the app with 100% Bun (Esbuild)")
446
- .action(() => { runCommand(runBunPureBuild("esbuild")); });
447
-
448
- program
449
- .command("build:bun:pure:rollup")
450
- .description("Build the app with 100% Bun (Rollup)")
451
- .action(() => { runCommand(runBunPureBuild("rollup")); });
452
-
453
- program
454
- .command("build:bun:pure:webpack")
455
- .description("Build the app with 100% Bun (Webpack)")
456
- .action(() => { runCommand(runBunPureBuild("webpack")); });
457
-
458
- for (const t of bunTargets) {
459
- for (const b of ["esbuild", "rollup", "webpack"]) {
460
- const cmdNames = b === "esbuild"
461
- ? [`build:bun:pure:compile${t.name}`, `build:bun:pure:compile${t.name}:esbuild`]
462
- : [`build:bun:pure:compile${t.name}:${b}`];
463
- for (const cmdName of cmdNames) {
464
- program
465
- .command(cmdName)
466
- .description(`Compile standalone Bun Pure executable (${t.name || "host"}, ${b})`)
467
- .action(() => {
468
- runCommand(`${runBunPureBuild(b)} && bun build --compile ${t.flags}.dinou/bun/server.js --outfile ${t.outfile}`);
469
- });
470
- }
471
- }
472
- }
473
-
474
- // --- EXPORT STATIC ---
475
-
476
- program
477
- .command("export-static")
478
- .description("Export standalone static website (using esbuild)")
479
- .action(() => {
480
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("core/export-static.js")}`);
481
- });
482
-
483
- program
484
- .command("export-static:esbuild")
485
- .description("Export standalone static website with Esbuild")
486
- .action(() => {
487
- runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("core/export-static.js")}`);
488
- });
489
-
490
- program
491
- .command("export-static:rollup")
492
- .description("Export standalone static website with Rollup")
493
- .action(() => {
494
- runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("core/export-static.js")}`);
495
- });
496
-
497
- program
498
- .command("export-static:webpack")
499
- .description("Export standalone static website with Webpack")
500
- .action(() => {
501
- runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && node ${p("core/export-static.js")}`);
502
- });
503
-
504
-
505
- // --- VENDORS ---
506
-
507
- program
508
- .command("build:vendors")
509
- .description("Bundle dependencies into dinou/compiled vendors")
510
- .action(() => {
511
- runCommand(`node ${p("scripts/build-vendors.js")}`);
512
- });
513
-
514
- // --- EJECT ---
515
-
516
- program
517
- .command("eject")
518
- .description("Copy the framework to the root of the project")
519
- .action(async () => {
520
- console.log("Executing eject...");
521
- const { eject } = await import("./eject.js");
522
- eject();
523
- });
524
-
525
- program.parse(process.argv);
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import { program } from "commander";
5
+ import { execSync } from "node:child_process";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
+ const dinouPath = fs.existsSync(path.resolve(__dirname, "dinou")) ? path.resolve(__dirname, "dinou") : __dirname;
11
+ const projectRoot = process.cwd();
12
+
13
+ // Global CLI options for Dinou v9 (Dual-Mode Vendoring)
14
+ program
15
+ .name("dinou")
16
+ .description("Full-stack React 19 framework with native RSC, progressive streaming, and dual-mode vendoring")
17
+ .version("9.0.2")
18
+ .option("-u, --unvendorized", "Run with standard node_modules dependencies instead of pre-bundled vendor packages");
19
+
20
+ const isUnvendorizedRequested = () =>
21
+ process.argv.includes("-u") ||
22
+ process.argv.includes("--unvendorized") ||
23
+ process.env.DINOU_UNVENDORIZED === "true" ||
24
+ process.env.DINOU_UNVENDORIZED === "1" ||
25
+ Boolean(program.opts?.().unvendorized);
26
+
27
+ const pathKey = Object.keys(process.env).find((k) => k.toLowerCase() === "path") || "PATH";
28
+ const projectBin = path.join(projectRoot, "node_modules", ".bin");
29
+ const dinouBin = path.join(dinouPath, "node_modules", ".bin");
30
+ const extendedPath = [projectBin, dinouBin, process.env[pathKey]].filter(Boolean).join(path.delimiter);
31
+
32
+ const runCommand = (command, options = {}) => {
33
+ try {
34
+ const unvendorized = isUnvendorizedRequested();
35
+ const baseNodeOptions = process.env.NODE_OPTIONS || "";
36
+ const nodeOptions = unvendorized && !baseNodeOptions.includes("unvendorized")
37
+ ? (baseNodeOptions ? `${baseNodeOptions} ` : "") + "--conditions=unvendorized"
38
+ : baseNodeOptions;
39
+
40
+ const env = {
41
+ ...process.env,
42
+ [pathKey]: extendedPath,
43
+ Path: extendedPath,
44
+ PATH: extendedPath,
45
+ ...(unvendorized ? { DINOU_UNVENDORIZED: "true" } : {}),
46
+ ...(nodeOptions ? { NODE_OPTIONS: nodeOptions } : {}),
47
+ ...(options.env || {}),
48
+ };
49
+
50
+ let finalCommand = command;
51
+ if (unvendorized) {
52
+ finalCommand = finalCommand.replace(/(node\s+(?:"[^"]+"|[^\s"&|]+))(?!\s+-u\b)(?=\s|$|[&|;])/g, "$1 -u");
53
+ }
54
+
55
+ execSync(finalCommand, { stdio: "inherit", cwd: projectRoot, ...options, env });
56
+ } catch (error) {
57
+ console.error(`Error executing "${command}":`, error.message);
58
+ process.exit(1);
59
+ }
60
+ };
61
+
62
+ // Helper paths
63
+ const p = (rel) => `"${path.join(dinouPath, rel).replaceAll("\\", "/")}"`;
64
+
65
+ // --- DEV ---
66
+
67
+ program
68
+ .command("dev")
69
+ .description("Start development server with Esbuild")
70
+ .action(() => {
71
+ runCommand(`cross-env DINOU_BUILD_TOOL=esbuild node ${p("node/dev.js")}`);
72
+ });
73
+
74
+ program
75
+ .command("dev:esbuild")
76
+ .description("Start development server with Esbuild")
77
+ .action(() => {
78
+ runCommand(`cross-env DINOU_BUILD_TOOL=esbuild node ${p("node/dev.js")}`);
79
+ });
80
+
81
+ program
82
+ .command("dev:rollup")
83
+ .description("Start development server with Rollup")
84
+ .action(() => {
85
+ runCommand(`cross-env DINOU_BUILD_TOOL=rollup node ${p("node/dev.js")}`);
86
+ });
87
+
88
+ program
89
+ .command("dev:webpack")
90
+ .description("Start development server with Webpack")
91
+ .action(() => {
92
+ runCommand(`cross-env DINOU_BUILD_TOOL=webpack node ${p("node/dev.js")}`);
93
+ });
94
+
95
+ // --- NODE (BUILD & START) ---
96
+
97
+ program
98
+ .command("build")
99
+ .description("Build the app for Node.js production (using esbuild)")
100
+ .action(() => {
101
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
102
+ });
103
+
104
+ program
105
+ .command("build:node")
106
+ .description("Build the app for Node.js production (using esbuild)")
107
+ .action(() => {
108
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
109
+ });
110
+
111
+ program
112
+ .command("build:node:esbuild")
113
+ .description("Build the app for Node.js with Esbuild")
114
+ .action(() => {
115
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("node/build.js")}`);
116
+ });
117
+
118
+ program
119
+ .command("build:node:rollup")
120
+ .description("Build the app for Node.js with Rollup")
121
+ .action(() => {
122
+ runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("node/build.js")}`);
123
+ });
124
+
125
+ program
126
+ .command("build:node:webpack")
127
+ .description("Build the app for Node.js with Webpack")
128
+ .action(() => {
129
+ runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack node ${p("node/build.js")}`);
130
+ });
131
+
132
+ program
133
+ .command("start")
134
+ .description("Start the app in production mode (Node.js)")
135
+ .action(() => {
136
+ runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
137
+ });
138
+
139
+ program
140
+ .command("start:node")
141
+ .description("Start the app in production mode (Node.js)")
142
+ .action(() => {
143
+ runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
144
+ });
145
+
146
+ program
147
+ .command("start:node:esbuild")
148
+ .description("Start the app in production mode (Esbuild build)")
149
+ .action(() => {
150
+ runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
151
+ });
152
+
153
+ program
154
+ .command("start:node:rollup")
155
+ .description("Start the app in production mode (Rollup build)")
156
+ .action(() => {
157
+ runCommand(`cross-env NODE_ENV=production node ${p("adapters/node.js")}`);
158
+ });
159
+
160
+ program
161
+ .command("start:node:webpack")
162
+ .description("Start the app in production mode (Webpack build)")
163
+ .action(() => {
164
+ runCommand(`cross-env NODE_ENV=production DINOU_BUILD_TOOL=webpack node ${p("adapters/node.js")}`);
165
+ });
166
+
167
+ // --- NODE (COMPILE VIA BUN) ---
168
+
169
+ const nodeTargets = [
170
+ { name: "", flags: "", outfile: "dist/server" },
171
+ { name: ":linux", flags: "--target=bun-linux-x64 ", outfile: "dist/server-linux" },
172
+ { name: ":linux_arm", flags: "--target=bun-linux-arm64 ", outfile: "dist/server-linux-arm" },
173
+ { name: ":mac", flags: "--target=bun-darwin-arm64 ", outfile: "dist/server-mac" },
174
+ { name: ":win", flags: "--target=bun-windows-x64 ", outfile: "dist/server-win" },
175
+ ];
176
+
177
+ const runNodeBuild = (bundler) => {
178
+ const bundlerCmd = bundler === "rollup"
179
+ ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
180
+ : bundler === "webpack"
181
+ ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
182
+ : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
183
+
184
+ const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
185
+ return `${bundlerCmd} && ${envPrefix}node ${p("node/build.js")}`;
186
+ };
187
+
188
+ for (const t of nodeTargets) {
189
+ for (const b of ["esbuild", "rollup", "webpack"]) {
190
+ const cmdNames = b === "esbuild"
191
+ ? [`build:node:compile${t.name}`, `build:node:compile${t.name}:esbuild`]
192
+ : [`build:node:compile${t.name}:${b}`];
193
+ for (const cmdName of cmdNames) {
194
+ program
195
+ .command(cmdName)
196
+ .description(`Compile standalone Node.js server executable with Bun (${t.name || "host"}, ${b})`)
197
+ .action(() => {
198
+ runCommand(`${runNodeBuild(b)} && bun build --compile ${t.flags}.dinou/node/server.mjs --outfile ${t.outfile}`);
199
+ });
200
+ }
201
+ }
202
+ }
203
+
204
+ // --- NODE (PURE BUN RUNNER COMPILE) ---
205
+
206
+ const runNodePureBuild = (bundler) => {
207
+ if (bundler === "rollup") {
208
+ return `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && bun ${p("node/build.js")}`;
209
+ }
210
+ if (bundler === "webpack") {
211
+ return `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack bun ${p("node/build.js")}`;
212
+ }
213
+ return `cross-env NODE_ENV=production bun ${p("esbuild/build.js")} && bun ${p("node/build.js")}`;
214
+ };
215
+
216
+ program
217
+ .command("build:node:pure")
218
+ .description("Build the app for Node.js with 100% Bun (using esbuild)")
219
+ .action(() => { runCommand(runNodePureBuild("esbuild")); });
220
+
221
+ program
222
+ .command("build:node:pure:esbuild")
223
+ .description("Build the app for Node.js with 100% Bun (Esbuild)")
224
+ .action(() => { runCommand(runNodePureBuild("esbuild")); });
225
+
226
+ program
227
+ .command("build:node:pure:rollup")
228
+ .description("Build the app for Node.js with 100% Bun (Rollup)")
229
+ .action(() => { runCommand(runNodePureBuild("rollup")); });
230
+
231
+ program
232
+ .command("build:node:pure:webpack")
233
+ .description("Build the app for Node.js with 100% Bun (Webpack)")
234
+ .action(() => { runCommand(runNodePureBuild("webpack")); });
235
+
236
+ for (const t of nodeTargets) {
237
+ for (const b of ["esbuild", "rollup", "webpack"]) {
238
+ const cmdNames = b === "esbuild"
239
+ ? [`build:node:pure:compile${t.name}`, `build:node:pure:compile${t.name}:esbuild`]
240
+ : [`build:node:pure:compile${t.name}:${b}`];
241
+ for (const cmdName of cmdNames) {
242
+ program
243
+ .command(cmdName)
244
+ .description(`Compile standalone Node.js server executable with 100% Bun (${t.name || "host"}, ${b})`)
245
+ .action(() => {
246
+ runCommand(`${runNodePureBuild(b)} && bun build --compile ${t.flags}.dinou/node/server.mjs --outfile ${t.outfile}`);
247
+ });
248
+ }
249
+ }
250
+ }
251
+
252
+ // --- CLOUDFLARE WORKERS ---
253
+
254
+ program
255
+ .command("build:cloudflare")
256
+ .description("Build the app for Cloudflare Workers (using esbuild)")
257
+ .action(() => {
258
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("cloudflare/build.js")}`);
259
+ });
260
+
261
+ program
262
+ .command("build:cloudflare:esbuild")
263
+ .description("Build the app for Cloudflare Workers with Esbuild")
264
+ .action(() => {
265
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("cloudflare/build.js")}`);
266
+ });
267
+
268
+ program
269
+ .command("build:cloudflare:rollup")
270
+ .description("Build the app for Cloudflare Workers with Rollup")
271
+ .action(() => {
272
+ runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("cloudflare/build.js")}`);
273
+ });
274
+
275
+ program
276
+ .command("build:cloudflare:webpack")
277
+ .description("Build the app for Cloudflare Workers with Webpack")
278
+ .action(() => {
279
+ runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack node ${p("cloudflare/build.js")}`);
280
+ });
281
+
282
+ // --- DENO DEPLOY / EDGE ---
283
+
284
+ const runDenoBuild = (bundler) => {
285
+ const bundlerCmd = bundler === "rollup"
286
+ ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
287
+ : bundler === "webpack"
288
+ ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
289
+ : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
290
+
291
+ const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
292
+ return `${bundlerCmd} && ${envPrefix}node ${p("deno/build.js")} && deno run --unstable-kv --allow-net --allow-read --allow-write --allow-env ${p("deno/seed-kv.js")}`;
293
+ };
294
+
295
+ program
296
+ .command("build:deno")
297
+ .description("Build the app for Deno Deploy / Edge (using esbuild)")
298
+ .action(() => { runCommand(runDenoBuild("esbuild")); });
299
+
300
+ program
301
+ .command("build:deno:esbuild")
302
+ .description("Build the app for Deno Deploy with Esbuild")
303
+ .action(() => { runCommand(runDenoBuild("esbuild")); });
304
+
305
+ program
306
+ .command("build:deno:rollup")
307
+ .description("Build the app for Deno Deploy with Rollup")
308
+ .action(() => { runCommand(runDenoBuild("rollup")); });
309
+
310
+ program
311
+ .command("build:deno:webpack")
312
+ .description("Build the app for Deno Deploy with Webpack")
313
+ .action(() => { runCommand(runDenoBuild("webpack")); });
314
+
315
+ program
316
+ .command("start:deno")
317
+ .description("Start the app in production mode with Deno")
318
+ .action(() => {
319
+ runCommand(`deno run --unstable-kv --allow-net --allow-read --allow-write --allow-env --allow-sys ${p("adapters/deno.js")}`);
320
+ });
321
+
322
+ // Deno compile commands
323
+ const denoTargets = [
324
+ { name: "", flags: "", outfile: "dist/deno-server" },
325
+ { name: ":linux", flags: "--target x86_64-unknown-linux-gnu ", outfile: "dist/deno-server-linux" },
326
+ { name: ":linux_arm", flags: "--target aarch64-unknown-linux-gnu ", outfile: "dist/deno-server-linux-arm" },
327
+ { name: ":mac", flags: "--target aarch64-apple-darwin ", outfile: "dist/deno-server-mac" },
328
+ { name: ":win", flags: "--target x86_64-pc-windows-msvc ", outfile: "dist/deno-server-win" },
329
+ ];
330
+
331
+ for (const t of denoTargets) {
332
+ for (const b of ["esbuild", "rollup", "webpack"]) {
333
+ const cmdNames = b === "esbuild"
334
+ ? [`build:deno:compile${t.name}`, `build:deno:compile${t.name}:esbuild`]
335
+ : [`build:deno:compile${t.name}:${b}`];
336
+ for (const cmdName of cmdNames) {
337
+ program
338
+ .command(cmdName)
339
+ .description(`Compile standalone Deno executable (${t.name || "host"}, ${b})`)
340
+ .action(() => {
341
+ runCommand(`${runDenoBuild(b)} && deno compile ${t.flags}--no-check --no-config --allow-net --allow-read --allow-write --allow-env --allow-sys --output ${t.outfile} .dinou/deno/main.js`);
342
+ });
343
+ }
344
+ }
345
+ }
346
+
347
+ // --- BUN (STANDARD) ---
348
+
349
+ const runBunBuild = (bundler) => {
350
+ const bundlerCmd = bundler === "rollup"
351
+ ? `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")}`
352
+ : bundler === "webpack"
353
+ ? `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")}`
354
+ : `cross-env NODE_ENV=production node ${p("esbuild/build.js")}`;
355
+
356
+ const envPrefix = bundler === "webpack" ? "cross-env DINOU_BUILD_TOOL=webpack " : "";
357
+ return `${bundlerCmd} && ${envPrefix}node ${p("bun/build.js")}`;
358
+ };
359
+
360
+ program
361
+ .command("build:bun")
362
+ .description("Build the app for Bun (using esbuild)")
363
+ .action(() => { runCommand(runBunBuild("esbuild")); });
364
+
365
+ program
366
+ .command("build:bun:esbuild")
367
+ .description("Build the app for Bun with Esbuild")
368
+ .action(() => { runCommand(runBunBuild("esbuild")); });
369
+
370
+ program
371
+ .command("build:bun:rollup")
372
+ .description("Build the app for Bun with Rollup")
373
+ .action(() => { runCommand(runBunBuild("rollup")); });
374
+
375
+ program
376
+ .command("build:bun:webpack")
377
+ .description("Build the app for Bun with Webpack")
378
+ .action(() => { runCommand(runBunBuild("webpack")); });
379
+
380
+ program
381
+ .command("start:bun")
382
+ .description("Start the app in production mode with Bun")
383
+ .action(() => {
384
+ runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
385
+ });
386
+
387
+ program
388
+ .command("start:bun:esbuild")
389
+ .description("Start the app in production mode with Bun (Esbuild)")
390
+ .action(() => {
391
+ runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
392
+ });
393
+
394
+ program
395
+ .command("start:bun:rollup")
396
+ .description("Start the app in production mode with Bun (Rollup)")
397
+ .action(() => {
398
+ runCommand(`cross-env NODE_ENV=production bun ${p("adapters/bun.js")}`);
399
+ });
400
+
401
+ program
402
+ .command("start:bun:webpack")
403
+ .description("Start the app in production mode with Bun (Webpack)")
404
+ .action(() => {
405
+ runCommand(`cross-env NODE_ENV=production DINOU_BUILD_TOOL=webpack bun ${p("adapters/bun.js")}`);
406
+ });
407
+
408
+ const bunTargets = [
409
+ { name: "", flags: "", outfile: "dist/server" },
410
+ { name: ":linux", flags: "--target=bun-linux-x64 ", outfile: "dist/server-linux" },
411
+ { name: ":linux_arm", flags: "--target=bun-linux-arm64 ", outfile: "dist/server-linux-arm" },
412
+ { name: ":mac", flags: "--target=bun-darwin-arm64 ", outfile: "dist/server-mac" },
413
+ { name: ":win", flags: "--target=bun-windows-x64 ", outfile: "dist/server-win" },
414
+ ];
415
+
416
+ for (const t of bunTargets) {
417
+ for (const b of ["esbuild", "rollup", "webpack"]) {
418
+ const cmdNames = b === "esbuild"
419
+ ? [`build:bun:compile${t.name}`, `build:bun:compile${t.name}:esbuild`]
420
+ : [`build:bun:compile${t.name}:${b}`];
421
+ for (const cmdName of cmdNames) {
422
+ program
423
+ .command(cmdName)
424
+ .description(`Compile standalone Bun executable (${t.name || "host"}, ${b})`)
425
+ .action(() => {
426
+ runCommand(`${runBunBuild(b)} && bun build --compile ${t.flags}.dinou/bun/server.js --outfile ${t.outfile}`);
427
+ });
428
+ }
429
+ }
430
+ }
431
+
432
+ // --- BUN (PURE) ---
433
+
434
+ const runBunPureBuild = (bundler) => {
435
+ if (bundler === "rollup") {
436
+ return `cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && bun ${p("bun/build.js")}`;
437
+ }
438
+ if (bundler === "webpack") {
439
+ return `cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && cross-env DINOU_BUILD_TOOL=webpack bun ${p("bun/build.js")}`;
440
+ }
441
+ return `cross-env NODE_ENV=production bun ${p("esbuild/build.js")} && bun ${p("bun/build.js")}`;
442
+ };
443
+
444
+ program
445
+ .command("build:bun:pure")
446
+ .description("Build the app with 100% Bun (using esbuild)")
447
+ .action(() => { runCommand(runBunPureBuild("esbuild")); });
448
+
449
+ program
450
+ .command("build:bun:pure:esbuild")
451
+ .description("Build the app with 100% Bun (Esbuild)")
452
+ .action(() => { runCommand(runBunPureBuild("esbuild")); });
453
+
454
+ program
455
+ .command("build:bun:pure:rollup")
456
+ .description("Build the app with 100% Bun (Rollup)")
457
+ .action(() => { runCommand(runBunPureBuild("rollup")); });
458
+
459
+ program
460
+ .command("build:bun:pure:webpack")
461
+ .description("Build the app with 100% Bun (Webpack)")
462
+ .action(() => { runCommand(runBunPureBuild("webpack")); });
463
+
464
+ for (const t of bunTargets) {
465
+ for (const b of ["esbuild", "rollup", "webpack"]) {
466
+ const cmdNames = b === "esbuild"
467
+ ? [`build:bun:pure:compile${t.name}`, `build:bun:pure:compile${t.name}:esbuild`]
468
+ : [`build:bun:pure:compile${t.name}:${b}`];
469
+ for (const cmdName of cmdNames) {
470
+ program
471
+ .command(cmdName)
472
+ .description(`Compile standalone Bun Pure executable (${t.name || "host"}, ${b})`)
473
+ .action(() => {
474
+ runCommand(`${runBunPureBuild(b)} && bun build --compile ${t.flags}.dinou/bun/server.js --outfile ${t.outfile}`);
475
+ });
476
+ }
477
+ }
478
+ }
479
+
480
+ // --- EXPORT STATIC ---
481
+
482
+ program
483
+ .command("export-static")
484
+ .description("Export standalone static website (using esbuild)")
485
+ .action(() => {
486
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("core/export-static.js")}`);
487
+ });
488
+
489
+ program
490
+ .command("export-static:esbuild")
491
+ .description("Export standalone static website with Esbuild")
492
+ .action(() => {
493
+ runCommand(`cross-env NODE_ENV=production node ${p("esbuild/build.js")} && node ${p("core/export-static.js")}`);
494
+ });
495
+
496
+ program
497
+ .command("export-static:rollup")
498
+ .description("Export standalone static website with Rollup")
499
+ .action(() => {
500
+ runCommand(`cross-env NODE_ENV=production npx rollup -c ${p("rollup/rollup.config.js")} && node ${p("core/export-static.js")}`);
501
+ });
502
+
503
+ program
504
+ .command("export-static:webpack")
505
+ .description("Export standalone static website with Webpack")
506
+ .action(() => {
507
+ runCommand(`cross-env NODE_ENV=production npx webpack --config ${p("webpack/webpack.config.js")} && node ${p("core/export-static.js")}`);
508
+ });
509
+
510
+
511
+ // --- VENDORS ---
512
+
513
+ program
514
+ .command("build:vendors")
515
+ .description("Bundle dependencies into dinou/compiled vendors")
516
+ .action(() => {
517
+ runCommand(`node ${p("scripts/build-vendors.js")}`);
518
+ });
519
+
520
+ // --- EJECT ---
521
+
522
+ program
523
+ .command("eject")
524
+ .description("Copy the framework to the root of the project")
525
+ .action(async () => {
526
+ console.log("Executing eject...");
527
+ const { eject } = await import("./eject.js");
528
+ eject();
529
+ });
530
+
531
+ program.parse(process.argv);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinou-ejected",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "private": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinou",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Full-stack React 19 framework with native RSC, Server Functions, progressive streaming, and zero vendor lock-in.",
5
5
  "type": "module",
6
6
  "main": "./dinou/index.js",