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

Ensure api types are included in the npm package #2559

Merged
merged 3 commits into from
May 18, 2024

Conversation

turt2live
Copy link
Contributor

Starting fresh with a TypeScript project results in error TS7016: Could not find a declaration file for module '@actual-app/api', but the types are in fact generated during build/release. The @types directory feels unintentionally excluded from the package.

It is worth noting that the @types directory has a bit of noise to it, but on balance having types feels more beneficial.

@github-actions github-actions bot changed the title Ensure api types are included in the npm package [WIP] Ensure api types are included in the npm package Apr 6, 2024
@trafico-bot trafico-bot bot added the 🚧 WIP label Apr 6, 2024
Copy link

netlify bot commented Apr 6, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 0c89565
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6648e20290bd0a00086a54cf
😎 Deploy Preview https://deploy-preview-2559.demo.actualbudget.org
📱 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.

Copy link
Contributor

github-actions bot commented Apr 6, 2024

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
9 4.72 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 59.97 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 20.54 kB 0%
static/js/wide.js 261.78 kB 0%
static/js/ReportRouter.js 1.23 MB 0%
static/js/index.js 3 MB 0%

Copy link
Contributor

github-actions bot commented Apr 6, 2024

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 1.2 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.2 MB 0%

@turt2live turt2live changed the title [WIP] Ensure api types are included in the npm package Ensure api types are included in the npm package Apr 6, 2024
@MatissJanis MatissJanis requested a review from twk3 April 6, 2024 18:56
@twk3
Copy link
Contributor

twk3 commented Apr 8, 2024

I would like to have all the imports that end up in the @types folder working first. I just went and fixed a bunch of them in #2567

But there are still more errors, when importing the api and running tsc. (If you don't disable skipLibCheck

@twk3
Copy link
Contributor

twk3 commented Apr 27, 2024

Further fixes up here: #2676

Remaining two issue:

  1. [major blocker] the api types are just plain wrong for anything that has an 'external model' conversion. Basically https://github.com/actualbudget/actual/blob/master/packages/loot-core/src/server/api-models.ts needs to be given typescript treatment, and then it's types need to be used rather than the internal types for the api.
  2. crdt types are also still missing

I'll continue to take a look, but I welcome any assistance picking up these final tasks as well to help speed it up.

Copy link
Contributor

@twk3 twk3 left a comment

Choose a reason for hiding this comment

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

With the other fixes in place, we are now ready for this change.

The types certainly aren't complete, but they shouldn't currently result in ts errors at least for users of the api.

@twk3 twk3 merged commit 99ab8db into actualbudget:master May 18, 2024
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully ✅ Approved and removed 🔍 Ready for Review ✨ Merged Pull Request has been merged successfully labels May 18, 2024
@turt2live turt2live deleted the travis/ts branch May 18, 2024 18:56
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