Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Extend eslint, tsconfig, next config and tailwind config #412

Merged
merged 10 commits into from
Jul 12, 2024
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,18 @@ jobs:

- name: Publish canary
if: github.event.inputs.release == 'canary'
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-vitnode --tag canary --no-git-checks
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-typescript-vitnode --tag canary --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish release candidate
if: github.event.inputs.release == 'release-candidate'
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-vitnode --tag rc --no-git-checks
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-typescript-vitnode --tag rc --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish stable
if: github.event.inputs.release == 'stable'
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-vitnode --no-git-checks
run: pnpm publish --provenance --access public --filter vitnode-backend --filter vitnode-frontend --filter vitnode-shared --filter create-vitnode-app --filter eslint-config-typescript-vitnode --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 1 addition & 4 deletions apps/backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"$schema": "https://json.schemastore.org/eslintrc",
"extends": ["eslint-config-vitnode/.eslintrc.json"],
"env": {
"node": true
},
"extends": ["eslint-config-typescript-vitnode/.eslintrc.shared.json"],
"ignorePatterns": ["uploads"]
}
43 changes: 22 additions & 21 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
{
"name": "backend",
"version": "0.0.7-canary.0",
"author": "Maciej Piotr (aXenDev) Balcerzak",
"license": "GPL-3.0 license",
"license": "MIT",
"scripts": {
"db": "drizzle-kit push",
"config:init": "vitnode-backend init",
"build": "nest build",
"dev": "pnpm config:init && cross-env NODE_ENV=development nest start -w",
"email:dev": "email dev -p 3001",
"start": "nest start",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"start": "node dist/main",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"migrate:forum": "drizzle-kit generate --config src/plugins/forum/admin/database/drizzle.config.ts",
"migrate:admin": "drizzle-kit up --config src/plugins/core/admin/database/drizzle.config.ts && drizzle-kit generate --config src/plugins/core/admin/database/drizzle.config.ts",
"migrate:blog": "drizzle-kit up --config src/plugins/blog/admin/database/drizzle.config.ts && drizzle-kit generate --config src/plugins/blog/admin/database/drizzle.config.ts",
"codegen": "graphql-codegen --config codegen.ts"
"codegen": "graphql-codegen --config codegen.ts",
"db": "drizzle-kit push"
},
"dependencies": {
"@nestjs/apollo": "^12.2.0",
"@nestjs/common": "^10.3.10",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.3.10",
"@nestjs/graphql": "^12.2.0",
"@nestjs/jwt": "^10.2.0",
"@nestjs/platform-express": "^10.3.10",
"@nestjs/schedule": "^4.1.0",
"@react-email/components": "^0.0.21",
"express": "^4.19.2",
"graphql": "^16.9.0",
"@nestjs/serve-static": "^4.0.2",
"pg": "^8.12.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1"
},
Expand All @@ -38,24 +34,29 @@
"@graphql-codegen/typescript-document-nodes": "^4.0.9",
"@graphql-codegen/typescript-operations": "^4.2.3",
"@nestjs/cli": "^10.4.2",
"@nestjs/platform-express": "^10.3.10",
"@nestjs/schematics": "^10.1.2",
"@react-email/components": "^0.0.21",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.6.13",
"@types/express": "^4.17.21",
"@types/node": "^20.14.10",
"@types/pg": "^8.11.6",
"@types/react": "^18.3.3",
"@types/react": "^18",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.22.8",
"drizzle-orm": "^0.31.2",
"drizzle-kit": "^0.23.0",
"drizzle-orm": "^0.32.0",
"eslint": "^8.57.0",
"eslint-config-vitnode": "workspace:*",
"pg": "^8.12.0",
"eslint-config-typescript-vitnode": "workspace:*",
"object-path": "^0.11.8",
"source-map-support": "^0.5.21",
"ts-jest": "^29.2.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.5.3",
"vitnode-backend": "workspace:*",
"vitnode-shared": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function bootstrap() {
},
});

await app.listen(process.env.PORT ?? '8080', null, () => {
await app.listen(process.env.PORT ?? '8080', '', () => {
console.log(
`Application is running on: http://localhost:${process.env.PORT ?? 8080}/graphql`,
);
Expand Down
20 changes: 3 additions & 17 deletions apps/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "eslint-config-vitnode/tsconfig.base.json",
"extends": "eslint-config-typescript-vitnode/tsconfig.nest.json",
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"jsx": "react",
"baseUrl": "./",
"outDir": "./dist",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitAny": false,
"strictNullChecks": false,
"forceConsistentCasingInFileNames": false, // TODO: Improve this value
"noFallthroughCasesInSwitch": false,
"strictPropertyInitialization": false,
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*", "./node_modules/vitnode-backend/dist/*"]
}
},
"exclude": ["uploads"],
"ts-node": {
// `pnpm add -D tsconfig-paths` / Paths for ts-node
"require": ["tsconfig-paths/register"]
}
"exclude": ["uploads"]
}
Loading
Loading