diff --git a/.gitignore b/.gitignore index ac208343158..afee8b743ce 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,4 @@ internal/documentation/.vitepress/dist internal/documentation/.vitepress/cache internal/documentation/dist internal/documentation/schema/* -internal/documentation/tmp +internal/documentation/docs/api \ No newline at end of file diff --git a/REUSE.toml b/REUSE.toml index 2fc7b1cffda..fbeaa448342 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -10,3 +10,8 @@ precedence = "aggregate" SPDX-FileCopyrightText = "2025 SAP SE or an SAP affiliate company and UI5 CLI contributors" SPDX-License-Identifier = "Apache-2.0" +[[annotations]] +path = "internal/documentation/jsdoc/docdash/**" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright (c) 2016 Clement Moron clenemt@gmail.com and the contributors to docdash" +SPDX-License-Identifier = "Apache-2.0" diff --git a/internal/documentation/.vitepress/config.ts b/internal/documentation/.vitepress/config.ts index ab2c702f67f..8102dc40517 100644 --- a/internal/documentation/.vitepress/config.ts +++ b/internal/documentation/.vitepress/config.ts @@ -5,6 +5,18 @@ import { defineConfig } from "vitepress"; // markdown import MarkdownItImplicitFigures from "markdown-it-implicit-figures"; +import fs from "node:fs"; +import path from "node:path"; + +// Create items for all api pages +const apiPages: { text: string; link: string; }[] = []; +for (const file of fs.readdirSync(path.join("docs", "api"))) { + apiPages.push({ + text: file.replaceAll("_", "/").replace(".md", ""), + link: "api/" + file + }); +} + export default defineConfig({ // Would be set in CI job via CLI arguments. For local development, it's just root. @@ -36,30 +48,30 @@ export default defineConfig({ ] ], - themeConfig: { + themeConfig: { - logo: { - light: "/images/Logo_B_RGB.png", - dark: "/images/Logo_O_RGB.png" - }, - externalLinkIcon: false, - outline: [1, 3], + logo: { + light: "/images/Logo_B_RGB.png", + dark: "/images/Logo_O_RGB.png" + }, + externalLinkIcon: false, + outline: [1, 3], - nav: nav(), + nav: nav(), - sidebar: { - "/": guide(), - }, + sidebar: { + "/": guide(), + }, - socialLinks: [ + socialLinks: [ - { icon: "github", link: "https://github.com/UI5/cli" }, - ], + { icon: "github", link: "https://github.com/UI5/cli" }, + ], - footer: { + footer: { - message: ` + message: ` © Copyright ${new Date().getFullYear()}, SAP SE and UI5 CLI Contributors
Legal Disclosure Terms of Use @@ -68,222 +80,218 @@ export default defineConfig({ `, - }, - - search: { - provider: "local", - //hotKeys: [], // disable hotkeys to avoid search while using UI5 web components input - }, - - + }, - }, + search: { + provider: "local", + //hotKeys: [], // disable hotkeys to avoid search while using UI5 web components input + }, + }, - markdown: { - // Configure the Markdown-it instance - config: (md) => { - // https://www.npmjs.com/package/markdown-it-implicit-figures - md.use(MarkdownItImplicitFigures, { - figcaption: true, - }); - }, - }, + markdown: { + // Configure the Markdown-it instance + config: (md) => { + // https://www.npmjs.com/package/markdown-it-implicit-figures + md.use(MarkdownItImplicitFigures, { + figcaption: true, + }); + }, + }, - vite: { - build: { - chunkSizeWarningLimit: 4000, // chunk for local search index dominates - } - } + vite: { + build: { + chunkSizeWarningLimit: 4000, // chunk for local search index dominates + }, + } }); function nav() { - return [ - { - - text: 'V5', - items: [ - { - text: 'V4', - link: `/../v4/`, - target: "_self" - }, - { - text: 'V3', - link: `/../v3/`, - target: "_self" - }, - { - text: 'V2', - link: `/../v2/`, - target: "_self" - } - ] - }, - ]; + return [ + { + + text: 'V5', + items: [ + { + text: 'V4', + link: `/../v4/`, + target: "_self" + }, + { + text: 'V3', + link: `/../v3/`, + target: "_self" + }, + { + text: 'V2', + link: `/../v2/`, + target: "_self" + } + ] + }, + ]; } function guide() { - return [ - - { - text: "Introduction", - collapsed: false, - - items: [ - - { - text: "Home", - link: "/", - }, - { - text: "Getting Started", - link: "/pages/GettingStarted", - }, - - ], - - }, - { - text: "UI5 CLI", - collapsed: true, - link: "/pages/CLI", - - - }, - { - text: "Configuration", - collapsed: true, - - link: "/pages/Configuration", - - }, - { - text: "Development", - collapsed: false, - items: [ - { - text: "Overview", - link: "/pages/Overview", - }, - { - text: "OpenUI5", - link: "/pages/OpenUI5", - }, - { - text: "SAPUI5", - link: "/pages/SAPUI5", - }, - { - text: "Workspace", - link: "/pages/Workspace", - }, - - ], - }, - - { - text: "Extensibility", - collapsed: false, - items: [ - { - text: "Custom Tasks", - link: "/pages/extensibility/CustomTasks", - }, - { - text: "Custom Server Middleware", - link: "/pages/extensibility/CustomServerMiddleware", - }, - { - text: "Project Shims", - link: "/pages/extensibility/ProjectShims", - }, - ], - }, - { - text: "Modules", - collapsed: false, - items: [ - { - text: "Server", - link: "/pages/Server", - }, - { - text: "Builder", - link: "/pages/Builder", - }, - { - text: "Project", - link: "/pages/Project", - }, - { - text: "File System", - link: "/pages/FileSystem", - }, - ], - }, - { - text: "FAQ", - collapsed: false, - link: "/pages/FAQ", - - }, - { - text: "Upgrade Guides", - collapsed: false, - items: [ - { - text: "Migrate to v5", - link: "/updates/migrate-v5", - }, - { - text: "Migrate to v4", - link: "/updates/migrate-v4", - }, - { - text: "Migrate to v3", - link: "/updates/migrate-v3", - }, - { - text: "Migrate to v2", - link: "/updates/migrate-v2", - }, - { - text: "Migrate to v1", - link: "/updates/migrate-v1", - }, - ], - }, - { - text: "Miscellaneous", - collapsed: false, - items: [ - { - text: "Troubleshooting", - link: "/pages/Troubleshooting", - }, - { - text: "Benchmarking", - link: "/pages/Benchmarking", - }, - { - text: "ECMAScript Support", - link: "/pages/ESSupport", - }, - { - text: "Code Analysis", - link: "/pages/CodeAnalysis", - }, - ], - }, - { - text: "API Reference", - link: "/api/index.html", - target: "_blank" - - }, - - ]; + return [ + + { + text: "Introduction", + collapsed: false, + + items: [ + + { + text: "Home", + link: "/", + }, + { + text: "Getting Started", + link: "/pages/GettingStarted", + }, + + ], + + }, + { + text: "UI5 CLI", + collapsed: true, + link: "/pages/CLI", + + + }, + { + text: "Configuration", + collapsed: true, + + link: "/pages/Configuration", + + }, + { + text: "Development", + collapsed: false, + items: [ + { + text: "Overview", + link: "/pages/Overview", + }, + { + text: "OpenUI5", + link: "/pages/OpenUI5", + }, + { + text: "SAPUI5", + link: "/pages/SAPUI5", + }, + { + text: "Workspace", + link: "/pages/Workspace", + }, + + ], + }, + + { + text: "Extensibility", + collapsed: false, + items: [ + { + text: "Custom Tasks", + link: "/pages/extensibility/CustomTasks", + }, + { + text: "Custom Server Middleware", + link: "/pages/extensibility/CustomServerMiddleware", + }, + { + text: "Project Shims", + link: "/pages/extensibility/ProjectShims", + }, + ], + }, + { + text: "Modules", + collapsed: false, + items: [ + { + text: "Server", + link: "/pages/Server", + }, + { + text: "Builder", + link: "/pages/Builder", + }, + { + text: "Project", + link: "/pages/Project", + }, + { + text: "File System", + link: "/pages/FileSystem", + }, + ], + }, + { + text: "FAQ", + collapsed: false, + link: "/pages/FAQ", + + }, + { + text: "Upgrade Guides", + collapsed: false, + items: [ + { + text: "Migrate to v5", + link: "/updates/migrate-v5", + }, + { + text: "Migrate to v4", + link: "/updates/migrate-v4", + }, + { + text: "Migrate to v3", + link: "/updates/migrate-v3", + }, + { + text: "Migrate to v2", + link: "/updates/migrate-v2", + }, + { + text: "Migrate to v1", + link: "/updates/migrate-v1", + }, + ], + }, + { + text: "Miscellaneous", + collapsed: false, + items: [ + { + text: "Troubleshooting", + link: "/pages/Troubleshooting", + }, + { + text: "Benchmarking", + link: "/pages/Benchmarking", + }, + { + text: "ECMAScript Support", + link: "/pages/ESSupport", + }, + { + text: "Code Analysis", + link: "/pages/CodeAnalysis", + }, + ], + }, + { + text: "API", + collapsed: true, + items: apiPages + }, + + ]; } diff --git a/internal/documentation/.vitepress/theme/apidocs.css b/internal/documentation/.vitepress/theme/apidocs.css new file mode 100644 index 00000000000..ea5211085d9 --- /dev/null +++ b/internal/documentation/.vitepress/theme/apidocs.css @@ -0,0 +1,19 @@ +/** + JSDoc Function Highlighting + */ +.jsdoc-object { + background-color: var(--vp-c-bg-soft); + padding: 15px; +} + +.jsdoc-object .type-signature { + color: var(--vp-c-brand-2); +} + +.jsdoc-object .signature { + color: var(--vp-c-brand-1); +} + +.jsdoc-object .signature .signature-attributes { + font-size: 11px; +} diff --git a/internal/documentation/.vitepress/theme/custom.css b/internal/documentation/.vitepress/theme/custom.css index e666cba1d66..702336af3ac 100644 --- a/internal/documentation/.vitepress/theme/custom.css +++ b/internal/documentation/.vitepress/theme/custom.css @@ -14,14 +14,14 @@ /* Water */ --ui5-water-main: #1873b4; /* denim-600 */ - --ui5-water-secondary: #53b8de; /* viking-400 */ + --ui5-water-secondary: #53b8de; /* viking-400 */ --ui5-water-background: #ffffff; /* white */ /* Tailwind CSS Color Generator ** https://uicolors.app/create */ - /* VP */ + /* VP */ /* The most solid color used mainly for colored text. */ --vp-c-brand-1: #1873b4; /* lochmara-600 */ /* The color used mainly for hover state of the button. */ @@ -32,7 +32,14 @@ /* The soft color must be semi transparent alpha channel. */ /*--vp-c-brand-soft: rgba(12, 72, 120, 0.14);*/ /* --brand-dark-blue */ --vp-c-brand-soft: rgba(3, 103, 161, 0.14); /* lochmara-700 */ + + /* Makes the sidebar ever so slighty wider, fixes claustrophobic width with api docs */ + --vp-sidebar-width: 345px; + + /* Makes the page wider for the api docs */ + --vp-layout-max-width: 80%; } + .dark { /* The most solid color used mainly for colored text. */ --vp-c-brand-1: #ff5a37; /* lochmara-600 */ @@ -44,15 +51,15 @@ /* The bg color used for main screen */ --vp-c-bg: #000000; /* The alternative bg color used in places such as "sidebar" or "code block". */ - + /* The elevated bg color. This is used at parts where it "floats", such as "dialog". */ /*--vp-c-bg-elv: red;*/ /* #1d2025;*/ - /* The bg color to slightly ditinguish some components from the page. - ** Used for things like "carbon ads" or "table". + /* The bg color to slightly ditinguish some components from the page. + ** Used for things like "carbon ads" or "table". */ --vp-c-bg-soft: #2b313a; /* 202127 */ - /* This is used for separators. This is used to divide sections within the same components, - ** such as having separator on "h2" heading. + /* This is used for separators. This is used to divide sections within the same components, + ** such as having separator on "h2" heading. */ --vp-c-divider: rgba(82,82,89,0.32); /*#2e2e32;*/ /* This is designed for borders on interactive components. @@ -86,7 +93,7 @@ } /* Default KBD - ** https://flowbite.com/docs/components/kbd/ + ** https://flowbite.com/docs/components/kbd/ */ .u-kbd { @apply px-2 py-1 text-xs font-semibold text-gray-800 bg-gray-50 border border-gray-300 rounded-lg dark:bg-gray-600 dark:text-gray-100 dark:border-gray-500; @@ -142,7 +149,7 @@ * Custom Block * -------------------------------------------------------------------------- */ .vp-doc .custom-block { - padding: 16px; + padding: 16px; } .vp-doc .custom-block.tip { @@ -301,3 +308,19 @@ li .learn-more { margin-right: 5px; vertical-align: middle; } + +/** +* Vitepress content width fix +* This expands the content to fit more stuff +* -------------------------------------------------------------------------- */ +.VPDoc.has-aside .content-container { + max-width: 100% !important; +} + +/** +* This makes the header anchor appear left next to the method names +* again + */ +.jsdoc-object + .header-anchor { + padding: 15px; +} diff --git a/internal/documentation/.vitepress/theme/index.ts b/internal/documentation/.vitepress/theme/index.ts index 82c2a17338e..5bb7828edd7 100644 --- a/internal/documentation/.vitepress/theme/index.ts +++ b/internal/documentation/.vitepress/theme/index.ts @@ -5,6 +5,7 @@ import { onMounted, watch, nextTick } from "vue"; // custom css import "./custom.css"; +import "./apidocs.css"; // global components import Badgen from "@theme/components/Badgen.vue"; @@ -25,7 +26,7 @@ export default { }, setup() { - // this function will be executed inside VitePressApp's setup hook. + // this function will be executed inside VitePressApp's setup hook. // all composition APIs are available here. const route = useRoute(); let initZoom: () => void; diff --git a/internal/documentation/jsdoc/docdash/LICENSE.md b/internal/documentation/jsdoc/docdash/LICENSE.md new file mode 100644 index 00000000000..ff66af581b1 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/LICENSE.md @@ -0,0 +1,61 @@ +# License + +Docdash is free software, licensed under the Apache License, Version 2.0 (the +"License"). Commercial and non-commercial use are permitted in compliance with +the License. + +Copyright (c) 2016 Clement Moron and the +[contributors to docdash](https://github.com/clenemt/docdash/graphs/contributors). +All rights reserved. + +You may obtain a copy of the License at: +http://www.apache.org/licenses/LICENSE-2.0 + +In addition, a copy of the License is included with this distribution. + +As stated in Section 7, "Disclaimer of Warranty," of the License: + +> Licensor provides the Work (and each Contributor provides its Contributions) +> on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either +> express or implied, including, without limitation, any warranties or +> conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any risks +> associated with Your exercise of permissions under this License. + +The source code for docdash is available at: +https://github.com/clenemt/docdash + +# Third-Party Software + +Docdash includes or depends upon the following third-party software, either in +whole or in part. Each third-party software package is provided under its own +license. + +## JSDoc 3 + +JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the +"License"). Commercial and non-commercial use are permitted in compliance with +the License. + +Copyright (c) 2011-2016 Michael Mathews and the +[contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). +All rights reserved. + +You may obtain a copy of the License at: +http://www.apache.org/licenses/LICENSE-2.0 + +In addition, a copy of the License is included with this distribution. + +As stated in Section 7, "Disclaimer of Warranty," of the License: + +> Licensor provides the Work (and each Contributor provides its Contributions) +> on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either +> express or implied, including, without limitation, any warranties or +> conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +> PARTICULAR PURPOSE. You are solely responsible for determining the +> appropriateness of using or redistributing the Work and assume any risks +> associated with Your exercise of permissions under this License. + +The source code for JSDoc 3 is available at: +https://github.com/jsdoc3/jsdoc diff --git a/internal/documentation/jsdoc/docdash/README.md b/internal/documentation/jsdoc/docdash/README.md new file mode 100644 index 00000000000..cdcc93bf990 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/README.md @@ -0,0 +1,19 @@ +# Docdash + +This folder includes files from [docdash 2.0.2](https://github.com/clenemt/docdash/tree/bee5d0789068be6a1e01ce02968b23dd021b4fb6), which is a documentation template for JSDoc. + +These files have been modified to change the output from HTML to Markdown, and to remove unnecessary features for our use case. + +## Modifications by SAP +* Output Markdown instead of HTML (Modified all templates) +* Removed navbar functionality from publish.js +* Removed static files functionality from publish.js +* Modified js links to link to GitHub +* Modified internal linking + +## Contributors + +Thanks to [lodash](https://lodash.com) and [minami](https://github.com/nijikokun/minami). + +## License +Licensed under the Apache License, version 2.0. (see [Apache-2.0](LICENSE.md)). diff --git a/internal/documentation/jsdoc/docdash/package.json b/internal/documentation/jsdoc/docdash/package.json new file mode 100644 index 00000000000..a0df0c86778 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/internal/documentation/jsdoc/docdash/publish.js b/internal/documentation/jsdoc/docdash/publish.js new file mode 100644 index 00000000000..22e75d348c8 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/publish.js @@ -0,0 +1,690 @@ +/*global env: true */ +'use strict'; + +var doop = require('jsdoc/util/doop'); +var fs = require('jsdoc/fs'); +var helper = require('jsdoc/util/templateHelper'); +var path = require('jsdoc/path'); +var taffy = require('@jsdoc/salty').taffy; +var template = require('jsdoc/template'); +var util = require('node:util'); + +var htmlsafe = helper.htmlsafe; +var resolveAuthorLinks = helper.resolveAuthorLinks; + +var data; +var view; + +// Modified to be able to link source files to GitHub +var githubSourceBaseUrl; + +var outdir = path.normalize(env.opts.destination); + +function find(spec) { + return helper.find(data, spec); +} + +function tutoriallink(tutorial) { + return helper.toTutorial(tutorial, null, { tag: 'em', classname: 'disabled', prefix: '' }); +} + +function getAncestorLinks(doclet) { + return helper.getAncestorLinks(data, doclet); +} + +// Modified to output Markdown style links +function hashToLink(doclet, hash) { + if ( !/^(#.+)/.test(hash) ) { return hash; } + + var url = helper.createLink(doclet); + + url = url.replace(/(#.+|$)/, hash); + return '[' + hash + '](' + url + ')'; +} + +function needsSignature(doclet) { + var needsSig = false; + + // function and class definitions always get a signature + if (doclet.kind === 'function' || doclet.kind === 'class') { + needsSig = true; + } + // typedefs that contain functions get a signature, too + else if (doclet.kind === 'typedef' && doclet.type && doclet.type.names && + doclet.type.names.length) { + for (var i = 0, l = doclet.type.names.length; i < l; i++) { + if (doclet.type.names[i].toLowerCase() === 'function') { + needsSig = true; + break; + } + } + } + + return needsSig; +} + +function getSignatureAttributes(item) { + var attributes = []; + + if (item.optional) { + attributes.push('opt'); + } + + if (item.nullable === true) { + attributes.push('nullable'); + } + else if (item.nullable === false) { + attributes.push('non-null'); + } + + return attributes; +} + +function updateItemName(item) { + var attributes = getSignatureAttributes(item); + var itemName = item.name || ''; + + if (item.variable) { + itemName = '…' + itemName; + } + + if (attributes && attributes.length) { + itemName = util.format( '%s%s', itemName, + attributes.join(', ') ); + } + + return itemName; +} + +function addParamAttributes(params) { + return params.filter(function(param) { + return param.name && param.name.indexOf('.') === -1; + }).map(updateItemName); +} + +function buildItemTypeStrings(item) { + var types = []; + + if (item && item.type && item.type.names) { + item.type.names.forEach(function(name) { + types.push( linkTo(name, htmlsafe(name)) ); + }); + } + + return types; +} + +function buildAttribsString(attribs) { + var attribsString = ''; + + if (attribs && attribs.length) { + attribsString = htmlsafe( util.format('(%s) ', attribs.join(', ')) ); + } + + return attribsString; +} + +function addNonParamAttributes(items) { + var types = []; + + items.forEach(function(item) { + types = types.concat( buildItemTypeStrings(item) ); + }); + + return types; +} + +function addSignatureParams(f) { + var params = f.params ? addParamAttributes(f.params) : []; + f.signature = util.format( '%s(%s)', (f.signature || ''), params.join(', ') ); +} + +function addSignatureReturns(f) { + var attribs = []; + var attribsString = ''; + var returnTypes = []; + var returnTypesString = ''; + + // jam all the return-type attributes into an array. this could create odd results (for example, + // if there are both nullable and non-nullable return types), but let's assume that most people + // who use multiple @return tags aren't using Closure Compiler type annotations, and vice-versa. + if (f.returns) { + f.returns.forEach(function(item) { + helper.getAttribs(item).forEach(function(attrib) { + if (attribs.indexOf(attrib) === -1) { + attribs.push(attrib); + } + }); + }); + + attribsString = buildAttribsString(attribs); + } + + if (f.returns) { + returnTypes = addNonParamAttributes(f.returns); + } + if (returnTypes.length) { + returnTypesString = util.format( ' → %s{%s}', attribsString, returnTypes.join('|') ); + } + + // Modified to support coloring in Vitepress + f.signature = '' + (f.signature || '') + '' + + '' + returnTypesString + ''; +} + +// Modified to support coloring in Vitepress +function addSignatureTypes(f) { + var types = f.type ? buildItemTypeStrings(f) : []; + + f.signature = (f.signature || '') + '' + + (types.length ? ' :' + types.join('|') : '') + ''; +} + +function addAttribs(f) { + var attribs = helper.getAttribs(f); + var attribsString = buildAttribsString(attribs); + + f.attribs = util.format('%s', attribsString); +} + +function shortenPaths(files, commonPrefix) { + Object.keys(files).forEach(function(file) { + files[file].shortened = files[file].resolved.replace(commonPrefix, '') + // always use forward slashes + .replace(/\\/g, '/'); + }); + + return files; +} + +function getPathFromDoclet(doclet) { + if (!doclet.meta) { + return null; + } + + return doclet.meta.path && doclet.meta.path !== 'null' ? + path.join(doclet.meta.path, doclet.meta.filename) : + doclet.meta.filename; +} + +function generate(type, title, docs, filename, resolveLinks) { + resolveLinks = resolveLinks === false ? false : true; + + var docData = { + type: type, + title: title, + docs: docs + }; + + var outpath = path.join(outdir, filename + ".md"), + html = view.render('container.tmpl', docData); + + if (resolveLinks) { + html = helper.resolveLinks(html); // turn {@link foo} into foo + } + + // Modified: replaceAll fixes pipe escaping + fs.writeFileSync(outpath, html.replaceAll("\\|", "|"), 'utf8'); +} + +// Modified: Don't write source files +function generateSourceFiles(sourceFiles, encoding) { + encoding = encoding || 'utf8'; + Object.keys(sourceFiles).forEach(function(file) { + // links are keyed to the shortened path in each doclet's `meta.shortpath` property + var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened); + helper.registerLink(sourceFiles[file].shortened, sourceOutfile); + }); +} + +/** + * Look for classes or functions with the same name as modules (which indicates that the module + * exports only that class or function), then attach the classes or functions to the `module` + * property of the appropriate module doclets. The name of each class or function is also updated + * for display purposes. This function mutates the original arrays. + * + * @private + * @param {Array.} doclets - The array of classes and functions to + * check. + * @param {Array.} modules - The array of module doclets to search. + */ +function attachModuleSymbols(doclets, modules) { + var symbols = {}; + + // build a lookup table + doclets.forEach(function(symbol) { + symbols[symbol.longname] = symbols[symbol.longname] || []; + symbols[symbol.longname].push(symbol); + }); + + return modules.map(function(module) { + if (symbols[module.longname]) { + module.modules = symbols[module.longname] + // Only show symbols that have a description. Make an exception for classes, because + // we want to show the constructor-signature heading no matter what. + .filter(function(symbol) { + return symbol.description || symbol.kind === 'class'; + }) + .map(function(symbol) { + symbol = doop(symbol); + + if (symbol.kind === 'class' || symbol.kind === 'function') { + symbol.name = symbol.name.replace('module:', '(require("') + '"))'; + } + + return symbol; + }); + } + }); +} + +/** + @param {TAFFY} taffyData See . + @param {object} opts + @param {Tutorial} tutorials + */ +exports.publish = function(taffyData, opts, tutorials) { + // Modified to fix .md file extensions in internal links + helper.fileExtension = ""; + + var docdash = env && env.conf && env.conf.docdash || {}; + data = taffyData; + + var conf = env.conf.templates || {}; + conf.default = conf.default || {}; + + var templatePath = path.normalize(opts.template); + view = new template.Template( path.join(templatePath, 'tmpl') ); + + // Modified + // Store GitHub base URL for source file links + githubSourceBaseUrl = docdash.githubSourceBaseUrl || null; + + // set up templating + view.layout = conf.default.layoutFile ? + path.getResourcePath(path.dirname(conf.default.layoutFile), + path.basename(conf.default.layoutFile) ) : + 'layout.tmpl'; + + // set up tutorials for helper + helper.setTutorials(tutorials); + + data = helper.prune(data); + + docdash.sort !== false && data.sort('longname, version, since'); + helper.addEventListeners(data); + + var sourceFiles = {}; + var sourceFilePaths = []; + data().each(function(doclet) { + doclet.attribs = ''; + + if (doclet.examples) { + doclet.examples = doclet.examples.map(function(example) { + var caption, code; + + if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) { + caption = RegExp.$1; + code = RegExp.$3; + } + + return { + caption: caption || '', + code: code || example + }; + }); + } + if (doclet.see) { + doclet.see.forEach(function(seeItem, i) { + doclet.see[i] = hashToLink(doclet, seeItem); + }); + } + + // build a list of source files + var sourcePath; + if (doclet.meta) { + sourcePath = getPathFromDoclet(doclet); + sourceFiles[sourcePath] = { + resolved: sourcePath, + shortened: null + }; + if (sourceFilePaths.indexOf(sourcePath) === -1) { + sourceFilePaths.push(sourcePath); + } + } + }); + + /// update outdir if necessary, then create outdir + var packageInfo = ( find({kind: 'package'}) || [] ) [0]; + if (packageInfo && packageInfo.name) { + outdir = path.join( outdir, packageInfo.name, (packageInfo.version || '') ); + } + fs.mkPath(outdir); + + // Modified: Static files are not needed anymore + + if (sourceFilePaths.length) { + sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) ); + } + data().each(function(doclet) { + var url = helper.createLink(doclet); + helper.registerLink(doclet.longname, url); + + // add a shortened version of the full path + var docletPath; + if (doclet.meta) { + docletPath = getPathFromDoclet(doclet); + docletPath = sourceFiles[docletPath].shortened; + if (docletPath) { + doclet.meta.shortpath = docletPath; + } + } + }); + + data().each(function(doclet) { + var url = helper.longnameToUrl[doclet.longname]; + + if (url.indexOf('#') > -1) { + doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop(); + } + else { + doclet.id = doclet.name; + } + + if ( needsSignature(doclet) ) { + addSignatureParams(doclet); + addSignatureReturns(doclet); + addAttribs(doclet); + } + }); + + // do this after the urls have all been generated + data().each(function(doclet) { + doclet.ancestors = getAncestorLinks(doclet); + + if (doclet.kind === 'member') { + addSignatureTypes(doclet); + addAttribs(doclet); + } + + if (doclet.kind === 'constant') { + addSignatureTypes(doclet); + addAttribs(doclet); + doclet.kind = 'member'; + } + }); + + var members = helper.getMembers(data); + members.tutorials = tutorials.children; + + // output pretty-printed source files by default + var outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false + ? true + : false; + + // add template helpers + view.find = find; + view.linkto = linkTo; + view.resolveAuthorLinks = resolveAuthorLinks; + view.tutoriallink = tutoriallink; + view.htmlsafe = htmlsafe; + view.outputSourceFiles = outputSourceFiles; + + // once for all + // Modified: Not needed anymore + //view.nav = buildNav(members); + attachModuleSymbols( find({ longname: {left: 'module:'} }), members.modules ); + + + // generate the pretty-printed source files first so other pages can link to them + if (outputSourceFiles) { + generateSourceFiles(sourceFiles, opts.encoding); + } + + // set up the lists that we'll use to generate pages + var classes = taffy(members.classes); + var modules = taffy(members.modules); + var namespaces = taffy(members.namespaces); + var mixins = taffy(members.mixins); + var externals = taffy(members.externals); + var interfaces = taffy(members.interfaces); + + Object.keys(helper.longnameToUrl).forEach(function(longname) { + var myModules = helper.find(modules, {longname: longname}); + if (myModules.length) { + generate('Module', myModules[0].name, myModules, helper.longnameToUrl[longname]); + } + + var myClasses = helper.find(classes, {longname: longname}); + if (myClasses.length) { + generate('Class', myClasses[0].name, myClasses, helper.longnameToUrl[longname]); + } + + var myNamespaces = helper.find(namespaces, {longname: longname}); + if (myNamespaces.length) { + generate('Namespace', myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]); + } + + var myMixins = helper.find(mixins, {longname: longname}); + if (myMixins.length) { + generate('Mixin', myMixins[0].name, myMixins, helper.longnameToUrl[longname]); + } + + var myExternals = helper.find(externals, {longname: longname}); + if (myExternals.length) { + generate('External', myExternals[0].name, myExternals, helper.longnameToUrl[longname]); + } + + var myInterfaces = helper.find(interfaces, {longname: longname}); + if (myInterfaces.length) { + generate('Interface', myInterfaces[0].name, myInterfaces, helper.longnameToUrl[longname]); + } + }); + + // TODO: move the tutorial functions to templateHelper.js + function generateTutorial(title, tutorial, filename) { + var tutorialData = { + title: title, + header: tutorial.title, + content: tutorial.parse(), + children: tutorial.children + }; + + var tutorialPath = path.join(outdir, filename); + var html = view.render('tutorial.tmpl', tutorialData); + + // yes, you can use {@link} in tutorials too! + html = helper.resolveLinks(html); // turn {@link foo} into foo + fs.writeFileSync(tutorialPath, html, 'utf8'); + } + + // tutorials can have only one parent so there is no risk for loops + function saveChildren(node) { + node.children.forEach(function(child) { + generateTutorial(child.title, child, helper.tutorialToUrl(child.name)); + saveChildren(child); + }); + } + + saveChildren(tutorials); +}; + +// Taken from templateHelper.js in jsdoc/util + +function linkTo(longname, linkText, cssClass, fragmentId) { + const classString = cssClass ? util.format(' class="%s"', cssClass) : ''; + let fileUrl; + let fragmentString = fragmentId ? `#${fragmentId}` : ''; + let stripped; + let text; + + // handle cases like: + // @see + // @see http://example.org + stripped = longname ? longname.replace(/^<|>$/g, '') : ''; + const hasUrlPrefix = /^(http|ftp)s?:\/\//.test(stripped); + + if (hasUrlPrefix) { + fileUrl = stripped; + text = linkText || stripped; + // Add target and rel attributes for external links + return util.format('%s', + encodeURI(fileUrl + fragmentString), classString, text); + } + // handle complex type expressions that may require multiple links + // (but skip anything that looks like an inline tag or HTML tag) + else if (longname && isComplexTypeExpression(longname) && + !/\{@.+\}/.test(longname) && !/^<[\s\S]+>/.test(longname)) { + // Parse complex types and create links for nested types + return linkComplexType(longname, linkText, cssClass); + } + else { + fileUrl = helper.longnameToUrl[longname] || ''; + text = linkText || longname; + + // If the URL contains a fragment (hash), extract it + if (fileUrl && fileUrl.indexOf('#') > -1) { + const parts = fileUrl.split('#'); + fileUrl = parts[0]; + // Only use the URL's fragment if no explicit fragmentId was provided + if (!fragmentId) { + fragmentString = '#' + parts[1]; + } + } + + // Convert source file links to GitHub URLs if configured + if (fileUrl && githubSourceBaseUrl && (fileUrl.endsWith('.js.md') || longname.endsWith('.js'))) { + fileUrl = convertSourceLinkToGitHub(fileUrl, longname); + // GitHub links should open in new tab + return util.format('%s', + encodeURI(fileUrl + fragmentString), classString, text); + } + // Remove .md extension from internal links for VitePress compatibility + // Handle both cases: with and without fragment identifiers + else if (fileUrl) { + fileUrl = fileUrl.replace(/\.md$/, ''); + } + } + + text = text || longname; + + if (!fileUrl) { + return text; + } + else { + return util.format('%s', encodeURI(fileUrl + fragmentString), + classString, text); + } +} + +function convertSourceLinkToGitHub(fileUrl, longname) { + if (!githubSourceBaseUrl) { + return fileUrl; + } + + // Look up the original source path from the reverse mapping + let sourcePath = helper.longnameToUrl.urlToLongname || {}; + + // Try to find the original path from the URL + for (let originalPath in helper.longnameToUrl) { + if (helper.longnameToUrl[originalPath] === fileUrl) { + sourcePath = originalPath; + break; + } + } + + // If we found a valid source path, convert it to GitHub URL + if (typeof sourcePath === 'string' && sourcePath.endsWith('.js')) { + // Clean up the path - remove any leading slashes or backslashes + sourcePath = sourcePath.replace(/^[\/\\]+/, ''); + + // Return the GitHub URL + return `${githubSourceBaseUrl}/${sourcePath}`; + } + + // Fallback: if no mapping found, return original fileUrl + return fileUrl; +} + +function isComplexTypeExpression(expr) { + // record types, type unions, and type applications all count as "complex" + return /^{.+}$/.test(expr) || /^.+\|.+$/.test(expr) || /^.+<.+>$/.test(expr); +} + +function linkComplexType(longname, linkText, cssClass) { + const classString = cssClass ? util.format(' class="%s"', cssClass) : ''; + + // Handle type unions (e.g., "string | number") + if (/^.+\|.+$/.test(longname) && !/<.+>/.test(longname)) { + const types = longname.split('|').map(t => t.trim()); + return types.map(type => { + let url = helper.longnameToUrl[type]; + if (url) { + // Remove .md extension for VitePress compatibility + url = url.replace(/\.md$/, ''); + return util.format('%s', encodeURI(url), classString, htmlsafe(type)); + } + return htmlsafe(type); + }).join(' | '); + } + + // Handle generic types (e.g., "Array.", "Promise.<@ui5/fs/Resource>") + if (/<.+>/.test(longname)) { + return linkGenericType(longname, classString); + } + + // Handle record types (e.g., "{a: string, b: number}") + if (/^{.+}$/.test(longname)) { + return htmlsafe(longname); + } + + // Fallback + return linkText || htmlsafe(longname); +} + +function linkGenericType(type, classString) { + // Match patterns like "Promise." or "Array." or "Promise.>" + const match = type.match(/^([^<]+)<(.+)>$/); + + if (!match) { + return htmlsafe(type); + } + + const baseType = match[1]; + const innerType = match[2]; + + // Strip any trailing dots from baseType for display (handles "Promise." cases) + const displayBase = String(baseType).replace(/\.+$/g, '').trim(); + + // Link the base type if it has a URL. Try both the original baseType and the stripped variant. + let result = ''; + let baseUrl = helper.longnameToUrl[baseType] || helper.longnameToUrl[displayBase]; + if (baseUrl) { + // Remove .md extension for VitePress compatibility + baseUrl = baseUrl.replace(/\.md$/, ''); + result = util.format('%s', encodeURI(baseUrl), classString, htmlsafe(displayBase)); + } else { + result = htmlsafe(displayBase); + } + + // Always use angle brackets without an extra dot: Base + result += '<'; + + // Recursively handle the inner type + if (isComplexTypeExpression(innerType)) { + result += linkComplexType(innerType, null, classString.replace(' class="', '').replace('"', '')); + } else { + let innerUrl = helper.longnameToUrl[innerType]; + if (innerUrl) { + // Remove .md extension for VitePress compatibility + innerUrl = innerUrl.replace(/\.md$/, ''); + result += util.format('%s', encodeURI(innerUrl), classString, htmlsafe(innerType)); + } else { + result += htmlsafe(innerType); + } + } + + result += '>'; + + return result; +} diff --git a/internal/documentation/jsdoc/docdash/tmpl/augments.tmpl b/internal/documentation/jsdoc/docdash/tmpl/augments.tmpl new file mode 100644 index 00000000000..053f971a107 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/augments.tmpl @@ -0,0 +1,10 @@ + + + + +- + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/container.tmpl b/internal/documentation/jsdoc/docdash/tmpl/container.tmpl new file mode 100644 index 00000000000..420832f2d07 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/container.tmpl @@ -0,0 +1,186 @@ + + + + + + + + + + +## Namespace + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +### Example 1? 's':'' ?> + + + + + + + +### Extends + + + + + +### Requires + + +- + + + + +### Classes + + +- + + + + + +### Interfaces + + +- + + + + + +### Mixins + + +- + + + + + +### Namespaces + + +- + + + + + +### Members + + + + + + + +### Methods + + + + + + + +### Type Definitions + + + + + + + + + +### Events + + + + + + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/details.tmpl b/internal/documentation/jsdoc/docdash/tmpl/details.tmpl new file mode 100644 index 00000000000..276c0fbb310 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/details.tmpl @@ -0,0 +1,133 @@ + + + +**Description:** + + + + +**Source:** , + + + + +**Version:** + + + + +**Since:** + + + + +**Inherited From:** + + + + +**Overrides:** + + + + +**Implementations:** + +- + + + + + +**Implements:** + +- + + + + + +**Mixes In:** + +- + + + + + +**Deprecated:** + + + + +**Author:** + +- + + + + + +**Copyright:** + + + + +**License:** + + + + +**Default Value:** + + + + + +**Tutorials:** + +- + + + + + +**See:** + +- + + + + + +**To Do:** + +- + + + + + + +##### Properties: + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/example.tmpl b/internal/documentation/jsdoc/docdash/tmpl/example.tmpl new file mode 100644 index 00000000000..031a1ced242 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/example.tmpl @@ -0,0 +1,4 @@ + +``` + +``` diff --git a/internal/documentation/jsdoc/docdash/tmpl/examples.tmpl b/internal/documentation/jsdoc/docdash/tmpl/examples.tmpl new file mode 100644 index 00000000000..a4fdceea1f7 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/examples.tmpl @@ -0,0 +1,17 @@ + +** + + +``` + +``` + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/exceptions.tmpl b/internal/documentation/jsdoc/docdash/tmpl/exceptions.tmpl new file mode 100644 index 00000000000..cc1dc7af193 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/exceptions.tmpl @@ -0,0 +1,14 @@ + + + + +**Type:** + + + + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/layout.tmpl b/internal/documentation/jsdoc/docdash/tmpl/layout.tmpl new file mode 100644 index 00000000000..7ae96f8c0b2 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/layout.tmpl @@ -0,0 +1,10 @@ +--- +prev: false +next: false +--- + + +# + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/mainpage.tmpl b/internal/documentation/jsdoc/docdash/tmpl/mainpage.tmpl new file mode 100644 index 00000000000..ac73961fa2a --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/mainpage.tmpl @@ -0,0 +1,12 @@ + + + +# + + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/members.tmpl b/internal/documentation/jsdoc/docdash/tmpl/members.tmpl new file mode 100644 index 00000000000..fc3169c2b2d --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/members.tmpl @@ -0,0 +1,35 @@ +, if so don't add another one +var hasClosingDiv = signature.includes(''); +?> +####
/, '').replace(/<\/div>$/, '') + name + signature + (hasClosingDiv ? '' : '
') ?> + + + + + + + + + + + + +##### Type: +- + + + +##### Fires: + +- + + + + +##### Example 1? 's':'' ?>: + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/method.tmpl b/internal/documentation/jsdoc/docdash/tmpl/method.tmpl new file mode 100644 index 00000000000..7434ca22e89 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/method.tmpl @@ -0,0 +1,128 @@ + + + +## Constructor + + +####
/, '') ?> + + + + + + + + + +##### Extends: + + + + +##### Type: +- + + + +##### This: +- + + + +##### Example 1? 's':'' ?>: + + + + +##### Parameters: + + + + +##### Requires: + +- + + + + +##### Fires: + +- + + + + +##### Listens to Events: + +- + + + + +##### Listeners of This Event: + +- + + + + +##### Modifies: + 1) { ?> + +- + + + + + + +##### Throws: + 1) { ?> + +- + + + + + + +##### Returns: + 1) { ?> + +- + + + + + + +##### Yields: + 1) { ?> + +- + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/modifies.tmpl b/internal/documentation/jsdoc/docdash/tmpl/modifies.tmpl new file mode 100644 index 00000000000..4bba92bb498 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/modifies.tmpl @@ -0,0 +1,7 @@ + + + +**Type:** + diff --git a/internal/documentation/jsdoc/docdash/tmpl/namespace.tmpl b/internal/documentation/jsdoc/docdash/tmpl/namespace.tmpl new file mode 100644 index 00000000000..348a59d0a53 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/namespace.tmpl @@ -0,0 +1,129 @@ + + + + +## Constructor + + +#### + + + + + + + + + +##### Extends: + + + + +##### Type: +- + + + +##### This: +- + + + +##### Example 1? 's':'' ?>: + + + + +##### Parameters: + + + + +##### Requires: + +- + + + + +##### Fires: + +- + + + + +##### Listens to Events: + +- + + + + +##### Listeners of This Event: + +- + + + + +##### Modifies: + 1) { ?> + +- + + + + + + +##### Throws: + 1) { ?> + +- + + + + + + +##### Returns: + 1) { ?> + +- + + + + + + +##### Yields: + 1) { ?> + +- + + + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/params.tmpl b/internal/documentation/jsdoc/docdash/tmpl/params.tmpl new file mode 100644 index 00000000000..97f0e3415ec --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/params.tmpl @@ -0,0 +1,67 @@ + +| Name | Type | Attributes | Default | Description | +| --- | --- | --- | --- | --- | +| `` | | optional, nullable, repeatable | `` | ').replaceAll("```js", "
").replaceAll("```", "
") ?>
*Properties:* + diff --git a/internal/documentation/jsdoc/docdash/tmpl/properties.tmpl b/internal/documentation/jsdoc/docdash/tmpl/properties.tmpl new file mode 100644 index 00000000000..3830cbdad29 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/properties.tmpl @@ -0,0 +1,39 @@ +
NameTypeAttributesDefaultDescription
optionalnullable").replaceAll("```js", "
").replaceAll("```", "
") ?>
Properties
diff --git a/internal/documentation/jsdoc/docdash/tmpl/returns.tmpl b/internal/documentation/jsdoc/docdash/tmpl/returns.tmpl new file mode 100644 index 00000000000..bf3e18fc412 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/returns.tmpl @@ -0,0 +1,11 @@ + + + + + + +**Type:** + diff --git a/internal/documentation/jsdoc/docdash/tmpl/source.tmpl b/internal/documentation/jsdoc/docdash/tmpl/source.tmpl new file mode 100644 index 00000000000..38334dc60e2 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/source.tmpl @@ -0,0 +1,6 @@ + +``` + +``` diff --git a/internal/documentation/jsdoc/docdash/tmpl/tutorial.tmpl b/internal/documentation/jsdoc/docdash/tmpl/tutorial.tmpl new file mode 100644 index 00000000000..40a160efc8f --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/tutorial.tmpl @@ -0,0 +1,13 @@ + 0) { ?> +## Child Tutorials + + +- + + + +## + + diff --git a/internal/documentation/jsdoc/docdash/tmpl/type.tmpl b/internal/documentation/jsdoc/docdash/tmpl/type.tmpl new file mode 100644 index 00000000000..33434d33aa4 --- /dev/null +++ b/internal/documentation/jsdoc/docdash/tmpl/type.tmpl @@ -0,0 +1,23 @@ +", ""); + var longname = name.replace("Array.<","").replace(">", ""); + } + } + } else { + var resolvedName = name; + } + var link = self.linkto(name, self.htmlsafe(resolvedName)); + if (longname) { + link = link.replace(longname, resolvedName); + } + ?> \| \ No newline at end of file diff --git a/internal/documentation/jsdoc/jsdoc-workspace.json b/internal/documentation/jsdoc/jsdoc-workspace.json index 92340614658..f0eccb0489d 100644 --- a/internal/documentation/jsdoc/jsdoc-workspace.json +++ b/internal/documentation/jsdoc/jsdoc-workspace.json @@ -18,7 +18,7 @@ ], "opts": { "encoding": "utf8", - "destination": "dist/api/", + "destination": "docs/api/", "recurse": true, "verbose": true, "access": "public" @@ -27,11 +27,7 @@ "cleverLinks": false, "monospaceLinks": false, "default": { - "useLongnameInNav": true, - "layoutFile": "jsdoc/templates/layout.tmpl", - "staticFiles": { - "include": ["jsdoc/templates/custom.css"] - } + "useLongnameInNav": true } }, "openGraph": { @@ -66,6 +62,7 @@ "class": "menu-item", "id": "github_link" } - } + }, + "githubSourceBaseUrl": "https://github.com/UI5/cli/blob/main/packages" } } diff --git a/internal/documentation/jsdoc/jsdoc.json b/internal/documentation/jsdoc/jsdoc.json index ab5fdc7dfee..3a8af30993d 100644 --- a/internal/documentation/jsdoc/jsdoc.json +++ b/internal/documentation/jsdoc/jsdoc.json @@ -17,7 +17,7 @@ ], "opts": { "encoding": "utf8", - "destination": "dist/api/", + "destination": "docs/api/", "recurse": true, "verbose": true, "access": "public" @@ -26,11 +26,7 @@ "cleverLinks": false, "monospaceLinks": false, "default": { - "useLongnameInNav": true, - "layoutFile": "jsdoc/templates/layout.tmpl", - "staticFiles": { - "include": ["jsdoc/templates/custom.css"] - } + "useLongnameInNav": true } }, "openGraph": { @@ -65,6 +61,7 @@ "class": "menu-item", "id": "github_link" } - } + }, + "githubSourceBaseUrl": "https://github.com/UI5/cli/blob/main/packages/" } } diff --git a/internal/documentation/jsdoc/templates/custom.css b/internal/documentation/jsdoc/templates/custom.css deleted file mode 100644 index c38efbd9f2f..00000000000 --- a/internal/documentation/jsdoc/templates/custom.css +++ /dev/null @@ -1,13 +0,0 @@ -footer { - display: flex; -} -.ui5-footer-item { - flex-grow: 0; - margin: auto 0.6rem; - padding: 0.4rem 0; - white-space: nowrap; -} -.ui5-footer-item-growing { - flex-grow: 1; - white-space: normal; -} diff --git a/internal/documentation/jsdoc/templates/layout.tmpl b/internal/documentation/jsdoc/templates/layout.tmpl deleted file mode 100644 index 63bad429df7..00000000000 --- a/internal/documentation/jsdoc/templates/layout.tmpl +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - <?js= title ?> - <?js= ((env.conf.docdash.meta && env.conf.docdash.meta.title) || "Documentation") ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

- - - - - -
- - - -
- -
- - - - - - - - - - - - - - - - - - - - - diff --git a/internal/documentation/package.json b/internal/documentation/package.json index dd1b6c824f4..94f350fab3c 100644 --- a/internal/documentation/package.json +++ b/internal/documentation/package.json @@ -30,8 +30,8 @@ "build:assets": "sh -c 'DEST_DIR=${1:-./dist}; cp -r ./docs/images \"$DEST_DIR/images\"' --", "preview": "vitepress preview --port 8080", "jsdoc": "npm run jsdoc-generate && open-cli dist/api/index.html", - "jsdoc-generate": "jsdoc -c jsdoc/jsdoc-workspace.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)", - "jsdoc-generate-gh-pages": "jsdoc -c jsdoc/jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)", + "jsdoc-generate": "jsdoc -c jsdoc/jsdoc-workspace.json -t jsdoc/docdash ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)", + "jsdoc-generate-gh-pages": "jsdoc -c jsdoc/jsdoc.json -t jsdoc/docdash ./ || (echo 'Error during JSDoc generation! Check log.' && exit 1)", "generate-cli-doc": "node ./scripts/generateCliDoc.js", "schema-generate": "node ./scripts/buildSchema.js", "schema-generate-gh-pages": "node ./scripts/buildSchema.js gh-pages", @@ -50,7 +50,7 @@ }, "devDependencies": { "@apidevtools/json-schema-ref-parser": "^14.2.1", - "docdash": "^2.0.2", + "@jsdoc/salty": "^0.2.9", "handlebars": "^4.7.8", "jsdoc": "^4.0.4", "open-cli": "^8.0.0", diff --git a/package-lock.json b/package-lock.json index 923f496d358..d13e3a6499f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ }, "devDependencies": { "@apidevtools/json-schema-ref-parser": "^14.2.1", - "docdash": "^2.0.2", + "@jsdoc/salty": "^0.2.9", "handlebars": "^4.7.8", "jsdoc": "^4.0.4", "open-cli": "^8.0.0", @@ -6510,6 +6510,30 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/cheerio/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -8256,16 +8280,6 @@ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "license": "MIT" }, - "node_modules/docdash": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/docdash/-/docdash-2.0.2.tgz", - "integrity": "sha512-3SDDheh9ddrwjzf6dPFe1a16M6ftstqTNjik2+1fx46l24H9dD2osT2q9y+nBEC1wWz4GIqA48JmicOLQ0R8xA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@jsdoc/salty": "^0.2.1" - } - }, "node_modules/docopt": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", @@ -8454,6 +8468,16 @@ "node": ">= 0.8" } }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, "node_modules/encoding-sniffer": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", @@ -8479,6 +8503,19 @@ "node": ">=0.10.0" } }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/enhance-visitors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/enhance-visitors/-/enhance-visitors-1.0.0.tgz", @@ -15510,26 +15547,38 @@ "dev": true, "license": "MIT" }, - "node_modules/parse5": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", - "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", "license": "MIT", "dependencies": { - "entities": "^6.0.0" + "domhandler": "^5.0.3", + "parse5": "^7.0.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", "license": "MIT", "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" + "entities": "^6.0.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -15547,7 +15596,7 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5/node_modules/entities": { + "node_modules/parse5-parser-stream/node_modules/entities": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", @@ -15559,6 +15608,18 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/parse5-parser-stream/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", diff --git a/packages/builder/lib/processors/bundlers/moduleBundler.js b/packages/builder/lib/processors/bundlers/moduleBundler.js index 843904d6cbd..e4f026e63cc 100644 --- a/packages/builder/lib/processors/bundlers/moduleBundler.js +++ b/packages/builder/lib/processors/bundlers/moduleBundler.js @@ -58,7 +58,7 @@ const log = getLogger("builder:processors:bundlers:moduleBundler"); * Excludes should be marked with a leading exclamation mark '!'. The order of filters is relevant; a later * exclusion overrides an earlier inclusion, and vice versa. * - * List of modules as glob patterns that should be in- or excluded + * Example: * * ```js * // Includes everything from "some/path/to/module/", diff --git a/packages/builder/lib/tasks/generateResourcesJson.js b/packages/builder/lib/tasks/generateResourcesJson.js index acd0f747530..aa612455252 100644 --- a/packages/builder/lib/tasks/generateResourcesJson.js +++ b/packages/builder/lib/tasks/generateResourcesJson.js @@ -55,7 +55,7 @@ function getCreatorOptions(projectName) { * Therefore it is also not supported in combination with self-contained build. *

* - * sample resources.json + * sample resources.json * * ```js * const resourcesJson = {