create-newt-app 0.22.19 → 0.23.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.d.ts +1 -1
- package/dist/index.js +63 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
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.23.0",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
private: false,
|
|
13
13
|
type: "module",
|
|
@@ -10198,6 +10198,7 @@ var api_package_json_default = {
|
|
|
10198
10198
|
"@nestjs/core": "^11.0.1",
|
|
10199
10199
|
"@nestjs/platform-express": "^11.0.1",
|
|
10200
10200
|
"@<%= projectName %>/auth": "workspace:*",
|
|
10201
|
+
"@<%= projectName %>/db": "workspace:*",
|
|
10201
10202
|
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
10202
10203
|
"dotenv": "^17.3.1",
|
|
10203
10204
|
"reflect-metadata": "^0.2.2",
|
|
@@ -10329,6 +10330,33 @@ const nextConfig = {
|
|
|
10329
10330
|
export default nextConfig;`
|
|
10330
10331
|
};
|
|
10331
10332
|
|
|
10333
|
+
// src/templates/single-process-custom-server/templates/web-tsconfig.ts
|
|
10334
|
+
var web_tsconfig_default = {
|
|
10335
|
+
filename: "apps/web/tsconfig.json",
|
|
10336
|
+
template: `{
|
|
10337
|
+
"extends": "@<%= projectName %>/typescript-config/nextjs.json",
|
|
10338
|
+
"compilerOptions": {
|
|
10339
|
+
"plugins": [
|
|
10340
|
+
{
|
|
10341
|
+
"name": "next"
|
|
10342
|
+
}
|
|
10343
|
+
],
|
|
10344
|
+
"strictNullChecks": true,
|
|
10345
|
+
"paths": {
|
|
10346
|
+
"@/*": ["./*"]
|
|
10347
|
+
}
|
|
10348
|
+
},
|
|
10349
|
+
"include": [
|
|
10350
|
+
"**/*.ts",
|
|
10351
|
+
"**/*.tsx",
|
|
10352
|
+
"next-env.d.ts",
|
|
10353
|
+
"next.config.js",
|
|
10354
|
+
".next/types/**/*.ts"
|
|
10355
|
+
],
|
|
10356
|
+
"exclude": ["node_modules", "server.ts"]
|
|
10357
|
+
}`
|
|
10358
|
+
};
|
|
10359
|
+
|
|
10332
10360
|
// src/templates/single-process-custom-server/templates/web-tsconfig-server.ts
|
|
10333
10361
|
var web_tsconfig_server_default = {
|
|
10334
10362
|
filename: "apps/web/tsconfig.server.json",
|
|
@@ -10358,6 +10386,7 @@ var singleProcessCustomServer = {
|
|
|
10358
10386
|
web_server_default,
|
|
10359
10387
|
web_package_json_default,
|
|
10360
10388
|
web_next_config_default,
|
|
10389
|
+
web_tsconfig_default,
|
|
10361
10390
|
web_tsconfig_server_default
|
|
10362
10391
|
]
|
|
10363
10392
|
};
|
|
@@ -10414,6 +10443,7 @@ var api_package_json_default2 = {
|
|
|
10414
10443
|
"@nestjs/platform-express": "^11.0.1",
|
|
10415
10444
|
"@nestjs/serve-static": "^5.0.0",
|
|
10416
10445
|
"@<%= projectName %>/auth": "workspace:*",
|
|
10446
|
+
"@<%= projectName %>/db": "workspace:*",
|
|
10417
10447
|
"@thallesp/nestjs-better-auth": "^2.5.1",
|
|
10418
10448
|
"dotenv": "^17.3.1",
|
|
10419
10449
|
"reflect-metadata": "^0.2.2",
|
|
@@ -10646,7 +10676,7 @@ export default nextConfig;`
|
|
|
10646
10676
|
};
|
|
10647
10677
|
|
|
10648
10678
|
// src/templates/nest-di-only/templates/web-tsconfig.ts
|
|
10649
|
-
var
|
|
10679
|
+
var web_tsconfig_default2 = {
|
|
10650
10680
|
filename: "apps/web/tsconfig.json",
|
|
10651
10681
|
template: `{
|
|
10652
10682
|
"extends": "@<%= projectName %>/typescript-config/nextjs.json",
|
|
@@ -10697,7 +10727,7 @@ var nestDiOnly = {
|
|
|
10697
10727
|
web_hello_route_default,
|
|
10698
10728
|
web_package_json_default2,
|
|
10699
10729
|
web_next_config_default3,
|
|
10700
|
-
|
|
10730
|
+
web_tsconfig_default2
|
|
10701
10731
|
]
|
|
10702
10732
|
};
|
|
10703
10733
|
var nest_di_only_default = nestDiOnly;
|
|
@@ -11916,7 +11946,7 @@ async function doInit(options) {
|
|
|
11916
11946
|
}
|
|
11917
11947
|
})
|
|
11918
11948
|
},
|
|
11919
|
-
...!options.
|
|
11949
|
+
...!options.nonInteractive && {
|
|
11920
11950
|
shadcn: () => p.confirm({
|
|
11921
11951
|
message: "Use shadcn/ui?",
|
|
11922
11952
|
initialValue: true
|
|
@@ -11972,17 +12002,23 @@ async function doInit(options) {
|
|
|
11972
12002
|
process.exit(0);
|
|
11973
12003
|
}
|
|
11974
12004
|
});
|
|
11975
|
-
const useShadcn = options.
|
|
11976
|
-
const testing = options.
|
|
11977
|
-
const database = options.
|
|
11978
|
-
const linter = options.
|
|
11979
|
-
const deployment = options.
|
|
11980
|
-
const nestDiOnly2 = options.
|
|
11981
|
-
const todoExample = options.
|
|
12005
|
+
const useShadcn = options.nonInteractive ? options.shadcn : group2.shadcn ?? true;
|
|
12006
|
+
const testing = options.nonInteractive ? options.testing : group2.testing ?? "jest";
|
|
12007
|
+
const database = options.nonInteractive ? options.database : group2.database ?? "sqlite";
|
|
12008
|
+
const linter = options.nonInteractive ? options.linter : group2.linter ?? "eslint";
|
|
12009
|
+
const deployment = options.nonInteractive ? options.deployment : group2.deployment ?? "none";
|
|
12010
|
+
const nestDiOnly2 = options.nonInteractive ? options.nestDiOnly : group2.nestDiOnly ?? false;
|
|
12011
|
+
const todoExample = options.nonInteractive ? !options.bare : group2.todoExample ?? true;
|
|
11982
12012
|
const deploymentModule = deployment === "standalone" ? templates.deploymentStandalone : deployment === "custom-server" ? templates.deploymentCustomServer : deployment === "spa" ? templates.deploymentSpa : null;
|
|
12013
|
+
const webModule = deployment === "spa" ? {
|
|
12014
|
+
...templates.web,
|
|
12015
|
+
templates: templates.web.templates.filter(
|
|
12016
|
+
(t) => t.filename !== "apps/web/app/api/auth/[...all]/route.ts"
|
|
12017
|
+
)
|
|
12018
|
+
} : templates.web;
|
|
11983
12019
|
const allModules = [
|
|
11984
12020
|
templates.root,
|
|
11985
|
-
|
|
12021
|
+
webModule,
|
|
11986
12022
|
templates.api,
|
|
11987
12023
|
database === "postgres" ? templates.dbPostgres : templates.dbSqlite,
|
|
11988
12024
|
templates.auth,
|
|
@@ -12051,14 +12087,26 @@ async function doInit(options) {
|
|
|
12051
12087
|
}
|
|
12052
12088
|
}
|
|
12053
12089
|
var program = new Command();
|
|
12054
|
-
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("--
|
|
12055
|
-
async (name, options) => {
|
|
12090
|
+
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("--shadcn", "Include shadcn/ui", false).option("--testing <framework>", "Testing framework: vitest or jest", "jest").option("--database <database>", "Database: sqlite or postgres", "sqlite").option("--linter <linter>", "Linter: eslint or oxc", "eslint").option("--deployment <strategy>", "Deployment extras: standalone, custom-server, spa", "none").option("--nest-di-only", "Use NestJS for dependency injection only", false).option("--bare", "Skip the todo example", false).action(
|
|
12091
|
+
async (name, options, command) => {
|
|
12056
12092
|
intro(`Create a ${chalk.blue("newt")} app.`);
|
|
12093
|
+
const configFlags = [
|
|
12094
|
+
"shadcn",
|
|
12095
|
+
"testing",
|
|
12096
|
+
"database",
|
|
12097
|
+
"linter",
|
|
12098
|
+
"deployment",
|
|
12099
|
+
"nestDiOnly",
|
|
12100
|
+
"bare"
|
|
12101
|
+
];
|
|
12102
|
+
const nonInteractive = configFlags.some(
|
|
12103
|
+
(flag) => command.getOptionValueSource(flag) === "cli"
|
|
12104
|
+
);
|
|
12057
12105
|
await doInit({
|
|
12058
12106
|
name,
|
|
12059
12107
|
install: options.install,
|
|
12060
12108
|
git: options.git,
|
|
12061
|
-
|
|
12109
|
+
nonInteractive,
|
|
12062
12110
|
shadcn: options.shadcn,
|
|
12063
12111
|
testing: options.testing === "vitest" ? "vitest" : "jest",
|
|
12064
12112
|
database: options.database === "postgres" ? "postgres" : "sqlite",
|