Skip to content

Commit

Permalink
feat: check links via linkinator (#255)
Browse files Browse the repository at this point in the history
* feat: check links via linkinator

* chore: update glob, add skip env

* chore(release): 8.0.1-qa.0 [skip ci]

* ci: exit early if CI

---------

Co-authored-by: Eric Willhoit <[email protected]>
Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2023
1 parent f200dc5 commit 5c5a1b4
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 113 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/dev-scripts",
"version": "8.0.0",
"version": "8.0.1-qa.0",
"description": "Standardize package.json scripts and config files for Salesforce projects.",
"repository": "forcedotcom/dev-scripts",
"bin": {
Expand Down Expand Up @@ -43,6 +43,7 @@
"cosmiconfig": "^7.0.0",
"eslint-config-salesforce-typescript": "^3.0.5",
"husky": "^7.0.4",
"linkinator": "^6.0.2",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
Expand Down
11 changes: 10 additions & 1 deletion utils/sf-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const PACKAGE_DEFAULTS = {
test: 'wireit',
'test:compile': undefined,
'test:only': 'wireit',
'link-check': 'wireit',
lint: 'wireit',
prepack: 'sf-prepack',
},
Expand All @@ -47,14 +48,21 @@ const PACKAGE_DEFAULTS = {
files: ['src/**/*.ts', 'test/**/*.ts', 'messages/**', '**/.eslint*', '**/tsconfig.json'],
output: [],
},
'link-check': {
command:
// eslint-disable-next-line max-len
'node -e "process.exit(process.env.CI ? 0 : 1)" || linkinator "**/*.md" --skip "CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|%s" --markdown --retry --directory-listing --verbosity error',
files: ['./*.md', './!(CHANGELOG).md', 'messages/**/*.md'],
output: [],
},
// compiles all test files, including NUTs
'test:compile': {
command: 'tsc -p "./test" --pretty',
files: ['test/**/*.ts', '**/tsconfig.json'],
output: [],
},
test: {
dependencies: ['test:only', 'test:compile'],
dependencies: ['test:only', 'test:compile', 'link-check'],
},
'test:only': {
command: 'nyc mocha "test/**/*.test.ts"',
Expand Down Expand Up @@ -122,6 +130,7 @@ const resolveConfig = (path) => {
'test:deprecation-policy',
'lint',
'test:json-schema',
'link-check',
],
},
},
Expand Down
Loading

0 comments on commit 5c5a1b4

Please sign in to comment.