Skip to content

Commit

Permalink
Merge branch 'master' into darkThemeReports
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom authored Sep 8, 2023
2 parents 3ea75dd + a8a0f77 commit 451a868
Show file tree
Hide file tree
Showing 304 changed files with 6,726 additions and 5,692 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,22 @@ module.exports = {
'./packages/desktop-client/src/components/UpdateNotification.*',
'./packages/desktop-client/src/components/accounts/Header.*',
'./packages/desktop-client/src/components/alerts.*',
'./packages/desktop-client/src/components/budget/BudgetCategories.*',
'./packages/desktop-client/src/components/budget/BudgetTotals.*',
'./packages/desktop-client/src/components/budget/ExpenseGroup.*',
'./packages/desktop-client/src/components/budget/IncomeGroup.*',
'./packages/desktop-client/src/components/budget/MobileBudget.*',
'./packages/desktop-client/src/components/budget/MobileBudgetTable.*',
'./packages/desktop-client/src/components/budget/MobileTable.*',
'./packages/desktop-client/src/components/budget/MonthCountSelector.*',
'./packages/desktop-client/src/components/budget/MonthPicker.*',
'./packages/desktop-client/src/components/budget/RenderMonths.*',
'./packages/desktop-client/src/components/budget/SidebarCategory.*',
'./packages/desktop-client/src/components/budget/SidebarGroup.*',
'./packages/desktop-client/src/components/budget/constants.*',
'./packages/desktop-client/src/components/budget/misc.*',
'./packages/desktop-client/src/components/budget/report/BudgetSummary.*',
'./packages/desktop-client/src/components/budget/report/components.*',
'./packages/desktop-client/src/components/budget/rollover/BudgetSummary.*',
'./packages/desktop-client/src/components/budget/rollover/rollover-components.*',
'./packages/desktop-client/src/components/budget/util.*',
Expand Down
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Funding policies: https://actualbudget.org/docs/contributing/leadership/funding
open_collective: actual
30 changes: 18 additions & 12 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ concurrency:
cancel-in-progress: true

jobs:
functional:
name: Functional
netlify:
name: Wait for Netlify build to finish
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.37.0-jammy
outputs:
netlify_url: ${{ steps.netlify.outputs.url }}
steps:
- uses: actions/checkout@v3
- name: Set up environment
Expand All @@ -25,10 +25,21 @@ jobs:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/actions/netlify-wait-for-build

functional:
name: Functional
needs: netlify
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.37.0-jammy
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Run E2E Tests on Netlify URL
run: yarn e2e
env:
E2E_START_URL: ${{ steps.netlify.outputs.url }}
E2E_START_URL: ${{ needs.netlify.outputs.netlify_url }}
- uses: actions/upload-artifact@v3
if: always()
with:
Expand All @@ -37,23 +48,18 @@ jobs:
retention-days: 30
vrt:
name: Visual regression
needs: netlify
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.37.0-jammy
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Wait for Netlify build to finish
id: netlify
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/actions/netlify-wait-for-build
- name: Run VRT Tests on Netlify URL
run: yarn vrt
env:
E2E_START_URL: ${{ steps.netlify.outputs.url }}
E2E_START_URL: ${{ needs.netlify.outputs.netlify_url }}
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Close stale PRs'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-pr-message: 'This PR was closed because it has been stalled for 5 days with no activity.'
days-before-stale: 30
days-before-close: 5
days-before-issue-stale: -1
2 changes: 0 additions & 2 deletions bin/package-electron
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ if [ "$OSTYPE" == "msys" ]; then
fi
fi

yarn patch-package

yarn rebuild-electron

yarn workspace loot-core build:node
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"scripts": {
"start": "yarn start:browser",
"start:desktop": "npm-run-all --parallel 'start:desktop-*'",
"start:desktop": "yarn rebuild-electron && npm-run-all --parallel 'start:desktop-*'",
"start:desktop-node": "yarn workspace loot-core watch:node",
"start:desktop-client": "yarn workspace @actual-app/web watch",
"start:desktop-electron": "yarn workspace desktop-electron watch",
Expand All @@ -39,8 +39,7 @@
"lint": "eslint . --max-warnings 0",
"lint:verbose": "DEBUG=eslint:cli-engine eslint . --max-warnings 0",
"typecheck": "yarn tsc",
"jq": "./node_modules/node-jq/bin/jq",
"postinstall": "patch-package"
"jq": "./node_modules/node-jq/bin/jq"
},
"devDependencies": {
"cross-env": "^7.0.3",
Expand All @@ -53,7 +52,6 @@
"eslint-plugin-rulesdir": "^0.2.2",
"node-jq": "^4.0.1",
"npm-run-all": "^4.1.3",
"patch-package": "^6.1.2",
"prettier": "2.8.2",
"react-refresh": "^0.14.0",
"source-map-support": "^0.5.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "rm -rf dist && yarn run build:app && yarn run build:node && yarn run build:migrations && yarn run build:default-db"
},
"dependencies": {
"better-sqlite3": "^8.2.0",
"better-sqlite3": "^8.6.0",
"node-fetch": "^3.3.2",
"uuid": "^9.0.0"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/crdt/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
},
};
3 changes: 2 additions & 1 deletion packages/crdt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@swc/core": "^1.3.82",
"@swc/jest": "^0.2.29",
"@types/jest": "^27.5.0",
"@types/uuid": "^9.0.2",
"jest": "^27.0.0",
"ts-jest": "^27.0.0",
"ts-protoc-gen": "^0.15.0",
"typescript": "^5.0.2"
}
Expand Down
16 changes: 16 additions & 0 deletions packages/desktop-client/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"jsc": {
"target": "es2022",
"transform": {
"react": {
"runtime": "automatic"
}
},
"externalHelpers": true,
"parser": {
"syntax": "typescript",
"tsx": true
}
},
"sourceMaps": true
}
77 changes: 0 additions & 77 deletions packages/desktop-client/config-overrides.js

This file was deleted.

116 changes: 116 additions & 0 deletions packages/desktop-client/craco.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
const path = require('path');

const {
loaderByName,
removeLoaders,
addAfterLoader,
addPlugins,
} = require('@craco/craco');
const chokidar = require('chokidar');
const TerserPlugin = require('terser-webpack-plugin');
const { IgnorePlugin } = require('webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

if (process.env.CI) {
process.env.DISABLE_ESLINT_PLUGIN = 'true';
}

// Forward Netlify env variables
if (process.env.REVIEW_ID) {
process.env.REACT_APP_REVIEW_ID = process.env.REVIEW_ID;
}

module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
webpackConfig.mode =
process.env.NODE_ENV === 'development' ? 'development' : 'production';

// swc-loader
addAfterLoader(webpackConfig, loaderByName('babel-loader'), {
test: /\.m?[tj]sx?$/,
exclude: /node_modules/,
loader: require.resolve('swc-loader'),
});

// remove the babel loaders
removeLoaders(webpackConfig, loaderByName('babel-loader'));

addPlugins(webpackConfig, [
new BundleAnalyzerPlugin({
analyzerMode: 'disabled',
generateStatsFile: true,
}),
// Pikaday throws a warning if Moment.js is not installed however it doesn't
// actually require it to be installed. As we don't use Moment.js ourselves
// then we can just silence this warning.
new IgnorePlugin({
contextRegExp: /pikaday$/,
resourceRegExp: /moment$/,
}),
]);

webpackConfig.resolve.extensions = [
'.web.js',
'.web.jsx',
'.web.ts',
'.web.tsx',
'.js',
'.jsx',
'.ts',
'.tsx',
...webpackConfig.resolve.extensions,
];

if (process.env.IS_GENERIC_BROWSER) {
webpackConfig.resolve.extensions = [
'.browser.js',
'.browser.jsx',
'.browser.ts',
'.browser.tsx',
...webpackConfig.resolve.extensions,
];
}

webpackConfig.optimization = {
...webpackConfig.optimization,
minimize:
process.env.CI === 'true' || process.env.NODE_ENV !== 'development',
minimizer: [
new TerserPlugin({
minify: TerserPlugin.swcMinify,
// `terserOptions` options will be passed to `swc` (`@swc/core`)
// Link to options - https://swc.rs/docs/config-js-minify
terserOptions: {
compress: false,
mangle: true,
},
}),
],
};

return webpackConfig;
},
},
devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
devServerConfig.onBeforeSetupMiddleware = server => {
chokidar
.watch([
path.resolve('../loot-core/lib-dist/*.js'),
path.resolve('../loot-core/lib-dist/browser/*.js'),
])
.on('all', function () {
for (const ws of server.webSocketServer.clients) {
ws.send(JSON.stringify({ type: 'static-changed' }));
}
});
};
devServerConfig.headers = {
...devServerConfig.headers,
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
};

return devServerConfig;
},
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 451a868

Please sign in to comment.