From 9214b964d0893b41123e1c4332c9b39c4acf1887 Mon Sep 17 00:00:00 2001 From: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:52:01 +0800 Subject: [PATCH] fix: apidocs table links fixes: https://github.com/loopbackio/loopback-next/discussions/11649 Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com> --- package-lock.json | 56 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + update-lb4-docs.js | 17 ++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/package-lock.json b/package-lock.json index 43d6099ae..56d4c8d18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@loopback/docs": "latest", "chalk": "^5.6.2", "fs-extra": "^11.3.6", + "glob": "^13.0.6", "markdownlint-cli": "^0.49.0", "retry": "^0.13.1", "swagger-ui-dist": "^5.32.8", @@ -301,6 +302,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -475,6 +494,16 @@ "uc.micro": "^2.0.0" } }, + "node_modules/lru-cache": { + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/markdown-it": { "version": "14.2.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.2.0.tgz", @@ -1146,6 +1175,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1173,6 +1212,23 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/picomatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", diff --git a/package.json b/package.json index d226ff637..816f97be0 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@loopback/docs": "latest", "chalk": "^5.6.2", "fs-extra": "^11.3.6", + "glob": "^13.0.6", "markdownlint-cli": "^0.49.0", "retry": "^0.13.1", "swagger-ui-dist": "^5.32.8", diff --git a/update-lb4-docs.js b/update-lb4-docs.js index a2f592950..563f01a14 100644 --- a/update-lb4-docs.js +++ b/update-lb4-docs.js @@ -7,6 +7,7 @@ const fs = require('fs-extra'); const path = require('path'); const yaml = require('js-yaml'); const assert = require('assert'); +const {glob} = require('glob'); const srcDocs = path.resolve(__dirname,'node_modules/@loopback/docs/site'); const destDocs = path.resolve(__dirname, 'pages/en/lb4'); @@ -83,6 +84,22 @@ function copyFile(input) { // Most of the connector doc files are in the lb3 dir, copy them for lb4 copyFile(connectorsReference); +const fixApidocs = async () => { + const apidocsFiles = await glob(path.resolve(destDocs, 'apidocs/**/*.md')); + for (apidocsFile of apidocsFiles) { + try { + let contents = fs.readFileSync(apidocsFile, 'utf-8'); + contents = contents.replaceAll('