Skip to content

Commit dc124f3

Browse files
authored
feat!: modernise package with rolldown (#527)
1 parent acfe228 commit dc124f3

40 files changed

+7068
-14905
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,29 @@ jobs:
1212

1313
steps:
1414
- name: Begin CI...
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616

17-
- name: Use Node 12
18-
uses: actions/setup-node@v1
17+
- name: Use Node 22
18+
uses: actions/setup-node@v4
1919
with:
20-
node-version: 12.x
21-
22-
- name: Get yarn cache directory path
23-
id: yarn-cache-dir-path
24-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
25-
26-
- uses: actions/cache@v2
27-
id: yarn-cache
28-
with:
29-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
30-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-yarn-
20+
node-version: 22.x
21+
cache: 'yarn'
3322

3423
- name: Install dependencies
3524
run: yarn install --immutable
3625

37-
- name: Lint
38-
run: yarn workspace react-responsive-modal lint
26+
- name: Typecheck
27+
run: yarn workspace react-responsive-modal typecheck
3928

4029
- name: Test
41-
run: yarn workspace react-responsive-modal test --ci --coverage --maxWorkers=2
30+
run: yarn workspace react-responsive-modal test --coverage
31+
env:
32+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4233

4334
- name: Report coverage
44-
uses: codecov/codecov-action@v1
35+
uses: codecov/codecov-action@v5
36+
with:
37+
token: ${{ secrets.CODECOV_TOKEN }}
4538

4639
- name: Build
4740
run: yarn workspace react-responsive-modal build
@@ -50,10 +43,13 @@ jobs:
5043
run: yarn workspace website build
5144

5245
- name: Cypress run
53-
uses: cypress-io/github-action@v2
46+
uses: cypress-io/github-action@v6
5447
with:
5548
# Dependencies already installed before
5649
install: false
5750
# Use monorepo
5851
project: ./react-responsive-modal
5952
start: yarn workspace website start -p 3000
53+
54+
- name: Size limit
55+
run: yarn workspace react-responsive-modal size

.github/workflows/release-please.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
extra-files: |
2020
react-responsive-modal/package.json
2121
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
if: ${{ steps.release.outputs.release_created }}
2424

25-
- name: Use Node 16
26-
uses: actions/setup-node@v1
25+
- name: Use Node 22
26+
uses: actions/setup-node@v4
2727
with:
28-
node-version: 16.x
28+
node-version: 22.x
2929
if: ${{ steps.release.outputs.release_created }}
3030

3131
- name: Install dependencies

.github/workflows/size.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 541 deletions
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.yarn/releases/yarn-3.3.0.cjs

Lines changed: 0 additions & 807 deletions
This file was deleted.

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
15
nodeLinker: node-modules
26

37
npmAuthToken: "${NPM_TOKEN-''}"
48

5-
plugins:
6-
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7-
spec: '@yarnpkg/plugin-interactive-tools'
8-
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
9-
spec: '@yarnpkg/plugin-workspace-tools'
10-
11-
yarnPath: .yarn/releases/yarn-3.3.0.cjs
9+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"devDependencies": {
2222
"husky": "4.3.0",
2323
"lint-staged": "10.5.1",
24-
"prettier": "2.1.2"
24+
"prettier": "3.6.2"
2525
},
2626
"version": "6.4.2",
27-
"packageManager": "yarn@3.3.0"
27+
"packageManager": "yarn@4.9.2"
2828
}

react-responsive-modal/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`modal > closeIcon > should render the closeIcon by default 1`] = `
4+
<button
5+
class="react-responsive-modal-closeButton"
6+
data-testid="close-button"
7+
>
8+
<svg
9+
data-testid="close-icon"
10+
height="28"
11+
viewBox="0 0 36 36"
12+
width="28"
13+
>
14+
<path
15+
d="M28.5 9.62L26.38 7.5 18 15.88 9.62 7.5 7.5 9.62 15.88 18 7.5 26.38l2.12 2.12L18 20.12l8.38 8.38 2.12-2.12L20.12 18z"
16+
/>
17+
</svg>
18+
</button>
19+
`;
20+
21+
exports[`modal > prop: closeIcon > should render custom icon instead of the default one 1`] = `
22+
<div
23+
data-testid="custom-icon"
24+
>
25+
custom icon
26+
</div>
27+
`;
228

329
exports[`modal closeIcon should render the closeIcon by default 1`] = `
430
<button

0 commit comments

Comments
 (0)