-
Notifications
You must be signed in to change notification settings - Fork 482
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
Remove dependency on isomorphic-fetch #1616
Changes from 2 commits
dc69a9b
6166934
22ce648
9a40a35
3d79af3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,11 @@ | |
// This code will generate changelog entries | ||
|
||
const { readFile } = require('fs'); | ||
const { promisify } = require('util'); | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const fetch = require('isomorphic-fetch'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this dep altogether? It's a polyfill for browsers, but we're using this script only with node.js There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yurishkuro Yes, it can be removed. @Yushmanth-reddy Here's some instructions to go ahead // ... (rest of the code)
const { readFile } = require('fs').promises; // Use native fs.promises.readFile
// ... (rest of the code)
// Remove the following line since 'promisify' is not required anymore
// const { promisify } = require('util');
// ... (rest of the code)
// Modify this function to use native fs.promises.readFile
// const readFilePromise = promisify(readFile);
// Instead, use the following line to define readFilePromise
// const readFilePromise = readFile;
// ... (rest of the code)
// No other changes are required in the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, thanks @anshgoyalevil |
||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const jsdom = require('jsdom'); | ||
const { promisify } = require('util'); | ||
|
||
const readFilePromise = promisify(readFile); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was that needed to be moved from
devDependencies
todependencies
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after changing scripts/get-changelog.js there was an error ('isomorphic-fetch' should be listed in the project's dependencies, not devDependencies). So I modified it and it worked fine.