create-newt-app 0.34.0 → 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 +54 -43
- 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>
|
|
@@ -689,7 +693,7 @@ export const { GET, POST } = toNextJsHandler(auth);`
|
|
|
689
693
|
filename: "apps/web/lib/auth-client.ts",
|
|
690
694
|
template: `import { createAuthClient } from "better-auth/react";
|
|
691
695
|
|
|
692
|
-
export const authClient
|
|
696
|
+
export const authClient = createAuthClient();`
|
|
693
697
|
},
|
|
694
698
|
{
|
|
695
699
|
filename: "apps/web/app/manifest.json",
|
|
@@ -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
|
};
|
|
@@ -11310,7 +11314,9 @@ const typescriptConfig = { templates: [
|
|
|
11310
11314
|
"moduleResolution": "Bundler",
|
|
11311
11315
|
"allowJs": true,
|
|
11312
11316
|
"jsx": "preserve",
|
|
11313
|
-
"noEmit": true
|
|
11317
|
+
"noEmit": true,
|
|
11318
|
+
"declaration": false,
|
|
11319
|
+
"declarationMap": false
|
|
11314
11320
|
}
|
|
11315
11321
|
}`
|
|
11316
11322
|
},
|
|
@@ -11433,22 +11439,22 @@ module.exports = {
|
|
|
11433
11439
|
{
|
|
11434
11440
|
module: "apps/api",
|
|
11435
11441
|
name: "test",
|
|
11436
|
-
script: "jest"
|
|
11442
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
11437
11443
|
},
|
|
11438
11444
|
{
|
|
11439
11445
|
module: "apps/api",
|
|
11440
11446
|
name: "test:watch",
|
|
11441
|
-
script: "jest --watch"
|
|
11447
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
11442
11448
|
},
|
|
11443
11449
|
{
|
|
11444
11450
|
module: "apps/api",
|
|
11445
11451
|
name: "test:cov",
|
|
11446
|
-
script: "jest --coverage"
|
|
11452
|
+
script: "NODE_OPTIONS=--experimental-vm-modules jest --coverage"
|
|
11447
11453
|
},
|
|
11448
11454
|
{
|
|
11449
11455
|
module: "apps/api",
|
|
11450
11456
|
name: "test:debug",
|
|
11451
|
-
script: "node --inspect-brk node_modules/.bin/jest --runInBand"
|
|
11457
|
+
script: "node --inspect-brk --experimental-vm-modules node_modules/.bin/jest --runInBand"
|
|
11452
11458
|
},
|
|
11453
11459
|
{
|
|
11454
11460
|
module: "apps/api",
|
|
@@ -11907,14 +11913,12 @@ import { NestFactory } from '@nestjs/core';
|
|
|
11907
11913
|
import { AppModule } from '@<%= projectName %>/api';
|
|
11908
11914
|
import type { INestApplicationContext, Type, Abstract } from '@nestjs/common';
|
|
11909
11915
|
|
|
11910
|
-
let context: INestApplicationContext | null = null;
|
|
11916
|
+
let context: Promise<INestApplicationContext> | null = null;
|
|
11911
11917
|
|
|
11912
|
-
export
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
});
|
|
11917
|
-
}
|
|
11918
|
+
export function getContext(): Promise<INestApplicationContext> {
|
|
11919
|
+
context ??= NestFactory.createApplicationContext(AppModule, {
|
|
11920
|
+
logger: false,
|
|
11921
|
+
});
|
|
11918
11922
|
return context;
|
|
11919
11923
|
}
|
|
11920
11924
|
|
|
@@ -12874,7 +12878,7 @@ export default function Home() {
|
|
|
12874
12878
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
12875
12879
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
12876
12880
|
<li>
|
|
12877
|
-
<Link href="https://newt-app.com">
|
|
12881
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
12878
12882
|
</li>
|
|
12879
12883
|
<li>
|
|
12880
12884
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13128,7 +13132,7 @@ export default function Home() {
|
|
|
13128
13132
|
<p className="mb-2 text-muted-foreground">Learn more</p>
|
|
13129
13133
|
<ul className="list-disc list-inside space-y-2 mt-2">
|
|
13130
13134
|
<li>
|
|
13131
|
-
<Link href="https://newt-app.com">
|
|
13135
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
13132
13136
|
</li>
|
|
13133
13137
|
<li>
|
|
13134
13138
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13455,7 +13459,7 @@ export default function Home() {
|
|
|
13455
13459
|
<p {...stylex.props(styles.muted)}>Learn more</p>
|
|
13456
13460
|
<ul {...stylex.props(styles.list)}>
|
|
13457
13461
|
<li>
|
|
13458
|
-
<Link href="https://newt-app.com">
|
|
13462
|
+
<Link href="https://newt-app.com">newt-app</Link>
|
|
13459
13463
|
</li>
|
|
13460
13464
|
<li>
|
|
13461
13465
|
<Link href="https://github.com/zeevo/newt-app">GitHub</Link>
|
|
@@ -13844,16 +13848,21 @@ async function pnpmInstall(cwd) {
|
|
|
13844
13848
|
return await execa("pnpm", ["install"], { cwd });
|
|
13845
13849
|
}
|
|
13846
13850
|
async function pnpmFormat(cwd) {
|
|
13847
|
-
return await execa("pnpm", ["format"], { cwd });
|
|
13851
|
+
return await execa("pnpm", ["format:fix"], { cwd });
|
|
13848
13852
|
}
|
|
13849
13853
|
async function initGit(cwd) {
|
|
13850
13854
|
await execa("git", ["init"], { cwd });
|
|
13851
13855
|
await execa("git", ["add", "."], { cwd });
|
|
13852
|
-
|
|
13853
|
-
"
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13856
|
+
try {
|
|
13857
|
+
await execa("git", [
|
|
13858
|
+
"commit",
|
|
13859
|
+
"-m",
|
|
13860
|
+
"Initial commit"
|
|
13861
|
+
], { cwd });
|
|
13862
|
+
return true;
|
|
13863
|
+
} catch {
|
|
13864
|
+
return false;
|
|
13865
|
+
}
|
|
13857
13866
|
}
|
|
13858
13867
|
//#endregion
|
|
13859
13868
|
//#region src/telemetry.ts
|
|
@@ -14146,11 +14155,12 @@ async function doInit(options) {
|
|
|
14146
14155
|
}
|
|
14147
14156
|
});
|
|
14148
14157
|
}
|
|
14158
|
+
let committed = true;
|
|
14149
14159
|
if (options.git) taskBuilder.add({
|
|
14150
14160
|
title: "Initializing git",
|
|
14151
14161
|
task: async () => {
|
|
14152
|
-
await initGit(name);
|
|
14153
|
-
return "Initialized git.";
|
|
14162
|
+
committed = await initGit(name);
|
|
14163
|
+
return committed ? "Initialized git." : "Initialized git, but could not commit.";
|
|
14154
14164
|
}
|
|
14155
14165
|
});
|
|
14156
14166
|
await p.tasks(taskBuilder.tasks);
|
|
@@ -14162,6 +14172,7 @@ async function doInit(options) {
|
|
|
14162
14172
|
console.log(chalk.blue(` pnpm install`));
|
|
14163
14173
|
console.log(chalk.blue(` pnpm format`));
|
|
14164
14174
|
}
|
|
14175
|
+
if (!committed) console.log(chalk.blue(` git commit -m "Initial commit"`));
|
|
14165
14176
|
console.log(chalk.blue(` pnpm dev`));
|
|
14166
14177
|
console.log();
|
|
14167
14178
|
await reportRun({
|