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

Specify types location in package.json #973

Closed
wants to merge 9 commits into from
Closed

Conversation

jeremywiebe
Copy link
Collaborator

@jeremywiebe jeremywiebe commented Feb 7, 2024

Summary:

NOTE: This PR is not in a state to land. I'm trying to figure things out, but this is not 100% yet.

Matthew ran into an issue while deploying a minor Perseus update today. It appears this is related to the fact that we were shipping source code, but we also suspect that it's because we haven't specified a types key in our package.json files.

Issue: "none"

Test plan:

I'm going to take this PR's snapshot npm package and install it in webapp and see if the type issues remain.

Note that I've added a commit on this PR that re-enables shipping the src dir to see if we can reproduce the problem and if this change fixes it.

@jeremywiebe jeremywiebe self-assigned this Feb 7, 2024
Copy link
Contributor

github-actions bot commented Feb 7, 2024

Size Change: +426 B (0%)

Total Size: 815 kB

Filename Size Change
packages/math-input/dist/es/index.js 79.7 kB +385 B (0%)
packages/perseus-editor/dist/es/index.js 263 kB -709 B (0%)
packages/perseus/dist/es/index.js 390 kB +750 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.27 kB
packages/perseus-core/dist/es/index.js 908 B
packages/perseus-error/dist/es/index.js 878 B
packages/perseus-linter/dist/es/index.js 21.8 kB
packages/pure-markdown/dist/es/index.js 3.77 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1502859) 63.51% compared to head (7caa134) 66.66%.
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #973      +/-   ##
==========================================
+ Coverage   63.51%   66.66%   +3.14%     
==========================================
  Files         421      428       +7     
  Lines       96123    96944     +821     
  Branches     6253     9827    +3574     
==========================================
+ Hits        61049    64624    +3575     
+ Misses      35074    32320    -2754     

Impacted file tree graph

see 88 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1502859...7caa134. Read the comment docs.

@jeremywiebe jeremywiebe marked this pull request as ready for review February 7, 2024 19:35
@khan-actions-bot khan-actions-bot requested a review from a team February 7, 2024 19:35
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Feb 7, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/real-feet-swim.md, packages/kas/package.json, packages/kmath/package.json, packages/math-input/package.json, packages/perseus/package.json, packages/perseus-core/package.json, packages/perseus-editor/package.json, packages/perseus-error/package.json, packages/perseus-linter/package.json, packages/pure-markdown/package.json, packages/simple-markdown/package.json, packages/simple-markdown/tsconfig-build.json

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Feb 7, 2024

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (7caa134) and published it to npm. You
can install it using the tag PR973.

Example:

yarn add @khanacademy/perseus@PR973

Comment on lines -21 to -23
"files": [
"dist"
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

why remove this? I think removing it means that the installed package will include extraneous files

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm moving this PR to a Draft. I was playing with figuring out why we're having Typescript issues in webapp and I haven't figured it out completely yet.

Ben fixed them with this PR (#971), but I don't feel like we truly understood why Typescript was seeing the files in the src/ dir of a node module.

@jeremywiebe jeremywiebe marked this pull request as draft February 14, 2024 21:34
@jeremywiebe
Copy link
Collaborator Author

I'm going to abandon this for now. We've moved to using an exports key in package.jsons and so this PR will need a bunch of re-working. I'll create a new one if need be.

@jeremywiebe jeremywiebe deleted the pkg-json-types branch May 17, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants