{"id":15537355,"url":"https://github.com/nullvoxpopuli/pnpm-sync-dependencies-meta-injected","last_synced_at":"2025-10-30T08:11:14.195Z","repository":{"id":170841318,"uuid":"647096429","full_name":"NullVoxPopuli/pnpm-sync-dependencies-meta-injected","owner":"NullVoxPopuli","description":"Temp work-around while https://github.com/pnpm/pnpm/pull/6135 is iterated on","archived":false,"fork":false,"pushed_at":"2024-05-06T21:00:08.000Z","size":520,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-09T08:33:45.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NullVoxPopuli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T03:51:48.000Z","updated_at":"2024-08-08T02:42:39.000Z","dependencies_parsed_at":"2024-05-06T22:23:40.867Z","dependency_job_id":null,"html_url":"https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected","commit_stats":null,"previous_names":["nullvoxpopuli/pnpm-sync-dependencies-meta-injected"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fpnpm-sync-dependencies-meta-injected","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fpnpm-sync-dependencies-meta-injected/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fpnpm-sync-dependencies-meta-injected/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NullVoxPopuli%2Fpnpm-sync-dependencies-meta-injected/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NullVoxPopuli","download_url":"https://codeload.github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233626866,"owners_count":18704811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T11:56:23.557Z","updated_at":"2025-10-30T08:11:09.163Z","avatar_url":"https://github.com/NullVoxPopuli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pnpm-sync-dependencies-meta-injected`\n\n\n- Do you use [`dependenciesMeta.*.injected = true`](https://pnpm.io/package_json#dependenciesmetainjected)?\n- Are you tired of the fight against the balance between ergonomics and \"dependencies being correct\"?\n\n_This package will solve all your problems!_\n\n## Setup\n\n1. Install the dependency.\n\n    ```bash\n    pnpm i pnpm-sync-dependencies-meta-injected -D\n    ```\n\n2. In each of your projects that declare a `dependenciesMeta.*.injected = true`, add a `_syncPnpm` script in your package.json:\n    ```js\n    \"_syncPnpm\": \"pnpm sync-dependencies-meta-injected\"\n    ```\n\n3. 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.\n    ```js\n    \"start\": \"concurrently 'ember serve' 'pnpm _syncPnpm --watch' --names 'tests serve,tests sync deps'\",\n    ```\n    By using [`concurrently`](https://github.com/open-cli-tools/concurrently), we can run our dev server as well as the `_syncPnpm` task in watch mode in parallel.\n\n\n## If you use turborepo\n\nWhen using turborepo, we can automatically sync the injected dependencies for all tasks defined in turbo.json\n    \n1. In your `turbo.json`, configure a `_syncPnpm` task:\n    ```js\n    \"_syncPnpm\": {\n      \"dependsOn\": [\"^build\"],\n      \"cache\": false\n    },\n    ```\n    It must not have a cache, because we need to modify the `.pnpm` directory in the top-level `node_modules` folder.\n\n2. 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.\n    ```diff\n      \"test\": {\n        \"outputs\": [],\n    -   \"dependsOn\": [\"^build\"]\n    +   \"dependsOn\": [\"_syncPnpm\"]\n      },\n\n      \"build\": {\n        \"outputs\": [\"dist/**\"],\n    -   \"dependsOn\": [\"^build\"]\n    +   \"dependsOn\": [\"_syncPnpm\"]\n      },\n    // etc\n    ```\n\n\n## Debug\n\nAdd\n```bash\nDEBUG=sync-pnpm\n```\nbefore the invocation.\n\nExample of adding to the package.json#scripts\n\n```js\n\"_syncPnpm\": \"DEBUG=sync-pnpm pnpm sync-dependencies-meta-injected\"\n```\n\nOr on-the-fly:\n```bash\nDEBUG=sync-pnpm pnpm _syncPnpm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullvoxpopuli%2Fpnpm-sync-dependencies-meta-injected","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullvoxpopuli%2Fpnpm-sync-dependencies-meta-injected","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullvoxpopuli%2Fpnpm-sync-dependencies-meta-injected/lists"}