-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v9.0-integration' into nullable-context
- Loading branch information
Showing
32 changed files
with
3,651 additions
and
2,108 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish Package to npmjs | ||
on: | ||
# keeping it purely manual for now as to not accidentally trigger a release | ||
#release: | ||
# types: [published] | ||
workflow_dispatch: | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'yarn' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test | ||
- run: npm publish --access public --provenance | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
build*/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,30 @@ | ||
const { defaults: tsjPreset } = require('ts-jest/presets') | ||
|
||
const defaults = { | ||
coverageDirectory: './coverage/', | ||
collectCoverage: true, | ||
testURL: 'http://localhost', | ||
} | ||
process.env.TS_JEST_DISABLE_VER_CHECKER = true | ||
|
||
const NORMAL_TEST_FOLDERS = ['components', 'hooks', 'integration', 'utils'] | ||
|
||
const tsTestFolderPath = (folderName) => | ||
`<rootDir>/test/${folderName}/**/*.{ts,tsx}` | ||
|
||
const tsStandardConfig = { | ||
...defaults, | ||
displayName: 'ReactDOM 18 (Shim)', | ||
displayName: 'ReactDOM 18', | ||
preset: 'ts-jest', | ||
testMatch: NORMAL_TEST_FOLDERS.map(tsTestFolderPath), | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: ['<rootDir>/jest.setupAfter.js'], | ||
} | ||
|
||
const rnConfig = { | ||
...defaults, | ||
displayName: 'React Native', | ||
testMatch: [tsTestFolderPath('react-native')], | ||
preset: 'react-native', | ||
transform: { | ||
'^.+\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js', | ||
...tsjPreset.transform, | ||
}, | ||
} | ||
|
||
const standardReact17Config = { | ||
...tsStandardConfig, | ||
displayName: 'ReactDOM 17', | ||
moduleNameMapper: { | ||
'^react$': 'react-17', | ||
'^react-dom$': 'react-dom-17', | ||
'^react-test-renderer$': 'react-test-renderer-17', | ||
'^@testing-library/react$': '@testing-library/react-12', | ||
}, | ||
} | ||
|
||
const nextEntryConfig = { | ||
...tsStandardConfig, | ||
displayName: 'ReactDOM 18 (Next)', | ||
moduleNameMapper: { | ||
'../../src/index': '<rootDir>/src/next', | ||
'^.+\\.(js|jsx|ts|tsx)$': [ | ||
'babel-jest', | ||
{ configFile: './babel.config.js' }, // <- cannot use rootDir here | ||
], | ||
}, | ||
} | ||
|
||
module.exports = { | ||
projects: [ | ||
tsStandardConfig, | ||
rnConfig, | ||
standardReact17Config, | ||
nextEntryConfig, | ||
], | ||
projects: [tsStandardConfig, rnConfig], | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const { TextEncoder, TextDecoder } = require('util') | ||
global.TextEncoder = TextEncoder | ||
global.TextDecoder = TextDecoder |
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
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
Oops, something went wrong.