Code more like cli

This commit is contained in:
Wendelin 2025-05-14 17:19:41 +02:00
parent fe37f8fad5
commit b2ec3c8c37
No known key found for this signature in database

View File

@ -17,24 +17,24 @@ import "./translations.js";
import "./rspack.js"; import "./rspack.js";
gulp.task("generate-component-docs", async function generateComponentDocs() { gulp.task("generate-component-docs", async function generateComponentDocs() {
// npx @custom-elements-manifest/analyzer analyze --litelement --globs "src/components/ha-alert.ts --dev"
const filePaths = ["src/components/ha-alert.ts"]; const filePaths = ["src/components/ha-alert.ts"];
const modules = await Promise.all( const modules = await Promise.all(
filePaths.map(async (file) => { filePaths.map(async (file) => {
const filePath = path.resolve(file); const filePath = path.resolve(file);
return ts.createSourceFile( console.log(`Reading ${file} -> ${filePath}`);
filePath, const source = fs.readFileSync(filePath).toString();
await fs.promises.readFile(filePath, "utf-8"),
ts.ScriptTarget.ES2015, return ts.createSourceFile(file, source, ts.ScriptTarget.ES2015, true);
true
);
}) })
); );
const manifest = create({ const manifest = create({
modules, modules,
plugins: [...litPlugin()], plugins: litPlugin(),
context: { dev: false }, context: { dev: true },
}); });
console.log(manifest); console.log(manifest);