Skip to content

Conversation

@oyve
Copy link
Owner

@oyve oyve commented Nov 28, 2025

No description provided.

Copy link

Copilot AI left a comment

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 merges development changes that improve the build system for dual CommonJS/ESM package distribution. The changes focus on correcting import paths, enhancing build scripts to handle JSON files, and expanding package exports to support subpath exports for readingStore and globals modules.

  • Corrected import paths in both source and test files to use proper relative paths
  • Enhanced build scripts to handle JSON files during the build process
  • Added cpx tool for copying JSON files to distribution directories
  • Expanded package.json exports to enable subpath imports

Reviewed changes

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

Show a summary per file
File Description
test/src/index.test.ts Fixed import paths to use correct relative paths (../../src/)
src/index.ts Fixed import paths to remove redundant src/ prefix in relative imports
scripts/rename-cjs-files.cjs Added JSON file exclusion logic when updating require statements
scripts/generate-exports.cjs Enhanced with singleFiles parameter and improved export path generation
package.json Added module field, copy-json script, cpx dependency, and subpath exports
package-lock.json Added cpx dependency and its transitive dependencies
Comments suppressed due to low confidence (1)

src/index.ts:9

  • Unused imports TENDENCY, TREND.

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

let content = fs.readFileSync(newFullPath, "utf8");
content = content.replace(/require\(['"](\..*?)['"]\)/g, (match, p1) => {
if (!p1.endsWith(".cjs")) {
if(p1.endsWith(".json")) {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Missing space after if keyword on line 23. For consistency with the existing codebase style (line 26 has else if with space), line 23 should be if (p1.endsWith(".json")) with a space between if and the opening parenthesis.

Suggested change
if(p1.endsWith(".json")) {
if (p1.endsWith(".json")) {

Copilot uses AI. Check for mistakes.

if(directory !== null) {
// Define paths
if (directory !== null) {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

This guard always evaluates to false.

Suggested change
if (directory !== null) {
if (directory) {

Copilot uses AI. Check for mistakes.
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