17 Commits

Author SHA1 Message Date
cbfc7e7b94 1.0.12 2024-06-23 12:57:24 +02:00
659ff9d6a0 fix(core): update 2024-06-23 12:57:23 +02:00
7f5d0ad68a update description 2024-05-29 13:55:22 +02:00
b1e03f8657 update tsconfig 2024-04-14 13:33:50 +02:00
57bcd8e30b update npmextra.json: githost 2024-04-01 21:32:55 +02:00
08144be520 update npmextra.json: githost 2024-04-01 19:57:16 +02:00
083a909ec4 update npmextra.json: githost 2024-03-30 21:46:12 +01:00
5414142deb switch to new org scheme 2023-07-10 23:54:19 +02:00
9649b3e4a8 switch to new org scheme 2023-07-10 02:41:05 +02:00
ac28f05a23 1.0.11 2022-04-28 16:26:38 +02:00
0f9b261f3e fix(core): update 2022-04-28 16:26:38 +02:00
15fa4305b9 1.0.10 2022-04-28 16:25:24 +02:00
831e0b8933 fix(core): update 2022-04-28 16:25:23 +02:00
7d808972c9 1.0.9 2022-04-28 16:19:22 +02:00
e7d7ec806e fix(core): update 2022-04-28 16:19:22 +02:00
2ecc541989 1.0.8 2022-04-28 11:24:27 +02:00
22dddb0e11 fix(core): update 2022-04-28 11:24:27 +02:00
13 changed files with 7510 additions and 551 deletions

View File

@ -123,7 +123,7 @@ pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci command npm install -g @git.zone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc

View File

@ -2,17 +2,31 @@
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "commitinfo",
"description": "bake commitinfos into code",
"npmPackagename": "@pushrocks/commitinfo",
"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"
},
"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"
}
}

982
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
{
"name": "@pushrocks/commitinfo",
"version": "1.0.7",
"name": "@push.rocks/commitinfo",
"version": "1.0.12",
"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",
@ -13,11 +13,12 @@
"build": "(tsbuild --web --allowimplicitany)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.44",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^17.0.27"
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsbundle": "^2.0.8",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.77",
"@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.14.8"
},
"browserslist": [
"last 1 chrome versions"
@ -35,8 +36,24 @@
"readme.md"
],
"dependencies": {
"@pushrocks/projectinfo": "^5.0.1",
"@pushrocks/smartfile": "^9.0.6",
"@pushrocks/smartversion": "^3.0.1"
"@push.rocks/projectinfo": "^5.0.1",
"@push.rocks/smartfile": "^10.0.26",
"@push.rocks/smartversion": "^3.0.2"
},
"keywords": [
"version control",
"commit information",
"typescript",
"node.js",
"software development",
"project management",
"code maintenance",
"continuous integration",
"continuous deployment"
],
"homepage": "https://code.foss.global/push.rocks/commitinfo",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/commitinfo.git"
}
}

6875
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

View File

@ -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 projects 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.

View File

@ -1,4 +1,4 @@
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as commitinfo from '../ts/index.js';
tap.test('first test', async () => {

View File

@ -1,5 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const version: string = '1.0.7';
export default version;
export const commitinfo = {
name: '@push.rocks/commitinfo',
version: '1.0.12',
description: 'A tool to bake commit information into code for tracking and version control.'
}

View File

@ -13,20 +13,25 @@ export class CommitInfo {
this.smartVersionRef = new plugins.smartversion.SmartVersion(this.projectinfoNpmRef.version);
}
public async getNextPlannedVersion() {
return this.smartVersionRef.getNewVersion(this.plannedCommitVersionTypeArg);
}
public async writeIntoPotentialDirs(potentialDirs: string[] = ['ts', 'ts_web']) {
const expectedDefinitiveVersion = this.smartVersionRef.getNewVersion(
this.plannedCommitVersionTypeArg
);
const expectedDefinitiveVersion = await this.getNextPlannedVersion();
for (const dir of potentialDirs) {
const dirExists = plugins.smartfile.fs.isDirectory(plugins.path.join(this.projectDir, dir));
if (dirExists) {
const writePath = plugins.path.join(this.projectDir, dir, '00_commitinfo_data.ts');
await plugins.smartfile.memory.toFs(
`/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const version: string = '${expectedDefinitiveVersion.versionString}';
export default version;
export const commitinfo = {
name: '${this.projectinfoNpmRef.name}',
version: '${expectedDefinitiveVersion.versionString}',
description: '${this.projectinfoNpmRef.packageJson.description}'
}
`,
writePath
);

View File

@ -6,9 +6,9 @@ export {
}
// pushrocks scope
import * as projectinfo from '@pushrocks/projectinfo';
import * as smartfile from '@pushrocks/smartfile';
import * as smartversion from '@pushrocks/smartversion';
import * as projectinfo from '@push.rocks/projectinfo';
import * as smartfile from '@push.rocks/smartfile';
import * as smartversion from '@push.rocks/smartversion';
export {
projectinfo,

View File

@ -1 +1,2 @@
export * from './commitinfo.classes.commitinfo.js';
export * from './commitinfo.classes.commitinfo.js';
export { commitinfo } from './00_commitinfo_data.js';

View File

@ -3,7 +3,12 @@
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}