Skip to content

chore(infra): add type module and publint validation#24

Merged
SoonIter merged 1 commit intomainfrom
feat/esm-publint
Mar 17, 2026
Merged

chore(infra): add type module and publint validation#24
SoonIter merged 1 commit intomainfrom
feat/esm-publint

Conversation

@SoonIter
Copy link
Copy Markdown
Member

Summary

  • Add "type": "module" to package.json for proper ESM support
  • Update export file extensions (.mjs.js, .js.cjs) to align with module type
  • Add rsbuild-plugin-publint for package publishing validation
  • Update repository URL to rstackjs org

Test plan

  • Verify pnpm build succeeds with updated config
  • Verify publint passes with no errors
  • Verify both ESM and CJS consumers can import the package correctly

- Add "type": "module" for proper ESM support
- Update export extensions (.mjs → .js, .js → .cjs) to match module type
- Add rsbuild-plugin-publint for package publishing validation
- Update repository URL to rstackjs org
Copilot AI review requested due to automatic review settings March 17, 2026 12:12
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly modernizes the package's module system by adopting ES Modules as the default, which improves compatibility and future-proofs the codebase. It also introduces automated validation for package publishing, a crucial step for maintaining high quality and preventing common distribution issues. These changes collectively enhance the package's maintainability and its readiness for broader adoption.

Highlights

  • Module System Update: Configured the package.json to use ES Modules by setting "type": "module" and adjusted export paths to use .js for ESM and .cjs for CommonJS, ensuring modern module compatibility.
  • Publishing Validation: Integrated rsbuild-plugin-publint into the build configuration to automatically validate package publishing, enhancing reliability and adherence to best practices.
  • Repository URL Update: Updated the repository URL in package.json to reflect the new rstackjs organization, aligning with current project ownership.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package.json
    • Added "type": "module" to declare the package as an ES Module.
    • Modified exports, main, and module fields to correctly point to .js for ESM and .cjs for CommonJS builds.
    • Updated the repository.url to the rstackjs organization.
    • Added rsbuild-plugin-publint to devDependencies.
  • pnpm-lock.yaml
    • Updated lockfile to include rsbuild-plugin-publint and its transitive dependencies such as @publint/pack, mri, package-manager-detector, picocolors@1.1.1, publint, and sade.
  • rslib.config.ts
    • Imported pluginPublint from rsbuild-plugin-publint.
    • Added pluginPublint() to the plugins array in the defineConfig call.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request transitions the package to an ES module by setting "type": "module" in package.json and updating file extensions in the exports map. It also adds rsbuild-plugin-publint for package validation. My feedback highlights a potential issue where the build configuration may not produce the .cjs file expected by the updated package.json, which could lead to resolution errors for CommonJS consumers.

@SoonIter SoonIter changed the title feat: add type module and publint validation chore(infra): add type module and publint validation Mar 17, 2026
@SoonIter SoonIter merged commit 670a067 into main Mar 17, 2026
7 checks passed
@SoonIter SoonIter deleted the feat/esm-publint branch March 17, 2026 12:14
Copy link
Copy Markdown
Contributor

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 updates the package to publish as an ESM-first module ("type": "module"), adjusts exported entrypoints accordingly, and adds rsbuild-plugin-publint to validate the published package surface during builds.

Changes:

  • Add "type": "module" and update exports/main/module paths to use .js (ESM) and .cjs (CJS).
  • Add rsbuild-plugin-publint and wire it into rslib.config.ts.
  • Update the repository URL and lockfile to reflect the new dependency graph.

Reviewed changes

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

File Description
rslib.config.ts Adds rsbuild-plugin-publint to run publint during the rslib build.
package.json Sets "type": "module", updates package entrypoints/extensions, and adds the publint plugin devDependency.
pnpm-lock.yaml Locks rsbuild-plugin-publint and its transitive dependencies.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Comment on lines 15 to +22
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.js"
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs"
},
"./package.json": "./package.json"
},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"module": "./dist/esm/index.js",
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