diff --git a/.github/workflows/build-release-binary.yml b/.github/workflows/build-release-binary.yml index d683c52..9a56e1e 100644 --- a/.github/workflows/build-release-binary.yml +++ b/.github/workflows/build-release-binary.yml @@ -83,23 +83,14 @@ jobs: cache: yarn cache-dependency-path: '**/yarn.lock' - - name: Build maker frontend - if: matrix.bin == 'maker' + - name: Build frontends shell: bash run: | - cd maker-frontend; - yarn - APP=maker yarn build - - # Overwrite taker frontend with our new fancy UI - - name: Build taker frontend - if: matrix.bin == 'taker' - shell: bash - run: | - cd taker-frontend; + cd ${{ matrix.bin }}-frontend; yarn yarn build + - name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary run: cargo build --target=${{ matrix.target }} --release --bin ${{ matrix.bin }} @@ -224,7 +215,3 @@ jobs: --tag ghcr.io/${{ github.repository }}/taker:${{ github.event.release.tag_name }} \ --build-arg BINARY_PATH=taker \ . - - - - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 876a227..cdbfe43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,8 +70,8 @@ jobs: cache: 'yarn' cache-dependency-path: maker-frontend/yarn.lock - run: yarn install - - run: APP=maker yarn test - - run: APP=maker yarn build + - run: yarn test + - run: yarn build build_and_test_taker_frontend: defaults: diff --git a/README.md b/README.md index e94895e..e27cd60 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ All the components can be started at once by running the following script: ./start_all.sh ``` -Note: Before first run, you need to run `cd frontend; yarn install` command to -ensure that all dependencies get installed. +Note: Before first run, you need to run `cd maker-frontend; yarn install; cd../taker-frontend; yarn install` command to ensure that all dependencies get +installed. The script combines the logs from all binaries inside a single terminal so it might not be ideal for all cases, but it is convenient for quick regression testing. @@ -46,24 +46,31 @@ Note: The sqlite databases for maker and taker are currently created in the proj ## Starting the maker and taker frontend -We use a single react project for hosting both the taker and the maker frontends. -However, the development environment still needs to be start twice! -Which frontend to start is configured via the `APP` environment variable. +We use a separate react projects for hosting taker and maker frontends. + +At the moment you will need a browser extension to allow CORS headers like `CORS Everywhere` ([Firefox Extension](https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/)) to use the frontends. + +### Taker ```bash -cd frontend +cd taker-frontend yarn install -APP=taker yarn dev -APP=maker yarn dev +yarn dev ``` -Bundling the web frontend and serving it from the respective daemon is yet to be configured. -At the moment you will need a browser extension to allow CORS headers like `CORS Everywhere` ([Firefox Extension](https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/)) to use the frontends. +### Maker + +```bash +cd maker-frontend +yarn install +yarn dev +``` ### Linting To run eslint, use: ```bash -cd frontend && yarn run eslint +cd maker-frontend && yarn run eslint +cd taker-frontend && yarn run eslint ``` diff --git a/maker-frontend/dynamicApp.ts b/maker-frontend/dynamicApp.ts deleted file mode 100644 index 1cc3313..0000000 --- a/maker-frontend/dynamicApp.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Plugin } from "vite"; - -export default function dynamicApp(app: string): Plugin { - return { - name: "dynamicApp", // required, will show up in warnings and errors - resolveId: (id) => { - // For some reason these are different? - const productionBuildId = "src/__app__.tsx"; - const devBuildId = "/src/__app__.tsx"; - - if (id === productionBuildId || id === devBuildId) { - return `${__dirname}/src/${app}.tsx`; - } - - return null; - }, - }; -} diff --git a/maker-frontend/index.html b/maker-frontend/index.html index 3066105..a89d7ce 100644 --- a/maker-frontend/index.html +++ b/maker-frontend/index.html @@ -7,7 +7,6 @@
- +