@nest-arch/tui 0.2.2 → 0.2.4

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.
@@ -0,0 +1,10 @@
1
+ [install]
2
+ trusted = [
3
+ "@nestjs/core"{{#if swagger}},
4
+ "@scarf/scarf"{{/if}}{{#if hasGraphql}},
5
+ "@apollo/protobufjs"{{/if}}{{#if usePrisma}},
6
+ "prisma",
7
+ "@prisma/engines"{{/if}}{{#if (and (eq auth "passport") hasDatabase)}},
8
+ "bcrypt"{{/if}}{{#if hasSqlite}},
9
+ "better-sqlite3"{{/if}},
10
+ ]
@@ -1,11 +1,12 @@
1
1
  import { INestApplication } from "@nestjs/common";
2
2
  import { Test, TestingModule } from "@nestjs/testing";
3
3
  import request from "supertest";
4
+ import type { App } from "supertest/types";
4
5
 
5
6
  import { AppModule } from "./../src/app.module.js";
6
7
 
7
8
  describe("AppController (e2e)", () => {
8
- let app: INestApplication;
9
+ let app: INestApplication<App>;
9
10
 
10
11
  beforeEach(async () => {
11
12
  const moduleFixture: TestingModule = await Test.createTestingModule({
@@ -19,4 +20,8 @@ describe("AppController (e2e)", () => {
19
20
  it("/ (GET)", () => {
20
21
  return request(app.getHttpServer()).get("/").expect(200).expect("Hello World!");
21
22
  });
23
+
24
+ afterEach(async () => {
25
+ await app.close();
26
+ });
22
27
  });
@@ -11,12 +11,12 @@
11
11
  "emitDecoratorMetadata": true,
12
12
  "experimentalDecorators": true,
13
13
  "allowSyntheticDefaultImports": true,
14
- "target": "ES2022",
14
+ "target": "ES2023",
15
15
  "sourceMap": true,
16
16
  "outDir": "./dist",
17
17
  "incremental": true,
18
18
  "skipLibCheck": true,
19
- "strict": false,
19
+ "strict": true,
20
20
  "strictPropertyInitialization": false,
21
21
  "types": [
22
22
  "vitest/globals",
@@ -1,9 +1,11 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import tsconfigPaths from "vite-tsconfig-paths";
2
3
 
3
4
  export default defineConfig({
5
+ plugins: [tsconfigPaths()],
4
6
  test: {
5
7
  globals: true,
6
- include: ["**/*.e2e-spec.ts"],
7
8
  root: "./",
9
+ include: ["**/*.e2e-spec.ts"],
8
10
  },
9
11
  });
@@ -1,9 +1,11 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import tsconfigPaths from "vite-tsconfig-paths";
2
3
 
3
4
  export default defineConfig({
5
+ plugins: [tsconfigPaths()],
4
6
  test: {
5
7
  globals: true,
6
- include: ["**/*.spec.ts"],
7
8
  root: "./",
9
+ include: ["**/*.spec.ts"],
8
10
  },
9
11
  });
@@ -8,6 +8,7 @@
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "build": "nest build",
11
+ "deploy": "nest deploy",
11
12
  "dev": "nest start --watch",
12
13
  "start": "nest start",
13
14
  "start:dev": "nest start --watch",
@@ -33,6 +34,7 @@
33
34
  },
34
35
  "devDependencies": {
35
36
  "@nestjs/cli": "next",
37
+ "@nestjs/mau": "^0.2.6",
36
38
  "@nestjs/schematics": "next",
37
39
  "@nestjs/testing": "next",
38
40
  "@repo/config": "workspace:*",
@@ -43,6 +45,7 @@
43
45
  "source-map-support": "^0.5.21",
44
46
  "supertest": "^7.0.0",
45
47
  "typescript": "catalog:",
48
+ "vite-tsconfig-paths": "^5.1.4",
46
49
  {{#if hasUltracite}}"ultracite": "7.8.0",{{/if}}
47
50
  "vitest": "^4.1.2"
48
51
  }
@@ -1,11 +1,12 @@
1
1
  import { INestApplication } from "@nestjs/common";
2
2
  import { Test, TestingModule } from "@nestjs/testing";
3
3
  import request from "supertest";
4
+ import type { App } from "supertest/types";
4
5
 
5
6
  import { AppModule } from "./../src/app.module.js";
6
7
 
7
8
  describe("AppController (e2e)", () => {
8
- let app: INestApplication;
9
+ let app: INestApplication<App>;
9
10
 
10
11
  beforeEach(async () => {
11
12
  const moduleFixture: TestingModule = await Test.createTestingModule({
@@ -19,4 +20,8 @@ describe("AppController (e2e)", () => {
19
20
  it("/ (GET)", () => {
20
21
  return request(app.getHttpServer()).get("/").expect(200).expect("Hello World!");
21
22
  });
23
+
24
+ afterEach(async () => {
25
+ await app.close();
26
+ });
22
27
  });
@@ -1,9 +1,11 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import tsconfigPaths from "vite-tsconfig-paths";
2
3
 
3
4
  export default defineConfig({
5
+ plugins: [tsconfigPaths()],
4
6
  test: {
5
7
  globals: true,
6
- include: ["**/*.e2e-spec.ts"],
7
8
  root: "./",
9
+ include: ["**/*.e2e-spec.ts"],
8
10
  },
9
11
  });
@@ -1,9 +1,11 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import tsconfigPaths from "vite-tsconfig-paths";
2
3
 
3
4
  export default defineConfig({
5
+ plugins: [tsconfigPaths()],
4
6
  test: {
5
7
  globals: true,
6
- include: ["**/*.spec.ts"],
7
8
  root: "./",
9
+ include: ["**/*.spec.ts"],
8
10
  },
9
11
  });
@@ -0,0 +1,9 @@
1
+ [install]
2
+ trusted = [
3
+ "@nestjs/core",
4
+ "esbuild"{{#if swagger}},
5
+ "@scarf/scarf"{{/if}}{{#if hasGraphql}},
6
+ "@apollo/protobufjs"{{/if}}{{#if (and (eq auth "passport") hasDatabase)}},
7
+ "bcrypt"{{/if}}{{#if hasSqlite}},
8
+ "better-sqlite3"{{/if}},
9
+ ]
@@ -8,6 +8,7 @@
8
8
  "type": "module",
9
9
  "scripts": {
10
10
  "build": "nest build",
11
+ "deploy": "nest deploy",
11
12
  "dev": "nest start --watch",
12
13
  "start": "nest start",
13
14
  "start:dev": "nest start --watch",
@@ -34,16 +35,18 @@
34
35
  },
35
36
  "devDependencies": {
36
37
  "@nestjs/cli": "next",
38
+ "@nestjs/mau": "^0.2.6",
37
39
  "@nestjs/schematics": "next",
38
40
  "@nestjs/testing": "next",
39
41
  "@types/express": "^5.0.0",
40
- "@types/node": "^22.13.14",
42
+ "@types/node": "^24.0.0",
41
43
  "@types/supertest": "^7.0.0",
42
44
  "@vitest/coverage-v8": "4.1.6",
43
45
  {{#if hasHusky}}"husky": "^9.1.7",{{/if}}
44
46
  "source-map-support": "^0.5.21",
45
47
  "supertest": "^7.0.0",
46
48
  "typescript": "^6.0.2",
49
+ "vite-tsconfig-paths": "^5.1.4",
47
50
  "vitest": "^4.1.2"
48
51
  }
49
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-arch/tui",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "description": "Interactive terminal UI for generating NestJS projects",
6
6
  "keywords": [
@@ -48,9 +48,9 @@
48
48
  "pkgroll": "^2.5.2",
49
49
  "tsx": "^4.19.2",
50
50
  "vitest": "^4.1.7",
51
- "@nest-arch/core": "0.2.2",
52
- "@nest-arch/shared": "0.0.0",
53
- "@nest-arch/env": "0.0.0"
51
+ "@nest-arch/core": "0.2.4",
52
+ "@nest-arch/env": "0.0.0",
53
+ "@nest-arch/shared": "0.0.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "typescript": "^5"
@@ -1 +0,0 @@
1
- const O="Nest Arch",A="v0.2.2",t="The comfy way to build NestJS projects",o="#e54545",R="#A0A0A0",c="#6B6B6B",s="#E5E5E5",C="#61AFEF",E="#3A3A3A",_="#7FD99A",n="#E8C468",L="#e96142ff";export{O as APP_NAME,t as APP_TAGLINE,A as APP_VERSION,C as COLOR_ACCENT,R as COLOR_DIM,c as COLOR_DIMMER,E as COLOR_DIVIDER,s as COLOR_FG,o as COLOR_RED,_ as COLOR_SUCCESS,n as COLOR_WARM,L as COLOR_WARM_SECONDARY};
@@ -1,21 +0,0 @@
1
- // This script is needed because nestjs-trpc doesn't have support for NestJS 12 yet.
2
- // Awaiting PR approval to support the new ESM support.
3
- import { readFileSync, writeFileSync } from "node:fs";
4
- import path from "node:path";
5
-
6
- const generatedFile = path.join(
7
- import.meta.dirname,
8
- "..",
9
- "@generated",
10
- "server.ts"
11
- );
12
-
13
- let content = readFileSync(generatedFile, "utf-8");
14
-
15
- content = content.replaceAll(
16
- /(?<ext>\.router)(?<quote>")/gu,
17
- "$<ext>.js$<quote>"
18
- );
19
-
20
- writeFileSync(generatedFile, content, "utf-8");
21
- console.log("Fixed trpc generated file:", generatedFile);
@@ -1,91 +0,0 @@
1
- // This script is needed because nestjs-trpc doesn't have support for NestJS 12 yet.
2
- // Awaiting PR approval to support the new ESM support.
3
- import { spawn } from "node:child_process";
4
- import { watchFile, readFileSync, writeFileSync } from "node:fs";
5
- import path from "node:path";
6
-
7
- const generatedFile = path.join(
8
- import.meta.dirname,
9
- "..",
10
- "@generated",
11
- "server.ts"
12
- );
13
- const REGEX_REPLACE = /(?<ext>\.router)(?<quote>")/gu;
14
-
15
- function fixGeneratedFile() {
16
- try {
17
- let content = readFileSync(generatedFile, "utf-8");
18
- const original = content;
19
- content = content.replaceAll(REGEX_REPLACE, "$<ext>.js$<quote>");
20
- if (content !== original) {
21
- writeFileSync(generatedFile, content, "utf-8");
22
- console.log("Fixed trpc generated file:", generatedFile);
23
- }
24
- } catch {
25
- // file might not exist yet
26
- }
27
- }
28
-
29
- // Run generate + fix upfront
30
- const projectRoot = path.join(import.meta.dirname, "..", "..", "..", "..");
31
- const SHELL = process.platform === "win32" ? "powershell.exe" : true;
32
- {{#if isMonorepo}}
33
- const genCmd =
34
- "pnpm exec nestjs-trpc generate -e src/app.module.ts -o ../../packages/api/src/trpc/@generated";
35
- {{else}}
36
- const genCmd =
37
- "pnpm exec nestjs-trpc generate -e src/app.module.ts -o src/libs/trpc/@generated";
38
- {{/if}}
39
-
40
- const spawnOpts = {
41
- cwd: projectRoot,
42
- shell: SHELL,
43
- stdio: "inherit",
44
- };
45
-
46
- const gen = spawn(genCmd, [], spawnOpts);
47
-
48
- gen.on("close", (code) => {
49
- if (code !== 0) {
50
- process.exit(code);
51
- }
52
- fixGeneratedFile();
53
-
54
- // Watch generated file for changes and re-apply fix
55
- watchFile(generatedFile, { interval: 500 }, () => {
56
- fixGeneratedFile();
57
- });
58
-
59
- // Start watch mode
60
- {{#if isMonorepo}}
61
- const watch = spawn(
62
- "pnpm",
63
- [
64
- "exec",
65
- "nestjs-trpc",
66
- "watch",
67
- "-e",
68
- "src/app.module.ts",
69
- "-o",
70
- " ../../packages/api/src/trpc/@generated",
71
- ],
72
- spawnOpts
73
- );
74
- {{else}}
75
- const watch = spawn(
76
- "pnpm",
77
- [
78
- "exec",
79
- "nestjs-trpc",
80
- "watch",
81
- "-e",
82
- "src/app.module.ts",
83
- "-o",
84
- "src/libs/trpc/@generated",
85
- ],
86
- spawnOpts
87
- );
88
- {{/if}}
89
-
90
- watch.on("close", (exitCode) => process.exit(exitCode ?? 0));
91
- });