Skip to content

chore: modernize package.json and TypeScript configuration #150

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

Open
wants to merge 10 commits into
base: pnpm
Choose a base branch
from

Conversation

J3m5
Copy link
Contributor

@J3m5 J3m5 commented Jun 4, 2025

What’s in this PR?

  • Re-aligns our library build and dev setup with the 2025 TypeScript defaults.
  • Introduces a dedicated tsconfig.build.json.
  • Switches to module: "NodeNext" and modern ES2022 targets, giving consumers first-class ESM support and smaller, helper-free output.
  • Enables the compiler options that catch the most common API-breaking mistakes (unused code, fall-through switches, mismatched casing, etc.) without resorting to a bundler.
  • Cleans up redundant or legacy flags, resulting in a clearer config that mirrors community best practices.

Sources consulted

Changelog

🐛 fix

  • ci: prevent duplicated CI run on pull requests
  • imports: add .js extension to imports

📦 build

  • package.json: add keywords and update repository metadata
  • package.json: update scripts (add typecheck[:watch], rename fix→lint:fix, rename watch→build:watch) and clean tsconfig.tsbuildinfo on build
  • package.json: refine files list (remove src, add LICENSE, include only README.md)
  • package.json: restructure exports and add type definitions
  • tsconfig.ts: modernize and improve compiler options
  • tsconfig.ts: sort and categorize compiler options

🚨 test

  • jest: update config and add @jest/globals dev dependency

🧹 chore

  • package.json: apply sort-package-json

Blocked by #149

@J3m5 J3m5 self-assigned this Jun 4, 2025
Copy link

@Copilot 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 modernizes the project configuration by updating import paths, enhancing TypeScript and Jest configurations, and refining package metadata. Key changes include:

  • Updating import statements to include file extensions for consistency with ESM.
  • Refactoring package.json to improve structure, add type definitions, and update dependency management.
  • Modernizing the Jest configuration to use the new ESM preset and TypeScript type assertions.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/openapi3/parseOpenApi3Documentation.ts Updated import path to include file extension.
src/hydra/fetchJsonLd.ts Updated import path to include file extension.
package.json Refactored JSON structure, updated scripts, and enhanced dependency configuration.
jest.config.ts Replaced legacy configuration with the new ESM preset and TS type checking using satisfies.
.github/workflows/ci.yml Refined CI workflow triggers for better branch filtering.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

package.json Outdated
Comment on lines 16 to 17
"codegen",
"scaffolding"
Copy link
Member

Choose a reason for hiding this comment

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

It's a parser, not a code generator, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not its not, but it can be used to build one, like said in the readme:

This data structure can then be used for various tasks such as creating smart API clients, scaffolding code or building administration interfaces.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but since it's not a code generator, these keywords shouldn't be present IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, I'll remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@J3m5 J3m5 force-pushed the typescript branch 7 times, most recently from b99b711 to 2733420 Compare June 8, 2025 14:41
Copy link
Member

@soyuka soyuka left a comment

Choose a reason for hiding this comment

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

nice this brings things forward thanks!

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.

4 participants