A local-first personal finance app
:fire: remove beta code and some unused scripts (#1189)
Matiss Janis Aboltinsdacaef6fa48b
diff --git a/bin/format-staged b/bin/format-stageddeleted file mode 100755index d9856e68ce..0000000000--- a/bin/format-staged+++ /dev/null@@ -1,11 +0,0 @@-#!/bin/sh-FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.js" "*.jsx" | sed 's| |\\ |g')-[ -z "$FILES" ] && exit 0--# Prettify all selected files-echo "$FILES" | xargs ./node_modules/.bin/prettier --write--# Add back the modified/prettified files to staging-echo "$FILES" | xargs git add--exit 0\ No newline at end of filediff --git a/bin/import-open-source-package b/bin/import-open-source-packagedeleted file mode 100755index dfafd9e699..0000000000--- a/bin/import-open-source-package+++ /dev/null@@ -1,27 +0,0 @@-#!/bin/sh -e--ROOT=$(cd "`dirname $0`"; pwd)-NPM_NAME="$1"-NAME="$2"-PACKAGE_DIR="`dirname "$ROOT"`/packages/$NAME"--if [ -z "$NAME" ] || [ -z "$NPM_NAME" ]; then- echo "Usage: `basename $0` <npm-name> <local-name>"- exit 1-fi--if [ -d "$PACKAGE_DIR" ]; then- read -p "Package exists, remove $PACKAGE_DIR? [y/N] " -r- if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then- exit 2- fi-fi--rm -rf "$PACKAGE_DIR"-URL="`npm view "$NPM_NAME" dist.tarball`"-TMPDIR="`mktemp -d`"--cd "$TMPDIR"-wget -O tar.tgz "$URL"-tar xvzf tar.tgz-mv package "$PACKAGE_DIR"diff --git a/bin/make-release b/bin/make-releasedeleted file mode 100755index db4b5de279..0000000000--- a/bin/make-release+++ /dev/null@@ -1,50 +0,0 @@-#!/bin/bash -e--VERSION=""--POSITIONAL=()-while [[ $# -gt 0 ]]; do- key="$1"-- case $key in- --version)- VERSION="$2"- shift- shift- ;;- *)- POSITIONAL+=("$1")- shift- ;;- esac-done-set -- "${POSITIONAL[@]}"--NOTES="$@"--if [ -z "$VERSION" ]; then- echo "--version is required";- exit 1-fi--echo "Version: $VERSION"-echo "Notes: $NOTES"-read -p "Make release? [y/N] " -r-if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then- exit 2-fi--source ./.secret-tokens--# Tag and push to make windows and linux versions-git push origin master-git tag -a "$VERSION" -m "$NOTES"-git push origin "$VERSION"--# Make a macOS version-./bin/package-electron --release --version "$VERSION"--# TODO: browser version--# Finally, update github issues-curl -X POST -H "x-release-token: $RELEASE_TOKEN" https://actual-automoto.fly.dev/release/"$VERSION"diff --git a/bin/package-browser b/bin/package-browserindex af7e6dfbc9..1585f64604 100755--- a/bin/package-browser+++ b/bin/package-browser@@ -1,63 +1,10 @@#!/bin/bash -eROOT=`dirname $0`-VERSION=""-RELEASE=""-CI=${CI:-false}cd "$ROOT/.."-POSITIONAL=()-while [[ $# -gt 0 ]]; do- key="$1"-- case $key in- --version)- VERSION="$2"- shift- shift- ;;- --beta)- RELEASE="beta"- shift- ;;- --release)- RELEASE="production"- shift- ;;- *)- POSITIONAL+=("$1")- shift- ;;- esac-done-set -- "${POSITIONAL[@]}"--if [ -z "$VERSION" ] && [ -n "$RELEASE" ]; then- echo "Version is required if making a release"- exit 1-fi--if [ -n "$RELEASE" ]; then- read -p "Deploy release for browser: $RELEASE v$VERSION? [y/N] " -r- if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then- exit 2- fi-- PACKAGE_VERSION=`node -p -e "require('./packages/desktop-electron/package.json').version"`- if [ "$VERSION" != "$PACKAGE_VERSION" ] && [ "$VERSION-next" != "$PACKAGE_VERSION" ]; then- echo "Version in desktop-electron/package.json does not match given version! ($PACKAGE_VERSION)"- exit 4- fi-fi--# There's no need to check linting in CI as it'll be done in a different step.-if [ $CI != true ]; then- yarn lint-fi--ACTUAL_RELEASE_TYPE=$RELEASE yarn workspace loot-core build:browser--REACT_APP_RELEASE_TYPE=$RELEASE yarn workspace @actual-app/web build:browser+yarn workspace loot-core build:browser+yarn workspace @actual-app/web build:browserecho "packages/desktop-client/build"diff --git a/bin/package-electron b/bin/package-electronindex 81509a1cf6..9e2e0d89d7 100755--- a/bin/package-electron+++ b/bin/package-electron@@ -2,10 +2,8 @@ROOT=`dirname $0`-VERSION=""-BETA=""RELEASE=""-RELEASE_NOTES=""+RELEASE_NOTES="" # TODO: figure out automation for release notes when we start publishing electron versionsCI=${CI:-false}cd "$ROOT/.."@@ -15,15 +13,6 @@ while [[ $# -gt 0 ]]; dokey="$1"case $key in- --version)- VERSION="$2"- shift- shift- ;;- --beta)- RELEASE="beta"- shift- ;;--release)RELEASE="production"shift@@ -36,34 +25,6 @@ while [[ $# -gt 0 ]]; dodoneset -- "${POSITIONAL[@]}"-if [ -z "$VERSION" ] && [ -n "$RELEASE" ]; then- echo "Version is required if making a release"- exit 1-fi--if [ -n "$RELEASE" ]; then- if [ -z "$CIRCLE_TAG" ]; then- read -p "Make release: $RELEASE v$VERSION? [y/N] " -r- if [ -z "$REPLY" ] || [ "$REPLY" != "y" ]; then- exit 2- fi- fi-- if [ "$RELEASE" == "production" ]; then- if [ -z "$CIRCLE_TAG" ]; then- RELEASE_NOTES=`git tag -l --format="%(contents:subject)" "$VERSION"`- else- RELEASE_NOTES=`git tag -l --format="%(contents:subject)" "$CIRCLE_TAG"`- fi- fi-- PACKAGE_VERSION=`node -p -e "require('./packages/desktop-electron/package.json').version"`- if [ "$VERSION" != "$PACKAGE_VERSION" ]; then- echo "Version in desktop-electron/package.json does not match given version! ($PACKAGE_VERSION)"- exit 4- fi-fi-if [ "$OSTYPE" == "msys" ]; thenif [ $CI != true ]; thenread -s -p "Windows certificate password: " -r CSC_KEY_PASSWORD@@ -96,11 +57,7 @@ yarn workspace desktop-electron update-clientfiyarn build --publish always -c.releaseInfo.releaseNotes="$RELEASE_NOTES" --arm64 --x64- echo "\nCreated release $VERSION with release notes \"$RELEASE_NOTES\""- elif [ "$RELEASE" == "beta" ]; then- yarn build --publish never --arm64 --x64-- echo "\nCreated beta release $VERSION"+ echo "\nCreated release with release notes \"$RELEASE_NOTES\""elseSKIP_NOTARIZATION=true yarn build --publish never --x64fidiff --git a/packages/desktop-client/src/browser-preload.browser.js b/packages/desktop-client/src/browser-preload.browser.jsindex c1c02b882d..1601925d0f 100644--- a/packages/desktop-client/src/browser-preload.browser.js+++ b/packages/desktop-client/src/browser-preload.browser.js@@ -39,7 +39,6 @@ global.Actual = {IS_DEV,ACTUAL_VERSION,IS_FAKE_WEB: true,- IS_BETA: process.env.REACT_APP_RELEASE_TYPE === 'beta',logToTerminal: (...args) => {console.log(...args);diff --git a/packages/loot-core/src/client/shared-listeners.ts b/packages/loot-core/src/client/shared-listeners.tsindex 9253433dc8..88566f1fe3 100644--- a/packages/loot-core/src/client/shared-listeners.ts+++ b/packages/loot-core/src/client/shared-listeners.ts@@ -242,7 +242,6 @@ export function listenForSyncEvent(actions, store) {message: `We couldn’t apply that change to the database. Please report this as a bug by [opening a Github issue](${githubIssueLink}).`,};break;- case 'beta-version':case 'network':// Show nothingbreak;diff --git a/packages/loot-core/src/platform/server/fs/index.web.ts b/packages/loot-core/src/platform/server/fs/index.web.tsindex c96e5821b9..d7685b82c7 100644--- a/packages/loot-core/src/platform/server/fs/index.web.ts+++ b/packages/loot-core/src/platform/server/fs/index.web.ts@@ -9,7 +9,6 @@ import join from './path-join';let FS = null;let BFS = null;-// let NO_PERSIST = process.env.IS_BETA === true;let NO_PERSIST = false;export const bundledDatabasePath = '/default-db.sqlite';diff --git a/packages/loot-core/src/server/cloud-storage.ts b/packages/loot-core/src/server/cloud-storage.tsindex 6a4f0aceda..f6829c1bc8 100644--- a/packages/loot-core/src/server/cloud-storage.ts+++ b/packages/loot-core/src/server/cloud-storage.ts@@ -67,10 +67,6 @@ export async function resetSyncState(newKeyState) {let { cloudFileId } = prefs.getPrefs();- if (process.env.IS_BETA) {- return { error: { reason: 'beta-version' } };- }-try {await post(getServer().SYNC_SERVER + '/reset-user-file', {token: userToken,@@ -223,11 +219,6 @@ export async function upload() {throw FileUploadError('unauthorized');}- // We never change the server from the beta version- if (process.env.IS_BETA) {- throw FileUploadError('beta-version');- }-let zipContent = await exportBuffer();if (zipContent == null) {return;diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.tsindex cb8069813d..c6553629f5 100644--- a/packages/loot-core/src/server/main.ts+++ b/packages/loot-core/src/server/main.ts@@ -1959,7 +1959,7 @@ handlers['close-budget'] = async function () {handlers['delete-budget'] = async function ({ id, cloudFileId }) {// If it's a cloud file, you can delete it from the server by// passing its cloud id- if (cloudFileId && !process.env.IS_BETA) {+ if (cloudFileId) {await cloudStorage.removeFile(cloudFileId).catch(err => {});}@@ -2235,7 +2235,7 @@ async function loadBudget(id) {// Ensure that syncing is enabledif (process.env.NODE_ENV !== 'test') {- if (process.env.IS_BETA || id === DEMO_BUDGET_ID) {+ if (id === DEMO_BUDGET_ID) {setSyncingMode('disabled');} else {if (getServer()) {@@ -2400,7 +2400,7 @@ export async function initApp(isDev, socketName) {});}- if (isDev || process.env.IS_BETA) {+ if (isDev) {global.$send = (name, args) => runHandler(app.handlers[name], args);global.$query = aqlQuery;global.$q = q;diff --git a/packages/loot-core/src/server/sync/index.ts b/packages/loot-core/src/server/sync/index.tsindex 4c017e14d6..e41ed60880 100644--- a/packages/loot-core/src/server/sync/index.ts+++ b/packages/loot-core/src/server/sync/index.ts@@ -594,11 +594,6 @@ export const fullSync = once(async function (): Promise<subtype: e.reason,meta: e.meta,});- } else if (e.reason === 'beta-version') {- app.events.emit('sync', {- type: 'error',- subtype: e.reason,- });} else {app.events.emit('sync', { type: 'error' });}diff --git a/packages/loot-core/src/shared/errors.ts b/packages/loot-core/src/shared/errors.tsindex 0fec6f4167..919c21002c 100644--- a/packages/loot-core/src/shared/errors.ts+++ b/packages/loot-core/src/shared/errors.ts@@ -16,8 +16,6 @@ export function getUploadError({ reason, meta }) {return 'Unable to encrypt your data because you are missing the key. Create the latest key in the next step.';case 'network':return 'Uploading the file failed. Check your network connection.';- case 'beta-version':- return 'You cannot perform this action in the beta version (resetting sync, deleting a file, etc).';default:return `An internal error occurred, sorry! Visit https://actualbudget.org/contact/ for support. (ref: ${reason})`;}diff --git a/packages/loot-core/webpack/webpack.browser.config.js b/packages/loot-core/webpack/webpack.browser.config.jsindex 4624fdcf1c..e11b057af1 100644--- a/packages/loot-core/webpack/webpack.browser.config.js+++ b/packages/loot-core/webpack/webpack.browser.config.js@@ -70,9 +70,6 @@ module.exports = {'process.env.IS_DEV': JSON.stringify(process.env.NODE_ENV === 'development',),- 'process.env.IS_BETA': JSON.stringify(- process.env.ACTUAL_RELEASE_TYPE === 'beta',- ),'process.env.PUBLIC_URL': JSON.stringify(process.env.PUBLIC_URL || '/'),'process.env.ACTUAL_DATA_DIR': JSON.stringify('/'),'process.env.ACTUAL_DOCUMENT_DIR': JSON.stringify('/documents'),diff --git a/upcoming-release-notes/1189.md b/upcoming-release-notes/1189.mdnew file mode 100644index 0000000000..e0e5bf4958--- /dev/null+++ b/upcoming-release-notes/1189.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [MatissJanis]+---++Remove unused scripts and `IS_BETA` env var