Skip to content

fix(pkg-utils): make named exports detectable by cjs-module-lexer#2619

Open
balzss wants to merge 1 commit into
masterfrom
fix-pkg-utils-cjs-named-exports
Open

fix(pkg-utils): make named exports detectable by cjs-module-lexer#2619
balzss wants to merge 1 commit into
masterfrom
fix-pkg-utils-cjs-named-exports

Conversation

@balzss

@balzss balzss commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Hoist the inline require() calls out of pkg-utils's module.exports object literal so all named exports are statically detectable by cjs-module-lexer.
  • Fixes the release failure where ui-scripts (ESM/TS since refactor(many): convert ui-scripts to TypeScript and add tests #2578) saw undefined for getPackageJSON/getPackage/getChangedPackages via import * as pkgUtils, breaking publish/bump/tag/deprecate.

Test Plan

  • Re-run the npm release job — the failed run never published, so a manual release re-run is needed after merge.

Fixes INSTUI-5086

🤖 Generated with Claude Code

Hoist the inline `require()` calls out of the `module.exports` object literal.
Inline requires in the literal defeat cjs-module-lexer's static analysis, so
ESM consumers doing `import * as pkgUtils from '@instructure/pkg-utils'` only
saw `getPackages` and got `undefined` for the rest — breaking `ui-scripts`
publish/bump/tag/deprecate with "pkgUtils.getPackageJSON is not a function"
after ui-scripts was converted to ESM/TypeScript.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@balzss balzss self-assigned this Jul 1, 2026
@balzss balzss requested a review from ToMESSKa July 1, 2026 14:55
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2619/

Built to branch gh-pages at 2026-07-01 14:56 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

github-actions Bot pushed a commit that referenced this pull request Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

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.

1 participant