Skip to content

Commit

Permalink
feat: add shared linters
Browse files Browse the repository at this point in the history
  • Loading branch information
fruneen committed Mar 26, 2024
1 parent 791bef6 commit 34fffec
Show file tree
Hide file tree
Showing 204 changed files with 3,506 additions and 4,848 deletions.
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion deploy/aws/deploy/script/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ RUN npm i --prefix ./deploy/script --progress=false --no-audit --production

ADD ./ ./

CMD node ./deploy/script/src/index.js
CMD node ./deploy/script/src/node.js
2 changes: 1 addition & 1 deletion deploy/digital-ocean/deploy/script/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ RUN npm i --prefix ./deploy/script --progress=false --no-audit --production

ADD ./ ./

CMD node ./deploy/script/src/index.js
CMD node ./deploy/script/src/node.js
4 changes: 2 additions & 2 deletions docs/deployment/kubernetes/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We use [**Blue-Green**](https://martinfowler.com/bliki/BlueGreenDeployment.html)

This is the main part of the deployment script.

```javascript deploy/script/src/index.js
```javascript deploy/script/src/node.js
const buildAndPushImage = async ({ dockerFilePath, dockerRepo, dockerContextDir, imageTag, environment }) => {
await execCommand(`docker build \
--build-arg APP_ENV=${environment} \
Expand Down Expand Up @@ -156,7 +156,7 @@ Services are parts of your application packaged as Helm Charts.
|[**Scheduler**](https://github.com/paralect/ship/blob/main/template/apps/api/src/scheduler)|Service that runs cron jobs|Pod|
|[**Migrator**](https://github.com/paralect/ship/blob/main/template/apps/api/src/migrator)|Service that migrates database schema. It deploys before api through Helm pre-upgrade [hook](https://helm.sh/docs/topics/charts_hooks/)|Job|

To deploy services in the cluster manually you need to set cluster authorization credentials inside [config](https://github.com/paralect/ship/blob/main/examples/base/deploy/script/src/config.js) and run deployment [script](https://github.com/paralect/ship/blob/main/examples/base/deploy/script/src/index.js).
To deploy services in the cluster manually you need to set cluster authorization credentials inside [config](https://github.com/paralect/ship/blob/main/examples/base/deploy/script/src/config.js) and run deployment [script](https://github.com/paralect/ship/blob/main/examples/base/deploy/script/src/node.js).

```shell deploy/script/src
node index
Expand Down
2 changes: 1 addition & 1 deletion docs/web/styling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Mantine UI offers a wide range of customizable components and hooks that facilit
Our application's design system is built on top of Mantine's [theme object](https://v6.mantine.dev/theming/theme-object/).
The theme object allows us to define global style properties that can be applied consistently across web application.

### Custom Components (`components/index.js`)
### Custom Components (`components/node.js`)

We extend Mantine's components to create custom-styled versions specific to our application needs.

Expand Down
29 changes: 27 additions & 2 deletions template/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
node_modules
*/**/node_modules
# dependencies
/node_modules

# testing
/coverage

# production
/dist

# edtiors
.idea
.vscode

# misc
.DS_Store
.dev
.turbo
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# typescript
*.tsbuildinfo
28 changes: 24 additions & 4 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# dependencies
/node_modules

# testing
/coverage

# production
/dist

# edtiors
.idea
.turbo
.vscode

# misc
.DS_Store
.dev
/node_modules
dist
coverage
.turbo
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# typescript
*.tsbuildinfo
5 changes: 0 additions & 5 deletions template/.vscode/settings.json

This file was deleted.

24 changes: 23 additions & 1 deletion template/apps/api/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
node_modules
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# typescript
*.tsbuildinfo
25 changes: 23 additions & 2 deletions template/apps/api/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
node_modules/*
jest.config.ts
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# typescript
*.tsbuildinfo
59 changes: 1 addition & 58 deletions template/apps/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,4 @@
const { resolve } = require("path");

module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import", "tsc"],
extends: [
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
],
env: {
node: true,
},
parserOptions: {
ecmaVersion: 13,
sourceType: "module",
project: "./tsconfig.json",
// use tsconfig relative to eslintrc file for IDE
tsconfigRootDir: __dirname,
},
rules: {
'tsc/config': [2, {
configFile: resolve(__dirname, './tsconfig.json')
}],
'arrow-body-style': 0,
'no-underscore-dangle': 0,
'function-paren-newline': 1,
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
'**/*.spec.{js,ts}',
'**/*.builder.{js,ts}',
],
}],
'max-len': ['warn', {
code: 120,
ignoreStrings: true,
ignoreUrls: true,
ignoreTemplateLiterals: true,
}],
},
settings: {
"import/resolver": {
"node": {
"moduleDirectory": [
"src",
"node_modules"
]
}
}
},
ignorePatterns: [
// ignore this file
".eslintrc.js",
// never lint node modules
"node_modules",
// ignore prod_node_modules copied in Docker
"prod_node_modules",
// ignore output build files
"dist"
],
extends: ['custom/node'],
};
28 changes: 23 additions & 5 deletions template/apps/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
node_modules
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/dist

# misc
.DS_Store
npm-debug.log
.idea
.vscode
./dist
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env.*
!.env.example

# typescript
*.tsbuildinfo
23 changes: 23 additions & 0 deletions template/apps/api/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# typescript
*.tsbuildinfo
1 change: 1 addition & 0 deletions template/apps/api/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"prettier-config-custom"
14 changes: 6 additions & 8 deletions template/apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ docker-compose up --build

To start the project not in the docker container just run: `npm run dev`. This command will start the application on port `3001` and will automatically restart whenever you change any file in `./src` directory.


### Important notes

You need to set ```APP_ENV``` variable in build args in a place where you deploy application. It is responsible for the config file from ```environment``` folder that will be taken when building your application

You need to set `APP_ENV` variable in build args in a place where you deploy application. It is responsible for the config file from `environment` folder that will be taken when building your application

| APP_ENV | File |
| ------------- | ------------- |
| development | development.json |
| staging | staging.json |
| production | production.json |
| APP_ENV | File |
| ----------- | ---------------- |
| development | development.json |
| staging | staging.json |
| production | production.json |
4 changes: 1 addition & 3 deletions template/apps/api/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const config: JestConfigWithTsJest = {
preset: '@shelf/jest-mongodb',
verbose: true,
testEnvironment: 'node',
testMatch: [
'**/?(*.)+(spec.ts)',
],
testMatch: ['**/?(*.)+(spec.ts)'],
transform: {
'^.+\\.(ts)$': 'ts-jest',
},
Expand Down
21 changes: 9 additions & 12 deletions template/apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"precommit": "lint-staged"
},
"dependencies": {
"@aws-sdk/client-s3": "3.289.0",
"@aws-sdk/lib-storage": "3.289.0",
"@aws-sdk/s3-request-presigner": "3.289.0",
"@aws-sdk/client-s3": "3.540.0",
"@aws-sdk/lib-storage": "3.540.0",
"@aws-sdk/s3-request-presigner": "3.540.0",
"@koa/cors": "4.0.0",
"@koa/multer": "3.0.2",
"@koa/router": "12.0.0",
Expand Down Expand Up @@ -75,22 +75,19 @@
"@types/node": "20.11.1",
"@types/node-schedule": "2.1.0",
"@types/psl": "1.1.0",
"@typescript-eslint/eslint-plugin": "5.54.1",
"@typescript-eslint/parser": "5.54.1",
"eslint": "8.36.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-tsc": "2.0.0",
"eslint": "8.56.0",
"eslint-config-custom": "workspace:*",
"jest": "29.5.0",
"lint-staged": "13.2.0",
"mongodb-memory-server": "8.12.0",
"nodemon": "3.0.1",
"npm-run-all": "4.1.5",
"prettier": "3.2.5",
"prettier-config-custom": "workspace:*",
"ts-jest": "29.0.5",
"ts-node": "10.9.1",
"ts-node-dev": "2.0.0",
"typescript": "4.9.5"
"tsconfig": "workspace:*",
"typescript": "5.3.3"
},
"lint-staged": {
"*.ts": [
Expand Down
Loading

0 comments on commit 34fffec

Please sign in to comment.