Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This doesn't relate to a current open issue. But I've found though out the
@octokit
npm packages that theexports
package entry point isn't being used. Which is the modern alternative tomain
.As we are compiling commonJS and ES module versions. We need to add
.mjs
file extension to the ES module build output files. As this is the standard practice to denote the difference from CommonJS and ES module. When not using"type": "module"
. Read though NodeJs - Modules Packages for more details.Behavior
Before the change?
.js
node14
when the package.json engine denotes"node": ">= 18"
is supported.exports
package entry pointAfter the change?
.mjs
.node18
.es2020
.exports
package entry point added/* @__PURE__ */
to allow users of the npm package to tree shake within their projects. The usage of arrow functions may break other@octokit
packages if the require features of traditional function expressions. Something to be aware of.Other information
tsup does support generating declaration files for each build format output. But I found that due to
bundle: true
being set and thesrc/index.ts
entry file only having oneexport
that not all the type definitions would be generated. So I've kept the TypeScript type definition output that was already implemented.Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking change
label).mjs
file extension to denote ES Module build output.exports
package entry point may break existing projects that are using the commonjs output but NodeJS will now use the ES module version. Edge cases?node18
instead ofnode14
might break projects that aren't using Node18 even though the package.json engine is set to"node": ">= 18"
.Pull request type
Please add the corresponding label for change this PR introduces:
Type: Bug
Type: Feature
Type: Documentation
Type: Maintenance