From 131e14d611921c74bbc2922270f93b308017b59a Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 29 Nov 2022 21:53:05 +0000 Subject: [PATCH 1/5] added jsdocs to package.json --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index be9a691..d3b329b 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,14 @@ "lint-html": "htmlhint **/*.html", "lint-css": "stylelint **/*.css", "fix-css": "stylelint --fix **/*.css", - "http-server": "http-server source" + "http-server": "http-server source", + "js-docs": "jsdoc **/*.js" }, "devDependencies": { "eslint": "^8.27.0", "htmlhint": "1.1.4", "http-server": "", + "jsdoc": "^4.0.0", "mocha": "10", "mock-local-storage": "^1.1.23", "puppeteer": "^18.2.1", From beb3e6cc984c2b2175ab72d53fc0db9ebced2ad7 Mon Sep 17 00:00:00 2001 From: Graydogminer <78515166+Graydogminer@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:59:02 -0800 Subject: [PATCH 2/5] added JS Docs to workflow --- .github/workflows/js-docs.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/js-docs.yml diff --git a/.github/workflows/js-docs.yml b/.github/workflows/js-docs.yml new file mode 100644 index 0000000..e2679ad --- /dev/null +++ b/.github/workflows/js-docs.yml @@ -0,0 +1,23 @@ +name: JS Docs + +on: + pull_request: + branches: + - main + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Single deploy job since we're just deploying + test: + runs-on: ubuntu-latest + steps: + - name: Install apt updates + run: sudo apt -y update; sudo apt -y upgrade; + - name: Checkout + uses: actions/checkout@v3 + - name: Install dependencies + run: sudo npm install + - name: Run js-docs + run: sudo npm run js-docs From 929de8c98bb59c38be7d2896cecf8ff5d2f85ba0 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 29 Nov 2022 22:11:12 +0000 Subject: [PATCH 3/5] fix js-doc command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d3b329b..f9ca927 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint-css": "stylelint **/*.css", "fix-css": "stylelint --fix **/*.css", "http-server": "http-server source", - "js-docs": "jsdoc **/*.js" + "js-doc": "jsdoc -d source/docs/ -r source/" }, "devDependencies": { "eslint": "^8.27.0", From dcee487737843c1d8e305cf6956790442d2345d0 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 29 Nov 2022 22:18:32 +0000 Subject: [PATCH 4/5] add JSDoc ADR, add JSDoc to publish action --- .github/workflows/deploy-githubpages.yml | 10 ++++++++++ specs/adrs/112922-doccumentation-jsdoc.md | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 specs/adrs/112922-doccumentation-jsdoc.md diff --git a/.github/workflows/deploy-githubpages.yml b/.github/workflows/deploy-githubpages.yml index 4909524..17c672b 100644 --- a/.github/workflows/deploy-githubpages.yml +++ b/.github/workflows/deploy-githubpages.yml @@ -29,8 +29,18 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: + - name: Install apt updates + run: sudo apt -y update; sudo apt -y upgrade; + - name: Install prerequisites + uses: actions/setup-node@v3 + with: + node-version: 18 - name: Checkout uses: actions/checkout@v3 + - name: Install dependencies + run: sudo npm install + - name: Run tests + run: sudo npm run js-doc - name: Setup Pages uses: actions/configure-pages@v2 - name: Upload artifact diff --git a/specs/adrs/112922-doccumentation-jsdoc.md b/specs/adrs/112922-doccumentation-jsdoc.md new file mode 100644 index 0000000..a7e92df --- /dev/null +++ b/specs/adrs/112922-doccumentation-jsdoc.md @@ -0,0 +1,17 @@ +# Use JSDoc for JS documentation + +- Status: accept +- Deciders: Arthur Lu, Marc Reta +- Date: 11 / 29 / 22 + +## Decision Drivers + +- Need simple way to publish documentation for code +- Already documentating infile using JSDoc style + +## Considered Options +- JSDoc + +## Decision Outcome + +Chosen Option: JSDoc \ No newline at end of file From 603fb849f381d004f230c107931431dc8bd38f6b Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 29 Nov 2022 22:23:24 +0000 Subject: [PATCH 5/5] add explanation of JSDoc usage to ADR --- specs/adrs/112922-doccumentation-jsdoc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/adrs/112922-doccumentation-jsdoc.md b/specs/adrs/112922-doccumentation-jsdoc.md index a7e92df..5d2be4c 100644 --- a/specs/adrs/112922-doccumentation-jsdoc.md +++ b/specs/adrs/112922-doccumentation-jsdoc.md @@ -14,4 +14,4 @@ ## Decision Outcome -Chosen Option: JSDoc \ No newline at end of file +Chosen Option: JSDoc. Will run by generating docs in /source/docs/ before publishing /source/ so users can enter the URI /docs/ to see documentation. \ No newline at end of file