Skip to content

Commit

Permalink
fix: lit-element
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Oct 26, 2021
1 parent 73adc49 commit 3342524
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/cli/frameworks/lit-element/src/lit-element-cli.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as path from 'path';
import './components/app/component.lit-element';

import { CreateOps } from '@leanup/cli/lib/interfaces';
import { LeanupCLI } from '@leanup/cli/lib/leanup-cli';
import * as PACKAGE_JSON from '../node_modules/lit-element/package.json';

export class LitElementCLI extends LeanupCLI {
constructor(name: string, version: string) {
super(name, version);
import { run } from './app.run';
import { typeIt } from './shares/utils';

this.addActionToCommand('create', (options: CreateOps) => {
this.copyAndPrint(path.join(__dirname, '../', 'template'), '', options);
});
const TYPED_PACKAGE_JSON = typeIt<{ version: string }>(PACKAGE_JSON);

run('lit-element', TYPED_PACKAGE_JSON.version, () => {
// Render the template to the document
const htmlDivElement: HTMLDivElement | null = document.querySelector('div#lit-element');
if (htmlDivElement instanceof HTMLDivElement) {
htmlDivElement.innerHTML = '<app-component />';
}
}
});

0 comments on commit 3342524

Please sign in to comment.