Skip to content

OTOOLS-122: Add _runPendingActivations to ext-webpack-plugin for npm 12 compatibility - #298

Open
sencha-digit wants to merge 1 commit into
ext-allshared-8.0.xfrom
OTOOLS-122
Open

OTOOLS-122: Add _runPendingActivations to ext-webpack-plugin for npm 12 compatibility#298
sencha-digit wants to merge 1 commit into
ext-allshared-8.0.xfrom
OTOOLS-122

Conversation

@sencha-digit

Copy link
Copy Markdown

Findings

npm 12 dropped support for install lifecycle scripts in published packages. @sencha/ext-* packages relied on scripts.install: "node activate.js" to activate the Ext JS license on first use. That hook is now silently skipped, leaving the package non-functional after install.

Root cause

ext-webpack-plugin had no mechanism to trigger activate.js once the lifecycle script was removed.

Fix

Added _runPendingActivations() to pluginUtil.js (both src/ and compiled dist/), called at the top of _constructor() before the first webpack compilation.

The function scans node_modules/@sencha/*/activate.js and runs each found script synchronously via spawnSync. activate.js self-deletes after running (existing behaviour), so existsSync makes this a true one-shot check per install.

Related PRs

  • extjs/SenchaDeploy #590 — removes scripts.install from published ext/cmd packages; converts activate.js to spawnSync
  • sencha/ext-gen — removes scripts.install from @sencha/ext-gen; lazy install.js on first CLI invocation

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