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

Update octokit/request to 9.1.1 with ESM support enabled #601

Conversation

exoego
Copy link
Contributor

@exoego exoego commented May 7, 2024

This unblocks #594 and #593.

Error: [tsl] ERROR in /home/runner/work/scala-steward-action/scala-steward-action/src/action/main.ts(9,23)
TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@octokit/request")' call instead.
To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field "type": "module" to '/home/runner/work/scala-steward-action/scala-steward-action/package.json'.

Those two PRs introduce ESM-only module, which conflicts with the current tsconfig.

We need the below config

    "module": "es2022", // to support ESM
    "moduleResolution": "bundler" // for @vercel/ncc

But tsconfig library does not provide such in https://github.com/tsconfig/bases/tree/main/bases.
(There are some but for specific web app frameworks).

So, tsconfig is now extended instead of copying it every time

Extending is documented:

https://github.com/tsconfig/bases?tab=readme-ov-file#node-20-tsconfigjson
Add to your tsconfig.json:

"extends": "@tsconfig/node20/tsconfig.json"

@exoego exoego changed the title Dependabot/npm and yarn/octokit/request 9.1.1 Update octokit/request to 9.1.1 with ESM support enabled May 7, 2024
@exoego exoego marked this pull request as draft May 7, 2024 10:12
dependabot bot and others added 3 commits May 7, 2024 20:34
Bumps [@octokit/request](https://github.com/octokit/request.js) from 8.3.1 to 9.1.1.
- [Release notes](https://github.com/octokit/request.js/releases)
- [Commits](octokit/request.js@v8.3.1...v9.1.1)

---
updated-dependencies:
- dependency-name: "@octokit/request"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@exoego exoego force-pushed the dependabot/npm_and_yarn/octokit/request-9.1.1 branch from 7291dae to 91759c7 Compare May 7, 2024 11:34
@exoego exoego marked this pull request as ready for review May 7, 2024 12:34
@alejandrohdezma
Copy link
Member

Nice! Thanks for taking care of this ❤️

@alejandrohdezma alejandrohdezma merged commit bfc0fa2 into scala-steward-org:dependabot/npm_and_yarn/octokit/request-9.1.1 May 7, 2024
1 check passed
@exoego exoego deleted the dependabot/npm_and_yarn/octokit/request-9.1.1 branch May 7, 2024 12:41
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