Skip to content

fix: fix cjs distribution artifacts#100

Merged
char0n merged 1 commit into
mainfrom
char0n/fix-corrupted-cjs
Feb 8, 2026
Merged

fix: fix cjs distribution artifacts#100
char0n merged 1 commit into
mainfrom
char0n/fix-corrupted-cjs

Conversation

@char0n

@char0n char0n commented Feb 8, 2026

Copy link
Copy Markdown
Member

No description provided.

@char0n
char0n requested a review from Copilot February 8, 2026 22:38
@char0n char0n self-assigned this Feb 8, 2026
@char0n char0n added the bug Something isn't working label Feb 8, 2026
@char0n
char0n merged commit 3bb232d into main Feb 8, 2026
8 checks passed
@char0n
char0n deleted the char0n/fix-corrupted-cjs branch February 8, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix CommonJS (CJS) distribution output so that runtime imports of apg-lite resolve to the bundled cjs/apg-lite.cjs artifact rather than an incorrect path, improving the published/consumed CJS build.

Changes:

  • Update the Babel module-resolver mapping for apg-lite to compute an import path that matches the cjs/ output directory structure.
  • Regenerate package-lock.json with additional "peer": true flags for certain packages.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
package-lock.json Updates lockfile metadata (adds "peer": true on several packages).
babel.config.cjs Adjusts apg-lite import rewriting logic for CJS builds to point at cjs/apg-lite.cjs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread babel.config.cjs
const apgLiteCJS = path.resolve("./src/apg-lite.cjs");
// apg-lite.cjs will be in the same cjs/ output directory
// The relative path from src/ needs to account for the output being in cjs/
const srcDir = path.resolve("./src");

Copilot AI Feb 8, 2026

Copy link

Choose a reason for hiding this comment

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

srcDir is derived from path.resolve("./src"), which depends on the process CWD. If Babel is invoked from a different working directory (e.g., via tooling/monorepo scripts), this resolver can generate incorrect paths. Prefer resolving relative to the config file (e.g., using __dirname) so the mapping is stable regardless of where the command is run.

Suggested change
const srcDir = path.resolve("./src");
const srcDir = path.resolve(__dirname, "src");

Copilot uses AI. Check for mistakes.
Comment thread babel.config.cjs
char0n pushed a commit that referenced this pull request Feb 8, 2026
## [2.0.3](v2.0.2...v2.0.3) (2026-02-08)

### Bug Fixes

* fix cjs distribution artifacts ([#100](#100)) ([3bb232d](3bb232d))
@char0n

char0n commented Feb 8, 2026

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 2.0.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@char0n char0n added the released label Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants