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

Use Node 16 module resolution #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

erisdev
Copy link

@erisdev erisdev commented Aug 26, 2024

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

What I changed:

  • Changed tsconfig.json target, package, etc fields to appropriate values for Node 16 as per the official documentation.
  • Updated import statements to include explicit .js extension where appropriate. This also means no more implicit index.js imports. 🐴
  • Added cause property declaration to NotFoundError and changed the constructor code a little to make TypeScript happy. This part is slightly annoying, because Node 16 is ES2021 according to the above docs, but it also has Error.cause and the two argument Error constructor from ES2022 since v16.9.0. TypeScript doesn't account for that, so I had to smack it with a wrench to get it working.

As for why—"node" for tsconfig's module and moduleResolution is deprecated in favor of "node16". Akte is currently incompatible with projects that use that setting. This PR fixes that, and you'll now get type errors if you try to use language features that aren't supported on Node 16 as an added bonus.

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

Copy link

netlify bot commented Aug 26, 2024

Deploy Preview for akte ready!

Name Link
🔨 Latest commit d452801
🔍 Latest deploy log https://app.netlify.com/sites/akte/deploys/66ccc29d9d854200085704e5
😎 Deploy Preview https://deploy-preview-1--akte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant