[PR #386] [MERGED] Always pull in API package from workspace (fixes #378) #3100

Closed
opened 2026-02-28 20:36:21 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/386
Author: @jlongster
Created: 11/10/2022
Status: Merged
Merged: 11/14/2022
Merged by: @jlongster

Base: masterHead: jlongster-api-deps


📝 Commits (2)

📊 Changes

3 files changed (+5 additions, -42 deletions)

View changed files

📝 packages/import-ynab4/package.json (+1 -1)
📝 packages/import-ynab5/package.json (+1 -1)
📝 yarn.lock (+3 -40)

📄 Description

This should fix the importers.

The issue is something that @TomAFrench pointed out in https://github.com/actualbudget/actual/pull/204. The API package should definitely never be pulled from npm. It should always be required from the workspace, and the way it works is the backend "injects" the ability for the API to send messages directly to the backend. It does this by importing the module and mutating internal state.

If something like the importer ends up pulling the API package from npm instead of the workspace, it won't know how to talk to the backend. When running outside the app, it works differently and knows how to communicate across a socket.

The issue is currently the importers depend on @actual-app/api version ^1.0.0. At some point, the api package got bump to a major version of 4.x.x (instead of 1.x.x) so the importers couldn't pull in the workspace version. Instead it fell back to importing from npm.

It specified ^1.0.0 because previously these importer packages were synced with separate open-source repos which should pull in the api package from npm (because they run via CLI). We copied that code back into Actual as-is. This happened to work because the local workspace api package fit the ^1.0.0 but bumping the major broke that assumption.

Now that everything is open-source, we should delete the separate import-ynab5 and import-ynab4 repos and keep everything here. Now, we can just use * and assume it'll always pull locally whatever version it is.

I'm not exactly sure what happened in https://github.com/actualbudget/actual/pull/230. Or why the previous PR used workspace:* and if there is any different with *, but everything currently uses * and this fixes the issue in my testing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/386 **Author:** [@jlongster](https://github.com/jlongster) **Created:** 11/10/2022 **Status:** ✅ Merged **Merged:** 11/14/2022 **Merged by:** [@jlongster](https://github.com/jlongster) **Base:** `master` ← **Head:** `jlongster-api-deps` --- ### 📝 Commits (2) - [`cd0fc02`](https://github.com/actualbudget/actual/commit/cd0fc02a447553553048b34ece4df33ddbec9c5f) Always pull in API package from workspace (fixes #378) - [`dbda0ec`](https://github.com/actualbudget/actual/commit/dbda0ec4c240ee850efa914080bae8df675ba28e) Remove console ### 📊 Changes **3 files changed** (+5 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `packages/import-ynab4/package.json` (+1 -1) 📝 `packages/import-ynab5/package.json` (+1 -1) 📝 `yarn.lock` (+3 -40) </details> ### 📄 Description This should fix the importers. The issue is something that @TomAFrench pointed out in https://github.com/actualbudget/actual/pull/204. The API package should definitely never be pulled from npm. It should always be required from the workspace, and the way it works is the backend "injects" the ability for the API to send messages directly to the backend. It does this by importing the module and mutating internal state. If something like the importer ends up pulling the API package from npm instead of the workspace, it won't know how to talk to the backend. When running outside the app, it works differently and knows how to communicate across a socket. The issue is currently the importers depend on `@actual-app/api` version `^1.0.0`. At some point, the api package got bump to a major version of 4.x.x (instead of 1.x.x) so the importers couldn't pull in the workspace version. Instead it fell back to importing from npm. It specified `^1.0.0` because previously these importer packages were synced with separate open-source repos which _should_ pull in the api package from npm (because they run via CLI). We copied that code back into Actual as-is. This happened to work because the local workspace api package fit the `^1.0.0` but bumping the major broke that assumption. Now that everything is open-source, we should delete the separate `import-ynab5` and `import-ynab4` repos and keep everything here. Now, we can just use `*` and assume it'll always pull locally whatever version it is. I'm not exactly sure what happened in https://github.com/actualbudget/actual/pull/230. Or why the previous PR used `workspace:*` and if there is any different with `*`, but everything currently uses `*` and this fixes the issue in my testing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:36:21 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#3100