update dependencies, cleanup, refine (#642)

* update dependencies, cleanup, refine

fixes #637

* update CI command to verify
This commit is contained in:
Jason O'Neill
2022-01-06 05:44:13 -08:00
committed by GitHub
parent 46f05224ab
commit ca346ccbb2
18 changed files with 5108 additions and 6710 deletions

View File

@@ -1,9 +1,8 @@
import chalk from 'chalk';
import fs from 'fs';
import del from 'del';
import mkdirp from 'mkdirp';
import path from 'path';
import pascalCase from 'pascal-case';
import { pascalCase } from 'pascal-case';
import prettier from 'prettier';
import prettierConfig from '../prettier.config.cjs';
import { getAllComponents } from './shared.js';
@@ -12,7 +11,7 @@ const outdir = path.join('./src/react');
// Clear build directory
del.sync(outdir);
mkdirp.sync(outdir);
fs.mkdirSync(outdir, { recursive: true });
// Fetch component metadata
const metadata = JSON.parse(fs.readFileSync('./dist/custom-elements.json', 'utf8'));
@@ -29,7 +28,7 @@ components.map(component => {
const componentFile = path.join(componentDir, 'index.ts');
const importPath = component.modulePath.replace(/^src\//, '').replace(/\.ts$/, '');
mkdirp.sync(componentDir);
fs.mkdirSync(componentDir, { recursive: true });
const events = (component.events || []).map(event => `${`on${pascalCase(event.name)}`}: '${event.name}'`).join(',\n');