Skip to content

Commit

Permalink
Merge branch 'master' into goalsStandardizeTime
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Jun 25, 2023
2 parents f305a90 + d48add5 commit 70cfcf4
Show file tree
Hide file tree
Showing 246 changed files with 1,915 additions and 6,117 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module.exports = {
],
'import/no-useless-path-segments': 'error',
'import/no-duplicates': ['error', { 'prefer-inline': true }],
'import/no-unused-modules': ['error', { 'unusedExports': true }],
'import/order': [
'error',
{
Expand Down Expand Up @@ -166,5 +167,33 @@ module.exports = {
],
},
},
{
files: ['./packages/loot-core/src/**/*'],
rules: {
// defining 'src' to check all packages is slow, so only do it for loot-core
'import/no-unused-modules': ['error', { 'unusedExports': true, 'src': ['../**/*.{js,ts,tsx}'] }],
}
},
{
files: [
'**/icons/**/*.js',
'**/mocks/**/*.{js,ts,tsx}',
'**/{mocks,__mocks__}/*.{js,ts,tsx}',
// can't correctly resolve usages
'**/*.{testing,electron,browser,web,api}.ts',
'packages/loot-core/src/server/main.ts'
],
rules: { 'import/no-unused-modules': 'off' }
},
],
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
}
};
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: File a bug report also known as an issue or problem.
title: '[Bug]: '
labels: ['bug', 'needs triage']
labels: ['bug']
body:
- type: markdown
id: intro-md
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature request
description: Request a missing feature
title: '[Feature] '
labels: ['feature', 'needs triage']
labels: ['feature']
body:
- type: markdown
id: intro-md
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ jobs:
name: actual-api
path: packages/api/actual-api.tgz

crdt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Build CRDT
run: cd packages/crdt && yarn build
- name: Create package tgz
run: cd packages/crdt && yarn pack && mv package.tgz actual-crdt.tgz
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: actual-crdt
path: packages/crdt/actual-crdt.tgz

web:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/issues-add-triage-label.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/issues-feature-implemented.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Handle completed feature requests
on:
pull_request:
types: [closed]

permissions:
issues: write

jobs:
handle-feature-requests:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!data/.gitkeep
/data2
packages/api/dist
packages/crdt/dist
packages/desktop-electron/client-build
packages/desktop-electron/.electron-symbols
packages/desktop-electron/dist
Expand Down
50 changes: 1 addition & 49 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,49 +1 @@
## Expectations

For smaller improvements or features - feel free to submit a PR or an issue if you don't have the necessary skills to build it yourself. For larger features we would recommend first opening an issue to discuss it with the team.

We aren't going to take every single little change. Don't be offended if we close your PR. In order for the project to stay healthy, we need to guard our bandwidth and also only take changes that align with Actual.

Here are some initial guidelines for how contributions will be treated:

- The mental health of the maintainers will be prioritized above all else. If this means some things get lost and PRs are unreviewed because maintainers are spending time with family or on themselves, we celebrate that.

- Multiple maintainers are key to this being a healthy project. Currently a few people have maintainer rights (see list below). We are actively looking for more people to come on as maintainers. If nobody steps up, expect less activity on this project.

- An open PR does not automatically deserve time for a full review and acceptance. It's up to the PR author to convince the maintainers that the change is good and worth reviewing. This involves a clear description for why the the change is being made, detailing the tradeoffs.

- We especially welcome improvements in automation: creating github actions to automatically generate builds, making the release process easier, etc.

## Main contributors

(sorted alphabetically)

- @albertogasparin
- @j-f1
- @jlongster
- @MatissJanis
- @rich-howell
- @trevdor

## Project ideas

We welcome all contributions from the community. If you have an idea for a feature you want to build - please go ahead and submit a PR with the implementation or if it's a larger feature - open a new issue so we can discuss it.

If you do not have ideas what to build: the issue list is always a good starting point. Look for issues labeled with "[help wanted](https://github.com/actualbudget/actual/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)".

For first time contributions you can also filter the issues labeled with "[good first issue](https://github.com/actualbudget/actual/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)".


## Development Environment
If you would like to contribute you can fork this repository and create a branch specific to the project you are working on.

There are three options for developing:
1. Yarn
- This is the traditional way to get an environment stood up. Run `yarn` to install the dependencies followed by `yarn start:browser` to start the development server. You will then be able to access Actual at `localhost:3001`.
2. Docker Compose
- If you prefer to work with docker containers, a `docker-compose.yml` file is included. Run `docker compose up -d` to start Actual. It will be accessible at `localhost:3001`.
3. Dev container
- Directly integrated in some IDEs, dependencies will be installed automatically as you enter the container.
- Use your preferred method to `npm start` the project, your IDE should expose the project on your `localhost` for you.

Both options above will dynamically update as you make changes to files. If you are making changes to the front end UI, you may have to reload the page to see any changes you make.
Please review the contributing documentation on our website: https://actualbudget.org/docs/contributing/
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Want to say thanks? Click the ⭐ at the top of the page.
## Key Links

- Actual [discord](https://discord.gg/pRYNYr4W5A) community.
- Actual [Community Documentation](https://actualbudget.github.io/docs)
- Actual [Community Documentation](https://actualbudget.org/docs)

## Installation

Expand All @@ -23,11 +23,11 @@ If you are only interested in running the latest version and not contributing to

The easiest way to get Actual running is to use the [actual-server](https://github.com/actualbudget/actual-server) project. That is the server for syncing changes across devices, and it comes with the latest version of Actual. The server will provide both the web project and a server for syncing.

You can get up and running quickly and easily by following our [Running Actual Locally Guide](https://actualbudget.github.io/docs/Installing/Local/your-own-machine)
You can get up and running quickly and easily by following our [Running Actual Locally Guide](https://actualbudget.org/docs/install/local)

## Documentation

We have a wide range of documentation on how to use Actual, this is all available in our [Community Documentation](https://actualbudget.github.io/docs), this includes topics on Budgeting, Account Management, Tips & Tricks and some documentation for developers.
We have a wide range of documentation on how to use Actual, this is all available in our [Community Documentation](https://actualbudget.org/docs), this includes topics on Budgeting, Account Management, Tips & Tricks and some documentation for developers.

## Code structure

Expand All @@ -37,9 +37,10 @@ The Actual app is split up into a few packages:
- desktop-client - The desktop UI
- desktop-electron - The desktop app

More information on the project structure is available in our [community documentation](https://actualbudget.github.io/docs/Developers/project-layout).
More information on the project structure is available in our [community documentation](https://actualbudget.org/docs/contributing/project-layout).

## Feature Requests

Current feature requests can be seen [here](https://github.com/actualbudget/actual/issues?q=is%3Aissue+label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc).
Vote for your favorite requests by reacting :+1: to the top comment of the request.

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"cross-env": "^7.0.3",
"eslint": "^8.37.0",
"eslint-config-react-app": "7.0.1",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-rulesdir": "^0.2.2",
"npm-run-all": "^4.1.3",
"patch-package": "^6.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
npm install @actual-app/api
```

View docs here: https://actualbudget.github.io/docs/Developers/using-the-API
View docs here: https://actualbudget.org/docs/api/
1 change: 1 addition & 0 deletions packages/crdt/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
1 change: 1 addition & 0 deletions packages/crdt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/main';
4 changes: 4 additions & 0 deletions packages/crdt/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
};
28 changes: 28 additions & 0 deletions packages/crdt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@actual-app/crdt",
"version": "1.0.0",
"license": "MIT",
"description": "CRDT layer of Actual",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"lint": "eslint .",
"build:node": "tsc --p tsconfig.dist.json",
"build": "rm -rf dist && yarn run build:node && cp src/proto/sync_pb.d.ts dist/src/proto/",
"test": "jest -c jest.config.js"
},
"dependencies": {
"google-protobuf": "^3.12.0-rc.1",
"murmurhash": "^0.0.2",
"uuid": "3.3.2"
},
"devDependencies": {
"@types/jest": "^27.5.0",
"jest": "^27.0.0",
"ts-jest": "^27.0.0",
"typescript": "^5.0.2"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import murmurhash from 'murmurhash';

import * as uuid from '../../platform/uuid';
import uuid from 'uuid';

/**
* Hybrid Unique Logical Clock (HULC) timestamp generator
Expand Down Expand Up @@ -65,7 +64,7 @@ export function deserializeClock(clock) {
}

export function makeClientId() {
return uuid.v4Sync().replace(/-/g, '').slice(-16);
return uuid.v4().replace(/-/g, '').slice(-16);
}

let config = {
Expand Down Expand Up @@ -282,7 +281,7 @@ Timestamp.recv = function (msg) {
* timestamp parsing
* converts a fixed-length string timestamp to the structured value
*/
Timestamp.parse = function (timestamp) {
Timestamp.parse = function (timestamp: string): Timestamp | null {
if (typeof timestamp === 'string') {
let parts = timestamp.split('-');
if (parts && parts.length === 5) {
Expand Down
13 changes: 13 additions & 0 deletions packages/crdt/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as SyncPb from './proto/sync_pb';
export {
merkle,
getClock,
setClock,
makeClock,
makeClientId,
serializeClock,
deserializeClock,
Timestamp,
} from './crdt';

export const SyncProtoBuf = SyncPb;
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/crdt/tsconfig.dist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
// Using ES2021 because that’s the newest version where
// the latest Node 16.x release supports all of the features
"target": "es2021",
"module": "CommonJS",
"noEmit": false,
"declaration": true,
"outDir": "dist"
},
"include": ["."],
"exclude": ["dist"]
}
2 changes: 2 additions & 0 deletions packages/desktop-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bundle.browser.js
build/
public/kcab/
**/node_modules/*
node_modules/
1 change: 1 addition & 0 deletions packages/desktop-client/e2e/onboarding.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ test.describe('Onboarding', () => {
await configurationPage.startFresh();

await navigation.clickOnNoServer();
await page.getByRole('button', { name: 'Start using a server' }).click();

await expect(configurationPage.heading).toHaveText('Where’s the server?');
});
Expand Down
8 changes: 0 additions & 8 deletions packages/desktop-client/e2e/page-models/account-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ export class AccountPage {
return new CloseAccountModal(this.page.locator('css=[aria-modal]'));
}

async _clearFocusedField() {
let isMac = process.platform === 'darwin';
await this.page.keyboard.press(isMac ? 'Meta+A' : 'Control+A');
await this.page.keyboard.press('Backspace');
}

async _fillTransactionFields(transactionRow, transaction) {
if (transaction.payee) {
await transactionRow.getByTestId('payee').click();
Expand All @@ -123,14 +117,12 @@ export class AccountPage {

if (transaction.debit) {
await transactionRow.getByTestId('debit').click();
await this._clearFocusedField();
await this.page.keyboard.type(transaction.debit);
await this.page.keyboard.press('Tab');
}

if (transaction.credit) {
await transactionRow.getByTestId('credit').click();
await this._clearFocusedField();
await this.page.keyboard.type(transaction.credit);
await this.page.keyboard.press('Tab');
}
Expand Down
7 changes: 6 additions & 1 deletion packages/desktop-client/e2e/page-models/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export class Navigation {

async createAccount(data) {
await this.page.getByRole('button', { name: 'Add account' }).click();
await this.page
.getByRole('button', { name: 'Create local account' })
.click();

// Fill the form
await this.page.getByLabel('Name:').fill(data.name);
Expand All @@ -66,7 +69,9 @@ export class Navigation {
await this.page.getByLabel('Off-budget').click();
}

await this.page.getByRole('button', { name: 'Create' }).click();
await this.page
.getByRole('button', { name: 'Create', exact: true })
.click();
return new AccountPage(this.page);
}

Expand Down
4 changes: 1 addition & 3 deletions packages/desktop-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"react-merge-refs": "^1.1.0",
"react-modal": "3.16.1",
"react-redux": "7.2.1",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-router-dom-v5-compat": "^6.4.1",
"react-router-dom": "6.11.2",
"react-scripts": "^5.0.1",
"react-spring": "^9.7.1",
"react-virtualized-auto-sizer": "^1.0.2",
Expand Down
Loading

0 comments on commit 70cfcf4

Please sign in to comment.