@ereo/cli 0.2.1 → 0.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4C5E"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C5E"}
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,GAAG,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuQjE"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,GAAG,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAyQjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ErE"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FrE"}
package/dist/index.js CHANGED
@@ -1448,7 +1448,8 @@ async function build(options = {}) {
1448
1448
  outDir: options.outDir || config.build?.outDir || ".ereo",
1449
1449
  minify: options.minify ?? config.build?.minify ?? true,
1450
1450
  sourcemap: options.sourcemap ?? config.build?.sourcemap ?? true,
1451
- target: bundlerTarget
1451
+ target: bundlerTarget,
1452
+ plugins: config.plugins
1452
1453
  };
1453
1454
  console.log(` Target: ${buildOptions.target}`);
1454
1455
  console.log(` Output: ${buildOptions.outDir}`);
@@ -1543,9 +1544,8 @@ async function dev(options = {}) {
1543
1544
  }, 200);
1544
1545
  });
1545
1546
  }
1546
- router.on("reload", async () => {
1547
+ router.on("reload", () => {
1547
1548
  console.log("\x1B[33m\u27F3\x1B[0m Routes reloaded");
1548
- await router.loadAllModules();
1549
1549
  hmr.reload();
1550
1550
  });
1551
1551
  router.on("change", (route) => {
@@ -1743,6 +1743,18 @@ async function start(options = {}) {
1743
1743
  });
1744
1744
  server.setApp(app);
1745
1745
  server.setRouter(router);
1746
+ const cssPath = join3(buildDir, "assets/styles.css");
1747
+ if (await Bun.file(cssPath).exists()) {
1748
+ const cssContent = await Bun.file(cssPath).text();
1749
+ server.use("/__tailwind.css", async (_request, _context, _next) => {
1750
+ return new Response(cssContent, {
1751
+ headers: {
1752
+ "Content-Type": "text/css; charset=utf-8",
1753
+ "Cache-Control": "public, max-age=31536000, immutable"
1754
+ }
1755
+ });
1756
+ });
1757
+ }
1746
1758
  await server.start();
1747
1759
  console.log(` \x1B[32m\u279C\x1B[0m Server running at \x1B[36mhttp://${hostname}:${port}/\x1B[0m
1748
1760
  `);
@@ -1866,6 +1878,8 @@ function generateTemplateFiles(template, typescript, projectName, version) {
1866
1878
  files["app/globals.css"] = generateGlobalCSS();
1867
1879
  }
1868
1880
  files[".gitignore"] = generateGitignore();
1881
+ files["Dockerfile"] = generateDockerfile();
1882
+ files[".dockerignore"] = generateDockerignore();
1869
1883
  return files;
1870
1884
  }
1871
1885
  function generateEreoConfig(template) {
@@ -2794,6 +2808,59 @@ export async function action({ request, context }${typescript ? ": ActionArgs" :
2794
2808
  }
2795
2809
  `.trim();
2796
2810
  }
2811
+ function generateDockerfile() {
2812
+ return `# ---- Build Stage ----
2813
+ FROM oven/bun:1 AS build
2814
+
2815
+ WORKDIR /app
2816
+
2817
+ # Install dependencies first (cached layer)
2818
+ COPY package.json bun.lock* ./
2819
+ RUN bun install --frozen-lockfile
2820
+
2821
+ # Copy source files
2822
+ COPY app/ ./app/
2823
+ COPY public/ ./public/
2824
+ COPY ereo.config.ts tsconfig.json ./
2825
+
2826
+ # Build for production
2827
+ RUN bun run build
2828
+
2829
+ # ---- Production Stage ----
2830
+ FROM oven/bun:1-slim
2831
+
2832
+ WORKDIR /app
2833
+
2834
+ # Copy package manifests and install production deps only
2835
+ COPY package.json bun.lock* ./
2836
+ RUN bun install --frozen-lockfile --production
2837
+
2838
+ # Copy source (needed by ereo start for route discovery)
2839
+ COPY app/ ./app/
2840
+ COPY ereo.config.ts ./
2841
+
2842
+ # Copy build output from build stage
2843
+ COPY --from=build /app/.ereo ./.ereo
2844
+
2845
+ # Expose port
2846
+ EXPOSE 3000
2847
+
2848
+ # Run production server
2849
+ CMD ["bun", "run", "start"]
2850
+ `.trim();
2851
+ }
2852
+ function generateDockerignore() {
2853
+ return `node_modules
2854
+ .ereo
2855
+ .env
2856
+ .env.local
2857
+ .env.*.local
2858
+ *.log
2859
+ .DS_Store
2860
+ .git
2861
+ .gitignore
2862
+ `.trim();
2863
+ }
2797
2864
 
2798
2865
  // src/commands/deploy.ts
2799
2866
  init_config();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ereo/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "license": "MIT",
5
5
  "author": "Ereo Team",
6
6
  "homepage": "https://ereojs.github.io/ereoJS",
@@ -35,11 +35,11 @@
35
35
  "typecheck": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@ereo/bundler": "^0.2.1",
39
- "@ereo/core": "^0.2.1",
40
- "@ereo/router": "^0.2.1",
41
- "@ereo/server": "^0.2.1",
42
- "@ereo/trace": "^0.2.1"
38
+ "@ereo/bundler": "^0.2.3",
39
+ "@ereo/core": "^0.2.3",
40
+ "@ereo/router": "^0.2.3",
41
+ "@ereo/server": "^0.2.3",
42
+ "@ereo/trace": "^0.2.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/bun": "^1.1.0",