create-newt-app 0.5.0 → 0.6.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.
- package/dist/index.js +18 -4
- 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.
|
|
10
|
+
version: "0.6.0",
|
|
11
11
|
private: false,
|
|
12
12
|
type: "module",
|
|
13
13
|
bin: {
|
|
@@ -232,6 +232,16 @@ async function doInit(options) {
|
|
|
232
232
|
{ value: "vitest", label: "Vitest" }
|
|
233
233
|
],
|
|
234
234
|
initialValue: "jest"
|
|
235
|
+
}),
|
|
236
|
+
deployment: () => p.select({
|
|
237
|
+
message: "Deployment strategy?",
|
|
238
|
+
options: [
|
|
239
|
+
{ value: "standalone", label: "Standalone + Dockerfile", hint: "default" },
|
|
240
|
+
{ value: "custom-server", label: "Custom Server", hint: "single process, single port" },
|
|
241
|
+
{ value: "spa", label: "SPA Mode", hint: "static export served by NestJS" },
|
|
242
|
+
{ value: "vercel", label: "Vercel", hint: "serverless function" }
|
|
243
|
+
],
|
|
244
|
+
initialValue: "standalone"
|
|
235
245
|
})
|
|
236
246
|
}
|
|
237
247
|
};
|
|
@@ -244,6 +254,8 @@ async function doInit(options) {
|
|
|
244
254
|
});
|
|
245
255
|
const useShadcn = options.ci ? options.shadcn : group2.shadcn ?? true;
|
|
246
256
|
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;
|
|
247
259
|
const allModules = [
|
|
248
260
|
templates.root,
|
|
249
261
|
templates.web,
|
|
@@ -252,7 +264,8 @@ async function doInit(options) {
|
|
|
252
264
|
useShadcn ? templates.shadcnUi : templates.ui,
|
|
253
265
|
templates.eslintConfig,
|
|
254
266
|
templates.typescriptConfig,
|
|
255
|
-
testing === "vitest" ? templates.testingVitest : templates.testingJest
|
|
267
|
+
testing === "vitest" ? templates.testingVitest : templates.testingJest,
|
|
268
|
+
...deploymentModule ? [deploymentModule] : []
|
|
256
269
|
];
|
|
257
270
|
const name = group2.name ?? options.name ?? "";
|
|
258
271
|
const taskBuilder = new TaskBuilder();
|
|
@@ -313,7 +326,7 @@ async function doInit(options) {
|
|
|
313
326
|
}
|
|
314
327
|
}
|
|
315
328
|
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(
|
|
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(
|
|
317
330
|
async (name, options) => {
|
|
318
331
|
intro(`Create a ${chalk.blue("newt")} app.`);
|
|
319
332
|
await doInit({
|
|
@@ -322,7 +335,8 @@ program.name("create-newt-app").version(package_default.version).description("Cr
|
|
|
322
335
|
git: options.git,
|
|
323
336
|
ci: options.ci,
|
|
324
337
|
shadcn: options.shadcn,
|
|
325
|
-
testing: options.testing === "
|
|
338
|
+
testing: options.testing === "vitest" ? "vitest" : "jest",
|
|
339
|
+
deployment: ["custom-server", "spa", "vercel"].includes(options.deployment) ? options.deployment : "standalone"
|
|
326
340
|
});
|
|
327
341
|
}
|
|
328
342
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-newt-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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.
|
|
19
|
+
"@newt-app/templates": "0.6.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/ejs": "^3.1.5",
|