Project

General

Profile

Actions

Bug #33317

open

better differentiate between build, develop and test dependencies for JavaScript

Added by Evgeni Golov over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
JavaScript stack
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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 2 (0 open2 closed)

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

Updated by Evgeni Golov over 2 years ago

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

Updated by Evgeni Golov over 2 years ago

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

Updated by Evgeni Golov over 2 years 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 :(

Actions

Also available in: Atom PDF