Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/pnpm-policy-inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ jobs:
- name: Build pnpm-policy
run: pnpm --filter 'pnpm-policy...' run build

# Invoked by path, not through the linked bin: pnpm resolves a workspace
# dependency to its `publishConfig.directory` only if that directory exists
# when the link is made, and here it is created by the build step above —
# after install. On a fresh checkout the bin therefore points at a cli.js
# that does not exist yet.
#
# The npm search endpoint is anonymous — no registry token needed — but it
# rate-limits bursts, so requests are spaced out.
- name: Query npm for what we publish
run: pnpm --filter @constructive-io/pnpm-policy exec pnpm-policy inventory --cwd . --throttle "${{ inputs.throttle || '1000' }}"
run: node packages/pnpm-policy/dist/cli.js inventory --cwd packages/constructive-pnpm-policy --throttle "${{ inputs.throttle || '1000' }}"

- name: Open a pull request if the inventory moved
env:
Expand Down
3 changes: 2 additions & 1 deletion packages/constructive-pnpm-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ Scopes become `@scope/*` globs, so a package published into one tomorrow is exem
## Refreshing

```bash
pnpm run refresh # pnpm-policy inventory --cwd .
pnpm --filter 'pnpm-policy...' run build # the sibling tool, if you have not built it
pnpm run refresh # pnpm-policy inventory --cwd .
```

Five throttled requests, a couple of seconds. In CI this runs weekly and **opens a pull request** rather than committing ([`pnpm-policy-inventory.yml`](../../.github/workflows/pnpm-policy-inventory.yml)): a name appearing in the diff is a name that stops being quarantined, so it gets read by a human before it lands. The npm search endpoint is anonymous, so the job needs no registry token — only `contents: write` and `pull-requests: write` to open the PR.
Expand Down
2 changes: 1 addition & 1 deletion packages/constructive-pnpm-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clean": "makage clean",
"copy": "makage assets",
"build": "makage clean && makage copy pnpm-policy.yaml inventory.json dist --flat && makage assets",
"refresh": "pnpm-policy inventory --cwd .",
"refresh": "node ../pnpm-policy/dist/cli.js inventory --cwd .",
"prepublishOnly": "npm run build"
},
"devDependencies": {
Expand Down
Loading