-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Update to carbon 11, React 18 and React-router 6. (#4)
* BREAKING: Update to carbon 11, React 18 and React-router 6. * Fix failing test
- Loading branch information
1 parent
590924b
commit f16bbbc
Showing
11 changed files
with
20,806 additions
and
15,488 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 |
---|---|---|
|
@@ -41,6 +41,7 @@ typings/ | |
|
||
# Optional npm cache directory | ||
.npm | ||
.yarn | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
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 @@ | ||
nodeLinker: node-modules |
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,33 @@ | ||
module.exports = (path, options) => { | ||
// Call the defaultResolver, so we leverage its cache, error handling, etc. | ||
return options.defaultResolver(path, { | ||
...options, | ||
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb) | ||
packageFilter: (pkg) => { | ||
// see https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149 | ||
// see https://github.com/uuidjs/uuid/pull/616 | ||
// | ||
// jest-environment-jsdom 28+ tries to use browser exports instead of default exports, | ||
// but uuid/react-colorful only offers an ESM browser export and not a CommonJS one. Jest does not yet | ||
// support ESM modules natively, so this causes a Jest error related to trying to parse | ||
// "export" syntax. | ||
// | ||
// This workaround prevents Jest from considering uuid's module-based exports at all; | ||
// it falls back to uuid's CommonJS+node "main" property. | ||
// | ||
// Once we're able to migrate our Jest config to ESM and a browser crypto | ||
// implementation is available for the browser+ESM version of uuid to use (eg, via | ||
// https://github.com/jsdom/jsdom/pull/3352 or a similar polyfill), this can go away. | ||
// | ||
// How to test if this is needed anymore: | ||
// - comment it out | ||
// - run `yarn test` | ||
// - if all the tests pass, it means the workaround is no longer needed | ||
if (pkg.name === 'uuid') { | ||
delete pkg['exports']; | ||
delete pkg['module']; | ||
} | ||
return pkg; | ||
}, | ||
}); | ||
}; |
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
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
2 changes: 1 addition & 1 deletion
2
packages/esm-patient-flags-app/src/patient-flags/patient-flags.component.tsx
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
4 changes: 2 additions & 2 deletions
4
packages/esm-patient-flags-app/src/patient-flags/patient-flags.scss
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,6 +1,6 @@ | ||
@use '@carbon/styles/scss/spacing'; | ||
@import '~@openmrs/esm-styleguide/src/vars'; | ||
@import '~carbon-components/src/globals/scss/vars'; | ||
|
||
.flagContainer { | ||
margin: $spacing-05; | ||
margin: spacing.$spacing-05; | ||
} |
16 changes: 9 additions & 7 deletions
16
packages/esm-patient-flags-app/src/patient-flags/patient-flags.test.tsx
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
Empty file.
Oops, something went wrong.