Skip to content
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 glob to v7.1.1 #11893

Closed
wants to merge 2 commits into from
Closed

Upgrade glob to v7.1.1 #11893

wants to merge 2 commits into from

Conversation

hawkrives
Copy link
Contributor

Explain the motivation for making this change. What existing problem does the pull request solve?

Of the three dependencies I have that rely on glob, react-native is the only one not on 7.x. If react-native can upgrade, then npm can deduplicate the glob dependency.

$ npm ls glob
├─┬ eslint@3.13.1
│ └── glob@7.1.1
├─┬ jest@18.1.0
│ └─┬ jest-cli@18.1.0
│   └─┬ istanbul-api@1.1.0
│     ├─┬ fileset@2.0.3
│     │ └── glob@7.1.1
│     ├─┬ istanbul-lib-report@1.0.0-alpha.3
│     │ └─┬ rimraf@2.5.4
│     │   └── glob@7.1.1
│     └─┬ istanbul-lib-source-maps@1.1.0
│       └─┬ rimraf@2.5.4
│         └── glob@7.1.1
└─┬ react-native@0.39.2
  ├── glob@5.0.15
  └─┬ rimraf@2.5.4
    └── glob@7.1.1

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. Make sure tests pass on both Travis and Circle CI.

There are three breaking changes since v5.0.15, as taken from node-glob/changelod.md:

  • v6.0
    • Remove comment and negation pattern support
    • Ignore patterns are always in dot:true mode
  • v7.0
    • Raise error if options.cwd is specified, and not a directory

I ran npm run test, and all tests passed locally. I also quickly grepped the codebase, to see if it used any of those breaking changes.

There are three places that specify cwd:

  1. local-cli/core/android/findPackageClassName.js:22

    • const files = glob.sync('**/*.java', { cwd: folder });
  2. local-cli/core/windows/findNamespace.js:22

    • const files = glob.sync('**/*.cs', { cwd: folder });
  3. local-cli/core/windows/findPackageClassName.js:22

    • const files = glob.sync('**/*.cs', { cwd: folder });

If folder doesn't exist on disk, I suppose that glob@7 will throw an error, and the react-native cli would need to catch it in order to gracefully exit?

Nothing appeared to use negation or comment patterns in a glob, from my limited explorations, and there did not seem to be anything that set the dot argument, so I believe that upgrading glob should be an easy change. Hopefully.

Let me know if I missed anything or if there's another reason that react-native is pinned to glob@5! I'm happy to do more work to let you all merge this, if you need me to.

Have a great week!

There are three breaking changes:

- 6.0
  - Remove comment and negation pattern support
  - Ignore patterns are always in dot:true mode
- 7.0
  - Raise error if options.cwd is specified, and not a directory

I ran `npm run test`, and all tests passed locally. I also quickly
grepped the codebase, to see if it used any of those breaking changes.

There are three places that specify `cwd`:

1. `local-cli/core/android/findPackageClassName.js:22`
  - `const files = glob.sync('**/*.java', { cwd: folder });`

2. `local-cli/core/windows/findNamespace.js:22`
  - `const files = glob.sync('**/*.cs', { cwd: folder });`

3. `local-cli/core/windows/findPackageClassName.js:22`
  - `const files = glob.sync('**/*.cs', { cwd: folder });`

Nothing appeared to use negation or comment patterns in a glob,
from my limited explorations, and there did not seem to be anything 
that set the `dot` argument.

## Motivation
$ npm ls glob
├─┬ eslint@3.13.1
│ └── glob@7.1.1
├─┬ jest@18.1.0
│ └─┬ jest-cli@18.1.0
│   └─┬ istanbul-api@1.1.0
│     ├─┬ fileset@2.0.3
│     │ └── glob@7.1.1
│     ├─┬ istanbul-lib-report@1.0.0-alpha.3
│     │ └─┬ rimraf@2.5.4
│     │   └── glob@7.1.1
│     └─┬ istanbul-lib-source-maps@1.1.0
│       └─┬ rimraf@2.5.4
│         └── glob@7.1.1
└─┬ react-native@0.39.2
  ├── glob@5.0.15
  └─┬ rimraf@2.5.4
    └── glob@7.1.1

Of the three dependencies I have that rely on `glob`, react-native is the only one not on 7.x. If react-native upgrades, then npm can deduplicate the glob dependency.
@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @davidaurelio and @jeanlauliac to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 13, 2017
@hawkrives
Copy link
Contributor Author

As far as I can tell, Circle failed because of an unrelated error. I can't restart the job to test that theory, however.

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Mar 29, 2017
@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Mar 30, 2017
@facebook-github-bot
Copy link
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

thotegowda pushed a commit to thotegowda/react-native that referenced this pull request May 7, 2017
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

Of the three dependencies I have that rely on `glob`, react-native is the only one not on 7.x. If react-native can upgrade, then npm can deduplicate the glob dependency.

```console
$ npm ls glob
├─┬ eslint@3.13.1
│ └── glob@7.1.1
├─┬ jest@18.1.0
│ └─┬ jest-cli@18.1.0
│   └─┬ istanbul-api@1.1.0
│     ├─┬ fileset@2.0.3
│     │ └── glob@7.1.1
│     ├─┬ istanbul-lib-report@1.0.0-alpha.3
│     │ └─┬ rimraf@2.5.4
│     │   └── glob@7.1.1
│     └─┬ istanbul-lib-source-maps@1.1.0
│       └─┬ rimraf@2.5.4
│         └── glob@7.1.1
└─┬ react-native@0.39.2
  ├── glob@5.0.15
  └─┬ rimraf@2.5.4
    └── glob@7.1.1
```

**Test plan (required)**

> Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull req
Closes facebook#11893

Differential Revision: D4796721

Pulled By: javache

fbshipit-source-id: 6e7424dd731329f982c2f6c05b40dec8febf2e57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants