Skip to content

Commit 49a3a11

Browse files
authored
fix: Documentation build with NPM dependencies (#1200)
The isolated `documentation` package does not have its own `package-lock.json`, so the documentation publishing action fails on `npm ci` command.
1 parent ad81e66 commit 49a3a11

File tree

5 files changed

+13280
-8635
lines changed

5 files changed

+13280
-8635
lines changed

.github/workflows/deploy-vitepress-docs.yaml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,15 @@ jobs:
4040
cache: npm
4141
- name: Setup Pages
4242
uses: actions/configure-pages@v4
43-
- name: Copy documentation package to isolated directory
44-
run: |
45-
# Create isolated directory for documentation
46-
# So, that API.json will be build from the NPM packages,
47-
# and not from workspace packages
48-
mkdir -p ${{ runner.temp }}/isolated-docs
49-
cp -r internal/documentation/. ${{ runner.temp }}/isolated-docs/
50-
- name: Install documentation dependencies from NPM
51-
working-directory: ${{ runner.temp }}/isolated-docs
43+
- name: Install dependencies
5244
run: npm ci --engine-strict
5345
- name: Fetch gh-pages branch
5446
run: git fetch origin gh-pages --depth=1
5547
- name: generate CLI doc
56-
working-directory: ${{ runner.temp }}/isolated-docs
48+
working-directory: internal/documentation
5749
run: npm run generate-cli-doc
5850
- name: Build vitepress build
59-
working-directory: ${{ runner.temp }}/isolated-docs
51+
working-directory: internal/documentation
6052
run: |
6153
# The base output
6254
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_VERSION}/"
@@ -65,7 +57,7 @@ jobs:
6557
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_ALIAS}/" --outDir="dist-${DOC_ALIAS}"
6658
npm run build:assets -- ./dist-${DOC_ALIAS}
6759
- name: Build jsdoc
68-
working-directory: ${{ runner.temp }}/isolated-docs
60+
working-directory: internal/documentation
6961
run: npm run jsdoc-generate
7062
# TODO: Skip for now deployment of the schema until we do a Schema Version 5 release
7163
# - name: Build Sch3 |
@@ -85,16 +77,16 @@ jobs:
8577
rm -rf ./gh-pages/${DOC_ALIAS}
8678
8779
# Main version route
88-
cp -R ${{ runner.temp }}/isolated-docs/dist ./gh-pages/${DOC_VERSION}/
80+
cp -R internal/documentation/dist ./gh-pages/${DOC_VERSION}/
8981
9082
# Alias route. E.g., next, latest, stable, etc.
9183
# For vitepress must be a copy with different config, not a symlink
92-
cp -R ${{ runner.temp }}/isolated-docs/dist-${DOC_ALIAS} ./gh-pages/${DOC_ALIAS}/
84+
cp -R internal/documentation/dist-${DOC_ALIAS} ./gh-pages/${DOC_ALIAS}/
9385
# Symlink the api docs to avoid duplication
9486
ln -s ../${DOC_VERSION}/api ./gh-pages/${DOC_ALIAS}/api
9587
9688
# TODO: Enable when v5 release is done
97-
# cp ${{ runner.temp }}/isolated-docs/scripts/resources/custom404.html ./gh-pages/404.html
89+
# cp internal/documentation/scripts/resources/custom404.html ./gh-pages/404.html
9890
- name: Publish Docs
9991
run: |
10092
cd ./gh-pages
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"tags": {
3+
"allowUnknownTags": false
4+
},
5+
"source": {
6+
"include": ["jsdoc/index.md", "../../packages"],
7+
"exclude": [
8+
"../../packages/builder/lib/lbt/utils/JSTokenizer.js",
9+
"../../packages/builder/lib/processors/jsdoc/lib/ui5/plugin.js",
10+
"../../packages/builder/lib/processors/jsdoc/lib/ui5/template/publish.js",
11+
"../../packages/builder/lib/processors/jsdoc/lib/ui5/template/utils/versionUtil.js"
12+
],
13+
"includePattern": "packages/[^/]+/(lib/.+|index)\\.js$",
14+
"excludePattern": "packages/.*/node_modules"
15+
},
16+
"plugins": [
17+
"jsdoc/jsdoc-plugin.cjs"
18+
],
19+
"opts": {
20+
"encoding": "utf8",
21+
"destination": "dist/api/",
22+
"recurse": true,
23+
"verbose": true,
24+
"access": "public"
25+
},
26+
"templates": {
27+
"cleverLinks": false,
28+
"monospaceLinks": false,
29+
"default": {
30+
"useLongnameInNav": true,
31+
"layoutFile": "jsdoc/templates/layout.tmpl",
32+
"staticFiles": {
33+
"include": ["jsdoc/templates/custom.css"]
34+
}
35+
}
36+
},
37+
"openGraph": {
38+
"title": "UI5 CLI - API Reference",
39+
"type": "website",
40+
"image": "https://ui5.github.io/cli/v5/images/UI5_logo_wide.png",
41+
"site_name": "UI5 CLI - API Reference",
42+
"url": "https://ui5.github.io/cli/v5/"
43+
},
44+
"docdash": {
45+
"sectionOrder": [
46+
"Modules",
47+
"Namespaces",
48+
"Classes",
49+
"Externals",
50+
"Events",
51+
"Mixins",
52+
"Tutorials",
53+
"Interfaces"
54+
],
55+
"meta": {
56+
"title": "UI5 CLI - API Reference",
57+
"description": "UI5 CLI - API Reference",
58+
"keyword": "openui5 sapui5 ui5 build development tool api reference"
59+
},
60+
"search": true,
61+
"wrap": true,
62+
"menu": {
63+
"GitHub": {
64+
"href": "https://github.com/UI5/cli",
65+
"target": "_blank",
66+
"class": "menu-item",
67+
"id": "github_link"
68+
}
69+
}
70+
}
71+
}

internal/documentation/jsdoc/jsdoc.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"allowUnknownTags": false
44
},
55
"source": {
6-
"include": ["jsdoc/index.md"],
6+
"include": ["jsdoc/index.md", "../../node_modules/@ui5"],
77
"exclude": [
8-
"node_modules/@ui5/builder/lib/lbt/utils/JSTokenizer.js",
9-
"node_modules/@ui5/builder/lib/processors/jsdoc/lib/ui5/plugin.js",
10-
"node_modules/@ui5/builder/lib/processors/jsdoc/lib/ui5/template/publish.js",
11-
"node_modules/@ui5/builder/lib/processors/jsdoc/lib/ui5/template/utils/versionUtil.js"
8+
"../../node_modules/@ui5/builder-npm/lib/lbt/utils/JSTokenizer.js",
9+
"../../node_modules/@ui5/builder-npm/lib/processors/jsdoc/lib/ui5/plugin.js",
10+
"../../node_modules/@ui5/builder-npm/lib/processors/jsdoc/lib/ui5/template/publish.js",
11+
"../../node_modules/@ui5/builder-npm/lib/processors/jsdoc/lib/ui5/template/utils/versionUtil.js"
1212
],
13-
"includePattern": "node_modules/@ui5/[^\/]*/(lib/.+|index)\\.js$",
14-
"excludePattern": "node_modules/@ui5/.*/node_modules/@ui5"
13+
"includePattern": "@ui5/[^/]*-npm/(lib/.+|index)\\.js$",
14+
"excludePattern": "@ui5/.*/node_modules/@ui5"
1515
},
1616
"plugins": [
1717
"jsdoc/jsdoc-plugin.cjs"

internal/documentation/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
"scripts": {
2525
"start": "vitepress dev --open",
2626
"lint": "eslint .",
27-
"depcheck": "depcheck --ignores @ui5/documentation,vitepress,docdash,jsdoc,open-cli,handlebars,@types/node,@ui5/webcomponents,autoprefixer,cssnano,@ui5/cli,@ui5/builder,@ui5/fs,@ui5/logger,@ui5/project,@ui5/server,@theme/components",
27+
"depcheck": "depcheck --ignores @ui5/documentation,vitepress,docdash,jsdoc,open-cli,handlebars,@types/node,@ui5/webcomponents,autoprefixer,cssnano,@ui5/cli-npm,@ui5/builder-npm,@ui5/fs-npm,@ui5/logger-npm,@ui5/project-npm,@ui5/server-npm,@theme/components",
2828
"dev": "vitepress dev",
2929
"build:vitepress": "vitepress build",
3030
"build:assets": "sh -c 'DEST_DIR=${1:-./dist}; cp -r ./docs/images \"$DEST_DIR/images\"' --",
3131
"preview": "vitepress preview --port 8080",
3232
"jsdoc": "npm run jsdoc-generate && open-cli dist/api/index.html",
3333
"jsdoc-generate": "jsdoc -c jsdoc/jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
34+
"jsdoc-generate-workspace": "jsdoc -c jsdoc/jsdoc-workspace.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
3435
"generate-cli-doc": "node ./scripts/generateCliDoc.js"
3536
},
3637
"dependencies": {
@@ -45,12 +46,12 @@
4546
"vue": "^3.4.38"
4647
},
4748
"devDependencies": {
48-
"@ui5/builder": "^4",
49-
"@ui5/cli": "^4",
50-
"@ui5/fs": "^4",
51-
"@ui5/logger": "^4",
52-
"@ui5/project": "^4",
53-
"@ui5/server": "^4",
49+
"@ui5/builder-npm": "npm:@ui5/builder@^4.0.11",
50+
"@ui5/cli-npm": "npm:@ui5/cli@^4.0.26",
51+
"@ui5/fs-npm": "npm:@ui5/fs@^4.0.2",
52+
"@ui5/logger-npm": "npm:@ui5/logger@^4.0.2",
53+
"@ui5/project-npm": "npm:@ui5/project@^4.0.6",
54+
"@ui5/server-npm": "npm:@ui5/server@^4.0.7",
5455
"docdash": "^2.0.2",
5556
"jsdoc": "^4.0.4",
5657
"open-cli": "^8.0.0",

0 commit comments

Comments
 (0)