Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak npm scripts #1197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@ jobs:
- name: Install npm dependencies
run: npm ci

- name: Build docs
run: mkdocs build --strict

- name: Test
- name: Build and test
run: npm test
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
},
"homepage": "https://docs.pi-hole.net/",
"scripts": {
"build": "mkdocs build --clean",
"build": "mkdocs build --clean --strict",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the sake of documentation: --strict determines how warnings are handled. Set to halt processing when a warning is raised. Otherwise, print a warning and continue processing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"markdownlint": "markdownlint-cli2 \"**/*.md\" \"!**/node_modules/**\"",
"linkinator": "npm run build && linkinator site --recurse --silent --skip \"^(?!http://localhost)\"",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still working when we remove the build step here? I'm asking because when we run npm run test locally before committing/pushing, where does it run the necessary build step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, no. You need to build the docs manually.

Alternatively, we could just change the CI script if you prefer that.

"linkinator": "linkinator site --recurse --silent --skip \"^(?!http://localhost)\"",
"pretest": "npm run build",
"test": "npm run markdownlint && npm run linkinator",
"serve": "mkdocs serve --dev-addr 0.0.0.0:8000"
"serve": "mkdocs serve --dev-addr 0.0.0.0:8000",
"start": "npm run serve"
},
"devDependencies": {
"linkinator": "^6.1.2",
Expand Down