diff --git a/npmextra.json b/npmextra.json index 488eee5..ce75342 100644 --- a/npmextra.json +++ b/npmextra.json @@ -5,17 +5,28 @@ "githost": "code.foss.global", "gitscope": "push.rocks", "gitrepo": "smartntml", - "description": "lit-html for the backend", + "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" + ] } }, "npmci": { "npmGlobalTools": [], "npmAccessLevel": "public" }, - "tsdocs": { + "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" } } \ No newline at end of file diff --git a/package.json b/package.json index 42d5bc4..774a4c7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@push.rocks/smartntml", "version": "2.0.4", "private": false, - "description": "lit-html for the backend", + "description": "Provides lit-html rendering capabilities for backend applications.", "main": "dist_ts/index.js", "typings": "dist_ts/index.d.ts", "type": "module", @@ -42,5 +42,16 @@ "cli.js", "npmextra.json", "readme.md" + ], + "keywords": [ + "backend rendering", + "lit-html", + "template rendering", + "server-side rendering", + "html template", + "web components", + "happy-dom", + "indexeddb", + "typescript" ] } \ No newline at end of file diff --git a/readme.hints.md b/readme.hints.md new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/readme.hints.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/readme.md b/readme.md index 3180dc8..d49d135 100644 --- a/readme.md +++ b/readme.md @@ -1,37 +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) +```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: -## Legal -> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc) -| 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 + } +} +``` + +### 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` +