1.7.0 • Published 6 months ago

@piotar/pkg-sync v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

pkg-sync

GitHub package.json version npm (scoped) node-current (scoped) NPM

A utility for synchronization multiple packages, without any symlinks and any changes in source projects(package.json, etc.).

It is a simple application to watching and copying files from project to another project using CLI.

Installation

npm install -g @piotar/pkg-sync

Usage

In some cases, we can not use symbolic links for dependencies. The solution is to copy build files to our project and test it locally.

Example

We have a main project (App) and 2 dependencies (Ui and Store) with difference locations (this is not monorepository).

~
├── projects
│   └── App
│       ├── node_modules
│       ├── package.json
│       └── etc...
└── external
    ├── Ui
    │   ├── node_modules
    │   ├── package.json
    │   └── etc...
    └── Store
        ├── node_modules
        ├── package.json
        └── etc...

First of all, we need to add dependencies to pkg-sync.

  1. Go to directories ~/external/Ui and ~/external/Store.
  2. Run command pkg-sync add . with each directory.
  3. Go to ~/projects/App directory.
  4. Run command pkg-sync sync .. This will copy dependency files and start watching for changes.

That's it... Points 1-2 are only necessary for the first run.

Commands

add options

Usage: pkg-sync add [options] [path]

Add package to sync

Arguments:
  path                  Path to package (path not set will be set to closest package.json)

Options:
  -n, --name <package>  Package name (override name from package.json)
  -f, --force           Override package
  -d, --dir [dirs...]   Directory to watch (override default values)
  -h, --help            display help for command

remove|rm options

Usage: pkg-sync remove|rm [options] [packages...]

Remove package from sync

Arguments:
  packages           Package name (name set as "." will be set from closest package.json)

Options:
  -i, --interactive  Interactive mode (default: false)
  -a, --all          Remove all stored packages (default: false)
  -h, --help         display help for command

list|ls

Usage: pkg-sync list|ls [options]

Show all stored packages

Options:
  -h, --help  display help for command

validate options

Usage: pkg-sync validate [options] [path]

Show coverage packages from project

Arguments:
  path                  Path to package (path not set will be set to closest package.json)

Options:
  -d, --depth [number]  Deep search of dependencies (default: 2, preset: 2)
  -h, --help            display help for command

sync options packages...

Usage: pkg-sync sync [options] [path] [packages...]

Sync and watch packages in project

Arguments:
  path                  Path to package (path not set will be set to closest package.json)
  packages              Package name to sync

Options:
  --no-watch            Disable watch files after sync
  -i, --interactive     Interactive mode (default: false)
  -d, --depth [number]  Deep search of dependencies (default: 2, preset: 2)
  -h, --help            display help for command

update-check

Usage: pkg-sync update-check [options]

Check version of 'pkg-sync'

Options:
  -h, --help  display help for command

config

Usage: pkg-sync config [options] [command]

Config

Options:
  -h, --help         display help for command

Commands:
  set <key> <value>  Set config
  get [key]          Get config
  restore            Restore config to default
  help [command]     display help for command
1.7.0

6 months ago

1.5.2

10 months ago

1.6.0

6 months ago

1.5.0

12 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago