Skip to content

Commit

Permalink
[#482]: Nodejs 20.11 (#483)
Browse files Browse the repository at this point in the history
* [#482]: create prepare-nodejs github action

* [#482]: fix types

* [#482]: ligretto core remove engine
  • Loading branch information
Themezv authored Mar 21, 2024
1 parent 6445e3e commit 1a3b3dc
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 147 deletions.
19 changes: 19 additions & 0 deletions .github/actions/prepare-nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Prepare nodejs"
description: "Install nodejs. Install dependencies"

runs:
using: "composite"
steps:
- name: Install node
uses: actions/setup-node@main
with:
node-version: "20.11.1"
cache: "yarn"

- name: Install yarn
shell: 'bash'
run: corepack enable

- name: Install dependencies
shell: 'bash'
run: yarn
39 changes: 6 additions & 33 deletions .github/workflows/blog-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Lint code
run: yarn blog:lint
Expand All @@ -45,17 +36,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Run tests
run: yarn blog:test:ci
Expand All @@ -68,17 +50,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Generate articles
run: yarn workspace @memebattle/blog run generate
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/gamehub-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Lint code
run: yarn gamehub-client:lint
Expand All @@ -45,17 +36,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: TS check
run: yarn workspace @memebattle/gamehub-client run ts-check
13 changes: 2 additions & 11 deletions .github/workflows/ligretto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Build frontend
run: yarn run ligretto:front:build
Expand Down
52 changes: 8 additions & 44 deletions .github/workflows/ligretto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Lint code
run: yarn lint
Expand All @@ -49,17 +40,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Build shared
run: yarn ligretto-shared:build
Expand All @@ -85,17 +67,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: TS check
run: yarn ligretto:ts-check:ci
Expand Down Expand Up @@ -128,17 +101,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Install Playwright Browsers
run: yarn dlx [email protected] install --with-deps chromium
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/ligretto-schedule-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,8 @@ jobs:
- name: Checkout
uses: actions/checkout@main

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18.14'
cache: 'yarn'

- name: Install yarn
run: corepack enable

- name: Install dependencies
run: yarn
- uses: ./.github/actions/prepare-nodejs
name: Prepare Node.js

- name: Install Playwright Browsers
run: yarn dlx [email protected] install --with-deps chromium
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"@types/negotiator": "^0",
"@types/node": "^18.14.0",
"@types/node": "20.11.30",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/gamehub-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@types/lodash": "^4.14.182",
"@types/node": "^18.14.0",
"@types/node": "20.11.30",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"typescript": "^5.0.4"
Expand Down
3 changes: 0 additions & 3 deletions apps/ligretto-core-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "@memebattle/ligretto-core-backend",
"version": "1.0.0",
"private": true,
"engines": {
"node": "18"
},
"scripts": {
"build": "node ace build --production",
"start": "node server.js",
Expand Down
2 changes: 1 addition & 1 deletion apps/ligretto-gameplay-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@types/jest": "^28.1.6",
"@types/lodash": "^4.14.182",
"@types/node": "^18.14.0",
"@types/node": "20.11.30",
"cross-env": "^7.0.3",
"jest": "^29.5.0",
"mock-socket": "^9.1.5",
Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@
"build-storybook": "storybook build"
},
"engines": {
"node": ">=18"
"node": ">=20.11"
},
"workspaces": [
"packages/**",
"apps/*"
],
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@storybook/addon-actions": "^7.0.6",
"@storybook/addon-docs": "^7.0.6",
Expand All @@ -55,7 +49,7 @@
"@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^7.0.6",
"@storybook/react-vite": "^7.0.6",
"@types/node": "^18.14.0",
"@types/node": "20.11.30",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"css-loader": "^6.7.1",
Expand All @@ -82,7 +76,7 @@
},
"packageManager": "[email protected]",
"resolutions": {
"@types/node": "18.14.0",
"@types/node": "20.11.30",
"@types/readable-stream": "2.3.15",
"vite": "4.5.0"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ export const Carousel = ({ children, initialSlideIndex = 0 }: CarouselProps) =>
}, [])

useEffect(() => {
let timerId: NodeJS.Timer
let timerId: number
if (isAutoChangeEnabled) {
timerId = setInterval(() => {
timerId = window.setInterval(() => {
setScrollToIndex(index => (index + 1) % slidesCount)
}, 5000)
}
return () => clearInterval(timerId)
return () => window.clearInterval(timerId)
}, [isAutoChangeEnabled, slidesCount])

const contextValue = useMemo<CarouselContextValue>(
Expand Down
25 changes: 17 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ __metadata:
"@radix-ui/react-popover": ^1.0.7
"@tailwindcss/typography": ^0.5.9
"@types/negotiator": ^0
"@types/node": ^18.14.0
"@types/node": 20.11.30
"@types/react": ^18.0.28
"@types/react-dom": ^18.0.11
"@vitejs/plugin-react": ^4.1.1
Expand Down Expand Up @@ -3341,7 +3341,7 @@ __metadata:
"@emotion/server": ^11.4.0
"@memebattle/ui": "workspace:^"
"@types/lodash": ^4.14.182
"@types/node": ^18.14.0
"@types/node": 20.11.30
"@types/react": ^18.0.28
"@types/react-dom": ^18.0.11
lodash: ^4.17.21
Expand Down Expand Up @@ -3425,7 +3425,7 @@ __metadata:
"@memebattle/ligretto-shared": "workspace:^"
"@types/jest": ^28.1.6
"@types/lodash": ^4.14.182
"@types/node": ^18.14.0
"@types/node": 20.11.30
axios: ^1.3.4
cross-env: ^7.0.3
inversify: ^5.0.1
Expand Down Expand Up @@ -3468,7 +3468,7 @@ __metadata:
"@storybook/preset-scss": ^1.0.3
"@storybook/react": ^7.0.6
"@storybook/react-vite": ^7.0.6
"@types/node": ^18.14.0
"@types/node": 20.11.30
"@typescript-eslint/eslint-plugin": ^5.53.0
"@typescript-eslint/parser": ^5.53.0
css-loader: ^6.7.1
Expand Down Expand Up @@ -6857,10 +6857,12 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:18.14.0":
version: 18.14.0
resolution: "@types/node@npm:18.14.0"
checksum: d83fcf5e4ed544755dd9028f5cbb6b9d46235043159111bb2ad62223729aee581c0144a9f6df8ba73d74011db9ed4ebd7af2fd5e0996714e3beb508a5da8ac5c
"@types/node@npm:20.11.30":
version: 20.11.30
resolution: "@types/node@npm:20.11.30"
dependencies:
undici-types: ~5.26.4
checksum: 7597767aa3e44b0f1bf62efa522dd17741135f283c11de6a20ead8bb7016fb4999cc30adcd8f2bb29ebb216906c92894346ccd187de170927dc1e212d2c07c81
languageName: node
linkType: hard

Expand Down Expand Up @@ -22588,6 +22590,13 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~5.26.4":
version: 5.26.5
resolution: "undici-types@npm:5.26.5"
checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487
languageName: node
linkType: hard

"unfetch@npm:^4.2.0":
version: 4.2.0
resolution: "unfetch@npm:4.2.0"
Expand Down

0 comments on commit 1a3b3dc

Please sign in to comment.