Skip to content

build(deps): use the published @posthog/warlock npm package#182

Merged
sarahxsanders merged 1 commit into
mainfrom
posthog-code/warlock-npm-package
Jun 10, 2026
Merged

build(deps): use the published @posthog/warlock npm package#182
sarahxsanders merged 1 commit into
mainfrom
posthog-code/warlock-npm-package

Conversation

@sarahxsanders

Copy link
Copy Markdown
Collaborator

What

Switches @posthog/warlock from the git dependency (git+https://github.com/PostHog/warlock.git) to the published npm package ^0.2.2, and drops the warlock build-script approvals that the git install needed.

Why now

The CI workflows install pnpm with version: latest. That just rolled over to pnpm v11, which tightened supply-chain safety: it blocks install/build scripts for git-hosted dependencies unless they're explicitly allow-listed in a specific git-spec format. The warlock is pulled from git and runs a build step on install, so v11's gate broke pnpm install repo-wide (ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED).

The published tarball ships pre-built (main: dist/index.js) with no install script, and its only dependency (@virustotal/yara-x) is a prebuilt WASM package with no install script either. So installing from the registry runs no build step at all, and v11 has nothing to gate. This fixes the failure at the root instead of pinning pnpm or hand-maintaining a SHA-pinned allowlist.

Changes

  • package.json — warlock dep git+...^0.2.2.
  • pnpm-workspace.yaml — removed the now-unnecessary @posthog/warlock entries from onlyBuiltDependencies and allowBuilds (kept esbuild).
  • pnpm-lock.yaml — regenerated; warlock now resolves to 0.2.2 from the registry, no git refs remain.

Verification (local, pnpm v10)

  • pnpm install resolves 0.2.2 from the registry, lockfile has zero warlock.git refs.
  • Package imports { scan, triageMatches, CATEGORIES } — exactly what scripts/scan-warlock.js uses.
  • WASM scanner runs and returns { matched, matches: [{ rule, metadata, matchedStrings }] }, the shape scan-warlock.js consumes (confirmed against a real shipped rule).
  • npm test passes (58/58).
  • CI's node scripts/scan-warlock.js dist/skills step (in build.yml) is the end-to-end integration check.

Heads-up for the reviewer

  • warlock 0.2.2 declares engines: node ^20.20.0 || >=22.22.0, slightly newer than this repo's >=20.11.0. CI uses node-version: lts/*, which satisfies it, but if anyone runs an older Node locally they may see an engines warning.
  • Independent of the in-flight CLI overhaul PR (feat(cli): cli overhaul #178); this targets main directly so it can land and unblock CI for everyone.

Created with PostHog Code

Switch @posthog/warlock from the git dependency
(git+https://github.com/PostHog/warlock.git) to the published registry
release (^0.2.2): https://www.npmjs.com/package/@posthog/warlock

Why now: the CI workflows install pnpm `version: latest`, which just
became pnpm v11. v11 blocks install/build scripts for git-hosted
dependencies unless they're allow-listed in a specific git-spec format.
The warlock is pulled from git and runs a build step on install, so
v11's gate broke `pnpm install` repo-wide. The published tarball ships
pre-built (main: dist/index.js) with no install script, so installing
from the registry runs no build step and v11 has nothing to gate.

Also drops the now-unnecessary warlock build-script approvals from
pnpm-workspace.yaml (onlyBuiltDependencies + allowBuilds). esbuild stays.

Verified locally (pnpm v10): lockfile resolves 0.2.2 from the registry
with no git refs; the package imports { scan, triageMatches, CATEGORIES };
the WASM scanner runs and returns { matched, matches: [{rule, metadata,
matchedStrings}] }, matching what scripts/scan-warlock.js consumes; and
npm test passes (58/58). CI's `scan-warlock.js dist/skills` step is the
end-to-end check.

Generated-By: PostHog Code
Task-Id: 95407a79-1f13-4f1d-a37b-43fe4a62b857
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@sarahxsanders sarahxsanders requested a review from a team June 10, 2026 16:47

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LETSS GOOOO

@sarahxsanders sarahxsanders merged commit 88e7d91 into main Jun 10, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants