From 78f9ac5b5ebd021827b73126432f6d81b063e8d2 Mon Sep 17 00:00:00 2001 From: Spotandjake Date: Fri, 3 Jan 2025 04:01:45 -0500 Subject: [PATCH] feat: Add scripts for `stdlib format` and `stdlib doc` --- .github/workflows/build-native.yml | 4 ++-- stdlib/README.md | 4 ++-- stdlib/package.json | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-native.yml b/.github/workflows/build-native.yml index 9740bef98..6b5409606 100644 --- a/.github/workflows/build-native.yml +++ b/.github/workflows/build-native.yml @@ -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 diff --git a/stdlib/README.md b/stdlib/README.md index 5b4426466..3928fba55 100644 --- a/stdlib/README.md +++ b/stdlib/README.md @@ -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: diff --git a/stdlib/package.json b/stdlib/package.json index b2757c3ee..6bc4aeaa7 100644 --- a/stdlib/package.json +++ b/stdlib/package.json @@ -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": {