Skip to content

Commit

Permalink
update(commands): updated desktop building commands
Browse files Browse the repository at this point in the history
  • Loading branch information
GervinFung committed Mar 25, 2024
1 parent 273a701 commit 0419a03
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 33 deletions.
54 changes: 26 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,37 @@ For Mac and Linux, make is available, but for Windows, you can install make with

Environment Variables

1. Development and Testing
`apps/web/config/.env.production` does not exists as it's not committed, so any `make` commands related to production will not, including but are not limited to `make build-production`, `make copy-env-production`, `make build-executable-production`

Run the following command
Rest assured that you can still build an optimised & minimised version of this application without production configuration provided

`make copy-env-[development/testing]`

2. Make Commands
Make Commands

_*Below are the listed commands that you can use to build/develop/test this app*_

1. Web in `apps/web`

| Command | Usage |
| ------------------------------------------------- | ------------------------------------------------- |
| make start | Start the bundled app |
| make generate | Generate the file needed |
| make start-(development OR testing OR production) | Start development |
| make build-(development OR testing OR production) | Bundle and build the app |
| make deploy-production | Bundle, build and deploy the app |
| make install | Install all dependencies |
| make test | Run all test code |
| make typecheck | Run typechecking for source code |
| make lint | Run linter for source and test code |
| make format-check | Run prettier to check source and test code format |
| make format-write | Run prettier to format source and test code |

2. Desktop in `apps/desktop`

| Command | Usage |
| -------------------------------------- | ------------------------------------------------- |
| make build-(development OR production) | Bundle and build the app |
| make format-check | Run prettier to check source and test code format |
| make format-write | Run prettier to format source and test code |
2. Web in `apps/web`

| Command | Usage |
| ---------------------------------------------------- | ------------------------------------------------- |
| make start | Start the bundled app |
| make generate | Generate the file needed |
| make start-(development OR testing OR production) | Start development |
| make build-(development OR testing OR production) | Bundle and build the app |
| make copy-env-(development OR testing OR production) | Copy environment variables to `.env` |
| make install | Install all dependencies |
| make test | Run all test code |
| make typecheck | Run typechecking for source code |
| make lint | Run linter for source and test code |
| make format-check | Run prettier to check source and test code format |
| make format-write | Run prettier to format source and test code |

3. Desktop in `apps/desktop`

| Command | Usage |
| --------------------- | ------------------------------------------------- |
| make build-production | Bundle and build the app |
| make format-check | Run prettier to check source and test code format |
| make format-write | Run prettier to format source and test code |

_*You can run the app without setting up the app for demo purpose, the execution (windows/mac/linux) is in `apps/desktop/src-tauri/target/release/periotable(.exe?)`*_

Expand Down
14 changes: 11 additions & 3 deletions apps/desktop/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
.PHONY: build test
MAKEFLAGS += --silent

# build
build-production:
pnpm tauri build

# build
build-desktop:
build-development: build-executable-development

build-executable:
rm -rf build &&\
cd ../web &&\
make build-desktop &&\
make build-$(environment) &&\
mv desktop ../desktop/build

build-executable-development:
make build-executable environment=development

build-executable-production:
make build-executable environment=production

# format
format:
pnpm prettier --$(type) .
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"beforeBuildCommand": "make build-desktop",
"beforeBuildCommand": "make build-executable-production",
"distDir": "../build"
},
"package": {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ build-production: clear-cache copy-env-production generate-web-stuffs build gene

build-testing: clear-cache copy-env-testing generate-web-stuffs build

build-desktop: clear-cache copy-env-production generate-desktop-stuffs build
build-development-desktop: clear-cache copy-env-development generate-desktop-stuffs build

build-production-desktop: clear-cache copy-env-production generate-desktop-stuffs build

build:
pnpm next build
Expand Down

0 comments on commit 0419a03

Please sign in to comment.