@stacksjs/git 0.64.6 → 0.65.0

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/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@stacksjs/git",
3
3
  "type": "module",
4
- "version": "0.64.6",
4
+ "version": "0.65.0",
5
5
  "description": "The Stacks git utilities & conventions.",
6
6
  "author": "Chris Breuer",
7
+ "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
8
  "license": "MIT",
8
9
  "funding": "https://github.com/sponsors/chrisbbreuer",
9
10
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/git#readme",
@@ -15,13 +16,7 @@
15
16
  "bugs": {
16
17
  "url": "https://github.com/stacksjs/stacks/issues"
17
18
  },
18
- "keywords": [
19
- "git",
20
- "github",
21
- "utilities",
22
- "functions",
23
- "stacks"
24
- ],
19
+ "keywords": ["git", "github", "utilities", "functions", "stacks"],
25
20
  "exports": {
26
21
  ".": {
27
22
  "bun": "./src/index.ts",
@@ -34,28 +29,21 @@
34
29
  },
35
30
  "module": "dist/index.js",
36
31
  "types": "dist/index.d.ts",
37
- "contributors": [
38
- "Chris Breuer <chris@stacksjs.org>"
39
- ],
40
- "files": [
41
- "README.md",
42
- "dist",
43
- "src"
44
- ],
32
+ "files": ["README.md", "dist", "src"],
45
33
  "scripts": {
46
- "build": "bun --bun build.ts",
47
- "typecheck": "bun --bun tsc --noEmit",
34
+ "build": "bun build.ts",
35
+ "typecheck": "bun tsc --noEmit",
48
36
  "prepublishOnly": "bun run build"
49
37
  },
50
38
  "dependencies": {
51
- "bumpp": "^9.5.2",
52
- "changelogen": "^0.5.5",
53
- "commitizen": "^4.3.0",
54
- "cz-git": "^1.9.4",
39
+ "bumpp": "^9.7.1",
40
+ "changelogen": "^0.5.7",
41
+ "commitizen": "^4.3.1",
42
+ "cz-git": "^1.10.1",
55
43
  "giget": "^1.2.3",
56
44
  "simple-git-hooks": "^2.11.1"
57
45
  },
58
46
  "devDependencies": {
59
- "@stacksjs/development": "latest"
47
+ "@stacksjs/development": "0.64.6"
60
48
  }
61
49
  }
package/src/index.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  export * as changelog from 'changelogen'
2
2
 
3
- export function useGitHub() {
3
+ interface UseGitHub {
4
+ getTimeDifference: (givenDateString: string) => string
5
+ formatDuration: (durationInSeconds: number) => string
6
+ getActionRunDuration: (startTime: Date, endTime: Date) => string
7
+ }
8
+
9
+ export function useGitHub(): UseGitHub {
4
10
  function getTimeDifference(givenDateString: string): string {
5
11
  // Convert the given date string to a Date object
6
12
  const givenDate: Date = new Date(givenDateString)
@@ -48,7 +54,8 @@ export function useGitHub() {
48
54
  const minutes = Math.floor(durationInSeconds / 60)
49
55
  const seconds = durationInSeconds % 60
50
56
 
51
- if (minutes > 1) return `${minutes}m ${seconds}s`
57
+ if (minutes > 1)
58
+ return `${minutes}m ${seconds}s`
52
59
 
53
60
  return `${seconds}s`
54
61
  }