resuxjs 0.3.7 → 0.3.8

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.
Files changed (38) hide show
  1. package/README.md +251 -251
  2. package/dist/cli.js +308 -295
  3. package/dist/cli.js.map +1 -1
  4. package/dist/compiler/implementation.js +266 -162
  5. package/dist/compiler/index.js.map +1 -1
  6. package/dist/core/module-container.d.ts +4 -0
  7. package/dist/core/module-container.js +35 -8
  8. package/dist/core/module-container.js.map +1 -1
  9. package/dist/create.js +446 -446
  10. package/dist/deploy/framework-runtime.d.ts +1 -0
  11. package/dist/deploy/framework-runtime.js +56 -0
  12. package/dist/deploy/framework-runtime.js.map +1 -0
  13. package/dist/deploy/netlify.js +7 -0
  14. package/dist/deploy/netlify.js.map +1 -1
  15. package/dist/deploy/production-report.d.ts +1 -0
  16. package/dist/deploy/production-report.js +19 -0
  17. package/dist/deploy/production-report.js.map +1 -0
  18. package/dist/deploy/runtime-dependencies.d.ts +4 -0
  19. package/dist/deploy/runtime-dependencies.js +237 -0
  20. package/dist/deploy/runtime-dependencies.js.map +1 -0
  21. package/dist/deploy/vercel.js +7 -125
  22. package/dist/deploy/vercel.js.map +1 -1
  23. package/dist/halal-core/ai/classifyRuntimeContent.js +20 -20
  24. package/dist/halal-core/report/generateHalalReport.js +17 -17
  25. package/dist/i18n/index.js +45 -6
  26. package/dist/i18n/index.js.map +1 -1
  27. package/dist/i18n/shared.js +11 -1
  28. package/dist/i18n/shared.js.map +1 -1
  29. package/dist/icons/index.d.ts +4 -4
  30. package/dist/runtime/index.d.ts +2 -0
  31. package/dist/runtime/index.js +9307 -8941
  32. package/dist/runtime/index.js.map +1 -1
  33. package/dist/ui/index.d.ts +15 -15
  34. package/dist/ui/index.js +254 -250
  35. package/dist/ui/index.js.map +1 -1
  36. package/package.json +150 -150
  37. package/templates/default/README.md +18 -18
  38. package/templates/default/pages/index.vue +102 -102
package/dist/cli.js CHANGED
@@ -22,33 +22,33 @@ let devReloadRevision = 0;
22
22
  let devLastBuildSourceMtime = 0;
23
23
  const devReloadClients = new Set();
24
24
  let devHalalOverlayScript = "";
25
- const RESUX_PLACEHOLDER_SVG = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
26
- <title id="title">Resux mark</title>
27
- <desc id="desc">A compact Resux monogram shaped like a resumable route.</desc>
28
- <defs>
29
- <linearGradient id="panel" x1="12" y1="8" x2="88" y2="92" gradientUnits="userSpaceOnUse">
30
- <stop stop-color="#111827"/>
31
- <stop offset="1" stop-color="#020617"/>
32
- </linearGradient>
33
- <linearGradient id="route" x1="25" y1="22" x2="73" y2="75" gradientUnits="userSpaceOnUse">
34
- <stop stop-color="#22D3EE"/>
35
- <stop offset="0.58" stop-color="#7C3AED"/>
36
- <stop offset="1" stop-color="#10B981"/>
37
- </linearGradient>
38
- <filter id="soft" x="8" y="8" width="80" height="80" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
39
- <feGaussianBlur stdDeviation="4"/>
40
- </filter>
41
- </defs>
42
- <rect x="4" y="4" width="88" height="88" rx="22" fill="url(#panel)"/>
43
- <path d="M24 29C31 20 43 16 55 18C68 20 77 29 77 41C77 54 67 62 53 62H36V77" stroke="#38BDF8" stroke-opacity="0.18" stroke-width="18" stroke-linecap="round" stroke-linejoin="round" filter="url(#soft)"/>
44
- <path d="M27 76V25H54C67 25 75 32 75 42C75 52 67 59 54 59H37" stroke="url(#route)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round"/>
45
- <path d="M50 59L72 76" stroke="url(#route)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round"/>
46
- <path d="M31 35H54C60 35 64 38 64 42C64 47 60 50 54 50H31" stroke="#F8FAFC" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
47
- <circle cx="27" cy="25" r="4" fill="#22D3EE"/>
48
- <circle cx="72" cy="76" r="4" fill="#10B981"/>
49
- <path d="M22 14H34" stroke="#F8FAFC" stroke-opacity="0.22" stroke-width="3" stroke-linecap="round"/>
50
- <path d="M62 82H74" stroke="#F8FAFC" stroke-opacity="0.22" stroke-width="3" stroke-linecap="round"/>
51
- </svg>
25
+ const RESUX_PLACEHOLDER_SVG = `<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
26
+ <title id="title">Resux mark</title>
27
+ <desc id="desc">A compact Resux monogram shaped like a resumable route.</desc>
28
+ <defs>
29
+ <linearGradient id="panel" x1="12" y1="8" x2="88" y2="92" gradientUnits="userSpaceOnUse">
30
+ <stop stop-color="#111827"/>
31
+ <stop offset="1" stop-color="#020617"/>
32
+ </linearGradient>
33
+ <linearGradient id="route" x1="25" y1="22" x2="73" y2="75" gradientUnits="userSpaceOnUse">
34
+ <stop stop-color="#22D3EE"/>
35
+ <stop offset="0.58" stop-color="#7C3AED"/>
36
+ <stop offset="1" stop-color="#10B981"/>
37
+ </linearGradient>
38
+ <filter id="soft" x="8" y="8" width="80" height="80" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
39
+ <feGaussianBlur stdDeviation="4"/>
40
+ </filter>
41
+ </defs>
42
+ <rect x="4" y="4" width="88" height="88" rx="22" fill="url(#panel)"/>
43
+ <path d="M24 29C31 20 43 16 55 18C68 20 77 29 77 41C77 54 67 62 53 62H36V77" stroke="#38BDF8" stroke-opacity="0.18" stroke-width="18" stroke-linecap="round" stroke-linejoin="round" filter="url(#soft)"/>
44
+ <path d="M27 76V25H54C67 25 75 32 75 42C75 52 67 59 54 59H37" stroke="url(#route)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round"/>
45
+ <path d="M50 59L72 76" stroke="url(#route)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round"/>
46
+ <path d="M31 35H54C60 35 64 38 64 42C64 47 60 50 54 50H31" stroke="#F8FAFC" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
47
+ <circle cx="27" cy="25" r="4" fill="#22D3EE"/>
48
+ <circle cx="72" cy="76" r="4" fill="#10B981"/>
49
+ <path d="M22 14H34" stroke="#F8FAFC" stroke-opacity="0.22" stroke-width="3" stroke-linecap="round"/>
50
+ <path d="M62 82H74" stroke="#F8FAFC" stroke-opacity="0.22" stroke-width="3" stroke-linecap="round"/>
51
+ </svg>
52
52
  `;
53
53
  const REQUIRED_GITIGNORE_ENTRIES = [
54
54
  ".resux",
@@ -61,13 +61,16 @@ const REQUIRED_GITIGNORE_ENTRIES = [
61
61
  ".env.*",
62
62
  "!.env.example",
63
63
  ];
64
- const GENERATED_DTS_PLACEHOLDER = `// Generated by Resux. Do not edit manually.
65
- // This file will be updated by \`resux dev\` or \`resux build\`.
66
-
67
- export {};
64
+ const GENERATED_DTS_PLACEHOLDER = `// Generated by Resux. Do not edit manually.
65
+ // This file will be updated by \`resux dev\` or \`resux build\`.
66
+
67
+ export {};
68
68
  `;
69
+ async function importRuntimeModule(specifier) {
70
+ return import(specifier);
71
+ }
69
72
  async function runCompilerBuild(appRoot, outDir, options) {
70
- const { buildProject } = await import("./compiler/index.js");
73
+ const { buildProject } = await importRuntimeModule("./compiler/index.js");
71
74
  return buildProject(appRoot, outDir, options);
72
75
  }
73
76
  export function createResuxNodeHandler(options = {}) {
@@ -86,12 +89,6 @@ export function createResuxNodeHandler(options = {}) {
86
89
  });
87
90
  };
88
91
  }
89
- if (isMainModule()) {
90
- void runResuxCli(process.argv.slice(2)).catch((error) => {
91
- console.error(error instanceof Error ? error.message : String(error));
92
- process.exitCode = 1;
93
- });
94
- }
95
92
  export async function runResuxCli(args) {
96
93
  const command = readCommand(args);
97
94
  const commandArgs = command === args[0] ? args.slice(1) : args;
@@ -1339,11 +1336,11 @@ async function ensureSafeProjectFiles(appRoot, options) {
1339
1336
  },
1340
1337
  {
1341
1338
  path: "app.vue",
1342
- contents: `<template>
1343
- <ResuxLayout>
1344
- <ResuxPage />
1345
- </ResuxLayout>
1346
- </template>
1339
+ contents: `<template>
1340
+ <ResuxLayout>
1341
+ <ResuxPage />
1342
+ </ResuxLayout>
1343
+ </template>
1347
1344
  `,
1348
1345
  condition: hasPagesDir,
1349
1346
  },
@@ -1453,9 +1450,9 @@ async function updateNitroConfigPrerenderRoutes(appRoot, outDir) {
1453
1450
  }
1454
1451
  let updated = source;
1455
1452
  const prerenderBlockRegex = /prerender\s*:\s*\{[\s\S]*?\}/m;
1456
- const newPrerenderBlock = `prerender: {
1457
- crawlLinks: ${isStatic ? "true" : "false"},
1458
- routes: ${JSON.stringify(prerenderRoutes, null, 2)}
1453
+ const newPrerenderBlock = `prerender: {
1454
+ crawlLinks: ${isStatic ? "true" : "false"},
1455
+ routes: ${JSON.stringify(prerenderRoutes, null, 2)}
1459
1456
  }`;
1460
1457
  if (prerenderBlockRegex.test(updated)) {
1461
1458
  updated = updated.replace(prerenderBlockRegex, newPrerenderBlock);
@@ -1486,6 +1483,16 @@ async function upgradeNitroConfigForResux(configFile) {
1486
1483
  updated.includes('"/api/**":')) {
1487
1484
  updated = updated.replace(/(\s+)\"\/api\/\*\*\":\s*\{/, ` "/__resux/image": {\n headers: {\n "cache-control": "public, max-age=31536000, immutable"\n }\n },\n$1"/api/**": {`);
1488
1485
  }
1486
+ const cloudflareNodeCompatPattern = /(\bcloudflare\s*:\s*\{[\s\S]*?\bnodeCompat\s*:\s*)(?:true|false)/;
1487
+ if (cloudflareNodeCompatPattern.test(updated)) {
1488
+ updated = updated.replace(cloudflareNodeCompatPattern, "$1true");
1489
+ }
1490
+ else if (/\bcloudflare\s*:\s*\{/.test(updated)) {
1491
+ updated = updated.replace(/\bcloudflare\s*:\s*\{/, (match) => `${match}\n nodeCompat: true,`);
1492
+ }
1493
+ else {
1494
+ updated = updated.replace(/export\s+default\s+defineNitroConfig\s*\(\s*\{/, (match) => `${match}\n cloudflare: {\n nodeCompat: true\n },`);
1495
+ }
1489
1496
  if (updated === source) {
1490
1497
  return;
1491
1498
  }
@@ -1569,231 +1576,237 @@ async function writeDeploymentFile(appRoot, relativePath, contents, force) {
1569
1576
  }
1570
1577
  function createDeploymentGuide(preset) {
1571
1578
  const dockerSection = preset === "docker"
1572
- ? `
1573
- ## Docker
1574
-
1575
- \`\`\`sh
1576
- docker build -t resux-app .
1577
- docker run --rm -p 3000:3000 resux-app
1578
- \`\`\`
1579
+ ? `
1580
+ ## Docker
1581
+
1582
+ \`\`\`sh
1583
+ docker build -t resux-app .
1584
+ docker run --rm -p 3000:3000 resux-app
1585
+ \`\`\`
1579
1586
  `
1580
1587
  : "";
1581
1588
  const nitroSection = preset === "nitro"
1582
- ? `
1583
- ## Nitro
1584
-
1585
- Install the Nitro build dependencies:
1586
-
1587
- \`\`\`sh
1588
- npm install -D nitropack h3
1589
- \`\`\`
1590
-
1591
- Build Resux. The default production build creates both \`.resux\` and Nitro \`.output\`:
1592
-
1593
- \`\`\`sh
1594
- npm run build
1595
- node .output/server/index.mjs
1596
- \`\`\`
1597
-
1598
- Nitro reads \`NITRO_PRESET\` for provider-specific output. For example:
1599
-
1600
- \`\`\`sh
1601
- NITRO_PRESET=vercel npx nitro build
1602
- \`\`\`
1603
-
1604
- The generated Nitro handler wraps the Resux Node request handler. \`resux build\` runs Nitro from the project root so \`.output\` can be started with Node.
1589
+ ? `
1590
+ ## Nitro
1591
+
1592
+ Install the Nitro build dependencies:
1593
+
1594
+ \`\`\`sh
1595
+ npm install -D nitropack h3
1596
+ \`\`\`
1597
+
1598
+ Build Resux. The default production build creates both \`.resux\` and Nitro \`.output\`:
1599
+
1600
+ \`\`\`sh
1601
+ npm run build
1602
+ node .output/server/index.mjs
1603
+ \`\`\`
1604
+
1605
+ Nitro reads \`NITRO_PRESET\` for provider-specific output. For example:
1606
+
1607
+ \`\`\`sh
1608
+ NITRO_PRESET=vercel npx nitro build
1609
+ \`\`\`
1610
+
1611
+ The generated Nitro handler wraps the Resux Node request handler. \`resux build\` runs Nitro from the project root so \`.output\` can be started with Node.
1605
1612
  `
1606
1613
  : "";
1607
- return `# Deployment
1608
-
1609
- ## Node Server
1610
-
1611
- \`\`\`sh
1612
- npm install
1613
- npm run build
1614
- npm run start
1615
- \`\`\`
1616
-
1617
- The production server reads \`PORT\`, so most Node hosts can run the same start command:
1618
-
1619
- \`\`\`sh
1620
- PORT=3000 npm run start
1621
- \`\`\`
1622
-
1623
- Health checks can call:
1624
-
1625
- \`\`\`txt
1626
- /__resux/health
1627
- \`\`\`
1628
- ${dockerSection}
1629
- ${nitroSection}
1630
- ## Diagnostics
1631
-
1632
- \`\`\`sh
1633
- npm run inspect
1634
- npm run inspect -- --json
1635
- \`\`\`
1636
-
1637
- Production serving enables Resux default security headers. Disable them only when a host or reverse proxy owns those headers:
1638
-
1639
- \`\`\`sh
1640
- resux start . --no-security-headers
1641
- \`\`\`
1614
+ return `# Deployment
1615
+
1616
+ ## Node Server
1617
+
1618
+ \`\`\`sh
1619
+ npm install
1620
+ npm run build
1621
+ npm run start
1622
+ \`\`\`
1623
+
1624
+ The production server reads \`PORT\`, so most Node hosts can run the same start command:
1625
+
1626
+ \`\`\`sh
1627
+ PORT=3000 npm run start
1628
+ \`\`\`
1629
+
1630
+ Health checks can call:
1631
+
1632
+ \`\`\`txt
1633
+ /__resux/health
1634
+ \`\`\`
1635
+ ${dockerSection}
1636
+ ${nitroSection}
1637
+ ## Diagnostics
1638
+
1639
+ \`\`\`sh
1640
+ npm run inspect
1641
+ npm run inspect -- --json
1642
+ \`\`\`
1643
+
1644
+ Production serving enables Resux default security headers. Disable them only when a host or reverse proxy owns those headers:
1645
+
1646
+ \`\`\`sh
1647
+ resux start . --no-security-headers
1648
+ \`\`\`
1642
1649
  `;
1643
1650
  }
1644
1651
  function createNitroConfig() {
1645
- return `import { defineNitroConfig } from "nitropack/config";
1646
-
1647
- export default defineNitroConfig({
1648
- srcDir: ".resux-nitro",
1649
- compatibilityDate: "2026-05-02",
1650
- // Resux uses top-level /plugins, /modules, and /middleware for app features.
1651
- // Nitro auto-scans these folders too, so exclude them from Nitro scanning.
1652
- ignore: ["plugins/**", "modules/**", "middleware/**", "assets/**"],
1653
- // Keep Nitro discovery scoped to the generated adapter directory.
1654
- scanDirs: ["."],
1655
- publicAssets: [
1656
- {
1657
- dir: "../public",
1658
- baseURL: "/"
1659
- },
1660
- {
1661
- dir: "../.resux/client",
1662
- baseURL: "/__resux",
1663
- fallthrough: true
1664
- }
1665
- ],
1666
- serverAssets: [
1667
- {
1668
- baseName: "resux",
1669
- dir: "../.resux/server"
1670
- }
1671
- ],
1672
- handlers: [
1673
- {
1674
- route: "/**",
1675
- handler: "./.resux-nitro/handler.ts"
1676
- }
1677
- ],
1678
- routeRules: {
1679
- "/__resux/route": {
1680
- headers: {
1681
- "cache-control": "no-store"
1682
- }
1683
- },
1684
- "/__resux/dev-events": {
1685
- headers: {
1686
- "cache-control": "no-store"
1687
- }
1688
- },
1689
- "/__resux/handlers/**": {
1690
- headers: {
1691
- "cache-control": "public, max-age=31536000, immutable"
1692
- }
1693
- },
1694
- "/__resux/plugins/**": {
1695
- headers: {
1696
- "cache-control": "public, max-age=31536000, immutable"
1697
- }
1698
- },
1699
- "/__resux/middleware/**": {
1700
- headers: {
1701
- "cache-control": "public, max-age=31536000, immutable"
1702
- }
1703
- },
1704
- "/__resux/vue-islands/**": {
1705
- headers: {
1706
- "cache-control": "public, max-age=31536000, immutable"
1707
- }
1708
- },
1709
- "/__resux/runtime-client.mjs": {
1710
- headers: {
1711
- "cache-control": "public, max-age=31536000, immutable"
1712
- }
1713
- },
1714
- "/__resux/client-enhancements.mjs": {
1715
- headers: {
1716
- "cache-control": "public, max-age=31536000, immutable"
1717
- }
1718
- },
1719
- "/__resux/image": {
1720
- headers: {
1721
- "cache-control": "public, max-age=31536000, immutable"
1722
- }
1723
- },
1724
- "/api/**": {
1725
- headers: {
1726
- "cache-control": "no-store"
1727
- }
1728
- },
1729
- "/**": {
1730
- headers: {
1731
- "cache-control": "no-store"
1732
- }
1733
- }
1734
- },
1735
- prerender: {
1736
- crawlLinks: false,
1737
- routes: []
1738
- }
1739
- });
1652
+ return `import { defineNitroConfig } from "nitropack/config";
1653
+
1654
+ export default defineNitroConfig({
1655
+ srcDir: ".resux-nitro",
1656
+ compatibilityDate: "2026-05-02",
1657
+ cloudflare: {
1658
+ nodeCompat: true
1659
+ },
1660
+ // Resux uses top-level /plugins, /modules, and /middleware for app features.
1661
+ // Nitro auto-scans these folders too, so exclude them from Nitro scanning.
1662
+ ignore: ["plugins/**", "modules/**", "middleware/**", "assets/**"],
1663
+ // Keep Nitro discovery scoped to the generated adapter directory.
1664
+ scanDirs: ["."],
1665
+ publicAssets: [
1666
+ {
1667
+ dir: "../public",
1668
+ baseURL: "/"
1669
+ },
1670
+ {
1671
+ dir: "../.resux/client",
1672
+ baseURL: "/__resux",
1673
+ fallthrough: true
1674
+ }
1675
+ ],
1676
+ serverAssets: [
1677
+ {
1678
+ baseName: "resux",
1679
+ dir: "../.resux/server"
1680
+ }
1681
+ ],
1682
+ handlers: [
1683
+ {
1684
+ route: "/**",
1685
+ handler: "./.resux-nitro/handler.ts"
1686
+ }
1687
+ ],
1688
+ routeRules: {
1689
+ "/__resux/route": {
1690
+ headers: {
1691
+ "cache-control": "no-store"
1692
+ }
1693
+ },
1694
+ "/__resux/dev-events": {
1695
+ headers: {
1696
+ "cache-control": "no-store"
1697
+ }
1698
+ },
1699
+ "/__resux/handlers/**": {
1700
+ headers: {
1701
+ "cache-control": "public, max-age=31536000, immutable"
1702
+ }
1703
+ },
1704
+ "/__resux/plugins/**": {
1705
+ headers: {
1706
+ "cache-control": "public, max-age=31536000, immutable"
1707
+ }
1708
+ },
1709
+ "/__resux/middleware/**": {
1710
+ headers: {
1711
+ "cache-control": "public, max-age=31536000, immutable"
1712
+ }
1713
+ },
1714
+ "/__resux/vue-islands/**": {
1715
+ headers: {
1716
+ "cache-control": "public, max-age=31536000, immutable"
1717
+ }
1718
+ },
1719
+ "/__resux/runtime-client.mjs": {
1720
+ headers: {
1721
+ "cache-control": "public, max-age=31536000, immutable"
1722
+ }
1723
+ },
1724
+ "/__resux/client-enhancements.mjs": {
1725
+ headers: {
1726
+ "cache-control": "public, max-age=31536000, immutable"
1727
+ }
1728
+ },
1729
+ "/__resux/image": {
1730
+ headers: {
1731
+ "cache-control": "public, max-age=31536000, immutable"
1732
+ }
1733
+ },
1734
+ "/api/**": {
1735
+ headers: {
1736
+ "cache-control": "no-store"
1737
+ }
1738
+ },
1739
+ "/**": {
1740
+ headers: {
1741
+ "cache-control": "no-store"
1742
+ }
1743
+ }
1744
+ },
1745
+ prerender: {
1746
+ crawlLinks: false,
1747
+ routes: []
1748
+ }
1749
+ });
1740
1750
  `;
1741
1751
  }
1742
1752
  function createNitroHandler() {
1743
- return `import { fromNodeMiddleware } from "h3";
1744
- import { createResuxNodeHandler } from "resuxjs/node";
1745
-
1746
- const resuxHandler = createResuxNodeHandler();
1747
-
1748
- export default fromNodeMiddleware((req, res, next) => {
1749
- resuxHandler(req, res);
1750
-
1751
- if (res.writableEnded) {
1752
- return;
1753
- }
1754
-
1755
- const done = () => {
1756
- res.off("finish", done);
1757
- res.off("close", done);
1758
- next();
1759
- };
1760
-
1761
- res.once("finish", done);
1762
- res.once("close", done);
1763
- });
1753
+ return `import { fromNodeMiddleware } from "h3";
1754
+ import { createResuxNodeHandler } from "resuxjs/node";
1755
+
1756
+ const resuxHandler = createResuxNodeHandler();
1757
+
1758
+ export default fromNodeMiddleware((req, res, next) => {
1759
+ resuxHandler(req, res);
1760
+
1761
+ if (res.writableEnded) {
1762
+ return;
1763
+ }
1764
+
1765
+ const done = () => {
1766
+ res.off("finish", done);
1767
+ res.off("close", done);
1768
+ next();
1769
+ };
1770
+
1771
+ res.once("finish", done);
1772
+ res.once("close", done);
1773
+ });
1764
1774
  `;
1765
1775
  }
1766
1776
  function createDockerfile() {
1767
- return `FROM node:24-alpine AS build
1768
- WORKDIR /app
1769
- COPY package*.json ./
1770
- RUN npm install
1771
- COPY . .
1772
- RUN npm run build
1773
- RUN npm prune --omit=dev
1774
-
1775
- FROM node:24-alpine AS runner
1776
- WORKDIR /app
1777
- ENV NODE_ENV=production
1778
- ENV PORT=3000
1779
- COPY --from=build /app /app
1780
- EXPOSE 3000
1781
- CMD ["npm", "run", "start"]
1777
+ return `FROM node:24-alpine AS build
1778
+ WORKDIR /app
1779
+ COPY package*.json ./
1780
+ RUN npm install
1781
+ COPY . .
1782
+ RUN npm run build
1783
+ RUN npm prune --omit=dev
1784
+
1785
+ FROM node:24-alpine AS runner
1786
+ WORKDIR /app
1787
+ ENV NODE_ENV=production
1788
+ ENV PORT=3000
1789
+ COPY --from=build /app /app
1790
+ EXPOSE 3000
1791
+ CMD ["npm", "run", "start"]
1782
1792
  `;
1783
1793
  }
1784
1794
  function createDockerignore() {
1785
- return `node_modules
1786
- .resux
1787
- dist
1788
- .git
1789
- *.log
1790
- .env
1791
- .env.*
1795
+ return `node_modules
1796
+ .resux
1797
+ dist
1798
+ .git
1799
+ *.log
1800
+ .env
1801
+ .env.*
1792
1802
  `;
1793
1803
  }
1794
1804
  async function startViteDevServer(outDir, buildOptions, cliOptions) {
1795
1805
  const appRoot = path.dirname(outDir);
1796
- const [{ createServer: createViteServer }, { default: vuePlugin }] = await Promise.all([import("vite"), import("@vitejs/plugin-vue")]);
1806
+ const [{ createServer: createViteServer }, { default: vuePlugin }] = await Promise.all([
1807
+ importRuntimeModule("vite"),
1808
+ importRuntimeModule("@vitejs/plugin-vue"),
1809
+ ]);
1797
1810
  const hmrPort = 30000 + Math.floor(Math.random() * 20000);
1798
1811
  const viteConfig = {
1799
1812
  root: path.join(outDir, "vite-client"),
@@ -2006,50 +2019,50 @@ function readPort(value, fallback) {
2006
2019
  return parsed;
2007
2020
  }
2008
2021
  function printHelp() {
2009
- console.log(`resux ${version}
2010
-
2011
- Usage:
2012
- resux dev [app-root] [options]
2013
- resux init [project-dir] [options]
2014
- resux build [app-root] [options]
2015
- resux compile [app-root] [options]
2016
- resux prepare [app-root] [options]
2017
- resux preview [app-root] [options]
2018
- resux start [app-root] [options]
2019
- resux inspect [app-root] [target] [options]
2020
- resux check [app-root] [options]
2021
- resux deploy [app-root] [options]
2022
-
2023
- Commands:
2024
- init Scaffold a new Resux app
2025
- dev Start the Resux dev server with Vite middleware
2026
- build Build server/client output into .resux and Nitro .output
2027
- compile Build only the lower-level .resux output
2028
- prepare Generate safe files, generated directories, manifests, and type stubs
2029
- preview Serve the built app, rebuilding when needed
2030
- start Alias for preview, intended for production Node servers
2031
- inspect Print build/debug metadata (routes/plugins/enhancements/middleware/imports/components/build/images/server/packages/templates/bundles/seo)
2032
- check Validate a Resux user project structure and build readiness
2033
- deploy Generate Node, Docker, or Nitro deployment files
2034
-
2035
- Options:
2036
- --security-headers Enable default production security headers
2037
- --no-security-headers
2038
- Disable default production security headers
2039
- --json Print JSON output for inspect
2040
- --open Open the app in your default browser
2041
- --https Emit HTTPS dev/preview URL (transport stays HTTP locally)
2042
- --debug Print debug diagnostics
2043
- --trace-resume Enable resumability tracing diagnostics
2044
- --trace-routes Enable route trace diagnostics
2045
- --trace-build Enable build trace diagnostics
2046
- --preset <preset> Deployment preset for deploy: node, docker, or nitro
2047
- --force Overwrite existing deployment files
2048
- --fix Apply safe autofixes for check/dev/build/prepare missing files
2049
- -p, --port <port> Set the server port, default 3000 or PORT
2050
- --host <host> Set the server host
2051
- -v, --version Print the Resux version
2052
- -h, --help Show this help message
2022
+ console.log(`resux ${version}
2023
+
2024
+ Usage:
2025
+ resux dev [app-root] [options]
2026
+ resux init [project-dir] [options]
2027
+ resux build [app-root] [options]
2028
+ resux compile [app-root] [options]
2029
+ resux prepare [app-root] [options]
2030
+ resux preview [app-root] [options]
2031
+ resux start [app-root] [options]
2032
+ resux inspect [app-root] [target] [options]
2033
+ resux check [app-root] [options]
2034
+ resux deploy [app-root] [options]
2035
+
2036
+ Commands:
2037
+ init Scaffold a new Resux app
2038
+ dev Start the Resux dev server with Vite middleware
2039
+ build Build server/client output into .resux and Nitro .output
2040
+ compile Build only the lower-level .resux output
2041
+ prepare Generate safe files, generated directories, manifests, and type stubs
2042
+ preview Serve the built app, rebuilding when needed
2043
+ start Alias for preview, intended for production Node servers
2044
+ inspect Print build/debug metadata (routes/plugins/enhancements/middleware/imports/components/build/images/server/packages/templates/bundles/seo)
2045
+ check Validate a Resux user project structure and build readiness
2046
+ deploy Generate Node, Docker, or Nitro deployment files
2047
+
2048
+ Options:
2049
+ --security-headers Enable default production security headers
2050
+ --no-security-headers
2051
+ Disable default production security headers
2052
+ --json Print JSON output for inspect
2053
+ --open Open the app in your default browser
2054
+ --https Emit HTTPS dev/preview URL (transport stays HTTP locally)
2055
+ --debug Print debug diagnostics
2056
+ --trace-resume Enable resumability tracing diagnostics
2057
+ --trace-routes Enable route trace diagnostics
2058
+ --trace-build Enable build trace diagnostics
2059
+ --preset <preset> Deployment preset for deploy: node, docker, or nitro
2060
+ --force Overwrite existing deployment files
2061
+ --fix Apply safe autofixes for check/dev/build/prepare missing files
2062
+ -p, --port <port> Set the server port, default 3000 or PORT
2063
+ --host <host> Set the server host
2064
+ -v, --version Print the Resux version
2065
+ -h, --help Show this help message
2053
2066
  `);
2054
2067
  }
2055
2068
  async function handleRequest(request, response, options) {
@@ -2658,7 +2671,7 @@ async function loadSharpFactory() {
2658
2671
  }
2659
2672
  sharpFactoryPromise = (async () => {
2660
2673
  try {
2661
- const sharpModule = await import("sharp");
2674
+ const sharpModule = await importRuntimeModule("sharp");
2662
2675
  const factory = sharpModule.default
2663
2676
  ?? sharpModule;
2664
2677
  sharpFactoryLoadError = null;