update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 18:12:04 +02:00
parent c25c2e96a4
commit 74f8f628fa
4 changed files with 141 additions and 24 deletions

View File

@ -7,14 +7,25 @@
"shortDescription": "create reports and display them on the web",
"npmPackagename": "@push.rocks/smartreport",
"license": "MIT",
"projectDomain": "push.rocks"
"projectDomain": "push.rocks",
"description": "A library for creating and displaying reports on the web.",
"keywords": [
"report generation",
"web display",
"TypeScript",
"documentation",
"testing",
"code formatting",
"open source",
"contribution"
]
}
},
"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"
}
}

View File

@ -2,7 +2,7 @@
"name": "@push.rocks/smartreport",
"version": "1.0.2",
"private": false,
"description": "create reports and display them on the web",
"description": "A library for creating and displaying reports on the web.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Lossless GmbH",
@ -31,5 +31,15 @@
"cli.js",
"npmextra.json",
"readme.md"
],
"keywords": [
"report generation",
"web display",
"TypeScript",
"documentation",
"testing",
"code formatting",
"open source",
"contribution"
]
}

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

137
readme.md
View File

@ -1,32 +1,127 @@
# @pushrocks/smartreport
# @push.rocks/smartreport
create reports and display them on the web
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartreport)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartreport)
* [github.com (source mirror)](https://github.com/pushrocks/smartreport)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartreport/)
## Install
To install `@push.rocks/smartreport`, you need to run the following command using npm (Node Package Manager):
## Status for master
[![build status](https://gitlab.com/pushrocks/smartreport/badges/master/build.svg)](https://gitlab.com/pushrocks/smartreport/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartreport/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartreport/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartreport.svg)](https://www.npmjs.com/package/@pushrocks/smartreport)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartreport/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartreport)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
```bash
npm install @push.rocks/smartreport --save
```
Ensure you have Node.js and npm installed on your machine before you install the package.
## Usage
Use TypeScript for best in class intellisense.
This documentation provides a comprehensive guide on how to utilize `@push.rocks/smartreport` to create and display reports on the web using TypeScript. Whether you're creating a simple project report or an elaborate web analytics display, `@push.rocks/smartreport` offers the tools required to craft, manipulate, and showcase your data elegantly.
## Contribution
### Prerequisites
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). :)
Before you begin, ensure that the following are installed:
- Node.js (10.x.x or higher)
- TypeScript (3.x or higher)
For further information read the linked docs at the top of this readme.
### Getting Started
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
First, import `Smartreport`, `ReportSection`, and `ReportItem` from `@push.rocks/smartreport`:
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
```typescript
import { Smartreport, ReportSection, ReportItem } from '@push.rocks/smartreport';
```
### Setting up Your Report
To set up a new report:
```typescript
const myReport = new Smartreport();
```
### Adding Report Sections
A report is comprised of various sections that can be individually added to the report instance. Each `ReportSection` can have a heading or name to distinguish what it represents.
```typescript
const salesReportSection = new ReportSection('Sales Data');
myReport.addReportSection(salesReportSection);
```
### Adding Items to a Section
Within each `ReportSection`, you can add multiple `ReportItem`s which represent the data or content of the section:
```typescript
const salesItem1 = new ReportItem(/* Include your data here */);
// Add data and configurations to salesItem1 as required
salesReportSection.addReportItem(salesItem1);
```
Repeat the process to add more sections and items as needed by your report.
### Customizing `ReportItem`
The `ReportItem` class can be extended or used to encapsulate data points, charts, or any form of data representation. Custom attributes and methods can be added to represent and process your data effectively. Currently, customization requires direct interaction with the class:
```typescript
class CustomReportItem extends ReportItem {
constructor(public data: any) {
super();
// Add custom initialization and methods here
}
}
const customItem = new CustomReportItem({metric: 'visitors', count: 1000});
salesReportSection.addReportItem(customItem);
```
This example demonstrates how to subclass `ReportItem` for custom data encapsulation. Implement data processing and presentation logic within your custom classes as needed.
### Displaying the Report
To display your report on the web, you will need to convert it into a format suitable for web consumption, such as HTML or JSON. This library focuses on the creation and structural organization of report data, so transforming the report into a web-friendly format and displaying it would require additional steps, potentially using other libraries or custom code to parse and render the data.
For example, to generate HTML:
```typescript
// This function is purely illustrative
function reportToHtml(report: Smartreport): string {
let htmlOutput = `<h1>My Report</h1>`;
report.reportSections.forEach(section => {
htmlOutput += `<h2>${section.name}</h2>`;
section.reportItems.forEach(item => {
// Implement custom rendering based on the item's data and type
htmlOutput += `<p>Item: ${/* item data representation */}</p>`;
});
});
return htmlOutput;
}
const myReportHtml = reportToHtml(myReport);
// Display `myReportHtml` in your web application
```
Note: The function `reportToHtml` is for illustration purposes and must be implemented based on your project's requirements.
### Conclusion
`@push.rocks/smartreport` provides the foundational tools to construct structured, data-driven reports. While creating and organizing report data is straightforward with `Smartreport`, transforming and displaying this data on the web requires additional handling suited to your application's architecture and presentation needs.
Remember, the Transformation and presentation layer for displaying the report on the web is up to you to implement. Use your preferred libraries and frameworks to bring your report data to life in the user interface.
## 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.