-
Notifications
You must be signed in to change notification settings - Fork 41
chore: replace Nx workspace scripts with pnpm recursive commands #1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
2df7332
90f61f4
702386b
27723af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/env node | ||
| /* eslint-disable no-console */ | ||
|
|
||
| const { execSync } = require( 'child_process' ); | ||
|
|
||
| /** | ||
| * Build workspace packages after install when dev tooling is available. | ||
| * | ||
| * Skips builds for production installs that omit devDependencies (e.g. pnpm install --prod). | ||
| */ | ||
| function hasTypeScript() { | ||
| try { | ||
| require.resolve( 'typescript' ); | ||
| return true; | ||
| } catch ( err ) { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| if ( ! hasTypeScript() ) { | ||
| process.exit( 0 ); | ||
| } | ||
|
|
||
| execSync( 'pnpm run build:tsc && pnpm run build:types', { | ||
| stdio: 'inherit', | ||
| } ); | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ | |
| "@wordpress/i18n": "^6.2.0" | ||
| }, | ||
| "scripts": { | ||
| "prepublishOnly": "pnpm run build:tsc && pnpm run build:types", | ||
| "prepack": "pnpm run build:tsc && pnpm run build:types", | ||
| "build:tsc": "tsc", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Removing Useful? React with 👍 / 👎. |
||
| "build:types": "tsc --build", | ||
| "watch:tsc": "tsc -w", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: PopupMaker/Popup-Maker
Length of output: 649
Fix
postinstallfailure handling when TypeScript is present but the build failsbin/postinstall-packages.jscorrectly skips the build whentypescriptis missing (require.resolve('typescript')+process.exit(0)), but when TypeScript exists it runsexecSync('pnpm run build:tsc && pnpm run build:types')with no try/catch—so a failingbuild:tsc/build:typeswill still fail thepostinstallstep and can breakpnpm install.🤖 Prompt for AI Agents