mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 09:51:36 +00:00
28 lines
693 B
JavaScript
28 lines
693 B
JavaScript
// @ts-check
|
|
import fs from "node:fs";
|
|
import { globSync } from "tinyglobby";
|
|
import { sveld } from "sveld";
|
|
import pkg from "../package.json" with { type: "json" };
|
|
|
|
sveld({
|
|
glob: true,
|
|
markdown: true,
|
|
markdownOptions: {
|
|
onAppend: (type, document, components) => {
|
|
if (type === "h1")
|
|
document.append(
|
|
"quote",
|
|
`${components.size} components exported from ${pkg.name}@${pkg.version}.`,
|
|
);
|
|
},
|
|
},
|
|
json: true,
|
|
jsonOptions: {
|
|
outFile: "docs/src/COMPONENT_API.json",
|
|
},
|
|
});
|
|
|
|
for (const file of globSync(["./src/**/*.d.ts"])) {
|
|
console.log("Copying", file, " to types/");
|
|
fs.copyFileSync(file, file.replace(/src/, "types"));
|
|
}
|