@sit-onyx/github-metrics 0.0.0 → 0.1.1-dev-20261123100908

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt CHANGED
@@ -175,7 +175,7 @@
175
175
 
176
176
  END OF TERMS AND CONDITIONS
177
177
 
178
- Copyright 2023 Schwarz IT KG
178
+ Copyright 2023 Schwarz Digits IT KG
179
179
 
180
180
  Licensed under the Apache License, Version 2.0 (the "License");
181
181
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <div align="center" style="text-align: center">
2
- <img alt="onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/.github/onyx-logo.svg" height="96px">
2
+ <img alt="Onyx logo" src="https://raw.githubusercontent.com/SchwarzIT/onyx/main/packages/assets/src/onyx-brand/signet.svg" height="96px">
3
3
  </div>
4
4
 
5
5
  <br>
6
6
 
7
7
  # @sit-onyx/github-metrics
8
8
 
9
- Utilities for collecting metrics for GitHub projects. Created by [Schwarz IT](https://it.schwarz).
9
+ Utilities for collecting metrics for GitHub projects. Created by [Schwarz Digits](https://schwarz-digits.de).
10
10
 
11
11
  ## Documentation
12
12
 
@@ -1,7 +1,7 @@
1
1
  import type { IterationBasedMetricOptions } from "../types.js";
2
2
  /**
3
- * Calculates the bug fixing ratio in the given iteration (how much time is spend on bugs in relation to other stories).
4
- * Items without an assigned size will be ignored.
3
+ * Calculates the bug fixing ratio in the given iteration (how much time is spend on bugs in
4
+ * relation to other stories). Items without an assigned size will be ignored.
5
5
  */
6
6
  export declare function getBugFixingRatio(options: IterationBasedMetricOptions): Promise<{
7
7
  ratio: number;
@@ -1,7 +1,7 @@
1
1
  import { getAllItemsByIterationDate } from "../utils/client.js";
2
2
  /**
3
- * Calculates the bug fixing ratio in the given iteration (how much time is spend on bugs in relation to other stories).
4
- * Items without an assigned size will be ignored.
3
+ * Calculates the bug fixing ratio in the given iteration (how much time is spend on bugs in
4
+ * relation to other stories). Items without an assigned size will be ignored.
5
5
  */
6
6
  export async function getBugFixingRatio(options) {
7
7
  const { items: allItems, iteration } = await getAllItemsByIterationDate(options.client, options.iteration ?? new Date());
package/dist/types.d.ts CHANGED
@@ -3,7 +3,8 @@ export type CreateClientOptions = {
3
3
  /**
4
4
  * Name of the GitHub organization
5
5
  *
6
- * @example "SchwarzIT"
6
+ * @example
7
+ * "SchwarzIT";
7
8
  */
8
9
  organization: string;
9
10
  /**
@@ -11,12 +12,14 @@ export type CreateClientOptions = {
11
12
  */
12
13
  projectId: number;
13
14
  /**
14
- * GitHub token to use for authentication.
15
- * It is recommended to use an environment variable for this and NOT include it in any public code or commit.
15
+ * GitHub token to use for authentication. It is recommended to use an environment variable for
16
+ * this and NOT include it in any public code or commit.
16
17
  *
17
- * To get a GitHub token, go to: https://github.com/settings/tokens and create a new token with scope "read:project".
18
+ * To get a GitHub token, go to: https://github.com/settings/tokens and create a new token with
19
+ * scope "read:project".
18
20
  *
19
- * @example `authToken: process.env.GITHUB_TOKEN`
21
+ * @example
22
+ * `authToken: process.env.GITHUB_TOKEN`;
20
23
  */
21
24
  authToken: string;
22
25
  /**
@@ -26,8 +29,8 @@ export type CreateClientOptions = {
26
29
  /**
27
30
  * Fetch function to use for making HTTP requests.
28
31
  *
29
- * @default `global.fetch``
30
32
  * @private Only intended for internal usage / testing
33
+ * @default `global.fetch`
31
34
  */
32
35
  fetch?: typeof global.fetch;
33
36
  };
@@ -35,13 +38,15 @@ export type ClientProjectFields = {
35
38
  /**
36
39
  * Name of the numeric field that represents your Story effort/size/estimation.
37
40
  *
38
- * @example "Effort"
41
+ * @example
42
+ * "Effort";
39
43
  */
40
44
  effort: string;
41
45
  /**
42
46
  * Name of the iteration field that represents your iteration/sprint.
43
47
  *
44
- * @example "Sprint"
48
+ * @example
49
+ * "Sprint";
45
50
  */
46
51
  iteration: string;
47
52
  /**
@@ -1,6 +1,7 @@
1
1
  import type { Client, CreateClientOptions, Iteration, ProjectItem, RunQueryOptions } from "../types.js";
2
2
  /**
3
- * Creates a new client that can be used to collect metrics from a GitHub project / interact with the GitHub GraphQL API.
3
+ * Creates a new client that can be used to collect metrics from a GitHub project / interact with
4
+ * the GitHub GraphQL API.
4
5
  */
5
6
  export declare function createClient(options: CreateClientOptions): {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  import { findIterationByDate } from "./github.js";
2
2
  /**
3
- * Creates a new client that can be used to collect metrics from a GitHub project / interact with the GitHub GraphQL API.
3
+ * Creates a new client that can be used to collect metrics from a GitHub project / interact with
4
+ * the GitHub GraphQL API.
4
5
  */
5
6
  export function createClient(options) {
6
7
  /**
package/package.json CHANGED
@@ -1,25 +1,22 @@
1
1
  {
2
2
  "name": "@sit-onyx/github-metrics",
3
+ "version": "0.1.1-dev-20261123100908",
3
4
  "description": "Utilities for collecting metrics for GitHub projects",
4
- "version": "0.0.0",
5
- "type": "module",
6
- "author": "Schwarz IT KG",
7
- "license": "Apache-2.0",
8
- "sideEffects": false,
9
- "engines": {
10
- "node": ">=20"
5
+ "bugs": {
6
+ "url": "https://github.com/SchwarzIT/onyx/issues"
11
7
  },
8
+ "license": "Apache-2.0",
9
+ "author": "Schwarz Digits IT KG",
12
10
  "repository": {
13
11
  "type": "git",
14
12
  "url": "https://github.com/SchwarzIT/onyx",
15
13
  "directory": "packages/github-metrics"
16
14
  },
17
- "bugs": {
18
- "url": "https://github.com/SchwarzIT/onyx/issues"
19
- },
20
15
  "files": [
21
16
  "dist"
22
17
  ],
18
+ "type": "module",
19
+ "sideEffects": false,
23
20
  "exports": {
24
21
  ".": {
25
22
  "types": "./dist/index.d.ts",
@@ -27,12 +24,15 @@
27
24
  }
28
25
  },
29
26
  "devDependencies": {
30
- "dotenv": "^17.2.3",
31
- "tsx": "^4.20.6",
32
27
  "@sit-onyx/shared": "^0.1.0"
33
28
  },
29
+ "engines": {
30
+ "node": ">=22"
31
+ },
34
32
  "scripts": {
35
- "dev": "tsx ./scripts/onyx.ts",
33
+ "dev": "pnpm run '/^dev:/'",
34
+ "dev:build": "pnpm run build --watch",
35
+ "dev:run": "node --env-file-if-exists=.env --watch --experimental-strip-types ./scripts/onyx.ts",
36
36
  "build": "rm -rf ./dist && tsc",
37
37
  "test": "vitest"
38
38
  }