update tsconfig
This commit is contained in:
parent
ce1ef50831
commit
4966edd60b
@ -8,14 +8,24 @@
|
|||||||
"shortDescription": "a smartlog source wrapping ora for local display",
|
"shortDescription": "a smartlog source wrapping ora for local display",
|
||||||
"npmPackagename": "@push.rocks/smartlog-source-ora",
|
"npmPackagename": "@push.rocks/smartlog-source-ora",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "push.rocks"
|
"projectDomain": "push.rocks",
|
||||||
|
"description": "A project that integrates smartlog logging capabilities with the ora spinner for visually appealing CLI output.",
|
||||||
|
"keywords": [
|
||||||
|
"logging",
|
||||||
|
"smartlog",
|
||||||
|
"ora spinner",
|
||||||
|
"CLI",
|
||||||
|
"typescript",
|
||||||
|
"node.js",
|
||||||
|
"developer tools"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"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"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
11
package.json
11
package.json
@ -2,7 +2,7 @@
|
|||||||
"name": "@push.rocks/smartlog-source-ora",
|
"name": "@push.rocks/smartlog-source-ora",
|
||||||
"version": "1.0.9",
|
"version": "1.0.9",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a smartlog source wrapping ora for local display",
|
"description": "A project that integrates smartlog logging capabilities with the ora spinner for visually appealing CLI output.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
@ -35,5 +35,14 @@
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"logging",
|
||||||
|
"smartlog",
|
||||||
|
"ora spinner",
|
||||||
|
"CLI",
|
||||||
|
"typescript",
|
||||||
|
"node.js",
|
||||||
|
"developer tools"
|
||||||
]
|
]
|
||||||
}
|
}
|
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
146
readme.md
146
readme.md
@ -1,38 +1,132 @@
|
|||||||
# @pushrocks/smartlog-source-ora
|
# @push.rocks/smartlog-source-ora
|
||||||
a smartlog source wrapping ora for local display
|
a smartlog source wrapping ora for local display
|
||||||
|
|
||||||
## Availabililty and Links
|
## Install
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartlog-source-ora)
|
|
||||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartlog-source-ora)
|
|
||||||
* [github.com (source mirror)](https://github.com/pushrocks/smartlog-source-ora)
|
|
||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartlog-source-ora/)
|
|
||||||
|
|
||||||
## Status for master
|
To use `@push.rocks/smartlog-source-ora` in your project, you need to include it via npm. Run the following command to install it:
|
||||||
|
|
||||||
Status Category | Status Badge
|
```bash
|
||||||
-- | --
|
npm install @push.rocks/smartlog-source-ora --save
|
||||||
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartlog-source-ora/badges/master/pipeline.svg)](https://lossless.cloud)
|
```
|
||||||
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartlog-source-ora/badges/master/coverage.svg)](https://lossless.cloud)
|
|
||||||
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartlog-source-ora)](https://lossless.cloud)
|
This will add `@push.rocks/smartlog-source-ora` to your project's dependencies.
|
||||||
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartlog-source-ora)](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/smartlog-source-ora)](https://lossless.cloud)
|
|
||||||
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartlog-source-ora)](https://lossless.cloud)
|
|
||||||
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartlog-source-ora)](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)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
This library provides a convenient way to use the `ora` spinner in combination with the `smartlog` logging solution. It is great for CLI applications or any other Node.js project where you need to indicate progress or loading states in a visually appealing way. Below are examples demonstrating how to integrate and use `@push.rocks/smartlog-source-ora` in your projects.
|
||||||
|
|
||||||
## Contribution
|
### Importing and Initialization
|
||||||
|
|
||||||
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). :)
|
To start using `@push.rocks/smartlog-source-ora`, you first need to import the library and initialize an instance of `SmartlogSourceOra`.
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
```typescript
|
||||||
|
import { SmartlogSourceOra } from '@push.rocks/smartlog-source-ora';
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
const smartlogOra = new SmartlogSourceOra();
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
```
|
||||||
|
|
||||||
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
|
### Displaying Text with the Spinner
|
||||||
|
|
||||||
|
Once you have your `SmartlogSourceOra` instance, you can start displaying messages with an accompanying spinner. This is particularly useful when you want to inform the user about the current status of operations.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
smartlogOra.text('Loading resources...');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manipulating the Spinner State
|
||||||
|
|
||||||
|
`@push.rocks/smartlog-source-ora` allows you to control the spinner state by stopping it, marking it as successful, or indicating failure. Each method allows for an optional text message to be displayed.
|
||||||
|
|
||||||
|
#### Stopping the Spinner
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
smartlogOra.stop();
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Indicating Success
|
||||||
|
|
||||||
|
To indicate that the operation was successful, you can use the `finishSuccess()` method. Optionally, you can pass a message to be displayed alongside the success indication.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
smartlogOra.finishSuccess('Resources loaded successfully.');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Indicating Failure
|
||||||
|
|
||||||
|
Similarly, if an operation fails, you can use the `finishFail()` method to display a failure message.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
smartlogOra.finishFail('Failed to load resources.');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Success/Failure and Moving to the Next Operation
|
||||||
|
|
||||||
|
`@push.rocks/smartlog-source-ora` also provides convenient methods to indicate the success or failure of an operation and immediately moves on to the text of the next operation.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Indicating success and moving on
|
||||||
|
smartlogOra.successAndNext('Resources loaded. Initializing...');
|
||||||
|
|
||||||
|
// Indicating failure and moving on
|
||||||
|
smartlogOra.failAndNext('Failed to load resources. Retrying...');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Integrating with `smartlogInterfaces`
|
||||||
|
|
||||||
|
This module is designed to integrate seamlessly with `smartlogInterfaces`, allowing for a unified logging solution across your project.
|
||||||
|
|
||||||
|
To achieve comprehensive logging and progress indication, consider extending `SmartlogSourceOra` with functionality to integrate logging levels and message types according to `smartlogInterfaces`. This ensures a coherent user experience where log messages and progress indicators work hand in hand.
|
||||||
|
|
||||||
|
### Complete Example
|
||||||
|
|
||||||
|
Below is a concise example that brings together all the above elements, demonstrating how `@push.rocks/smartlog-source-ora` can be used in a real-world scenario:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { SmartlogSourceOra } from '@push.rocks/smartlog-source-ora';
|
||||||
|
|
||||||
|
async function performOperations() {
|
||||||
|
const smartlogOra = new SmartlogSourceOra();
|
||||||
|
|
||||||
|
try {
|
||||||
|
smartlogOra.text('Starting operation 1...');
|
||||||
|
// simulate operation
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
|
smartlogOra.finishSuccess('Operation 1 completed.');
|
||||||
|
|
||||||
|
smartlogOra.text('Starting operation 2...');
|
||||||
|
// simulate operation
|
||||||
|
await new Promise((resolve, reject) => setTimeout(reject, 2000));
|
||||||
|
} catch (error) {
|
||||||
|
smartlogOra.finishFail('Operation 2 failed. Check logs for details.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
performOperations();
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example, `performOperations()` makes use of the `@push.rocks/smartlog-source-ora` module to provide real-time feedback to the user about the operations being performed. It demonstrates how to indicate the beginning of an operation, success completion, and handling failures, offering a comprehensive user experience.
|
||||||
|
|
||||||
|
### Conclusion
|
||||||
|
|
||||||
|
The integration of `@push.rocks/smartlog-source-ora` into your application not only improves the visual feedback during operations but also contributes to a better user experience by clearly communicating the state of operations in real time. Whether you're building CLI tools or applications that require status updates, `@push.rocks/smartlog-source-ora` provides a straightforward and elegant solution.
|
||||||
|
|
||||||
|
For any further assistance or more advanced use cases, you may delve into the source code and explore additional features that may suit your specific needs. 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user