@koalarx/nest-cli 1.2.24 → 2.0.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/code-base/env/config.txt +0 -2
- package/code-base/startup-project/.eslintrc.js +12 -10
- package/code-base/startup-project/.vscode/launch.json +9 -24
- package/code-base/startup-project/Dockerfile +26 -5
- package/code-base/startup-project/package.json +6 -10
- package/code-base/startup-project/prisma/scripts/fix-extensions.mjs +4 -1
- package/code-base/startup-project/src/test/setup-e2e.ts +7 -2
- package/code-base/startup-project/tsconfig.json +1 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/code-base/startup-project/vitest.config.e2e.mts +0 -19
- package/code-base/startup-project/vitest.config.mts +0 -18
package/code-base/env/config.txt
CHANGED
|
@@ -3,18 +3,20 @@ module.exports = {
|
|
|
3
3
|
NodeJS: true,
|
|
4
4
|
},
|
|
5
5
|
extends: [
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
"@rocketseat/eslint-config/node",
|
|
7
|
+
"plugin:vitest-globals/recommended",
|
|
8
8
|
],
|
|
9
9
|
env: {
|
|
10
|
-
|
|
10
|
+
"vitest-globals/env": true,
|
|
11
11
|
},
|
|
12
|
-
ignorePatterns: [
|
|
12
|
+
ignorePatterns: ["*.json"],
|
|
13
13
|
rules: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
"no-unused-vars": "off",
|
|
15
|
+
"no-useless-constructor": "off",
|
|
16
|
+
"no-new": "off",
|
|
17
|
+
"no-use-before-define": "off",
|
|
18
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
19
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
20
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
19
21
|
},
|
|
20
|
-
}
|
|
22
|
+
};
|
|
@@ -6,36 +6,21 @@
|
|
|
6
6
|
"request": "launch",
|
|
7
7
|
"name": "Nest Debug (Bun)",
|
|
8
8
|
"runtimeExecutable": "bun",
|
|
9
|
-
"runtimeArgs": [
|
|
9
|
+
"runtimeArgs": [
|
|
10
|
+
"run",
|
|
11
|
+
"start:debug"
|
|
12
|
+
],
|
|
10
13
|
"console": "integratedTerminal",
|
|
11
14
|
"restart": true,
|
|
12
|
-
"protocol": "auto",
|
|
13
|
-
"port": 9229,
|
|
14
15
|
"autoAttachChildProcesses": true
|
|
15
16
|
},
|
|
16
17
|
{
|
|
17
|
-
"type": "
|
|
18
|
+
"type": "bun",
|
|
18
19
|
"request": "launch",
|
|
19
|
-
"name": "Debug
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"autoAttachChildProcesses": true,
|
|
24
|
-
"skipFiles": ["<node_internals>/**"],
|
|
25
|
-
"smartStep": true,
|
|
26
|
-
"console": "integratedTerminal"
|
|
20
|
+
"name": "Debug Bun File",
|
|
21
|
+
"program": "${file}", // This runs the currently active file
|
|
22
|
+
"cwd": "${workspaceFolder}",
|
|
23
|
+
"stopOnEntry": false // Set to true to pause on the first line
|
|
27
24
|
},
|
|
28
|
-
{
|
|
29
|
-
"type": "node",
|
|
30
|
-
"request": "launch",
|
|
31
|
-
"name": "Debug E2E Tests (Bun)",
|
|
32
|
-
"runtimeExecutable": "bun",
|
|
33
|
-
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
|
|
34
|
-
"args": ["run", "${relativeFile}", "--config", "./vitest.config.e2e.ts"],
|
|
35
|
-
"autoAttachChildProcesses": true,
|
|
36
|
-
"skipFiles": ["<node_internals>/**"],
|
|
37
|
-
"smartStep": true,
|
|
38
|
-
"console": "integratedTerminal"
|
|
39
|
-
}
|
|
40
25
|
]
|
|
41
26
|
}
|
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
ARG BUN_VERSION=
|
|
2
|
-
|
|
1
|
+
ARG BUN_VERSION=1.3.5-debian
|
|
2
|
+
|
|
3
|
+
# ====== STAGE 1: BUILDER ======
|
|
4
|
+
FROM oven/bun:${BUN_VERSION} AS builder
|
|
3
5
|
|
|
4
6
|
# Criando diretório de trabalho
|
|
5
7
|
WORKDIR /home/bun/app
|
|
6
8
|
|
|
7
9
|
# Copiando arquivos de configuração com permissões
|
|
8
|
-
COPY
|
|
10
|
+
COPY package.json bun.lock ./
|
|
9
11
|
|
|
10
12
|
# Instalando dependências
|
|
11
13
|
RUN bun install --frozen-lockfile
|
|
12
14
|
|
|
13
15
|
# Copiando o restante do código com permissões
|
|
14
|
-
COPY
|
|
16
|
+
COPY . .
|
|
17
|
+
|
|
18
|
+
ENV DATABASE_URL=" "
|
|
15
19
|
|
|
16
20
|
# Compilando o app
|
|
17
|
-
RUN bun run build
|
|
21
|
+
RUN bun run prisma:generate && bun run build
|
|
22
|
+
|
|
23
|
+
# ====== STAGE 2: RUNTIME ======
|
|
24
|
+
FROM oven/bun:${BUN_VERSION}
|
|
25
|
+
|
|
26
|
+
# Create a non-root user and group
|
|
27
|
+
RUN apt-get update -y && \
|
|
28
|
+
apt-get install -y openssl curl && \
|
|
29
|
+
apt-get clean
|
|
30
|
+
|
|
31
|
+
# Criando diretório de trabalho
|
|
32
|
+
WORKDIR /home/bun/app
|
|
33
|
+
|
|
34
|
+
# Copiando apenas os arquivos necessários do builder
|
|
35
|
+
COPY --from=builder --chown=bun:bun --chmod=555 /home/bun/app/node_modules ./node_modules
|
|
36
|
+
COPY --from=builder --chown=bun:bun --chmod=555 /home/bun/app/prisma ./prisma
|
|
37
|
+
COPY --from=builder --chown=bun:bun --chmod=555 /home/bun/app/dist ./dist
|
|
38
|
+
COPY --from=builder --chown=bun:bun --chmod=555 /home/bun/app/package.json ./package.json
|
|
18
39
|
|
|
19
40
|
# Alterando o usuário para "bun" por segurança
|
|
20
41
|
USER bun
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"start:debug": "nest start app --debug --watch",
|
|
14
14
|
"start:prod": "bun dist/host/main.js",
|
|
15
15
|
"lint": "prettier --end-of-line lf --write . && bunx eslint --fix src/**/* && bunx eslint --fix .eslintrc.js",
|
|
16
|
-
"test": "
|
|
17
|
-
"test:watch": "
|
|
18
|
-
"test:cov": "
|
|
19
|
-
"test:debug": "
|
|
20
|
-
"test:e2e": "
|
|
16
|
+
"test": "bun test src/**/*.spec.ts",
|
|
17
|
+
"test:watch": "bun test --watch src/**/*.spec.ts",
|
|
18
|
+
"test:cov": "bun test --coverage src/**/*.spec.ts",
|
|
19
|
+
"test:debug": "bun test --inspect-brk src/**/*.spec.ts",
|
|
20
|
+
"test:e2e": "bun test --preload ./src/test/setup-e2e.ts src/**/*.e2e-spec.ts",
|
|
21
21
|
"test:all": "bun run test && bun run test:e2e"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
@@ -61,7 +61,6 @@
|
|
|
61
61
|
"@types/supertest": "^6.0.2",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
63
63
|
"@typescript-eslint/parser": "^8.27.0",
|
|
64
|
-
"@vitest/coverage-v8": "^3.0.9",
|
|
65
64
|
"eslint": "^8.57.0",
|
|
66
65
|
"eslint-config-prettier": "^8.3.0",
|
|
67
66
|
"eslint-plugin-prettier": "^4.0.0",
|
|
@@ -71,10 +70,7 @@
|
|
|
71
70
|
"prisma": "^7.2.0",
|
|
72
71
|
"source-map-support": "^0.5.20",
|
|
73
72
|
"supertest": "^7.1.0",
|
|
74
|
-
"tsconfig-paths": "^4.2.0",
|
|
75
73
|
"typescript": "^5.1.3",
|
|
76
|
-
"unplugin-swc": "^1.5.1"
|
|
77
|
-
"vite-tsconfig-paths": "^5.1.4",
|
|
78
|
-
"vitest": "^3.0.9"
|
|
74
|
+
"unplugin-swc": "^1.5.1"
|
|
79
75
|
}
|
|
80
76
|
}
|
|
@@ -3,5 +3,10 @@ import { dropE2EDatabase } from '@koalarx/nest/test/utils/drop-e2e-database'
|
|
|
3
3
|
|
|
4
4
|
let schemaId: string
|
|
5
5
|
|
|
6
|
-
beforeAll(() =>
|
|
7
|
-
|
|
6
|
+
beforeAll(async () => {
|
|
7
|
+
schemaId = await createE2EDatabase('bun')
|
|
8
|
+
}, 60000)
|
|
9
|
+
|
|
10
|
+
afterAll(async () => {
|
|
11
|
+
await dropE2EDatabase(schemaId)
|
|
12
|
+
})
|
package/index.js
CHANGED
|
@@ -30635,7 +30635,7 @@ var import_chalk2 = __toESM(require_chalk(), 1);
|
|
|
30635
30635
|
// package.json
|
|
30636
30636
|
var package_default = {
|
|
30637
30637
|
name: "@koalarx/nest-cli",
|
|
30638
|
-
version: "
|
|
30638
|
+
version: "2.0.0",
|
|
30639
30639
|
description: "Biblioteca de CLI para criação de projetos utilizando Koala Nest",
|
|
30640
30640
|
scripts: {
|
|
30641
30641
|
test: "vitest run",
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import swc from "unplugin-swc";
|
|
2
|
-
import tsConfigPatchs from "vite-tsconfig-paths";
|
|
3
|
-
import { defineConfig } from "vitest/config";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
test: {
|
|
7
|
-
globals: true,
|
|
8
|
-
root: "./",
|
|
9
|
-
environment: "node",
|
|
10
|
-
include: ["**/*.e2e-spec.ts"],
|
|
11
|
-
setupFiles: ["./src/test/setup-e2e.ts"],
|
|
12
|
-
},
|
|
13
|
-
plugins: [
|
|
14
|
-
tsConfigPatchs(),
|
|
15
|
-
swc.vite({
|
|
16
|
-
module: { type: "es6" },
|
|
17
|
-
}),
|
|
18
|
-
],
|
|
19
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import swc from "unplugin-swc";
|
|
2
|
-
import tsConfigPatchs from "vite-tsconfig-paths";
|
|
3
|
-
import { defineConfig } from "vitest/config";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
test: {
|
|
7
|
-
globals: true,
|
|
8
|
-
root: "./",
|
|
9
|
-
environment: "node",
|
|
10
|
-
},
|
|
11
|
-
plugins: [
|
|
12
|
-
tsConfigPatchs(),
|
|
13
|
-
swc.vite({
|
|
14
|
-
module: { type: "es6" },
|
|
15
|
-
sourceMaps: true,
|
|
16
|
-
}),
|
|
17
|
-
],
|
|
18
|
-
});
|