Skip to content

Commit

Permalink
Made separate build scripts for browser and electron, in line with st…
Browse files Browse the repository at this point in the history
…art.

Updated README.
  • Loading branch information
harmen-xb committed Nov 25, 2024
1 parent 4166f52 commit 6950da2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
# We set a timeout here as a fix for the timeout issues which sometimes occur when connecting the the npm repo.
run: |
yarn --skip-integrity-check --network-timeout 100000
yarn build:dev
yarn build:browser
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ For detailed instructions for a Windows machine, follow [this](./docs/Prerequisi

## Running the application

yarn start:electron
### Browser

_or:_
This will build and start CrossModel as a web application. When the web application is running you can open <http://localhost:3000> in your browser to use CrossModel.

yarn rebuild:electron
cd applications/electron-app
yarn start
yarn build:browser &&
yarn start:browser

### Electron (desktop application)

_or:_ launch `Launch CrossModel Electron` configuration from VS code.
This will build and start CrossModel as a native desktop application for the OS (Windows, Linux or MacOS) where the command is started.

yarn build:electron &&
yarn start:electron

## Example Workspace

Expand Down
13 changes: 11 additions & 2 deletions applications/electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"main": "scripts/electron-main.js",
"scripts": {
"bundle": "cross-env NODE_OPTIONS=--max-old-space-size=8192 && yarn rebuild && theia build --mode development && yarn download:plugins",
"build": "yarn -s rebuild && theia build --app-target=\"electron\" --mode development && yarn download:plugins",
"bundle": "cross-env NODE_OPTIONS=--max-old-space-size=8192 && yarn build",
"clean": "theia clean && rimraf lib src-gen",
"deploy": "rimraf dist && electron-builder -c.mac.identity=null --publish always",
"download:plugins": "theia download:plugins",
Expand Down Expand Up @@ -50,7 +51,15 @@
"@theia/preferences": "1.49.1",
"@theia/process": "1.49.1",
"@theia/terminal": "1.49.1",
"@theia/workspace": "1.49.1"
"@theia/workspace": "1.49.1",
"cpu-features": "*",
"drivelist": "*",
"find-git-repositories": "*",
"keytar": "*",
"native-keymap": "*",
"node-pty": "*",
"nsfw": "*",
"ssh2": "*"
},
"devDependencies": {
"@theia/cli": "1.49.1",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"scripts": {
"build": "lerna run build",
"build:dev": "yarn build:packages && yarn build:extensions && yarn symlink:browser && yarn theia:browser build",
"build:browser": "yarn build:packages && yarn build:extensions && yarn symlink:browser && yarn theia:browser build",
"build:electron": "yarn build:packages && yarn build:extensions && yarn symlink:electron && yarn theia:electron build",
"build:extensions": "lerna run --scope=\"crossmodel-lang\" build",
"build:packages": "lerna run --scope=\"@crossbreeze/*\" build",
"clean": "lerna run clean",
Expand All @@ -22,6 +23,7 @@
"start:electron": "yarn theia:electron start",
"start:verdaccio": "yarn verdaccio --config verdaccio-config.yaml",
"symlink:browser": "lerna run --scope=\"crossmodel-lang\" symlink:browser",
"symlink:electron": "lerna run --scope=\"crossmodel-lang\" symlink:electron",
"test": "rimraf unit-test-results && yarn run test:cjs && yarn run test:esm",
"test:cjs": "jest --config=configs/jest.config.js --passWithNoTests",
"test:esm": "yarn --cwd extensions/crossmodel-lang test",
Expand Down

0 comments on commit 6950da2

Please sign in to comment.