@ereo/cli 0.2.0 → 0.2.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/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/index.js +57 -2
- package/package.json +6 -6
|
@@ -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,
|
|
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 +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,
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -1460,6 +1460,7 @@ async function build(options = {}) {
|
|
|
1460
1460
|
console.log(`
|
|
1461
1461
|
\x1B[32m\u2713\x1B[0m Build completed successfully
|
|
1462
1462
|
`);
|
|
1463
|
+
process.exit(0);
|
|
1463
1464
|
} else {
|
|
1464
1465
|
console.error(`
|
|
1465
1466
|
\x1B[31m\u2717\x1B[0m Build failed
|
|
@@ -1542,9 +1543,8 @@ async function dev(options = {}) {
|
|
|
1542
1543
|
}, 200);
|
|
1543
1544
|
});
|
|
1544
1545
|
}
|
|
1545
|
-
router.on("reload",
|
|
1546
|
+
router.on("reload", () => {
|
|
1546
1547
|
console.log("\x1B[33m\u27F3\x1B[0m Routes reloaded");
|
|
1547
|
-
await router.loadAllModules();
|
|
1548
1548
|
hmr.reload();
|
|
1549
1549
|
});
|
|
1550
1550
|
router.on("change", (route) => {
|
|
@@ -1865,6 +1865,8 @@ function generateTemplateFiles(template, typescript, projectName, version) {
|
|
|
1865
1865
|
files["app/globals.css"] = generateGlobalCSS();
|
|
1866
1866
|
}
|
|
1867
1867
|
files[".gitignore"] = generateGitignore();
|
|
1868
|
+
files["Dockerfile"] = generateDockerfile();
|
|
1869
|
+
files[".dockerignore"] = generateDockerignore();
|
|
1868
1870
|
return files;
|
|
1869
1871
|
}
|
|
1870
1872
|
function generateEreoConfig(template) {
|
|
@@ -2793,6 +2795,59 @@ export async function action({ request, context }${typescript ? ": ActionArgs" :
|
|
|
2793
2795
|
}
|
|
2794
2796
|
`.trim();
|
|
2795
2797
|
}
|
|
2798
|
+
function generateDockerfile() {
|
|
2799
|
+
return `# ---- Build Stage ----
|
|
2800
|
+
FROM oven/bun:1 AS build
|
|
2801
|
+
|
|
2802
|
+
WORKDIR /app
|
|
2803
|
+
|
|
2804
|
+
# Install dependencies first (cached layer)
|
|
2805
|
+
COPY package.json bun.lock* ./
|
|
2806
|
+
RUN bun install --frozen-lockfile
|
|
2807
|
+
|
|
2808
|
+
# Copy source files
|
|
2809
|
+
COPY app/ ./app/
|
|
2810
|
+
COPY public/ ./public/
|
|
2811
|
+
COPY ereo.config.ts tsconfig.json ./
|
|
2812
|
+
|
|
2813
|
+
# Build for production
|
|
2814
|
+
RUN bun run build
|
|
2815
|
+
|
|
2816
|
+
# ---- Production Stage ----
|
|
2817
|
+
FROM oven/bun:1-slim
|
|
2818
|
+
|
|
2819
|
+
WORKDIR /app
|
|
2820
|
+
|
|
2821
|
+
# Copy package manifests and install production deps only
|
|
2822
|
+
COPY package.json bun.lock* ./
|
|
2823
|
+
RUN bun install --frozen-lockfile --production
|
|
2824
|
+
|
|
2825
|
+
# Copy source (needed by ereo start for route discovery)
|
|
2826
|
+
COPY app/ ./app/
|
|
2827
|
+
COPY ereo.config.ts ./
|
|
2828
|
+
|
|
2829
|
+
# Copy build output from build stage
|
|
2830
|
+
COPY --from=build /app/.ereo ./.ereo
|
|
2831
|
+
|
|
2832
|
+
# Expose port
|
|
2833
|
+
EXPOSE 3000
|
|
2834
|
+
|
|
2835
|
+
# Run production server
|
|
2836
|
+
CMD ["bun", "run", "start"]
|
|
2837
|
+
`.trim();
|
|
2838
|
+
}
|
|
2839
|
+
function generateDockerignore() {
|
|
2840
|
+
return `node_modules
|
|
2841
|
+
.ereo
|
|
2842
|
+
.env
|
|
2843
|
+
.env.local
|
|
2844
|
+
.env.*.local
|
|
2845
|
+
*.log
|
|
2846
|
+
.DS_Store
|
|
2847
|
+
.git
|
|
2848
|
+
.gitignore
|
|
2849
|
+
`.trim();
|
|
2850
|
+
}
|
|
2796
2851
|
|
|
2797
2852
|
// src/commands/deploy.ts
|
|
2798
2853
|
init_config();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ereo/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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.
|
|
39
|
-
"@ereo/core": "^0.2.
|
|
40
|
-
"@ereo/router": "^0.2.
|
|
41
|
-
"@ereo/server": "^0.2.
|
|
42
|
-
"@ereo/trace": "^0.2.
|
|
38
|
+
"@ereo/bundler": "^0.2.2",
|
|
39
|
+
"@ereo/core": "^0.2.2",
|
|
40
|
+
"@ereo/router": "^0.2.2",
|
|
41
|
+
"@ereo/server": "^0.2.2",
|
|
42
|
+
"@ereo/trace": "^0.2.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/bun": "^1.1.0",
|