fix(core): Updated dependencies and optimized code structure

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

31
changelog.md Normal file
View File

@ -0,0 +1,31 @@
# Changelog
## 2024-10-13 - 2.0.8 - fix(core)
Updated dependencies and optimized code structure
- Upgraded '@git.zone/tsbuild', '@git.zone/tsrun', '@design.estate/dees-element', and '@happy-dom/global-registrator' packages to their latest versions.
- Removed 'why-is-node-running' from devDependencies as it is not used.
- Refactored Smartntml class to separate file for better module organization.
## 2024-05-28 - 2.0.4 to 2.0.7 - fix and maintenance updates
Minor updates and fixes to the core functionality.
- fixed various core updates
- updated description in version 2.0.7
## 2023-05-01 - 2.0.0 to 2.0.4 - updates and fixes
Introduction of new organization schemes and updates.
- switched to new organization scheme
- fixed core updates throughout versions
## 2023-03-30 - 1.0.12 to 2.0.0 - major and breaking changes
Significant version upgrade with breaking changes for environment handling.
- improved loading of the environment allowing use in synchronization environments
- fixed core updates in version 2.0.0
## 2022-05-28 - 1.0.1 to 1.0.12 - initial fixes
Initial series of updates focusing on core functionality improvements.
- fixed core updates consistently across versions

View File

@ -14,17 +14,16 @@
"buildDocs": "tsdoc"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.65",
"@git.zone/tsbuild": "^2.1.84",
"@git.zone/tsbundle": "^2.0.7",
"@git.zone/tsrun": "^1.2.39",
"@git.zone/tsrun": "^1.2.49",
"@git.zone/tstest": "^1.0.73",
"@push.rocks/tapbundle": "^5.0.4",
"@types/node": "^20.12.12",
"why-is-node-running": "^2.2.2"
"@push.rocks/tapbundle": "^5.3.0",
"@types/node": "^22.7.5"
},
"dependencies": {
"@design.estate/dees-element": "^2.0.20",
"@happy-dom/global-registrator": "^14.11.1",
"@design.estate/dees-element": "^2.0.39",
"@happy-dom/global-registrator": "^15.7.4",
"@push.rocks/smartpromise": "^4.0.3",
"fake-indexeddb": "^6.0.0"
},

1768
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
import log from 'why-is-node-running';
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as smartntml from '../ts/index.js';
@ -19,7 +18,6 @@ tap.test('should render a string', async () => {
});
tap.test('should log', async () => {
log();
setTimeout(() => process.exit(0), 0);
});

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';