Skip to content

Commit 0542128

Browse files
authored
fix: Issue with building Typedocs (#233)
1 parent c2a6fc2 commit 0542128

File tree

5 files changed

+53
-9
lines changed

5 files changed

+53
-9
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config = {
1818
"**/integration-tests/**/*.mjs",
1919
"**/integration-tests/test-api/**/*",
2020
"**/scripts/publish-docs.mjs",
21-
"**/typedoc/plugin-remove-references.js",
21+
"**/typedoc/plugin-remove-references.mjs",
2222
],
2323
parserOptions: {
2424
ecmaVersion: "latest",

.github/workflows/ci.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,52 @@ jobs:
146146
- name: Run TSC
147147
run: pnpm run type-check
148148

149+
build-docs:
150+
name: Test docs build
151+
runs-on: ubuntu-latest
152+
needs: install
153+
steps:
154+
- name: Checkout
155+
uses: actions/checkout@v4
156+
with:
157+
fetch-depth: 0
158+
159+
- name: Setup node
160+
uses: actions/setup-node@v4
161+
with:
162+
node-version: 20
163+
164+
- name: Install pnpm
165+
uses: pnpm/action-setup@v4
166+
with:
167+
version: 9
168+
run_install: false
169+
170+
- name: Get pnpm store directory
171+
shell: bash
172+
run: |
173+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
174+
175+
- name: Cache node_modules
176+
id: cache-node-modules
177+
uses: actions/cache@v4
178+
env:
179+
cache-name: cache-codecov-js-bundle-plugin-node-modules
180+
with:
181+
path: ${{ env.STORE_PATH }}
182+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
183+
restore-keys: |
184+
${{ runner.os }}-${{ env.cache-name }}-
185+
186+
- name: Install dependencies
187+
run: pnpm install
188+
189+
- name: Build packages
190+
run: pnpm run build
191+
192+
- name: Run Docs
193+
run: pnpm run generate:typedoc
194+
149195
unit-test:
150196
name: Run Unit Tests
151197
runs-on: ubuntu-latest
@@ -475,7 +521,7 @@ jobs:
475521
WEBPACK_API_URL: ${{ secrets.CODECOV_STAGING_API_URL }}
476522
run: pnpm run build
477523

478-
upldate-plugin-stats-production:
524+
upload-plugin-stats-production:
479525
name: "Production: upload ${{ matrix.package }} stats"
480526
runs-on: ubuntu-latest
481527
needs: [install, unit-test, integration-test]
@@ -545,7 +591,7 @@ jobs:
545591
PLUGIN_CODECOV_API_URL: ${{ secrets.CODECOV_API_URL }}
546592
run: pnpm run build
547593

548-
upldate-plugin-stats-staging:
594+
upload-plugin-stats-staging:
549595
name: "Staging: upload ${{ matrix.package }} stats"
550596
runs-on: ubuntu-latest
551597
needs: [install, unit-test, integration-test]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ dist
137137

138138
# typedoc generated files
139139
typedoc/*
140-
!typedoc/plugin-remove-references.js
140+
!typedoc/plugin-remove-references.mjs

typedoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"excludeNotDocumented": true,
1313
"useTsLinkResolution": true,
1414
"githubPages": true,
15-
"plugin": ["./typedoc/plugin-remove-references.js"]
15+
"plugin": ["./typedoc/plugin-remove-references.mjs"]
1616
}

typedoc/plugin-remove-references.js renamed to typedoc/plugin-remove-references.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
// SOFTWARE.
2424

25-
const { ReflectionKind, Converter } = require("typedoc");
25+
import { ReflectionKind, Converter } from "typedoc";
2626

27-
function load({ application }) {
27+
export function load({ application }) {
2828
application.converter.on(Converter.EVENT_RESOLVE_BEGIN, (context) => {
2929
for (const reflection of context.project.getReflectionsByKind(
3030
ReflectionKind.Reference,
@@ -33,5 +33,3 @@ function load({ application }) {
3333
}
3434
});
3535
}
36-
37-
module.exports = { load };

0 commit comments

Comments
 (0)