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

build: generate types for release #20

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

RebeccaStevens
Copy link
Collaborator

@RebeccaStevens RebeccaStevens commented Feb 6, 2023

PR Checklist

Overview

Generate types on build:release.

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Right! Thanks! 🙌

@codecov-commenter
Copy link

Codecov Report

Merging #20 (6283ab9) into main (7563431) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #20   +/-   ##
=======================================
  Coverage   25.31%   25.31%           
=======================================
  Files          13       13           
  Lines         237      237           
  Branches       98       98           
=======================================
  Hits           60       60           
  Misses        174      174           
  Partials        3        3           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Ah, but the package.json sorting needs to happen. Could you fix the lint issues real quick please?

/home/runner/work/ts-api-tools/ts-api-tools/package.json
Error:   44:4  error  Expected object keys to be in ascending order. 'import' should be before 'types'  jsonc/sort-keys
Error:   54:2  error  Expected object keys to be in ascending order. 'name' should be before 'types'    jsonc/sort-keys

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Feb 6, 2023
@RebeccaStevens
Copy link
Collaborator Author

One of those linting issue can't be fixed. types must come before any other field in exports.

I don't think sorting package.json fields alphabetically is good idea. We should instead us an approach like in #22

@JoshuaKGoldberg
Copy link
Owner

types must come before any other field in exports.

...huh, TIL (thanks!). I'll admit I haven't set this up before. Do you have a good resource that describes this?

@RebeccaStevens
Copy link
Collaborator Author

Do you have a good resource that describes this?

Have a look at this: https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing

@JoshuaKGoldberg
Copy link
Owner

Entry-point for TypeScript resolution - must occur first!

Ryan Reynolds in surgical gear going "but why?"

I guess this is blocked on JoshuaKGoldberg/create-typescript-app#223. 😩

@JoshuaKGoldberg JoshuaKGoldberg removed the status: waiting for author Needs an action taken by the original poster label Feb 7, 2023
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

❤️‍🔥

@JoshuaKGoldberg JoshuaKGoldberg merged commit bfaee86 into JoshuaKGoldberg:main Feb 7, 2023
@JoshuaKGoldberg
Copy link
Owner

@allcontributors add @RebeccaStevens for bug

@allcontributors
Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @RebeccaStevens! 🎉

@RebeccaStevens
Copy link
Collaborator Author

Entry-point for TypeScript resolution - must occur first!

Ryan Reynolds in surgical gear going "but why?"

I imagine the reason is because when looking for a matching pattern for the path, import is also a valid match as types are imported (require might be to in certain contexts, maybe?). We need to have types first so that types always resolve to types and not JS.

@RebeccaStevens RebeccaStevens deleted the dts branch February 13, 2023 09:14
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.

🚀 Feature: Add types
3 participants