-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Description
I'd like to use wireit for preinstall scripts:
"preinstall": "wireit",
"pnpm:devPreinstall": "wireit",
Obviously, what you can do in a preinstall script is fairly limited. packages won't be available, but you can still do scripting related stuff.
Using the usual configuration here will fail because wireit has not yet been installed:
. pnpm:devPreinstall$ wireit
│ sh: wireit: command not found
└─ Running...
ELIFECYCLE Command failed.
. preinstall$ wireit
│ sh: wireit: command not found
└─ Running...
ELIFECYCLE Command failed.
The obvious fix is to use pnpx or similar to ensure the package is downloaded:
"preinstall": "pnpx wireit",
"pnpm:devPreinstall": "pnpx wireit",
But wireit itself complains in that scenario:
. pnpm:devPreinstall$ pnpx wireit
│ ❌ package.json:16:25 This command should just be "wireit", as this script is configured in the wireit section.
│ ning... "pnpm:devPreinstall": "pnpx wireit",
│ ~~~~~~~~~~~~~
│ package.json:124:3 The wireit config is here.
│ ... "pnpm:devPreinstall": {
│ ~~~~~~~~~~~~~~~~~~~~
└─ Failed in 404ms at /Users/robbie/programming/work/gen-1
ELIFECYCLE Command failed with exit code 1.
I'd suggest relaxing wireit's check here to allow invoking wireit via a package manager within it's script, eg:
npx wireit
bunx wireit
pnpx wireit
pnpm dlx wireit
Metadata
Metadata
Assignees
Labels
No labels