22 Commits

Author SHA1 Message Date
jkunz 27977cd43e v2.0.9 2026-05-01 18:10:45 +00:00
jkunz 4209d7767b fix(build): modernize project configuration, dependencies, and node-based test setup 2026-05-01 18:10:45 +00:00
philkunz d10ec8d81f 2.0.8 2024-10-13 12:12:35 +02:00
philkunz ef65d08a54 fix(core): Updated dependencies and optimized code structure 2024-10-13 12:12:35 +02:00
philkunz 8872a92193 update description 2024-05-29 14:15:06 +02:00
philkunz c9a324b9a6 2.0.7 2024-05-28 10:40:39 +02:00
philkunz caa1e60cf6 fix(core): update 2024-05-28 10:40:38 +02:00
philkunz 7402967715 2.0.6 2024-05-28 00:42:20 +02:00
philkunz ef6f043a68 fix(core): update 2024-05-28 00:42:20 +02:00
philkunz 39ca9c52ae 2.0.5 2024-05-28 00:28:34 +02:00
philkunz d7c3f035ec fix(core): update 2024-05-28 00:28:33 +02:00
philkunz 48989c17c7 update tsconfig 2024-04-14 18:04:25 +02:00
philkunz 46a70d55c5 update npmextra.json: githost 2024-04-01 21:36:58 +02:00
philkunz 4e44ed81a5 update npmextra.json: githost 2024-04-01 19:59:08 +02:00
philkunz 313538e48f update npmextra.json: githost 2024-03-30 21:48:07 +01:00
philkunz b64a819023 switch to new org scheme 2023-07-10 10:16:59 +02:00
philkunz a7281760ac 2.0.4 2023-05-01 14:02:26 +02:00
philkunz 1c8fef7a07 fix(core): update 2023-05-01 14:02:25 +02:00
philkunz 71396208ee 2.0.3 2023-05-01 13:03:55 +02:00
philkunz 1dadeeb05a fix(core): update 2023-05-01 13:03:55 +02:00
philkunz 0fd7ae74f8 2.0.2 2023-05-01 13:03:33 +02:00
philkunz 9d6238618f fix(core): update 2023-05-01 13:03:32 +02:00
17 changed files with 7468 additions and 17948 deletions
-140
View File
@@ -1,140 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
+40
View File
@@ -0,0 +1,40 @@
{
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartntml",
"shortDescription": "backend lit-html renderer",
"description": "Provides lit-html rendering capabilities for backend applications.",
"npmPackagename": "@push.rocks/smartntml",
"license": "MIT",
"projectDomain": "push.rocks",
"keywords": [
"backend rendering",
"lit-html",
"template rendering",
"server-side rendering",
"html template",
"web components",
"happy-dom",
"indexeddb",
"typescript"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}
+38
View File
@@ -0,0 +1,38 @@
# Changelog
## 2026-05-01 - 2.0.9 - fix(build)
modernize project configuration, dependencies, and node-based test setup
- adds package exports and includes .smartconfig.json and license in published files
- updates build and test tooling to current @git.zone packages and enables stricter TypeScript settings
- migrates tests to a Node-focused happy-dom setup using @git.zone/tstest and removes obsolete smartpromise usage
## 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
+16 -6
View File
@@ -1,9 +1,19 @@
The MIT License (MIT)
Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
Copyright 2022 Lossless GmbH <hello@lossless.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+31 -9
View File
@@ -1,18 +1,40 @@
{
"gitzone": {
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartntml",
"description": "lit-html for the backend",
"npmPackagename": "@pushrocks/smartntml",
"shortDescription": "backend lit-html renderer",
"description": "Provides lit-html rendering capabilities for backend applications.",
"npmPackagename": "@push.rocks/smartntml",
"license": "MIT",
"projectDomain": "push.rocks"
"projectDomain": "push.rocks",
"keywords": [
"backend rendering",
"lit-html",
"template rendering",
"server-side rendering",
"html template",
"web components",
"happy-dom",
"indexeddb",
"typescript"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"npmci": {
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
"npmRegistryUrl": "registry.npmjs.org"
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}
}
-13821
View File
File diff suppressed because it is too large Load Diff
+36 -17
View File
@@ -1,30 +1,31 @@
{
"name": "@pushrocks/smartntml",
"version": "2.0.1",
"name": "@push.rocks/smartntml",
"version": "2.0.9",
"private": false,
"description": "lit-html for the backend",
"description": "Provides lit-html rendering capabilities for backend applications.",
"exports": {
".": "./dist_ts/index.js"
},
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"author": "Task Venture Capital GmbH <hello@task.vc>",
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
"test": "tstest test/",
"build": "tsbuild --web",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsbundle": "^2.0.7",
"@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.7.23",
"why-is-node-running": "^2.2.2"
"@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsrun": "^2.0.3",
"@git.zone/tstest": "^3.6.3",
"@types/node": "^25.6.0"
},
"dependencies": {
"@designestate/dees-element": "^2.0.20",
"@happy-dom/global-registrator": "^8.9.0",
"@pushrocks/smartpromise": "^3.1.7"
"@design.estate/dees-element": "^2.2.4",
"@happy-dom/global-registrator": "^20.9.0",
"fake-indexeddb": "^6.2.5"
},
"browserslist": [
"last 1 chrome versions"
@@ -38,7 +39,25 @@
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
".smartconfig.json",
"license",
"npmextra.json",
"readme.md"
]
],
"keywords": [
"backend rendering",
"lit-html",
"template rendering",
"server-side rendering",
"html template",
"web components",
"happy-dom",
"indexeddb",
"typescript"
],
"homepage": "https://code.foss.global/push.rocks/smartntml",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartntml.git"
}
}
+7138 -3878
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
+116 -27
View File
@@ -1,39 +1,128 @@
# @pushrocks/smartntml
# @push.rocks/smartntml
lit-html for the backend
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartntml)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartntml)
* [github.com (source mirror)](https://github.com/pushrocks/smartntml)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartntml/)
## Install
## Status for master
To install `@push.rocks/smartntml`, you need Node.js and npm installed on your machine. If you have them ready, open your terminal and run the following command:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartntml/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartntml/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartntml)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartntml)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartntml)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartntml)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartntml)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
```bash
npm install @push.rocks/smartntml --save
```
This will add `@push.rocks/smartntml` as a dependency to your project and you're ready to use lit-html in your backend applications.
## Usage
Use TypeScript for best in class intellisense
The core idea behind `@push.rocks/smartntml` is to bring the convenience and developer experience of `lit-html` to server-side rendering. This package leverages the power of `lit-html`'s syntax and data-binding capabilities in a Node.js environment, especially focusing on backend applications that require rendering HTML.
## Contribution
To start using `@push.rocks/smartntml`, you need to familiarize yourself with TypeScript and ESM syntax, as this module is designed to offer the best experience within this ecosystem.
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
### Setting Up Your Project with TypeScript and ESM
For further information read the linked docs at the top of this readme.
First and foremost, ensure your project is set up to use TypeScript and ECMAScript Modules (ESM). Your `tsconfig.json` should have the following settings:
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
```json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
}
}
```
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
### Basic Usage
`@push.rocks/smartntml` simplifies the process of creating and rendering templates. The following example demonstrates how to create a template and render it:
1. **Import the necessary modules**
First, import `Smartntml` and any other module you wish to use:
```typescript
import { Smartntml, deesElement } from '@push.rocks/smartntml';
```
`deesElement` is leveraged for its `TemplateResult` type and `html` tag function, allowing us to define our templates with ease.
2. **Create an instance of Smartntml**
```typescript
const smartNTML = new Smartntml();
```
3. **Define a Template**
You can define a template using the `html` function provided by `deesElement`. This function allows you to embed dynamic content in a concise and readable manner.
```typescript
const myTemplate = deesElement.html`
<div>Welcome to Smartntml!</div>
`;
```
4. **Render the Template**
With a template defined, you can render it to a string. This string can then be sent as a response to a client in a web application or stored for later use.
```typescript
async function renderMyTemplate() {
const renderedString = await smartNTML.renderTemplateResult(myTemplate);
console.log(renderedString);
}
renderMyTemplate();
```
### Working with Dynamic Content
`@push.rocks/smartntml` excels in rendering dynamic content. Assume you have an array of items that you want to display in a list:
```typescript
const items = ['Apple', 'Banana', 'Cherry'];
const listTemplate = deesElement.html`
<ul>
${items.map(item => deesElement.html`<li>${item}</li>`)}
</ul>
`;
```
You can dynamically render arrays or any functional JavaScript within your templates, making it incredibly powerful for generating dynamic HTML content.
### Advanced Usage
`@push.rocks/smartntml` can also integrate with other backend services and capabilities. For instance, using it alongside your server-side logic to render user-specific data, handling form submissions, or creating email templates.
**Note:** Always sanitize any user input before rendering it with `smartntml` to prevent XSS (Cross-Site Scripting) attacks.
### Support and Contribution
`@push.rocks/smartntml` is an open-source project and welcomes contributions from the community. Whether it's improving the documentation, adding new features, or reporting bugs, every contribution helps make `smartntml` better for everyone.
Before contributing to the project, make sure to discuss your ideas or issues on the repository's issue tracker. This ensures that your contributions align with the project's goals and don't overlap with existing efforts.
### Final Thoughts
`@push.rocks/smartntml` provides a streamlined and efficient way to use `lit-html`-like syntax for server-rendered templates in Node.js applications. It offers a blend of simplicity and power, enabling developers to create dynamic, data-driven HTML content on the backend with minimal effort. By integrating `@push.rocks/smartntml` into your project, you embrace modern JavaScript practices and significantly enhance your server-side rendering capabilities.
For more detailed usage examples and advanced features, make sure to check out the official documentation and explore the `@push.rocks/smartntml` codebase. Happy coding!
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
+10 -8
View File
@@ -1,9 +1,16 @@
import log from 'why-is-node-running';
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import { tap } from '@git.zone/tstest/tapbundle';
import { GlobalRegistrator } from '@happy-dom/global-registrator';
import * as smartntml from '../ts/index.js';
let testSmartntmlInstance: smartntml.Smartntml;
tap.registerCleanup(async () => {
if (GlobalRegistrator.isRegistered) {
await GlobalRegistrator.unregister();
}
await tap.stopForcefully(0);
});
tap.test('first test', async () => {
testSmartntmlInstance = new smartntml.Smartntml();
});
@@ -18,9 +25,4 @@ tap.test('should render a string', async () => {
console.log(stringResult);
});
tap.test('should log', async () => {
log();
setTimeout(()=> process.exit(0), 0);
})
tap.start();
export default tap.start();
+4 -4
View File
@@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartntml',
version: '2.0.1',
description: 'lit-html for the backend'
name: '@push.rocks/smartntml',
version: '2.0.9',
description: 'Provides lit-html rendering capabilities for backend applications.'
}
+17
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;
}
}
+4 -22
View File
@@ -1,23 +1,5 @@
import './instrument/happydom.js';
import * as plugins from './smartntml.plugins.js';
const deesElement = plugins.deesElement;
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;
}
}
import { Smartntml } from './classes.smartntml.js';
export { Smartntml };
import * as deesElement from '@design.estate/dees-element';
export { deesElement };
+5
View File
@@ -1,4 +1,9 @@
// happy-dom setup
// first lets setup indexeddb
import 'fake-indexeddb/auto';
// @ts-nocheck
import { GlobalRegistrator } from '@happy-dom/global-registrator';
GlobalRegistrator.register();
window.location.href = 'http://localhost';
+2 -13
View File
@@ -1,15 +1,4 @@
// @pushrocks scope
import * as smartpromise from '@pushrocks/smartpromise';
export {
smartpromise
}
// designestate
import * as deesElement from '@designestate/dees-element';
import * as deesElement from '@design.estate/dees-element';
export {
deesElement
}
// third party scope
export { deesElement };
+10 -3
View File
@@ -3,7 +3,14 @@
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noImplicitAny": true,
"esModuleInterop": true,
"verbatimModuleSyntax": true,
"types": ["node"]
},
"exclude": [
"dist_*/**/*.d.ts"
]
}