1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-10-08 00:33:12 +02:00

switch to Node.js v20, package updates

This commit is contained in:
Matthias Kretschmann 2024-03-12 19:51:45 +00:00
parent ee8f7c8c4e
commit f58ffefddc
Signed by: m
GPG Key ID: 606EEEF3C479A91F
7 changed files with 834 additions and 512 deletions

View File

@ -23,12 +23,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
node: ['18']
os: [ubuntu-latest, macos-14]
node: ['20']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
@ -39,12 +39,12 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
node: ['18']
os: [ubuntu-latest, macos-14]
node: ['20']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
@ -56,19 +56,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
node: ['18']
os: [ubuntu-latest, macos-14]
node: ['20']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit
- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest' && matrix.node == '18'
if: matrix.os == 'ubuntu-latest' && matrix.node == '20'
with:
name: coverage-${{ matrix.os }}-${{ matrix.node }}
path: coverage/
@ -78,12 +78,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['18']
node: ['20']
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
@ -95,17 +95,17 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
node: ['18']
os: [ubuntu-latest, macos-14]
node: ['20']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Cache Astro build output
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.astro
key: ${{ matrix.os }}-${{ matrix.node }}-astro-build-${{ hashFiles('content/**/*.jpg', 'content/**/*.png') }}
@ -113,10 +113,10 @@ jobs:
- run: npm ci
- run: NODE_OPTIONS="--max-old-space-size=4096" npm run build
- name: Zip artifact for deployment
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.node == '18'
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.node == '20'
run: zip dist.zip ./dist -r
- uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.node == '18'
if: github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' && matrix.node == '20'
with:
name: dist-${{ matrix.os }}-${{ matrix.node }}
path: dist.zip
@ -126,10 +126,10 @@ jobs:
needs: [test-unit]
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: coverage-ubuntu-latest-18
name: coverage-ubuntu-latest-20
- uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
@ -140,10 +140,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: dist-ubuntu-latest-18
name: dist-ubuntu-latest-20
- name: unzip artifact
run: unzip dist.zip
- name: Deploy to S3

2
.nvmrc
View File

@ -1 +1 @@
18
20

1227
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -49,43 +49,43 @@
]
},
"dependencies": {
"@astrojs/check": "^0.3.2",
"@astrojs/react": "^3.0.10",
"@astrojs/check": "^0.5.8",
"@astrojs/react": "^3.1.0",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.1.1",
"@coingecko/cryptoformat": "^0.8.0",
"@nanostores/persistent": "^0.9.1",
"@nanostores/query": "^0.2.8",
"@nanostores/react": "^0.7.1",
"@coingecko/cryptoformat": "^0.8.1",
"@nanostores/persistent": "^0.10.1",
"@nanostores/query": "^0.2.10",
"@nanostores/react": "^0.7.2",
"@radix-ui/react-select": "^2.0.0",
"@rainbow-me/rainbowkit": "^1.3.0",
"astro": "4.4.6",
"astro-expressive-code": "^0.29.4",
"astro": "4.5.2",
"astro-expressive-code": "^0.33.4",
"astro-redirect-from": "^1.0.6",
"date-fns": "^3.3.1",
"date-fns": "^3.4.0",
"dms2dec": "^1.1.0",
"fast-exif": "^2.0.1",
"feather-icons": "^4.29.1",
"fraction.js": "^4.3.7",
"fuse.js": "^7.0.0",
"motion": "^10.16.4",
"nanostores": "^0.9.5",
"pigeon-maps": "^0.21.3",
"motion": "^10.17.0",
"nanostores": "^0.10.0",
"pigeon-maps": "^0.21.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sharp": "^0.33.0",
"sharp": "^0.33.2",
"slugify": "^1.6.6",
"swr": "^2.2.5",
"viem": "^1.19.13",
"wagmi": "^1.4.12"
},
"devDependencies": {
"@playwright/test": "^1.40.1",
"@testing-library/jest-dom": "^6.1.5",
"@playwright/test": "^1.42.1",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.1.2",
"@types/node": "^20.10.4",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/node": "^20.11.26",
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.21",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitest/coverage-v8": "^1.2.2",
@ -122,7 +122,7 @@
"vitest": "^1.1.1"
},
"engines": {
"node": "18"
"node": "20"
},
"repository": {
"type": "git",

View File

@ -6,7 +6,7 @@ import { Icon as ChevronsDown } from '@images/components/react/ChevronsDown'
import { Icon as ChevronsUp } from '@images/components/react/ChevronsUp'
import { useFetchTokens } from '@features/Web3/hooks/useFetchTokens'
import { useStore } from '@nanostores/react'
import { $selectedToken, $setSelectedToken } from '@features/Web3/stores'
import { $selectedToken } from '@features/Web3/stores'
import { Loader } from '@components/Loader'
import { useAccount } from 'wagmi'
import { useEffect } from 'react'
@ -24,7 +24,7 @@ export function TokenSelect() {
const token = tokens?.find((token) => token.address === value)
if (!token) return
$setSelectedToken(token)
$selectedToken.set(token)
}
// Auto-select native token
@ -37,7 +37,7 @@ export function TokenSelect() {
return tokens && address ? (
<Select.Root
defaultValue={selectedToken?.address || tokens[0].address}
// defaultValue={selectedToken?.address || tokens[0].address}
value={selectedToken?.address}
onValueChange={(value: `0x${string}`) => handleValueChange(value)}
disabled={isLoading}

View File

@ -1,4 +1,3 @@
import { action } from 'nanostores'
import { persistentAtom } from '@nanostores/persistent'
import type { GetToken } from '../hooks/useFetchTokens'
@ -12,12 +11,3 @@ export const $selectedToken = persistentAtom<GetToken | undefined>(
decode: JSON.parse
}
)
export const $setSelectedToken = action(
$selectedToken,
'setSelectedToken',
(store, token: GetToken | undefined) => {
store.set(token)
return store.get()
}
)

View File

@ -1,12 +1,11 @@
import { action, atom } from 'nanostores'
import { atom } from 'nanostores'
import { normalizeAmount } from '../lib/normalizeAmount'
export const $isInitSend = atom<boolean>(false)
export const $amount = atom<string>('')
export const $txHash = atom<string | undefined>()
export const $setAmount = action($amount, 'setAmount', (store, amount) => {
export const $setAmount = (amount: string) => {
const normalizedAmount = normalizeAmount(amount)
store.set(normalizedAmount)
return store.get()
})
return $amount.set(normalizedAmount)
}