13 Commits

Author SHA1 Message Date
minori a4e7545275 deps: update eslint to 10.0.0
Node.js CI / CI (pull_request) Failing after 16s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m29s
2026-02-17 07:15:07 -08:00
naomi 2bb7208bab feat: handle package checking better
Node.js CI / CI (push) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m45s
2026-02-04 08:12:51 -08:00
naomi f81acbac47 debug: again
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m17s
2026-02-04 08:08:00 -08:00
naomi 6da707f1e6 debug: log to terminal
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-04 08:06:16 -08:00
naomi b6fb12ae9f fix: branches fucking suck
Node.js CI / CI (push) Failing after 11s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 58s
2026-02-03 19:36:50 -08:00
naomi d0bf95cb6d fix: more branch shit
Node.js CI / CI (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-03 19:34:10 -08:00
naomi 4a8973a6e8 fix: branch name parsing
Node.js CI / CI (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-03 19:29:42 -08:00
naomi 565581570c fix: handle branches betterer
Node.js CI / CI (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-03 19:25:50 -08:00
naomi 0dbedfe546 fix: coerce weird versions
Node.js CI / CI (push) Failing after 12s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m14s
2026-02-03 19:19:29 -08:00
naomi df608370a4 fix: versions
Node.js CI / CI (push) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-03 19:14:31 -08:00
naomi d435b9da47 chore: use single logger instance
Node.js CI / CI (push) Has been cancelled
Security Scan and Upload / Security & DefectDojo Upload (push) Has been cancelled
2026-02-03 19:11:30 -08:00
naomi a1bb6b791c feat: no unstable versions
Node.js CI / CI (push) Failing after 7s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m2s
2026-02-03 19:07:14 -08:00
naomi bc572cdf76 feat: minimum age
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 57s
2026-02-03 18:58:40 -08:00
12 changed files with 637 additions and 205 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
"@types/semver": "7.7.1",
"@vitest/coverage-istanbul": "^4.0.18",
"@vitest/coverage-v8": "^4.0.18",
"eslint": "9.39.2",
"eslint": "10.0.0",
"typescript": "5.9.3",
"vitest": "^4.0.18"
},
+169 -171
View File
@@ -23,7 +23,7 @@ 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.0))
version: 5.2.0(@typescript-eslint/utils@8.54.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(playwright@1.58.1)(react@19.2.4)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.0))
'@nhcarrigan/typescript-config':
specifier: 4.0.0
version: 4.0.0(typescript@5.9.3)
@@ -43,8 +43,8 @@ importers:
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
specifier: 10.0.0
version: 10.0.0
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -310,41 +310,33 @@ packages:
eslint:
optional: true
'@eslint/config-array@0.21.1':
resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/config-array@0.23.1':
resolution: {integrity: sha512-uVSdg/V4dfQmTjJzR0szNczjOH/J+FyUMMjYtr07xFRXR7EDf9i1qdxrD0VusZH9knj1/ecxzCQQxyic5NzAiA==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/config-helpers@0.4.2':
resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/config-helpers@0.5.2':
resolution: {integrity: sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/core@0.17.0':
resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/core@1.1.0':
resolution: {integrity: sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/eslintrc@3.2.0':
resolution: {integrity: sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/eslintrc@3.3.3':
resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.17.0':
resolution: {integrity: sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.39.2':
resolution: {integrity: sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/object-schema@3.0.1':
resolution: {integrity: sha512-P9cq2dpr+LU8j3qbLygLcSZrl2/ds/pUpfnHNNuk5HW7mnngHs+6WSq5C9mO3rqRX8A1poxqLTC9cu0KOyJlBg==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@eslint/object-schema@2.1.7':
resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/plugin-kit@0.4.1':
resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/plugin-kit@0.6.0':
resolution: {integrity: sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
'@humanfs/core@0.19.1':
resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==}
@@ -362,6 +354,10 @@ packages:
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
engines: {node: '>=18.18'}
'@isaacs/cliui@9.0.0':
resolution: {integrity: sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==}
engines: {node: '>=18'}
'@istanbuljs/schema@0.1.3':
resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==}
engines: {node: '>=8'}
@@ -560,6 +556,9 @@ packages:
'@types/deep-eql@4.0.2':
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
'@types/esrecurse@4.3.1':
resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==}
'@types/estree@1.0.8':
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
@@ -766,10 +765,6 @@ packages:
ajv@6.12.6:
resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
ansi-styles@4.3.0:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
engines: {node: '>=8'}
are-docs-informative@0.0.2:
resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==}
engines: {node: '>=14'}
@@ -837,6 +832,10 @@ packages:
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
balanced-match@4.0.2:
resolution: {integrity: sha512-x0K50QvKQ97fdEz2kPehIerj+YTeptKF9hyYkKf6egnwmMWAkADiO0QCzSp0R5xN8FTZgYaBfSaue46Ej62nMg==}
engines: {node: 20 || >=22}
baseline-browser-mapping@2.9.19:
resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==}
hasBin: true
@@ -847,6 +846,10 @@ packages:
brace-expansion@2.0.2:
resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}
brace-expansion@5.0.2:
resolution: {integrity: sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==}
engines: {node: 20 || >=22}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
@@ -883,10 +886,6 @@ packages:
resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==}
engines: {node: '>=18'}
chalk@4.1.2:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
engines: {node: '>=10'}
ci-info@4.4.0:
resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==}
engines: {node: '>=8'}
@@ -895,13 +894,6 @@ packages:
resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
engines: {node: '>=4'}
color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
@@ -1105,9 +1097,9 @@ packages:
peerDependencies:
eslint: '>=8.56.0'
eslint-scope@8.4.0:
resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint-scope@9.1.0:
resolution: {integrity: sha512-CkWE42hOJsNj9FJRaoMX9waUFYhqY4jmyLFdAdzZr6VaCg3ynLYx4WnOdkaIifGfH4gsUcBTn4OZbHXkpLD0FQ==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
eslint-visitor-keys@1.3.0:
resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==}
@@ -1121,9 +1113,13 @@ packages:
resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint@9.39.2:
resolution: {integrity: sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint-visitor-keys@5.0.0:
resolution: {integrity: sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
eslint@10.0.0:
resolution: {integrity: sha512-O0piBKY36YSJhlFSG8p9VUdPV/SxxS4FYDWVpr/9GJuMaepzwlf4J8I4ov1b+ySQfDTPhc3DtLaxcT1fN0yqCg==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
hasBin: true
peerDependencies:
jiti: '*'
@@ -1135,6 +1131,10 @@ packages:
resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
espree@11.1.0:
resolution: {integrity: sha512-WFWYhO1fV4iYkqOOvq8FbqIhr2pYfoDY0kCotMkDeNtGpiGGkZ1iov2u8ydjtgM8yF8rzK7oaTbw2NAzbAbehw==}
engines: {node: ^20.19.0 || ^22.13.0 || >=24}
espree@6.2.1:
resolution: {integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==}
engines: {node: '>=6.0.0'}
@@ -1488,6 +1488,10 @@ packages:
resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==}
engines: {node: '>= 0.4'}
jackspeak@4.2.3:
resolution: {integrity: sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==}
engines: {node: 20 || >=22}
js-tokens@10.0.0:
resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==}
@@ -1554,9 +1558,6 @@ packages:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'}
lodash.merge@4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
loose-envify@1.4.0:
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
hasBin: true
@@ -1598,6 +1599,10 @@ packages:
resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
engines: {node: '>=4'}
minimatch@10.2.1:
resolution: {integrity: sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==}
engines: {node: 20 || >=22}
minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
@@ -2367,36 +2372,36 @@ snapshots:
'@esbuild/win32-x64@0.27.2':
optional: true
'@eslint-community/eslint-plugin-eslint-comments@4.4.1(eslint@9.39.2)':
'@eslint-community/eslint-plugin-eslint-comments@4.4.1(eslint@10.0.0)':
dependencies:
escape-string-regexp: 4.0.0
eslint: 9.39.2
eslint: 10.0.0
ignore: 5.3.2
'@eslint-community/eslint-utils@4.9.1(eslint@9.39.2)':
'@eslint-community/eslint-utils@4.9.1(eslint@10.0.0)':
dependencies:
eslint: 9.39.2
eslint: 10.0.0
eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.2': {}
'@eslint/compat@1.2.4(eslint@9.39.2)':
'@eslint/compat@1.2.4(eslint@10.0.0)':
optionalDependencies:
eslint: 9.39.2
eslint: 10.0.0
'@eslint/config-array@0.21.1':
'@eslint/config-array@0.23.1':
dependencies:
'@eslint/object-schema': 2.1.7
'@eslint/object-schema': 3.0.1
debug: 4.4.3
minimatch: 3.1.2
minimatch: 10.2.1
transitivePeerDependencies:
- supports-color
'@eslint/config-helpers@0.4.2':
'@eslint/config-helpers@0.5.2':
dependencies:
'@eslint/core': 0.17.0
'@eslint/core': 1.1.0
'@eslint/core@0.17.0':
'@eslint/core@1.1.0':
dependencies:
'@types/json-schema': 7.0.15
@@ -2414,29 +2419,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@eslint/eslintrc@3.3.3':
dependencies:
ajv: 6.12.6
debug: 4.4.3
espree: 10.4.0
globals: 14.0.0
ignore: 5.3.2
import-fresh: 3.3.1
js-yaml: 4.1.1
minimatch: 3.1.2
strip-json-comments: 3.1.1
transitivePeerDependencies:
- supports-color
'@eslint/js@9.17.0': {}
'@eslint/js@9.39.2': {}
'@eslint/object-schema@3.0.1': {}
'@eslint/object-schema@2.1.7': {}
'@eslint/plugin-kit@0.4.1':
'@eslint/plugin-kit@0.6.0':
dependencies:
'@eslint/core': 0.17.0
'@eslint/core': 1.1.0
levn: 0.4.1
'@humanfs/core@0.19.1': {}
@@ -2450,6 +2439,8 @@ snapshots:
'@humanwhocodes/retry@0.4.3': {}
'@isaacs/cliui@9.0.0': {}
'@istanbuljs/schema@0.1.3': {}
'@jridgewell/gen-mapping@0.3.13':
@@ -2471,24 +2462,24 @@ 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.0))':
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.54.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(playwright@1.58.1)(react@19.2.4)(typescript@5.9.3)(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-community/eslint-plugin-eslint-comments': 4.4.1(eslint@10.0.0)
'@eslint/compat': 1.2.4(eslint@10.0.0)
'@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.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-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)
'@stylistic/eslint-plugin': 2.12.1(eslint@10.0.0)(typescript@5.9.3)
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(typescript@5.9.3)
'@typescript-eslint/parser': 8.19.0(eslint@10.0.0)(typescript@5.9.3)
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.54.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.0))
eslint: 10.0.0
eslint-plugin-deprecation: 3.0.0(eslint@10.0.0)(typescript@5.9.3)
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)
eslint-plugin-jsdoc: 50.6.1(eslint@10.0.0)
eslint-plugin-playwright: 2.1.0(eslint@10.0.0)
eslint-plugin-react: 7.37.3(eslint@10.0.0)
eslint-plugin-sort-keys-fix: 1.1.2
eslint-plugin-unicorn: 56.0.1(eslint@9.39.2)
eslint-plugin-unicorn: 56.0.1(eslint@10.0.0)
globals: 15.14.0
playwright: 1.58.1
react: 19.2.4
@@ -2599,10 +2590,10 @@ 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@10.0.0)(typescript@5.9.3)':
dependencies:
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@5.9.3)
eslint: 9.39.2
'@typescript-eslint/utils': 8.54.0(eslint@10.0.0)(typescript@5.9.3)
eslint: 10.0.0
eslint-visitor-keys: 4.2.1
espree: 10.4.0
estraverse: 5.3.0
@@ -2618,6 +2609,8 @@ snapshots:
'@types/deep-eql@4.0.2': {}
'@types/esrecurse@4.3.1': {}
'@types/estree@1.0.8': {}
'@types/json-schema@7.0.15': {}
@@ -2634,15 +2627,15 @@ 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@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(typescript@5.9.3)':
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@10.0.0)(typescript@5.9.3)
'@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@10.0.0)(typescript@5.9.3)
'@typescript-eslint/utils': 8.19.0(eslint@10.0.0)(typescript@5.9.3)
'@typescript-eslint/visitor-keys': 8.19.0
eslint: 9.39.2
eslint: 10.0.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
@@ -2651,14 +2644,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.19.0(eslint@9.39.2)(typescript@5.9.3)':
'@typescript-eslint/parser@8.19.0(eslint@10.0.0)(typescript@5.9.3)':
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/visitor-keys': 8.19.0
debug: 4.4.3
eslint: 9.39.2
eslint: 10.0.0
typescript: 5.9.3
transitivePeerDependencies:
- supports-color
@@ -2691,12 +2684,12 @@ snapshots:
dependencies:
typescript: 5.9.3
'@typescript-eslint/type-utils@8.19.0(eslint@9.39.2)(typescript@5.9.3)':
'@typescript-eslint/type-utils@8.19.0(eslint@10.0.0)(typescript@5.9.3)':
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/utils': 8.19.0(eslint@10.0.0)(typescript@5.9.3)
debug: 4.4.3
eslint: 9.39.2
eslint: 10.0.0
ts-api-utils: 1.4.3(typescript@5.9.3)
typescript: 5.9.3
transitivePeerDependencies:
@@ -2752,35 +2745,35 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@7.18.0(eslint@9.39.2)(typescript@5.9.3)':
'@typescript-eslint/utils@7.18.0(eslint@10.0.0)(typescript@5.9.3)':
dependencies:
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
'@eslint-community/eslint-utils': 4.9.1(eslint@10.0.0)
'@typescript-eslint/scope-manager': 7.18.0
'@typescript-eslint/types': 7.18.0
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3)
eslint: 9.39.2
eslint: 10.0.0
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@10.0.0)(typescript@5.9.3)':
dependencies:
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
'@eslint-community/eslint-utils': 4.9.1(eslint@10.0.0)
'@typescript-eslint/scope-manager': 8.19.0
'@typescript-eslint/types': 8.19.0
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
eslint: 9.39.2
eslint: 10.0.0
typescript: 5.9.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.54.0(eslint@9.39.2)(typescript@5.9.3)':
'@typescript-eslint/utils@8.54.0(eslint@10.0.0)(typescript@5.9.3)':
dependencies:
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
'@eslint-community/eslint-utils': 4.9.1(eslint@10.0.0)
'@typescript-eslint/scope-manager': 8.54.0
'@typescript-eslint/types': 8.54.0
'@typescript-eslint/typescript-estree': 8.54.0(typescript@5.9.3)
eslint: 9.39.2
eslint: 10.0.0
typescript: 5.9.3
transitivePeerDependencies:
- supports-color
@@ -2830,10 +2823,10 @@ snapshots:
tinyrainbow: 3.0.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.0))':
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.54.0(eslint@10.0.0)(typescript@5.9.3))(eslint@10.0.0)(typescript@5.9.3)(vitest@4.0.18(@types/node@25.2.0))':
dependencies:
'@typescript-eslint/utils': 8.54.0(eslint@9.39.2)(typescript@5.9.3)
eslint: 9.39.2
'@typescript-eslint/utils': 8.54.0(eslint@10.0.0)(typescript@5.9.3)
eslint: 10.0.0
optionalDependencies:
typescript: 5.9.3
vitest: 4.0.18(@types/node@25.2.0)
@@ -2896,10 +2889,6 @@ snapshots:
json-schema-traverse: 0.4.1
uri-js: 4.4.1
ansi-styles@4.3.0:
dependencies:
color-convert: 2.0.1
are-docs-informative@0.0.2: {}
argparse@2.0.1: {}
@@ -2999,6 +2988,10 @@ snapshots:
balanced-match@1.0.2: {}
balanced-match@4.0.2:
dependencies:
jackspeak: 4.2.3
baseline-browser-mapping@2.9.19: {}
brace-expansion@1.1.12:
@@ -3010,6 +3003,10 @@ snapshots:
dependencies:
balanced-match: 1.0.2
brace-expansion@5.0.2:
dependencies:
balanced-match: 4.0.2
braces@3.0.3:
dependencies:
fill-range: 7.1.1
@@ -3047,23 +3044,12 @@ snapshots:
chai@6.2.2: {}
chalk@4.1.2:
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
ci-info@4.4.0: {}
clean-regexp@1.0.0:
dependencies:
escape-string-regexp: 1.0.5
color-convert@2.0.1:
dependencies:
color-name: 1.1.4
color-name@1.1.4: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
@@ -3292,27 +3278,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@10.0.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@10.0.0):
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 8.19.0(eslint@9.39.2)(typescript@5.9.3)
eslint: 9.39.2
'@typescript-eslint/parser': 8.19.0(eslint@10.0.0)(typescript@5.9.3)
eslint: 10.0.0
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@10.0.0)(typescript@5.9.3):
dependencies:
'@typescript-eslint/utils': 7.18.0(eslint@9.39.2)(typescript@5.9.3)
eslint: 9.39.2
'@typescript-eslint/utils': 7.18.0(eslint@10.0.0)(typescript@5.9.3)
eslint: 10.0.0
ts-api-utils: 1.4.3(typescript@5.9.3)
tslib: 2.8.1
typescript: 5.9.3
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@10.0.0)(typescript@5.9.3))(eslint@10.0.0):
dependencies:
'@rtsao/scc': 1.1.0
array-includes: 3.1.9
@@ -3321,9 +3307,9 @@ snapshots:
array.prototype.flatmap: 1.3.3
debug: 3.2.7
doctrine: 2.1.0
eslint: 9.39.2
eslint: 10.0.0
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@10.0.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@10.0.0)
hasown: 2.0.2
is-core-module: 2.16.1
is-glob: 4.0.3
@@ -3335,20 +3321,20 @@ 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@10.0.0)(typescript@5.9.3)
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
- supports-color
eslint-plugin-jsdoc@50.6.1(eslint@9.39.2):
eslint-plugin-jsdoc@50.6.1(eslint@10.0.0):
dependencies:
'@es-joy/jsdoccomment': 0.49.0
are-docs-informative: 0.0.2
comment-parser: 1.4.1
debug: 4.4.3
escape-string-regexp: 4.0.0
eslint: 9.39.2
eslint: 10.0.0
espree: 10.4.0
esquery: 1.7.0
parse-imports: 2.2.1
@@ -3358,12 +3344,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-plugin-playwright@2.1.0(eslint@9.39.2):
eslint-plugin-playwright@2.1.0(eslint@10.0.0):
dependencies:
eslint: 9.39.2
eslint: 10.0.0
globals: 13.24.0
eslint-plugin-react@7.37.3(eslint@9.39.2):
eslint-plugin-react@7.37.3(eslint@10.0.0):
dependencies:
array-includes: 3.1.9
array.prototype.findlast: 1.2.5
@@ -3371,7 +3357,7 @@ snapshots:
array.prototype.tosorted: 1.1.4
doctrine: 2.1.0
es-iterator-helpers: 1.2.2
eslint: 9.39.2
eslint: 10.0.0
estraverse: 5.3.0
hasown: 2.0.2
jsx-ast-utils: 3.3.5
@@ -3392,14 +3378,14 @@ snapshots:
natural-compare: 1.4.0
requireindex: 1.2.0
eslint-plugin-unicorn@56.0.1(eslint@9.39.2):
eslint-plugin-unicorn@56.0.1(eslint@10.0.0):
dependencies:
'@babel/helper-validator-identifier': 7.28.5
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
'@eslint-community/eslint-utils': 4.9.1(eslint@10.0.0)
ci-info: 4.4.0
clean-regexp: 1.0.0
core-js-compat: 3.48.0
eslint: 9.39.2
eslint: 10.0.0
esquery: 1.7.0
globals: 15.14.0
indent-string: 4.0.0
@@ -3412,8 +3398,10 @@ snapshots:
semver: 7.7.3
strip-indent: 3.0.0
eslint-scope@8.4.0:
eslint-scope@9.1.0:
dependencies:
'@types/esrecurse': 4.3.1
'@types/estree': 1.0.8
esrecurse: 4.3.0
estraverse: 5.3.0
@@ -3423,28 +3411,27 @@ snapshots:
eslint-visitor-keys@4.2.1: {}
eslint@9.39.2:
eslint-visitor-keys@5.0.0: {}
eslint@10.0.0:
dependencies:
'@eslint-community/eslint-utils': 4.9.1(eslint@9.39.2)
'@eslint-community/eslint-utils': 4.9.1(eslint@10.0.0)
'@eslint-community/regexpp': 4.12.2
'@eslint/config-array': 0.21.1
'@eslint/config-helpers': 0.4.2
'@eslint/core': 0.17.0
'@eslint/eslintrc': 3.3.3
'@eslint/js': 9.39.2
'@eslint/plugin-kit': 0.4.1
'@eslint/config-array': 0.23.1
'@eslint/config-helpers': 0.5.2
'@eslint/core': 1.1.0
'@eslint/plugin-kit': 0.6.0
'@humanfs/node': 0.16.7
'@humanwhocodes/module-importer': 1.0.1
'@humanwhocodes/retry': 0.4.3
'@types/estree': 1.0.8
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.6
debug: 4.4.3
escape-string-regexp: 4.0.0
eslint-scope: 8.4.0
eslint-visitor-keys: 4.2.1
espree: 10.4.0
eslint-scope: 9.1.0
eslint-visitor-keys: 5.0.0
espree: 11.1.0
esquery: 1.7.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
@@ -3455,8 +3442,7 @@ snapshots:
imurmurhash: 0.1.4
is-glob: 4.0.3
json-stable-stringify-without-jsonify: 1.0.1
lodash.merge: 4.6.2
minimatch: 3.1.2
minimatch: 10.2.1
natural-compare: 1.4.0
optionator: 0.9.4
transitivePeerDependencies:
@@ -3468,6 +3454,12 @@ snapshots:
acorn-jsx: 5.3.2(acorn@8.15.0)
eslint-visitor-keys: 4.2.1
espree@11.1.0:
dependencies:
acorn: 8.15.0
acorn-jsx: 5.3.2(acorn@8.15.0)
eslint-visitor-keys: 5.0.0
espree@6.2.1:
dependencies:
acorn: 7.4.1
@@ -3827,6 +3819,10 @@ snapshots:
has-symbols: 1.1.0
set-function-name: 2.0.2
jackspeak@4.2.3:
dependencies:
'@isaacs/cliui': 9.0.0
js-tokens@10.0.0: {}
js-tokens@4.0.0: {}
@@ -3881,8 +3877,6 @@ snapshots:
dependencies:
p-locate: 5.0.0
lodash.merge@4.6.2: {}
loose-envify@1.4.0:
dependencies:
js-tokens: 4.0.0
@@ -3922,6 +3916,10 @@ snapshots:
min-indent@1.0.1: {}
minimatch@10.2.1:
dependencies:
brace-expansion: 5.0.2
minimatch@3.1.2:
dependencies:
brace-expansion: 1.1.12
+1 -3
View File
@@ -4,14 +4,12 @@
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
import cron from "node-cron";
import { config, validateConfig } from "./config.js";
import {
UpdateOrchestratorService,
} from "./services/updateOrchestratorService.js";
const logger = new Logger("Minori", process.env.LOG_TOKEN ?? "");
import { logger } from "./utils/logger.js";
/**
* Main entry point for the application.
+24 -9
View File
@@ -4,17 +4,15 @@
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
import semver from "semver";
import type { NpmService } from "./npmService.js";
import { logger } from "../utils/logger.js";
import { NpmService } from "./npmService.js";
import type {
DependencyType,
DependencyUpdate,
PackageJson,
} from "../types/package.types.js";
const logger = new Logger("DependencyAnalyzer", process.env.LOG_TOKEN ?? "");
/**
* Checks if a version string is a valid semver range.
* @param version - The version string to validate.
@@ -44,12 +42,14 @@ const isValidSemverRange = (version: string): boolean => {
};
/**
* Removes version prefixes for comparison.
* Removes version prefixes and coerces to valid semver.
* @param version - The version string to sanitise.
* @returns The cleaned version string.
* @returns The cleaned version string, or null if invalid.
*/
const cleanVersion = (version: string): string => {
return version.replace(/^[<=>^~]/, "");
const cleanVersion = (version: string): string | null => {
const stripped = version.replace(/^[<=>^~]+/, "");
const coerced = semver.coerce(stripped);
return coerced?.version ?? null;
};
/**
@@ -68,6 +68,8 @@ const shouldUpdate = (
}
return semver.lt(currentVersion, latestVersion);
// eslint-disable-next-line capitalized-comments -- v8 coverage ignore directive must be lowercase
/* v8 ignore start -- @preserve */
} catch (error) {
void logger.error(
`Error comparing versions: ${currentVersion} vs ${latestVersion}`,
@@ -76,6 +78,8 @@ const shouldUpdate = (
);
return false;
}
// eslint-disable-next-line capitalized-comments -- v8 coverage ignore directive must be lowercase
/* v8 ignore stop -- @preserve */
};
/**
@@ -151,8 +155,19 @@ class DependencyAnalyzerService {
return null;
}
const latestVersion = packageInfo["dist-tags"].latest;
// Use mature version (at least 10 days old) instead of dist-tags.latest
const latestVersion = NpmService.getLatestMatureVersion(
packageInfo,
10,
);
if (latestVersion === null) {
return null;
}
const cleanCurrentVersion = cleanVersion(currentVersion);
if (cleanCurrentVersion === null) {
return null;
}
if (shouldUpdate(cleanCurrentVersion, latestVersion)) {
return {
+79 -9
View File
@@ -212,20 +212,84 @@ const cloneRepository = async(
};
};
/**
* Deletes a stale local branch if it exists.
* @param logger - The logger instance.
* @param repoPath - Path to the repository.
* @param branchName - Name of the branch to delete.
*/
const deleteStaleLocalBranch = async(
logger: Logger,
repoPath: string,
branchName: string,
): Promise<void> => {
const localBranchOutput = await runGitCommand(logger, repoPath, "git branch");
const localBranchNames = localBranchOutput.
split("\n").
map((line) => {
return line.replace(/^\*?\s*/, "").trim();
}).
filter((name) => {
return name.length > 0;
});
if (localBranchNames.includes(branchName)) {
await runGitCommand(logger, repoPath, `git branch -D ${branchName}`);
}
};
/**
* Fetches and checks out an existing remote branch.
* @param logger - The logger instance.
* @param repoPath - The repository path.
* @param branchName - The branch name to fetch and checkout.
* @returns True if successful, false if the branch no longer exists on remote.
*/
const fetchAndCheckoutRemoteBranch = async(
logger: Logger,
repoPath: string,
branchName: string,
): Promise<boolean> => {
try {
await runGitCommand(
logger,
repoPath,
`git fetch origin ${branchName}:refs/remotes/origin/${branchName}`,
);
await runGitCommand(
logger,
repoPath,
`git checkout -b ${branchName} origin/${branchName}`,
);
return true;
} catch {
// Branch may have been deleted between check and fetch
return false;
}
};
/**
* Handles updating an existing branch with a newer version.
* @param options - The branch update options.
* @returns The update result.
* @returns The update result, or null if branch no longer exists.
*/
const handleExistingBranch = async(
options: BranchUpdateOptions,
): Promise<UpdateResult> => {
): Promise<UpdateResult | null> => {
const { branchName, clonedRepo, logger, packageName, targetVersion }
= options;
const { path: repoPath } = clonedRepo;
await runGitCommand(logger, repoPath, `git checkout ${branchName}`);
await runGitCommand(logger, repoPath, `git pull origin ${branchName}`);
await deleteStaleLocalBranch(logger, repoPath, branchName);
const checkedOut = await fetchAndCheckoutRemoteBranch(
logger,
repoPath,
branchName,
);
if (!checkedOut) {
// Branch was deleted on remote, fall back to creating new branch
return null;
}
const currentVersion = await getCurrentVersionOnBranch(repoPath, packageName);
@@ -269,19 +333,20 @@ const handleNewBranch = async(
const { path: repoPath } = clonedRepo;
await runGitCommand(logger, repoPath, "git checkout main");
await runGitCommand(logger, repoPath, `git checkout -b ${branchName}`);
// Check if package exists before creating branch
const currentVersion = await getCurrentVersionOnBranch(repoPath, packageName);
if (currentVersion === null) {
void logger.log("warn", `Package ${packageName} not found in package.json`);
await runGitCommand(logger, repoPath, "git checkout main");
await runGitCommand(logger, repoPath, `git branch -D ${branchName}`);
return {
error: `Package ${packageName} not found in package.json`,
status: "failed",
};
}
// Only create branch if package exists
await runGitCommand(logger, repoPath, `git checkout -b ${branchName}`);
await updatePackageAndCommit({
logger,
packageName,
@@ -308,7 +373,8 @@ const createOrUpdateBranch = async(
const { path: repoPath } = clonedRepo;
try {
await runGitCommand(logger, repoPath, "git fetch origin");
// Use --prune to remove stale remote-tracking refs that no longer exist
await runGitCommand(logger, repoPath, "git fetch origin --prune");
const remoteBranches = await runGitCommand(
logger,
repoPath,
@@ -317,7 +383,11 @@ const createOrUpdateBranch = async(
const branchExists = remoteBranches.includes(`origin/${branchName}`);
if (branchExists) {
return await handleExistingBranch(options);
const result = await handleExistingBranch(options);
// If null, branch was deleted on remote between check and fetch
if (result !== null) {
return result;
}
}
return await handleNewBranch(options);
+46 -3
View File
@@ -4,13 +4,12 @@
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
import axios, { isAxiosError, type AxiosInstance } from "axios";
import semver from "semver";
import { config } from "../config.js";
import { logger } from "../utils/logger.js";
import type { NpmPackageInfo } from "../types/package.types.js";
const logger = new Logger("NpmService", process.env.LOG_TOKEN ?? "");
/* eslint-disable @typescript-eslint/naming-convention -- GitHub API response types use snake_case property names */
interface GitHubRelease {
body?: string;
@@ -148,6 +147,50 @@ class NpmService {
});
}
/**
* Gets the latest version that is at least minimumAgeDays old.
* @param packageInfo - The package information from npm.
* @param minimumAgeDays - Minimum days since publication (default 10).
* @returns The latest mature version, or null if none found.
*/
public static getLatestMatureVersion(
packageInfo: NpmPackageInfo,
minimumAgeDays = 10,
): string | null {
const now = Date.now();
const minimumAgeMs = minimumAgeDays * 24 * 60 * 60 * 1000;
const cutoffDate = now - minimumAgeMs;
const versions = Object.keys(packageInfo.versions);
const matureVersions = versions.filter((version) => {
// Skip prerelease versions (e.g., 1.0.0-rc.1, 1.0.0-alpha, 1.0.0-beta.2)
const prereleaseComponents = semver.prerelease(version);
if (prereleaseComponents !== null && prereleaseComponents.length > 0) {
return false;
}
const publishedAt = packageInfo.time[version];
if (publishedAt === undefined) {
return false;
}
const publishedDate = new Date(publishedAt).getTime();
return publishedDate <= cutoffDate;
});
if (matureVersions.length === 0) {
return null;
}
// Sort by semver (descending) to get the latest mature version
matureVersions.sort((version1, version2) => {
return version2.localeCompare(version1, undefined, { numeric: true });
});
// eslint-disable-next-line capitalized-comments -- v8 coverage ignore directive must be lowercase
/* v8 ignore next -- @preserve */
return matureVersions[0] ?? null;
}
/**
* Fetches changelog information for a package update.
* @param options - The changelog fetch options.
+1 -3
View File
@@ -4,8 +4,8 @@
* @author Naomi Carrigan
*/
import { Logger } from "@nhcarrigan/logger";
import { config } from "../config.js";
import { logger } from "../utils/logger.js";
import { DependencyAnalyzerService } from "./dependencyAnalyzerService.js";
import { GiteaService } from "./giteaService.js";
import {
@@ -17,8 +17,6 @@ import { NpmService } from "./npmService.js";
import type { GiteaRepository } from "../types/gitea.types.js";
import type { DependencyUpdate, PackageJson } from "../types/package.types.js";
const logger = new Logger("UpdateOrchestrator", process.env.LOG_TOKEN ?? "");
/**
* Strips version prefix characters from a version string.
* @param version - The version string with potential prefixes.
+1
View File
@@ -33,6 +33,7 @@ interface NpmPackageInfo {
latest: string;
};
"name": string;
"time": Record<string, string>;
"versions": Record<
string,
{
+12 -1
View File
@@ -6,6 +6,17 @@
import { Logger } from "@nhcarrigan/logger";
const logger = new Logger("Minori", process.env.LOG_TOKEN ?? "");
// import { Logger } from "@nhcarrigan/logger";
// const logger = new Logger("Minori", process.env.LOG_TOKEN ?? "");
const logger = {
error: (message: string, error: Error) => {
console.error(message, error);
},
log: (level: string, message: string) => {
console.log(level, message);
},
} as unknown as Logger;
export { logger };
@@ -6,11 +6,17 @@
/* 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 require many test cases */
/* eslint-disable @typescript-eslint/naming-convention -- Test data uses npm package names and destructured imports */
/* eslint-disable @typescript-eslint/consistent-type-assertions -- Required for mocking */
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const getDaysAgoIso = (days: number): string => {
const msPerDay = 24 * 60 * 60 * 1000;
const ageMs = days * msPerDay;
return new Date(Date.now() - ageMs).toISOString();
};
vi.mock("@nhcarrigan/logger", () => {
return {
@@ -57,10 +63,13 @@ describe("dependencyAnalyzerService", () => {
it("should find updates for dependencies", async() => {
expect.assertions(2);
const mockNpmService = createMockNpmService();
// Include time field with a date >10 days ago for the mature version check
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"versions": {},
"time": { "2.0.0": oldDate },
"versions": { "2.0.0": { version: "2.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
@@ -197,10 +206,12 @@ describe("dependencyAnalyzerService", () => {
it("should not include packages that are already up-to-date", async() => {
expect.assertions(1);
const mockNpmService = createMockNpmService();
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "1.0.0" },
"name": "test-package",
"versions": {},
"time": { "1.0.0": oldDate },
"versions": { "1.0.0": { version: "1.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
@@ -235,10 +246,12 @@ describe("dependencyAnalyzerService", () => {
it("should handle version prefixes like ^", async() => {
expect.assertions(2);
const mockNpmService = createMockNpmService();
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"versions": {},
"time": { "2.0.0": oldDate },
"versions": { "2.0.0": { version: "2.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
@@ -254,6 +267,54 @@ describe("dependencyAnalyzerService", () => {
expect(result[0]?.currentVersion).toBe("^1.0.0");
});
it("should handle multi-character version prefixes like >=", async() => {
expect.assertions(2);
const mockNpmService = createMockNpmService();
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "2.0.0": oldDate },
"versions": { "2.0.0": { version: "2.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
const analyzerService = new DependencyAnalyzerService(
mockNpmService as Parameters<typeof DependencyAnalyzerService>[0],
);
const result = await analyzerService.analyzePackageJson({
dependencies: {
"test-package": ">=1.0.0",
},
});
expect(result).toHaveLength(1);
expect(result[0]?.currentVersion).toBe(">=1.0.0");
});
it("should handle partial version numbers like '2'", async() => {
expect.assertions(2);
const mockNpmService = createMockNpmService();
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "3.0.0" },
"name": "test-package",
"time": { "3.0.0": oldDate },
"versions": { "3.0.0": { version: "3.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
const analyzerService = new DependencyAnalyzerService(
mockNpmService as Parameters<typeof DependencyAnalyzerService>[0],
);
const result = await analyzerService.analyzePackageJson({
dependencies: {
"test-package": "2",
},
});
expect(result).toHaveLength(1);
expect(result[0]?.currentVersion).toBe("2");
});
it("should handle npm errors gracefully", async() => {
expect.assertions(1);
const mockNpmService = createMockNpmService();
@@ -274,10 +335,12 @@ describe("dependencyAnalyzerService", () => {
it("should handle semver comparison errors", async() => {
expect.assertions(1);
const mockNpmService = createMockNpmService();
const oldDate = getDaysAgoIso(15);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "invalid-version" },
"name": "test-package",
"versions": {},
"time": { "invalid-version": oldDate },
"versions": { "invalid-version": { version: "invalid-version" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
@@ -291,4 +354,28 @@ describe("dependencyAnalyzerService", () => {
});
expect(result).toStrictEqual([]);
});
it("should return null when no mature version exists", async() => {
expect.assertions(1);
const mockNpmService = createMockNpmService();
// Use a very recent date (2 days ago) so getLatestMatureVersion returns null
const recentDate = getDaysAgoIso(2);
mockNpmService.getPackageInfo.mockResolvedValue({
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "2.0.0": recentDate },
"versions": { "2.0.0": { version: "2.0.0" } },
});
const { DependencyAnalyzerService }
= await import("../../src/services/dependencyAnalyzerService.js");
const analyzerService = new DependencyAnalyzerService(
mockNpmService as Parameters<typeof DependencyAnalyzerService>[0],
);
const result = await analyzerService.analyzePackageJson({
dependencies: {
"test-package": "1.0.0",
},
});
expect(result).toStrictEqual([]);
});
});
+76
View File
@@ -203,6 +203,44 @@ describe("gitService", () => {
expect(result.status).toBe("up-to-date");
});
it("should delete stale local branch before checking out remote", async() => {
expect.assertions(2);
const branchDeleteCalls: Array<string> = [];
mockExecAsync.mockImplementation((command: string) => {
if (command.includes("git branch -r")) {
return Promise.resolve({
stderr: "",
stdout: " origin/dependencies/update-test-package\n",
});
}
if (command.includes("git branch") && !command.includes("-")) {
// Return local branches including the stale one
return Promise.resolve({
stderr: "",
stdout: "* main\n dependencies/update-test-package\n",
});
}
if (command.includes("git branch -D")) {
branchDeleteCalls.push(command);
}
return Promise.resolve({ stderr: "", stdout: "" });
});
vi.mocked(readFile).mockResolvedValue(JSON.stringify({
dependencies: { "test-package": "2.0.0" },
}));
const { createOrUpdateBranch } = await import("../../src/services/gitService.js");
const mockClonedRepo = createMockClonedRepo();
const result = await createOrUpdateBranch({
branchName: "dependencies/update-test-package",
clonedRepo: mockClonedRepo,
logger: mockLogger,
packageName: "test-package",
targetVersion: "2.0.0",
});
expect(result.status).toBe("up-to-date");
expect(branchDeleteCalls).toHaveLength(1);
});
it("should fail when package is not found", async() => {
expect.assertions(2);
mockExecAsync.mockResolvedValue({ stderr: "", stdout: "" });
@@ -364,6 +402,44 @@ describe("gitService", () => {
expect(writtenContent.devDependencies["test-package"]).toBe("2.0.0");
});
it("should fall back to new branch when remote branch fetch fails", async() => {
expect.assertions(2);
mockExecAsync.mockImplementation((command: string) => {
if (command.includes("git branch -r")) {
// Report branch as existing
return Promise.resolve({
stderr: "",
stdout: " origin/dependencies/update-test-package\n",
});
}
if (command.includes("git fetch origin dependencies/update-test-package")) {
// But fail when trying to fetch it (deleted between check and fetch)
const error = new Error("Git command failed") as Error & { stderr: string };
error.stderr = "fatal: couldn't find remote ref dependencies/update-test-package";
return Promise.reject(error);
}
return Promise.resolve({ stderr: "", stdout: "" });
});
vi.mocked(readFile).mockResolvedValue(JSON.stringify({
dependencies: { "test-package": "1.0.0" },
}));
vi.mocked(writeFile).mockResolvedValue(undefined);
const { createOrUpdateBranch } = await import("../../src/services/gitService.js");
const mockClonedRepo = createMockClonedRepo();
const result = await createOrUpdateBranch({
branchName: "dependencies/update-test-package",
clonedRepo: mockClonedRepo,
logger: mockLogger,
packageName: "test-package",
targetVersion: "2.0.0",
});
// Should fall back to creating a new branch
expect(result.status).toBe("created");
if (result.status === "created") {
expect(result.branchName).toBe("dependencies/update-test-package");
}
});
it("should log pnpm error details when install fails", async() => {
expect.assertions(2);
mockExecAsync.mockImplementation((command: string) => {
+135
View File
@@ -11,11 +11,19 @@
/* eslint-disable @typescript-eslint/consistent-type-imports -- Dynamic imports */
/* eslint-disable vitest/require-to-throw-message -- Generic throw assertion */
/* eslint-disable stylistic/max-len -- Test files have long URLs */
/* eslint-disable max-lines -- Test files have many test cases */
/* eslint-disable max-statements -- Test describe blocks have many statements */
import axios, { AxiosError, type AxiosResponse } from "axios";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { NpmService } from "../../src/services/npmService.js";
const getDaysAgoIso = (days: number): string => {
const msPerDay = 24 * 60 * 60 * 1000;
const ageMs = days * msPerDay;
return new Date(Date.now() - ageMs).toISOString();
};
vi.mock("axios", async() => {
const actualAxios = await vi.importActual<typeof import("axios")>("axios");
return {
@@ -331,4 +339,131 @@ describe("npmService", () => {
});
expect(result).toBe("Updated from 1.0.0 to 2.0.0");
});
it("should return latest mature version when versions are old enough", () => {
expect.assertions(1);
const oldDate = getDaysAgoIso(15);
const packageInfo = {
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "1.0.0": oldDate, "2.0.0": oldDate },
"versions": {
"1.0.0": { version: "1.0.0" },
"2.0.0": { version: "2.0.0" },
},
};
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBe("2.0.0");
});
it("should return null when no mature versions exist", () => {
expect.assertions(1);
const recentDate = getDaysAgoIso(2);
const packageInfo = {
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "2.0.0": recentDate },
"versions": { "2.0.0": { version: "2.0.0" } },
};
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBeNull();
});
it("should skip versions without time data", () => {
expect.assertions(1);
const oldDate = getDaysAgoIso(15);
const packageInfo = {
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "1.0.0": oldDate },
"versions": {
"1.0.0": { version: "1.0.0" },
"2.0.0": { version: "2.0.0" },
},
};
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBe("1.0.0");
});
it("should sort versions correctly and return the latest", () => {
expect.assertions(1);
const oldDate = getDaysAgoIso(15);
const packageInfo = {
"dist-tags": { latest: "3.0.0" },
"name": "test-package",
"time": { "1.0.0": oldDate, "2.0.0": oldDate, "3.0.0": oldDate },
"versions": {
"1.0.0": { version: "1.0.0" },
"2.0.0": { version: "2.0.0" },
"3.0.0": { version: "3.0.0" },
},
};
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBe("3.0.0");
});
it("should use custom minimumAgeDays parameter", () => {
expect.assertions(1);
const fiveDaysAgo = getDaysAgoIso(5);
const packageInfo = {
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "2.0.0": fiveDaysAgo },
"versions": { "2.0.0": { version: "2.0.0" } },
};
// Default is 10 days, so 5 days old should be null
const resultDefault = NpmService.getLatestMatureVersion(packageInfo);
expect(resultDefault).toBeNull();
});
it("should return mature version with custom minimumAgeDays", () => {
expect.assertions(1);
const fiveDaysAgo = getDaysAgoIso(5);
const packageInfo = {
"dist-tags": { latest: "2.0.0" },
"name": "test-package",
"time": { "2.0.0": fiveDaysAgo },
"versions": { "2.0.0": { version: "2.0.0" } },
};
// With 3 days minimum, 5 days old should be valid
const resultCustom = NpmService.getLatestMatureVersion(packageInfo, 3);
expect(resultCustom).toBe("2.0.0");
});
it("should skip prerelease versions like rc, alpha, beta", () => {
expect.assertions(1);
const oldDate = getDaysAgoIso(15);
const packageInfo = {
"dist-tags": { latest: "3.0.0-rc.1" },
"name": "test-package",
"time": {
"2.0.0": oldDate,
"3.0.0-alpha": oldDate,
"3.0.0-beta.1": oldDate,
"3.0.0-rc.1": oldDate,
},
"versions": {
"2.0.0": { version: "2.0.0" },
"3.0.0-alpha": { version: "3.0.0-alpha" },
"3.0.0-beta.1": { version: "3.0.0-beta.1" },
"3.0.0-rc.1": { version: "3.0.0-rc.1" },
},
};
// Should return 2.0.0 since all 3.0.0 versions are prereleases
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBe("2.0.0");
});
it("should return null when only prerelease versions exist", () => {
expect.assertions(1);
const oldDate = getDaysAgoIso(15);
const packageInfo = {
"dist-tags": { latest: "1.0.0-rc.1" },
"name": "test-package",
"time": { "1.0.0-rc.1": oldDate },
"versions": { "1.0.0-rc.1": { version: "1.0.0-rc.1" } },
};
const result = NpmService.getLatestMatureVersion(packageInfo);
expect(result).toBeNull();
});
});