@forsakringskassan/vite-lib-config 4.0.3 → 4.1.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/api-extractor.js +32 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/vite.config.cjs +2727 -3553
- package/dist/vite.config.mjs +829 -1642
- package/package.json +4 -4
package/dist/api-extractor.js
CHANGED
|
@@ -9405,6 +9405,32 @@ async function patchAugmentations(config) {
|
|
|
9405
9405
|
}
|
|
9406
9406
|
console.groupEnd();
|
|
9407
9407
|
}
|
|
9408
|
+
async function patchDeclareVarVls(declarationDir) {
|
|
9409
|
+
console.group(
|
|
9410
|
+
`Patching vue-tsc dts files in "${declarationDir}" (microsoft/rushstack#5146)`
|
|
9411
|
+
);
|
|
9412
|
+
let numPatchedFiles = 0;
|
|
9413
|
+
const filenames = await glob("**/*.vue.d.ts", { cwd: declarationDir });
|
|
9414
|
+
const promises = filenames.map(async (filename) => {
|
|
9415
|
+
const filePath = import_node_path4.default.join(declarationDir, filename);
|
|
9416
|
+
const content = await import_promises2.default.readFile(filePath, "utf-8");
|
|
9417
|
+
const updated = content.replace(
|
|
9418
|
+
/declare var (__VLS_\d+)/,
|
|
9419
|
+
"declare const $1"
|
|
9420
|
+
);
|
|
9421
|
+
if (content !== updated) {
|
|
9422
|
+
await import_promises2.default.writeFile(filePath, updated, "utf-8");
|
|
9423
|
+
numPatchedFiles++;
|
|
9424
|
+
console.log(filename);
|
|
9425
|
+
}
|
|
9426
|
+
});
|
|
9427
|
+
await Promise.all(promises);
|
|
9428
|
+
console.groupEnd();
|
|
9429
|
+
console.log(
|
|
9430
|
+
`${numPatchedFiles} file${numPatchedFiles === 1 ? "" : "s"} patched
|
|
9431
|
+
`
|
|
9432
|
+
);
|
|
9433
|
+
}
|
|
9408
9434
|
async function run(argv) {
|
|
9409
9435
|
const flags = argv.filter((it) => it.startsWith("--"));
|
|
9410
9436
|
const positional = argv.filter((it) => !it.startsWith("--"));
|
|
@@ -9414,6 +9440,9 @@ async function run(argv) {
|
|
|
9414
9440
|
--help Show this help.
|
|
9415
9441
|
--patch-augmentations Post-process generated dts file to include module
|
|
9416
9442
|
augmentations.
|
|
9443
|
+
--patch-declare-var-vls Pre-process dts files to workaround
|
|
9444
|
+
vue-tsc/api-extractor incompatibility (see
|
|
9445
|
+
microsoft/rushstack#5146)
|
|
9417
9446
|
|
|
9418
9447
|
By default \`api-extractor.json\` is used as configuration file but you can
|
|
9419
9448
|
specify custom configuration filenames as the positional argument to this tool,
|
|
@@ -9434,6 +9463,9 @@ only.
|
|
|
9434
9463
|
}
|
|
9435
9464
|
console.groupEnd();
|
|
9436
9465
|
console.log();
|
|
9466
|
+
if (flags.includes("--patch-declare-var-vls")) {
|
|
9467
|
+
await patchDeclareVarVls("temp/types");
|
|
9468
|
+
}
|
|
9437
9469
|
for (const filePath of configFiles) {
|
|
9438
9470
|
const config = import_api_extractor.ExtractorConfig.loadFileAndPrepare(filePath);
|
|
9439
9471
|
const result = import_api_extractor.Extractor.invoke(config, {
|