Download node/node_modules/npm/lib/utils/update-workspaces.js from codekingpro/portable-devtools: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/update-workspaces.js
- Command line
-
hf download hf://datasets/codekingpro/portable-devtools@df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/update-workspaces.js
-
curl -L -o update-workspaces.js https://huggingface.co/datasets/codekingpro/portable-devtools/resolve/df58e70f9edde36aaca2d2aacc2440dd6c2f807d/node/node_modules/npm/lib/utils/update-workspaces.js
1.03 kB
| const reifyFinish = require('../utils/reify-finish.js') | |
| async function updateWorkspaces ({ | |
| config, | |
| flatOptions, | |
| localPrefix, | |
| npm, | |
| workspaces, | |
| }) { | |
| if (!flatOptions.workspacesUpdate || !workspaces.length) { | |
| return | |
| } | |
| // default behavior is to not save by default in order to avoid race condition problems when publishing multiple workspaces that have dependencies on one another | |
| // it might still be useful in some cases, which then need to set --save | |
| const save = config.isDefault('save') | |
| ? false | |
| : config.get('save') | |
| // runs a minimalistic reify update, targeting only the workspaces that had version updates and skipping fund/audit/save | |
| const opts = { | |
| ...flatOptions, | |
| audit: false, | |
| fund: false, | |
| path: localPrefix, | |
| save, | |
| } | |
| const Arborist = require('@npmcli/arborist') | |
| const arb = new Arborist(opts) | |
| await arb.reify({ ...opts, update: workspaces }) | |
| await reifyFinish(npm, arb) | |
| } | |
| module.exports = updateWorkspaces | |