@forsakringskassan/docs-generator 3.12.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2049,6 +2049,7 @@ function parseFile$2(filePath, basePath, content) {
|
|
|
2049
2049
|
path: ["", "."].includes(urlpath) ? "." : `./${normalizePath(urlpath)}`,
|
|
2050
2050
|
name: filename,
|
|
2051
2051
|
fullPath: normalizePath(filePath),
|
|
2052
|
+
/* eslint-disable-next-line unicorn/prefer-logical-operator-over-ternary -- false positive? */
|
|
2052
2053
|
outputName: include ? `${filename}.html` : false
|
|
2053
2054
|
}
|
|
2054
2055
|
};
|
|
@@ -2983,9 +2984,10 @@ async function compileScript(options) {
|
|
|
2983
2984
|
fs: fs$1 = fs
|
|
2984
2985
|
} = options;
|
|
2985
2986
|
const iconLib = process.env.DOCS_ICON_LIB ?? "@fkui/icon-lib-default";
|
|
2987
|
+
const sanitizedName = name.replaceAll(/[^a-z0-9-]+/gi, "_");
|
|
2986
2988
|
try {
|
|
2987
2989
|
const entryPoints = [src instanceof URL ? fileURLToPath(src) : src];
|
|
2988
|
-
const outfile = path__default.join("temp", `asset-${
|
|
2990
|
+
const outfile = path__default.join("temp", `asset-${sanitizedName}.js`);
|
|
2989
2991
|
const external = [...assets, ...vendor.map(toExternalVendor)];
|
|
2990
2992
|
const format = buildOptions.format ?? "esm";
|
|
2991
2993
|
await esbuild({
|
|
@@ -3005,7 +3007,7 @@ async function compileScript(options) {
|
|
|
3005
3007
|
const content = await fs$1.readFile(outfile, "utf8");
|
|
3006
3008
|
const fingerprint = getFingerprint(content);
|
|
3007
3009
|
const integrity = getIntegrity(content);
|
|
3008
|
-
const filename = `${outputName}.js`.replaceAll("[name]", () =>
|
|
3010
|
+
const filename = `${outputName}.js`.replaceAll("[name]", () => sanitizedName).replaceAll("[hash]", () => fingerprint);
|
|
3009
3011
|
const dst = path__default.join(outputFolder, filename);
|
|
3010
3012
|
const publicPath = path__default.posix.join(
|
|
3011
3013
|
path__default.posix.relative(rootDir, outputFolder),
|