Skip to content

Commit 2135dbd

Browse files
committed
init
1 parent b057e75 commit 2135dbd

33 files changed

+710
-0
lines changed

.dockerignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.git
2+
.github
3+
.vscode
4+
coverage
5+
docker-compose.yml
6+
reports
7+
README.md
8+
9+
# Node Files #
10+
node_modules
11+
npm-debug.log
12+
npm-debug.log.*

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = false
9+
insert_final_newline = false

.eslintrc.cjs

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es2021: true,
6+
},
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
project: './tsconfig.json',
10+
ecmaVersion: 'latest',
11+
sourceType: 'module',
12+
},
13+
settings: {
14+
'import/parsers': {
15+
'@typescript-eslint/parser': ['.ts'],
16+
},
17+
'import/resolver': {
18+
node: {
19+
project: './tsconfig.json',
20+
paths: ['@modules', '@common', '@config', '@migrations'],
21+
extensions: ['.js', '.ts'],
22+
},
23+
typescript: {
24+
project: './tsconfig.json',
25+
alwaysTryTypes: true,
26+
},
27+
alias: {
28+
map: [
29+
['@modules', './src/modules'],
30+
['@common', './src/common'],
31+
['@config', './src/config'],
32+
['@migrations', './src/migrations'],
33+
],
34+
extensions: ['.ts', '.js'],
35+
},
36+
},
37+
'import/ignore': ['node_modules'],
38+
},
39+
plugins: [
40+
'@typescript-eslint',
41+
'@trilon/eslint-plugin',
42+
'import',
43+
'nestjs',
44+
'eslint-plugin-import-helpers',
45+
'prettier',
46+
],
47+
extends: [
48+
'plugin:@typescript-eslint/strict-type-checked',
49+
'plugin:@typescript-eslint/stylistic-type-checked',
50+
'plugin:@trilon/recommended',
51+
'plugin:sonarjs/recommended',
52+
'plugin:import/recommended',
53+
'plugin:import/typescript',
54+
'plugin:unicorn/recommended',
55+
'plugin:nestjs/recommended',
56+
'plugin:eslint-comments/recommended',
57+
'prettier',
58+
],
59+
overrides: [
60+
{
61+
files: ['*.spec.ts', '*.mock.ts'],
62+
extends: ['plugin:vitest/recommended'],
63+
rules: {
64+
'sonarjs/no-duplicate-string': 'off',
65+
},
66+
},
67+
],
68+
ignorePatterns: [
69+
'**/node_modules/**',
70+
'**/dist/**',
71+
'README.md',
72+
'.eslintrc.cjs',
73+
],
74+
rules: {
75+
'prettier/prettier': 'warn',
76+
'prefer-const': 'warn',
77+
'@typescript-eslint/no-unused-vars': [
78+
'error',
79+
{ ignoreRestSiblings: true, argsIgnorePattern: '^_' },
80+
],
81+
'@typescript-eslint/interface-name-prefix': 'off',
82+
'@typescript-eslint/explicit-function-return-type': 'off',
83+
'@typescript-eslint/explicit-module-boundary-types': 'off',
84+
'@typescript-eslint/no-extraneous-class': 'off',
85+
'@typescript-eslint/no-empty-function': 'off',
86+
'@typescript-eslint/no-floating-promises': 'off',
87+
'@typescript-eslint/no-non-null-assertion': 'off',
88+
'@typescript-eslint/no-unsafe-argument': 'off',
89+
'@typescript-eslint/no-unsafe-assignment': 'off',
90+
'@typescript-eslint/no-unsafe-member-access': 'off',
91+
'@typescript-eslint/restrict-template-expressions': [
92+
'error',
93+
{
94+
allowNumber: true,
95+
},
96+
],
97+
'@typescript-eslint/no-unnecessary-type-assertion': [
98+
'error',
99+
{
100+
typesToIgnore: ['const'],
101+
},
102+
],
103+
'@trilon/detect-circular-reference': 'off',
104+
'nestjs/use-validation-pipe': 'off',
105+
'import/order': [
106+
'warn',
107+
{
108+
'newlines-between': 'always',
109+
},
110+
],
111+
'import/no-cycle': 'warn',
112+
'unicorn/no-array-reduce': 'off',
113+
'unicorn/no-null': 'off',
114+
'unicorn/no-array-callback-reference': 'off',
115+
'unicorn/prefer-top-level-await': 'off',
116+
'unicorn/no-useless-undefined': 'off',
117+
'unicorn/throw-new-error': 'off',
118+
'unicorn/prevent-abbreviations': [
119+
'error',
120+
{
121+
replacements: {
122+
e: false,
123+
},
124+
allowList: {
125+
param: true,
126+
params: true,
127+
ref: true,
128+
Ref: true,
129+
Param: true,
130+
Params: true,
131+
args: true,
132+
env: true,
133+
doc: true,
134+
},
135+
},
136+
],
137+
},
138+
}

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
/.pnp.* binary linguist-generated

.gitignore

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# compiled output
2+
3+
/node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Package manager
15+
.yarn/*
16+
!.yarn/cache
17+
!.yarn/patches
18+
!.yarn/plugins
19+
!.yarn/releases
20+
!.yarn/sdks
21+
!.yarn/versions
22+
23+
24+
# OS
25+
.DS_Store
26+
27+
# Tests
28+
/coverage
29+
/reports
30+
/.nyc_output
31+
32+
# Cache
33+
.eslintcache
34+
35+
# IDEs and editors
36+
/.idea
37+
.project
38+
.classpath
39+
.c9/
40+
*.launch
41+
.settings/
42+
*.sublime-workspace
43+
44+
# IDE - VSCode
45+
.vscode/*
46+
!.vscode/settings.json
47+
!.vscode/tasks.json
48+
!.vscode/launch.json
49+
!.vscode/extensions.json
50+
# stryker temp files
51+
.stryker-tmp
52+
53+
# Environment
54+
.env
55+
56+
# Build
57+
/dist

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
bun run commitlint --edit $1

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
bun run lint-staged

.lintstagedrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,ts}": "eslint --cache --fix"
3+
}

.markdownlint.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"MD024": {
3+
"siblings_only": true
4+
}
5+
}

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.16.0

.prettierignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Node Files
2+
node_modules
3+
npm-debug.log
4+
npm-debug.log.*
5+
6+
# Build Files
7+
/build
8+
/public/build
9+
/dist
10+
/reports
11+
12+
# Enviroment Files
13+
.env

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": false,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"trailingComma": "es5",
7+
"arrowParens": "avoid",
8+
"printWidth": 80
9+
}

.swcrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://json.schemastore.org/swcrc",
3+
"sourceMaps": true,
4+
"jsc": {
5+
"parser": {
6+
"syntax": "typescript",
7+
"decorators": true,
8+
"dynamicImport": true
9+
},
10+
"target": "es2022",
11+
"baseUrl": "./"
12+
},
13+
"minify": false
14+
}

.vscode/settings.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.formatOnSave": true,
4+
"explorer.fileNesting.enabled": true,
5+
"explorer.fileNesting.patterns": {
6+
"*.ts": "$(capture).js, $(capture).*.ts, $(capture).*.js",
7+
"*.js": "$(capture).js.map, $(capture).*.ts, $(capture).*.js",
8+
"tsconfig.json": "tsconfig.*.json",
9+
"Dockerfile": "docker-compose.yml, .dockerignore",
10+
".env": "*.env",
11+
"package.json": "yarn.lock, .nvmrc, .yarnrc.yml, bun.lockb",
12+
".eslintrc.*": ".eslintignore, .eslintcache",
13+
".prettierrc": ".prettierignore",
14+
".gitignore": ".gitattributes"
15+
},
16+
"javascript.updateImportsOnFileMove.enabled": "always",
17+
"typescript.updateImportsOnFileMove.enabled": "always",
18+
"workbench.editor.tabSizing": "shrink",
19+
"editor.defaultFormatter": "esbenp.prettier-vscode",
20+
"editor.codeActionsOnSave": {
21+
"source.fixAll.eslint": "explicit",
22+
"source.fixAll.prettier": "explicit",
23+
"source.fixAll.markdownlint": "explicit"
24+
},
25+
"eslint.validate": ["javascript", "typescript"],
26+
"material-icon-theme.activeIconPack": "nest",
27+
"files.eol": "\n"
28+
}

Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM imbios/bun-node:latest-20.12.2-debian as development
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY package.json ./
6+
COPY bun.lockb ./
7+
8+
RUN bun install
9+
10+
COPY . .
11+
12+
RUN bun run build
13+
14+
FROM imbios/bun-node:latest-20.12.2-debian as production
15+
16+
ARG NODE_ENV=production
17+
ARG EnvironmentVariable
18+
ENV NODE_ENV=${NODE_ENV}
19+
20+
WORKDIR /usr/src/app
21+
22+
COPY package.json ./
23+
COPY bun.lockb ./
24+
25+
RUN bun install --production --ignore-scripts
26+
27+
COPY . .
28+
29+
COPY --from=development /usr/src/app/dist ./dist
30+
31+
CMD ["bun", "dist/main.js"]
32+

0 commit comments

Comments
 (0)