Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INTERNAL] JSDoc: Fix reference to jsdoc template #1072

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
},
"source": {
"include": ["README.md"],
"exclude": ["lib/lbt/utils/JSTokenizer.js"],
"exclude": [
"lib/lbt/utils/JSTokenizer.js",
"lib/processors/jsdoc/lib/ui5/plugin.js",
"lib/processors/jsdoc/lib/ui5/template/publish.js",
"lib/processors/jsdoc/lib/ui5/template/utils/versionUtil.js"
],
"includePattern": ".+\\.js$",
"excludePattern": "(node_modules(\\\\|/))"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/processors/jsdoc/apiIndexGenerator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createResource} from "@ui5/fs/resourceFactory";
import createIndex from "./lib/createIndexFiles.cjs";
import createIndex from "./lib/createIndexFiles.js";

/**
* @public
Expand Down
7 changes: 2 additions & 5 deletions lib/processors/jsdoc/jsdocGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ async function generateJsdocConfig({targetPath, tmpPath, namespace, projectName,

// Resolve path to this script to get the path to the JSDoc extensions folder
const jsdocPath = path.normalize(import.meta.dirname);
const pluginPath = path.join(jsdocPath, "lib", "ui5", "plugin.cjs").replace(backslashRegex, "\\\\");
// Using export via package.json to allow loading the CJS template.
// jsdoc appends /publish to the provided path but doesn't allow to
// add the .cjs extension, so loading won't work otherwise.
const templatePath = "@ui5/builder/internal/jsdoc/template";
const pluginPath = path.join(jsdocPath, "lib", "ui5", "plugin.js").replace(backslashRegex, "\\\\");
const templatePath = path.join(jsdocPath, "lib", "ui5", "template").replace(backslashRegex, "\\\\");
const destinationPath = path.normalize(tmpPath).replace(backslashRegex, "\\\\");
const jsapiFilePath = path.join(targetPath, "libraries", projectName + ".js").replace(backslashRegex, "\\\\");
const apiJsonFolderPath = path.join(tmpPath, "dependency-apis").replace(backslashRegex, "\\\\");
Expand Down
3 changes: 3 additions & 0 deletions lib/processors/jsdoc/lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const info = logger.info.bind(logger);
const warning = logger.warn.bind(logger);
const error = logger.error.bind(logger);

const {extractVersion, extractSince} = require("./utils/versionUtil.cjs");
const {extractVersion, extractSince} = require("./utils/versionUtil");

/* errors that might fail the build in future */
function future(msg) {
Expand Down
2 changes: 1 addition & 1 deletion lib/processors/jsdoc/sdkTransformer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createResource} from "@ui5/fs/resourceFactory";
import transformer from "./lib/transformApiJson.cjs";
import transformer from "./lib/transformApiJson.js";

/**
* @public
Expand Down
Loading