Yarn: bundledDependencies don't get packed as of >= v0.19.0

Created on 5 Feb 2017  ·  3Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
BUG

What is the current behavior?
yarn pack does not package bundledDependecies in v0.19.0, v0.19.1 and v0.20.0

If the current behavior is a bug, please provide the steps to reproduce.

{
  "name": "test-bundled-deps",
  "version": "0.0.0",
  "dependencies": {
    "bcryptjs": "^2.0.0",
  },
  "bundledDependencies": [
    "bcryptjs",
  ]
}

then run yarn followed by yarn pack
check the tgz file. It will not contain the node_modules folder.

What is the expected behavior?
to work as in version 0.18.1
Please mention your node.js, yarn and operating system version.

$ node -v
v7.4.0

OS X El Capitan 10.11.6

cat-bug good first issue help wanted high-priority triaged

Most helpful comment

@bestander: I've added a PR with a failing test case (#4598).

With a project setup specified in the test fixture, running npm install and npm pack the resulting archive will contain a node_modules directory containing the bundled dependencies. Performing the same commands using yarn the archive does not contain the bundled dependencies.

All 3 comments

Would seem to at least be caused by:-

  • 'node_modules' being added to FOLDERS_IGNORE d1d5343082cd5a3b2020962c0bb6f2d6fb1ac4f3
  • Accessing of bundledDependencies incorrect in commands/pack.js:-

    • src/cli/commands/pack.js: const {bundledDependencies, main, files: onlyFiles} = pkg;

    • src/util/normalize-manifest/fix.js: info.bundleDependencies = info.bundledDependencies;

    • src/util/normalize-manifest/fix.js: delete info.bundledDependencies;

Resolving those gives me node_modules/module in the packed .tgz but no subdirectories/files.

A PR with a test is welcome

@bestander: I've added a PR with a failing test case (#4598).

With a project setup specified in the test fixture, running npm install and npm pack the resulting archive will contain a node_modules directory containing the bundled dependencies. Performing the same commands using yarn the archive does not contain the bundled dependencies.

Was this page helpful?
0 / 5 - 0 ratings