create-newt-app 0.5.0 → 0.7.0

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 +27 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import chalk from "chalk";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "create-newt-app",
10
- version: "0.5.0",
10
+ version: "0.7.0",
11
11
  private: false,
12
12
  type: "module",
13
13
  bin: {
@@ -232,6 +232,21 @@ async function doInit(options) {
232
232
  { value: "vitest", label: "Vitest" }
233
233
  ],
234
234
  initialValue: "jest"
235
+ }),
236
+ nestDiOnly: () => p.confirm({
237
+ message: "Use NestJS for dependency injection only?",
238
+ initialValue: false
239
+ }),
240
+ deployment: () => p.select({
241
+ message: "Deployment extras?",
242
+ options: [
243
+ { value: "none", label: "None", hint: "skip" },
244
+ { value: "standalone", label: "Standalone + Dockerfile", hint: "Dockerfiles + docker-compose.yml" },
245
+ { value: "custom-server", label: "Custom Server", hint: "single process, single port" },
246
+ { value: "spa", label: "SPA Mode", hint: "static export served by NestJS" },
247
+ { value: "vercel", label: "Vercel", hint: "serverless function" }
248
+ ],
249
+ initialValue: "none"
235
250
  })
236
251
  }
237
252
  };
@@ -244,15 +259,20 @@ async function doInit(options) {
244
259
  });
245
260
  const useShadcn = options.ci ? options.shadcn : group2.shadcn ?? true;
246
261
  const testing = options.ci ? options.testing : group2.testing ?? "jest";
262
+ const deployment = options.ci ? options.deployment : group2.deployment ?? "none";
263
+ const nestDiOnly = options.ci ? options.nestDiOnly : group2.nestDiOnly ?? false;
264
+ const deploymentModule = deployment === "standalone" ? templates.deploymentStandalone : deployment === "custom-server" ? templates.deploymentCustomServer : deployment === "spa" ? templates.deploymentSpa : deployment === "vercel" ? templates.deploymentVercel : null;
247
265
  const allModules = [
248
266
  templates.root,
249
267
  templates.web,
250
- templates.api,
268
+ ...nestDiOnly ? [] : [templates.api],
251
269
  templates.auth,
252
270
  useShadcn ? templates.shadcnUi : templates.ui,
253
271
  templates.eslintConfig,
254
272
  templates.typescriptConfig,
255
- testing === "vitest" ? templates.testingVitest : templates.testingJest
273
+ testing === "vitest" ? templates.testingVitest : templates.testingJest,
274
+ ...deploymentModule ? [deploymentModule] : [],
275
+ ...nestDiOnly ? [templates.nestDiOnly] : []
256
276
  ];
257
277
  const name = group2.name ?? options.name ?? "";
258
278
  const taskBuilder = new TaskBuilder();
@@ -313,7 +333,7 @@ async function doInit(options) {
313
333
  }
314
334
  }
315
335
  var program = new Command();
316
- program.name("create-newt-app").version(package_default.version).description("Create a new newt-app monorepo").argument("[name]").option("-ni, --no-install", "Skip pnpm install", true).option("-ng, --no-git", "Skip git initialization", true).option("--ci", "Non-interactive mode", false).option("--shadcn", "Include shadcn/ui (used with --ci)", false).option("--testing <framework>", "Testing framework: vitest or jest (used with --ci)", "jest").action(
336
+ program.name("create-newt-app").version(package_default.version).description("Create a new newt-app monorepo").argument("[name]").option("-ni, --no-install", "Skip pnpm install", true).option("-ng, --no-git", "Skip git initialization", true).option("--ci", "Non-interactive mode", false).option("--shadcn", "Include shadcn/ui (used with --ci)", false).option("--testing <framework>", "Testing framework: vitest or jest (used with --ci)", "jest").option("--deployment <strategy>", "Deployment extras: standalone, custom-server, spa, vercel (used with --ci)", "none").option("--nest-di-only", "Use NestJS for dependency injection only (used with --ci)", false).action(
317
337
  async (name, options) => {
318
338
  intro(`Create a ${chalk.blue("newt")} app.`);
319
339
  await doInit({
@@ -322,7 +342,9 @@ program.name("create-newt-app").version(package_default.version).description("Cr
322
342
  git: options.git,
323
343
  ci: options.ci,
324
344
  shadcn: options.shadcn,
325
- testing: options.testing === "jest" ? "jest" : "vitest"
345
+ testing: options.testing === "vitest" ? "vitest" : "jest",
346
+ deployment: ["standalone", "custom-server", "spa", "vercel"].includes(options.deployment) ? options.deployment : "none",
347
+ nestDiOnly: options.nestDiOnly
326
348
  });
327
349
  }
328
350
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-newt-app",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "ejs": "^3.1.10",
17
17
  "execa": "^9.6.0",
18
18
  "zod": "^3.25.76",
19
- "@newt-app/templates": "0.5.0"
19
+ "@newt-app/templates": "0.7.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/ejs": "^3.1.5",