create-ereo 0.2.28 → 0.2.35

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 (2) hide show
  1. package/dist/index.js +22 -22
  2. 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 options2 = {};
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
- options2.template = tmpl;
89
+ options.template = tmpl;
90
90
  } else if (arg === "--no-typescript") {
91
- options2.typescript = false;
91
+ options.typescript = false;
92
92
  } else if (arg === "--no-git") {
93
- options2.git = false;
93
+ options.git = false;
94
94
  } else if (arg === "--no-install") {
95
- options2.install = false;
95
+ options.install = false;
96
96
  } else if (arg === "--trace") {
97
- options2.trace = true;
97
+ options.trace = true;
98
98
  } else if (!arg.startsWith("-") && !projectName) {
99
99
  projectName = arg;
100
100
  }
101
101
  }
102
- return { projectName, options: options2 };
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 = options.trace ? `
1116
+ const clientEntry = trace ? `
1117
1117
  /**
1118
1118
  * Client Entry Point
1119
1119
  *
@@ -2872,7 +2872,7 @@ export async function action({ request, context }${ts ? ": { request: Request; c
2872
2872
  await auth.signIn('credentials', { email, password });
2873
2873
 
2874
2874
  return new Response(null, {
2875
- status: 302,
2875
+ status: 303,
2876
2876
  headers: {
2877
2877
  Location: '/tasks',
2878
2878
  'Set-Cookie': auth.getCookieHeader() || '',
@@ -3009,7 +3009,7 @@ export async function action({ request, context }${ts ? ": { request: Request; c
3009
3009
  await auth.signIn('credentials', { email, password });
3010
3010
 
3011
3011
  return new Response(null, {
3012
- status: 302,
3012
+ status: 303,
3013
3013
  headers: {
3014
3014
  Location: '/tasks',
3015
3015
  'Set-Cookie': auth.getCookieHeader() || '',
@@ -3017,7 +3017,7 @@ export async function action({ request, context }${ts ? ": { request: Request; c
3017
3017
  });
3018
3018
  } catch {
3019
3019
  // Account created but auto-login failed \u2014 redirect to login
3020
- return new Response(null, { status: 302, headers: { Location: '/login' } });
3020
+ return new Response(null, { status: 303, headers: { Location: '/login' } });
3021
3021
  }
3022
3022
  }
3023
3023
 
@@ -3139,7 +3139,7 @@ export async function action({ context }${ts ? ": { context: any }" : ""}) {
3139
3139
  }
3140
3140
 
3141
3141
  return new Response(null, {
3142
- status: 302,
3142
+ status: 303,
3143
3143
  headers: { Location: '/' },
3144
3144
  });
3145
3145
  }
@@ -3310,7 +3310,7 @@ export const config = { ...requireAuth({ redirect: '/login' }) };
3310
3310
  export async function action({ request, context }${ts ? ": { request: Request; context: any }" : ""}) {
3311
3311
  const auth = getAuth(context);
3312
3312
  if (!auth.isAuthenticated()) {
3313
- return new Response(null, { status: 302, headers: { Location: '/login' } });
3313
+ return new Response(null, { status: 303, headers: { Location: '/login' } });
3314
3314
  }
3315
3315
  const user = auth.getUser()${ts ? "!" : ""};
3316
3316
  const userId = Number(user.id);
@@ -3333,7 +3333,7 @@ export async function action({ request, context }${ts ? ": { request: Request; c
3333
3333
  createTask(userId, title, description, 'todo', priority);
3334
3334
 
3335
3335
  return new Response(null, {
3336
- status: 302,
3336
+ status: 303,
3337
3337
  headers: { Location: '/tasks' },
3338
3338
  });
3339
3339
  }
@@ -3441,7 +3441,7 @@ export async function loader({ params, context }${ts ? ": { params: { id: string
3441
3441
  export async function action({ request, params, context }${ts ? ": { request: Request; params: { id: string }; context: any }" : ""}) {
3442
3442
  const auth = getAuth(context);
3443
3443
  if (!auth.isAuthenticated()) {
3444
- return new Response(null, { status: 302, headers: { Location: '/login' } });
3444
+ return new Response(null, { status: 303, headers: { Location: '/login' } });
3445
3445
  }
3446
3446
  const user = auth.getUser()${ts ? "!" : ""};
3447
3447
  const userId = Number(user.id);
@@ -3454,7 +3454,7 @@ export async function action({ request, params, context }${ts ? ": { request: Re
3454
3454
  if (intent === 'delete') {
3455
3455
  deleteTask(taskId, userId);
3456
3456
  return new Response(null, {
3457
- status: 302,
3457
+ status: 303,
3458
3458
  headers: { Location: '/tasks' },
3459
3459
  });
3460
3460
  }
@@ -3472,7 +3472,7 @@ export async function action({ request, params, context }${ts ? ": { request: Re
3472
3472
 
3473
3473
  updateTask(taskId, userId, task.title, task.description, nextStatus[task.status] || 'todo', task.priority);
3474
3474
  return new Response(null, {
3475
- status: 302,
3475
+ status: 303,
3476
3476
  headers: { Location: \`/tasks/\${taskId}\` },
3477
3477
  });
3478
3478
  }
@@ -3500,7 +3500,7 @@ export async function action({ request, params, context }${ts ? ": { request: Re
3500
3500
  }
3501
3501
 
3502
3502
  return new Response(null, {
3503
- status: 302,
3503
+ status: 303,
3504
3504
  headers: { Location: '/tasks' },
3505
3505
  });
3506
3506
  }
@@ -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, options2) {
3887
- const { template, typescript, trace } = options2;
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: options2 } = parseArgs(args);
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, ...options2 };
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ereo",
3
- "version": "0.2.28",
3
+ "version": "0.2.35",
4
4
  "license": "MIT",
5
5
  "author": "Ereo Team",
6
6
  "homepage": "https://ereojs.github.io/ereoJS",