* [AI] Add @actual-app/cli package
New CLI tool wrapping the full @actual-app/api surface for interacting with
Actual Budget from the command line. Connects to a sync server and supports
all CRUD operations across accounts, budgets, categories, transactions,
payees, tags, rules, schedules, and AQL queries.
* Refactor CLI options: replace `--quiet` with `--verbose` for improved message control. Update related configurations and tests to reflect this change. Adjust build command in workflow for consistency.
* Refactor tests: streamline imports in connection and accounts test files for improved clarity and consistency. Remove dynamic imports in favor of static imports.
* Enhance package.json: Add exports configuration for module resolution and publish settings. This includes specifying types and default files for better compatibility and clarity in package usage.
* Update package.json exports configuration to support environment-specific module resolution. Added 'development' and 'default' entries for improved clarity in file usage.
* Enhance CLI functionality: Update configuration loading to support additional search places for config files. Refactor error handling in command options to improve validation and user feedback. Introduce new utility functions for parsing boolean flags and update related commands to utilize these functions. Add comprehensive tests for new utility functions to ensure reliability.
* Update CLI TypeScript configuration to include Vitest globals and streamline test imports across multiple test files for improved clarity and consistency.
* Update CLI dependencies and build workflow
- Upgrade Vite to version 8.0.0 and Vitest to version 4.1.0 in package.json.
- Add rollup-plugin-visualizer for bundle analysis.
- Modify build workflow to prepare and upload CLI bundle stats.
- Update size comparison workflow to include CLI stats.
- Remove obsolete vitest.config.ts file as its configuration is now integrated into vite.config.ts.
* Enhance size comparison workflow to include CLI build checks and artifact downloads
- Added steps to wait for CLI build success in both base and PR workflows.
- Included downloading of CLI build artifacts for comparison between base and PR branches.
- Updated failure reporting to account for CLI build status.
* Update documentation to replace "CLI tool" with "Server CLI" for consistency across multiple files. This change clarifies the distinction between the command-line interface for the Actual Budget application and the sync-server CLI tool.
* Refactor configuration to replace "budgetId" with "syncId" across CLI and documentation
* Enhance configuration validation by adding support for 'ACTUAL_ENCRYPTION_PASSWORD' and implementing a new validation function for config file content. Update documentation to clarify error output format for the CLI tool.
* Enhance configuration tests to include 'encryptionPassword' checks for CLI options and environment variables, ensuring proper priority handling in the configuration resolution process.
* Update nightly versioning script to use yarn
* Align versions
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Combine bundle stats comments in PR
* Refactor bundle stats comment generation to use a mapping approach for base and head stats, improving argument parsing and validation in the CI action.
* Enhance size comparison workflow by adding steps to checkout the base branch and set up the environment, ensuring accurate build status checks for pull requests.
* Implement size comparison job in GitHub Actions workflow, replacing the deprecated size-compare.yml. This new job downloads build stats from both the base and head branches, processes the stats files, and generates a combined comment for pull requests, enhancing visibility into bundle size changes.
* Add release notes for bundle size stats update, consolidating workflow and PR comment generation.
* Refactor GitHub Actions workflows by removing the deprecated size comparison job from build.yml and introducing a new size-compare.yml workflow. This new workflow enhances build status checks and ensures accurate reporting of bundle size changes for pull requests.
* chore: update action versions and improve error messages in bundle stats scripts
- Updated GitHub Actions to specific commit versions for `upload-artifact` and `checkout`.
- Enhanced error messages in `bundle-stats-comment.mjs` and `update-bundle-stats-comment.mjs` for better clarity and consistency, replacing standard quotes with typographic quotes.
* fix: standardize error messages in bundle-stats-comment.mjs
- Updated error messages in `bundle-stats-comment.mjs` to remove typographic quotes for consistency and clarity.
* Enhance CI workflows to support repository dispatch events and improve branch handling
- Added support for `repository_dispatch` events in build, check, and codeql workflows.
- Updated concurrency group to include `client_payload.pr_number` for better context.
- Modified checkout steps to reference the correct branch from `client_payload` if available.
* Add release notes for PR #5586
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* attempt at running with typescript
* release notes
* working jest tests for TS files
* working docker image build
* remaining docker images
* cleanup
* ensure vitest is working
* get tests passing in ci
* less strict
* update release notes
* use tsc compiled assets in the published package
* scripts
* update yarn.lock
* Use build path for electron app
* PR feedback: move sync-server build out of bin/build-browser
* PR feedback: undo moduleResolution change
* extend main tsconfig and fix types
* PR feedback on scripts and when the sync-server build runs
* fix lint (unrelated change)
---------
Co-authored-by: alecbakholdin <alecbakholdin@gmail.com>
This PR moves the size comparison action back to a separate workflow
which now uses the `pull_request_target` event. This event is triggered
at all the same times as the `pull_request` action, except that the
workflow file content comes from the target branch of the PR, and it is
run in the context of the repo owning the target branch. Practically,
this means that it will still have access to post a comment even if the
PR comes from a fork.
We don’t want the build actions to be run in a `pull_request_target`
workflow because they would get access to the secrets and be able to
perform arbitrary actions on the repository, even from fork PRs.
See the current version failing here:
https://github.com/actualbudget/actual/actions/runs/5395184895/jobs/9797388016?pr=1122
actual-server does not need to import the full actual-app/api package.
It can import only the CRDT stuff.. so I'm extracting it into a new
package to reduce the size of actual-server and make the link between
things more transparent.
Updates to the latest version of electron and moves the backend-frontend
communication from node-ipc to websockets. This resolves the previous
roadblock regarding `nodeIntegration` .
Done
- Remove node-ipc in favour of websockets.
- Move file copying out of `preload.js` to avoid importing module `fs`
there
- Bump all electron pacakge versions to the latest
- Added new package for finding open ports as node-ipc is gone
- Tweaked webpack config for above changes
Partially fixes#468
Questions/ Pending:
- Literally every single test fails for me, presumably some issue with
my setup/environment.
- The websocket communication is not using TLS. I'm not sure how to
enable this, or if we even need to as its all local.
- Still need to create the CI for building/deploying but I'm not sure
where start in this regard as i have no exp with it. Presumably we will
need to point the electron auto-updater to the github releases url's. If
people are happy with this PR I will look at adding the CI before its
merged.
- In dev mode only, I have disabled TLS security becuase my docker
container's cert is not signed. I _assume_ this will be true for other
people who spin up the server on thier own hardware. Perhaps I just need
to change my cert to one from letsencrypt or something...
Notes.
I have not touched javascript in eons so my apologies if the commit
trail is a bit fragmented. I tried to keep them fairly contained and
then there is a slightly gnarly final commit fixing all the linter
issues... Please let me know if you want me to squash some commits etc.
I initially tried to move this to web workers the same way the web app
does it but this was unsuccessful. I have found no way to spin up a
worker in one place (frontend/backend) and then pass this worker to the
other. The electron ipc channels don't allow you to directly pass
objects such as workers, everything is cloned/serialised. Passing a port
number so the other end can spin up its own socket works fine.
---------
Co-authored-by: Shazib Hussain <contact@shazib.com>
Co-authored-by: Jed Fox <git@jedfox.com>
* Make it easier to build the bundle.api.js for the API
* Remove budgetId parameter, move config to top level of API
* that’s a breaking change
* Add support for signing into the server in init()
* Add api.downloadBudget(syncId, { password }) method
* Fix lint errors
* Refactor: extract out getSyncError
* api/download-budget: sync if possible instead of downloading
* Don’t bother with fetching remote files and installing key if the file is local
* *groupId
* FIx lint issues
* Remove extra close+reopen
* Refactor out duplicate load-budget logic
* Trailing commas