Skip to content

Commit

Permalink
Move JSDoc, SassDoc into into app/public/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Mar 15, 2023
1 parent f03be50 commit 62da944
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ runs:
with:
# Restore build cache (unless commit SHA changes)
key: build-cache-${{ runner.os }}-${{ github.sha }}
path: |
app/public
jsdoc
sassdoc
path: app/public

- name: Install dependencies
uses: ./.github/workflows/actions/install-node
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ node_modules/
coverage/

# Build output
jsdoc/
public/
sassdoc/

# Files to ignore
.DS_Store
Expand Down
6 changes: 4 additions & 2 deletions app/src/common/middleware/docs.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { join } from 'path'

import express from 'express'

import { paths } from '../../../../config/index.js'
Expand Down Expand Up @@ -27,7 +29,7 @@ router.use('/sass', ({ app }, res, next) => {
/**
* Add middleware
*/
router.use('/sass', express.static(paths.sassdoc))
router.use('/javascript', express.static(paths.jsdoc))
router.use('/sass', express.static(join(paths.app, 'public/docs/sassdoc')))
router.use('/javascript', express.static(join(paths.app, 'public/docs/jsdoc')))

export default router
6 changes: 1 addition & 5 deletions config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@ module.exports = {
package: join(rootPath, 'package'),

// Review application
app: join(rootPath, 'app'),

// Documentation
jsdoc: join(rootPath, 'jsdoc'),
sassdoc: join(rootPath, 'sassdoc')
app: join(rootPath, 'app')
}
8 changes: 4 additions & 4 deletions docs/contributing/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ npm scripts are defined in `package.json`. These trigger a number of Gulp tasks.
- copy fonts and images
- run sub tasks from `gulp styles` without ESLint code quality checks
- run sub tasks from `gulp scripts` without StyleLint code quality checks
- compile Sass documentation into `./sassdoc`
- compile JavaScript documentation into `./jsdoc`
- compile Sass documentation into `./app/public/docs/sassdoc`
- compile JavaScript documentation into `./app/public/docs/jsdoc`

**`npm run build:package` will do the following:**

Expand Down Expand Up @@ -77,15 +77,15 @@ This task will:

- check Sass code quality via Stylelint (`npm run lint:scss`)
- compile Sass to CSS into `./app/public/stylesheets`
- compile Sass documentation into `./sassdoc`
- compile Sass documentation into `./app/public/docs/sassdoc`

**`gulp scripts`**

This task will:

- check JavaScript code quality via ESLint (`npm run lint:js`) (using JavaScript Standard Style)
- compile JavaScript ESM to CommonJS into `./app/public/javascripts`
- compile JavaScript documentation into `./jsdoc`
- compile JavaScript documentation into `./app/public/docs/jsdoc`

## Express app only

Expand Down
2 changes: 1 addition & 1 deletion jsdoc.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
opts: {
destination: './jsdoc',
destination: './public/docs/jsdoc',
recurse: true
},
plugins: [
Expand Down
1 change: 1 addition & 0 deletions sassdoc.config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dest: public/docs/sassdoc
exclude:
- vendor/*

Expand Down

0 comments on commit 62da944

Please sign in to comment.