Skip to content

Commit

Permalink
Merge e335265 into 377a792
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Dec 15, 2022
2 parents 377a792 + e335265 commit fedafd7
Show file tree
Hide file tree
Showing 28 changed files with 25,302 additions and 27,428 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-peas-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Update to React.useId() when using React 18
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@
{
"ts-ignore": "allow-with-description"
}
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@react-aria/ssr",
"importNames": ["useSSRSafeId"],
"message": "Please use the `useId` hook from `src/hooks/useId.ts` instead"
}
],
"patterns": []
}
]
}
},
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,20 @@ jobs:
run: node script/set-react-version.js ${{ matrix.react }}

- name: Install dependencies
if: ${{ matrix.react == 18 }}
if: ${{ matrix.react == 17 }}
run: npm install --legacy-peer-deps

- name: Install dependencies
if: ${{ matrix.react == 17 }}
if: ${{ matrix.react == 18 }}
run: npm ci

- name: Build
run: npm run build

- name: Test
run: npm run test -- --coverage
with:
REACT_VERSION_17: ${{ matrix.react == 17 }}

type-check:
strategy:
Expand All @@ -78,11 +80,11 @@ jobs:
run: node script/set-react-version.js ${{ matrix.react }}

- name: Install dependencies
if: ${{ matrix.react == 18 }}
if: ${{ matrix.react == 17 }}
run: npm install --legacy-peer-deps

- name: Install dependencies
if: ${{ matrix.react != 18 }}
if: ${{ matrix.react != 17 }}
run: npm ci

- name: Type check
Expand Down
19 changes: 8 additions & 11 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,26 @@ module.exports = {
{
name: 'storybook-addon-turbo-build',
options: {
optimizationLevel: 2
}
optimizationLevel: 2,
},
},
...(process.env.NODE_ENV === 'production' && process.env.GITHUB_JOB !== 'chromatic'
? ['@whitespace/storybook-addon-html']
: [])
],
core: {
builder: {
name: 'webpack5',
options: {
fsCache: true
}
}
fsCache: true,
},
},
},
features: {
interactionsDebugger: true,
storyStoreV7: true,
buildStoriesJson: true
buildStoriesJson: true,
},
framework: '@storybook/react',
reactOptions: {
fastRefresh: true,
strictMode: true
}
strictMode: true,
},
}
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
/* eslint-disable github/unescaped-html-literal */

'use strict'

const {REACT_VERSION_17} = process.env

/**
* @type {import('jest').Config}
*/
module.exports = {
globals: {
REACT_VERSION_LATEST: REACT_VERSION_17 ? REACT_VERSION_17 !== 'true' : true,
REACT_VERSION_17: REACT_VERSION_17 === 'true',
},
testEnvironment: 'jsdom',
cacheDirectory: '.test',
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/stories/**', '!**/*.stories.{js,jsx,ts,tsx}'],
Expand Down
Loading

0 comments on commit fedafd7

Please sign in to comment.