Fix typos in nextjs.md #1193
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Old TypeScript | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
test_matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
typescript: | |
- 5.4.4 | |
- 5.3.3 | |
- 5.2.2 | |
- 5.1.6 | |
- 5.0.4 | |
- 4.9.5 | |
- 4.8.4 | |
- 4.7.4 | |
- 4.6.4 | |
- 4.5.5 | |
- 4.4.4 | |
- 4.3.5 | |
- 4.2.3 | |
- 4.1.5 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
cache: yarn | |
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
- run: yarn install --frozen-lockfile --check-files | |
- run: yarn build | |
- name: Patch for Old TS | |
run: | | |
sed -i~ 's/\/\/ @ts-expect-error.*\[LATEST-TS-ONLY\]//' tests/*.tsx | |
sed -i~ 's/"target":/"skipLibCheck":true,"target":/' tsconfig.json | |
sed -i~ 's/"exactOptionalPropertyTypes": true,//' tsconfig.json | |
sed -i~ 's/"moduleResolution": "bundler",/"moduleResolution": "node",/' tsconfig.json | |
sed -i~ 's/"allowImportingTsExtensions": true,//' tsconfig.json | |
sed -i~ 's/"zustand": \["\.\/src\/index\.ts"\],/"zustand": [".\/dist\/index.d.ts"],/' tsconfig.json | |
sed -i~ 's/"zustand\/\*": \["\.\/src\/\*\.ts"\]/"zustand\/*": [".\/dist\/*.d.ts"]/' tsconfig.json | |
sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json | |
yarn json -I -f package.json -e "this.resolutions={}; this.resolutions['@types/node']='18.13.0';" | |
yarn add -D @types/node@18.13.0 | |
- name: Install old TypeScript | |
run: yarn add -D typescript@${{ matrix.typescript }} | |
- name: Patch testing setup for Old TS | |
if: ${{ matrix.typescript == '4.4.4' || matrix.typescript == '4.3.5' || matrix.typescript == '4.2.3' || matrix.typescript == '4.1.5' }} | |
run: | | |
rm node_modules/@vitest/expect/dist/*.d.ts | |
echo "declare module '@vitest/expect'" >> ./src/types.d.ts | |
rm node_modules/@vitest/runner/dist/*.d.ts | |
echo "declare module '@vitest/runner'" >> ./src/types.d.ts | |
rm node_modules/@vitest/spy/dist/*.d.ts | |
echo "declare module '@vitest/spy'" >> ./src/types.d.ts | |
rm node_modules/@vitest/utils/dist/*.d.ts | |
echo "declare module '@vitest/utils'" >> ./src/types.d.ts | |
rm node_modules/vite-node/dist/*.d.ts | |
echo "declare module 'vite-node'" >> ./src/types.d.ts | |
rm node_modules/vitest/dist/*.d.ts | |
echo "declare module 'vitest'" >> ./src/types.d.ts | |
- name: Test ${{ matrix.typescript }} | |
run: yarn tsc --noEmit |