Skip to content

Commit 4b20a51

Browse files
authored
README: described the various scripts that are avaialble.
2 parents 72a56a1 + 6e5f316 commit 4b20a51

File tree

6 files changed

+63
-88
lines changed

6 files changed

+63
-88
lines changed

.github/workflows/cd.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ jobs:
1717
include:
1818
- name: Windows
1919
os: windows-latest
20-
script: win
2120
- name: Linux
2221
os: ubuntu-latest
23-
script: linux
2422
- name: macOS (Intel)
2523
os: macos-13
26-
script: mac
2724
- name: macOS (ARM)
2825
os: macos-latest
29-
script: mac
3026
steps:
3127
- name: Check out OpenCOR
3228
uses: actions/checkout@v4
@@ -36,10 +32,10 @@ jobs:
3632
node-version: 'lts/*'
3733
- name: Install Yarn
3834
run: npm install -g yarn
39-
- name: Build OpenCOR
35+
- name: Packages OpenCOR
4036
run: |
4137
yarn
42-
yarn build:${{ matrix.script }}
38+
yarn package
4339
- name: Remove blockmap files
4440
shell: bash
4541
run: find ./dist -name '*.blockmap' -delete

.github/workflows/ci.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,17 @@ jobs:
3434
node-version: 'lts/*'
3535
- name: Install Yarn
3636
run: npm install -g yarn
37-
- name: Yarn install
37+
- name: Install all of OpenCOR's dependencies
3838
run: yarn
39-
- name: Yarn format
40-
run: |
41-
yarn format
42-
git diff --quiet
43-
- name: Yarn lint
39+
- name: Check that OpenCOR's code and OpenCOR's Web app's code are properly formatted
40+
run: yarn format:check
41+
- name: Lint OpenCOR's code and OpenCOR's Web app's code
4442
run: yarn lint
45-
- name: Yarn build
46-
run: yarn build
47-
- name: Yarn build:win (Windows only)
48-
if: ${{ runner.os == 'Windows' }}
49-
run: yarn build:win
50-
- name: Yarn build:linux (Linux only)
51-
if: ${{ runner.os == 'Linux' }}
52-
run: yarn build:linux
53-
- name: Yarn build:mac (macOS only)
54-
if: ${{ runner.os == 'macOS' }}
55-
run: yarn build:mac
56-
- name: Yarn build:unpack
57-
run: yarn build:unpack
58-
- name: Yarn build:web
59-
run: yarn build:web
60-
- name: Yarn clean
43+
- name: Type check OpenCOR's code
44+
run: yarn typecheck
45+
- name: Type check OpenCOR's Web app's code
46+
run: yarn typecheck:web
47+
- name: Package OpenCOR
48+
run: yarn package
49+
- name: Clean OpenCOR's environment
6150
run: yarn clean

.prettierrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Schema: https://json.schemastore.org/prettierrc
22

3+
endOfLine: auto
34
printWidth: 120
45
semi: false
56
singleQuote: true

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
# OpenCOR
22

33
[OpenCOR](https://opencor.ws/) is a Web-based modelling environment, which can be used to organise, edit, simulate, and analyse [CellML](https://cellml.org/) files. It can be used both as a standalone application (on [Windows](https://en.wikipedia.org/wiki/Microsoft_Windows), [Linux](https://en.wikipedia.org/wiki/Linux), and [macOS](https://en.wikipedia.org/wiki/MacOS)) and on the Web.
4+
5+
## Prerequisites
6+
7+
To build OpenCOR, you need to install [node.js](https://nodejs.org/) and [npm](https://npmjs.com/), which you can do from [here](https://nodejs.org/en/download/package-manager). Then, you need to install [yarn](https://yarnpkg.com/), which you can do by running:
8+
9+
```bash
10+
npm install -g yarn
11+
```
12+
13+
## Scripts
14+
15+
Before doing anything, you need to install all of OpenCOR's dependencies:
16+
17+
```bash
18+
yarn
19+
```
20+
21+
Then, you can run a given script:
22+
23+
```bash
24+
yarn <script>
25+
```
26+
27+
where `<script>` is one of the following:
28+
29+
- `clean`: clean OpenCOR's environment;
30+
- `dev`: start OpenCOR and OpenCOR's Web app in development mode;
31+
- `dev:web`: start OpenCOR's Web app in development mode;
32+
- `format`: format OpenCOR's code and OpenCOR's Web app's code;
33+
- `format:check`: check that OpenCOR's code and OpenCOR's Web app's code are properly formatted;
34+
- `lint`: lint OpenCOR's code and OpenCOR's Web app's code;
35+
- `package`: (build and) package OpenCOR for the current platform;
36+
- `package:linux`: (build and) package OpenCOR for Linux;
37+
- `package:mac`: (build and) package OpenCOR for macOS;
38+
- `package:win`: (build and) package OpenCOR for Windows;
39+
- `publish:web`: publish OpenCOR's Web app on [npm](https://npmjs.com/);
40+
- `start`: start OpenCOR in production mode;
41+
- `start:web`: start OpenCOR's Web app in production mode;
42+
- `typecheck`: type check OpenCOR's code; and
43+
- `typecheck:web`: type check OpenCOR's Web app's code.

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,21 @@
2020
"type": "module",
2121
"version": "0.0.0",
2222
"scripts": {
23-
"build": "npm run typecheck && electron-vite build",
24-
"build:linux": "npm run build && electron-builder --linux",
25-
"build:mac": "npm run build && electron-builder --mac",
26-
"build:unpack": "npm run build && electron-builder --dir",
27-
"build:web": "(cd ./src/renderer && tsc && vite build)",
28-
"build:win": "npm run build && electron-builder --win",
2923
"clean": "rimraf dist node_modules out src/renderer/components.d.ts src/renderer/dist src/renderer/node_modules",
30-
"debug": "electron-vite --inspect --sourcemap dev --watch",
3124
"dev": "electron-vite dev --watch",
3225
"dev:web": "(cd ./src/renderer && vite dev)",
3326
"format": "prettier --write .",
27+
"format:check": "prettier --check .",
3428
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
29+
"package": "electron-vite build && electron-builder",
30+
"package:linux": "electron-vite build && electron-builder --linux",
31+
"package:mac": "electron-vite build && electron-builder --mac",
32+
"package:win": "electron-vite build && electron-builder --win",
3533
"publish:web": "yarn publish ./src/renderer",
3634
"start": "electron-vite preview",
3735
"start:web": "(cd ./src/renderer && vite preview)",
38-
"typecheck": "run-p typecheck:*",
39-
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
40-
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
41-
"web": "(cd ./src/renderer && vite)"
36+
"typecheck": "tsc --noEmit -p tsconfig.node.json --composite false",
37+
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false"
4238
},
4339
"dependencies": {
4440
"@electron-toolkit/preload": "^3.0.1",
@@ -67,7 +63,6 @@
6763
"electron-vite": "^2.3.0",
6864
"eslint": "^8.57.0",
6965
"eslint-plugin-vue": "^9.28.0",
70-
"npm-run-all2": "^6.2.3",
7166
"postcss": "^8.4.47",
7267
"prettier": "^3.3.3",
7368
"rimraf": "^6.0.1",

yarn.lock

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
11941194
dependencies:
11951195
color-convert "^2.0.1"
11961196

1197-
ansi-styles@^6.1.0, ansi-styles@^6.2.1:
1197+
ansi-styles@^6.1.0:
11981198
version "6.2.1"
11991199
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
12001200
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
@@ -3040,11 +3040,6 @@ json-buffer@3.0.1:
30403040
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
30413041
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
30423042

3043-
json-parse-even-better-errors@^3.0.0:
3044-
version "3.0.2"
3045-
resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.2.tgz#b43d35e89c0f3be6b5fbbe9dc6c82467b30c28da"
3046-
integrity sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ==
3047-
30483043
json-schema-traverse@^0.4.1:
30493044
version "0.4.1"
30503045
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
@@ -3271,11 +3266,6 @@ matcher@^3.0.0:
32713266
dependencies:
32723267
escape-string-regexp "^4.0.0"
32733268

3274-
memorystream@^0.3.1:
3275-
version "0.3.1"
3276-
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
3277-
integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==
3278-
32793269
merge-stream@^2.0.0:
32803270
version "2.0.0"
32813271
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@@ -3347,7 +3337,7 @@ minimatch@^5.0.1, minimatch@^5.1.0:
33473337
dependencies:
33483338
brace-expansion "^2.0.1"
33493339

3350-
minimatch@^9.0.0, minimatch@^9.0.3, minimatch@^9.0.4, minimatch@^9.0.5:
3340+
minimatch@^9.0.3, minimatch@^9.0.4, minimatch@^9.0.5:
33513341
version "9.0.5"
33523342
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5"
33533343
integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==
@@ -3535,24 +3525,6 @@ normalize-url@^6.0.1:
35353525
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
35363526
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
35373527

3538-
npm-normalize-package-bin@^3.0.0:
3539-
version "3.0.1"
3540-
resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz#25447e32a9a7de1f51362c61a559233b89947832"
3541-
integrity sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==
3542-
3543-
npm-run-all2@^6.2.3:
3544-
version "6.2.3"
3545-
resolved "https://registry.yarnpkg.com/npm-run-all2/-/npm-run-all2-6.2.3.tgz#ea0c0987337b828eaa78c2f5488e70de0969917b"
3546-
integrity sha512-5RsxC7jEc/RjxOYBVdEfrJf5FsJ0pHA7jr2/OxrThXknajETCTYjigOCG3iaGjdYIKEQlDuCG0ir0T1HTva8pg==
3547-
dependencies:
3548-
ansi-styles "^6.2.1"
3549-
cross-spawn "^7.0.3"
3550-
memorystream "^0.3.1"
3551-
minimatch "^9.0.0"
3552-
pidtree "^0.6.0"
3553-
read-package-json-fast "^3.0.2"
3554-
shell-quote "^1.7.3"
3555-
35563528
npm-run-path@^4.0.1:
35573529
version "4.0.1"
35583530
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"
@@ -3749,11 +3721,6 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1:
37493721
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
37503722
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
37513723

3752-
pidtree@^0.6.0:
3753-
version "0.6.0"
3754-
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c"
3755-
integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==
3756-
37573724
pify@^2.3.0:
37583725
version "2.3.0"
37593726
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -3939,14 +3906,6 @@ read-cache@^1.0.0:
39393906
dependencies:
39403907
pify "^2.3.0"
39413908

3942-
read-package-json-fast@^3.0.2:
3943-
version "3.0.2"
3944-
resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz#394908a9725dc7a5f14e70c8e7556dff1d2b1049"
3945-
integrity sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==
3946-
dependencies:
3947-
json-parse-even-better-errors "^3.0.0"
3948-
npm-normalize-package-bin "^3.0.0"
3949-
39503909
readable-stream@^2.0.0, readable-stream@^2.0.5:
39513910
version "2.3.8"
39523911
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b"
@@ -4171,11 +4130,6 @@ shebang-regex@^3.0.0:
41714130
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
41724131
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
41734132

4174-
shell-quote@^1.7.3:
4175-
version "1.8.1"
4176-
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
4177-
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==
4178-
41794133
signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7:
41804134
version "3.0.7"
41814135
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"

0 commit comments

Comments
 (0)