Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pnpm-sync-dependencies-meta-injected

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pnpm-sync-dependencies-meta-injected

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pnpm-sync-dependencies-meta-injected

  • Do you use dependenciesMeta.*.injected = true?
  • Are you tired of the fight against the balance between ergonomics and "dependencies being correct"?

This package (with turborepo) will solve all your problems!

Setup

  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 each of your projects that declare a dependenciesMeta.*.injected = true, add a _syncPnpm script in your package.json:

    "_syncPnpm": "DEBUG=sync-pnpm pnpm sync-dependencies-meta-injected"
    
  3. In each of your projects now 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 the built 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.

  4. in your turbe.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": ["_syncPnpm", "^build"]
    },
    
    "build": {
      "outputs": ["dist/**"],
      "dependsOn": ["_syncPnpm", "^build"]
    },
    // 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"

FAQs

Package last updated on 22 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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