-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[eslint-plugin-specs] fix npm lifecycle hook #34273
Closed
Closed
Conversation
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
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Contributor
A React Native contributor.
p: Microsoft
Partner: Microsoft
Partner
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
labels
Jul 26, 2022
Base commit: 743f9ff |
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @kelset in 8441c4a. When will my fix make it into a release? | Upcoming Releases |
dmytrorykun
pushed a commit
that referenced
this pull request
Jul 26, 2022
Summary: In `0.70-stable` we started seeing `yarn run lint` fail; turns out, this is happening because the latest release of `react-native/eslint-plugin-specs` 0.0.4 (from ea8d8e2) is faulty: the underlying reason is that since 0.0.2 there was this local workaround in place 2d06e6a (that changes a flag from false to true) but in NPM 8 the lifecycle hook `prepublish` has [been deprecated](https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts) so this pre publishing script to change the flag was not run (you can easily verify by checking the node_module and see `react-native-modules.js` the flag on L17 is set to false). This PR addresses it by moving to the new lifecycle hook `prepack` (and modifies the other files accordingly). After this PR is merged, we'll need to cherry pick it into 0.70 and do both a new release from the 0.70 branch and one from the main branch to have new versions of this module with the flag set correctly. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [General] [Fixed] - Fix eslint-plugin-specs prepack npm lifecycle hook now that we use npm 8 Pull Request resolved: #34273 Test Plan: Go in the `eslint-plugin-specs` folder, run `npm pack`, unzip the generated tar file, go into `package`, verify that L17 of `react-native-modules.js` is correctly changed to `const PACKAGE_USAGE = true;` (instead of false - which is what happen without this fix). Reviewed By: GijsWeterings Differential Revision: D38151433 Pulled By: dmitryrykun fbshipit-source-id: 7c4f13dae70eb731d57cbafa90f7be05c9bb8576
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Contributor
A React Native contributor.
Merged
This PR has been merged.
p: Microsoft
Partner: Microsoft
Partner
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
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.
Summary
In
0.70-stable
we started seeingyarn run lint
fail; turns out, this is happening because the latest release of@react-native/eslint-plugin-specs
0.0.4 (from ea8d8e2) is faulty: the underlying reason is that since 0.0.2 there was this local workaround in place 2d06e6a (that changes a flag from false to true) but in NPM 8 the lifecycle hookprepublish
has been deprecated so this pre publishing script to change the flag was not run (you can easily verify by checking the node_module and seereact-native-modules.js
the flag on L17 is set to false).This PR addresses it by moving to the new lifecycle hook
prepack
(and modifies the other files accordingly).After this PR is merged, we'll need to cherry pick it into 0.70 and do both a new release from the 0.70 branch and one from the main branch to have new versions of this module with the flag set correctly.
Changelog
[General] [Fixed] - Fix eslint-plugin-specs prepack npm lifecycle hook now that we use npm 8
Test Plan
Go in the
eslint-plugin-specs
folder, runnpm pack
, unzip the generated tar file, go intopackage
, verify that L17 ofreact-native-modules.js
is correctly changed toconst PACKAGE_USAGE = true;
(instead of false - which is what happen without this fix).