Project

General

Profile

Bug #33317

better differentiate between build, develop and test dependencies for JavaScript

Added by Evgeni Golov over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
JavaScript stack
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Ohai,

today, when I run "npm i" in Foreman core, it looks roughly like this:

22:30:38 added 1616 packages from 759 contributors and audited 1640 packages in 137.236s
22:31:08 added 4250 packages from 2660 contributors in 726.496s

Yes, two outputs, as the second one is coming from script/npm-fix-foreman-stories.sh which is executed as the postinstall step in our package.json.

This is slowing down various steps where we always start from a fresh checkout, and is IMHO improvable.

See https://community.theforeman.org/t/speeding-up-debian-package-builds/24957 for a few numbers ;)

My question here is: is there a good way in the JavaScript ecosystem to mark different (dev)Dependencies for different tasks? In the Ruby (and Python) world we can define arbitrary named groups, and then tell "don't install group X" -- I couldn't find anything like that for JavaScript? :(


Related issues

Related to Foreman - Feature #33318: provide a list of JavaScript dependencies that can be ignored during package buildingClosed
Related to Foreman - Bug #33319: don't run npm-fix-foreman-stories.sh on every npm installClosed

History

#1 Updated by Evgeni Golov over 1 year ago

  • Related to Feature #33318: provide a list of JavaScript dependencies that can be ignored during package building added

#2 Updated by Evgeni Golov over 1 year ago

  • Related to Bug #33319: don't run npm-fix-foreman-stories.sh on every npm install added

#3 Updated by Evgeni Golov over 1 year ago

Yarn supports "dependenciesMeta" (https://yarnpkg.com/configuration/manifest): This field lists some extra information related to the dependencies listed in the dependencies and devDependencies fields.

Which has an "optional" field, that is documented as "If true, the build isn't required to succeed for the install to be considered a success. It's what the optionalDependencies field compiles down to."

So we could tag the non-required deps with that? But NPM doesn't seem to have that :(

Also available in: Atom PDF