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

chore: new turbo, eslint and dependency refresh #2571

Merged
merged 10 commits into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
client/.next/cache
client/.next/static
client/.turbo
node_modules
npm-debug.log
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ jobs:
${{ runner.os }}-${{ env.cache-name }}-

- name: Install turbo
run: npm install turbo@1 --global
run: npm install turbo@2 --global

- name: Generate a isolated subworkspace for Client
run: turbo prune --scope=client --docker
@@ -72,6 +72,7 @@ jobs:
RSSHCOOL_UI_GCP_MAPS_API_KEY: ${{ secrets.RSSHCOOL_UI_GCP_MAPS_API_KEY }}
CDN_HOST: 'https://cdn.rs.school'
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
DO_NOT_TRACK: 1
working-directory: ./app
run: npm run build

@@ -146,6 +147,7 @@ jobs:
- name: Build (npm run build)
env:
NODE_ENV: production
DO_NOT_TRACK: 1
run: npm run build
working-directory: ./app

@@ -208,6 +210,7 @@ jobs:
- name: Build (npm run build)
env:
NODE_ENV: production
DO_NOT_TRACK: 1
run: npx turbo run build --filter=nestjs
working-directory: ./app

21 changes: 13 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
.vscode
.DS_Store
node_modules/
.next/
dist/
.env
.idea
.history/
.idea/
.next/
.sentryclirc
.swc/
.turbo
.vscode
app/
coverage
dist/
node_modules/
out
playwright-report/
reports/*.xml
setup/backup.sql
.history/
setup/cdk/cdk.out
.turbo
out
test-results/
4 changes: 0 additions & 4 deletions client/.eslintignore

This file was deleted.

49 changes: 0 additions & 49 deletions client/.eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions client/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -7,15 +7,15 @@ ENV NODE_PORT 8080

WORKDIR /app

COPY client/next.config.js /app/client/next.config.js
COPY client/next.config.prod.js /app/client/next.config.prod.js
COPY client/next.config.mjs /app/client/next.config.mjs
COPY client/next.config.prod.mjs /app/client/next.config.prod.mjs
COPY client/package.json /app/client/package.json
COPY client/public /app/client/public

COPY package.json /app
COPY package-lock.json /app

RUN npm ci --omit=dev --omit=optional
RUN npm ci --production --no-optional

COPY client/.next /app/client/.next

39 changes: 0 additions & 39 deletions client/Dockerfile-changed

This file was deleted.

2 changes: 1 addition & 1 deletion client/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ COPY package.json package.json
COPY package-lock.json package-lock.json
COPY client/public client/public
COPY client/package.json client/package.json
COPY client/next.config.prod.js client/next.config.js
COPY client/next.config.prod.mjs client/next.config.mjs

RUN npm ci --production --no-optional

10 changes: 10 additions & 0 deletions client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import testingLibrary from 'eslint-plugin-testing-library';
import defaultConfig from '../eslint.config.mjs';

export default [
...defaultConfig,
{
...testingLibrary.configs['flat/react'],
files: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
},
];
8 changes: 4 additions & 4 deletions client/jest.config.js β†’ client/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require('next/jest');
import next from 'next/jest.js';

// eslint-disable-next-line turbo/no-undeclared-env-vars, no-undef
process.env.TZ = 'UTC';

const esModules = [
@@ -27,9 +27,9 @@ const esModules = [
'trim-lines',
].join('|');

const createJestConfig = nextJest({ dir: './' });
const createJestConfig = next({ dir: './' });

module.exports = async () => {
export default async () => {
const config = await createJestConfig({
testEnvironment: 'jsdom',
rootDir: 'src',
55 changes: 0 additions & 55 deletions client/next.config.js

This file was deleted.

27 changes: 27 additions & 0 deletions client/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import prodConfig from './next.config.prod.mjs';

const isProd = process.env.NODE_ENV === 'production';

const server = process.env.SERVER_HOST || 'http://localhost:3001';
const nestjs = process.env.NESTJS_HOST || 'http://localhost:3002';

const nextConfig = {
...prodConfig,
rewrites: () =>
isProd
? []
: [
{ source: '/certificate/:path*', destination: `${nestjs}/certificate/:path*` },
{ source: '/swagger', destination: `${nestjs}/swagger/` },
{ source: '/swagger-json', destination: `${nestjs}/swagger-json` },
{ source: '/swagger:path', destination: `${nestjs}/swagger/swagger:path` },
{ source: '/api/v2/:path*', destination: `${nestjs}/:path*` },
{ source: '/api/:path*', destination: `${server}/:path*` },
],
eslint: {
ignoreDuringBuilds: true,
},
swcMinify: true,
};

export default nextConfig;
Original file line number Diff line number Diff line change
@@ -12,4 +12,5 @@ const nextConfig = {
CDN_HOST: process.env.CDN_HOST || '',
},
};
module.exports = nextConfig;

export default nextConfig;
23 changes: 4 additions & 19 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -2,13 +2,10 @@
"name": "client",
"private": true,
"version": "1.0.0",
"license": "Mozilla Public License 2.0",
"browserslist": [
"> 1%"
],
"engines": {
"node": ">=16",
"npm": ">=8"
},
"scripts": {
"start": "next dev",
"build": "next build",
@@ -27,14 +24,10 @@
"@ant-design/compatible": "5.1.2",
"@ant-design/cssinjs": "^1.20.0",
"@ant-design/plots": "1.2.5",
"@sentry/nextjs": "7.81.0",
"ahooks": "3.8.4",
"antd": "5.11.2",
"axios": "1.6.2",
"cookie": "0.7.0",
"csvtojson": "2.0.10",
"dayjs": "1.11.10",
"lodash": "4.17.21",
"next": "13.4.3",
"react": "18.2.0",
"react-dom": "18.2.0",
@@ -49,28 +42,20 @@
},
"devDependencies": {
"@next/bundle-analyzer": "13.4.3",
"@playwright/test": "1.37.1",
"@playwright/test": "1.49.1",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.1.2",
"@testing-library/user-event": "14.5.1",
"@types/aws-lambda": "8.10.126",
"@types/cookie": "0.5.4",
"@types/lodash": "4.14.201",
"@types/node": "20.9.2",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"dotenv": "16.3.1",
"eslint-config-next": "14.0.3",
"eslint-config-turbo": "1.10.16",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-jest-dom": "5.1.0",
"eslint-plugin-testing-library": "6.1.2",
"eslint-plugin-testing-library": "7.1.1",
"jest-environment-jsdom": "29.7.0",
"jest-junit": "16.0.0",
"jest-mock-axios": "4.7.3",
"mq-polyfill": "1.1.8",
"nextjs-bundle-analysis": "0.4.0",
"typescript": "5.3.2"
"nextjs-bundle-analysis": "0.4.0"
},
"nextBundleAnalysis": {
"budget": 512000,
Loading

Unchanged files with check annotations Beta

koaJwt({ key: 'user', cookie: 'auth-token', secret: config.sessionKey, debug: true, passthrough: true }),
);
process.on('unhandledRejection', reason => this.appLogger.error(reason as any));

Check warning on line 33 in server/src/app.ts

GitHub Actions / Lint and Format

Unexpected any. Specify a different type
}
public start(listen = false) {