mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
27 lines
662 B
JavaScript
27 lines
662 B
JavaScript
const fs = require("node:fs");
|
|
const glob = require("glob");
|
|
const { sveld } = require("sveld");
|
|
const pkg = require("../package.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",
|
|
},
|
|
});
|
|
|
|
glob.sync("./src/**/*.d.ts").forEach((file) => {
|
|
console.log("Copying", file, " to types/");
|
|
fs.copyFileSync(file, file.replace(/src/, "types"));
|
|
});
|