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/.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 diff --git a/package.json b/package.json index be9a691..f9ca927 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-doc": "jsdoc -d source/docs/ -r source/" }, "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", diff --git a/specs/adrs/112922-doccumentation-jsdoc.md b/specs/adrs/112922-doccumentation-jsdoc.md new file mode 100644 index 0000000..5d2be4c --- /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. 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