[PR #1175] [CLOSED] [WIP] Replace bash scripts with javascript #3567

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/1175
Author: @Shazib
Created: 6/23/2023
Status: Closed

Base: masterHead: replace-bash


📝 Commits (10+)

  • 30a1e4f Replace bash scripts with javascript
  • 842b452 Add release notes
  • 0483c4c Updates for building new 'api' package
  • d9e38e2 oops
  • 35daee4 Merge branch 'master' into replace-bash
  • d9991c6 Give remaining bash scripts line endings because they get missed by the .gitattributes eol=lf rule
  • da0b663 electron bash to js conversion
  • ca95006 force commit this to update line endings??
  • a4631e4 Update to use file extensions
  • 8fadde5 set line endings on tsx files

📊 Changes

17 files changed (+294 additions, -6 deletions)

View changed files

📝 .eslintignore (+2 -0)
packages/bin/build-defines.js (+37 -0)
packages/bin/fs-util.js (+27 -0)
packages/bin/index.js (+28 -0)
packages/bin/migration-util.js (+25 -0)
packages/bin/package.json (+12 -0)
packages/bin/shell-util.js (+36 -0)
packages/desktop-client/bin/build-browser.js (+20 -0)
packages/desktop-client/bin/watch-browser.js (+12 -0)
📝 packages/desktop-client/package.json (+2 -2)
packages/desktop-electron/bin/update-client.js (+14 -0)
📝 packages/desktop-electron/package.json (+1 -1)
packages/loot-core/bin/build-browser.js (+40 -0)
packages/loot-core/bin/copy-migrations.js (+9 -0)
📝 packages/loot-core/package.json (+3 -3)
upcoming-release-notes/1175.md (+6 -0)
📝 yarn.lock (+20 -0)

📄 Description

Would like to hear peoples feedback on this.

  • We already use some js scripts, there is one for example that checks migrations
  • These should work on any platform and don't require the extra work on windows.
  • I still have a couple scripts to migrate

I tried to move as much common functionality into a few util classes in the top level. Things are a bit more verbose at times, because js isn't necessarily geared towards doing some of the things that bash is good at, and the linter wants things on multiple lines. I tried to keep the LOC count as low as possible at the front.

Other things however are much nicer, for example the previous command used to get the version from the package.json file is pretty scary looking (to me!)

VERSION=`cat "$ROOT/../../desktop-client/package.json" | grep version | head -n1 | awk -F "\"" '{print $4}' | tr -d '\r\n'`

I've tried to make the final build/watch scripts as 'user friendly' as possible so its hopefully clear what they're doing exactly.


🔄 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/1175 **Author:** [@Shazib](https://github.com/Shazib) **Created:** 6/23/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `replace-bash` --- ### 📝 Commits (10+) - [`30a1e4f`](https://github.com/actualbudget/actual/commit/30a1e4ff84bffce5f2fbb7452a2c7f29d96994fd) Replace bash scripts with javascript - [`842b452`](https://github.com/actualbudget/actual/commit/842b452caeeee423eedbee10e1576fd4516f2c36) Add release notes - [`0483c4c`](https://github.com/actualbudget/actual/commit/0483c4cb882f2b67d52894a0c3dbd9ecce62e640) Updates for building new 'api' package - [`d9e38e2`](https://github.com/actualbudget/actual/commit/d9e38e21db3e142ef4e5a0a849fb07104be24976) oops - [`35daee4`](https://github.com/actualbudget/actual/commit/35daee490226535cec6567a6b96d15b6fda432db) Merge branch 'master' into replace-bash - [`d9991c6`](https://github.com/actualbudget/actual/commit/d9991c69f7e39ae56c5b7254bc1e7157ff429892) Give remaining bash scripts line endings because they get missed by the .gitattributes eol=lf rule - [`da0b663`](https://github.com/actualbudget/actual/commit/da0b6635990a5f90637db8d22ab9d1251238f857) electron bash to js conversion - [`ca95006`](https://github.com/actualbudget/actual/commit/ca95006bd0e20a8a3d54f7c154b6abdab8b896fb) force commit this to update line endings?? - [`a4631e4`](https://github.com/actualbudget/actual/commit/a4631e4dd80f9e5d0d9e5511e2ea4ebb28254c36) Update to use file extensions - [`8fadde5`](https://github.com/actualbudget/actual/commit/8fadde5d808037deb6387491bfa4a053e22124a7) set line endings on tsx files ### 📊 Changes **17 files changed** (+294 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.eslintignore` (+2 -0) ➕ `packages/bin/build-defines.js` (+37 -0) ➕ `packages/bin/fs-util.js` (+27 -0) ➕ `packages/bin/index.js` (+28 -0) ➕ `packages/bin/migration-util.js` (+25 -0) ➕ `packages/bin/package.json` (+12 -0) ➕ `packages/bin/shell-util.js` (+36 -0) ➕ `packages/desktop-client/bin/build-browser.js` (+20 -0) ➕ `packages/desktop-client/bin/watch-browser.js` (+12 -0) 📝 `packages/desktop-client/package.json` (+2 -2) ➕ `packages/desktop-electron/bin/update-client.js` (+14 -0) 📝 `packages/desktop-electron/package.json` (+1 -1) ➕ `packages/loot-core/bin/build-browser.js` (+40 -0) ➕ `packages/loot-core/bin/copy-migrations.js` (+9 -0) 📝 `packages/loot-core/package.json` (+3 -3) ➕ `upcoming-release-notes/1175.md` (+6 -0) 📝 `yarn.lock` (+20 -0) </details> ### 📄 Description Would like to hear peoples feedback on this. - We already use some js scripts, there is one for example that checks migrations - These should work on any platform and don't require the extra work on windows. - I still have a couple scripts to migrate I tried to move as much common functionality into a few `util` classes in the top level. Things are a bit more verbose at times, because js isn't necessarily geared towards doing some of the things that bash is good at, and the linter wants things on multiple lines. I tried to keep the LOC count as low as possible at the front. Other things however are much nicer, for example the previous command used to get the version from the `package.json` file is pretty scary looking (to me!) ``` VERSION=`cat "$ROOT/../../desktop-client/package.json" | grep version | head -n1 | awk -F "\"" '{print $4}' | tr -d '\r\n'` ``` I've tried to make the final `build/watch` scripts as 'user friendly' as possible so its _hopefully_ clear what they're doing exactly. --- <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:43:32 -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#3567