create-newt-app 0.29.0 → 0.31.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/templates/types.ts","../src/index.ts"],"mappings":";KA+BY;;;cCfN;cACA;cACA;cACA;KAGD,kBAAkB;KAClB,mBAAmB;KACnB,iBAAiB;KACjB,qBAAqB;KAErB;EACH;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,UAAU;EACV,QAAQ;EACR,YAAY;EACZ;EACA;EACA,iBAAiB;;iBAWG,OAAO,SAAS,UAAO"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/templates/types.ts","../src/index.ts"],"mappings":";KA+BY;;;cCfN;cACA;cACA;cACA;KAGD,kBAAkB;KAClB,mBAAmB;KACnB,iBAAiB;KACjB,qBAAqB;KAcrB;EACH;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,UAAU;EACV,QAAQ;EACR,YAAY;EACZ;EACA;EACA,iBAAiB;;iBAWG,OAAO,SAAS,UAAO"}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import ejs from "ejs";
10
10
  import { existsSync, promises } from "fs";
11
11
  import path from "path";
12
12
  //#region package.json
13
- var version = "0.29.0";
13
+ var version = "0.31.0";
14
14
  var engines = { "node": ">=24.0.0" };
15
15
  //#endregion
16
16
  //#region src/templates/root/index.ts
@@ -25,6 +25,7 @@ const root$2 = { templates: [
25
25
  "dev": "turbo run dev",
26
26
  "lint": "turbo run lint",
27
27
  "test": "turbo run test",
28
+ "typecheck": "turbo run typecheck",
28
29
  "db:make": "pnpm --filter @<%= projectName %>/db run make",
29
30
  "db:migrate": "turbo run migrate",
30
31
  "db:generate": "turbo run generate"
@@ -34,7 +35,10 @@ const root$2 = { templates: [
34
35
  "turbo": "<%= versions.turbo %>",
35
36
  "typescript": "<%= versions.typescript %>"
36
37
  },
37
- "packageManager": "pnpm@9.0.0",
38
+ "pnpm": {
39
+ "onlyBuiltDependencies": ["better-sqlite3", "esbuild", "sharp", "unrs-resolver"]
40
+ },
41
+ "packageManager": "pnpm@10.34.5",
38
42
  "engines": {
39
43
  "node": ">=24.0.0"
40
44
  }
@@ -110,11 +114,16 @@ dist
110
114
  "inputs": ["$TURBO_DEFAULT$", ".env*"],
111
115
  "outputs": [".next/**", "!.next/cache/**"]
112
116
  },
113
- <% if (linter === "oxc") { %> "typecheck": {
117
+ "typecheck": {
114
118
  "dependsOn": ["^build"]
115
- },<% } else { %> "lint": {
119
+ },<% if (linter !== "oxc") { %>
120
+ "lint": {
116
121
  "dependsOn": ["^lint"],
117
122
  "env": ["NODE_ENV"]
123
+ },
124
+ "lint:check": {
125
+ "dependsOn": ["^lint:check"],
126
+ "env": ["NODE_ENV"]
118
127
  },<% } %>
119
128
  "test": {
120
129
  "dependsOn": ["^build"],
@@ -195,7 +204,7 @@ This version has breaking changes — APIs, conventions, and file structure may
195
204
  ] };
196
205
  //#endregion
197
206
  //#region src/templates/web/index.ts
198
- const web$2 = {
207
+ const web$1 = {
199
208
  templates: [
200
209
  {
201
210
  when: (s) => !s.nestDiOnly && s.deployment !== "custom-server",
@@ -209,6 +218,7 @@ const web$2 = {
209
218
  "dev": "next dev --port 3000",
210
219
  "build": "next build",
211
220
  "start": "next start",
221
+ "typecheck": "next typegen && tsc --noEmit",
212
222
  "db:migrate": "better-auth migrate"
213
223
  },
214
224
  "dependencies": {
@@ -752,6 +762,7 @@ const api$1 = { templates: [
752
762
  "license": "UNLICENSED",
753
763
  "scripts": {
754
764
  "build": "nest build",
765
+ "typecheck": "tsc -p tsconfig.build.json --noEmit",
755
766
  "start": "nest start",
756
767
  "dev": "nest start --watch",
757
768
  "start:dev": "nest start --watch",
@@ -903,6 +914,7 @@ const auth = { templates: [
903
914
  ".": "./src/index.ts"
904
915
  },
905
916
  "scripts": {
917
+ "typecheck": "tsc --noEmit",
906
918
  "migrate": "dotenv -e ../../.env -- auth migrate -y --config src/index.ts",
907
919
  "generate": "dotenv -e ../../.env -- auth generate --config src/index.ts"
908
920
  },
@@ -1137,6 +1149,7 @@ var package_json_sqlite_default = {
1137
1149
  ".": "./src/index.ts"
1138
1150
  },
1139
1151
  "scripts": {
1152
+ "typecheck": "tsc --noEmit",
1140
1153
  "migrate": "dotenv -e ../../.env -- tsx src/migrate.ts",
1141
1154
  "make": "tsx scripts/new-migration.ts"
1142
1155
  },
@@ -1165,6 +1178,7 @@ var package_json_postgres_default = {
1165
1178
  ".": "./src/index.ts"
1166
1179
  },
1167
1180
  "scripts": {
1181
+ "typecheck": "tsc --noEmit",
1168
1182
  "migrate": "dotenv -e ../../.env -- tsx src/migrate.ts",
1169
1183
  "make": "tsx scripts/new-migration.ts"
1170
1184
  },
@@ -1262,7 +1276,7 @@ const ui$1 = { templates: [
1262
1276
  "./*": "./src/*.tsx"
1263
1277
  },
1264
1278
  "scripts": {
1265
- "check-types": "tsc --noEmit"
1279
+ "typecheck": "tsc --noEmit"
1266
1280
  },
1267
1281
  "devDependencies": {
1268
1282
  "@<%= projectName %>/typescript-config": "workspace:*",
@@ -1588,7 +1602,9 @@ const shadcnUi = {
1588
1602
  "./hooks/*": "./src/hooks/*.ts",
1589
1603
  "./*": "./src/components/*.tsx"
1590
1604
  },
1591
- "scripts": {},
1605
+ "scripts": {
1606
+ "typecheck": "tsc --noEmit"
1607
+ },
1592
1608
  "dependencies": {
1593
1609
  "@base-ui/react": "<%= versions["@base-ui/react"] %>",
1594
1610
  "@shadcn/react": "<%= versions["@shadcn/react"] %>",
@@ -10098,7 +10114,7 @@ var prettierrc_default = {
10098
10114
  };
10099
10115
  //#endregion
10100
10116
  //#region src/templates/eslint-config/index.ts
10101
- const web$1 = "apps/web";
10117
+ const web = "apps/web";
10102
10118
  const api = "apps/api";
10103
10119
  const ui = "packages/ui";
10104
10120
  const root$1 = "";
@@ -10116,13 +10132,13 @@ const eslintConfig = {
10116
10132
  packages: [
10117
10133
  {
10118
10134
  package: "eslint",
10119
- module: web$1,
10135
+ module: web,
10120
10136
  version: versions.eslint,
10121
10137
  dev: true
10122
10138
  },
10123
10139
  {
10124
10140
  package: "@<%= projectName %>/eslint-config",
10125
- module: web$1,
10141
+ module: web,
10126
10142
  version: "workspace:*",
10127
10143
  dev: true
10128
10144
  },
@@ -10183,12 +10199,12 @@ const eslintConfig = {
10183
10199
  ],
10184
10200
  scripts: [
10185
10201
  {
10186
- module: web$1,
10202
+ module: web,
10187
10203
  name: "lint",
10188
10204
  script: "eslint --fix && next typegen && tsc --noEmit"
10189
10205
  },
10190
10206
  {
10191
- module: web$1,
10207
+ module: web,
10192
10208
  name: "lint:check",
10193
10209
  script: "eslint --max-warnings 0 && next typegen && tsc --noEmit"
10194
10210
  },
@@ -10200,7 +10216,7 @@ const eslintConfig = {
10200
10216
  {
10201
10217
  module: api,
10202
10218
  name: "lint:check",
10203
- script: `eslint "src/**/*.ts"`
10219
+ script: `eslint "src/**/*.ts" --max-warnings 0`
10204
10220
  },
10205
10221
  {
10206
10222
  module: ui,
@@ -10212,6 +10228,11 @@ const eslintConfig = {
10212
10228
  name: "lint:check",
10213
10229
  script: "eslint . --max-warnings 0"
10214
10230
  },
10231
+ {
10232
+ module: root$1,
10233
+ name: "lint:check",
10234
+ script: "turbo run lint:check"
10235
+ },
10215
10236
  {
10216
10237
  module: root$1,
10217
10238
  name: "format",
@@ -10287,7 +10308,6 @@ var oxfmtrc_default = {
10287
10308
  };
10288
10309
  //#endregion
10289
10310
  //#region src/templates/oxc/index.ts
10290
- const web = "apps/web";
10291
10311
  const root = "";
10292
10312
  const oxc = {
10293
10313
  templates: [oxlintrc_default, oxfmtrc_default],
@@ -10303,21 +10323,11 @@ const oxc = {
10303
10323
  dev: true
10304
10324
  }],
10305
10325
  scripts: [
10306
- {
10307
- module: web,
10308
- name: "typecheck",
10309
- script: "next typegen && tsc --noEmit"
10310
- },
10311
10326
  {
10312
10327
  module: root,
10313
10328
  name: "lint",
10314
10329
  script: "oxlint --fix"
10315
10330
  },
10316
- {
10317
- module: root,
10318
- name: "typecheck",
10319
- script: "turbo run typecheck"
10320
- },
10321
10331
  {
10322
10332
  module: root,
10323
10333
  name: "lint:check",
@@ -10522,7 +10532,9 @@ const typescriptConfig = { templates: [
10522
10532
  "$schema": "https://json.schemastore.org/tsconfig",
10523
10533
  "extends": "./base.json",
10524
10534
  "compilerOptions": {
10525
- "jsx": "react-jsx"
10535
+ "jsx": "react-jsx",
10536
+ "module": "ESNext",
10537
+ "moduleResolution": "Bundler"
10526
10538
  }
10527
10539
  }`
10528
10540
  }
@@ -10538,9 +10550,9 @@ const testingJest = {
10538
10550
  export default {
10539
10551
  moduleFileExtensions: ['js', 'json', 'ts'],
10540
10552
  rootDir: 'src',
10541
- testRegex: '.*\\.spec\\.ts$',
10553
+ testRegex: '.*\\\\.spec\\\\.ts$',
10542
10554
  transform: {
10543
- '^.+\\.(t|j)s$': 'ts-jest',
10555
+ '^.+\\\\.(t|j)s$': 'ts-jest',
10544
10556
  },
10545
10557
  collectCoverageFrom: ['**/*.(t|j)s'],
10546
10558
  coverageDirectory: '../coverage',
@@ -10932,10 +10944,17 @@ export default nextConfig;`
10932
10944
  "env": ["API_HOST", "DATABASE_URL"],
10933
10945
  "outputs": [".next/**", "!.next/cache/**"]
10934
10946
  },
10947
+ "typecheck": {
10948
+ "dependsOn": ["^build"]
10949
+ },<% if (linter !== "oxc") { %>
10935
10950
  "lint": {
10936
10951
  "dependsOn": ["^lint"],
10937
10952
  "env": ["NODE_ENV"]
10938
10953
  },
10954
+ "lint:check": {
10955
+ "dependsOn": ["^lint:check"],
10956
+ "env": ["NODE_ENV"]
10957
+ },<% } %>
10939
10958
  "test": {
10940
10959
  "dependsOn": ["^build"],
10941
10960
  "outputs": ["coverage/**"]
@@ -11022,7 +11041,7 @@ dotenv.config({ path: resolve(process.cwd(), '.env') });
11022
11041
  import { NestFactory } from '@nestjs/core';
11023
11042
  import { AppModule } from '@<%= projectName %>/api';
11024
11043
  import next from 'next';
11025
- import { createServer } from 'node:http';
11044
+ import { createServer, type IncomingMessage, type ServerResponse } from 'node:http';
11026
11045
 
11027
11046
  const dev = process.env.NODE_ENV !== 'production';
11028
11047
  const port = parseInt(process.env.PORT ?? '3000', 10);
@@ -11040,7 +11059,7 @@ async function main() {
11040
11059
 
11041
11060
  const nestListener = nestApp
11042
11061
  .getHttpServer()
11043
- .listeners('request')[0] as (req: any, res: any) => void;
11062
+ .listeners('request')[0] as (req: IncomingMessage, res: ServerResponse) => void;
11044
11063
 
11045
11064
  const server = createServer((req, res) => {
11046
11065
  if (req.url?.startsWith('/api/')) {
@@ -11165,21 +11184,28 @@ export default nextConfig;`
11165
11184
  "ui": "tui",
11166
11185
  "tasks": {
11167
11186
  "build": {
11168
- "env": ["DATABASE_URL"],
11187
+ "env": ["DATABASE_URL", "PORT"],
11169
11188
  "dependsOn": ["^build"],
11170
11189
  "inputs": ["$TURBO_DEFAULT$", ".env*"],
11171
11190
  "outputs": [".next/**", "!.next/cache/**", "dist/**"]
11172
11191
  },
11192
+ "typecheck": {
11193
+ "dependsOn": ["^build"]
11194
+ },<% if (linter !== "oxc") { %>
11173
11195
  "lint": {
11174
11196
  "dependsOn": ["^lint"],
11175
11197
  "env": ["NODE_ENV"]
11176
11198
  },
11199
+ "lint:check": {
11200
+ "dependsOn": ["^lint:check"],
11201
+ "env": ["NODE_ENV"]
11202
+ },<% } %>
11177
11203
  "test": {
11178
11204
  "dependsOn": ["^build"],
11179
11205
  "outputs": ["coverage/**"]
11180
11206
  },
11181
11207
  "dev": {
11182
- "env": ["DATABASE_URL"],
11208
+ "env": ["DATABASE_URL", "PORT"],
11183
11209
  "dependsOn": ["^migrate", "^build"],
11184
11210
  "cache": false,
11185
11211
  "persistent": true
@@ -12590,9 +12616,9 @@ function selectModules(selection) {
12590
12616
  const { deployment, nestDiOnly: nestDiOnly$1, todoExample, shadcn, database, linter, testing, extras } = selection;
12591
12617
  const deploymentModule = deployment === "standalone" ? deploymentStandalone : deployment === "custom-server" ? singleProcessCustomServer : deployment === "spa" ? singleProcessStaticExport : null;
12592
12618
  const webModule = deployment === "spa" ? {
12593
- ...web$2,
12594
- templates: web$2.templates.filter((t) => t.filename !== "apps/web/app/api/auth/[...all]/route.ts")
12595
- } : web$2;
12619
+ ...web$1,
12620
+ templates: web$1.templates.filter((t) => t.filename !== "apps/web/app/api/auth/[...all]/route.ts")
12621
+ } : web$1;
12596
12622
  return [
12597
12623
  root$2,
12598
12624
  webModule,
@@ -12616,6 +12642,9 @@ function selectModules(selection) {
12616
12642
  }
12617
12643
  //#endregion
12618
12644
  //#region src/utils.ts
12645
+ function isMissingFile(cause) {
12646
+ return cause instanceof Error && "code" in cause && cause.code === "ENOENT";
12647
+ }
12619
12648
  async function updatePackageJson(destDir, packages, templateData) {
12620
12649
  for (const pkg of packages) {
12621
12650
  const renderedPackage = ejs.render(pkg.package, templateData);
@@ -12624,7 +12653,7 @@ async function updatePackageJson(destDir, packages, templateData) {
12624
12653
  try {
12625
12654
  packageJsonContent = await promises.readFile(packageJsonPath, "utf8");
12626
12655
  } catch (err) {
12627
- if (typeof err === "object" && err && err.code === "ENOENT") continue;
12656
+ if (isMissingFile(err)) continue;
12628
12657
  throw err;
12629
12658
  }
12630
12659
  const packageJson = JSON.parse(packageJsonContent);
@@ -12642,7 +12671,7 @@ async function updateScripts(destDir, scripts, templateData) {
12642
12671
  try {
12643
12672
  packageJsonContent = await promises.readFile(packageJsonPath, "utf8");
12644
12673
  } catch (err) {
12645
- if (typeof err === "object" && err && err.code === "ENOENT") continue;
12674
+ if (isMissingFile(err)) continue;
12646
12675
  throw err;
12647
12676
  }
12648
12677
  const packageJson = JSON.parse(packageJsonContent);
@@ -12938,18 +12967,18 @@ async function doInit(options) {
12938
12967
  git: options.git
12939
12968
  }, hasCommand)].find((result) => !result.valid);
12940
12969
  if (preflight) throw new Error(preflight.error);
12941
- const group = await p.group(groupOpts, { onCancel: () => {
12970
+ const answers = await p.group(groupOpts, { onCancel: () => {
12942
12971
  console.log("Exiting.");
12943
12972
  process.exit(0);
12944
12973
  } });
12945
- const useShadcn = options.nonInteractive ? options.shadcn : group.shadcn ?? true;
12946
- const testing = options.nonInteractive ? options.testing : group.testing ?? "jest";
12947
- const database = options.nonInteractive ? options.database : group.database ?? "sqlite";
12948
- const linter = options.nonInteractive ? options.linter : group.linter ?? "eslint";
12949
- const deployment = options.nonInteractive ? options.deployment : group.deployment ?? "none";
12950
- const nestDiOnly = options.nonInteractive ? options.nestDiOnly : group.nestDiOnly ?? false;
12951
- const todoExample = options.nonInteractive ? options.includeExample : group.todoExample ?? true;
12952
- const extras = options.nonInteractive ? options.extras : group.extras ?? [];
12974
+ const useShadcn = options.nonInteractive ? options.shadcn : answers.shadcn ?? true;
12975
+ const testing = options.nonInteractive ? options.testing : answers.testing ?? "jest";
12976
+ const database = options.nonInteractive ? options.database : answers.database ?? "sqlite";
12977
+ const linter = options.nonInteractive ? options.linter : answers.linter ?? "eslint";
12978
+ const deployment = options.nonInteractive ? options.deployment : answers.deployment ?? "none";
12979
+ const nestDiOnly = options.nonInteractive ? options.nestDiOnly : answers.nestDiOnly ?? false;
12980
+ const todoExample = options.nonInteractive ? options.includeExample : answers.todoExample ?? true;
12981
+ const extras = options.nonInteractive ? options.extras : answers.extras ?? [];
12953
12982
  const deploymentCombo = validateDeploymentCombo(deployment, nestDiOnly);
12954
12983
  if (!deploymentCombo.valid) throw new Error(deploymentCombo.error);
12955
12984
  const extrasCombo = validateExtrasCombo(extras, linter);
@@ -12965,7 +12994,7 @@ async function doInit(options) {
12965
12994
  extras
12966
12995
  };
12967
12996
  const allModules = selectModules(selection);
12968
- const name = group.name ?? options.name ?? "";
12997
+ const name = answers.name ?? options.name ?? "";
12969
12998
  const taskBuilder = new TaskBuilder();
12970
12999
  taskBuilder.add({
12971
13000
  title: "Scaffolding project",