From a9ff91cd8c9b4a47efeac343c1716010e4bdc8ec Mon Sep 17 00:00:00 2001 From: pwizla Date: Wed, 27 Jan 2021 18:03:24 +0100 Subject: [PATCH 1/3] Add check-md plugin for VuePress Now you can run `yarn check-links` for a basic output of links issues. --- developer-docs/.vuepress/config.js | 1 + developer-docs/package.json | 8 ++++-- developer-docs/yarn.lock | 40 ++++++++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/developer-docs/.vuepress/config.js b/developer-docs/.vuepress/config.js index 528dd5b883..5b0d2bb690 100644 --- a/developer-docs/.vuepress/config.js +++ b/developer-docs/.vuepress/config.js @@ -9,6 +9,7 @@ module.exports = { '@vuepress/google-analytics': { ga: 'UA-54313258-1', }, + 'check-md': {}, seo: { siteTitle: (_, $site) => $site.title, title: $page => $page.title, diff --git a/developer-docs/package.json b/developer-docs/package.json index fc3f3675f1..34bff86ae7 100644 --- a/developer-docs/package.json +++ b/developer-docs/package.json @@ -4,7 +4,8 @@ "main": "index.js", "scripts": { "dev": "vuepress dev", - "build": "vuepress build" + "build": "vuepress build", + "check-links": "vuepress check-md" }, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -26,5 +27,8 @@ "email": "hi@strapi.io", "url": "http://strapi.io" } - ] + ], + "devDependencies": { + "vuepress-plugin-check-md": "^0.0.2" + } } diff --git a/developer-docs/yarn.lock b/developer-docs/yarn.lock index 0b2cf1e2e8..ffc49943f2 100644 --- a/developer-docs/yarn.lock +++ b/developer-docs/yarn.lock @@ -918,6 +918,14 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/slugify@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/slugify/-/slugify-0.8.0.tgz#5550b7fa064f3a8a82651463ad635378054c72d0" + integrity sha512-Y+C3aG0JHmi4nCfixHgq0iAtqWCjMCliWghf6fXbemRKSGzpcrHdYxGZGDt8MeFg+gH7ounfMbz6WogqKCWvDg== + dependencies: + escape-string-regexp "^1.0.5" + lodash.deburr "^4.1.0" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -2157,6 +2165,17 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +check-md@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/check-md/-/check-md-1.0.0.tgz#6ba97cf4e061b23691b4132591afb168d4cd5910" + integrity sha512-H9LS+TDB6ix4QZQFiTp2TVIL+24zKutOKDqxIxAxnvkx3phpzrwPINaykD8RSeynxIVp3s0PecR2GEA3KLbziQ== + dependencies: + "@sindresorhus/slugify" "^0.8.0" + chalk "^2.4.2" + commander "^2.19.0" + diacritics "^1.3.0" + globby "^9.1.0" + chokidar@^2.0.2, chokidar@^2.0.3, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -2359,7 +2378,7 @@ commander@2.17.x: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.20.0: +commander@^2.19.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2991,6 +3010,11 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== +diacritics@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" + integrity sha1-PvqHMj67hj5mls67AILUj/PW96E= + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -3813,7 +3837,7 @@ globby@^7.1.1: pify "^3.0.0" slash "^1.0.0" -globby@^9.2.0: +globby@^9.1.0, globby@^9.2.0: version "9.2.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== @@ -4910,6 +4934,11 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= +lodash.deburr@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.deburr/-/lodash.deburr-4.1.0.tgz#ddb1bbb3ef07458c0177ba07de14422cb033ff9b" + integrity sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s= + lodash.kebabcase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" @@ -8199,6 +8228,13 @@ vuepress-html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" +vuepress-plugin-check-md@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/vuepress-plugin-check-md/-/vuepress-plugin-check-md-0.0.2.tgz#e0c5f296948fa5df24280971ee6a725c00a88738" + integrity sha512-XwA/IiMNvR42L3ajmkr+6JY3JRnhDN+uluh1wLYl0VAI8VqTkXT7Ng4xlxgebfLPChEFPnJgcydGv8E52Zdpig== + dependencies: + check-md "1.0.0" + vuepress-plugin-container@^2.0.2: version "2.1.1" resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.1.tgz#1938f28c8244aa82fee60aa4741596129d1df01f" From 35e92c3a3caa196847a69f7acced46afa2c8e835 Mon Sep 17 00:00:00 2001 From: pwizla Date: Wed, 27 Jan 2021 18:02:36 +0100 Subject: [PATCH 2/3] Exclude '_old' folders when scanning for broken links --- developer-docs/.vuepress/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/developer-docs/.vuepress/config.js b/developer-docs/.vuepress/config.js index 5b0d2bb690..ae3f389c17 100644 --- a/developer-docs/.vuepress/config.js +++ b/developer-docs/.vuepress/config.js @@ -9,7 +9,9 @@ module.exports = { '@vuepress/google-analytics': { ga: 'UA-54313258-1', }, - 'check-md': {}, + 'check-md': { + ignore: ['**/node_modules', '**/_old/*'] + }, seo: { siteTitle: (_, $site) => $site.title, title: $page => $page.title, From 5addae0971cc1eb442af0d95bf67098fd8c92687 Mon Sep 17 00:00:00 2001 From: pwizla Date: Fri, 29 Jan 2021 12:03:24 +0100 Subject: [PATCH 3/3] Also add plugin to user-docs folder --- user-docs/.vuepress/config.js | 3 +++ user-docs/package.json | 11 +++++----- user-docs/yarn.lock | 40 +++++++++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/user-docs/.vuepress/config.js b/user-docs/.vuepress/config.js index a773d33a92..a00a69852f 100755 --- a/user-docs/.vuepress/config.js +++ b/user-docs/.vuepress/config.js @@ -9,6 +9,9 @@ module.exports = { '@vuepress/google-analytics': { ga: 'UA-54313258-1', }, + 'check-md': { + ignore: ['**/node_modules', '**/_old/*'] + }, seo: { siteTitle: (_, $site) => $site.title, title: ($page) => $page.title, diff --git a/user-docs/package.json b/user-docs/package.json index 1da8d7ea59..a2a37c9cf7 100755 --- a/user-docs/package.json +++ b/user-docs/package.json @@ -4,12 +4,10 @@ "main": "index.js", "scripts": { "dev": "vuepress dev", - "build": "vuepress build" + "build": "vuepress build", + "check-links": "vuepress check-md" }, "license": "SEE LICENSE IN LICENSE", - "devDependencies": { - "vuepress": "^1.5.3" - }, "dependencies": { "@vuepress/plugin-google-analytics": "^1.7.1", "@vuepress/plugin-medium-zoom": "^1.7.1", @@ -29,5 +27,8 @@ "email": "hi@strapi.io", "url": "http://strapi.io" } - ] + ], + "devDependencies": { + "vuepress-plugin-check-md": "^0.0.2" + } } diff --git a/user-docs/yarn.lock b/user-docs/yarn.lock index 522cdb98e6..ab509157b8 100644 --- a/user-docs/yarn.lock +++ b/user-docs/yarn.lock @@ -899,6 +899,14 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/slugify@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/slugify/-/slugify-0.8.0.tgz#5550b7fa064f3a8a82651463ad635378054c72d0" + integrity sha512-Y+C3aG0JHmi4nCfixHgq0iAtqWCjMCliWghf6fXbemRKSGzpcrHdYxGZGDt8MeFg+gH7ounfMbz6WogqKCWvDg== + dependencies: + escape-string-regexp "^1.0.5" + lodash.deburr "^4.1.0" + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -2161,6 +2169,17 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +check-md@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/check-md/-/check-md-1.0.0.tgz#6ba97cf4e061b23691b4132591afb168d4cd5910" + integrity sha512-H9LS+TDB6ix4QZQFiTp2TVIL+24zKutOKDqxIxAxnvkx3phpzrwPINaykD8RSeynxIVp3s0PecR2GEA3KLbziQ== + dependencies: + "@sindresorhus/slugify" "^0.8.0" + chalk "^2.4.2" + commander "^2.19.0" + diacritics "^1.3.0" + globby "^9.1.0" + chokidar@^2.0.3, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -2360,7 +2379,7 @@ commander@2.17.x: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.20.0: +commander@^2.19.0, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2985,6 +3004,11 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== +diacritics@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" + integrity sha1-PvqHMj67hj5mls67AILUj/PW96E= + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -3843,7 +3867,7 @@ globby@^7.1.1: pify "^3.0.0" slash "^1.0.0" -globby@^9.2.0: +globby@^9.1.0, globby@^9.2.0: version "9.2.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== @@ -4922,6 +4946,11 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= +lodash.deburr@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.deburr/-/lodash.deburr-4.1.0.tgz#ddb1bbb3ef07458c0177ba07de14422cb033ff9b" + integrity sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s= + lodash.kebabcase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" @@ -8106,6 +8135,13 @@ vuepress-html-webpack-plugin@^3.2.0: toposort "^1.0.0" util.promisify "1.0.0" +vuepress-plugin-check-md@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/vuepress-plugin-check-md/-/vuepress-plugin-check-md-0.0.2.tgz#e0c5f296948fa5df24280971ee6a725c00a88738" + integrity sha512-XwA/IiMNvR42L3ajmkr+6JY3JRnhDN+uluh1wLYl0VAI8VqTkXT7Ng4xlxgebfLPChEFPnJgcydGv8E52Zdpig== + dependencies: + check-md "1.0.0" + vuepress-plugin-container@^2.0.2: version "2.1.5" resolved "https://registry.yarnpkg.com/vuepress-plugin-container/-/vuepress-plugin-container-2.1.5.tgz#37fff05662fedbd63ffd3a5463b2592c7a7f3133"