@push.rocks/smartntml 2.0.4 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * autocreated commitinfo by @pushrocks/commitinfo
2
+ * autocreated commitinfo by @push.rocks/commitinfo
3
3
  */
4
4
  export declare const commitinfo: {
5
5
  name: string;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * autocreated commitinfo by @pushrocks/commitinfo
2
+ * autocreated commitinfo by @push.rocks/commitinfo
3
3
  */
4
4
  export const commitinfo = {
5
- name: '@pushrocks/smartntml',
6
- version: '2.0.4',
7
- description: 'lit-html for the backend'
5
+ name: '@push.rocks/smartntml',
6
+ version: '2.0.8',
7
+ description: 'Provides lit-html rendering capabilities for backend applications.'
8
8
  };
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDBCQUEwQjtDQUN4QyxDQUFBIn0=
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLG9FQUFvRTtDQUNsRixDQUFBIn0=
@@ -0,0 +1,5 @@
1
+ import * as plugins from './smartntml.plugins.js';
2
+ export declare class Smartntml {
3
+ constructor();
4
+ renderTemplateResult(templateResult: plugins.deesElement.TemplateResult, stripCommentsArg?: boolean): Promise<string>;
5
+ }
@@ -0,0 +1,14 @@
1
+ import * as plugins from './smartntml.plugins.js';
2
+ export class Smartntml {
3
+ constructor() { }
4
+ async renderTemplateResult(templateResult, stripCommentsArg = true) {
5
+ const element = document.createElement('div');
6
+ plugins.deesElement.render(templateResult, element);
7
+ let stringResult = element.innerHTML;
8
+ if (stripCommentsArg) {
9
+ stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
10
+ }
11
+ return stringResult;
12
+ }
13
+ }
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5zbWFydG50bWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jbGFzc2VzLnNtYXJ0bnRtbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHdCQUF3QixDQUFDO0FBQ2xELE1BQU0sT0FBTyxTQUFTO0lBQ3BCLGdCQUFlLENBQUM7SUFFVCxLQUFLLENBQUMsb0JBQW9CLENBQy9CLGNBQWtELEVBQ2xELGdCQUFnQixHQUFHLElBQUk7UUFFdkIsTUFBTSxPQUFPLEdBQUcsUUFBUSxDQUFDLGFBQWEsQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUM5QyxPQUFPLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxjQUFjLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFDcEQsSUFBSSxZQUFZLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQztRQUNyQyxJQUFJLGdCQUFnQixFQUFFLENBQUM7WUFDckIsWUFBWSxHQUFHLFlBQVksQ0FBQyxPQUFPLENBQUMsZUFBZSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1FBQzNELENBQUM7UUFDRCxPQUFPLFlBQVksQ0FBQztJQUN0QixDQUFDO0NBQ0YifQ==
@@ -1,8 +1,5 @@
1
1
  import './instrument/happydom.js';
2
- import * as plugins from './smartntml.plugins.js';
3
- import * as deesElement from '@designestate/dees-element';
2
+ import { Smartntml } from './classes.smartntml.js';
3
+ export { Smartntml };
4
+ import * as deesElement from '@design.estate/dees-element';
4
5
  export { deesElement };
5
- export declare class Smartntml {
6
- constructor();
7
- renderTemplateResult(templateResult: plugins.deesElement.TemplateResult, stripCommentsArg?: boolean): Promise<string>;
8
- }
package/dist_ts/index.js CHANGED
@@ -1,17 +1,7 @@
1
+ // @ts-ignore
1
2
  import './instrument/happydom.js';
2
- import * as plugins from './smartntml.plugins.js';
3
- import * as deesElement from '@designestate/dees-element';
3
+ import { Smartntml } from './classes.smartntml.js';
4
+ export { Smartntml };
5
+ import * as deesElement from '@design.estate/dees-element';
4
6
  export { deesElement };
5
- export class Smartntml {
6
- constructor() { }
7
- async renderTemplateResult(templateResult, stripCommentsArg = true) {
8
- const element = document.createElement('div');
9
- plugins.deesElement.render(templateResult, element);
10
- let stringResult = element.innerHTML;
11
- if (stripCommentsArg) {
12
- stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
13
- }
14
- return stringResult;
15
- }
16
- }
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLDBCQUEwQixDQUFDO0FBQ2xDLE9BQU8sS0FBSyxPQUFPLE1BQU0sd0JBQXdCLENBQUM7QUFFbEQsT0FBTyxLQUFLLFdBQVcsTUFBTSw0QkFBNEIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsV0FBVyxFQUFFLENBQUM7QUFFdkIsTUFBTSxPQUFPLFNBQVM7SUFDcEIsZ0JBQWUsQ0FBQztJQUVULEtBQUssQ0FBQyxvQkFBb0IsQ0FDL0IsY0FBa0QsRUFDbEQsZ0JBQWdCLEdBQUcsSUFBSTtRQUV2QixNQUFNLE9BQU8sR0FBRyxRQUFRLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQzlDLE9BQU8sQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLGNBQWMsRUFBRSxPQUFPLENBQUMsQ0FBQztRQUNwRCxJQUFJLFlBQVksR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDO1FBQ3JDLElBQUksZ0JBQWdCLEVBQUU7WUFDcEIsWUFBWSxHQUFHLFlBQVksQ0FBQyxPQUFPLENBQUMsZUFBZSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1NBQzFEO1FBQ0QsT0FBTyxZQUFZLENBQUM7SUFDdEIsQ0FBQztDQUNGIn0=
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxhQUFhO0FBQ2IsT0FBTywwQkFBMEIsQ0FBQztBQUNsQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxDQUFDO0FBQ3JCLE9BQU8sS0FBSyxXQUFXLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDIn0=
@@ -1,7 +1,8 @@
1
1
  // happy-dom setup
2
2
  // first lets setup indexeddb
3
3
  import 'fake-indexeddb/auto';
4
+ // @ts-nocheck
4
5
  import { GlobalRegistrator } from '@happy-dom/global-registrator';
5
6
  GlobalRegistrator.register();
6
7
  window.location.href = 'http://localhost';
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFwcHlkb20uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9pbnN0cnVtZW50L2hhcHB5ZG9tLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFrQjtBQUVsQiw2QkFBNkI7QUFDN0IsT0FBTyxxQkFBcUIsQ0FBQztBQUU3QixPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNsRSxpQkFBaUIsQ0FBQyxRQUFRLEVBQUUsQ0FBQztBQUM3QixNQUFNLENBQUMsUUFBUSxDQUFDLElBQUksR0FBRyxrQkFBa0IsQ0FBQyJ9
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFwcHlkb20uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9pbnN0cnVtZW50L2hhcHB5ZG9tLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFrQjtBQUVsQiw2QkFBNkI7QUFDN0IsT0FBTyxxQkFBcUIsQ0FBQztBQUU3QixjQUFjO0FBQ2QsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDbEUsaUJBQWlCLENBQUMsUUFBUSxFQUFFLENBQUM7QUFDN0IsTUFBTSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEdBQUcsa0JBQWtCLENBQUMifQ==
@@ -1,4 +1,4 @@
1
- import * as smartpromise from '@pushrocks/smartpromise';
1
+ import * as smartpromise from '@push.rocks/smartpromise';
2
2
  export { smartpromise };
3
- import * as deesElement from '@designestate/dees-element';
3
+ import * as deesElement from '@design.estate/dees-element';
4
4
  export { deesElement };
@@ -1,8 +1,8 @@
1
1
  // @pushrocks scope
2
- import * as smartpromise from '@pushrocks/smartpromise';
2
+ import * as smartpromise from '@push.rocks/smartpromise';
3
3
  export { smartpromise };
4
4
  // designestate
5
- import * as deesElement from '@designestate/dees-element';
5
+ import * as deesElement from '@design.estate/dees-element';
6
6
  export { deesElement };
7
7
  // third party scope
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRudG1sLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydG50bWwucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUI7QUFDbkIsT0FBTyxLQUFLLFlBQVksTUFBTSx5QkFBeUIsQ0FBQztBQUV4RCxPQUFPLEVBQUUsWUFBWSxFQUFFLENBQUM7QUFFeEIsZUFBZTtBQUNmLE9BQU8sS0FBSyxXQUFXLE1BQU0sNEJBQTRCLENBQUM7QUFFMUQsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDO0FBRXZCLG9CQUFvQiJ9
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRudG1sLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydG50bWwucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUI7QUFDbkIsT0FBTyxLQUFLLFlBQVksTUFBTSwwQkFBMEIsQ0FBQztBQUV6RCxPQUFPLEVBQUUsWUFBWSxFQUFFLENBQUM7QUFFeEIsZUFBZTtBQUNmLE9BQU8sS0FBSyxXQUFXLE1BQU0sNkJBQTZCLENBQUM7QUFFM0QsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDO0FBRXZCLG9CQUFvQiJ9
package/npmextra.json CHANGED
@@ -2,17 +2,31 @@
2
2
  "gitzone": {
3
3
  "projectType": "npm",
4
4
  "module": {
5
- "githost": "gitlab.com",
6
- "gitscope": "pushrocks",
5
+ "githost": "code.foss.global",
6
+ "gitscope": "push.rocks",
7
7
  "gitrepo": "smartntml",
8
- "description": "lit-html for the backend",
9
- "npmPackagename": "@pushrocks/smartntml",
8
+ "description": "Provides lit-html rendering capabilities for backend applications.",
9
+ "npmPackagename": "@push.rocks/smartntml",
10
10
  "license": "MIT",
11
- "projectDomain": "push.rocks"
11
+ "projectDomain": "push.rocks",
12
+ "keywords": [
13
+ "backend rendering",
14
+ "lit-html",
15
+ "template rendering",
16
+ "server-side rendering",
17
+ "html template",
18
+ "web components",
19
+ "happy-dom",
20
+ "indexeddb",
21
+ "typescript"
22
+ ]
12
23
  }
13
24
  },
14
25
  "npmci": {
15
26
  "npmGlobalTools": [],
16
27
  "npmAccessLevel": "public"
28
+ },
29
+ "tsdoc": {
30
+ "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"
17
31
  }
18
32
  }
package/package.json CHANGED
@@ -1,32 +1,26 @@
1
1
  {
2
2
  "name": "@push.rocks/smartntml",
3
- "version": "2.0.4",
3
+ "version": "2.0.8",
4
4
  "private": false,
5
- "description": "lit-html for the backend",
5
+ "description": "Provides lit-html rendering capabilities for backend applications.",
6
6
  "main": "dist_ts/index.js",
7
7
  "typings": "dist_ts/index.d.ts",
8
8
  "type": "module",
9
9
  "author": "Lossless GmbH",
10
10
  "license": "MIT",
11
- "scripts": {
12
- "test": "(tstest test/ --web)",
13
- "build": "(tsbuild --web)",
14
- "buildDocs": "tsdoc"
15
- },
16
11
  "devDependencies": {
17
- "@gitzone/tsbuild": "^2.1.65",
18
- "@gitzone/tsbundle": "^2.0.7",
19
- "@gitzone/tsrun": "^1.2.39",
20
- "@gitzone/tstest": "^1.0.73",
21
- "@pushrocks/tapbundle": "^5.0.4",
22
- "@types/node": "^18.7.23",
23
- "why-is-node-running": "^2.2.2"
12
+ "@git.zone/tsbuild": "^2.1.84",
13
+ "@git.zone/tsbundle": "^2.0.7",
14
+ "@git.zone/tsrun": "^1.2.49",
15
+ "@git.zone/tstest": "^1.0.73",
16
+ "@push.rocks/tapbundle": "^5.3.0",
17
+ "@types/node": "^22.7.5"
24
18
  },
25
19
  "dependencies": {
26
- "@designestate/dees-element": "^2.0.20",
27
- "@happy-dom/global-registrator": "^8.9.0",
28
- "@pushrocks/smartpromise": "^3.1.7",
29
- "fake-indexeddb": "^4.0.1"
20
+ "@design.estate/dees-element": "^2.0.39",
21
+ "@happy-dom/global-registrator": "^15.7.4",
22
+ "@push.rocks/smartpromise": "^4.0.3",
23
+ "fake-indexeddb": "^6.0.0"
30
24
  },
31
25
  "browserslist": [
32
26
  "last 1 chrome versions"
@@ -42,5 +36,26 @@
42
36
  "cli.js",
43
37
  "npmextra.json",
44
38
  "readme.md"
45
- ]
39
+ ],
40
+ "keywords": [
41
+ "backend rendering",
42
+ "lit-html",
43
+ "template rendering",
44
+ "server-side rendering",
45
+ "html template",
46
+ "web components",
47
+ "happy-dom",
48
+ "indexeddb",
49
+ "typescript"
50
+ ],
51
+ "homepage": "https://code.foss.global/push.rocks/smartntml",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://code.foss.global/push.rocks/smartntml.git"
55
+ },
56
+ "scripts": {
57
+ "test": "(tstest test/ --web)",
58
+ "build": "(tsbuild --web --allowimplicitany)",
59
+ "buildDocs": "tsdoc"
60
+ }
46
61
  }
@@ -0,0 +1 @@
1
+
package/readme.md CHANGED
@@ -1,37 +1,128 @@
1
- # @pushrocks/smartntml
1
+ # @push.rocks/smartntml
2
2
  lit-html for the backend
3
3
 
4
- ## Availabililty and Links
5
- * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartntml)
6
- * [gitlab.com (source)](https://gitlab.com/pushrocks/smartntml)
7
- * [github.com (source mirror)](https://github.com/pushrocks/smartntml)
8
- * [docs (typedoc)](https://pushrocks.gitlab.io/smartntml/)
9
-
10
- ## Status for master
11
-
12
- Status Category | Status Badge
13
- -- | --
14
- GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartntml/badges/master/pipeline.svg)](https://lossless.cloud)
15
- GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartntml/badges/master/coverage.svg)](https://lossless.cloud)
16
- npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartntml)](https://lossless.cloud)
17
- Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartntml)](https://lossless.cloud)
18
- TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
19
- node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
20
- Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
21
- PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartntml)](https://lossless.cloud)
22
- PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartntml)](https://lossless.cloud)
23
- BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartntml)](https://lossless.cloud)
4
+ ## Install
5
+
6
+ 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:
7
+
8
+ ```bash
9
+ npm install @push.rocks/smartntml --save
10
+ ```
11
+
12
+ This will add `@push.rocks/smartntml` as a dependency to your project and you're ready to use lit-html in your backend applications.
24
13
 
25
14
  ## Usage
26
15
 
27
- Use TypeScript for best in class intellisense
16
+ 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.
17
+
18
+ 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.
19
+
20
+ ### Setting Up Your Project with TypeScript and ESM
21
+
22
+ First and foremost, ensure your project is set up to use TypeScript and ECMAScript Modules (ESM). Your `tsconfig.json` should have the following settings:
23
+
24
+ ```json
25
+ {
26
+ "compilerOptions": {
27
+ "target": "ESNext",
28
+ "module": "ESNext",
29
+ "moduleResolution": "node",
30
+ "esModuleInterop": true,
31
+ "allowSyntheticDefaultImports": true
32
+ }
33
+ }
34
+ ```
35
+
36
+ ### Basic Usage
37
+
38
+ `@push.rocks/smartntml` simplifies the process of creating and rendering templates. The following example demonstrates how to create a template and render it:
39
+
40
+ 1. **Import the necessary modules**
41
+
42
+ First, import `Smartntml` and any other module you wish to use:
43
+
44
+ ```typescript
45
+ import { Smartntml, deesElement } from '@push.rocks/smartntml';
46
+ ```
47
+
48
+ `deesElement` is leveraged for its `TemplateResult` type and `html` tag function, allowing us to define our templates with ease.
49
+
50
+ 2. **Create an instance of Smartntml**
51
+
52
+ ```typescript
53
+ const smartNTML = new Smartntml();
54
+ ```
55
+
56
+ 3. **Define a Template**
57
+
58
+ 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.
59
+
60
+ ```typescript
61
+ const myTemplate = deesElement.html`
62
+ <div>Welcome to Smartntml!</div>
63
+ `;
64
+ ```
65
+
66
+ 4. **Render the Template**
67
+
68
+ 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.
69
+
70
+ ```typescript
71
+ async function renderMyTemplate() {
72
+ const renderedString = await smartNTML.renderTemplateResult(myTemplate);
73
+ console.log(renderedString);
74
+ }
75
+ renderMyTemplate();
76
+ ```
77
+
78
+ ### Working with Dynamic Content
79
+
80
+ `@push.rocks/smartntml` excels in rendering dynamic content. Assume you have an array of items that you want to display in a list:
81
+
82
+ ```typescript
83
+ const items = ['Apple', 'Banana', 'Cherry'];
84
+ const listTemplate = deesElement.html`
85
+ <ul>
86
+ ${items.map(item => deesElement.html`<li>${item}</li>`)}
87
+ </ul>
88
+ `;
89
+ ```
90
+
91
+ You can dynamically render arrays or any functional JavaScript within your templates, making it incredibly powerful for generating dynamic HTML content.
92
+
93
+ ### Advanced Usage
94
+
95
+ `@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.
96
+
97
+ **Note:** Always sanitize any user input before rendering it with `smartntml` to prevent XSS (Cross-Site Scripting) attacks.
98
+
99
+ ### Support and Contribution
100
+
101
+ `@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.
102
+
103
+ 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.
104
+
105
+ ### Final Thoughts
106
+
107
+ `@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.
108
+
109
+ 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!
110
+
111
+ ## License and Legal Information
112
+
113
+ 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.
114
+
115
+ **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.
116
+
117
+ ### Trademarks
118
+
119
+ 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.
28
120
 
29
- ## Contribution
121
+ ### Company Information
30
122
 
31
- 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). :)
123
+ Task Venture Capital GmbH
124
+ Registered at District court Bremen HRB 35230 HB, Germany
32
125
 
33
- For further information read the linked docs at the top of this readme.
126
+ For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
34
127
 
35
- ## Legal
36
- > MIT licensed | **&copy;** [Task Venture Capital GmbH](https://task.vc)
37
- | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
128
+ 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.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * autocreated commitinfo by @pushrocks/commitinfo
2
+ * autocreated commitinfo by @push.rocks/commitinfo
3
3
  */
4
4
  export const commitinfo = {
5
- name: '@pushrocks/smartntml',
6
- version: '2.0.4',
7
- description: 'lit-html for the backend'
5
+ name: '@push.rocks/smartntml',
6
+ version: '2.0.8',
7
+ description: 'Provides lit-html rendering capabilities for backend applications.'
8
8
  }
@@ -0,0 +1,17 @@
1
+ import * as plugins from './smartntml.plugins.js';
2
+ export class Smartntml {
3
+ constructor() {}
4
+
5
+ public async renderTemplateResult(
6
+ templateResult: plugins.deesElement.TemplateResult,
7
+ stripCommentsArg = true
8
+ ) {
9
+ const element = document.createElement('div');
10
+ plugins.deesElement.render(templateResult, element);
11
+ let stringResult = element.innerHTML;
12
+ if (stripCommentsArg) {
13
+ stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
14
+ }
15
+ return stringResult;
16
+ }
17
+ }
package/ts/index.ts CHANGED
@@ -1,22 +1,8 @@
1
+ // @ts-ignore
1
2
  import './instrument/happydom.js';
2
- import * as plugins from './smartntml.plugins.js';
3
-
4
- import * as deesElement from '@designestate/dees-element';
3
+ import { Smartntml } from './classes.smartntml.js';
4
+ export { Smartntml };
5
+ import * as deesElement from '@design.estate/dees-element';
5
6
  export { deesElement };
6
7
 
7
- export class Smartntml {
8
- constructor() {}
9
8
 
10
- public async renderTemplateResult(
11
- templateResult: plugins.deesElement.TemplateResult,
12
- stripCommentsArg = true
13
- ) {
14
- const element = document.createElement('div');
15
- plugins.deesElement.render(templateResult, element);
16
- let stringResult = element.innerHTML;
17
- if (stripCommentsArg) {
18
- stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
19
- }
20
- return stringResult;
21
- }
22
- }
@@ -3,6 +3,7 @@
3
3
  // first lets setup indexeddb
4
4
  import 'fake-indexeddb/auto';
5
5
 
6
+ // @ts-nocheck
6
7
  import { GlobalRegistrator } from '@happy-dom/global-registrator';
7
8
  GlobalRegistrator.register();
8
9
  window.location.href = 'http://localhost';
@@ -1,10 +1,10 @@
1
1
  // @pushrocks scope
2
- import * as smartpromise from '@pushrocks/smartpromise';
2
+ import * as smartpromise from '@push.rocks/smartpromise';
3
3
 
4
4
  export { smartpromise };
5
5
 
6
6
  // designestate
7
- import * as deesElement from '@designestate/dees-element';
7
+ import * as deesElement from '@design.estate/dees-element';
8
8
 
9
9
  export { deesElement };
10
10