@koalarx/nest-cli 1.0.3 → 1.0.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/code-base/startup-project/.swcrc +24 -0
- package/code-base/startup-project/.vscode/launch.json +42 -0
- package/code-base/startup-project/.vscode/settings.json +136 -0
- package/code-base/startup-project/.vscode/tasks.json +13 -0
- package/code-base/startup-project/Dockerfile +37 -0
- package/code-base/startup-project/nest-cli.json +12 -29
- package/code-base/startup-project/tsconfig.build.json +4 -0
- package/code-base/startup-project/tsconfig.json +11 -16
- package/code-base/startup-project/vitest.config.e2e.mts +1 -1
- package/code-base/startup-project/vitest.config.mts +8 -1
- package/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
+
"sourceMaps": true,
|
|
4
|
+
"module": {
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"strict": true
|
|
7
|
+
},
|
|
8
|
+
"inputSourceMap":true,
|
|
9
|
+
"jsc": {
|
|
10
|
+
"target": "es2022",
|
|
11
|
+
"parser": {
|
|
12
|
+
"syntax": "typescript",
|
|
13
|
+
"decorators": true,
|
|
14
|
+
"dynamicImport": true
|
|
15
|
+
},
|
|
16
|
+
"baseUrl": "./",
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": [
|
|
19
|
+
"src/*"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"minify": true
|
|
24
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use o IntelliSense para saber mais sobre os atributos possíveis.
|
|
3
|
+
// Focalizar para exibir as descrições dos atributos existentes.
|
|
4
|
+
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Nest Debug",
|
|
11
|
+
"runtimeExecutable": "npm",
|
|
12
|
+
"runtimeArgs": ["run", "start:debug", "--", "--inspect-brk"],
|
|
13
|
+
"console": "integratedTerminal",
|
|
14
|
+
"restart": true,
|
|
15
|
+
"protocol": "auto",
|
|
16
|
+
"port": 9229,
|
|
17
|
+
"autoAttachChildProcesses": true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "node",
|
|
21
|
+
"request": "launch",
|
|
22
|
+
"name": "Debug Unit Tests",
|
|
23
|
+
"autoAttachChildProcesses": true,
|
|
24
|
+
"skipFiles": ["<node_internals>/**"],
|
|
25
|
+
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
|
|
26
|
+
"args": ["run", "${relativeFile}"],
|
|
27
|
+
"smartStep": true,
|
|
28
|
+
"console": "integratedTerminal"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "node",
|
|
32
|
+
"request": "launch",
|
|
33
|
+
"name": "Debug E2E Tests",
|
|
34
|
+
"autoAttachChildProcesses": true,
|
|
35
|
+
"skipFiles": ["<node_internals>/**"],
|
|
36
|
+
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
|
|
37
|
+
"args": ["run", "${relativeFile}", "--config", "./vitest.config.e2e.ts"],
|
|
38
|
+
"smartStep": true,
|
|
39
|
+
"console": "integratedTerminal"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"vsicons.presets.angular": false,
|
|
3
|
+
"vsicons.presets.nestjs": true,
|
|
4
|
+
"material-icon-theme.activeIconPack": "nest",
|
|
5
|
+
"editor.fontFamily": "Fira Code",
|
|
6
|
+
"editor.fontSize": 15,
|
|
7
|
+
"editor.fontLigatures": true,
|
|
8
|
+
"emmet.syntaxProfiles": {
|
|
9
|
+
"javascript": "jsx"
|
|
10
|
+
},
|
|
11
|
+
"workbench.startupEditor": "newUntitledFile",
|
|
12
|
+
"javascript.suggest.autoImports": true,
|
|
13
|
+
"javascript.updateImportsOnFileMove.enabled": "always",
|
|
14
|
+
"editor.rulers": [80, 120],
|
|
15
|
+
"extensions.ignoreRecommendations": true,
|
|
16
|
+
"typescript.tsserver.log": "off",
|
|
17
|
+
"files.associations": {
|
|
18
|
+
".sequelizerc": "javascript",
|
|
19
|
+
".stylelintrc": "json",
|
|
20
|
+
"*.tsx": "typescriptreact",
|
|
21
|
+
".env.*": "dotenv",
|
|
22
|
+
".prettierrc": "json"
|
|
23
|
+
},
|
|
24
|
+
"editor.parameterHints.enabled": false,
|
|
25
|
+
"editor.renderLineHighlight": "gutter",
|
|
26
|
+
"editor.lineHeight": 26,
|
|
27
|
+
"editor.suggestSelection": "first",
|
|
28
|
+
"explorer.confirmDelete": false,
|
|
29
|
+
"gitlens.codeLens.recentChange.enabled": false,
|
|
30
|
+
"terminal.integrated.showExitAlert": false,
|
|
31
|
+
"[prisma]": {
|
|
32
|
+
"editor.formatOnSave": true
|
|
33
|
+
},
|
|
34
|
+
"typescript.suggest.autoImports": true,
|
|
35
|
+
"terminal.integrated.env.osx": {
|
|
36
|
+
"FIG_NEW_SESSION": "1"
|
|
37
|
+
},
|
|
38
|
+
"workbench.editor.labelFormat": "short",
|
|
39
|
+
"editor.acceptSuggestionOnCommitCharacter": false,
|
|
40
|
+
"explorer.compactFolders": false,
|
|
41
|
+
"git.enableSmartCommit": true,
|
|
42
|
+
"editor.accessibilitySupport": "off",
|
|
43
|
+
"explorer.confirmDragAndDrop": false,
|
|
44
|
+
"terminal.integrated.fontSize": 14,
|
|
45
|
+
"editor.semanticHighlighting.enabled": false,
|
|
46
|
+
"breadcrumbs.enabled": true,
|
|
47
|
+
"gitlens.codeLens.authors.enabled": false,
|
|
48
|
+
"editor.tabSize": 2,
|
|
49
|
+
"files.exclude": {
|
|
50
|
+
"**/CVS": true,
|
|
51
|
+
"**/.DS_Store": true,
|
|
52
|
+
"**/.hg": true,
|
|
53
|
+
"**/.svn": true,
|
|
54
|
+
"**/.git": true
|
|
55
|
+
},
|
|
56
|
+
"gitlens.codeLens.enabled": false,
|
|
57
|
+
"workbench.iconTheme": "material-icon-theme",
|
|
58
|
+
"material-icon-theme.languages.associations": {
|
|
59
|
+
"dotenv": "tune"
|
|
60
|
+
},
|
|
61
|
+
"material-icon-theme.files.associations": {
|
|
62
|
+
"vitest.config.e2e.ts": "vitest",
|
|
63
|
+
"*.e2e-spec.ts": "test-js",
|
|
64
|
+
"*.dto.ts": "diff",
|
|
65
|
+
"*.request.ts": "log",
|
|
66
|
+
"*.schema.ts": "scheme",
|
|
67
|
+
"*.response.ts": "commitlint"
|
|
68
|
+
},
|
|
69
|
+
"material-icon-theme.folders.associations": {
|
|
70
|
+
"adapters": "contract",
|
|
71
|
+
"grpc": "pipe",
|
|
72
|
+
"kube": "kubernetes",
|
|
73
|
+
"main": "lib",
|
|
74
|
+
"websockets": "pipe",
|
|
75
|
+
"implementations": "core",
|
|
76
|
+
"protos": "pipe",
|
|
77
|
+
"entities": "class",
|
|
78
|
+
"kafka": "pipe",
|
|
79
|
+
"use-cases": "functions",
|
|
80
|
+
"migrations": "tools",
|
|
81
|
+
"schemas": "class",
|
|
82
|
+
"useCases": "functions",
|
|
83
|
+
"eslint-config": "tools",
|
|
84
|
+
"typeorm": "database",
|
|
85
|
+
"_shared": "shared",
|
|
86
|
+
"mappers": "meta",
|
|
87
|
+
"fakes": "mock",
|
|
88
|
+
"modules": "components",
|
|
89
|
+
"subscribers": "messages",
|
|
90
|
+
"domain": "class",
|
|
91
|
+
"protocols": "contract",
|
|
92
|
+
"infra": "app",
|
|
93
|
+
"view-models": "views",
|
|
94
|
+
"presentation": "template",
|
|
95
|
+
"dtos": "typescript",
|
|
96
|
+
"http": "container",
|
|
97
|
+
"providers": "include",
|
|
98
|
+
"factories": "class",
|
|
99
|
+
"repositories": "mappings",
|
|
100
|
+
"filters": "pipe"
|
|
101
|
+
},
|
|
102
|
+
"symbols.folders.associations": {
|
|
103
|
+
"data": "folder-database",
|
|
104
|
+
"auth": "folder-purple",
|
|
105
|
+
"common": "folder-green",
|
|
106
|
+
"controllers": "folder-yellow",
|
|
107
|
+
"decorators": "folder-yellow",
|
|
108
|
+
"repositories": "folder-yellow",
|
|
109
|
+
"services": "folder-yellow",
|
|
110
|
+
"filters": "folder-blue",
|
|
111
|
+
"guards": "folder-orange",
|
|
112
|
+
"test": "folder-context"
|
|
113
|
+
},
|
|
114
|
+
"symbols.files.associations": {
|
|
115
|
+
"*.module.ts": "nest",
|
|
116
|
+
"*.controller.ts": "nest",
|
|
117
|
+
"*.guard.ts": "nest",
|
|
118
|
+
"*.spec.ts": "ts-test",
|
|
119
|
+
"*.e2e-spec.ts": "ts-test",
|
|
120
|
+
"vitest.config.e2e.ts": "vite",
|
|
121
|
+
".env.example": "gear"
|
|
122
|
+
},
|
|
123
|
+
"editor.codeActionsOnSave": {
|
|
124
|
+
"source.fixAll.eslint": "explicit"
|
|
125
|
+
},
|
|
126
|
+
"terminal.integrated.defaultProfile.windows": "Command Prompt",
|
|
127
|
+
"git.confirmSync": false,
|
|
128
|
+
"files.eol": "\n",
|
|
129
|
+
"workbench.productIconTheme": "Default",
|
|
130
|
+
"npm.scriptExplorerAction": "run",
|
|
131
|
+
"npm.packageManager": "npm",
|
|
132
|
+
"editor.wordWrap": "on",
|
|
133
|
+
"editor.wrappingIndent": "indent",
|
|
134
|
+
"a-file-icon-vscode.activeIconPacks": ["nest"],
|
|
135
|
+
"a-file-icon-vscode.arrowTheme": "plusMinus"
|
|
136
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
FROM node:20.18.0 AS builder
|
|
2
|
+
|
|
3
|
+
# Criando diretório de trabalho
|
|
4
|
+
WORKDIR /home/node/app
|
|
5
|
+
|
|
6
|
+
# Copiando arquivos de configuração
|
|
7
|
+
COPY package.json ./
|
|
8
|
+
COPY package-lock.json ./
|
|
9
|
+
COPY prisma ./prisma/
|
|
10
|
+
|
|
11
|
+
# Instalando dependências
|
|
12
|
+
RUN npm ci --force
|
|
13
|
+
|
|
14
|
+
# Copiando arquivos do app
|
|
15
|
+
COPY . .
|
|
16
|
+
|
|
17
|
+
# Compilando app
|
|
18
|
+
RUN npm run build
|
|
19
|
+
|
|
20
|
+
FROM node:20.18.0
|
|
21
|
+
|
|
22
|
+
# Criando diretório de trabalho
|
|
23
|
+
WORKDIR /home/node/app
|
|
24
|
+
|
|
25
|
+
COPY --chown=node:node --from=builder /home/node/app/node_modules ./node_modules
|
|
26
|
+
COPY --chown=node:node --from=builder /home/node/app/package.json ./dist/package.json
|
|
27
|
+
COPY --chown=node:node --from=builder /home/node/app/package*.json ./
|
|
28
|
+
COPY --chown=node:node --from=builder /home/node/app/dist ./dist
|
|
29
|
+
COPY --chown=node:node --from=builder /home/node/app/prisma ./prisma
|
|
30
|
+
|
|
31
|
+
ENV NODE_ENV production
|
|
32
|
+
|
|
33
|
+
USER node
|
|
34
|
+
|
|
35
|
+
EXPOSE 3000
|
|
36
|
+
|
|
37
|
+
CMD npx prisma migrate deploy && npm run start:prod
|
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
3
|
"collection": "@nestjs/schematics",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"entryFile": "infra/main",
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"builder": "swc",
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "@nestjs/swagger",
|
|
11
|
+
"options": {
|
|
12
|
+
"classValidatorShim": false,
|
|
13
|
+
"introspectComments": true
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
"example": {
|
|
16
|
-
"type": "application",
|
|
17
|
-
"root": "apps/example",
|
|
18
|
-
"entryFile": "example/src/infra/main",
|
|
19
|
-
"sourceRoot": "apps/example/src",
|
|
20
|
-
"compilerOptions": {
|
|
21
|
-
"deleteOutDir": true,
|
|
22
|
-
"tsConfigPath": "apps/example/tsconfig.app.json",
|
|
23
|
-
"plugins": [
|
|
24
|
-
{
|
|
25
|
-
"name": "@nestjs/swagger",
|
|
26
|
-
"options": {
|
|
27
|
-
"classValidatorShim": false,
|
|
28
|
-
"introspectComments": true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
}
|
|
16
|
+
]
|
|
34
17
|
}
|
|
35
18
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
4
|
-
"
|
|
5
|
-
"baseUrl": "./",
|
|
6
|
-
"types": ["vitest/globals"],
|
|
7
|
-
"paths": {
|
|
8
|
-
"@/*": ["./apps/example/src/*"],
|
|
9
|
-
"@koalarx/nest/*": ["./apps/koala-nest/src/*"]
|
|
10
|
-
},
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"declaration": true,
|
|
11
5
|
"removeComments": true,
|
|
12
6
|
"emitDecoratorMetadata": true,
|
|
13
7
|
"experimentalDecorators": true,
|
|
14
8
|
"allowSyntheticDefaultImports": true,
|
|
15
9
|
"target": "es2022",
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": ["./src/*"]
|
|
15
|
+
},
|
|
16
16
|
"incremental": true,
|
|
17
17
|
"skipLibCheck": true,
|
|
18
18
|
"strictNullChecks": true,
|
|
@@ -20,12 +20,7 @@
|
|
|
20
20
|
"strictBindCallApply": false,
|
|
21
21
|
"forceConsistentCasingInFileNames": false,
|
|
22
22
|
"noFallthroughCasesInSwitch": false,
|
|
23
|
-
"resolveJsonModule": true
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"node_modules",
|
|
27
|
-
"dist",
|
|
28
|
-
"vitest.config.e2e.mts",
|
|
29
|
-
"vitest.config.mts"
|
|
30
|
-
]
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
"types": ["vitest/globals"]
|
|
25
|
+
}
|
|
31
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import swc from "unplugin-swc";
|
|
1
2
|
import tsConfigPatchs from 'vite-tsconfig-paths'
|
|
2
3
|
import { defineConfig } from 'vitest/config'
|
|
3
4
|
|
|
@@ -6,5 +7,11 @@ export default defineConfig({
|
|
|
6
7
|
globals: true,
|
|
7
8
|
root: './'
|
|
8
9
|
},
|
|
9
|
-
plugins: [
|
|
10
|
+
plugins: [
|
|
11
|
+
tsConfigPatchs(),
|
|
12
|
+
swc.vite({
|
|
13
|
+
module: { type: "es6" },
|
|
14
|
+
sourceMaps: true,
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
10
17
|
})
|
package/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var import_inquirer = __toESM(require("inquirer"));
|
|
|
30
30
|
// package.json
|
|
31
31
|
var package_default = {
|
|
32
32
|
name: "@koalarx/nest-cli",
|
|
33
|
-
version: "1.0.
|
|
33
|
+
version: "1.0.5",
|
|
34
34
|
description: "Biblioteca de CLI para cria\xE7\xE3o de projetos utilizando Koala Nest",
|
|
35
35
|
scripts: {
|
|
36
36
|
test: "vitest run",
|