-
Notifications
You must be signed in to change notification settings - Fork 2
npm: update dependencies #21
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
Merged
Merged
Conversation
This file contains hidden or 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
I had intention to install locked dependencies and called `npm install` in the project directory first time. Surprisingly, it updates my `package-lock.json` with `lockfileVersion: 2` (was 1) and the new `packages` field. The documentation [1] says that it is the new lock file format for npm v7+, which is compatible with npm v6. Okay, let's move to the new format. FWIW, my versions are the following: | Package | Version | | ------- | ------- | | nodejs | 16.13.1 | | npm | 8.1.2 | [1]: https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json
`npm audit` says the following: | node-fetch <2.6.7 | Severity: high | node-fetch is vulnerable to Exposure of Sensitive Information to an | Unauthorized Actor - GHSA-r683-j2x4-v87g Why not to update? I called `npm audit fix`, which updates the `package-lock.json` file.
`npm install` says: | npm WARN deprecated @zeit/[email protected]: @zeit/ncc is no longer | maintained. Please use @vercel/ncc instead. Okay, why not? Updated.
Called `npm update` and committed the resulting `package-lock.json` file. There were no updates in the repository for several months and I think it is good time to perform some maintenance activities. Updating dependencies to latest compatible ones should be the right action at this point.
`npm run pre-checkin` (more precisely `tsc`) says the following: | src/main.ts:178:20 - error TS2571: Object is of type 'unknown'. | | 178 core.warning(error.message) | ~~~~~ | | src/main.ts:184:20 - error TS2571: Object is of type 'unknown'. | | 184 core.setFailed(error.message) | ~~~~~ | | | Found 2 errors. In the previous commit I called `npm update` and it updates TypeScript from 4.1.2 to 4.5.5. Since 4.4 it requires to explicitly check that a raised error is of type Error, when the strict mode is enabled (see [1]). We have the strict mode enabled in `tsconfig.json`. I also found that TypeScript 4.0 allows to mark a raised object as `unknown` explicitly (see [2]) and I considered it as the recommendation to apply. The similar change was applied in the TypeScript Action template (see [3]). [1]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#using-unknown-in-catch-variables [2]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#unknown-on-catch-clause-bindings [3]: actions/typescript-action#376
In previous commits I applied several maintenance changes: updated dependencies versions, fixed the source for TypeScript 4.4 and above. Now it is time to regenerate the resulting JavaScript file. I called `npm run pre-checkin` and committed the resulting `dist/main/index.js` file.
Described how to setup necessary environment and regenerate the resulting `index.js` file to ease a pathway of a first time contributor like me.
Make working on the project more engaging for ones who (like me) using Vim.
@rosik, please, take a look if time permits. |
GitHub removed Ubuntu Xenial (16.04) runners in Sep, 2021. See the announcement [1]. [1]: https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/
Yaroslav said: 👍. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think it is good time to perform some maintenance activities. I plan to propose several changes and it is good to renew obsolete things before start.
Changes in short:
ncc
(upstream is changed),node-fetch
(security) and runnpm update
.Full list of changes:
Consider commit messages for details.