create-newt-app 0.6.0 → 0.8.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 +17 -9
  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.6.0",
10
+ version: "0.8.0",
11
11
  private: false,
12
12
  type: "module",
13
13
  bin: {
@@ -233,15 +233,20 @@ async function doInit(options) {
233
233
  ],
234
234
  initialValue: "jest"
235
235
  }),
236
+ nestDiOnly: () => p.confirm({
237
+ message: "Use NestJS for dependency injection only?",
238
+ initialValue: false
239
+ }),
236
240
  deployment: () => p.select({
237
- message: "Deployment strategy?",
241
+ message: "Deployment extras?",
238
242
  options: [
239
- { value: "standalone", label: "Standalone + Dockerfile", hint: "default" },
243
+ { value: "none", label: "None", hint: "skip" },
244
+ { value: "standalone", label: "Standalone + Dockerfile", hint: "Dockerfiles + docker-compose.yml" },
240
245
  { value: "custom-server", label: "Custom Server", hint: "single process, single port" },
241
246
  { value: "spa", label: "SPA Mode", hint: "static export served by NestJS" },
242
247
  { value: "vercel", label: "Vercel", hint: "serverless function" }
243
248
  ],
244
- initialValue: "standalone"
249
+ initialValue: "none"
245
250
  })
246
251
  }
247
252
  };
@@ -254,8 +259,9 @@ async function doInit(options) {
254
259
  });
255
260
  const useShadcn = options.ci ? options.shadcn : group2.shadcn ?? true;
256
261
  const testing = options.ci ? options.testing : group2.testing ?? "jest";
257
- const deployment = options.ci ? options.deployment : group2.deployment ?? "standalone";
258
- const deploymentModule = deployment === "custom-server" ? templates.deploymentCustomServer : deployment === "spa" ? templates.deploymentSpa : deployment === "vercel" ? templates.deploymentVercel : null;
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;
259
265
  const allModules = [
260
266
  templates.root,
261
267
  templates.web,
@@ -265,7 +271,8 @@ async function doInit(options) {
265
271
  templates.eslintConfig,
266
272
  templates.typescriptConfig,
267
273
  testing === "vitest" ? templates.testingVitest : templates.testingJest,
268
- ...deploymentModule ? [deploymentModule] : []
274
+ ...deploymentModule ? [deploymentModule] : [],
275
+ ...nestDiOnly ? [templates.nestDiOnly] : []
269
276
  ];
270
277
  const name = group2.name ?? options.name ?? "";
271
278
  const taskBuilder = new TaskBuilder();
@@ -326,7 +333,7 @@ async function doInit(options) {
326
333
  }
327
334
  }
328
335
  var program = new Command();
329
- 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 strategy: standalone, custom-server, spa, vercel (used with --ci)", "standalone").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(
330
337
  async (name, options) => {
331
338
  intro(`Create a ${chalk.blue("newt")} app.`);
332
339
  await doInit({
@@ -336,7 +343,8 @@ program.name("create-newt-app").version(package_default.version).description("Cr
336
343
  ci: options.ci,
337
344
  shadcn: options.shadcn,
338
345
  testing: options.testing === "vitest" ? "vitest" : "jest",
339
- deployment: ["custom-server", "spa", "vercel"].includes(options.deployment) ? options.deployment : "standalone"
346
+ deployment: ["standalone", "custom-server", "spa", "vercel"].includes(options.deployment) ? options.deployment : "none",
347
+ nestDiOnly: options.nestDiOnly
340
348
  });
341
349
  }
342
350
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-newt-app",
3
- "version": "0.6.0",
3
+ "version": "0.8.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.6.0"
19
+ "@newt-app/templates": "0.8.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/ejs": "^3.1.5",