0.0.13 • Published 2 days ago

pnpm-sync-dependencies-meta-injected v0.0.13

Weekly downloads
-
License
MIT
Repository
-
Last release
2 days ago

pnpm-sync-dependencies-meta-injected

This package will solve all your problems!

Setup

  1. Install the dependency.

    pnpm i pnpm-sync-dependencies-meta-injected -D
  2. In each of your projects that declare a dependenciesMeta.*.injected = true, add a _syncPnpm script in your package.json:

    "_syncPnpm": "pnpm sync-dependencies-meta-injected"
  3. In each of your projects that includes _syncPnpm, re-configure your project's start command to run _syncPnpm in watch mode so that you can continually work on your injected dependencies and have updates automatically re-synced as they are built.

    "start": "concurrently 'ember serve' 'pnpm _syncPnpm --watch' --names 'tests serve,tests sync deps'",

    By using concurrently, we can run our dev server as well as the _syncPnpm task in watch mode in parallel.

If you use turborepo

When using turborepo, we can automatically sync the injected dependencies for all tasks defined in turbo.json

  1. In your turbo.json, configure a _syncPnpm task:

    "_syncPnpm": {
      "dependsOn": ["^build"],
      "cache": false
    },

    It must not have a cache, because we need to modify the .pnpm directory in the top-level node_modules folder.

  2. In your turbo.json, configure each task that relies on ^build to also rely on _syncPnpm (no ^) -- this, combined with the above will sync the hard links that pnpm uses for dependenciesMeta.*.injected after the dependencies are built.

      "test": {
        "outputs": [],
    -   "dependsOn": ["^build"]
    +   "dependsOn": ["_syncPnpm"]
      },
    
      "build": {
        "outputs": ["dist/**"],
    -   "dependsOn": ["^build"]
    +   "dependsOn": ["_syncPnpm"]
      },
    // etc

Debug

Add

DEBUG=sync-pnpm

before the invocation.

Example of adding to the package.json#scripts

"_syncPnpm": "DEBUG=sync-pnpm pnpm sync-dependencies-meta-injected"

Or on-the-fly:

DEBUG=sync-pnpm pnpm _syncPnpm
0.0.11

3 days ago

0.0.12

3 days ago

0.0.13

2 days ago

0.0.10

8 months ago

0.0.9

9 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago