create-newt-app 0.35.3 → 0.35.5

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/README.md CHANGED
@@ -19,14 +19,14 @@ npm create newt-app
19
19
 
20
20
  Next.js and NestJS in one production-grade monorepo: a real backend, auth, and a database, curated so you're not deleting half of it on day one.
21
21
 
22
- ## Documentation
22
+ ## Options
23
23
 
24
- Visit [newt-app.com](https://newt-app.com) to view the full documentation.
24
+ Run `npm create newt-app -- --help` for every flag, or build a command at [newt-app.com](https://newt-app.com).
25
25
 
26
26
  ## What's inside
27
27
 
28
28
  - **Next.js** frontend and **NestJS** backend, with `/api` proxied server-side to Nest
29
29
  - **Better Auth** shared across both apps
30
30
  - **Kysely** persistence, on SQLite or Postgres
31
- - **shadcn/ui** component library
31
+ - Optional **shadcn/ui** component library
32
32
  - **Turborepo** + **pnpm** workspaces
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { existsSync, promises, readdirSync } from "fs";
11
11
  import path from "path";
12
12
  import https from "node:https";
13
13
  //#region package.json
14
- var version = "0.35.3";
14
+ var version = "0.35.5";
15
15
  var engines = { "node": ">=24.0.0" };
16
16
  //#endregion
17
17
  //#region src/templates/root/index.ts
@@ -451,7 +451,11 @@ const geistMono = localFont({
451
451
 
452
452
  export const metadata: Metadata = {
453
453
  title: "<%= projectName %>",
454
+ <% if (nest !== 'off') { -%>
454
455
  description: "Next + Nest = Newt",
456
+ <% } else { -%>
457
+ description: "Next.js + better-auth = Newt",
458
+ <% } -%>
455
459
  icons: {
456
460
  icon: [
457
461
  { url: "/icon0.svg", type: "image/svg+xml" },
@@ -507,7 +511,11 @@ export default function Home() {
507
511
  <div>
508
512
  <h1 className="text-4xl font-black tracking-tight"><%= projectName %></h1>
509
513
  <p className="text-sm text-muted-foreground tracking-widest uppercase">
514
+ <% if (nest !== 'off') { -%>
510
515
  Next + Nest = Newt 💜
516
+ <% } else { -%>
517
+ Next.js + better-auth = Newt 💜
518
+ <% } -%>
511
519
  </p>
512
520
  </div>
513
521
  </div>
@@ -518,6 +526,7 @@ export default function Home() {
518
526
  <p className="text-sm text-muted-foreground">Next.js rendering</p>
519
527
  </div>
520
528
 
529
+ <% if (nest === 'on') { -%>
521
530
  <div className="rounded-xl border p-6 space-y-1">
522
531
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">nest.js</p>
523
532
  <p className="font-mono text-sm text-muted-foreground">GET /api/hello</p>
@@ -525,6 +534,23 @@ export default function Home() {
525
534
  <code>{JSON.stringify(hello, null, 2)}</code>
526
535
  </pre>
527
536
  </div>
537
+ <% } else if (nest === 'di-only') { -%>
538
+ <div className="rounded-xl border p-6 space-y-1">
539
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">nest.js</p>
540
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served by a Next.js route handler</p>
541
+ <pre className="mt-2 border rounded-md p-3 text-sm bg-muted/50">
542
+ <code>{JSON.stringify(hello, null, 2)}</code>
543
+ </pre>
544
+ </div>
545
+ <% } else { -%>
546
+ <div className="rounded-xl border p-6 space-y-1">
547
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">next.js</p>
548
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served in-process</p>
549
+ <pre className="mt-2 border rounded-md p-3 text-sm bg-muted/50">
550
+ <code>{JSON.stringify(hello, null, 2)}</code>
551
+ </pre>
552
+ </div>
553
+ <% } -%>
528
554
 
529
555
  <div className="rounded-xl border p-6">
530
556
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground mb-4">better-auth</p>
@@ -554,9 +580,11 @@ export default function Home() {
554
580
  <li>
555
581
  <Link href="https://nextjs.org">Next.js</Link>
556
582
  </li>
583
+ <% if (nest !== 'off') { -%>
557
584
  <li>
558
585
  <Link href="https://nestjs.com">NestJS</Link>
559
586
  </li>
587
+ <% } -%>
560
588
  </ul>
561
589
  </div>
562
590
  </main>
@@ -1932,7 +1960,11 @@ const geistMono = localFont({
1932
1960
 
1933
1961
  export const metadata: Metadata = {
1934
1962
  title: "<%= projectName %>",
1963
+ <% if (nest !== 'off') { -%>
1935
1964
  description: "Next + Nest = Newt",
1965
+ <% } else { -%>
1966
+ description: "Next.js + better-auth = Newt",
1967
+ <% } -%>
1936
1968
  icons: {
1937
1969
  icon: [
1938
1970
  { url: "/icon0.svg", type: "image/svg+xml" },
@@ -1996,7 +2028,11 @@ export default function Home() {
1996
2028
  <div>
1997
2029
  <h1 className="text-4xl font-black tracking-tight"><%= projectName %></h1>
1998
2030
  <p className="text-sm text-muted-foreground tracking-widest uppercase">
2031
+ <% if (nest !== 'off') { -%>
1999
2032
  Next + Nest = Newt 💜
2033
+ <% } else { -%>
2034
+ Next.js + better-auth = Newt 💜
2035
+ <% } -%>
2000
2036
  </p>
2001
2037
  </div>
2002
2038
  </div>
@@ -2013,6 +2049,7 @@ export default function Home() {
2013
2049
  </CardContent>
2014
2050
  </Card>
2015
2051
 
2052
+ <% if (nest === 'on') { -%>
2016
2053
  <Card>
2017
2054
  <CardHeader>
2018
2055
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
@@ -2026,6 +2063,35 @@ export default function Home() {
2026
2063
  </pre>
2027
2064
  </CardContent>
2028
2065
  </Card>
2066
+ <% } else if (nest === 'di-only') { -%>
2067
+ <Card>
2068
+ <CardHeader>
2069
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
2070
+ nest.js
2071
+ </p>
2072
+ </CardHeader>
2073
+ <CardContent>
2074
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served by a Next.js route handler</p>
2075
+ <pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
2076
+ <code>{JSON.stringify(hello, null, 2)}</code>
2077
+ </pre>
2078
+ </CardContent>
2079
+ </Card>
2080
+ <% } else { -%>
2081
+ <Card>
2082
+ <CardHeader>
2083
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
2084
+ next.js
2085
+ </p>
2086
+ </CardHeader>
2087
+ <CardContent>
2088
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served in-process</p>
2089
+ <pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
2090
+ <code>{JSON.stringify(hello, null, 2)}</code>
2091
+ </pre>
2092
+ </CardContent>
2093
+ </Card>
2094
+ <% } -%>
2029
2095
 
2030
2096
  <Card>
2031
2097
  <CardHeader>
@@ -2061,9 +2127,11 @@ export default function Home() {
2061
2127
  <li>
2062
2128
  <Link href="https://nextjs.org">Next.js</Link>
2063
2129
  </li>
2130
+ <% if (nest !== 'off') { -%>
2064
2131
  <li>
2065
2132
  <Link href="https://nestjs.com">NestJS</Link>
2066
2133
  </li>
2134
+ <% } -%>
2067
2135
  </ul>
2068
2136
  </div>
2069
2137
  </main>
@@ -10209,6 +10277,8 @@ const config = {
10209
10277
  "@stylexjs/postcss-plugin": {
10210
10278
  include: [
10211
10279
  "app/**/*.{js,jsx,ts,tsx}",
10280
+ "components/**/*.{js,jsx,ts,tsx}",
10281
+ "lib/**/*.{js,jsx,ts,tsx}",
10212
10282
  "../../packages/ui/src/**/*.{js,jsx,ts,tsx}",
10213
10283
  ],
10214
10284
  babelConfig: {
@@ -10243,7 +10313,11 @@ const geistMono = localFont({
10243
10313
 
10244
10314
  export const metadata: Metadata = {
10245
10315
  title: "<%= projectName %>",
10316
+ <% if (nest !== 'off') { -%>
10246
10317
  description: "Next + Nest = Newt",
10318
+ <% } else { -%>
10319
+ description: "Next.js + better-auth = Newt",
10320
+ <% } -%>
10247
10321
  icons: {
10248
10322
  icon: [
10249
10323
  { url: "/icon0.svg", type: "image/svg+xml" },
@@ -10310,7 +10384,11 @@ export default function Home() {
10310
10384
  <div>
10311
10385
  <h1 {...stylex.props(styles.h1)}><%= projectName %></h1>
10312
10386
  <p {...stylex.props(styles.muted, styles.tagline)}>
10387
+ <% if (nest !== 'off') { -%>
10313
10388
  Next + Nest = Newt 💜
10389
+ <% } else { -%>
10390
+ Next.js + better-auth = Newt 💜
10391
+ <% } -%>
10314
10392
  </p>
10315
10393
  </div>
10316
10394
  </div>
@@ -10321,6 +10399,7 @@ export default function Home() {
10321
10399
  <p {...stylex.props(styles.muted)}>Next.js rendering</p>
10322
10400
  </div>
10323
10401
 
10402
+ <% if (nest === 'on') { -%>
10324
10403
  <div {...stylex.props(styles.card)}>
10325
10404
  <p {...stylex.props(styles.eyebrow)}>nest.js</p>
10326
10405
  <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello</p>
@@ -10328,6 +10407,23 @@ export default function Home() {
10328
10407
  <code>{JSON.stringify(hello, null, 2)}</code>
10329
10408
  </pre>
10330
10409
  </div>
10410
+ <% } else if (nest === 'di-only') { -%>
10411
+ <div {...stylex.props(styles.card)}>
10412
+ <p {...stylex.props(styles.eyebrow)}>nest.js</p>
10413
+ <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello, served by a Next.js route handler</p>
10414
+ <pre {...stylex.props(styles.pre)}>
10415
+ <code>{JSON.stringify(hello, null, 2)}</code>
10416
+ </pre>
10417
+ </div>
10418
+ <% } else { -%>
10419
+ <div {...stylex.props(styles.card)}>
10420
+ <p {...stylex.props(styles.eyebrow)}>next.js</p>
10421
+ <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello, served in-process</p>
10422
+ <pre {...stylex.props(styles.pre)}>
10423
+ <code>{JSON.stringify(hello, null, 2)}</code>
10424
+ </pre>
10425
+ </div>
10426
+ <% } -%>
10331
10427
 
10332
10428
  <div {...stylex.props(styles.card)}>
10333
10429
  <p {...stylex.props(styles.eyebrow, styles.eyebrowSpaced)}>better-auth</p>
@@ -10357,9 +10453,11 @@ export default function Home() {
10357
10453
  <li>
10358
10454
  <Link href="https://nextjs.org">Next.js</Link>
10359
10455
  </li>
10456
+ <% if (nest !== 'off') { -%>
10360
10457
  <li>
10361
10458
  <Link href="https://nestjs.com">NestJS</Link>
10362
10459
  </li>
10460
+ <% } -%>
10363
10461
  </ul>
10364
10462
  </div>
10365
10463
  </main>
@@ -11604,7 +11702,7 @@ describe('AppController (e2e)', () => {
11604
11702
  {
11605
11703
  module: "apps/api",
11606
11704
  name: "test:debug",
11607
- script: "vitest --inspect-brk --inspect --logHeapUsage --threads=false"
11705
+ script: "vitest --inspect-brk --no-file-parallelism"
11608
11706
  },
11609
11707
  {
11610
11708
  module: "apps/api",
@@ -11784,6 +11882,7 @@ export default nextConfig;`
11784
11882
  "dependsOn": ["^build"]
11785
11883
  },
11786
11884
  "dev": {
11885
+ "dependsOn": ["^migrate"],
11787
11886
  "env": ["DATABASE_URL"],
11788
11887
  "cache": false,
11789
11888
  "persistent": true
@@ -11811,6 +11910,7 @@ const singleProcessStaticExport = { templates: [{
11811
11910
  "private": true,
11812
11911
  "scripts": {
11813
11912
  "build": "nest build",
11913
+ "typecheck": "tsc -p tsconfig.build.json --noEmit",
11814
11914
  "start": "nest start",
11815
11915
  "dev": "nest start --watch",
11816
11916
  "start:debug": "nest start --debug --watch",
@@ -11882,7 +11982,8 @@ const nestDiOnly = { templates: [
11882
11982
  ".": "./src/index.ts"
11883
11983
  },
11884
11984
  "scripts": {
11885
- "build": "nest build"
11985
+ "build": "nest build",
11986
+ "typecheck": "tsc -p tsconfig.build.json --noEmit"
11886
11987
  },
11887
11988
  "dependencies": {
11888
11989
  "@nestjs/common": "<%= versions["@nestjs/common"] %>",
@@ -12907,7 +13008,11 @@ export default function Home() {
12907
13008
  <div>
12908
13009
  <h1 className="text-4xl font-black tracking-tight"><%= projectName %></h1>
12909
13010
  <p className="text-sm text-muted-foreground tracking-widest uppercase">
13011
+ <% if (nest !== 'off') { -%>
12910
13012
  Next + Nest = Newt 💜
13013
+ <% } else { -%>
13014
+ Next.js + better-auth = Newt 💜
13015
+ <% } -%>
12911
13016
  </p>
12912
13017
  </div>
12913
13018
  </div>
@@ -12918,6 +13023,7 @@ export default function Home() {
12918
13023
  <p className="text-sm text-muted-foreground">Next.js rendering</p>
12919
13024
  </div>
12920
13025
 
13026
+ <% if (nest === 'on') { -%>
12921
13027
  <div className="rounded-xl border p-6 space-y-1">
12922
13028
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">nest.js</p>
12923
13029
  <p className="font-mono text-sm text-muted-foreground">GET /api/hello</p>
@@ -12925,6 +13031,23 @@ export default function Home() {
12925
13031
  <code>{JSON.stringify(hello, null, 2)}</code>
12926
13032
  </pre>
12927
13033
  </div>
13034
+ <% } else if (nest === 'di-only') { -%>
13035
+ <div className="rounded-xl border p-6 space-y-1">
13036
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">nest.js</p>
13037
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served by a Next.js route handler</p>
13038
+ <pre className="mt-2 border rounded-md p-3 text-sm bg-muted/50">
13039
+ <code>{JSON.stringify(hello, null, 2)}</code>
13040
+ </pre>
13041
+ </div>
13042
+ <% } else { -%>
13043
+ <div className="rounded-xl border p-6 space-y-1">
13044
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">next.js</p>
13045
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served in-process</p>
13046
+ <pre className="mt-2 border rounded-md p-3 text-sm bg-muted/50">
13047
+ <code>{JSON.stringify(hello, null, 2)}</code>
13048
+ </pre>
13049
+ </div>
13050
+ <% } -%>
12928
13051
 
12929
13052
  <div className="rounded-xl border p-6">
12930
13053
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground mb-4">better-auth</p>
@@ -12949,9 +13072,11 @@ export default function Home() {
12949
13072
  <li>
12950
13073
  <Link href="https://nextjs.org">Next.js</Link>
12951
13074
  </li>
13075
+ <% if (nest !== 'off') { -%>
12952
13076
  <li>
12953
13077
  <Link href="https://nestjs.com">NestJS</Link>
12954
13078
  </li>
13079
+ <% } -%>
12955
13080
  </ul>
12956
13081
  </div>
12957
13082
  </main>
@@ -13152,7 +13277,11 @@ export default function Home() {
13152
13277
  <div>
13153
13278
  <h1 className="text-4xl font-black tracking-tight"><%= projectName %></h1>
13154
13279
  <p className="text-sm text-muted-foreground tracking-widest uppercase">
13280
+ <% if (nest !== 'off') { -%>
13155
13281
  Next + Nest = Newt 💜
13282
+ <% } else { -%>
13283
+ Next.js + better-auth = Newt 💜
13284
+ <% } -%>
13156
13285
  </p>
13157
13286
  </div>
13158
13287
  </div>
@@ -13169,6 +13298,7 @@ export default function Home() {
13169
13298
  </CardContent>
13170
13299
  </Card>
13171
13300
 
13301
+ <% if (nest === 'on') { -%>
13172
13302
  <Card>
13173
13303
  <CardHeader>
13174
13304
  <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
@@ -13182,6 +13312,35 @@ export default function Home() {
13182
13312
  </pre>
13183
13313
  </CardContent>
13184
13314
  </Card>
13315
+ <% } else if (nest === 'di-only') { -%>
13316
+ <Card>
13317
+ <CardHeader>
13318
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
13319
+ nest.js
13320
+ </p>
13321
+ </CardHeader>
13322
+ <CardContent>
13323
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served by a Next.js route handler</p>
13324
+ <pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
13325
+ <code>{JSON.stringify(hello, null, 2)}</code>
13326
+ </pre>
13327
+ </CardContent>
13328
+ </Card>
13329
+ <% } else { -%>
13330
+ <Card>
13331
+ <CardHeader>
13332
+ <p className="text-xs font-mono uppercase tracking-widest text-muted-foreground">
13333
+ next.js
13334
+ </p>
13335
+ </CardHeader>
13336
+ <CardContent>
13337
+ <p className="font-mono text-sm text-muted-foreground">GET /api/hello, served in-process</p>
13338
+ <pre className="mt-2 rounded-md border p-3 text-sm bg-muted/50">
13339
+ <code>{JSON.stringify(hello, null, 2)}</code>
13340
+ </pre>
13341
+ </CardContent>
13342
+ </Card>
13343
+ <% } -%>
13185
13344
 
13186
13345
  <Card>
13187
13346
  <CardHeader>
@@ -13212,9 +13371,11 @@ export default function Home() {
13212
13371
  <li>
13213
13372
  <Link href="https://nextjs.org">Next.js</Link>
13214
13373
  </li>
13374
+ <% if (nest !== 'off') { -%>
13215
13375
  <li>
13216
13376
  <Link href="https://nestjs.com">NestJS</Link>
13217
13377
  </li>
13378
+ <% } -%>
13218
13379
  </ul>
13219
13380
  </div>
13220
13381
  </main>
@@ -13511,7 +13672,11 @@ export default function Home() {
13511
13672
  <div>
13512
13673
  <h1 {...stylex.props(styles.h1)}><%= projectName %></h1>
13513
13674
  <p {...stylex.props(styles.muted, styles.tagline)}>
13675
+ <% if (nest !== 'off') { -%>
13514
13676
  Next + Nest = Newt 💜
13677
+ <% } else { -%>
13678
+ Next.js + better-auth = Newt 💜
13679
+ <% } -%>
13515
13680
  </p>
13516
13681
  </div>
13517
13682
  </div>
@@ -13522,6 +13687,7 @@ export default function Home() {
13522
13687
  <p {...stylex.props(styles.muted)}>Next.js rendering</p>
13523
13688
  </div>
13524
13689
 
13690
+ <% if (nest === 'on') { -%>
13525
13691
  <div {...stylex.props(styles.card)}>
13526
13692
  <p {...stylex.props(styles.eyebrow)}>nest.js</p>
13527
13693
  <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello</p>
@@ -13529,6 +13695,23 @@ export default function Home() {
13529
13695
  <code>{JSON.stringify(hello, null, 2)}</code>
13530
13696
  </pre>
13531
13697
  </div>
13698
+ <% } else if (nest === 'di-only') { -%>
13699
+ <div {...stylex.props(styles.card)}>
13700
+ <p {...stylex.props(styles.eyebrow)}>nest.js</p>
13701
+ <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello, served by a Next.js route handler</p>
13702
+ <pre {...stylex.props(styles.pre)}>
13703
+ <code>{JSON.stringify(hello, null, 2)}</code>
13704
+ </pre>
13705
+ </div>
13706
+ <% } else { -%>
13707
+ <div {...stylex.props(styles.card)}>
13708
+ <p {...stylex.props(styles.eyebrow)}>next.js</p>
13709
+ <p {...stylex.props(styles.mono, styles.muted)}>GET /api/hello, served in-process</p>
13710
+ <pre {...stylex.props(styles.pre)}>
13711
+ <code>{JSON.stringify(hello, null, 2)}</code>
13712
+ </pre>
13713
+ </div>
13714
+ <% } -%>
13532
13715
 
13533
13716
  <div {...stylex.props(styles.card)}>
13534
13717
  <p {...stylex.props(styles.eyebrow, styles.eyebrowSpaced)}>better-auth</p>
@@ -13553,9 +13736,11 @@ export default function Home() {
13553
13736
  <li>
13554
13737
  <Link href="https://nextjs.org">Next.js</Link>
13555
13738
  </li>
13739
+ <% if (nest !== 'off') { -%>
13556
13740
  <li>
13557
13741
  <Link href="https://nestjs.com">NestJS</Link>
13558
13742
  </li>
13743
+ <% } -%>
13559
13744
  </ul>
13560
13745
  </div>
13561
13746
  </main>