Skip to content

Commit

Permalink
feat: Add scripts for stdlib format and stdlib doc
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Jan 3, 2025
1 parent fbb08bf commit 78f9ac5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ jobs:
- name: (stdlib) Check documentation
if: inputs.os != 'windows-latest'
run: |
grain doc stdlib -o stdlib --current-version=$(grain -v)
npm run stdlib doc
git diff --exit-code --name-only
# If we have a working grain CLI, we can run grainfmt on stdlib & tests
- name: (stdlib) Check formatting
if: inputs.os != 'windows-latest'
run: |
grain format stdlib -o stdlib
npm run stdlib format
grain format compiler/test/stdlib -o compiler/test/stdlib
git diff --exit-code --name-only
4 changes: 2 additions & 2 deletions stdlib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ If you want to contribute to the `stdlib`, please consider the guidelines [here]
To regenerate the `stdlib`` documentation you can run:

```sh
grain doc stdlib -o stdlib --current-version=$(grain -v)
npm run stdlib doc
```

To format the `stdlib` you can run:

```sh
grain format ./stdlib/ -o ./stdlib/
npm run stdlib format
```

To run the `stdlib` tests you can run:
Expand Down
4 changes: 3 additions & 1 deletion stdlib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"index.js"
],
"scripts": {
"clean": "del-cli \"**/*.wasm\" \"**/*.wat\" \"**/*.modsig\""
"clean": "del-cli \"**/*.wasm\" \"**/*.wat\" \"**/*.modsig\"",
"doc": "grain doc ./ -o ./ --current-version=$(grain -v)",
"format": "grain format ./ -o ./"
},
"dependencies": {},
"devDependencies": {
Expand Down

0 comments on commit 78f9ac5

Please sign in to comment.