From b1e03f8657c10f654a4afcd74661a43c860744e6 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sun, 14 Apr 2024 13:33:50 +0200 Subject: [PATCH] update tsconfig --- npmextra.json | 17 +++++++-- package.json | 15 ++++++-- readme.hints.md | 1 + readme.md | 92 ++++++++++++++++++++++++++++++++++--------------- 4 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 readme.hints.md diff --git a/npmextra.json b/npmextra.json index 5443b87..1cf8f24 100644 --- a/npmextra.json +++ b/npmextra.json @@ -5,17 +5,28 @@ "githost": "code.foss.global", "gitscope": "push.rocks", "gitrepo": "commitinfo", - "description": "bake commitinfos into code", + "description": "A tool to bake commit information into code for tracking and version control.", "npmPackagename": "@push.rocks/commitinfo", "license": "MIT", - "projectDomain": "push.rocks" + "projectDomain": "push.rocks", + "keywords": [ + "version control", + "commit information", + "typescript", + "node.js", + "software development", + "project management", + "code maintenance", + "continuous integration", + "continuous deployment" + ] } }, "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 3f33f55..38e8e0e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@push.rocks/commitinfo", "version": "1.0.11", "private": false, - "description": "bake commitinfos into code", + "description": "A tool to bake commit information into code for tracking and version control.", "main": "dist_ts/index.js", "typings": "dist_ts/index.d.ts", "type": "module", @@ -38,5 +38,16 @@ "@pushrocks/projectinfo": "^5.0.1", "@pushrocks/smartfile": "^9.0.6", "@pushrocks/smartversion": "^3.0.2" - } + }, + "keywords": [ + "version control", + "commit information", + "typescript", + "node.js", + "software development", + "project management", + "code maintenance", + "continuous integration", + "continuous deployment" + ] } \ 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 e405947..aee80f4 100644 --- a/readme.md +++ b/readme.md @@ -1,39 +1,77 @@ -# @pushrocks/commitinfo +# @push.rocks/commitinfo bake commitinfos into code -## Availabililty and Links -* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/commitinfo) -* [gitlab.com (source)](https://gitlab.com/pushrocks/commitinfo) -* [github.com (source mirror)](https://github.com/pushrocks/commitinfo) -* [docs (typedoc)](https://pushrocks.gitlab.io/commitinfo/) +## Install +To start using `@push.rocks/commitinfo`, you need to first install it via npm. To do this, run the following command in your terminal: -## Status for master +```sh +npm install @push.rocks/commitinfo --save +``` -Status Category | Status Badge --- | -- -GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/commitinfo/badges/master/pipeline.svg)](https://lossless.cloud) -GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/commitinfo/badges/master/coverage.svg)](https://lossless.cloud) -npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/commitinfo)](https://lossless.cloud) -Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/commitinfo)](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/commitinfo)](https://lossless.cloud) -PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/commitinfo)](https://lossless.cloud) -BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/commitinfo)](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) +This command will add `@push.rocks/commitinfo` to your project's dependencies in your `package.json` file. ## Usage +The `@push.rocks/commitinfo` module is designed to help you incorporate commit information directly into your TypeScript codebase. Below are detailed steps and examples to utilize the module effectively. -Use TypeScript for best info class intellisense +### Basic Setup +First, ensure that your project is set up to use TypeScript and ESM syntax. Then, you can proceed to import and use `@push.rocks/commitinfo` in your project. -## Contribution +```typescript +import { CommitInfo } from '@push.rocks/commitinfo'; -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). :) +// Specify your project directory and the planned version type of your next commit +const commitInfo = new CommitInfo('./path/to/your/project', 'patch'); -For further information read the linked docs at the top of this readme. +// Now you can use commitInfo to access or modify commit-related information +``` -> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) -| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) +### Writing Commit Info into Your Project +One of the primary uses of `@push.rocks/commitinfo` is to bake commit information into your project dynamically. This is especially useful for including version information, project description, etc., within your build artifacts. -[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) +```typescript +// Assuming you've initialized `commitInfo` as shown previously + +// Write commit info into potential directories like 'ts' or 'ts_web' +await commitInfo.writeIntoPotentialDirs(['ts', 'ts_web']); +``` + +This method will check for the existence of specified directories (e.g., 'ts' and 'ts_web') in your project and create a `00_commitinfo_data.ts` file with commit-related information in each present directory. + +### Using Commit Info in Your Project +After running the `writeIntoPotentialDirs` function, `00_commitinfo_data.ts` will be generated in the specified directories. You can then import this file anywhere in your project to access the baked commit information. + +```typescript +import { commitinfo } from './ts/00_commitinfo_data'; + +console.log(commitinfo.name); // Outputs: @push.rocks/commitinfo +console.log(commitinfo.version); // Outputs the version that was baked into the code +console.log(commitinfo.description); // Outputs: bake commitinfos into code +``` + +### Real-World Scenario: Automating Version Updates +A practical use case for `@push.rocks/commitinfo` is to automate the updating of version information across your project upon each new release. By integrating `commitInfo.writeIntoPotentialDirs()` into your CI/CD pipeline, you can ensure that each build artifact always contains the latest commit information, making it easier to trace back artifacts to specific versions and commits. + +### Extending Usage +The above examples provide a basic understanding of how to use `@push.rocks/commitinfo`. However, feel free to explore more advanced scenarios that fit your project's needs, such as customizing the generated `00_commitinfo_data.ts` file or creating a dedicated workflow for handling version bumps and commit information updates. + +### Conclusion +`@push.rocks/commitinfo` offers a streamlined and efficient way to incorporate dynamic commit information into your TypeScript projects. By following the examples and scenarios outlined above, you can enhance your project’s maintainability and traceability, ensuring that each piece of code can be unequivocally linked to specific commits and version updates. + +## 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.