Skip to content

A local-first personal finance app

[AI] Publish loot-core (@actual-app/core) nightly first in workflow (#7200)

Matiss Janis Aboltins6c150cf28abc
diff --git a/.github/workflows/publish-nightly-npm-packages.yml b/.github/workflows/publish-nightly-npm-packages.yml
index 84cd56fcb3..9925d50557 100644
--- a/.github/workflows/publish-nightly-npm-packages.yml
+++ b/.github/workflows/publish-nightly-npm-packages.yml
@@ -20,11 +20,13 @@ jobs:
- name: Update package versions
run: |
# Get new nightly versions
+ NEW_CORE_VERSION=$(node ./packages/ci-actions/bin/get-next-package-version.js --package-json ./packages/loot-core/package.json --type nightly)
NEW_WEB_VERSION=$(node ./packages/ci-actions/bin/get-next-package-version.js --package-json ./packages/desktop-client/package.json --type nightly)
NEW_SYNC_VERSION=$(node ./packages/ci-actions/bin/get-next-package-version.js --package-json ./packages/sync-server/package.json --type nightly)
NEW_API_VERSION=$(node ./packages/ci-actions/bin/get-next-package-version.js --package-json ./packages/api/package.json --type nightly)
# Set package versions
+ npm version $NEW_CORE_VERSION --no-git-tag-version --workspace=@actual-app/core --no-workspaces-update
npm version $NEW_WEB_VERSION --no-git-tag-version --workspace=@actual-app/web --no-workspaces-update
npm version $NEW_SYNC_VERSION --no-git-tag-version --workspace=@actual-app/sync-server --no-workspaces-update
npm version $NEW_API_VERSION --no-git-tag-version --workspace=@actual-app/api --no-workspaces-update
@@ -33,6 +35,10 @@ jobs:
run: |
yarn install
+ - name: Pack the core package
+ run: |
+ yarn workspace @actual-app/core pack --filename @actual-app/core.tgz
+
- name: Build Server & Web
run: yarn build:server
@@ -53,6 +59,7 @@ jobs:
with:
name: npm-packages
path: |
+ packages/loot-core/@actual-app/core.tgz
packages/desktop-client/@actual-app/web.tgz
packages/sync-server/@actual-app/sync-server.tgz
packages/api/@actual-app/api.tgz
@@ -76,6 +83,12 @@ jobs:
node-version: 22
registry-url: 'https://registry.npmjs.org'
+ - name: Publish Core
+ run: |
+ npm publish loot-core/@actual-app/core.tgz --access public --tag nightly
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
- name: Publish Web
run: |
npm publish desktop-client/@actual-app/web.tgz --access public --tag nightly
diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml
index 64c67405e6..445544fabd 100644
--- a/.github/workflows/publish-npm-packages.yml
+++ b/.github/workflows/publish-npm-packages.yml
@@ -16,6 +16,10 @@ jobs:
- name: Set up environment
uses: ./.github/actions/setup
+ - name: Pack the core package
+ run: |
+ yarn workspace @actual-app/core pack --filename @actual-app/core.tgz
+
- name: Build Web
run: yarn build:server
@@ -36,6 +40,7 @@ jobs:
with:
name: npm-packages
path: |
+ packages/loot-core/@actual-app/core.tgz
packages/desktop-client/@actual-app/web.tgz
packages/sync-server/@actual-app/sync-server.tgz
packages/api/@actual-app/api.tgz
@@ -59,6 +64,12 @@ jobs:
node-version: 22
registry-url: 'https://registry.npmjs.org'
+ - name: Publish Core
+ run: |
+ npm publish loot-core/@actual-app/core.tgz --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
- name: Publish Web
run: |
npm publish desktop-client/@actual-app/web.tgz --access public
diff --git a/.oxfmtrc.json b/.oxfmtrc.json
index 63617a3085..d731450ff0 100644
--- a/.oxfmtrc.json
+++ b/.oxfmtrc.json
@@ -10,7 +10,7 @@
"builtin",
"external",
"loot-core",
- "parent",
+ ["parent", "subpath"],
"sibling",
"index",
"desktop-client"
@@ -22,7 +22,7 @@
},
{
"groupName": "loot-core",
- "elementNamePattern": ["loot-core/**"]
+ "elementNamePattern": ["loot-core/**", "@actual-app/core/**"]
},
{
"groupName": "desktop-client",
diff --git a/AGENTS.md b/AGENTS.md
index 81bd4001ff..269dc2a7f3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -84,7 +84,7 @@ The core application logic that runs on any platform.
```bash
# Run all loot-core tests
- yarn workspace loot-core run test
+ yarn workspace @actual-app/core run test
# Or run tests across all packages using lage
yarn test
@@ -219,7 +219,7 @@ yarn test
yarn test:debug
# Run tests for a specific package
-yarn workspace loot-core run test
+yarn workspace @actual-app/core run test
```
**E2E Tests (Playwright)**
diff --git a/bin/package-browser b/bin/package-browser
index 526393a139..67204a5b20 100755
--- a/bin/package-browser
+++ b/bin/package-browser
@@ -17,7 +17,7 @@ packages/desktop-client/bin/remove-untranslated-languages
export NODE_OPTIONS="--max-old-space-size=4096"
yarn workspace plugins-service build
-yarn workspace loot-core build:browser
+yarn workspace @actual-app/core build:browser
yarn workspace @actual-app/web build:browser
echo "packages/desktop-client/build"
diff --git a/bin/package-electron b/bin/package-electron
index 0506fdcb5b..ffd46c5817 100755
--- a/bin/package-electron
+++ b/bin/package-electron
@@ -51,16 +51,16 @@ fi
export NODE_OPTIONS="--max-old-space-size=4096"
yarn workspace plugins-service build
-yarn workspace loot-core build:node
+yarn workspace @actual-app/core build:node
yarn workspace @actual-app/web build --mode=desktop # electron specific build
# required for running the sync-server server
-yarn workspace loot-core build:browser
+yarn workspace @actual-app/core build:browser
yarn workspace @actual-app/web build:browser
yarn workspace @actual-app/sync-server build
-# Emit loot-core declarations so desktop-electron (which includes typings/window.ts) can build
-yarn workspace loot-core exec tsgo -p tsconfig.json
+# Emit @actual-app/core declarations so desktop-electron (which includes typings/window.ts) can build
+yarn workspace @actual-app/core exec tsgo -p tsconfig.json
yarn workspace desktop-electron update-client
diff --git a/package.json b/package.json
index 0078250294..ca03c0d2ed 100644
--- a/package.json
+++ b/package.json
@@ -25,16 +25,16 @@
"start:desktop": "yarn desktop-dependencies && npm-run-all --parallel 'start:desktop-*'",
"start:docs": "yarn workspace docs start",
"desktop-dependencies": "npm-run-all --parallel rebuild-electron build:browser-backend build:plugins-service",
- "start:desktop-node": "yarn workspace loot-core watch:node",
+ "start:desktop-node": "yarn workspace @actual-app/core watch:node",
"start:desktop-client": "yarn workspace @actual-app/web watch",
"start:desktop-server-client": "yarn workspace @actual-app/web build:browser",
"start:desktop-electron": "yarn workspace desktop-electron watch",
"start:browser": "yarn workspace plugins-service build-dev && npm-run-all --parallel 'start:browser-*'",
"start:service-plugins": "yarn workspace plugins-service watch",
- "start:browser-backend": "yarn workspace loot-core watch:browser",
+ "start:browser-backend": "yarn workspace @actual-app/core watch:browser",
"start:browser-frontend": "yarn workspace @actual-app/web start:browser",
"start:storybook": "yarn workspace @actual-app/components start:storybook",
- "build:browser-backend": "yarn workspace loot-core build:browser",
+ "build:browser-backend": "yarn workspace @actual-app/core build:browser",
"build:server": "yarn build:browser && yarn workspace @actual-app/sync-server build",
"build:browser": "./bin/package-browser",
"build:desktop": "./bin/package-electron",
@@ -53,7 +53,7 @@
"vrt": "yarn workspace @actual-app/web run vrt",
"vrt:docker": "./bin/run-vrt",
"rebuild-electron": "./node_modules/.bin/electron-rebuild -m ./packages/loot-core",
- "rebuild-node": "yarn workspace loot-core rebuild",
+ "rebuild-node": "yarn workspace @actual-app/core rebuild",
"lint": "oxfmt --check . && oxlint --type-aware --quiet",
"lint:fix": "oxfmt . && oxlint --fix --type-aware --quiet",
"install:server": "yarn workspaces focus @actual-app/sync-server --production",
diff --git a/packages/api/index.ts b/packages/api/index.ts
index 38e9d5f723..2daa9b456e 100644
--- a/packages/api/index.ts
+++ b/packages/api/index.ts
@@ -3,8 +3,8 @@ import type {
RequestInit as FetchInit,
} from 'node-fetch';
-import { init as initLootCore } from 'loot-core/server/main';
-import type { InitConfig, lib } from 'loot-core/server/main';
+import { init as initLootCore } from '@actual-app/core/server/main';
+import type { InitConfig, lib } from '@actual-app/core/server/main';
import { validateNodeVersion } from './validateNodeVersion';
diff --git a/packages/api/methods.test.ts b/packages/api/methods.test.ts
index 5bb180b8e1..3b23865aa8 100644
--- a/packages/api/methods.test.ts
+++ b/packages/api/methods.test.ts
@@ -3,7 +3,7 @@ import * as path from 'path';
import { vi } from 'vitest';
-import type { RuleEntity } from 'loot-core/types/models';
+import type { RuleEntity } from '@actual-app/core/types/models';
import * as api from './index';
diff --git a/packages/api/methods.ts b/packages/api/methods.ts
index 3ba5916115..14137aad41 100644
--- a/packages/api/methods.ts
+++ b/packages/api/methods.ts
@@ -6,16 +6,16 @@ import type {
APIPayeeEntity,
APIScheduleEntity,
APITagEntity,
-} from 'loot-core/server/api-models';
-import { lib } from 'loot-core/server/main';
-import type { Query } from 'loot-core/shared/query';
-import type { ImportTransactionsOpts } from 'loot-core/types/api-handlers';
-import type { Handlers } from 'loot-core/types/handlers';
+} from '@actual-app/core/server/api-models';
+import { lib } from '@actual-app/core/server/main';
+import type { Query } from '@actual-app/core/shared/query';
+import type { ImportTransactionsOpts } from '@actual-app/core/types/api-handlers';
+import type { Handlers } from '@actual-app/core/types/handlers';
import type {
ImportTransactionEntity,
RuleEntity,
TransactionEntity,
-} from 'loot-core/types/models';
+} from '@actual-app/core/types/models';
export { q } from './app/query';
diff --git a/packages/api/package.json b/packages/api/package.json
index 27673eec01..2e867ee28a 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -10,15 +10,15 @@
"main": "dist/index.js",
"types": "@types/index.d.ts",
"scripts": {
- "build": "yarn workspace loot-core exec tsgo && vite build && node scripts/inline-loot-core-types.mjs",
+ "build": "yarn workspace @actual-app/core exec tsgo && vite build && node scripts/inline-loot-core-types.mjs",
"test": "vitest --run",
"typecheck": "tsgo -b && tsc-strict"
},
"dependencies": {
- "@actual-app/crdt": "workspace:^",
+ "@actual-app/core": "workspace:*",
+ "@actual-app/crdt": "workspace:*",
"better-sqlite3": "^12.6.2",
"compare-versions": "^6.1.1",
- "loot-core": "workspace:^",
"node-fetch": "^3.3.2",
"uuid": "^13.0.0"
},
diff --git a/packages/api/scripts/inline-loot-core-types.mjs b/packages/api/scripts/inline-loot-core-types.mjs
index 2dc719f57d..9dd156cf4d 100644
--- a/packages/api/scripts/inline-loot-core-types.mjs
+++ b/packages/api/scripts/inline-loot-core-types.mjs
@@ -1,7 +1,7 @@
/**
* Post-build script: copies loot-core declaration tree into @types/loot-core
* and rewrites index.d.ts to reference it so the published package is self-contained.
- * Run after vite build; requires loot-core declarations (yarn workspace loot-core exec tsgo).
+ * Run after vite build; requires loot-core declarations (yarn workspace @actual-app/core exec tsgo).
*/
import fs from 'fs';
import path from 'path';
@@ -23,7 +23,7 @@ function main() {
}
if (!fs.existsSync(lootCoreDeclSrc)) {
console.error(
- 'Missing loot-core declarations; run: yarn workspace loot-core exec tsgo',
+ 'Missing loot-core declarations; run: yarn workspace @actual-app/core exec tsgo',
);
process.exit(1);
}
diff --git a/packages/api/utils.ts b/packages/api/utils.ts
index 0977cc34e1..b83c3ab072 100644
--- a/packages/api/utils.ts
+++ b/packages/api/utils.ts
@@ -1,4 +1,4 @@
-import { lib } from 'loot-core/server/main';
+import { lib } from '@actual-app/core/server/main';
export const amountToInteger = lib.amountToInteger;
export const integerToAmount = lib.integerToAmount;
diff --git a/packages/desktop-client/package.json b/packages/desktop-client/package.json
index 45af21ebba..6804493e53 100644
--- a/packages/desktop-client/package.json
+++ b/packages/desktop-client/package.json
@@ -20,6 +20,7 @@
},
"devDependencies": {
"@actual-app/components": "workspace:*",
+ "@actual-app/core": "workspace:*",
"@codemirror/autocomplete": "^6.20.0",
"@codemirror/lang-javascript": "^6.2.4",
"@codemirror/language": "^6.12.1",
@@ -62,7 +63,6 @@
"i18next-resources-to-backend": "^1.2.1",
"jsdom": "^27.4.0",
"lodash": "^4.17.23",
- "loot-core": "workspace:*",
"mdast-util-newline-to-break": "^2.0.0",
"memoize-one": "^6.0.0",
"pikaday": "1.8.2",
diff --git a/packages/desktop-client/src/globals.ts b/packages/desktop-client/src/globals.ts
index 9a4173fa37..947a4efa30 100644
--- a/packages/desktop-client/src/globals.ts
+++ b/packages/desktop-client/src/globals.ts
@@ -1 +1 @@
-import 'loot-core/typings/window';
+import '@actual-app/core/typings/window';
diff --git a/packages/desktop-client/tsconfig.json b/packages/desktop-client/tsconfig.json
index 7acc952fea..519b45b7f6 100644
--- a/packages/desktop-client/tsconfig.json
+++ b/packages/desktop-client/tsconfig.json
@@ -11,6 +11,8 @@
"rootDir": "src",
"tsBuildInfoFile": "build/ts/.tsbuildinfo",
"paths": {
+ // TODO: remove and replace with imports from "@actual-app/core"
+ "loot-core/*": ["../loot-core/src/*"],
// TODO: move to subpath imports
"@desktop-client/*": ["./src/*"]
},
diff --git a/packages/desktop-client/vite.config.mts b/packages/desktop-client/vite.config.mts
index e4e8f5249f..492a9ee38f 100644
--- a/packages/desktop-client/vite.config.mts
+++ b/packages/desktop-client/vite.config.mts
@@ -154,6 +154,8 @@ export default defineConfig(async ({ mode }) => {
extensions: resolveExtensions,
alias: {
'@desktop-client': path.join(__dirname, 'src'),
+ // TODO: remove this once all loot-core imports are replaced with @actual-app/core
+ 'loot-core': path.join(__dirname, '../loot-core/src'),
},
...(!env.IS_GENERIC_BROWSER && {
conditions: ['electron', 'module', 'browser', 'default'],
diff --git a/packages/desktop-electron/index.ts b/packages/desktop-electron/index.ts
index 92a3b3ae1d..bec2260211 100644
--- a/packages/desktop-electron/index.ts
+++ b/packages/desktop-electron/index.ts
@@ -25,7 +25,7 @@ import type {
import { copy, exists, mkdir, remove } from 'fs-extra';
import promiseRetry from 'promise-retry';
-import type { GlobalPrefsJson } from 'loot-core/types/prefs';
+import type { GlobalPrefsJson } from '@actual-app/core/types/prefs';
import { getMenu } from './menu';
import {
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index e9426d3461..beca063f2a 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -21,6 +21,7 @@
"promise-retry": "^2.0.1"
},
"devDependencies": {
+ "@actual-app/core": "workspace:*",
"@electron/notarize": "3.1.1",
"@electron/rebuild": "4.0.2",
"@playwright/test": "1.58.2",
@@ -31,7 +32,6 @@
"cross-env": "^10.1.0",
"electron": "39.2.7",
"electron-builder": "26.4.0",
- "loot-core": "workspace:*",
"typescript-strict-plugin": "^2.4.4"
},
"build": {
diff --git a/packages/docs/docs/contributing/development-setup.md b/packages/docs/docs/contributing/development-setup.md
index 69f412f341..431dd66ff1 100644
--- a/packages/docs/docs/contributing/development-setup.md
+++ b/packages/docs/docs/contributing/development-setup.md
@@ -118,8 +118,8 @@ yarn workspace <workspace-name> run <command>
Examples:
```bash
-# Run tests for loot-core
-yarn workspace loot-core run test
+# Run tests for @actual-app/core
+yarn workspace @actual-app/core run test
# Start the docs development server
yarn workspace docs start
diff --git a/packages/docs/docs/contributing/testing.md b/packages/docs/docs/contributing/testing.md
index a29f21c1dc..10f09e80b2 100644
--- a/packages/docs/docs/contributing/testing.md
+++ b/packages/docs/docs/contributing/testing.md
@@ -33,8 +33,8 @@ The `yarn test` command uses Lage to run tests in parallel across all workspaces
### Running Tests for a Specific Package
```bash
-# Run tests for loot-core
-yarn workspace loot-core run test
+# Run tests for @actual-app/core
+yarn workspace @actual-app/core run test
# Run tests for the API package
yarn workspace @actual-app/api run test
diff --git a/packages/docs/docs/contributing/troubleshooting.md b/packages/docs/docs/contributing/troubleshooting.md
index 24f1d3f538..26ffd96ef3 100644
--- a/packages/docs/docs/contributing/troubleshooting.md
+++ b/packages/docs/docs/contributing/troubleshooting.md
@@ -86,7 +86,7 @@ This guide helps you resolve common issues when developing for Actual.
1. On Windows: Ensure you selected "Automatically install the necessary tools" during Node.js installation
2. Run `yarn rebuild-electron` for Electron builds
-3. Run `yarn workspace loot-core rebuild` for Node.js builds
+3. Run `yarn workspace @actual-app/core rebuild` for Node.js builds
4. Ensure you have the necessary build tools installed (Python, Visual Studio Build Tools on Windows)
## Development Server Issues
diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json
index 281de24a83..e54c531cfb 100644
--- a/packages/loot-core/package.json
+++ b/packages/loot-core/package.json
@@ -1,10 +1,8 @@
{
- "name": "loot-core",
- "version": "0.0.2",
+ "name": "@actual-app/core",
+ "version": "26.3.0",
"description": "",
"license": "ISC",
- "author": "",
- "main": "index.js",
"typesVersions": {
"*": {
"types/*": [
@@ -12,6 +10,14 @@
]
}
},
+ "imports": {
+ "#*": [
+ "./src/*.ts",
+ "./src/*.tsx",
+ "./src/*/index.ts",
+ "./src/*/index.tsx"
+ ]
+ },
"exports": {
"./client/accounts/*": "./src/client/accounts/*.ts",
"./client/app/*": "./src/client/app/*.ts",
@@ -94,7 +100,7 @@
"uuid": "^13.0.0"
},
"devDependencies": {
- "@actual-app/crdt": "workspace:^",
+ "@actual-app/crdt": "workspace:*",
"@swc/core": "^1.15.11",
"@types/adm-zip": "^0.5.7",
"@types/better-sqlite3": "^7.6.13",
diff --git a/packages/loot-core/src/server/budget/actions.ts b/packages/loot-core/src/server/budget/actions.ts
index 930460aaec..01de568cc0 100644
--- a/packages/loot-core/src/server/budget/actions.ts
+++ b/packages/loot-core/src/server/budget/actions.ts
@@ -1,7 +1,6 @@
// @ts-strict-ignore
-import { getCurrency } from 'loot-core/shared/currencies';
-
+import { getCurrency } from '#shared/currencies';
import * as asyncStorage from '../../platform/server/asyncStorage';
import { getLocale } from '../../shared/locale';
import * as monthUtils from '../../shared/months';
diff --git a/packages/loot-core/src/server/budget/category-template-context.ts b/packages/loot-core/src/server/budget/category-template-context.ts
index 59ba98c9a8..f715bc3bf0 100644
--- a/packages/loot-core/src/server/budget/category-template-context.ts
+++ b/packages/loot-core/src/server/budget/category-template-context.ts
@@ -1,7 +1,6 @@
-import { getCurrency } from 'loot-core/shared/currencies';
-import type { Currency } from 'loot-core/shared/currencies';
-import { q } from 'loot-core/shared/query';
-
+import { getCurrency } from '#shared/currencies';
+import type { Currency } from '#shared/currencies';
+import { q } from '#shared/query';
import * as monthUtils from '../../shared/months';
import { amountToInteger, integerToAmount } from '../../shared/util';
import type { CategoryEntity } from '../../types/models';
diff --git a/packages/loot-core/src/server/budget/schedule-template.test.ts b/packages/loot-core/src/server/budget/schedule-template.test.ts
index 4c8ff24d65..72ecd5090a 100644
--- a/packages/loot-core/src/server/budget/schedule-template.test.ts
+++ b/packages/loot-core/src/server/budget/schedule-template.test.ts
@@ -1,5 +1,4 @@
-import type { Currency } from 'loot-core/shared/currencies';
-
+import type { Currency } from '#shared/currencies';
import type { CategoryEntity } from '../../types/models';
import * as db from '../db';
import { Rule } from '../rules';
diff --git a/packages/loot-core/src/server/budget/schedule-template.ts b/packages/loot-core/src/server/budget/schedule-template.ts
index 39975cc0da..6c8c534c52 100644
--- a/packages/loot-core/src/server/budget/schedule-template.ts
+++ b/packages/loot-core/src/server/budget/schedule-template.ts
@@ -1,8 +1,7 @@
// @ts-strict-ignore
-import type { Currency } from 'loot-core/shared/currencies';
-import { amountToInteger } from 'loot-core/shared/util';
-
+import type { Currency } from '#shared/currencies';
+import { amountToInteger } from '#shared/util';
import * as monthUtils from '../../shared/months';
import {
extractScheduleConds,
diff --git a/packages/loot-core/src/server/payees/app.ts b/packages/loot-core/src/server/payees/app.ts
index d04d2bd909..80b8431bbc 100644
--- a/packages/loot-core/src/server/payees/app.ts
+++ b/packages/loot-core/src/server/payees/app.ts
@@ -1,5 +1,4 @@
-import { DEFAULT_MAX_DISTANCE_METERS } from 'loot-core/shared/constants';
-
+import { DEFAULT_MAX_DISTANCE_METERS } from '#shared/constants';
import type { Diff } from '../../shared/util';
import type {
NearbyPayeeEntity,
@@ -245,7 +244,7 @@ async function getNearbyPayees({
// Get the closest location for each payee within maxDistance using window functions
const query = `
WITH payee_distances AS (
- SELECT
+ SELECT
pl.id as location_id,
pl.payee_id,
pl.latitude,
@@ -260,8 +259,8 @@ async function getNearbyPayees({
-- Haversine formula to calculate distance
((6371 * acos(
MIN(1, MAX(-1,
- cos(radians(?)) * cos(radians(pl.latitude)) *
- cos(radians(pl.longitude) - radians(?)) +
+ cos(radians(?)) * cos(radians(pl.latitude)) *
+ cos(radians(pl.longitude) - radians(?)) +
sin(radians(?)) * sin(radians(pl.latitude))
))
))) * 1000 as distance,
@@ -269,8 +268,8 @@ async function getNearbyPayees({
ROW_NUMBER() OVER (PARTITION BY pl.payee_id ORDER BY (
(6371 * acos(
MIN(1, MAX(-1,
- cos(radians(?)) * cos(radians(pl.latitude)) *
- cos(radians(pl.longitude) - radians(?)) +
+ cos(radians(?)) * cos(radians(pl.latitude)) *
+ cos(radians(pl.longitude) - radians(?)) +
sin(radians(?)) * sin(radians(pl.latitude))
))
)) * 1000
@@ -282,13 +281,13 @@ async function getNearbyPayees({
-- Filter by distance using Haversine formula
AND (6371 * acos(
MIN(1, MAX(-1,
- cos(radians(?)) * cos(radians(pl.latitude)) *
- cos(radians(pl.longitude) - radians(?)) +
+ cos(radians(?)) * cos(radians(pl.latitude)) *
+ cos(radians(pl.longitude) - radians(?)) +
sin(radians(?)) * sin(radians(pl.latitude))
))
)) * 1000 <= ?
)
- SELECT
+ SELECT
location_id,
payee_id,
latitude,
diff --git a/packages/loot-core/src/server/reports/app.ts b/packages/loot-core/src/server/reports/app.ts
index d3993bb18e..5339668c7c 100644
--- a/packages/loot-core/src/server/reports/app.ts
+++ b/packages/loot-core/src/server/reports/app.ts
@@ -1,7 +1,6 @@
import { v4 as uuidv4 } from 'uuid';
-import { q } from 'loot-core/shared/query';
-
+import { q } from '#shared/query';
import type { CustomReportData, CustomReportEntity } from '../../types/models';
import { createApp } from '../app';
import { aqlQuery } from '../aql';
diff --git a/packages/loot-core/src/server/rules/action.ts b/packages/loot-core/src/server/rules/action.ts
index be1ff6396d..275f1c9ea7 100644
--- a/packages/loot-core/src/server/rules/action.ts
+++ b/packages/loot-core/src/server/rules/action.ts
@@ -4,8 +4,7 @@ import * as Handlebars from 'handlebars';
import { HyperFormula } from 'hyperformula';
import enUS from 'hyperformula/i18n/languages/enUS';
-import { amountToInteger } from 'loot-core/shared/util';
-
+import { amountToInteger } from '#shared/util';
import { logger } from '../../platform/server/log';
import { currentDay, format, parseDate } from '../../shared/months';
import { FIELD_TYPES } from '../../shared/rules';
diff --git a/packages/loot-core/src/shared/schedules.ts b/packages/loot-core/src/shared/schedules.ts
index 295bea0971..54848c27de 100644
--- a/packages/loot-core/src/shared/schedules.ts
+++ b/packages/loot-core/src/shared/schedules.ts
@@ -4,12 +4,7 @@ import * as d from 'date-fns';
import type { Locale } from 'date-fns';
import { t } from 'i18next';
-import type {
- PayeeEntity,
- RecurConfig,
- ScheduleEntity,
-} from 'loot-core/types/models';
-
+import type { PayeeEntity, RecurConfig, ScheduleEntity } from '#types/models';
import { Condition } from '../server/rules';
import * as monthUtils from './months';
diff --git a/upcoming-release-notes/7200.md b/upcoming-release-notes/7200.md
new file mode 100644
index 0000000000..9739c90574
--- /dev/null
+++ b/upcoming-release-notes/7200.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+Publish loot-core package and rename it to "@actual-app/core"
diff --git a/yarn.lock b/yarn.lock
index 4ce3d02497..bcd52e9783 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -23,11 +23,11 @@ __metadata:
version: 0.0.0-use.local
resolution: "@actual-app/api@workspace:packages/api"
dependencies:
- "@actual-app/crdt": "workspace:^"
+ "@actual-app/core": "workspace:*"
+ "@actual-app/crdt": "workspace:*"
"@typescript/native-preview": "npm:^7.0.0-dev.20260309.1"
better-sqlite3: "npm:^12.6.2"
compare-versions: "npm:^6.1.1"
- loot-core: "workspace:^"
node-fetch: "npm:^3.3.2"
rollup-plugin-visualizer: "npm:^6.0.5"
typescript-strict-plugin: "npm:^2.4.4"
@@ -75,6 +75,64 @@ __metadata:
languageName: unknown
linkType: soft
+"@actual-app/core@workspace:*, @actual-app/core@workspace:packages/loot-core":
+ version: 0.0.0-use.local
+ resolution: "@actual-app/core@workspace:packages/loot-core"
+ dependencies:
+ "@actual-app/crdt": "workspace:*"
+ "@jlongster/sql.js": "npm:^1.6.7"
+ "@reduxjs/toolkit": "npm:^2.11.2"
+ "@rschedule/core": "npm:^1.5.0"
+ "@rschedule/json-tools": "npm:^1.5.0"
+ "@rschedule/standard-date-adapter": "npm:^1.5.0"
+ "@swc/core": "npm:^1.15.11"
+ "@types/adm-zip": "npm:^0.5.7"
+ "@types/better-sqlite3": "npm:^7.6.13"
+ "@types/emscripten": "npm:^1.41.5"
+ "@types/jlongster__sql.js": "npm:@types/sql.js@latest"
+ "@types/node": "npm:^22.19.10"
+ "@types/pegjs": "npm:^0.10.6"
+ "@typescript/native-preview": "npm:^7.0.0-dev.20260309.1"
+ absurd-sql: "npm:0.0.54"
+ adm-zip: "patch:adm-zip@npm%3A0.5.16#~/.yarn/patches/adm-zip-npm-0.5.16-4556fea098.patch"
+ assert: "npm:^2.1.0"
+ better-sqlite3: "npm:^12.6.2"
+ browserify-zlib: "npm:^0.2.0"
+ buffer: "npm:^6.0.3"
+ cross-env: "npm:^10.1.0"
+ csv-parse: "npm:^6.1.0"
+ csv-stringify: "npm:^6.6.0"
+ date-fns: "npm:^4.1.0"
+ fake-indexeddb: "npm:^6.2.5"
+ fast-check: "npm:4.5.3"
+ handlebars: "npm:^4.7.8"
+ i18next: "npm:^25.8.4"
+ jest-diff: "npm:^30.2.0"
+ jsverify: "npm:^0.8.4"
+ lru-cache: "npm:^11.2.5"
+ md5: "npm:^2.3.0"
+ memoize-one: "npm:^6.0.0"
+ mitt: "npm:^3.0.1"
+ mockdate: "npm:^3.0.5"
+ npm-run-all: "npm:^4.1.5"
+ path-browserify: "npm:^1.0.1"
+ peggy: "npm:5.0.6"
+ promise-retry: "npm:^2.0.1"
+ rollup-plugin-visualizer: "npm:^6.0.5"
+ slash: "npm:5.1.0"
+ stream-browserify: "npm:^3.0.0"
+ ts-node: "npm:^10.9.2"
+ typescript-strict-plugin: "npm:^2.4.4"
+ ua-parser-js: "npm:^2.0.9"
+ uuid: "npm:^13.0.0"
+ vite: "npm:^7.3.1"
+ vite-plugin-node-polyfills: "npm:^0.25.0"
+ vite-plugin-peggy-loader: "npm:^2.0.1"
+ vitest: "npm:^4.0.18"
+ yargs: "npm:^18.0.0"
+ languageName: unknown
+ linkType: soft
+
"@actual-app/crdt@npm:2.1.0":
version: 2.1.0
resolution: "@actual-app/crdt@npm:2.1.0"
@@ -86,7 +144,7 @@ __metadata:
languageName: node
linkType: hard
-"@actual-app/crdt@workspace:^, @actual-app/crdt@workspace:packages/crdt":
+"@actual-app/crdt@workspace:*, @actual-app/crdt@workspace:packages/crdt":
version: 0.0.0-use.local
resolution: "@actual-app/crdt@workspace:packages/crdt"
dependencies:
@@ -151,6 +209,7 @@ __metadata:
resolution: "@actual-app/web@workspace:packages/desktop-client"
dependencies:
"@actual-app/components": "workspace:*"
+ "@actual-app/core": "workspace:*"
"@codemirror/autocomplete": "npm:^6.20.0"
"@codemirror/lang-javascript": "npm:^6.2.4"
"@codemirror/language": "npm:^6.12.1"
@@ -193,7 +252,6 @@ __metadata:
i18next-resources-to-backend: "npm:^1.2.1"
jsdom: "npm:^27.4.0"
lodash: "npm:^4.17.23"
- loot-core: "workspace:*"
mdast-util-newline-to-break: "npm:^2.0.0"
memoize-one: "npm:^6.0.0"
pikaday: "npm:1.8.2"
@@ -15101,6 +15159,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "desktop-electron@workspace:packages/desktop-electron"
dependencies:
+ "@actual-app/core": "workspace:*"
"@actual-app/sync-server": "workspace:*"
"@electron/notarize": "npm:3.1.1"
"@electron/rebuild": "npm:4.0.2"
@@ -15114,7 +15173,6 @@ __metadata:
electron: "npm:39.2.7"
electron-builder: "npm:26.4.0"
fs-extra: "npm:^11.3.3"
- loot-core: "workspace:*"
promise-retry: "npm:^2.0.1"
typescript-strict-plugin: "npm:^2.4.4"
languageName: unknown
@@ -20566,64 +20624,6 @@ __metadata:
languageName: node
linkType: hard
-"loot-core@workspace:*, loot-core@workspace:^, loot-core@workspace:packages/loot-core":
- version: 0.0.0-use.local
- resolution: "loot-core@workspace:packages/loot-core"
- dependencies:
- "@actual-app/crdt": "workspace:^"
- "@jlongster/sql.js": "npm:^1.6.7"
- "@reduxjs/toolkit": "npm:^2.11.2"
- "@rschedule/core": "npm:^1.5.0"
- "@rschedule/json-tools": "npm:^1.5.0"
- "@rschedule/standard-date-adapter": "npm:^1.5.0"
- "@swc/core": "npm:^1.15.11"
- "@types/adm-zip": "npm:^0.5.7"
- "@types/better-sqlite3": "npm:^7.6.13"
- "@types/emscripten": "npm:^1.41.5"
- "@types/jlongster__sql.js": "npm:@types/sql.js@latest"
- "@types/node": "npm:^22.19.10"
- "@types/pegjs": "npm:^0.10.6"
- "@typescript/native-preview": "npm:^7.0.0-dev.20260309.1"
- absurd-sql: "npm:0.0.54"
- adm-zip: "patch:adm-zip@npm%3A0.5.16#~/.yarn/patches/adm-zip-npm-0.5.16-4556fea098.patch"
- assert: "npm:^2.1.0"
- better-sqlite3: "npm:^12.6.2"
- browserify-zlib: "npm:^0.2.0"
- buffer: "npm:^6.0.3"
- cross-env: "npm:^10.1.0"
- csv-parse: "npm:^6.1.0"
- csv-stringify: "npm:^6.6.0"
- date-fns: "npm:^4.1.0"
- fake-indexeddb: "npm:^6.2.5"
- fast-check: "npm:4.5.3"
- handlebars: "npm:^4.7.8"
- i18next: "npm:^25.8.4"
- jest-diff: "npm:^30.2.0"
- jsverify: "npm:^0.8.4"
- lru-cache: "npm:^11.2.5"
- md5: "npm:^2.3.0"
- memoize-one: "npm:^6.0.0"
- mitt: "npm:^3.0.1"
- mockdate: "npm:^3.0.5"
- npm-run-all: "npm:^4.1.5"
- path-browserify: "npm:^1.0.1"
- peggy: "npm:5.0.6"
- promise-retry: "npm:^2.0.1"
- rollup-plugin-visualizer: "npm:^6.0.5"
- slash: "npm:5.1.0"
- stream-browserify: "npm:^3.0.0"
- ts-node: "npm:^10.9.2"
- typescript-strict-plugin: "npm:^2.4.4"
- ua-parser-js: "npm:^2.0.9"
- uuid: "npm:^13.0.0"
- vite: "npm:^7.3.1"
- vite-plugin-node-polyfills: "npm:^0.25.0"
- vite-plugin-peggy-loader: "npm:^2.0.1"
- vitest: "npm:^4.0.18"
- yargs: "npm:^18.0.0"
- languageName: unknown
- linkType: soft
-
"loupe@npm:^3.1.0, loupe@npm:^3.1.4, loupe@npm:^3.2.1":
version: 3.2.1
resolution: "loupe@npm:3.2.1"