question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: add hoist command

See original GitHub issue

hoist

Take a property from multiple package.json files and merge them into the target package.json. When hoisting dependencies and multiple sources contain the same dependency, the newest version will be used. When hoisting scripts with the same name, they will be namespaced on the target like so “build:packagename”.

Options

-s, --source [pattern]  glob pattern for package.json files to read from
-t, --target [pattern]  glob pattern for package.json files to write to
-p, --prop [name]       path to property to hoist
-e, --exclude [name]    path to property to exclude from hoisting
-i, --indent [value]    override indentation. defaults to "  "
-h, --help              output usage information

Examples

# uses packages defined in lerna.json as default sources and ./package.json as default target
syncpack hoist --prop "devDependencies"
# nested properties can be hoisted like this
syncpack hoist --prop "devDependencies.gulp"
# properties can be excluded like this
syncpack hoist --prop "devDependencies" --exclude "devDependencies.jest"
# uses packages defined by --source and --target when provided
syncpack hoist --prop "devDependencies" --source "apps/*/package.json" --target "package.json"
# multiple sources can be provided like this
syncpack hoist --prop "devDependencies" --source "apps/*/package.json" --source "core/*/package.json"
# multiple targets can be provided like this
syncpack hoist --prop "devDependencies" --source "packages/foo/package.json" --target "packages/bar/package.json" --target "packages/baz/package.json"
# multiple properties can be provided like this
syncpack hoist --prop "devDependencies" --prop "scripts"
# indent package.json with 4 spaces instead of 2
syncpack hoist --prop "devDependencies" --indent "    "

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
AlexHaytoncommented, Aug 21, 2018

This sounds really useful! Would also need a list of deps not to hoist (e.g. jest)

1reaction
ecraig12345commented, Jul 15, 2022

@JamieMason Haha thanks, though better-deps is definitely still early/experimental stage, and I’m not sure long-term whether it makes sense as its own tool or would be better to combine the functionality into one or more existing tools (such as syncpack). I hadn’t thought about hoisting as something syncpack could handle, but I can see how that would make sense.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pnpm i should not require the --shamefully-hoist option #9834
When installing a front-end dependency with pnpm i, I do not want to have to provide the --shamefully-hoist option. Yet I still want...
Read more >
Lerna from a DevOps point of view - LinkedIn
Lerna lets you install and link all shared dependencies among the microservices of the monorepo using symlinks i.e. it provides the ability to ......
Read more >
Creating a hoist key - Vectorworks
The Create Hoist Symbol Key command generates a key showing the various hoist symbols used in the file. To create a hoist key:...
Read more >
Hoist Automation - Technic Inc.
Technic hoist control systems offer a complete array of controls to meet each customer's production and process control needs.
Read more >
NAVFAC P-307 | Navy Tribe
This publication provides the uniform Navy program for the management, maintenance, inspection, testing, certification, alteration, repair, and operation of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found