Skip to content

Commit

Permalink
Add .d.ts files to theme style.js files (#1767)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwivix committed Dec 6, 2023
1 parent b7eccb1 commit 3de99ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/make-themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ files.forEach(async file => {
{ parser: 'babel-ts' }
);

let dTs = await prettier.format(
`
declare const _default: import("lit").CSSResult;
export default _default;
`,
{ parser: 'babel-ts' }
);

const cssFile = path.join(themesDir, path.basename(file));
const jsFile = path.join(themesDir, path.basename(file).replace('.css', '.styles.js'));
const dTsFile = path.join(themesDir, path.basename(file).replace('.css', '.styles.d.ts'));

fs.writeFileSync(cssFile, css, 'utf8');
fs.writeFileSync(jsFile, js, 'utf8');
fs.writeFileSync(dTsFile, dTs, 'utf8');
});

0 comments on commit 3de99ee

Please sign in to comment.