Skip to content
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

fix: CommonJS types in all packages #148

Merged
merged 2 commits into from
Jan 30, 2025
Merged

fix: CommonJS types in all packages #148

merged 2 commits into from
Jan 30, 2025

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Jan 29, 2025

Prerequisites checklist

What is the purpose of this pull request?

Fix CommonJS types in all packages.

What changes did you make? (Give an overview)

  • Moved build-cts.js to be a top-level tool
  • Updated all packages to build their CTS files using the tool
  • Updated eslint.config.js to allow console.log in tools/**

Related Issues

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Jan 29, 2025
@nzakas nzakas mentioned this pull request Jan 29, 2025
1 task
fasttime
fasttime previously approved these changes Jan 30, 2025
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

Just left some comments, but generally LGTM.

tools/build-cts.js Outdated Show resolved Hide resolved
"build:cts": "node -e \"fs.copyFileSync('dist/esm/index.d.ts', 'dist/cjs/index.d.cts')\"",
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
Copy link
Member

Choose a reason for hiding this comment

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

This isn't really necessary since the compat package generates no types.ts or types.cts file. But it's okay to use the build-cts script if we'd like to stay consistent across packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I just wanted things to be consistent. That way, if we ever add a types.ts, we won't get confused when the same bug gets introduced later.

Co-authored-by: Francesco Trotta <[email protected]>
@nzakas nzakas merged commit c91866c into main Jan 30, 2025
18 checks passed
@nzakas nzakas deleted the build-cts branch January 30, 2025 18:53
@github-actions github-actions bot mentioned this pull request Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

2 participants