generated from nhcarrigan/template
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c85cf4cf1d | |||
| 4643e99447 | |||
| 9bdefdb030 | |||
| d9f959d115 |
+5
-5
@@ -17,14 +17,14 @@
|
||||
"devDependencies": {
|
||||
"@nhcarrigan/eslint-config": "5.2.0",
|
||||
"@nhcarrigan/typescript-config": "4.0.0",
|
||||
"@types/node": "25.2.3",
|
||||
"@types/node": "25.2.0",
|
||||
"@types/node-cron": "3.0.11",
|
||||
"@types/semver": "7.7.1",
|
||||
"@vitest/coverage-istanbul": "^4.0.18",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/coverage-istanbul": "4.0.18",
|
||||
"@vitest/coverage-v8": "4.0.18",
|
||||
"eslint": "9.39.2",
|
||||
"typescript": "5.9.3",
|
||||
"vitest": "^4.0.18"
|
||||
"typescript": "6.0.2",
|
||||
"vitest": "4.0.18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nhcarrigan/logger": "1.1.1",
|
||||
|
||||
Generated
+98
-98
@@ -23,13 +23,13 @@ importers:
|
||||
devDependencies:
|
||||
'@nhcarrigan/eslint-config':
|
||||
specifier: 5.2.0
|
||||
version: 5.2.0(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(playwright@1.58.1)(react@19.2.4)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.3))
|
||||
version: 5.2.0(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(playwright@1.58.1)(react@19.2.4)(typescript@6.0.2)(vitest@4.0.18(@types/node@25.2.0))
|
||||
'@nhcarrigan/typescript-config':
|
||||
specifier: 4.0.0
|
||||
version: 4.0.0(typescript@5.9.3)
|
||||
version: 4.0.0(typescript@6.0.2)
|
||||
'@types/node':
|
||||
specifier: 25.2.3
|
||||
version: 25.2.3
|
||||
specifier: 25.2.0
|
||||
version: 25.2.0
|
||||
'@types/node-cron':
|
||||
specifier: 3.0.11
|
||||
version: 3.0.11
|
||||
@@ -37,20 +37,20 @@ importers:
|
||||
specifier: 7.7.1
|
||||
version: 7.7.1
|
||||
'@vitest/coverage-istanbul':
|
||||
specifier: ^4.0.18
|
||||
version: 4.0.18(vitest@4.0.18(@types/node@25.2.3))
|
||||
specifier: 4.0.18
|
||||
version: 4.0.18(vitest@4.0.18(@types/node@25.2.0))
|
||||
'@vitest/coverage-v8':
|
||||
specifier: ^4.0.18
|
||||
version: 4.0.18(vitest@4.0.18(@types/node@25.2.3))
|
||||
specifier: 4.0.18
|
||||
version: 4.0.18(vitest@4.0.18(@types/node@25.2.0))
|
||||
eslint:
|
||||
specifier: 9.39.2
|
||||
version: 9.39.2
|
||||
typescript:
|
||||
specifier: 5.9.3
|
||||
version: 5.9.3
|
||||
specifier: 6.0.2
|
||||
version: 6.0.2
|
||||
vitest:
|
||||
specifier: ^4.0.18
|
||||
version: 4.0.18(@types/node@25.2.3)
|
||||
specifier: 4.0.18
|
||||
version: 4.0.18(@types/node@25.2.0)
|
||||
|
||||
packages:
|
||||
|
||||
@@ -572,8 +572,8 @@ packages:
|
||||
'@types/node-cron@3.0.11':
|
||||
resolution: {integrity: sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==}
|
||||
|
||||
'@types/node@25.2.3':
|
||||
resolution: {integrity: sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==}
|
||||
'@types/node@25.2.0':
|
||||
resolution: {integrity: sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==}
|
||||
|
||||
'@types/normalize-package-data@2.4.4':
|
||||
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
|
||||
@@ -2044,8 +2044,8 @@ packages:
|
||||
resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
typescript@5.9.3:
|
||||
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
|
||||
typescript@6.0.2:
|
||||
resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
@@ -2471,19 +2471,19 @@ snapshots:
|
||||
'@jridgewell/resolve-uri': 3.1.2
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
|
||||
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(playwright@1.58.1)(react@19.2.4)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.3))':
|
||||
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(playwright@1.58.1)(react@19.2.4)(typescript@6.0.2)(vitest@4.0.18(@types/node@25.2.0))':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.39.2)
|
||||
'@eslint/compat': 1.2.4(eslint@9.39.2)
|
||||
'@eslint/eslintrc': 3.2.0
|
||||
'@eslint/js': 9.17.0
|
||||
'@stylistic/eslint-plugin': 2.12.1(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.3))
|
||||
'@stylistic/eslint-plugin': 2.12.1(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(typescript@6.0.2)(vitest@4.0.18(@types/node@25.2.0))
|
||||
eslint: 9.39.2
|
||||
eslint-plugin-deprecation: 3.0.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)
|
||||
eslint-plugin-deprecation: 3.0.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)
|
||||
eslint-plugin-jsdoc: 50.6.1(eslint@9.39.2)
|
||||
eslint-plugin-playwright: 2.1.0(eslint@9.39.2)
|
||||
eslint-plugin-react: 7.37.3(eslint@9.39.2)
|
||||
@@ -2492,8 +2492,8 @@ snapshots:
|
||||
globals: 15.14.0
|
||||
playwright: 1.58.1
|
||||
react: 19.2.4
|
||||
typescript: 5.9.3
|
||||
vitest: 4.0.18(@types/node@25.2.3)
|
||||
typescript: 6.0.2
|
||||
vitest: 4.0.18(@types/node@25.2.0)
|
||||
transitivePeerDependencies:
|
||||
- '@typescript-eslint/utils'
|
||||
- eslint-import-resolver-typescript
|
||||
@@ -2502,9 +2502,9 @@ snapshots:
|
||||
|
||||
'@nhcarrigan/logger@1.1.1': {}
|
||||
|
||||
'@nhcarrigan/typescript-config@4.0.0(typescript@5.9.3)':
|
||||
'@nhcarrigan/typescript-config@4.0.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
dependencies:
|
||||
@@ -2599,9 +2599,9 @@ snapshots:
|
||||
|
||||
'@standard-schema/spec@1.1.0': {}
|
||||
|
||||
'@stylistic/eslint-plugin@2.12.1(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@stylistic/eslint-plugin@2.12.1(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
eslint-visitor-keys: 4.2.1
|
||||
espree: 10.4.0
|
||||
@@ -2626,7 +2626,7 @@ snapshots:
|
||||
|
||||
'@types/node-cron@3.0.11': {}
|
||||
|
||||
'@types/node@25.2.3':
|
||||
'@types/node@25.2.0':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
@@ -2634,41 +2634,41 @@ snapshots:
|
||||
|
||||
'@types/semver@7.7.1': {}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.2
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@typescript-eslint/scope-manager': 8.19.0
|
||||
'@typescript-eslint/type-utils': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/utils': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/type-utils': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@typescript-eslint/utils': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
'@typescript-eslint/visitor-keys': 8.19.0
|
||||
eslint: 9.39.2
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
natural-compare: 1.4.0
|
||||
ts-api-utils: 1.4.3(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
ts-api-utils: 1.4.3(typescript@6.0.2)
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.19.0
|
||||
'@typescript-eslint/types': 8.19.0
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@6.0.2)
|
||||
'@typescript-eslint/visitor-keys': 8.19.0
|
||||
debug: 4.4.3
|
||||
eslint: 9.39.2
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/project-service@8.54.0(typescript@5.9.3)':
|
||||
'@typescript-eslint/project-service@8.54.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/tsconfig-utils': 8.54.0(typescript@5.9.3)
|
||||
'@typescript-eslint/tsconfig-utils': 8.54.0(typescript@6.0.2)
|
||||
'@typescript-eslint/types': 8.54.0
|
||||
debug: 4.4.3
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -2687,18 +2687,18 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.54.0
|
||||
'@typescript-eslint/visitor-keys': 8.54.0
|
||||
|
||||
'@typescript-eslint/tsconfig-utils@8.54.0(typescript@5.9.3)':
|
||||
'@typescript-eslint/tsconfig-utils@8.54.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
|
||||
'@typescript-eslint/type-utils@8.19.0(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/type-utils@8.19.0(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
|
||||
'@typescript-eslint/utils': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@6.0.2)
|
||||
'@typescript-eslint/utils': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
debug: 4.4.3
|
||||
eslint: 9.39.2
|
||||
ts-api-utils: 1.4.3(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
ts-api-utils: 1.4.3(typescript@6.0.2)
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -2708,7 +2708,7 @@ snapshots:
|
||||
|
||||
'@typescript-eslint/types@8.54.0': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@7.18.0(typescript@5.9.3)':
|
||||
'@typescript-eslint/typescript-estree@7.18.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/visitor-keys': 7.18.0
|
||||
@@ -2717,13 +2717,13 @@ snapshots:
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.7.3
|
||||
ts-api-utils: 1.4.3(typescript@5.9.3)
|
||||
ts-api-utils: 1.4.3(typescript@6.0.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.19.0(typescript@5.9.3)':
|
||||
'@typescript-eslint/typescript-estree@8.19.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.19.0
|
||||
'@typescript-eslint/visitor-keys': 8.19.0
|
||||
@@ -2732,56 +2732,56 @@ snapshots:
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.7.3
|
||||
ts-api-utils: 1.4.3(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
ts-api-utils: 1.4.3(typescript@6.0.2)
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.54.0(typescript@5.9.3)':
|
||||
'@typescript-eslint/typescript-estree@8.54.0(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/project-service': 8.54.0(typescript@5.9.3)
|
||||
'@typescript-eslint/tsconfig-utils': 8.54.0(typescript@5.9.3)
|
||||
'@typescript-eslint/project-service': 8.54.0(typescript@6.0.2)
|
||||
'@typescript-eslint/tsconfig-utils': 8.54.0(typescript@6.0.2)
|
||||
'@typescript-eslint/types': 8.54.0
|
||||
'@typescript-eslint/visitor-keys': 8.54.0
|
||||
debug: 4.4.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.7.3
|
||||
tinyglobby: 0.2.15
|
||||
ts-api-utils: 2.4.0(typescript@5.9.3)
|
||||
typescript: 5.9.3
|
||||
ts-api-utils: 2.4.0(typescript@6.0.2)
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@7.18.0(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/utils@7.18.0(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
|
||||
'@typescript-eslint/scope-manager': 7.18.0
|
||||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3)
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@typescript-eslint/utils@8.19.0(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/utils@8.19.0(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
|
||||
'@typescript-eslint/scope-manager': 8.19.0
|
||||
'@typescript-eslint/types': 8.19.0
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
|
||||
'@typescript-eslint/typescript-estree': 8.19.0(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3)':
|
||||
'@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@6.0.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
|
||||
'@typescript-eslint/scope-manager': 8.54.0
|
||||
'@typescript-eslint/types': 8.54.0
|
||||
'@typescript-eslint/typescript-estree': 8.54.0(typescript@5.9.3)
|
||||
'@typescript-eslint/typescript-estree': 8.54.0(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
@@ -2800,7 +2800,7 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.54.0
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
||||
'@vitest/coverage-istanbul@4.0.18(vitest@4.0.18(@types/node@25.2.3))':
|
||||
'@vitest/coverage-istanbul@4.0.18(vitest@4.0.18(@types/node@25.2.0))':
|
||||
dependencies:
|
||||
'@istanbuljs/schema': 0.1.3
|
||||
'@jridgewell/gen-mapping': 0.3.13
|
||||
@@ -2812,11 +2812,11 @@ snapshots:
|
||||
magicast: 0.5.1
|
||||
obug: 2.1.1
|
||||
tinyrainbow: 3.0.3
|
||||
vitest: 4.0.18(@types/node@25.2.3)
|
||||
vitest: 4.0.18(@types/node@25.2.0)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@25.2.3))':
|
||||
'@vitest/coverage-v8@4.0.18(vitest@4.0.18(@types/node@25.2.0))':
|
||||
dependencies:
|
||||
'@bcoe/v8-coverage': 1.0.2
|
||||
'@vitest/utils': 4.0.18
|
||||
@@ -2828,15 +2828,15 @@ snapshots:
|
||||
obug: 2.1.1
|
||||
std-env: 3.10.0
|
||||
tinyrainbow: 3.0.3
|
||||
vitest: 4.0.18(@types/node@25.2.3)
|
||||
vitest: 4.0.18(@types/node@25.2.0)
|
||||
|
||||
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.3))':
|
||||
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2)(typescript@6.0.2)(vitest@4.0.18(@types/node@25.2.0))':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
optionalDependencies:
|
||||
typescript: 5.9.3
|
||||
vitest: 4.0.18(@types/node@25.2.3)
|
||||
typescript: 6.0.2
|
||||
vitest: 4.0.18(@types/node@25.2.0)
|
||||
|
||||
'@vitest/expect@4.0.18':
|
||||
dependencies:
|
||||
@@ -2847,13 +2847,13 @@ snapshots:
|
||||
chai: 6.2.2
|
||||
tinyrainbow: 3.0.3
|
||||
|
||||
'@vitest/mocker@4.0.18(vite@7.3.1(@types/node@25.2.3))':
|
||||
'@vitest/mocker@4.0.18(vite@7.3.1(@types/node@25.2.0))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.0.18
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 7.3.1(@types/node@25.2.3)
|
||||
vite: 7.3.1(@types/node@25.2.0)
|
||||
|
||||
'@vitest/pretty-format@4.0.18':
|
||||
dependencies:
|
||||
@@ -3292,27 +3292,27 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2):
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2):
|
||||
dependencies:
|
||||
debug: 3.2.7
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-plugin-deprecation@3.0.0(eslint@9.39.2)(typescript@5.9.3):
|
||||
eslint-plugin-deprecation@3.0.0(eslint@9.39.2)(typescript@6.0.2):
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
eslint: 9.39.2
|
||||
ts-api-utils: 1.4.3(typescript@5.9.3)
|
||||
ts-api-utils: 1.4.3(typescript@6.0.2)
|
||||
tslib: 2.8.1
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint@9.39.2):
|
||||
eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint@9.39.2):
|
||||
dependencies:
|
||||
'@rtsao/scc': 1.1.0
|
||||
array-includes: 3.1.9
|
||||
@@ -3323,7 +3323,7 @@ snapshots:
|
||||
doctrine: 2.1.0
|
||||
eslint: 9.39.2
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2)
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@6.0.2))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2)
|
||||
hasown: 2.0.2
|
||||
is-core-module: 2.16.1
|
||||
is-glob: 4.0.3
|
||||
@@ -3335,7 +3335,7 @@ snapshots:
|
||||
string.prototype.trimend: 1.0.9
|
||||
tsconfig-paths: 3.15.0
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
|
||||
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@6.0.2)
|
||||
transitivePeerDependencies:
|
||||
- eslint-import-resolver-typescript
|
||||
- eslint-import-resolver-webpack
|
||||
@@ -4381,13 +4381,13 @@ snapshots:
|
||||
dependencies:
|
||||
is-number: 7.0.0
|
||||
|
||||
ts-api-utils@1.4.3(typescript@5.9.3):
|
||||
ts-api-utils@1.4.3(typescript@6.0.2):
|
||||
dependencies:
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
|
||||
ts-api-utils@2.4.0(typescript@5.9.3):
|
||||
ts-api-utils@2.4.0(typescript@6.0.2):
|
||||
dependencies:
|
||||
typescript: 5.9.3
|
||||
typescript: 6.0.2
|
||||
|
||||
tsconfig-paths@3.15.0:
|
||||
dependencies:
|
||||
@@ -4441,7 +4441,7 @@ snapshots:
|
||||
possible-typed-array-names: 1.1.0
|
||||
reflect.getprototypeof: 1.0.10
|
||||
|
||||
typescript@5.9.3: {}
|
||||
typescript@6.0.2: {}
|
||||
|
||||
unbox-primitive@1.1.0:
|
||||
dependencies:
|
||||
@@ -4467,7 +4467,7 @@ snapshots:
|
||||
spdx-correct: 3.2.0
|
||||
spdx-expression-parse: 3.0.1
|
||||
|
||||
vite@7.3.1(@types/node@25.2.3):
|
||||
vite@7.3.1(@types/node@25.2.0):
|
||||
dependencies:
|
||||
esbuild: 0.27.2
|
||||
fdir: 6.5.0(picomatch@4.0.3)
|
||||
@@ -4476,13 +4476,13 @@ snapshots:
|
||||
rollup: 4.57.1
|
||||
tinyglobby: 0.2.15
|
||||
optionalDependencies:
|
||||
'@types/node': 25.2.3
|
||||
'@types/node': 25.2.0
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitest@4.0.18(@types/node@25.2.3):
|
||||
vitest@4.0.18(@types/node@25.2.0):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.0.18
|
||||
'@vitest/mocker': 4.0.18(vite@7.3.1(@types/node@25.2.3))
|
||||
'@vitest/mocker': 4.0.18(vite@7.3.1(@types/node@25.2.0))
|
||||
'@vitest/pretty-format': 4.0.18
|
||||
'@vitest/runner': 4.0.18
|
||||
'@vitest/snapshot': 4.0.18
|
||||
@@ -4499,10 +4499,10 @@ snapshots:
|
||||
tinyexec: 1.0.2
|
||||
tinyglobby: 0.2.15
|
||||
tinyrainbow: 3.0.3
|
||||
vite: 7.3.1(@types/node@25.2.3)
|
||||
vite: 7.3.1(@types/node@25.2.0)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 25.2.3
|
||||
'@types/node': 25.2.0
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
- less
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
import axios, { isAxiosError, type AxiosInstance } from "axios";
|
||||
import { config } from "../config.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type {
|
||||
GiteaCombinedStatus,
|
||||
GiteaFile,
|
||||
GiteaPullRequest,
|
||||
GiteaRepository,
|
||||
@@ -142,6 +144,87 @@ class GiteaService {
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the combined commit status for a specific commit by querying the Gitea API for all status checks.
|
||||
* @param owner - The repository owner.
|
||||
* @param repo - The repository name.
|
||||
* @param sha - The commit SHA to check.
|
||||
* @returns The combined status of all checks (pending, success, error, or failure).
|
||||
*/
|
||||
public async getCommitStatus(
|
||||
owner: string,
|
||||
repo: string,
|
||||
sha: string,
|
||||
): Promise<GiteaCombinedStatus> {
|
||||
const { data } = await this.client.get<GiteaCombinedStatus>(
|
||||
`/repos/${owner}/${repo}/commits/${sha}/status`,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges a pull request.
|
||||
* @param owner - The repository owner.
|
||||
* @param repo - The repository name.
|
||||
* @param index - The pull request index number.
|
||||
* @returns True if the merge was successful, false otherwise.
|
||||
*/
|
||||
public async mergePullRequest(
|
||||
owner: string,
|
||||
repo: string,
|
||||
index: number,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await this.client.post(
|
||||
`/repos/${owner}/${repo}/pulls/${String(index)}/merge`,
|
||||
{
|
||||
/* eslint-disable @typescript-eslint/naming-convention -- Gitea API uses snake_case */
|
||||
Do: "merge",
|
||||
MergeMessageField: "",
|
||||
MergeTitleField: "",
|
||||
delete_branch_after_merge: true,
|
||||
force_merge: true,
|
||||
head_commit_id: "",
|
||||
merge_when_checks_succeed: false,
|
||||
/* eslint-enable @typescript-eslint/naming-convention -- End Gitea API */
|
||||
},
|
||||
);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (isAxiosError(error)) {
|
||||
await logger.log(
|
||||
"warn",
|
||||
`Merge failed with status ${String(error.response?.status)}: ${JSON.stringify(error.response?.data)}`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a repository branch by name.
|
||||
* @param owner - The repository owner.
|
||||
* @param repo - The repository name.
|
||||
* @param branch - The branch name to remove.
|
||||
* @returns True if successful, false otherwise.
|
||||
*/
|
||||
public async deleteBranch(
|
||||
owner: string,
|
||||
repo: string,
|
||||
branch: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await this.client.delete(`/repos/${owner}/${repo}/branches/${branch}`);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (isAxiosError(error)) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { GiteaService };
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
import { config } from "../config.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import {
|
||||
isMajorVersionBump,
|
||||
stripVersionPrefix,
|
||||
} from "../utils/versionComparison.js";
|
||||
import { DependencyAnalyzerService } from "./dependencyAnalyzerService.js";
|
||||
import { GiteaService } from "./giteaService.js";
|
||||
import {
|
||||
@@ -17,15 +21,6 @@ import { NpmService } from "./npmService.js";
|
||||
import type { GiteaRepository } from "../types/gitea.types.js";
|
||||
import type { DependencyUpdate, PackageJson } from "../types/package.types.js";
|
||||
|
||||
/**
|
||||
* Strips version prefix characters from a version string.
|
||||
* @param version - The version string with potential prefixes.
|
||||
* @returns The version without prefix characters.
|
||||
*/
|
||||
const stripVersionPrefix = (version: string): string => {
|
||||
return version.replace(/^[<=>^~]*/, "");
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates the body content for a PR.
|
||||
* @param update - The dependency update information.
|
||||
@@ -142,6 +137,103 @@ class UpdateOrchestratorService {
|
||||
await logger.log("info", "Dependency update check complete!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to merge an existing PR after checking CI status.
|
||||
* @param repo - The repository information.
|
||||
* @param update - The dependency update details.
|
||||
* @param matchingPR - The existing PR with head SHA and number.
|
||||
* @param matchingPR.head - The PR head information.
|
||||
* @param matchingPR.head.sha - The commit SHA to check.
|
||||
* @param matchingPR.number - The PR number for merging.
|
||||
* @returns True if merge was attempted, false otherwise.
|
||||
*/
|
||||
private async attemptPRMerge(
|
||||
repo: GiteaRepository,
|
||||
update: DependencyUpdate,
|
||||
matchingPR: { head: { sha: string }; number: number },
|
||||
): Promise<boolean> {
|
||||
const commitStatus = await this.giteaService.getCommitStatus(
|
||||
config.giteaOrg,
|
||||
repo.name,
|
||||
matchingPR.head.sha,
|
||||
);
|
||||
|
||||
if (commitStatus.state !== "success") {
|
||||
await logger.log(
|
||||
"info",
|
||||
` PR exists for ${update.packageName} but CI status is ${commitStatus.state}, skipping auto-merge...`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
await logger.log(
|
||||
"info",
|
||||
` Auto-merging PR for ${update.packageName} (CI passed, non-major bump)...`,
|
||||
);
|
||||
|
||||
const merged = await this.giteaService.mergePullRequest(
|
||||
config.giteaOrg,
|
||||
repo.name,
|
||||
matchingPR.number,
|
||||
);
|
||||
|
||||
if (merged) {
|
||||
await logger.log(
|
||||
"info",
|
||||
` Successfully merged PR for ${update.packageName}`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
await logger.log(
|
||||
"warn",
|
||||
` Failed to merge PR for ${update.packageName}`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an existing PR can be auto-merged based on CI status and version bump type.
|
||||
* @param repo - The repository information.
|
||||
* @param update - The dependency update details.
|
||||
* @param branchName - The branch name for the PR.
|
||||
* @returns True if the PR exists and was handled, false otherwise.
|
||||
*/
|
||||
private async checkAndMergeExistingPR(
|
||||
repo: GiteaRepository,
|
||||
update: DependencyUpdate,
|
||||
branchName: string,
|
||||
): Promise<boolean> {
|
||||
const existingPRs = await this.giteaService.listPullRequests(
|
||||
config.giteaOrg,
|
||||
repo.name,
|
||||
"open",
|
||||
);
|
||||
|
||||
const matchingPR = existingPRs.find((pr) => {
|
||||
return pr.head.ref === branchName;
|
||||
});
|
||||
|
||||
if (matchingPR === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const isMajorBump = isMajorVersionBump(
|
||||
update.currentVersion,
|
||||
update.latestVersion,
|
||||
);
|
||||
|
||||
if (isMajorBump) {
|
||||
await logger.log(
|
||||
"info",
|
||||
` PR exists for ${update.packageName} but is a major version bump, skipping auto-merge...`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
return await this.attemptPRMerge(repo, update, matchingPR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a PR for a dependency update.
|
||||
* @param repo - The repository information.
|
||||
@@ -157,6 +249,16 @@ class UpdateOrchestratorService {
|
||||
= `${config.prBranchPrefix}${update.packageName.replaceAll(/[/@]/g, "-")}`;
|
||||
|
||||
try {
|
||||
const existingPRMerged = await this.checkAndMergeExistingPR(
|
||||
repo,
|
||||
update,
|
||||
branchName,
|
||||
);
|
||||
|
||||
if (existingPRMerged) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await createOrUpdateBranch({
|
||||
branchName: branchName,
|
||||
clonedRepo: clonedRepo,
|
||||
|
||||
@@ -39,6 +39,33 @@ interface GiteaPullRequest {
|
||||
state: "closed" | "open";
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface GiteaCommitStatus {
|
||||
context: string;
|
||||
created_at: string;
|
||||
description: string;
|
||||
id: number;
|
||||
state: "error" | "failure" | "pending" | "success" | "warning";
|
||||
target_url: string;
|
||||
updated_at: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface GiteaCombinedStatus {
|
||||
commit_url: string;
|
||||
repository: GiteaRepository;
|
||||
sha: string;
|
||||
state: "error" | "failure" | "pending" | "success" | "warning";
|
||||
statuses: Array<GiteaCommitStatus>;
|
||||
total_count: number;
|
||||
url: string;
|
||||
}
|
||||
/* eslint-enable @typescript-eslint/naming-convention -- End Gitea API types */
|
||||
|
||||
export type { GiteaFile, GiteaPullRequest, GiteaRepository };
|
||||
export type {
|
||||
GiteaCombinedStatus,
|
||||
GiteaCommitStatus,
|
||||
GiteaFile,
|
||||
GiteaPullRequest,
|
||||
GiteaRepository,
|
||||
};
|
||||
|
||||
+7
-4
@@ -4,19 +4,22 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { Logger } from "@nhcarrigan/logger";
|
||||
import type { Logger } from "@nhcarrigan/logger";
|
||||
|
||||
// import { Logger } from "@nhcarrigan/logger";
|
||||
// Import { Logger } from "@nhcarrigan/logger";
|
||||
|
||||
// const logger = new Logger("Minori", process.env.LOG_TOKEN ?? "");
|
||||
// Const logger = new Logger("Minori", process.env.LOG_TOKEN ?? "");
|
||||
|
||||
/* eslint-disable no-console -- Temporary mock logger for development */
|
||||
/* eslint-disable @typescript-eslint/consistent-type-assertions -- Mock logger requires type assertion */
|
||||
const logger = {
|
||||
error: (message: string, error: Error) => {
|
||||
console.error(message, error);
|
||||
},
|
||||
log: (level: string, message: string) => {
|
||||
log: (level: string, message: string) => {
|
||||
console.log(level, message);
|
||||
},
|
||||
} as unknown as Logger;
|
||||
/* eslint-enable no-console, @typescript-eslint/consistent-type-assertions -- Re-enable rules after mock logger */
|
||||
|
||||
export { logger };
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
/**
|
||||
* Strips version prefix characters from a version string.
|
||||
* @param version - The version string with potential prefixes.
|
||||
* @returns The version without prefix characters.
|
||||
*/
|
||||
const stripVersionPrefix = (version: string): string => {
|
||||
return version.replace(/^[<=>^~]*/, "");
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses a semantic version string into its components.
|
||||
* @param version - The version string to parse (e.g., "1.2.3").
|
||||
* @returns An object with major, minor, and patch numbers, or null if invalid.
|
||||
*/
|
||||
const parseVersion = (
|
||||
version: string,
|
||||
): { major: number; minor: number; patch: number } | null => {
|
||||
const cleaned = stripVersionPrefix(version);
|
||||
const parts = cleaned.split(".");
|
||||
|
||||
if (parts.length < 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const major = Number.parseInt(parts[0] ?? "0", 10);
|
||||
const minor = Number.parseInt(parts[1] ?? "0", 10);
|
||||
const patchPart = parts[2] ?? "0";
|
||||
const patch = Number.parseInt(patchPart.split("-")[0] ?? "0", 10);
|
||||
|
||||
if (Number.isNaN(major) || Number.isNaN(minor) || Number.isNaN(patch)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return { major, minor, patch };
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines if a version update is a major version bump.
|
||||
* A major bump occurs when the major version number increases.
|
||||
* @param fromVersion - The current version.
|
||||
* @param toVersion - The target version.
|
||||
* @returns True if this is a major version bump, false otherwise.
|
||||
*/
|
||||
const isMajorVersionBump = (
|
||||
fromVersion: string,
|
||||
toVersion: string,
|
||||
): boolean => {
|
||||
const from = parseVersion(fromVersion);
|
||||
const to = parseVersion(toVersion);
|
||||
|
||||
if (from === null || to === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return to.major > from.major;
|
||||
};
|
||||
|
||||
export { isMajorVersionBump, stripVersionPrefix };
|
||||
@@ -6,11 +6,16 @@
|
||||
|
||||
/* eslint-disable vitest/valid-expect -- Test expectations don't need messages */
|
||||
/* eslint-disable max-lines-per-function -- Test suites require many test cases */
|
||||
/* eslint-disable max-lines -- Test suites naturally have many cases */
|
||||
/* eslint-disable max-statements -- Test suites naturally have many statements */
|
||||
/* eslint-disable @typescript-eslint/consistent-type-assertions -- Required for mocking */
|
||||
/* eslint-disable @typescript-eslint/consistent-type-imports -- Dynamic imports */
|
||||
/* eslint-disable @typescript-eslint/naming-convention -- Environment variables and Gitea API format */
|
||||
/* eslint-disable max-nested-callbacks -- Vitest structure requires nested callbacks */
|
||||
/* eslint-disable vitest/require-to-throw-message -- Generic throw assertion */
|
||||
/* eslint-disable vitest/prefer-to-be-truthy -- toBe(true) is clearer for boolean functions */
|
||||
/* eslint-disable vitest/prefer-to-be-falsy -- toBe(false) is clearer for boolean functions */
|
||||
/* eslint-disable stylistic/max-len -- Test files have long object literals */
|
||||
|
||||
import axios, { AxiosError, type AxiosResponse } from "axios";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
@@ -24,8 +29,9 @@ vi.mock("axios", async() => {
|
||||
default: {
|
||||
create: vi.fn(() => {
|
||||
return {
|
||||
get: vi.fn(),
|
||||
post: vi.fn(),
|
||||
delete: vi.fn(),
|
||||
get: vi.fn(),
|
||||
post: vi.fn(),
|
||||
};
|
||||
}),
|
||||
},
|
||||
@@ -69,6 +75,8 @@ describe("giteaService", () => {
|
||||
let mockGet: ReturnType<typeof vi.fn>;
|
||||
// eslint-disable-next-line @typescript-eslint/init-declarations -- Reassigned in beforeEach
|
||||
let mockPost: ReturnType<typeof vi.fn>;
|
||||
// eslint-disable-next-line @typescript-eslint/init-declarations -- Reassigned in beforeEach
|
||||
let mockDelete: ReturnType<typeof vi.fn>;
|
||||
const originalEnvironment = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -77,9 +85,11 @@ describe("giteaService", () => {
|
||||
|
||||
mockGet = vi.fn();
|
||||
mockPost = vi.fn();
|
||||
mockDelete = vi.fn();
|
||||
vi.mocked(axios.create).mockReturnValue({
|
||||
get: mockGet,
|
||||
post: mockPost,
|
||||
delete: mockDelete,
|
||||
get: mockGet,
|
||||
post: mockPost,
|
||||
} as unknown as ReturnType<typeof axios.create>);
|
||||
|
||||
giteaService = new GiteaService();
|
||||
@@ -306,4 +316,69 @@ describe("giteaService", () => {
|
||||
{ params: { state: "closed" } },
|
||||
);
|
||||
});
|
||||
|
||||
it("should get commit status", async() => {
|
||||
expect.assertions(2);
|
||||
const mockStatus = {
|
||||
commit_url: "https://git.nhcarrigan.com/api/v1/repos/owner/repo/commits/abc123",
|
||||
repository: createMockRepository({ id: 1, name: "test-repo" }),
|
||||
sha: "abc123",
|
||||
state: "success",
|
||||
statuses: [],
|
||||
total_count: 0,
|
||||
url: "https://git.nhcarrigan.com/api/v1/repos/owner/repo/commits/abc123/status",
|
||||
};
|
||||
mockGet.mockResolvedValueOnce({ data: mockStatus });
|
||||
const result = await giteaService.getCommitStatus("owner", "repo", "abc123");
|
||||
expect(result).toStrictEqual(mockStatus);
|
||||
expect(mockGet).toHaveBeenCalledWith("/repos/owner/repo/commits/abc123/status");
|
||||
});
|
||||
|
||||
it("should merge a pull request successfully", async() => {
|
||||
expect.assertions(2);
|
||||
mockPost.mockResolvedValueOnce({ data: {} });
|
||||
const result = await giteaService.mergePullRequest("owner", "repo", 1);
|
||||
expect(result).toBe(true);
|
||||
expect(mockPost).toHaveBeenCalledWith("/repos/owner/repo/pulls/1/merge", {
|
||||
Do: "merge",
|
||||
MergeMessageField: "",
|
||||
MergeTitleField: "",
|
||||
delete_branch_after_merge: true,
|
||||
force_merge: false,
|
||||
head_commit_id: "",
|
||||
merge_when_checks_succeed: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("should return false when merge fails", async() => {
|
||||
expect.assertions(1);
|
||||
const axiosError = new AxiosError("Merge conflict");
|
||||
mockPost.mockRejectedValueOnce(axiosError);
|
||||
const result = await giteaService.mergePullRequest("owner", "repo", 1);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("should delete a branch successfully", async() => {
|
||||
expect.assertions(2);
|
||||
mockDelete.mockResolvedValueOnce({ data: {} });
|
||||
const result = await giteaService.deleteBranch(
|
||||
"owner",
|
||||
"repo",
|
||||
"feature-branch",
|
||||
);
|
||||
expect(result).toBe(true);
|
||||
expect(mockDelete).toHaveBeenCalledWith("/repos/owner/repo/branches/feature-branch");
|
||||
});
|
||||
|
||||
it("should return false when branch deletion fails", async() => {
|
||||
expect.assertions(1);
|
||||
const axiosError = new AxiosError("Branch not found");
|
||||
mockDelete.mockRejectedValueOnce(axiosError);
|
||||
const result = await giteaService.deleteBranch(
|
||||
"owner",
|
||||
"repo",
|
||||
"nonexistent-branch",
|
||||
);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,6 +18,8 @@ const mockGiteaGetFileContent = vi.fn();
|
||||
const mockGiteaListOrgRepositories = vi.fn();
|
||||
const mockGiteaCreatePullRequest = vi.fn();
|
||||
const mockGiteaListPullRequests = vi.fn();
|
||||
const mockGiteaGetCommitStatus = vi.fn();
|
||||
const mockGiteaMergePullRequest = vi.fn();
|
||||
const mockNpmGetPackageChangelog = vi.fn();
|
||||
const mockNpmGetPackageInfo = vi.fn();
|
||||
const mockAnalyzePackageJson = vi.fn();
|
||||
@@ -39,9 +41,11 @@ vi.mock("../../src/services/giteaService.js", () => {
|
||||
|
||||
GiteaService: class MockGiteaService {
|
||||
public createPullRequest = mockGiteaCreatePullRequest;
|
||||
public getCommitStatus = mockGiteaGetCommitStatus;
|
||||
public getFileContent = mockGiteaGetFileContent;
|
||||
public listOrgRepositories = mockGiteaListOrgRepositories;
|
||||
public listPullRequests = mockGiteaListPullRequests;
|
||||
public mergePullRequest = mockGiteaMergePullRequest;
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -221,6 +225,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockNpmGetPackageChangelog.mockResolvedValue("## Changelog");
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
@@ -267,6 +272,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
mockCreateOrUpdateBranch.mockResolvedValue({
|
||||
@@ -289,6 +295,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
mockCreateOrUpdateBranch.mockResolvedValue({
|
||||
@@ -312,6 +319,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
mockCreateOrUpdateBranch.mockResolvedValue({
|
||||
@@ -354,6 +362,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
mockCreateOrUpdateBranch.mockResolvedValue({
|
||||
@@ -377,6 +386,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockUpdates = [ createMockUpdate() ];
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockNpmGetPackageChangelog.mockResolvedValue("## Changelog");
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo());
|
||||
@@ -426,6 +436,7 @@ describe("updateOrchestratorService", () => {
|
||||
const mockCleanup = vi.fn();
|
||||
mockGiteaListOrgRepositories.mockResolvedValue(mockRepos);
|
||||
mockGiteaGetFileContent.mockResolvedValue(mockFileContent);
|
||||
mockGiteaListPullRequests.mockResolvedValue([]);
|
||||
mockAnalyzePackageJson.mockResolvedValue(mockUpdates);
|
||||
mockCloneRepository.mockResolvedValue(createMockClonedRepo(mockCleanup));
|
||||
mockCreateOrUpdateBranch.mockResolvedValue({
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* @copyright NHCarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
/* eslint-disable vitest/valid-expect -- Test expectations don't need messages */
|
||||
/* eslint-disable max-lines-per-function -- Test suites naturally have many cases */
|
||||
/* eslint-disable max-nested-callbacks -- Vitest structure requires nesting */
|
||||
/* eslint-disable vitest/prefer-to-be-truthy -- toBe(true) is clearer for boolean functions */
|
||||
/* eslint-disable vitest/prefer-to-be-falsy -- toBe(false) is clearer for boolean functions */
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
isMajorVersionBump,
|
||||
stripVersionPrefix,
|
||||
} from "../../src/utils/versionComparison.js";
|
||||
|
||||
describe("versionComparison", () => {
|
||||
describe("stripVersionPrefix", () => {
|
||||
it("should strip caret prefix", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix("^1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should strip tilde prefix", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix("~1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should strip greater than prefix", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix(">1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should strip less than prefix", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix("<1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should strip equals prefix", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix("=1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should strip multiple prefix characters", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix(">=1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
|
||||
it("should return version without prefix unchanged", () => {
|
||||
expect.assertions(1);
|
||||
expect(stripVersionPrefix("1.2.3")).toBe("1.2.3");
|
||||
});
|
||||
});
|
||||
|
||||
describe("isMajorVersionBump", () => {
|
||||
it("should detect major version bump", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "2.0.0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should detect major version bump with prefixes", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("^1.2.3", "^2.0.0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should not detect minor version bump as major", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "1.3.0")).toBe(false);
|
||||
});
|
||||
|
||||
it("should not detect patch version bump as major", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "1.2.4")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle version with pre-release tags", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "2.0.0-beta.1")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return false for invalid from version", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("invalid", "2.0.0")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false for invalid to version", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "invalid")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false for both invalid versions", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("invalid", "also-invalid")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle 0.x.x to 1.x.x as major bump", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("0.9.5", "1.0.0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should not detect same version as major bump", () => {
|
||||
expect.assertions(1);
|
||||
expect(isMajorVersionBump("1.2.3", "1.2.3")).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user