fix(core): Updated dependencies and optimized code structure

This commit is contained in:
2024-10-13 12:12:35 +02:00
parent 8872a92193
commit ef65d08a54
8 changed files with 912 additions and 945 deletions

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartntml',
version: '2.0.7',
version: '2.0.8',
description: 'Provides lit-html rendering capabilities for backend applications.'
}

17
ts/classes.smartntml.ts Normal file
View File

@ -0,0 +1,17 @@
import * as plugins from './smartntml.plugins.js';
export class Smartntml {
constructor() {}
public async renderTemplateResult(
templateResult: plugins.deesElement.TemplateResult,
stripCommentsArg = true
) {
const element = document.createElement('div');
plugins.deesElement.render(templateResult, element);
let stringResult = element.innerHTML;
if (stripCommentsArg) {
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
}
return stringResult;
}
}

View File

@ -1,23 +1,8 @@
// @ts-ignore
import './instrument/happydom.js';
import * as plugins from './smartntml.plugins.js';
import { Smartntml } from './classes.smartntml.js';
export { Smartntml };
import * as deesElement from '@design.estate/dees-element';
export { deesElement };
export class Smartntml {
constructor() {}
public async renderTemplateResult(
templateResult: plugins.deesElement.TemplateResult,
stripCommentsArg = true
) {
const element = document.createElement('div');
plugins.deesElement.render(templateResult, element);
let stringResult = element.innerHTML;
if (stripCommentsArg) {
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
}
return stringResult;
}
}

View File

@ -3,6 +3,7 @@
// first lets setup indexeddb
import 'fake-indexeddb/auto';
// @ts-nocheck
import { GlobalRegistrator } from '@happy-dom/global-registrator';
GlobalRegistrator.register();
window.location.href = 'http://localhost';