create-ereo 0.2.28 → 0.2.29
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/index.js +12 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66,7 +66,7 @@ function printHelp() {
|
|
|
66
66
|
`);
|
|
67
67
|
}
|
|
68
68
|
function parseArgs(args) {
|
|
69
|
-
const
|
|
69
|
+
const options = {};
|
|
70
70
|
let projectName = null;
|
|
71
71
|
for (let i = 0;i < args.length; i++) {
|
|
72
72
|
const arg = args[i];
|
|
@@ -86,20 +86,20 @@ function parseArgs(args) {
|
|
|
86
86
|
`);
|
|
87
87
|
process.exit(1);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
options.template = tmpl;
|
|
90
90
|
} else if (arg === "--no-typescript") {
|
|
91
|
-
|
|
91
|
+
options.typescript = false;
|
|
92
92
|
} else if (arg === "--no-git") {
|
|
93
|
-
|
|
93
|
+
options.git = false;
|
|
94
94
|
} else if (arg === "--no-install") {
|
|
95
|
-
|
|
95
|
+
options.install = false;
|
|
96
96
|
} else if (arg === "--trace") {
|
|
97
|
-
|
|
97
|
+
options.trace = true;
|
|
98
98
|
} else if (!arg.startsWith("-") && !projectName) {
|
|
99
99
|
projectName = arg;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
return { projectName, options
|
|
102
|
+
return { projectName, options };
|
|
103
103
|
}
|
|
104
104
|
function generateDockerfile(_typescript) {
|
|
105
105
|
return `# ---- Stage 1: Install all deps + build ----
|
|
@@ -1113,7 +1113,7 @@ export default function RootLayout({ children }${ts ? ": RootLayoutProps" : ""})
|
|
|
1113
1113
|
}
|
|
1114
1114
|
`.trim();
|
|
1115
1115
|
await Bun.write(join(projectDir, `app/routes/_layout.${ext}`), rootLayout);
|
|
1116
|
-
const clientEntry =
|
|
1116
|
+
const clientEntry = trace ? `
|
|
1117
1117
|
/**
|
|
1118
1118
|
* Client Entry Point
|
|
1119
1119
|
*
|
|
@@ -3883,8 +3883,8 @@ This project includes \`@ereo/trace\` for full-stack observability.
|
|
|
3883
3883
|
`;
|
|
3884
3884
|
await Bun.write(join(projectDir, "README.md"), readme);
|
|
3885
3885
|
}
|
|
3886
|
-
async function generateProject(projectDir, projectName,
|
|
3887
|
-
const { template, typescript, trace } =
|
|
3886
|
+
async function generateProject(projectDir, projectName, options) {
|
|
3887
|
+
const { template, typescript, trace } = options;
|
|
3888
3888
|
if (template === "minimal") {
|
|
3889
3889
|
await generateMinimalProject(projectDir, projectName, typescript, trace);
|
|
3890
3890
|
} else if (template === "tasks") {
|
|
@@ -3920,7 +3920,7 @@ async function main() {
|
|
|
3920
3920
|
printBanner();
|
|
3921
3921
|
await checkForUpdates();
|
|
3922
3922
|
const args = process.argv.slice(2);
|
|
3923
|
-
const { projectName, options
|
|
3923
|
+
const { projectName, options } = parseArgs(args);
|
|
3924
3924
|
if (!projectName) {
|
|
3925
3925
|
console.error(` \x1B[31m\u2717\x1B[0m Please provide a project name
|
|
3926
3926
|
`);
|
|
@@ -3932,7 +3932,7 @@ async function main() {
|
|
|
3932
3932
|
`);
|
|
3933
3933
|
process.exit(1);
|
|
3934
3934
|
}
|
|
3935
|
-
const finalOptions = { ...defaultOptions, ...
|
|
3935
|
+
const finalOptions = { ...defaultOptions, ...options };
|
|
3936
3936
|
const projectDir = resolve(process.cwd(), projectName);
|
|
3937
3937
|
if (!projectDir.startsWith(process.cwd())) {
|
|
3938
3938
|
console.error(` \x1B[31m\u2717\x1B[0m Invalid project name: path traversal detected.
|