Skip to content

Commit 8036c20

Browse files
Merge pull request #1352 from trilitech/migrate-to-monorepo
Migrate to monorepo
2 parents 3ea7122 + d0a123d commit 8036c20

File tree

719 files changed

+1134
-2452
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

719 files changed

+1134
-2452
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@umami/eslint-config/index.js"],
4+
parserOptions: {
5+
project: ["./apps/*/tsconfig.json", "./packages/*/tsconfig.json"],
6+
parser: "@typescript-eslint/parser",
7+
tsconfigRootDir: __dirname,
8+
},
9+
};

.github/workflows/build.yaml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/e2e.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,24 @@ jobs:
2727
node-version: 20.x
2828
cache: "yarn"
2929

30-
- name: Install dependencies
31-
run: yarn install --immutable
30+
- run: yarn install --immutable
3231

33-
- name: Install Playwright Browsers & build the app
34-
run: yarn exec concurrently "yarn playwright install chromium --with-deps" "yarn build"
32+
- name: Install Playwright browser
33+
run: yarn workspace @umami/desktop playwright install chromium --with-deps
3534

36-
- name: Start server
37-
run: yarn exec http-server build -p 3000 &
38-
39-
- name: Run cucumber tests
40-
run: yarn test:e2e
35+
- run: yarn test:e2e
4136

4237
- name: Cucumber Report to Annotations
4338
uses: deblockt/cucumber-report-annotations-action@v1.16
4439
if: always()
4540
with:
4641
access-token: ${{ secrets.GITHUB_TOKEN }}
47-
path: "test-results/cucumber-report.json"
42+
path: "apps/dekstop/test-results/cucumber-report.json"
4843
show-global-summary-report: true
4944

5045
- uses: actions/upload-artifact@v4
5146
if: always()
5247
with:
5348
name: cucumber-report
54-
path: test-results/cucumber-report.html
49+
path: apps/dekstop/test-results/cucumber-report.html
5550
retention-days: 10

.github/workflows/test.yaml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313

1414
jobs:
1515
test:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-latest-m
1717
env:
1818
NODE_OPTIONS: "--max_old_space_size=4096"
1919
steps:
@@ -32,30 +32,8 @@ jobs:
3232
node-version: 20.x
3333
cache: "yarn"
3434

35-
- name: Install packages
36-
run: yarn install --immutable
35+
- run: yarn install --immutable
3736

38-
- name: Check format
39-
run: yarn format:ci
37+
- run: yarn ci
4038

41-
- name: Run linter
42-
run: yarn lint:ci
43-
44-
- name: Typecheck
45-
run: yarn tsc
46-
47-
- name: Circular dependencies check
48-
run: npx madge --circular src/index.tsx
49-
50-
- name: Run tests
51-
uses: ArtiomTr/jest-coverage-report-action@v2.3.0
52-
with:
53-
skip-step: install
54-
test-script: yarn test
55-
annotations: coverage
56-
base-coverage-file: report.json
57-
prnumber: ${{ steps.findPr.outputs.number }}
58-
59-
- name: Audit dependencies
60-
# Exclude @toruslabs/customauth from audit until it's upgraded
61-
run: yarn npm audit --exclude @toruslabs/customauth
39+
- run: yarn test

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
/node_modules
5-
/.pnp
4+
node_modules/
5+
.pnp/
66
.pnp.*
77
.yarn/*
88
!.yarn/patches
@@ -12,11 +12,11 @@
1212
!.yarn/versions
1313

1414
# testing
15-
/coverage
15+
coverage/
1616

1717
# production
18-
/build
19-
/dist
18+
build/
19+
dist/
2020

2121
# misc
2222
.DS_Store
@@ -33,7 +33,9 @@ yarn-error.log*
3333
.vscode
3434

3535
settings.json
36-
/test-results/
36+
test-results/
3737

3838
*.tsbuildinfo
39-
/docs
39+
docs/
40+
41+
.turbo/

README.md

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,17 @@ Blockchain](https://tezos.com/). It runs as a desktop electron-based app with mu
1515
- Delegation to bakers
1616
- Address Book
1717

18+
This is a monorepo which contains all the packages related to Umami.
19+
1820
## Initial setup
1921

2022
- Node.js version is 20.x, you can use [NVM](https://github.com/nvm-sh/nvm) to install it and select for this project.
2123
- Yarn 4.x should be used, you can find the installation guide [here](https://yarnpkg.com/getting-started/install).
22-
- `yarn install`
23-
- (optional) if you want to run all the necessary checks before pushing to github (which is much faster than waiting for CI) then just run `./bin/setup`
24-
25-
## Available Scripts
26-
27-
In the project directory, you can run:
28-
29-
### `yarn start`
30-
31-
Runs the app in the development mode.\
32-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
33-
34-
The page will reload if you make edits.\
35-
You will also see any lint errors in the console.
36-
37-
### `yarn test`
38-
39-
Launches the test runner in the interactive watch mode.\
40-
We use [jest](https://jestjs.io/) as the test runner.
41-
42-
### `yarn test:e2e`
43-
44-
This will run the e2e tests for you. Please make sure that you have docker & docker-compose [installed](https://docs.docker.com/desktop/install/mac-install/).
45-
46-
When you run it for the first time you'll have to install playwright's dependencies using
47-
48-
```bash
49-
yarn playwright install --with-deps chromium
50-
```
51-
52-
Note: the test runner expects the server with the app running at localhost:3000. You can use the dev server (`yarn start`) for that.
53-
On CI we build the app and serve the production build on the same port (check `.github/workflows/e2e.yaml` for details).
54-
55-
When you're working on a specific scenario, you can mark it with a `@focus` tag and use `yarn test:e2e:focus` to run it exclusively.
56-
57-
### `yarn build`
58-
59-
Builds the app for production to the `build` folder.\
60-
It correctly bundles React in production mode and optimizes the build for the best performance.
61-
62-
### `yarn electron:start`
63-
64-
Runs the electron app in the development mode.
65-
In order to get the dev tools work please make sure to set the `devTools` to `true` in the `webPreferences` in `public/electron.js`
66-
Note: you still have to have your `yarn start` running in a separate terminal
67-
68-
### `yarn electron:package:(mac|win|linux)`
69-
70-
Build electron app for desired platform (don't forget to run `yarn build` before running this one)
71-
72-
For the mac build you'd need signing credentials & the certificate. Alongside that you need to obtain an [Apple app specific password](https://support.apple.com/en-gb/102654). The app will be signed automatically during the packaging process.
73-
74-
For Windows you need the USB dongle with the certificate. You package the app using `yarn electron:package:win` and then run
75-
76-
```
77-
signtool sign /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a '.\dist\<installer>.exe'
78-
```
79-
80-
To make yourself a debugging build run `yarn electron:package:mac:debug`. It will work only on your machine, but you'll be able to play around with it. For the same purpose you might find helpful enabling devTools in `public/electron.js` before running `yarn build` and this command.
24+
- `yarn install` to install all the dependencies
25+
- `npm install turbo --global` to be able to use the [turborepo](https://turbo.build/repo/docs) tooling
26+
- `yarn playwright install --with-deps chromium` to be able to run e2e tests
8127

82-
### `yarn docs`
28+
## Dev workflow
8329

84-
It will generate documentation in HTML and put it into the `docs` folder. Open `docs/index.html`
30+
In most cases you'll use turborepo to build all the dependencies and run the app. All tasks are defined in the `turbo.json` file.
31+
Here's a [guide](https://turbo.build/repo/docs/crafting-your-repository/running-tasks) how to run tasks using turbo

apps/desktop/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
extends: ["@umami/eslint-config/index.js"],
3+
parserOptions: {
4+
// tsconfig.e2e.json includes both src and src/e2e
5+
project: "./tsconfig.e2e.json",
6+
parser: "@typescript-eslint/parser",
7+
tsconfigRootDir: __dirname,
8+
},
9+
};

apps/desktop/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Umami Desktop
2+
3+
Umami Desktop is an Electron-based wallet.
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `yarn dev`
10+
11+
Runs the app in the development mode.\
12+
Open [http://127.0.0.1:3000](http://127.0.0.1:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.\
15+
You will also see any lint errors in the console.
16+
17+
### `yarn test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
We use [jest](https://jestjs.io/) as the test runner.
21+
22+
### `yarn test:e2e`
23+
24+
This will run the e2e tests for you. Please make sure that you have docker & docker-compose [installed](https://docs.docker.com/desktop/install/mac-install/).
25+
26+
Note: the test runner expects the server with the app running at localhost:3000. You can use the dev server (`yarn dev`) for that.
27+
On CI we build the app and serve the production build on the same port (check `.github/workflows/e2e.yaml` for details).
28+
29+
When you're working on a specific scenario, you can mark it with a `@focus` tag and use `yarn test:e2e:focus` to run it exclusively.
30+
31+
### `yarn build`
32+
33+
Builds the app for production to the `build` folder.\
34+
It correctly bundles React in production mode and optimizes the build for the best performance.
35+
36+
### `yarn electron:start`
37+
38+
Runs the electron app in the development mode.
39+
In order to get the dev tools work please make sure to set the `devTools` to `true` in the `webPreferences` in `public/electron.js`
40+
Note: you still have to have your `yarn dev` running in a separate terminal
41+
42+
### `yarn electron:package:(mac|win|linux)`
43+
44+
Build electron app for desired platform (don't forget to run `yarn build` before running this one)
45+
46+
For the mac build you'd need signing credentials & the certificate. Alongside that you need to obtain an [Apple app specific password](https://support.apple.com/en-gb/102654). The app will be signed automatically during the packaging process.
47+
48+
For Windows you need the USB dongle with the certificate. You package the app using `yarn electron:package:win` and then run
49+
50+
```
51+
signtool sign /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a '.\dist\<installer>.exe'
52+
```
53+
54+
To make yourself a debugging build run `yarn electron:package:mac:debug`. It will work only on your machine, but you'll be able to play around with it. For the same purpose you might find helpful enabling devTools in `public/electron.js` before running `yarn build` and this command.
55+
56+
### `yarn docs`
57+
58+
It will generate documentation in HTML and put it into the `docs` folder. Open `docs/index.html`

0 commit comments

Comments
 (0)