Skip to content

feat: migrate to ESM#968

Merged
wolfy1339 merged 5 commits intobetafrom
esm
Feb 14, 2024
Merged

feat: migrate to ESM#968
wolfy1339 merged 5 commits intobetafrom
esm

Conversation

@wolfy1339
Copy link
Copy Markdown
Member

BREAKING CHANGE: Migrate to ESM builds

@wolfy1339 wolfy1339 added Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR Type: Breaking change Used to note any change that requires a major version bump labels Feb 11, 2024
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

}
},
"compilerOptions": {
"lib": ["ESNext"],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These can be moved to @octokit/tsconfig later on

"@octokit/webhooks-methods": "^4.0.0",
"@wolfy1339/openapi-webhooks-types": "5.1.3",
"aggregate-error": "^3.1.0"
"aggregate-error": "^5.0.0"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

While AggregateError was introduced natively in NodeJS v15, it isn't generic. So the types cannot be extended to use our custom error

? EmitterWebhookEvent
: EmitterWebhookEvent & TTransformed;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The types were fixed in version 3.0.1 and these are out of date versus v5 of aggregate-error

expect(error.message).toMatch(/oops/);

const errors = Array.from(error);
const errors = Array.from(error.errors);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The AggregateError class doesn't extend Iterable<T> anymore, you have to use the .errors property

There is currently a bug in ts-node where it completely ignores the `module` and `moduleResolution` options
kulshekhar/ts-jest#4198
Copy link
Copy Markdown
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

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

All of this looks good @wolfy1339 - thank you for pushing this forward ❤️. Just a clarifying question - are you planning a follow along set of changes in octokit.js and app.js for imports and such since those are still cjs modules?

@wolfy1339
Copy link
Copy Markdown
Member Author

Yes, I will be doing the other modules as well.

@wolfy1339 wolfy1339 merged commit 5518092 into beta Feb 14, 2024
@wolfy1339 wolfy1339 deleted the esm branch February 14, 2024 13:58
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 13.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @beta Type: Breaking change Used to note any change that requires a major version bump Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants