mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 05:27:46 +00:00
Code more like cli
This commit is contained in:
parent
fe37f8fad5
commit
b2ec3c8c37
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user