-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to jest v24-26 and babel to version 7 #182
Labels
good first issue
Good for newcomers
Comments
bors bot
added a commit
that referenced
this issue
Jan 13, 2021
193: Remove yars parser vulnerability r=bidoubiwa a=bidoubiwa This PR fixes: #182 and #123 This has been done by doing the following: - Removing all v6.0 dependencies - Adding all v7.0> dependencies - Remove `-q` flag that was not compatible with `babel-cli` v7.0 > - Remove outdated test-coverage that was not used. A newer way of test-coverage compatible with babel v7.0 should be looked for ## Fix failing search After the update of webpack from 4.* to 5.* some additional parameters are expected for the results we want to have. **1** in `index.js` we previously used both ES syntax and CommonJs syntax, which resulted in the following error: `Uncaught TypeError: "exports" is read-only` **2** webpack now adds the modules inside the `window` object and because we used a `default` export it was only accessible at `window.docSearchBar.default()`. ```javascript // index.js /* eslint-disable import/no-commonjs */ import docsSearchBar from './src/lib/main'; export default docsSearchBar; ``` Fortunately webpack has an option to solve this issue: > # libraryExport > Configure which module or modules will be exposed via the libraryTarget. It is undefined by default, same behaviour will be applied if you set libraryTarget to an empty string e.g. '' it will export the whole (namespace) object. The examples below demonstrate the effect of this configuration when using libraryTarget: 'var'. > >The following configurations are supported: > > libraryExport: 'default' - The default export of your entry point will be assigned to the library target: > ``` > // if your entry has a default export of `MyDefaultModule` > var MyDefaultModule = _entry_return_.default; >``` Co-authored-by: Charlotte Vermandel <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because or Jest version is v23 we have vulnerabilities caused by
yargs-parser
.We tried to fix it by using the resolutions, this introduced more problems. Also, resolutions are patches and not a solution.
linked issue: jestjs/jest#7424
This vulnerability has been fixed in jest
v24>
Jest version 24 uses Babel 7:
https://jestjs.io/blog/2019/01/25/jest-24-refreshing-polished-typescript-friendly#typescript-support
But we use a previous version that is not compatible with jest v24.
To fix this problem properly we should consider upgrading jest to v24 or higher and babel to version 7.
The text was updated successfully, but these errors were encountered: