Skip to content

Commit b00a785

Browse files
committed
refactor: Use npm aliases for names to download the @ui6/* packages from NPM
1 parent 26f1898 commit b00a785

File tree

5 files changed

+17150
-7073
lines changed

5 files changed

+17150
-7073
lines changed

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

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +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
52-
# npm ci won't work as this package relies on the monorepo's package-lock.json
53-
# Run npm install instead as we want latest @ui5/* packages to be installed from NPM
54-
run: npm install --engine-strict
43+
- name: Install dependencies
44+
run: npm ci --engine-strict
5545
- name: Fetch gh-pages branch
5646
run: git fetch origin gh-pages --depth=1
5747
- name: generate CLI doc
58-
working-directory: ${{ runner.temp }}/isolated-docs
48+
working-directory: internal/documentation
5949
run: npm run generate-cli-doc
6050
- name: Build vitepress build
61-
working-directory: ${{ runner.temp }}/isolated-docs
51+
working-directory: internal/documentation
6252
run: |
6353
# The base output
6454
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_VERSION}/"
@@ -67,7 +57,7 @@ jobs:
6757
npm run build:vitepress -- --base="/${{ github.event.repository.name }}/${DOC_ALIAS}/" --outDir="dist-${DOC_ALIAS}"
6858
npm run build:assets -- ./dist-${DOC_ALIAS}
6959
- name: Build jsdoc
70-
working-directory: ${{ runner.temp }}/isolated-docs
60+
working-directory: internal/documentation
7161
run: npm run jsdoc-generate
7262
# TODO: Skip for now deployment of the schema until we do a Schema Version 5 release
7363
# - name: Build Sch3 |
@@ -87,16 +77,16 @@ jobs:
8777
rm -rf ./gh-pages/${DOC_ALIAS}
8878
8979
# Main version route
90-
cp -R ${{ runner.temp }}/isolated-docs/dist ./gh-pages/${DOC_VERSION}/
80+
cp -R internal/documentation/dist ./gh-pages/${DOC_VERSION}/
9181
9282
# Alias route. E.g., next, latest, stable, etc.
9383
# For vitepress must be a copy with different config, not a symlink
94-
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}/
9585
# Symlink the api docs to avoid duplication
9686
ln -s ../${DOC_VERSION}/api ./gh-pages/${DOC_ALIAS}/api
9787
9888
# TODO: Enable when v5 release is done
99-
# 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
10090
- name: Publish Docs
10191
run: |
10292
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/v4/images/UI5_logo_wide.png",
41+
"site_name": "UI5 CLI - API Reference",
42+
"url": "https://ui5.github.io/cli/v4/"
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)