@ogre-tools/linkable
TypeScript icon, indicating that this package has built-in type declarations

17.11.1 • Public • Published

Linkable

A substitute for $ npm link which extends library yalc with ability to link to multiple modules using wildcard-paths.

Reinventing $ npm link is necessary, because it stumbles when symlinks created by it lead to places which have their local node_modules, which will unnaturally take precedence over peerDependencies causing poisonous multiple instances in runtime.

The downside of linkable is that, unlike npm link, linkable requires linkable-push to "refresh" the targets of linking to those linking.

Usage

  1. In linking source:
    1. $ npm install --save-dev @ogre-tools/linkable
    2. Add scripts: { "postinstall": "linkable" } to package.json.
    3. Add lines to .gitignore for new stuff related only for local development:
      1. .linkable.json
      2. .yalc
      3. yalc.lock
    4. Create a configuration file: .linkable.json to project root with your preference of paths to local module directories under development, eg.:
[
  "../some-module",
  "/some-monorepo/packages/**"
]
  1. In linking target:

    1. Also $ npm install --save-dev @ogre-tools/linkable
    2. Add scripts: { "postbuild": "linkable-push" } to package.json.
    3. $ npm build
  2. $ npm install in linking source will now create "live" yalc-links to packages defined in .linkable.json. When the target packages are linkable-push:ed as result from being built, the source(s) will pick up the changes.

Readme

Keywords

none

Package Sidebar

Install

npm i @ogre-tools/linkable

Weekly Downloads

390

Version

17.11.1

License

MIT

Unpacked Size

352 kB

Total Files

27

Last publish

Collaborators

  • iku-turso
  • jansav