fix(core): update

This commit is contained in:
Philipp Kunz 2024-01-24 00:59:11 +01:00
parent 321ce99338
commit c021a84788
3 changed files with 25 additions and 7 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-catalog', name: '@design.estate/dees-catalog',
version: '1.0.275', version: '1.0.276',
description: 'website for lossless.com' description: 'website for lossless.com'
} }

View File

@ -39,10 +39,6 @@ export class DeesSimpleAppDash extends DeesElement {
@property() @property()
public viewTabs: IView[] = []; public viewTabs: IView[] = [];
@property()
public views: Array<{ name: string; icon: string; viewFunction: () => Promise<TemplateResult> }> =
[];
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`

View File

@ -27,6 +27,9 @@ export class DeesTerminal extends DeesElement {
// INSTANCE // INSTANCE
private resizeObserver: ResizeObserver; private resizeObserver: ResizeObserver;
@property()
public setupCommand = `pnpm install @git.zone/tsbuild && clear && echo 'welcome'`;
constructor() { constructor() {
super(); super();
this.resizeObserver = new ResizeObserver((entries) => { this.resizeObserver = new ResizeObserver((entries) => {
@ -278,8 +281,9 @@ export class DeesTerminal extends DeesElement {
term.onData((data) => { term.onData((data) => {
input.write(data); input.write(data);
}); });
await domtools.convenience.smartdelay.delayFor(5000); await this.waitForPrompt(term, '~/');
input.write(`pnpm add isomorphic-git @git.zone/tsbuild\n`); input.write(this.setupCommand);
input.write(`\n`);
} }
async connectedCallback(): Promise<void> { async connectedCallback(): Promise<void> {
@ -295,4 +299,22 @@ export class DeesTerminal extends DeesElement {
handleResize() { handleResize() {
this.fitAddon.fit(); this.fitAddon.fit();
} }
private async waitForPrompt(term: Terminal, prompt: string): Promise<void> {
return new Promise<void>((resolve) => {
const checkPrompt = () => {
const lines = term.buffer.active;
for (let i = 0; i < lines.length; i++) {
const line = lines.getLine(i);
if (line && line.translateToString().includes(prompt)) {
resolve();
return;
}
}
setTimeout(checkPrompt, 100); // check every 100 ms
};
checkPrompt();
});
}
} }