create-newt-app 0.29.0 → 0.30.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.30.0";
14
14
  var engines = { "node": ">=24.0.0" };
15
15
  //#endregion
16
16
  //#region src/templates/root/index.ts
@@ -34,7 +34,10 @@ const root$2 = { templates: [
34
34
  "turbo": "<%= versions.turbo %>",
35
35
  "typescript": "<%= versions.typescript %>"
36
36
  },
37
- "packageManager": "pnpm@9.0.0",
37
+ "pnpm": {
38
+ "onlyBuiltDependencies": ["better-sqlite3", "esbuild", "sharp", "unrs-resolver"]
39
+ },
40
+ "packageManager": "pnpm@10.34.5",
38
41
  "engines": {
39
42
  "node": ">=24.0.0"
40
43
  }
@@ -115,6 +118,10 @@ dist
115
118
  },<% } else { %> "lint": {
116
119
  "dependsOn": ["^lint"],
117
120
  "env": ["NODE_ENV"]
121
+ },
122
+ "lint:check": {
123
+ "dependsOn": ["^lint:check"],
124
+ "env": ["NODE_ENV"]
118
125
  },<% } %>
119
126
  "test": {
120
127
  "dependsOn": ["^build"],
@@ -10200,7 +10207,7 @@ const eslintConfig = {
10200
10207
  {
10201
10208
  module: api,
10202
10209
  name: "lint:check",
10203
- script: `eslint "src/**/*.ts"`
10210
+ script: `eslint "src/**/*.ts" --max-warnings 0`
10204
10211
  },
10205
10212
  {
10206
10213
  module: ui,
@@ -10212,6 +10219,11 @@ const eslintConfig = {
10212
10219
  name: "lint:check",
10213
10220
  script: "eslint . --max-warnings 0"
10214
10221
  },
10222
+ {
10223
+ module: root$1,
10224
+ name: "lint:check",
10225
+ script: "turbo run lint:check"
10226
+ },
10215
10227
  {
10216
10228
  module: root$1,
10217
10229
  name: "format",
@@ -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,16 @@ export default nextConfig;`
10932
10944
  "env": ["API_HOST", "DATABASE_URL"],
10933
10945
  "outputs": [".next/**", "!.next/cache/**"]
10934
10946
  },
10935
- "lint": {
10947
+ <% if (linter === "oxc") { %> "typecheck": {
10948
+ "dependsOn": ["^build"]
10949
+ },<% } else { %> "lint": {
10936
10950
  "dependsOn": ["^lint"],
10937
10951
  "env": ["NODE_ENV"]
10938
10952
  },
10953
+ "lint:check": {
10954
+ "dependsOn": ["^lint:check"],
10955
+ "env": ["NODE_ENV"]
10956
+ },<% } %>
10939
10957
  "test": {
10940
10958
  "dependsOn": ["^build"],
10941
10959
  "outputs": ["coverage/**"]
@@ -11022,7 +11040,7 @@ dotenv.config({ path: resolve(process.cwd(), '.env') });
11022
11040
  import { NestFactory } from '@nestjs/core';
11023
11041
  import { AppModule } from '@<%= projectName %>/api';
11024
11042
  import next from 'next';
11025
- import { createServer } from 'node:http';
11043
+ import { createServer, type IncomingMessage, type ServerResponse } from 'node:http';
11026
11044
 
11027
11045
  const dev = process.env.NODE_ENV !== 'production';
11028
11046
  const port = parseInt(process.env.PORT ?? '3000', 10);
@@ -11040,7 +11058,7 @@ async function main() {
11040
11058
 
11041
11059
  const nestListener = nestApp
11042
11060
  .getHttpServer()
11043
- .listeners('request')[0] as (req: any, res: any) => void;
11061
+ .listeners('request')[0] as (req: IncomingMessage, res: ServerResponse) => void;
11044
11062
 
11045
11063
  const server = createServer((req, res) => {
11046
11064
  if (req.url?.startsWith('/api/')) {
@@ -11165,21 +11183,27 @@ export default nextConfig;`
11165
11183
  "ui": "tui",
11166
11184
  "tasks": {
11167
11185
  "build": {
11168
- "env": ["DATABASE_URL"],
11186
+ "env": ["DATABASE_URL", "PORT"],
11169
11187
  "dependsOn": ["^build"],
11170
11188
  "inputs": ["$TURBO_DEFAULT$", ".env*"],
11171
11189
  "outputs": [".next/**", "!.next/cache/**", "dist/**"]
11172
11190
  },
11173
- "lint": {
11191
+ <% if (linter === "oxc") { %> "typecheck": {
11192
+ "dependsOn": ["^build"]
11193
+ },<% } else { %> "lint": {
11174
11194
  "dependsOn": ["^lint"],
11175
11195
  "env": ["NODE_ENV"]
11176
11196
  },
11197
+ "lint:check": {
11198
+ "dependsOn": ["^lint:check"],
11199
+ "env": ["NODE_ENV"]
11200
+ },<% } %>
11177
11201
  "test": {
11178
11202
  "dependsOn": ["^build"],
11179
11203
  "outputs": ["coverage/**"]
11180
11204
  },
11181
11205
  "dev": {
11182
- "env": ["DATABASE_URL"],
11206
+ "env": ["DATABASE_URL", "PORT"],
11183
11207
  "dependsOn": ["^migrate", "^build"],
11184
11208
  "cache": false,
11185
11209
  "persistent": true
@@ -12616,6 +12640,9 @@ function selectModules(selection) {
12616
12640
  }
12617
12641
  //#endregion
12618
12642
  //#region src/utils.ts
12643
+ function isMissingFile(cause) {
12644
+ return cause instanceof Error && "code" in cause && cause.code === "ENOENT";
12645
+ }
12619
12646
  async function updatePackageJson(destDir, packages, templateData) {
12620
12647
  for (const pkg of packages) {
12621
12648
  const renderedPackage = ejs.render(pkg.package, templateData);
@@ -12624,7 +12651,7 @@ async function updatePackageJson(destDir, packages, templateData) {
12624
12651
  try {
12625
12652
  packageJsonContent = await promises.readFile(packageJsonPath, "utf8");
12626
12653
  } catch (err) {
12627
- if (typeof err === "object" && err && err.code === "ENOENT") continue;
12654
+ if (isMissingFile(err)) continue;
12628
12655
  throw err;
12629
12656
  }
12630
12657
  const packageJson = JSON.parse(packageJsonContent);
@@ -12642,7 +12669,7 @@ async function updateScripts(destDir, scripts, templateData) {
12642
12669
  try {
12643
12670
  packageJsonContent = await promises.readFile(packageJsonPath, "utf8");
12644
12671
  } catch (err) {
12645
- if (typeof err === "object" && err && err.code === "ENOENT") continue;
12672
+ if (isMissingFile(err)) continue;
12646
12673
  throw err;
12647
12674
  }
12648
12675
  const packageJson = JSON.parse(packageJsonContent);
@@ -12938,18 +12965,18 @@ async function doInit(options) {
12938
12965
  git: options.git
12939
12966
  }, hasCommand)].find((result) => !result.valid);
12940
12967
  if (preflight) throw new Error(preflight.error);
12941
- const group = await p.group(groupOpts, { onCancel: () => {
12968
+ const answers = await p.group(groupOpts, { onCancel: () => {
12942
12969
  console.log("Exiting.");
12943
12970
  process.exit(0);
12944
12971
  } });
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 ?? [];
12972
+ const useShadcn = options.nonInteractive ? options.shadcn : answers.shadcn ?? true;
12973
+ const testing = options.nonInteractive ? options.testing : answers.testing ?? "jest";
12974
+ const database = options.nonInteractive ? options.database : answers.database ?? "sqlite";
12975
+ const linter = options.nonInteractive ? options.linter : answers.linter ?? "eslint";
12976
+ const deployment = options.nonInteractive ? options.deployment : answers.deployment ?? "none";
12977
+ const nestDiOnly = options.nonInteractive ? options.nestDiOnly : answers.nestDiOnly ?? false;
12978
+ const todoExample = options.nonInteractive ? options.includeExample : answers.todoExample ?? true;
12979
+ const extras = options.nonInteractive ? options.extras : answers.extras ?? [];
12953
12980
  const deploymentCombo = validateDeploymentCombo(deployment, nestDiOnly);
12954
12981
  if (!deploymentCombo.valid) throw new Error(deploymentCombo.error);
12955
12982
  const extrasCombo = validateExtrasCombo(extras, linter);
@@ -12965,7 +12992,7 @@ async function doInit(options) {
12965
12992
  extras
12966
12993
  };
12967
12994
  const allModules = selectModules(selection);
12968
- const name = group.name ?? options.name ?? "";
12995
+ const name = answers.name ?? options.name ?? "";
12969
12996
  const taskBuilder = new TaskBuilder();
12970
12997
  taskBuilder.add({
12971
12998
  title: "Scaffolding project",