Skip to content

Commit

Permalink
Merge pull request #630 from reduxjs/feature/5.0-rtk-ci-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Oct 28, 2023
2 parents b2a85ee + 7f62568 commit 634ef51
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 235 deletions.
78 changes: 54 additions & 24 deletions .github/workflows/build-and-test-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
name: Lint, Test, Report Coverage on Node ${{ matrix.node }}
name: Build and Test on Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -57,13 +57,14 @@ jobs:
fail-fast: false
matrix:
node: ['16.x']
ts: ['4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8', '4.9', '5.0']
ts: ['4.7', '4.8', '4.9', '5.0', '5.1', '5.2']

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
Expand Down Expand Up @@ -94,6 +95,28 @@ jobs:
./node_modules/.bin/tsc --version
yarn test:typescript
are-the-types-wrong:
name: Check package config with are-the-types-wrong

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['16.x']
steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: package
path: .

# Note: We currently expect "FalseCJS" failures for Node16 + `moduleResolution: "node16",
- name: Run are-the-types-wrong
run: npx @arethetypeswrong/cli ./package.tgz --format table --ignore-rules false-cjs

test-published-artifact:
name: Test Published Artifact ${{ matrix.example }}

Expand All @@ -103,35 +126,45 @@ jobs:
fail-fast: false
matrix:
node: ['16.x']
example:
[
'cra4',
'cra5',
'next',
'vite',
'node-standard',
'node-esm',
'are-the-types-wrong'
]
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm']
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Clone RTK repo
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit

- name: Check out v2.0-integration
working-directory: ./redux-toolkit
run: git checkout v2.0-integration

- name: Check folder contents
run: ls -l .

# Some weird install diffs with cloning this repo and installing.
# Just kill the lockfiles for this repo and RTK and reinstall

- name: Remove top lockfile
run: rm yarn.lock && rm package.json

- name: Remove RTK lockfile
working-directory: ./redux-toolkit
run: rm yarn.lock && rm package.json

- name: Install deps
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn install
run: rm yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install

- name: Install Playwright browser if necessary
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
continue-on-error: true
run: yarn playwright install

- uses: actions/download-artifact@v2
with:
Expand All @@ -150,17 +183,14 @@ jobs:
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn info reselect && yarn why reselect

- name: Check MSW version
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn why msw

- name: Build example
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn build

- name: Run test step
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn test
if: matrix.example != 'are-the-types-wrong'

- name: Run test step (attw)
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
# Ignore "FalseCJS" errors in the `attw` job
run: yarn test -n FalseCJS
if: matrix.example == 'are-the-types-wrong'
7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
"default": "./dist/cjs/reselect.cjs"
}
},
"typesVersions": {
"<=4.6": {
"*": [
"./dist/versionedTypes/ts46/index.d.ts"
]
}
},
"files": [
"src",
"dist"
Expand Down
14 changes: 0 additions & 14 deletions src/versionedTypes/package.dist.json

This file was deleted.

171 changes: 0 additions & 171 deletions src/versionedTypes/ts46-mergeParameters.ts

This file was deleted.

1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"paths": {
"reselect": ["src/index.ts"], // @remap-prod-remove-line
"@internal/*": ["src/*"],
"./ts47-mergeParameters": ["./src/versionedTypes/ts46-mergeParameters.ts"]
}
},
"include": ["./src/**/*"],
Expand Down
6 changes: 0 additions & 6 deletions tsconfig.ts46types.json

This file was deleted.

13 changes: 1 addition & 12 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,7 @@ export default defineConfig(options => {
format: ['esm'],
outExtension: () => ({ js: '.mjs' }),
dts: true,
clean: true,
async onSuccess() {
console.log('onSuccess')

console.log('Generating TS 4.6 types...')
await execAsync('yarn tsc -p tsconfig.ts46types.json')
fs.copyFileSync(
'src/versionedTypes/package.dist.json',
'dist/versionedTypes/ts46/versionedTypes/package.json'
)
console.log('TS 4.6 types done')
}
clean: true
},

// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
Expand Down

0 comments on commit 634ef51

Please sign in to comment.