-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): update and document packages scripts
- Loading branch information
Showing
20 changed files
with
580 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Frontend Development Setup | ||
|
||
The Mintter Frontend architecture is based on a [pnpm](https://pnpm.io) workspace. Currently we have this packages: | ||
|
||
1. App Package: for the desktop app code lives | ||
2. Gateway: for the gateway code | ||
3. Shared: for the shared API-related code | ||
4. UI (soon): for all the design system/common UI building blocks for all the Mintter applications | ||
|
||
After you [setup the project](./dev-setup.md) on your local machine, you should have `pnpm` available, so no need to install it globally. | ||
|
||
## Prerequisites | ||
|
||
Please make sure that after you enter the repo root path, you see something similar to this showing the necessary Environment variables set: | ||
|
||
![dev-setup-root-terminal.png](./assets/dev-setup-root-terminal.png) | ||
|
||
After this is correct, you should run `pnpm install` (or `pnpm i`) to install all the frontend packages. | ||
|
||
## Run the Desktop app locally | ||
|
||
because we are using [Nix](./nix.md), we are able to create custom orchestrated commands in order to setup everything properly for any situation. To run the desktop app locally, you just need to run: | ||
|
||
```bash | ||
./dev run-desktop | ||
``` | ||
|
||
This command should trigger a set of processes that eventually should launch the app in dev mode | ||
|
||
![Locally running the Desktop app](./assets/dev-setup-local-run.png) | ||
|
||
> you can also run `./dev` to print the stript's readme and see all the possible commands/options. You can checkout all the commands [here](../dev) | ||
Keep in mind that `./dev run-desktop` runs both the desktop app **and the go backend**. This is setup this way for convenience and ease of use. You are able to run _just_ the desktop frontend code by running: | ||
|
||
```bash | ||
./dev run-frontend | ||
``` | ||
|
||
> You can also run _just_ the backend with `./dev run-backend` | ||
## Run the Gateway app locally | ||
|
||
The same way we can run the desktop app with a `./dev` command, you have access to gateway-specific commands: | ||
|
||
```bash | ||
./dev run-gw-frontend # run the gateway frontend _only_ (dev mode) | ||
./dev run-gw-bacend # run the gateway backend _only_ (dev mode) | ||
``` | ||
|
||
## Shared package | ||
|
||
The frontend shared package is wrapping all the API/Backend related code that is shared between both the desktop app and the web gateway. You don't have to manually run any command for this, but you can check the specific commands defined for this package in the [root `package.json`](../package.json). | ||
|
||
## Per-package scripts overview | ||
|
||
For every frontend package, there's a set of required scripts in order to keep consistency inside all the project: | ||
|
||
1. `dev`: run the current package in dev mode. | ||
2. `build`: build the current package. | ||
3. `test`: run all the possible tests inside the current package. | ||
4. `lint`: run all the possible linters inside the current package. | ||
5. `format`: format the code for the current package. | ||
6. `validate`: lint + test the current package. | ||
|
||
> if you are creating a new frontend package, please make sure you create this scripts properly and connect them with the appropiate `./dev` script. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.next | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
// This file was automatically generated. Edits will be overwritten | ||
|
||
// This file was automatically generated. Edits will be overwritten | ||
|
||
export interface Typegen0 { | ||
'@@xstate/typegen': true; | ||
internalEvents: { | ||
"done.invoke.resizeObserver": { type: "done.invoke.resizeObserver"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; | ||
"error.platform.resizeObserver": { type: "error.platform.resizeObserver"; data: unknown }; | ||
"xstate.init": { type: "xstate.init" }; | ||
}; | ||
invokeSrcNameMap: { | ||
"resizeObserver": "done.invoke.resizeObserver"; | ||
}; | ||
missingImplementations: { | ||
actions: never; | ||
delays: never; | ||
guards: never; | ||
services: never; | ||
}; | ||
eventsCausingActions: { | ||
"removeTabIndexToElements": "MENU.DISABLE" | "MENU.OPEN" | "MENU.TOGGLE"; | ||
"setElementRef": "MENU.INIT"; | ||
"setFocusableElements": "MENU.INIT"; | ||
"setObserver": "MENU.OBSERVER.READY"; | ||
"setTabIndexToElements": "MENU.CLOSE" | "MENU.ENABLE" | "MENU.TOGGLE"; | ||
"startObserver": "MENU.INIT"; | ||
}; | ||
eventsCausingDelays: { | ||
|
||
}; | ||
eventsCausingGuards: { | ||
|
||
}; | ||
eventsCausingServices: { | ||
"resizeObserver": "xstate.init"; | ||
}; | ||
matchesStates: "disabled" | "enabled" | "enabled.closed" | "enabled.opened" | "idle" | { "enabled"?: "closed" | "opened"; }; | ||
tags: never; | ||
} | ||
|
||
export interface Typegen0 { | ||
'@@xstate/typegen': true | ||
internalEvents: { | ||
'done.invoke.resizeObserver': { | ||
type: 'done.invoke.resizeObserver' | ||
data: unknown | ||
__tip: 'See the XState TS docs to learn how to strongly type this.' | ||
} | ||
'error.platform.resizeObserver': { | ||
type: 'error.platform.resizeObserver' | ||
data: unknown | ||
} | ||
'xstate.init': {type: 'xstate.init'} | ||
} | ||
invokeSrcNameMap: { | ||
resizeObserver: 'done.invoke.resizeObserver' | ||
} | ||
missingImplementations: { | ||
actions: never | ||
delays: never | ||
guards: never | ||
services: never | ||
} | ||
eventsCausingActions: { | ||
removeTabIndexToElements: 'MENU.DISABLE' | 'MENU.OPEN' | 'MENU.TOGGLE' | ||
setElementRef: 'MENU.INIT' | ||
setFocusableElements: 'MENU.INIT' | ||
setObserver: 'MENU.OBSERVER.READY' | ||
setTabIndexToElements: 'MENU.CLOSE' | 'MENU.ENABLE' | 'MENU.TOGGLE' | ||
startObserver: 'MENU.INIT' | ||
} | ||
eventsCausingDelays: {} | ||
eventsCausingGuards: {} | ||
eventsCausingServices: { | ||
resizeObserver: 'xstate.init' | ||
} | ||
matchesStates: | ||
| 'disabled' | ||
| 'enabled' | ||
| 'enabled.closed' | ||
| 'enabled.opened' | ||
| 'idle' | ||
| {enabled?: 'closed' | 'opened'} | ||
tags: never | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,37 @@ | ||
// This file was automatically generated. Edits will be overwritten | ||
|
||
// This file was automatically generated. Edits will be overwritten | ||
|
||
export interface Typegen0 { | ||
'@@xstate/typegen': true; | ||
internalEvents: { | ||
"done.invoke.transformPublication": { type: "done.invoke.transformPublication"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." }; | ||
"error.platform.transformPublication": { type: "error.platform.transformPublication"; data: unknown }; | ||
"xstate.init": { type: "xstate.init" }; | ||
}; | ||
invokeSrcNameMap: { | ||
"transformPublication": "done.invoke.transformPublication"; | ||
}; | ||
missingImplementations: { | ||
actions: never; | ||
delays: never; | ||
guards: never; | ||
services: never; | ||
}; | ||
eventsCausingActions: { | ||
"setEditorValue": "PUBLICATION.TRANSFORM.SUCCESS"; | ||
"setPublication": "PUBLICATION.FETCH.SUCCESS"; | ||
}; | ||
eventsCausingDelays: { | ||
}; | ||
eventsCausingGuards: { | ||
}; | ||
eventsCausingServices: { | ||
"transformPublication": "PUBLICATION.FETCH.SUCCESS"; | ||
}; | ||
matchesStates: "fetching" | "idle" | "settled" | "transforming"; | ||
tags: never; | ||
} | ||
export interface Typegen0 { | ||
'@@xstate/typegen': true | ||
internalEvents: { | ||
'done.invoke.transformPublication': { | ||
type: 'done.invoke.transformPublication' | ||
data: unknown | ||
__tip: 'See the XState TS docs to learn how to strongly type this.' | ||
} | ||
'error.platform.transformPublication': { | ||
type: 'error.platform.transformPublication' | ||
data: unknown | ||
} | ||
'xstate.init': {type: 'xstate.init'} | ||
} | ||
invokeSrcNameMap: { | ||
transformPublication: 'done.invoke.transformPublication' | ||
} | ||
missingImplementations: { | ||
actions: never | ||
delays: never | ||
guards: never | ||
services: never | ||
} | ||
eventsCausingActions: { | ||
setEditorValue: 'PUBLICATION.TRANSFORM.SUCCESS' | ||
setPublication: 'PUBLICATION.FETCH.SUCCESS' | ||
} | ||
eventsCausingDelays: {} | ||
eventsCausingGuards: {} | ||
eventsCausingServices: { | ||
transformPublication: 'PUBLICATION.FETCH.SUCCESS' | ||
} | ||
matchesStates: 'fetching' | 'idle' | 'settled' | 'transforming' | ||
tags: never | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.