Skip to content

Commit 1aa0880

Browse files
authored
Merge pull request #69 from classmodel/richer-package
Split READMEs + Complete package.json
2 parents 9c89d42 + 8067255 commit 1aa0880

File tree

10 files changed

+848
-77
lines changed

10 files changed

+848
-77
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ jobs:
3535
BASE_PATH: "/class-web"
3636

3737
- name: Build package API docs
38-
run: pnpm run docs
38+
run: pnpm run docs --out ../../apps/class-solid/.output/public/docs
3939
working-directory: ./packages/class
4040

41-
- name: Combine web app with api docs
42-
run: cp -r ./packages/class/docs ./apps/class-solid/.output/public/docs
43-
4441
- name: upload artifact
4542
uses: actions/upload-pages-artifact@v3
4643
with:

.github/workflows/quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ jobs:
4141
cache-dependency-path: ./pnpm-lock.yaml
4242
- name: Install dependencies
4343
run: pnpm install
44+
- name: Build package
45+
run: pnpm build
46+
working-directory: packages/class
4447
- name: Typecheck
4548
run: pnpm typecheck

README.md

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,11 @@ The CLASS web application (from [apps/class-solid](apps/class-solid) directory)
1717

1818
## Command line usage
1919

20-
The class model can be run from the command line.
21-
The argument is the config file that should adhere to the [JSON schema](./packages/class/src/config.json).
20+
The class model can be run from the command line, see [packages/class/README.md](packages/class/README.md#command-line-usage) for more information.
2221

23-
```shell
24-
# Generate default config file
25-
pnpx @classmodel/cli generate --output config.json
26-
27-
# Run the model
28-
pnpx @classmodel/cli run config.json
29-
# Outputs h variable for each timestep in JSON format
22+
## Package usage
3023

31-
# To output csv use
32-
pnpx @classmodel/cli run --output output.csv --formtat csv config.json
33-
34-
# To read from stdin use
35-
cat config.json | pnpx @classmodel/cli -
36-
```
37-
38-
In development use `pnpx tsx src/cli.ts ./config.json`.
39-
40-
To use the reference configuration of a experiment downloaded from the web application use.
41-
42-
```shell
43-
jq .reference < ~/Downloads/class-MyExperiment.json > config.json
44-
```
24+
The class model can be used a package or library, see [packages/class/README.md](packages/class/README.md#package-usage) for more information.
4525

4626
## Developers
4727

@@ -62,17 +42,6 @@ Currently the repo is home to the following:
6242
- apps/
6343
- class-solid: web application with a graphical user interface for CLASS
6444

65-
### JSON schema
66-
67-
The Class model uses a JSON schema to validate the input configuration. The schema is defined in the `@classmodel/class` package and can be found in [packages/class/src/config.json](packages/class/src/config.json). The schema is used to validate the input configuration and to generate a form to input the configuration.
68-
69-
If any changes are made to the `packages/class/src/config.json` file then the Typescript type need to be regenerated with the following command:
70-
71-
```shell
72-
cd packages/class
73-
pnpm json2ts
74-
```
75-
7645
### Publish package
7746

7847
To publish a new version of the class package:
@@ -113,34 +82,13 @@ To check types, you can run the `pnpm typecheck` command as other commands ignor
11382

11483
## Tests
11584

116-
The unit tests are written with [node:test](https://nodejs.org/api/test.html) and [node:assert](https://nodejs.org/api/assert.html).
11785

118-
The unit tests can be run with the following command:
86+
The tests can be run with the following command:
11987

12088
```shell
12189
pnpm test
12290
```
12391

124-
To get test coverage
125-
126-
```shell
127-
# Does not work via pnpm script so need to call node directly
128-
node --import tsx --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info src/*.test.ts
129-
# To generate a html report use genhtml which is part of lcov OS package
130-
genhtml lcov.info --output-directory coverage
131-
```
132-
133-
## API Documentation
134-
135-
The API documention of the package can be generated with
136-
137-
```shell
138-
pnpm run docs
139-
```
140-
Which will write HTML files to `docs/` directory.
141-
142-
The documentation of the latest release is published at [https://classmodel.github.io/class-web/docs/](https://classmodel.github.io/class-web/docs/).
143-
14492
## Tech stack
14593

14694
The CLASS package is written in typescript.

apps/class-solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "class-solid",
33
"private": true,
4-
"version": "0.0.6",
4+
"version": "0.0.7",
55
"type": "module",
66
"scripts": {
77
"dev": "vinxi dev",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"scripts": {
55
"build": "turbo build",
66
"dev": "turbo dev",

packages/class/LICENSE

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)