-
Notifications
You must be signed in to change notification settings - Fork 8k
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 use of npm ls
in grunt tasks
#11965
Conversation
The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too.
Is this expected?
|
Can we remove npm from dev dependencies? |
No, and I'm not seeing that locally, can you run and pass |
I cleared out node modules and it's fine now, sorry about that. Maybe I had some local changes.
|
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.
Looking good. I tested on both windows and linux, diffed the notice files, and broke a few licenses.
Everything looked fine except the node.js license and base_notice.txt are copied over twice to the final notice file.
Also noting I ran into the same path must be a string issue on windows too, until I did another npm install. My deps were a few weeks out of date. |
So far this is looking good to me as well. When diffing the two |
756c1e9
to
e5a4839
Compare
@jbudz @tylersmalley Sorry, I should have known this was coming. The issue is that Fixed this in e5a4839 |
Here is my diff after running
Looks like this is the behavior in master too, but e5a4839 removes it and I'm confident that's fine/good. |
@spalger I am seeing the same diff and agree we should remove the kibana package bundle. LGTM |
a80c43e
to
60bf904
Compare
60bf904
to
596fa03
Compare
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator (cherry picked from commit 5c04ff6)
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator (cherry picked from commit 5c04ff6)
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator (cherry picked from commit 5c04ff6)
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator (cherry picked from commit 5c04ff6)
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator (cherry picked from commit 5c04ff6)
* [grunt/build] refactor _build:notice task to not depend on npm The _build:notice task used to rely on the output of `npm ls` to determine where modules were defined, but the task now just asks `license-checker` to include the `realPath` of the modules it describes in it's output, which is ultimately the same thing but works with `yarn` too. * [grunt/licenses] convert to use lib/packages/getInstalledPackages() * [grunt/notice/generate] test generateNoticeText() * [grunt/licenses] tested assertLicensesValid() * [npm] remove npm dev dep * [tasks/lib/packages] do not include kibana in "installed packages" * [tasks/lib/notice] join all notices with the same separator
In order to transition to yarn we have to remove our dependency on
npm ls
, which is currently being used in the grunt tasks to get the paths for modules. To remove this dependency, this pr passes thecustomFormat
argument tolicense-checker
, which adds the directory for each module to its output that already included every installed npm package.The two tasks using
npm ls
arelicenses
and_build:notice
. Now both of those tasks use thegetInstalledPackages()
function fromtasks/lib
to fetch a list of packages (created with thelicense-checker
module then normalized) and then pass the list of packages to eitherassertValidLicenses()
orgenerateNoticeText()
, also fromtasks/lib
.Care was taken to not bind the logic to grunt directly so that we can move away from grunt for these tasks someday.