create-newt-app 0.34.1 → 0.35.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 +50 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { existsSync, promises } from "fs";
|
|
|
11
11
|
import path from "path";
|
|
12
12
|
import https from "node:https";
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "0.
|
|
14
|
+
var version = "0.35.0";
|
|
15
15
|
var engines = { "node": ">=24.0.0" };
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/templates/root/index.ts
|
|
@@ -166,7 +166,7 @@ allowBuilds:
|
|
|
166
166
|
filename: "README.md",
|
|
167
167
|
template: `# <%= projectName %>
|
|
168
168
|
|
|
169
|
-
Full-stack monorepo: Next.js 16<% if (nest !== 'off') { %> + NestJS
|
|
169
|
+
Full-stack monorepo: Next.js 16<% if (nest !== 'off') { %> + NestJS 12<% } %> + better-auth + <%= database === 'postgres' ? 'Postgres' : 'SQLite' %>.
|
|
170
170
|
|
|
171
171
|
## Quick start
|
|
172
172
|
|
|
@@ -196,6 +196,10 @@ Open [http://localhost:3000](http://localhost:3000).
|
|
|
196
196
|
- **\`@<%= projectName %>/eslint-config\`**: shared ESLint config
|
|
197
197
|
<% } -%>
|
|
198
198
|
- **\`@<%= projectName %>/typescript-config\`**: shared tsconfig
|
|
199
|
+
|
|
200
|
+
## Formatting
|
|
201
|
+
|
|
202
|
+
\`pnpm format\` checks without modifying files and fails if any file is unformatted; \`pnpm format:fix\` applies formatting.
|
|
199
203
|
`
|
|
200
204
|
},
|
|
201
205
|
{
|
|
@@ -516,7 +520,7 @@ export default function Home() {
|
|
|
516
520
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
517
521
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
518
522
|
<li>
|
|
519
|
-
<Link href="https://newt-app.com">
|
|
523
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
520
524
|
</li>
|
|
521
525
|
<li>
|
|
522
526
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -1489,13 +1493,13 @@ const versions = {
|
|
|
1489
1493
|
"@babel/plugin-transform-class-properties": "^8.0.1",
|
|
1490
1494
|
"@base-ui/react": "^1.6.0",
|
|
1491
1495
|
"@eslint/js": "^9.39.1",
|
|
1492
|
-
"@nestjs/cli": "^
|
|
1493
|
-
"@nestjs/common": "^
|
|
1494
|
-
"@nestjs/core": "^
|
|
1495
|
-
"@nestjs/platform-express": "^
|
|
1496
|
-
"@nestjs/schematics": "^
|
|
1497
|
-
"@nestjs/serve-static": "^
|
|
1498
|
-
"@nestjs/testing": "^
|
|
1496
|
+
"@nestjs/cli": "^12.0.7",
|
|
1497
|
+
"@nestjs/common": "^12.1.0",
|
|
1498
|
+
"@nestjs/core": "^12.1.0",
|
|
1499
|
+
"@nestjs/platform-express": "^12.1.0",
|
|
1500
|
+
"@nestjs/schematics": "^12.0.5",
|
|
1501
|
+
"@nestjs/serve-static": "^12.0.0",
|
|
1502
|
+
"@nestjs/testing": "^12.1.0",
|
|
1499
1503
|
"@next/eslint-plugin-next": "^16.3.4",
|
|
1500
1504
|
"@oxlint/plugins": "^1.74.0",
|
|
1501
1505
|
"@shadcn/lint": "^0.1.0",
|
|
@@ -1507,7 +1511,7 @@ const versions = {
|
|
|
1507
1511
|
"@tailwindcss/postcss": "^4.2.1",
|
|
1508
1512
|
"@tanstack/react-form": "^1.28.5",
|
|
1509
1513
|
"@tanstack/react-query": "^5.90.21",
|
|
1510
|
-
"@thallesp/nestjs-better-auth": "^2.
|
|
1514
|
+
"@thallesp/nestjs-better-auth": "^2.8.0",
|
|
1511
1515
|
"@types/better-sqlite3": "^7.6.13",
|
|
1512
1516
|
"@types/express": "^5.0.0",
|
|
1513
1517
|
"@types/jest": "^30.0.0",
|
|
@@ -2018,7 +2022,7 @@ export default function Home() {
|
|
|
2018
2022
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
2019
2023
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
2020
2024
|
<li>
|
|
2021
|
-
<Link href="https://newt-app.com">
|
|
2025
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
2022
2026
|
</li>
|
|
2023
2027
|
<li>
|
|
2024
2028
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -10314,7 +10318,7 @@ export default function Home() {
|
|
|
10314
10318
|
<p {...stylex.props(styles.muted)}>Learn more</p>
|
|
10315
10319
|
<ul {...stylex.props(styles.list)}>
|
|
10316
10320
|
<li>
|
|
10317
|
-
<Link href="https://newt-app.com">
|
|
10321
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
10318
10322
|
</li>
|
|
10319
10323
|
<li>
|
|
10320
10324
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -11017,12 +11021,12 @@ const eslintConfig = {
|
|
|
11017
11021
|
{
|
|
11018
11022
|
module: root$1,
|
|
11019
11023
|
name: "format",
|
|
11020
|
-
script: `prettier --
|
|
11024
|
+
script: `prettier --check "**/*.{ts,tsx,js,jsx,json,md,yaml,yml}"`
|
|
11021
11025
|
},
|
|
11022
11026
|
{
|
|
11023
11027
|
module: root$1,
|
|
11024
|
-
name: "format:
|
|
11025
|
-
script: `prettier --
|
|
11028
|
+
name: "format:fix",
|
|
11029
|
+
script: `prettier --write "**/*.{ts,tsx,js,jsx,json,md,yaml,yml}"`
|
|
11026
11030
|
}
|
|
11027
11031
|
]
|
|
11028
11032
|
};
|
|
@@ -11124,12 +11128,12 @@ const oxc = {
|
|
|
11124
11128
|
{
|
|
11125
11129
|
module: root,
|
|
11126
11130
|
name: "format",
|
|
11127
|
-
script: "oxfmt"
|
|
11131
|
+
script: "oxfmt --check"
|
|
11128
11132
|
},
|
|
11129
11133
|
{
|
|
11130
11134
|
module: root,
|
|
11131
|
-
name: "format:
|
|
11132
|
-
script: "oxfmt
|
|
11135
|
+
name: "format:fix",
|
|
11136
|
+
script: "oxfmt"
|
|
11133
11137
|
}
|
|
11134
11138
|
]
|
|
11135
11139
|
};
|
|
@@ -11435,22 +11439,22 @@ module.exports = {
|
|
|
11435
11439
|
{
|
|
11436
11440
|
module: "apps/api",
|
|
11437
11441
|
name: "test",
|
|
11438
|
-
script: "jest"
|
|
11442
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
11439
11443
|
},
|
|
11440
11444
|
{
|
|
11441
11445
|
module: "apps/api",
|
|
11442
11446
|
name: "test:watch",
|
|
11443
|
-
script: "jest --watch"
|
|
11447
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
11444
11448
|
},
|
|
11445
11449
|
{
|
|
11446
11450
|
module: "apps/api",
|
|
11447
11451
|
name: "test:cov",
|
|
11448
|
-
script: "jest --coverage"
|
|
11452
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest --coverage"
|
|
11449
11453
|
},
|
|
11450
11454
|
{
|
|
11451
11455
|
module: "apps/api",
|
|
11452
11456
|
name: "test:debug",
|
|
11453
|
-
script: "node --inspect-brk node_modules/.bin/jest --runInBand"
|
|
11457
|
+
script: "node --inspect-brk --experimental-vm-modules node_modules/.bin/jest --runInBand"
|
|
11454
11458
|
},
|
|
11455
11459
|
{
|
|
11456
11460
|
module: "apps/api",
|
|
@@ -11909,14 +11913,12 @@ import { NestFactory } from '@nestjs/core';
|
|
|
11909
11913
|
import { AppModule } from '@<%= projectName %>/api';
|
|
11910
11914
|
import type { INestApplicationContext, Type, Abstract } from '@nestjs/common';
|
|
11911
11915
|
|
|
11912
|
-
let context: INestApplicationContext | null = null;
|
|
11916
|
+
let context: Promise<INestApplicationContext> | null = null;
|
|
11913
11917
|
|
|
11914
|
-
export
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
});
|
|
11919
|
-
}
|
|
11918
|
+
export function getContext(): Promise<INestApplicationContext> {
|
|
11919
|
+
context ??= NestFactory.createApplicationContext(AppModule, {
|
|
11920
|
+
logger: false,
|
|
11921
|
+
});
|
|
11920
11922
|
return context;
|
|
11921
11923
|
}
|
|
11922
11924
|
|
|
@@ -12876,7 +12878,7 @@ export default function Home() {
|
|
|
12876
12878
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
12877
12879
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
12878
12880
|
<li>
|
|
12879
|
-
<Link href="https://newt-app.com">
|
|
12881
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
12880
12882
|
</li>
|
|
12881
12883
|
<li>
|
|
12882
12884
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13130,7 +13132,7 @@ export default function Home() {
|
|
|
13130
13132
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
13131
13133
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
13132
13134
|
<li>
|
|
13133
|
-
<Link href="https://newt-app.com">
|
|
13135
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
13134
13136
|
</li>
|
|
13135
13137
|
<li>
|
|
13136
13138
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13457,7 +13459,7 @@ export default function Home() {
|
|
|
13457
13459
|
<p {...stylex.props(styles.muted)}>Learn more</p>
|
|
13458
13460
|
<ul {...stylex.props(styles.list)}>
|
|
13459
13461
|
<li>
|
|
13460
|
-
<Link href="https://newt-app.com">
|
|
13462
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
13461
13463
|
</li>
|
|
13462
13464
|
<li>
|
|
13463
13465
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13846,16 +13848,21 @@ async function pnpmInstall(cwd) {
|
|
|
13846
13848
|
return await execa("pnpm", ["install"], { cwd });
|
|
13847
13849
|
}
|
|
13848
13850
|
async function pnpmFormat(cwd) {
|
|
13849
|
-
return await execa("pnpm", ["format"], { cwd });
|
|
13851
|
+
return await execa("pnpm", ["format:fix"], { cwd });
|
|
13850
13852
|
}
|
|
13851
13853
|
async function initGit(cwd) {
|
|
13852
13854
|
await execa("git", ["init"], { cwd });
|
|
13853
13855
|
await execa("git", ["add", "."], { cwd });
|
|
13854
|
-
|
|
13855
|
-
"
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
13856
|
+
try {
|
|
13857
|
+
await execa("git", [
|
|
13858
|
+
"commit",
|
|
13859
|
+
"-m",
|
|
13860
|
+
"Initial commit"
|
|
13861
|
+
], { cwd });
|
|
13862
|
+
return true;
|
|
13863
|
+
} catch {
|
|
13864
|
+
return false;
|
|
13865
|
+
}
|
|
13859
13866
|
}
|
|
13860
13867
|
//#endregion
|
|
13861
13868
|
//#region src/telemetry.ts
|
|
@@ -14148,11 +14155,12 @@ async function doInit(options) {
|
|
|
14148
14155
|
}
|
|
14149
14156
|
});
|
|
14150
14157
|
}
|
|
14158
|
+
let committed = true;
|
|
14151
14159
|
if (options.git) taskBuilder.add({
|
|
14152
14160
|
title: "Initializing git",
|
|
14153
14161
|
task: async () => {
|
|
14154
|
-
await initGit(name);
|
|
14155
|
-
return "Initialized git.";
|
|
14162
|
+
committed = await initGit(name);
|
|
14163
|
+
return committed ? "Initialized git." : "Initialized git, but could not commit.";
|
|
14156
14164
|
}
|
|
14157
14165
|
});
|
|
14158
14166
|
await p.tasks(taskBuilder.tasks);
|
|
@@ -14164,6 +14172,7 @@ async function doInit(options) {
|
|
|
14164
14172
|
console.log(chalk.blue(` pnpm install`));
|
|
14165
14173
|
console.log(chalk.blue(` pnpm format`));
|
|
14166
14174
|
}
|
|
14175
|
+
if (!committed) console.log(chalk.blue(` git commit -m "Initial commit"`));
|
|
14167
14176
|
console.log(chalk.blue(` pnpm dev`));
|
|
14168
14177
|
console.log();
|
|
14169
14178
|
await reportRun({
|