[PR #84] [CLOSED] Minimal typescript migration #3009

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/84
Author: @TomAFrench
Created: 6/1/2022
Status: Closed

Base: masterHead: typescript


📝 Commits (5)

  • 2e4c5ec build: add a typescript-compatible linter setup
  • cf0bf0d build: add ts-loader for typescript support
  • e539002 refactor: minimal migration to typescript
  • 1f1169e style: run prettier
  • 7ca007e fix: correct type of ACTUAL_APP_VERSION variable

📊 Changes

15 files changed (+2521 additions, -1590 deletions)

View changed files

.eslintrc.js (+17 -0)
📝 package.json (+2 -1)
📝 packages/loot-core/package.json (+7 -0)
📝 packages/loot-core/src/platform/server/asyncStorage/index.electron.js (+3 -0)
📝 packages/loot-core/src/platform/server/asyncStorage/index.testing.js (+3 -1)
📝 packages/loot-core/src/platform/server/asyncStorage/index.web.js (+3 -1)
📝 packages/loot-core/src/server/main.ts (+194 -173)
📝 packages/loot-core/src/server/sync/index.js (+4 -4)
📝 packages/loot-core/src/shared/query.ts (+9 -7)
packages/loot-core/tsconfig.json (+12 -0)
📝 packages/loot-core/webpack/webpack.api.config.js (+1 -1)
📝 packages/loot-core/webpack/webpack.browser.config.js (+7 -2)
📝 packages/loot-core/webpack/webpack.desktop.config.js (+7 -2)
📝 packages/loot-core/webpack/webpack.mobile.config.js (+7 -2)
📝 yarn.lock (+2245 -1396)

📄 Description

This PR performs an MVP migration of loot-core over to typescript:

  • A TS compatible linter has been set up.
  • ts-loader has been added to the webpack config so that it can load TS files
  • The entrypoint file main.js has been replaced by main.ts.
  • The minimum possible changes have been made to the source files to fix the resultant TS errors and allow the loot-core package to build.

This allows us to gradually migrate the rest of the package over to typescript without having to do everything at once (causing huge merge conflicts with the other PRs). Considering how widely loot-core is used across the other packages, I think it makes sense to migrate this package first and once it has a well defined interface then we can migrate the other packages over to TS.

One odd thing I've noticed is that we've set the context for the loot-core package to be the monorepo root which seems to cause a need for ts-loader to be installed up there (or at the very least hoisted). I haven't looked into whether this is necessary or if we can remove this.


🔄 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/84 **Author:** [@TomAFrench](https://github.com/TomAFrench) **Created:** 6/1/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `typescript` --- ### 📝 Commits (5) - [`2e4c5ec`](https://github.com/actualbudget/actual/commit/2e4c5ec07998b1139d9b76d0e977cc647ec0b221) build: add a typescript-compatible linter setup - [`cf0bf0d`](https://github.com/actualbudget/actual/commit/cf0bf0d3044954c1bb8c92bbb06fda8d0badab9a) build: add ts-loader for typescript support - [`e539002`](https://github.com/actualbudget/actual/commit/e539002e5881ccd152b09f2c9badbe23db44c0dd) refactor: minimal migration to typescript - [`1f1169e`](https://github.com/actualbudget/actual/commit/1f1169e536e05450c2d0ea971f7ee9d636c3ba25) style: run prettier - [`7ca007e`](https://github.com/actualbudget/actual/commit/7ca007e6503f4fb456841da4ac8c824768c7339f) fix: correct type of ACTUAL_APP_VERSION variable ### 📊 Changes **15 files changed** (+2521 additions, -1590 deletions) <details> <summary>View changed files</summary> ➕ `.eslintrc.js` (+17 -0) 📝 `package.json` (+2 -1) 📝 `packages/loot-core/package.json` (+7 -0) 📝 `packages/loot-core/src/platform/server/asyncStorage/index.electron.js` (+3 -0) 📝 `packages/loot-core/src/platform/server/asyncStorage/index.testing.js` (+3 -1) 📝 `packages/loot-core/src/platform/server/asyncStorage/index.web.js` (+3 -1) 📝 `packages/loot-core/src/server/main.ts` (+194 -173) 📝 `packages/loot-core/src/server/sync/index.js` (+4 -4) 📝 `packages/loot-core/src/shared/query.ts` (+9 -7) ➕ `packages/loot-core/tsconfig.json` (+12 -0) 📝 `packages/loot-core/webpack/webpack.api.config.js` (+1 -1) 📝 `packages/loot-core/webpack/webpack.browser.config.js` (+7 -2) 📝 `packages/loot-core/webpack/webpack.desktop.config.js` (+7 -2) 📝 `packages/loot-core/webpack/webpack.mobile.config.js` (+7 -2) 📝 `yarn.lock` (+2245 -1396) </details> ### 📄 Description This PR performs an MVP migration of `loot-core` over to typescript: - A TS compatible linter has been set up. - `ts-loader` has been added to the webpack config so that it can load TS files - The entrypoint file `main.js` has been replaced by `main.ts`. - The minimum possible changes have been made to the source files to fix the resultant TS errors and allow the `loot-core` package to build. This allows us to gradually migrate the rest of the package over to typescript without having to do everything at once (causing huge merge conflicts with the other PRs). Considering how widely `loot-core` is used across the other packages, I think it makes sense to migrate this package first and once it has a well defined interface then we can migrate the other packages over to TS. One odd thing I've noticed is that we've set the context for the `loot-core` package to be the monorepo root which seems to cause a need for `ts-loader` to be installed up there (or at the very least hoisted). I haven't looked into whether this is necessary or if we can remove this. --- <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:34:57 -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#3009