New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

syncpack

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncpack - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

dist/bin-copy-values.js

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.3.0"></a>
# [0.3.0](https://github.com/JamieMason/syncpack/compare/0.2.1...0.3.0) (2017-08-22)
### Features
* **cli:** add copy-values command ([b51a2c9](https://github.com/JamieMason/syncpack/commit/b51a2c9))
<a name="0.2.1"></a>

@@ -2,0 +12,0 @@ ## [0.2.1](https://github.com/JamieMason/syncpack/compare/0.2.0...0.2.1) (2017-08-20)

27

dist/bin.js

@@ -12,27 +12,10 @@ #!/usr/bin/env node

var _log = require('./lib/log');
var _constants = require('./constants');
var log = _interopRequireWildcard(_log);
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var patternValue = void 0;
_commander2.default.version(_package.version).command('sync-versions', 'synchronise dependency versions between packages', {
isDefault: true
}).command('copy-values <keys...>', 'copy values from eg. ' + _constants.DEFAULT_SOURCE + ' to ' + _constants.DEFAULT_PACKAGES);
_commander2.default.version(_package.version).arguments('[pattern]').action(function (pattern) {
patternValue = pattern;
});
_commander2.default.parse(process.argv);
(0, _index2.default)({
pattern: patternValue
}).catch(function (err) {
log.bug('uncaught error in syncpack', err);
process.exit(1);
});
_commander2.default.parse(process.argv);
{
"name": "syncpack",
"description": "Normalise differences in packages/*/package.json files in Lerna Monorepos",
"version": "0.2.1",
"version": "0.3.0",
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
"bin": {
"syncpack": "dist/bin.js"
"syncpack": "dist/bin.js",
"syncpack-sync-versions": "dist/bin-sync-versions.js",
"syncpack-copy-values": "dist/bin-copy-values.js"
},

@@ -15,2 +17,3 @@ "bugs": "https://github.com/JamieMason/syncpack/issues",

"glob": "7.1.2",
"lodash": "4.17.4",
"nodent-runtime": "3.0.4",

@@ -17,0 +20,0 @@ "semver": "5.4.1"

@@ -7,10 +7,54 @@ # syncpack

[![Dependency Status](http://img.shields.io/david/JamieMason/syncpack.svg?style=flat-square)](https://david-dm.org/JamieMason/syncpack)
[![Code Climate](https://img.shields.io/codeclimate/github/JamieMason/syncpack.svg?style=flat-square)](https://codeclimate.com/github/JamieMason/syncpack)
[![Join the chat at https://gitter.im/JamieMason/syncpack](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/JamieMason/syncpack)
[![Analytics](https://ga-beacon.appspot.com/UA-45466560-5/syncpack?flat&useReferer)](https://github.com/igrigorik/ga-beacon)
<br>
[![Donate via Gratipay](https://img.shields.io/gratipay/user/JamieMason.svg)](https://gratipay.com/~JamieMason/)
[![Follow JamieMason on GitHub](https://img.shields.io/github/followers/JamieMason.svg?style=social&label=Follow)](https://github.com/JamieMason)
[![Follow fold_left on Twitter](https://img.shields.io/twitter/follow/fold_left.svg?style=social&label=Follow)](https://twitter.com/fold_left)
Synchronises the versions of dependencies used across multiple `package.json` files, such as
`packages/*/package.json` in [Lerna](https://lernajs.io) Monorepos.
Synchronises the contents of multiple `package.json` files, such as `packages/*/package.json` in
[Lerna](https://lernajs.io) Monorepos.
## Overview
## Contents
* [Installation](#installation)
* [Usage](#usage)
* [`sync-versions`](#sync-versions)
* [`copy-values`](#copy-values)
## Installation
```
npm install --global syncpack
```
## Usage
```
Usage: syncpack [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
sync-versions synchronise dependency versions between packages
copy-values <keys...> copy values from eg. ./package.json to ./packages/*/package.json
help [cmd] display help for [cmd]
```
### `sync-versions`
```
Usage: syncpack sync-versions [options]
Options:
-p, --packages <glob> location of packages. defaults to ./packages/*/package.json
-h, --help output usage information
```
Imagine the packages `guybrush`, `herman`, and `elaine` all have `react` as a dependency, but

@@ -29,25 +73,64 @@ versions `'15.4.0'`, `'15.5.4'`, and `'15.6.1'` respectively.

Running `syncpack` will update each `package.json` to use version `'15.6.1'` of `react` in
`dependencies`, `devDependencies`, and `peerDependencies` as needed.
To update each `package.json` to use version `'15.6.1'` of `react` in `dependencies`,
`devDependencies`, and `peerDependencies` (as needed) you can run
## Installation
```
syncpack sync-versions
```
### `copy-values`
```
npm install --global syncpack
Usage: syncpack copy-values [options] <keys...>
Options:
-p, --packages <glob> location of packages. defaults to ./packages/*/package.json
-s, --source <glob> location of source. defaults to ./package.json
-h, --help output usage information
```
## Usage
Imagine the packages `carla` and `murray` were previously hosted at their own repositories, but are
now part of your new Monorepo.
### Command Line
```
/Users/foldleft/Dev/monorepo/packages/
├── carla
│   └── package.json
└── murray
└── package.json
```
With the following contents
```
Usage: syncpack [options] [pattern]
"bugs": "https://github.com/Scumm/carla/issues",
"homepage": "https://github.com/Scumm/carla#readme",
"repository": "Scumm/carla",
```
Options:
```
"bugs": "https://github.com/Scumm/murray/issues",
"homepage": "https://github.com/Scumm/murray#readme",
"repository": "Scumm/murray",
```
-h, --help output usage information
-V, --version output the version number
To copy these fields from your Monorepo's `package.json` to each of its packages, you can run
```
syncpack copy-values bugs homepage repository
```
The default pattern of `'./packages/*/package.json'` can be overridden as follows
`syncpack './**/package.json'`
to copy the value of those properties, leaving them like so
```
"bugs": "https://github.com/Scumm/monorepo/issues",
"homepage": "https://github.com/Scumm/monorepo#readme",
"repository": "Scumm/monorepo",
```
to copy deeply nested values, pass the path to the key as follows
```
syncpack copy-values scripts.test
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc