From 355a22a53e866ab340d8d96a55460feed9a76d3c Mon Sep 17 00:00:00 2001 From: Ghost CI <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 21:48:48 +0000 Subject: [PATCH 001/174] Bumped version to 6.77.1-rc.0 --- ghost/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/package.json b/ghost/package.json index 422bc506b6e6..bc1e62226949 100644 --- a/ghost/package.json +++ b/ghost/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "6.77.0", + "version": "6.77.1-rc.0", "description": "The professional publishing platform", "keywords": [ "blog", From 8903ccf417e02cffcac687abc14cdb785e5b4a36 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Wed, 11 Nov 2026 19:00:05 -0500 Subject: [PATCH 002/174] Updated readdir-glob to v4 (#32804) no ref - add override for readdir-glob to update minimatch --- pnpm-lock.yaml | 13 +++++++------ pnpm-workspace.yaml | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0939a1f4f529..50d8777d674f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -860,6 +860,7 @@ overrides: body-parser: 1.20.9 express: 4.22.3 qs: 6.16.1 + readdir-glob: ^4.0.0 packageExtensionsChecksum: sha256-ObOLO7cMPhZpUKrGhf0yokgWfmIPQH99MnaBfCkqyCs= @@ -15295,9 +15296,9 @@ packages: resolution: {integrity: sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - readdir-glob@3.0.0: - resolution: {integrity: sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==} - engines: {node: '>=18'} + readdir-glob@4.0.0: + resolution: {integrity: sha512-TG+tPOT85yLmgnlsp6xIu7/cOZsFYs74utMOZRahGQ1HAm3QGT63MSUD64WyzbQg/WN8hciv/+43XTzeIgn83w==} + engines: {node: '>=20'} readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} @@ -22444,7 +22445,7 @@ snapshots: lazystream: 1.0.1 normalize-path: 3.0.0 readable-stream: 4.7.0 - readdir-glob: 3.0.0 + readdir-glob: 4.0.0 tar-stream: 3.2.0 zip-stream: 7.0.5 transitivePeerDependencies: @@ -28574,9 +28575,9 @@ snapshots: process: 0.11.10 string_decoder: 1.3.0 - readdir-glob@3.0.0: + readdir-glob@4.0.0: dependencies: - minimatch: 10.2.6 + minimatch: 11.0.5 readdirp@3.6.0: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9c3a2b41f69b..36a78d3d2f1e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -336,6 +336,7 @@ overrides: body-parser: 'catalog:' express: 'catalog:' qs: 'catalog:' + readdir-glob: '^4.0.0' packageExtensions: # These import packages they don't declare. @@ -431,6 +432,7 @@ minimumReleaseAgeExclude: # nx pins its platform binaries to its own exact version, so the release age # of nx itself still gates them - '@nx/nx-*' + - 'readdir-glob@4.0.0' # audit fix bump # configuration for pnpm's native versioning (changesets). Private packages opt out # by carrying the non-semver placeholder version "private", so only published From 4b1bc7c397cb3294e5c9832606659b00059f2dee Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 11 Nov 2026 18:26:44 -0600 Subject: [PATCH 003/174] Improved machine payments test flakiness (#32805) no ref --- .../unit/server/services/machine-payments/service.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghost/test/unit/server/services/machine-payments/service.test.ts b/ghost/test/unit/server/services/machine-payments/service.test.ts index 1ab725ead198..c4a9a722695a 100644 --- a/ghost/test/unit/server/services/machine-payments/service.test.ts +++ b/ghost/test/unit/server/services/machine-payments/service.test.ts @@ -54,7 +54,12 @@ describe('Unit: server/services/machine-payments/service', function () { }), }; - contentLoader = sinon.createStubInstance(ContentLoader); + // Sinon 22 createStubInstance uses a separate call counter. Supply stubs + // from the same sandbox as the adapters so callOrder remains reliable. + contentLoader = sinon.createStubInstance(ContentLoader, { + isPurchasable: sinon.stub(), + loadFullEntry: sinon.stub(), + }); contentLoader.isPurchasable.resolves(true); contentLoader.loadFullEntry.resolves({ id: 'post1', From 27d8a8000a93fcb9be257722c0a03bc380bd7922 Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 11 Nov 2026 18:27:09 -0600 Subject: [PATCH 004/174] Removed unnecessary class from link replacer (#32803) no ref I recommend reviewing this with whitespace changes disabled. This removes an unnecessary class and just exports the function. --- ghost/core/server/lib/link-replacer.js | 148 ++++++++++++------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/ghost/core/server/lib/link-replacer.js b/ghost/core/server/lib/link-replacer.js index 5f434823d6a7..5b26c0d6e2da 100644 --- a/ghost/core/server/lib/link-replacer.js +++ b/ghost/core/server/lib/link-replacer.js @@ -1,94 +1,92 @@ -class LinkReplacer { - /** - * Replaces the links in the provided HTML - * @param {string} html - * @param {(url: URL, originalPath: string) => Promise} replaceLink - * @param {object} options - * @param {string} [options.base] If you want to replace relative links, this will replace them to an absolute link and call the replaceLink method too - * @returns {Promise} - */ - async replace(html, replaceLink, options = {}) { - const { tokenize } = require('html5parser'); - const entities = require('entities'); +/** + * Replaces the links in the provided HTML + * @param {string} html + * @param {(url: URL, originalPath: string) => Promise} replaceLink + * @param {object} options + * @param {string} [options.base] If you want to replace relative links, this will replace them to an absolute link and call the replaceLink method too + * @returns {Promise} + */ +const replace = async (html, replaceLink, options = {}) => { + const { tokenize } = require('html5parser'); + const entities = require('entities'); - try { - const tokens = tokenize(html); // IToken[] - const replacements = []; + try { + const tokens = tokenize(html); // IToken[] + const replacements = []; - let inAnchor = false; - let inHref = false; + let inAnchor = false; + let inHref = false; - // interface IToken { - // start: number; - // end: number; - // value: string; - // type: TokenKind; - // } + // interface IToken { + // start: number; + // end: number; + // value: string; + // type: TokenKind; + // } - // const enum TokenKind { - // 0 Literal, - // 1 OpenTag, // trim leading '<' - // 2 OpenTagEnd, // trim tailing '>', only could be '/' or '' - // 3 CloseTag, // trim leading '' - // 4 Whitespace, // the whitespace between attributes - // 5 AttrValueEq, - // 6 AttrValueNq, - // 7 AttrValueSq, - // 8 AttrValueDq, - // } + // const enum TokenKind { + // 0 Literal, + // 1 OpenTag, // trim leading '<' + // 2 OpenTagEnd, // trim tailing '>', only could be '/' or '' + // 3 CloseTag, // trim leading '' + // 4 Whitespace, // the whitespace between attributes + // 5 AttrValueEq, + // 6 AttrValueNq, + // 7 AttrValueSq, + // 8 AttrValueDq, + // } - for (const token of tokens) { - if (token.type === 1 && token.value === 'a') { - inAnchor = true; + for (const token of tokens) { + if (token.type === 1 && token.value === 'a') { + inAnchor = true; + } + + if (inAnchor) { + if (token.type === 2) { + inAnchor = false; + inHref = false; } - if (inAnchor) { - if (token.type === 2) { - inAnchor = false; - inHref = false; - } + if (token.type === 6 && token.value === 'href') { + inHref = true; + } - if (token.type === 6 && token.value === 'href') { - inHref = true; + if (inHref && token.type === 8) { + const path = entities.decode(token.value.substring(1, token.value.length - 1)); + let url; + try { + url = new URL(path, options.base); + } catch (e) { + // Ignore invalid URLs } - - if (inHref && token.type === 8) { - const path = entities.decode(token.value.substring(1, token.value.length - 1)); - let url; - try { - url = new URL(path, options.base); - } catch (e) { - // Ignore invalid URLs - } - if (url) { - url = await replaceLink(url, path); - const str = url.toString(); - replacements.push({ url: str, start: token.start + 1, end: token.end - 1 }); - } - - inHref = false; + if (url) { + url = await replaceLink(url, path); + const str = url.toString(); + replacements.push({ url: str, start: token.start + 1, end: token.end - 1 }); } + + inHref = false; } } + } - let offsetAdjustment = 0; + let offsetAdjustment = 0; - replacements.forEach(({ url, start, end }) => { - const originalLength = end - start; - const replacementLength = url.length; + replacements.forEach(({ url, start, end }) => { + const originalLength = end - start; + const replacementLength = url.length; - html = html.slice(0, start + offsetAdjustment) + url + html.slice(end + offsetAdjustment); + html = html.slice(0, start + offsetAdjustment) + url + html.slice(end + offsetAdjustment); - offsetAdjustment += replacementLength - originalLength; - }); + offsetAdjustment += replacementLength - originalLength; + }); - return html; - } catch (e) { - // do nothing in case of error, - // we don't want to break the content for the sake of member attribution - return html; - } + return html; + } catch (e) { + // do nothing in case of error, + // we don't want to break the content for the sake of member attribution + return html; } -} +}; -module.exports = new LinkReplacer(); +module.exports = { replace }; From 63a3aef3c0be85be9317534bdb9c35b6500494df Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:23:35 +0000 Subject: [PATCH 005/174] Update dependency knip to v6.44.2 --- pnpm-lock.yaml | 230 +++++++++++++++++++++----------------------- pnpm-workspace.yaml | 2 +- 2 files changed, 112 insertions(+), 120 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50d8777d674f..367ad96e2bad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -648,8 +648,8 @@ catalogs: specifier: 6.2.1 version: 6.2.1 knip: - specifier: 6.32.1 - version: 6.32.1 + specifier: 6.44.2 + version: 6.44.2 libphonenumber-js: specifier: 1.13.15 version: 1.13.15 @@ -898,7 +898,7 @@ importers: version: 4.3.2 knip: specifier: 'catalog:' - version: 6.32.1 + version: 6.44.2 lint-staged: specifier: 'catalog:' version: 17.6.0 @@ -6525,8 +6525,8 @@ packages: cpu: [arm] os: [android] - '@oxc-parser/binding-android-arm-eabi@0.142.0': - resolution: {integrity: sha512-ZiRGDutGsv1G6bL/ozy/koC0Sv39T1DqyoC4KD1DOy9ZoACm1O5UWhEK2c02Qdk+4lfLVkvFa/mQ0fm/4h1BtQ==} + '@oxc-parser/binding-android-arm-eabi@0.156.0': + resolution: {integrity: sha512-RMq7DKNzEp1T51QKNLTn0NryNEt2IYfh7mZBlIdi2Ju52ltOEDMeIXv0XBpA6dL7j7ChjlcovtGcc1Jv4qMipg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] @@ -6537,8 +6537,8 @@ packages: cpu: [arm64] os: [android] - '@oxc-parser/binding-android-arm64@0.142.0': - resolution: {integrity: sha512-WZkvGRLNQTz8lR9zP5nLjUdlroRCopBu3g9zF1p/laE6DzT1UbQo8Rdz5MWhaJUPYg/6gp+jo7HUgsyKaN1FtQ==} + '@oxc-parser/binding-android-arm64@0.156.0': + resolution: {integrity: sha512-mwkWKhOBpmh8fWc3m4MiLsmEAtx0YuHmvyo9ff557cnb3QZ2kt2eauSz75wCGIpiZG3gUsJ4WwzEjm4R4/BHig==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] @@ -6549,8 +6549,8 @@ packages: cpu: [arm64] os: [darwin] - '@oxc-parser/binding-darwin-arm64@0.142.0': - resolution: {integrity: sha512-l4khS8LQOOVYsGRVARo1gSaCT/aBSceUVXgtovWc2+drnxVuDr082WA3OCHVdVzIz5JIrP/y9CWsSKxBDNmYGg==} + '@oxc-parser/binding-darwin-arm64@0.156.0': + resolution: {integrity: sha512-6pGR5fUszM9M4eBBapqpGjCRJolFwuCldx8bRQjqXyM09cQysBTWVF2Ttg4UNJVxYSaw5RRINbveCOOCrsuGvA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] @@ -6561,8 +6561,8 @@ packages: cpu: [x64] os: [darwin] - '@oxc-parser/binding-darwin-x64@0.142.0': - resolution: {integrity: sha512-QBsNF3nqlXmcH2B1YOPqQYmCJoy4HuIjUxGbBO/k5JAJUl68ghU2psRY2zPk+RyBaWqKP/qfL4oaFgEMCdwskA==} + '@oxc-parser/binding-darwin-x64@0.156.0': + resolution: {integrity: sha512-M9QghL7uCAqMKjYJv1rDGblfEvkeQu3QzTPd7Uwo16gG3uO7m9ikVQ9OL8FZTnKzU4vbCEby6kTlEkqN+JeEMA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] @@ -6573,8 +6573,8 @@ packages: cpu: [x64] os: [freebsd] - '@oxc-parser/binding-freebsd-x64@0.142.0': - resolution: {integrity: sha512-b7Q7m4Cqc6XqNhri3R+QhU+GVy646Pn+bkdhrDdWym/Fdi0ZUa+d73H9dm5H91JtbtAQ/z1d8XKMW3oOV8a4tQ==} + '@oxc-parser/binding-freebsd-x64@0.156.0': + resolution: {integrity: sha512-lX0ANxSwAOrpOT7NHB+YsrBqDJ8sOVon5m7GS9eQtkuUeNzQMMGpFsJLsStawTbrdwOF5KDVxgPWcKmt/DIZUQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] @@ -6585,8 +6585,8 @@ packages: cpu: [arm] os: [linux] - '@oxc-parser/binding-linux-arm-gnueabihf@0.142.0': - resolution: {integrity: sha512-3riVS5IhdH3uCZj1Y9ftDQlR0dvLsIlw/edrRqk8JhgNd5K0XSs+UBtgh50N13CAlW9/TXj6sVGXaKNBocd0Yg==} + '@oxc-parser/binding-linux-arm-gnueabihf@0.156.0': + resolution: {integrity: sha512-iPgYpasRcqk7X3TGncQg7B+6RotDvG8weug0UrgF+FXLf4KmaNDyT91BKONlqbHcNgK9Nryp7AEZGuQn32fP6g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] @@ -6597,8 +6597,8 @@ packages: cpu: [arm] os: [linux] - '@oxc-parser/binding-linux-arm-musleabihf@0.142.0': - resolution: {integrity: sha512-NmXUOpgpTSkhl795TiXmWppTwmSJ92RC1qvD6e4XOF+slgmo3e6Ah+kEu+6AN8s7NAOEwqGmir58MgSQSWmBSA==} + '@oxc-parser/binding-linux-arm-musleabihf@0.156.0': + resolution: {integrity: sha512-sJqJDEZevtkEfoxrXfaRTkSt6Itckr549cIfBbs11UgXv8bFyqQsXTQa6iKm8mTiWYmCDDFJf7TLnqxcbqzPOw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] @@ -6610,8 +6610,8 @@ packages: os: [linux] libc: [glibc] - '@oxc-parser/binding-linux-arm64-gnu@0.142.0': - resolution: {integrity: sha512-gc0EXsKtXgerujmU2Bql3u1L1HsSQ2774R83idq/FoNMPVV/RY/1ErFsvnit7KoiP/sLvzQixeUo4Ut0ic0wmw==} + '@oxc-parser/binding-linux-arm64-gnu@0.156.0': + resolution: {integrity: sha512-mrQs5OdRiqKskRuWEORPKT6YGIFhrpVvCvL9hqVaIh60EzgR4qjPvSsV6hWZcOfyWHBTbdEvfnDJPh/eQlxPRQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] @@ -6624,8 +6624,8 @@ packages: os: [linux] libc: [musl] - '@oxc-parser/binding-linux-arm64-musl@0.142.0': - resolution: {integrity: sha512-F2XvmWSE0uWpie+jHKKIFgdVOe9ypGhkEZxKx5DuW215K6cbAC274yYaPkcM7EqY4Df3Weyhpcz3lsURyH2LVg==} + '@oxc-parser/binding-linux-arm64-musl@0.156.0': + resolution: {integrity: sha512-ZtPqgCU3+wpU7dvX7YbaEiw71r0UdguzuPhcx4PIEZSs4XFqc6F5wXCtNdb6M7m3DMErlxrwosryoXrzYOY/Gg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] @@ -6638,8 +6638,8 @@ packages: os: [linux] libc: [glibc] - '@oxc-parser/binding-linux-ppc64-gnu@0.142.0': - resolution: {integrity: sha512-wLMbT21U/QxknQsk+VvNF0b9D2/aGWhcaQQQ+VYlE8FwD5+GoWZIPPXNzyHmkYyhm0KB3itL+TBavjMatqNnYA==} + '@oxc-parser/binding-linux-ppc64-gnu@0.156.0': + resolution: {integrity: sha512-ZuGRT/adReZZJn3PYNneb1HQIOH0iIZ2fzFgC1/XJYpMQ5KsRKmWIEzy3wEFsUwIOTomCmnmTZ/zbFYo9z9VeA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] @@ -6652,8 +6652,8 @@ packages: os: [linux] libc: [glibc] - '@oxc-parser/binding-linux-riscv64-gnu@0.142.0': - resolution: {integrity: sha512-+G8F/4ckwT7FCJV4H2bt09xEzJbjNCfuL4Sp1AYNaFtFMVtgIGMuJlteT82U+K0UIZ/DzAR/LDlMFnEuajG7Kw==} + '@oxc-parser/binding-linux-riscv64-gnu@0.156.0': + resolution: {integrity: sha512-T+iWCeAOoEAJpHqr6/pogHIv98g9p8Ctccysm/h962hG4ayX5OL2c0Ih4oYe+JuFndLXy/OASvwMlTPe76sIiw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] @@ -6666,8 +6666,8 @@ packages: os: [linux] libc: [musl] - '@oxc-parser/binding-linux-riscv64-musl@0.142.0': - resolution: {integrity: sha512-hTsHtTLxMAfCo+rpF5K3qZJKW2NpPN/CHd4mYB3y7XlSdspHkd2gehDIofP64AacA9nWQw2tY3O7wR6UY8IVOA==} + '@oxc-parser/binding-linux-riscv64-musl@0.156.0': + resolution: {integrity: sha512-wL55bI2kVKfwdxScbw60zVgzAqbQbmE5zpSPWPZoZ9RSG8egm6ITE/UWE5mDWlglxz1QElJCcUbpaJCtHD11BQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] @@ -6680,8 +6680,8 @@ packages: os: [linux] libc: [glibc] - '@oxc-parser/binding-linux-s390x-gnu@0.142.0': - resolution: {integrity: sha512-6y7qYY3TCUDYjqswImdTGl92y+KA/80twALegQPN27kfY+bG7Ib1+L3jbmrCZQx6wrVnai9IPsEZp07I0hx7JQ==} + '@oxc-parser/binding-linux-s390x-gnu@0.156.0': + resolution: {integrity: sha512-+D+JilhLqwrDLODYEl4qtovVwgxKALb23FkAWBiPvgmUWYgjCV83KKuwwxZJM8GCdKlNA1vt3iKtow8HUFjXtg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] @@ -6694,8 +6694,8 @@ packages: os: [linux] libc: [glibc] - '@oxc-parser/binding-linux-x64-gnu@0.142.0': - resolution: {integrity: sha512-i69kAWU+2LgoH5bR+zWiiu+UzAw7Oxkwv7COeJTeY19pn4e70nKQcr9Pm6cL2Z0Z54d+gl9qADlK/0yyuCPiBA==} + '@oxc-parser/binding-linux-x64-gnu@0.156.0': + resolution: {integrity: sha512-jRfwpN4xKrsEpC+SgrUPY5k0mINYZn7aLrt22I3uQFoumiSgHgsLYgS9f84ntbkvSydH4HiwGuDa2b1XCHaJzw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] @@ -6708,8 +6708,8 @@ packages: os: [linux] libc: [musl] - '@oxc-parser/binding-linux-x64-musl@0.142.0': - resolution: {integrity: sha512-4SQs678MmjYVrmhAgCWD4o0vpaFszXw9xLX5p2Z9MMFcltxiLkA88wQjh80YHjPrXtpyZ2CWI5m+1yNKM0m2Pw==} + '@oxc-parser/binding-linux-x64-musl@0.156.0': + resolution: {integrity: sha512-P/ajnypgLmxmuRRyCIZcp2o4lOwmCaXYH5+eqDTcCW+MCTI+csKSw/Zc6GB67jZoVa4ey3q1jXEt7S60adBEMQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] @@ -6721,8 +6721,8 @@ packages: cpu: [arm64] os: [openharmony] - '@oxc-parser/binding-openharmony-arm64@0.142.0': - resolution: {integrity: sha512-YHpx9N7Ln3a++Tc8rv+H7mrK1zyJQOAwCFg8LZ3lTs1T5afGWeZrLPhPT9HLnIwSjCyJqPWVMIrMxbjcmBr2oQ==} + '@oxc-parser/binding-openharmony-arm64@0.156.0': + resolution: {integrity: sha512-WSN6rQZZc9KqgZ4lMfjVDvqKhVOCjey/YEZIPisGXmwBqwgWOzru207dyiH50LHcf1n9LO2oceGk/id6RL9v0g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] @@ -6732,19 +6732,14 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] - '@oxc-parser/binding-wasm32-wasi@0.142.0': - resolution: {integrity: sha512-3pLDyY3+oogW73RM5uehNgAiR/Xfb7fvO2Q1Z1gIqZ2+50XDVQmBVlRkHXZTU4gKnQHpwETNsYQVsJ3joVB2iA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [wasm32] - '@oxc-parser/binding-win32-arm64-msvc@0.127.0': resolution: {integrity: sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxc-parser/binding-win32-arm64-msvc@0.142.0': - resolution: {integrity: sha512-Had/VeVY28Oyb0K+Q4FV8KCzoBycIh93oDK6pCbya9lkzdq+ikMHMgBubsdqqlybjJmQRawCQRrnBRHyQwYvcQ==} + '@oxc-parser/binding-win32-arm64-msvc@0.156.0': + resolution: {integrity: sha512-l21Tz6tjraGBC3JefVeJZ9pojD0fCiB62PydAv+i9nrqJX7z/pDmyDNYLamDr/PRcQ4UQbFwkSnz7NKBB9UMLw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] @@ -6755,8 +6750,8 @@ packages: cpu: [ia32] os: [win32] - '@oxc-parser/binding-win32-ia32-msvc@0.142.0': - resolution: {integrity: sha512-GGi3+YphVHavvgs6gum2UXoNCqzHAmPt/nXkn8ZQZstV2Q1qZD1Mn8fz/nWrDkefHQtrG/+1/XrbMxsBTo6Svw==} + '@oxc-parser/binding-win32-ia32-msvc@0.156.0': + resolution: {integrity: sha512-CUq0ZFl/RODqPiIgfNNSamkpTj5x8AjBTkR/y1DNVIQiTGnmWqjHcn3o08ZW3q/LgkI4g9G9g6UirmmQFvuOZw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] @@ -6767,8 +6762,8 @@ packages: cpu: [x64] os: [win32] - '@oxc-parser/binding-win32-x64-msvc@0.142.0': - resolution: {integrity: sha512-Ny/Wv4Us1LGC/ljwNTp+Hx3r/pH15EFfeDF0p+n898gt+TtRd6C9SccHcuUhDiNTb8s5tt7jdeAMDRQZ4Vq6hg==} + '@oxc-parser/binding-win32-x64-msvc@0.156.0': + resolution: {integrity: sha512-dcpx5Y1x2v/cs7U/q3SZMvmxfyXjVvqC86jMuw2ZZUbHDd7W2cW7uSMQfg3GLVaE68Su3H9xd/Pc4v6QNyeSRg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -6779,8 +6774,8 @@ packages: '@oxc-project/types@0.139.0': resolution: {integrity: sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==} - '@oxc-project/types@0.142.0': - resolution: {integrity: sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==} + '@oxc-project/types@0.156.0': + resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==} '@oxc-resolver/binding-android-arm-eabi@11.21.2': resolution: {integrity: sha512-xQoCRv+gKax9KTdwdaQNnAFOai8neay7g3jExDIORzhbrejwGSJaZNTdOJHR5ziLg2joMxOCMOFMo4zuxza2uQ==} @@ -11953,9 +11948,9 @@ packages: resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==} engines: {node: '>= 6'} - formatly@0.3.0: - resolution: {integrity: sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==} - engines: {node: '>=18.3.0'} + formatly@0.11.4: + resolution: {integrity: sha512-TeCC10lP8KCgoX+Fe5lryILIT0/Dy+nP0OSVnsuB5CwXoLuOdqxCYlPFF1inR8S/zTy1ec7TjhS2TeRKWzzImA==} + engines: {node: '>=18.14.0'} hasBin: true formidable@3.5.4: @@ -12059,8 +12054,8 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - get-tsconfig@4.14.1: - resolution: {integrity: sha512-Dz/6HxkrxgNehhxLVeyv8sad9UzF2xBVeaKBQNDfJ5XiSXmp2gTR0eO0RWiT2NCKS5aGP9jjkOMggTN90qU50A==} + get-tsconfig@4.14.3: + resolution: {integrity: sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==} get-tsconfig@5.0.0-beta.5: resolution: {integrity: sha512-/6gFNr0N04nob252sTQxyFLi3eKFRqIg1I87YcqAMT1i6SQrSF6KujUEQrtrjMV0H/eejTCltLdDSTEMzHbnsQ==} @@ -13028,8 +13023,8 @@ packages: tedious: optional: true - knip@6.32.1: - resolution: {integrity: sha512-mIiIHMTJVUgSlz0mxEgPt7wg8DmfbCp1Txqab3WpbMCJF7YHvHtC9jeAHHXfISMl72N8WzhyG71SQlaqCOGZtg==} + knip@6.44.2: + resolution: {integrity: sha512-6URO7pnqtOnyvSsXfW6+8C9j1lfcicxUCysXO0RgMtHTZ96HqCXh29op8iabeQW5JeIc8dJWwzSdJVWDokeScQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -14317,8 +14312,8 @@ packages: resolution: {integrity: sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA==} engines: {node: ^20.19.0 || >=22.12.0} - oxc-parser@0.142.0: - resolution: {integrity: sha512-kKR+jPiRJYJDexVoziIg/FVGvr1fT1FZSSJOk6tVoMKKSlsf1Cso+cgGCJkOEDWOP174vRntCPFKg+AS7InWvw==} + oxc-parser@0.156.0: + resolution: {integrity: sha512-7JhjgOfZjrIFJH5TlHrpRua864Si5GvwrPr5+eIRCY2sszhKXo6pyhP0HQKOGTtfO4UowwZ72XTGba0+lZphOQ==} engines: {node: ^20.19.0 || >=22.12.0} oxc-resolver@11.21.2: @@ -14392,6 +14387,9 @@ packages: resolution: {integrity: sha512-zDQ/3GyUFSwklDAT7jeBu4FQgxw0o0yayyP4qizTl5yDYlAWbk71npDC1zhOqD4iqnEN2/4Ssr8Xc2aUQtvdAg==} engines: {node: '>=22'} + package-manager-detector@1.9.0: + resolution: {integrity: sha512-zAMfbta9nPA8AKkA4WdmNAT8R8s6Dk0/xwPsqNnRidMFcLo1YkLuPDTgs2f64XdzS8vbLNnoJ+uUIkgbz7oRHA==} + pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} @@ -16465,8 +16463,8 @@ packages: resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==} engines: {node: '>=18'} - unbash@4.0.10: - resolution: {integrity: sha512-b7zoBQvpWp0vuN5q2vK2RRBR2SvuruQAs50DApdDveBSn3eSYd84IaHodFqQIMlvY9K2VnyBUEXgwOBuGU9GBg==} + unbash@6.0.4: + resolution: {integrity: sha512-t3OptUArewg9OpYGDskTSlxhyLDahfmZ4d36hE44Efb1y3HRLLpzsVqwH+AwBVymP4t7pP71xN+nnduudn2awA==} engines: {node: '>=14'} unbox-primitive@1.1.0: @@ -19085,97 +19083,97 @@ snapshots: '@oxc-parser/binding-android-arm-eabi@0.127.0': optional: true - '@oxc-parser/binding-android-arm-eabi@0.142.0': + '@oxc-parser/binding-android-arm-eabi@0.156.0': optional: true '@oxc-parser/binding-android-arm64@0.127.0': optional: true - '@oxc-parser/binding-android-arm64@0.142.0': + '@oxc-parser/binding-android-arm64@0.156.0': optional: true '@oxc-parser/binding-darwin-arm64@0.127.0': optional: true - '@oxc-parser/binding-darwin-arm64@0.142.0': + '@oxc-parser/binding-darwin-arm64@0.156.0': optional: true '@oxc-parser/binding-darwin-x64@0.127.0': optional: true - '@oxc-parser/binding-darwin-x64@0.142.0': + '@oxc-parser/binding-darwin-x64@0.156.0': optional: true '@oxc-parser/binding-freebsd-x64@0.127.0': optional: true - '@oxc-parser/binding-freebsd-x64@0.142.0': + '@oxc-parser/binding-freebsd-x64@0.156.0': optional: true '@oxc-parser/binding-linux-arm-gnueabihf@0.127.0': optional: true - '@oxc-parser/binding-linux-arm-gnueabihf@0.142.0': + '@oxc-parser/binding-linux-arm-gnueabihf@0.156.0': optional: true '@oxc-parser/binding-linux-arm-musleabihf@0.127.0': optional: true - '@oxc-parser/binding-linux-arm-musleabihf@0.142.0': + '@oxc-parser/binding-linux-arm-musleabihf@0.156.0': optional: true '@oxc-parser/binding-linux-arm64-gnu@0.127.0': optional: true - '@oxc-parser/binding-linux-arm64-gnu@0.142.0': + '@oxc-parser/binding-linux-arm64-gnu@0.156.0': optional: true '@oxc-parser/binding-linux-arm64-musl@0.127.0': optional: true - '@oxc-parser/binding-linux-arm64-musl@0.142.0': + '@oxc-parser/binding-linux-arm64-musl@0.156.0': optional: true '@oxc-parser/binding-linux-ppc64-gnu@0.127.0': optional: true - '@oxc-parser/binding-linux-ppc64-gnu@0.142.0': + '@oxc-parser/binding-linux-ppc64-gnu@0.156.0': optional: true '@oxc-parser/binding-linux-riscv64-gnu@0.127.0': optional: true - '@oxc-parser/binding-linux-riscv64-gnu@0.142.0': + '@oxc-parser/binding-linux-riscv64-gnu@0.156.0': optional: true '@oxc-parser/binding-linux-riscv64-musl@0.127.0': optional: true - '@oxc-parser/binding-linux-riscv64-musl@0.142.0': + '@oxc-parser/binding-linux-riscv64-musl@0.156.0': optional: true '@oxc-parser/binding-linux-s390x-gnu@0.127.0': optional: true - '@oxc-parser/binding-linux-s390x-gnu@0.142.0': + '@oxc-parser/binding-linux-s390x-gnu@0.156.0': optional: true '@oxc-parser/binding-linux-x64-gnu@0.127.0': optional: true - '@oxc-parser/binding-linux-x64-gnu@0.142.0': + '@oxc-parser/binding-linux-x64-gnu@0.156.0': optional: true '@oxc-parser/binding-linux-x64-musl@0.127.0': optional: true - '@oxc-parser/binding-linux-x64-musl@0.142.0': + '@oxc-parser/binding-linux-x64-musl@0.156.0': optional: true '@oxc-parser/binding-openharmony-arm64@0.127.0': optional: true - '@oxc-parser/binding-openharmony-arm64@0.142.0': + '@oxc-parser/binding-openharmony-arm64@0.156.0': optional: true '@oxc-parser/binding-wasm32-wasi@0.127.0': @@ -19185,36 +19183,29 @@ snapshots: '@napi-rs/wasm-runtime': 1.2.2(@emnapi/core@1.9.2)(@emnapi/runtime@1.9.2) optional: true - '@oxc-parser/binding-wasm32-wasi@0.142.0': - dependencies: - '@emnapi/core': 1.11.2 - '@emnapi/runtime': 1.11.2 - '@napi-rs/wasm-runtime': 1.2.2(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.2) - optional: true - '@oxc-parser/binding-win32-arm64-msvc@0.127.0': optional: true - '@oxc-parser/binding-win32-arm64-msvc@0.142.0': + '@oxc-parser/binding-win32-arm64-msvc@0.156.0': optional: true '@oxc-parser/binding-win32-ia32-msvc@0.127.0': optional: true - '@oxc-parser/binding-win32-ia32-msvc@0.142.0': + '@oxc-parser/binding-win32-ia32-msvc@0.156.0': optional: true '@oxc-parser/binding-win32-x64-msvc@0.127.0': optional: true - '@oxc-parser/binding-win32-x64-msvc@0.142.0': + '@oxc-parser/binding-win32-x64-msvc@0.156.0': optional: true '@oxc-project/types@0.127.0': {} '@oxc-project/types@0.139.0': {} - '@oxc-project/types@0.142.0': {} + '@oxc-project/types@0.156.0': {} '@oxc-resolver/binding-android-arm-eabi@11.21.2': optional: true @@ -24230,7 +24221,7 @@ snapshots: enhanced-resolve: 5.26.0 eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-es-x: 7.8.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) - get-tsconfig: 4.14.1 + get-tsconfig: 4.14.3 globals: 15.15.0 globrex: 0.1.2 ignore: 5.3.2 @@ -24719,9 +24710,10 @@ snapshots: hasown: 2.0.4 mime-types: 2.1.35 - formatly@0.3.0: + formatly@0.11.4: dependencies: fd-package-json: 2.0.0 + package-manager-detector: 1.9.0 formidable@3.5.4: dependencies: @@ -24845,7 +24837,7 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 - get-tsconfig@4.14.1: + get-tsconfig@4.14.3: dependencies: resolve-pkg-maps: 1.0.0 @@ -25959,19 +25951,18 @@ snapshots: transitivePeerDependencies: - supports-color - knip@6.32.1: + knip@6.44.2: dependencies: - fdir: 6.5.0(picomatch@4.0.7) - formatly: 0.3.0 - get-tsconfig: 4.14.1 + formatly: 0.11.4 + get-tsconfig: 4.14.3 jiti: 2.7.0 - oxc-parser: 0.142.0 + oxc-parser: 0.156.0 oxc-resolver: 11.24.2 picomatch: 4.0.7 smol-toml: 1.9.1 strip-json-comments: 5.0.3 tinyglobby: 0.2.17 - unbash: 4.0.10 + unbash: 6.0.4 yaml: 2.9.1 zod: 4.6.7 @@ -27480,30 +27471,29 @@ snapshots: '@oxc-parser/binding-win32-ia32-msvc': 0.127.0 '@oxc-parser/binding-win32-x64-msvc': 0.127.0 - oxc-parser@0.142.0: + oxc-parser@0.156.0: dependencies: - '@oxc-project/types': 0.142.0 + '@oxc-project/types': 0.156.0 optionalDependencies: - '@oxc-parser/binding-android-arm-eabi': 0.142.0 - '@oxc-parser/binding-android-arm64': 0.142.0 - '@oxc-parser/binding-darwin-arm64': 0.142.0 - '@oxc-parser/binding-darwin-x64': 0.142.0 - '@oxc-parser/binding-freebsd-x64': 0.142.0 - '@oxc-parser/binding-linux-arm-gnueabihf': 0.142.0 - '@oxc-parser/binding-linux-arm-musleabihf': 0.142.0 - '@oxc-parser/binding-linux-arm64-gnu': 0.142.0 - '@oxc-parser/binding-linux-arm64-musl': 0.142.0 - '@oxc-parser/binding-linux-ppc64-gnu': 0.142.0 - '@oxc-parser/binding-linux-riscv64-gnu': 0.142.0 - '@oxc-parser/binding-linux-riscv64-musl': 0.142.0 - '@oxc-parser/binding-linux-s390x-gnu': 0.142.0 - '@oxc-parser/binding-linux-x64-gnu': 0.142.0 - '@oxc-parser/binding-linux-x64-musl': 0.142.0 - '@oxc-parser/binding-openharmony-arm64': 0.142.0 - '@oxc-parser/binding-wasm32-wasi': 0.142.0 - '@oxc-parser/binding-win32-arm64-msvc': 0.142.0 - '@oxc-parser/binding-win32-ia32-msvc': 0.142.0 - '@oxc-parser/binding-win32-x64-msvc': 0.142.0 + '@oxc-parser/binding-android-arm-eabi': 0.156.0 + '@oxc-parser/binding-android-arm64': 0.156.0 + '@oxc-parser/binding-darwin-arm64': 0.156.0 + '@oxc-parser/binding-darwin-x64': 0.156.0 + '@oxc-parser/binding-freebsd-x64': 0.156.0 + '@oxc-parser/binding-linux-arm-gnueabihf': 0.156.0 + '@oxc-parser/binding-linux-arm-musleabihf': 0.156.0 + '@oxc-parser/binding-linux-arm64-gnu': 0.156.0 + '@oxc-parser/binding-linux-arm64-musl': 0.156.0 + '@oxc-parser/binding-linux-ppc64-gnu': 0.156.0 + '@oxc-parser/binding-linux-riscv64-gnu': 0.156.0 + '@oxc-parser/binding-linux-riscv64-musl': 0.156.0 + '@oxc-parser/binding-linux-s390x-gnu': 0.156.0 + '@oxc-parser/binding-linux-x64-gnu': 0.156.0 + '@oxc-parser/binding-linux-x64-musl': 0.156.0 + '@oxc-parser/binding-openharmony-arm64': 0.156.0 + '@oxc-parser/binding-win32-arm64-msvc': 0.156.0 + '@oxc-parser/binding-win32-ia32-msvc': 0.156.0 + '@oxc-parser/binding-win32-x64-msvc': 0.156.0 oxc-resolver@11.21.2: optionalDependencies: @@ -27626,6 +27616,8 @@ snapshots: p-wait-for@7.0.0: {} + package-manager-detector@1.9.0: {} + pako@1.0.11: {} papaparse@5.5.4: {} @@ -29928,7 +29920,7 @@ snapshots: dependencies: chokidar: 3.6.0 commander: 9.5.0 - get-tsconfig: 4.14.1 + get-tsconfig: 4.14.3 globby: 11.1.0 mylas: 2.1.14 normalize-path: 3.0.0 @@ -30091,7 +30083,7 @@ snapshots: uint8array-extras@1.5.0: {} - unbash@4.0.10: {} + unbash@6.0.4: {} unbox-primitive@1.1.0: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 36a78d3d2f1e..4215d851efe3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -258,7 +258,7 @@ catalog: '@octokit/plugin-throttling': 11.0.5 '@secretlint/secretlint-rule-pattern': 13.0.7 '@secretlint/secretlint-rule-preset-recommend': 13.0.7 - knip: 6.32.1 + knip: 6.44.2 lint-staged: 17.6.0 secretlint: 13.0.7 '@pnpm/releasing.versioning': 1100.3.8 From 25b0522bd32d4da9282c69b7bfb50ebb1967c7c5 Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 00:58:38 +0000 Subject: [PATCH 006/174] Update secretlint monorepo to v13.1.0 --- pnpm-lock.yaml | 157 ++++++++++++++++++++++---------------------- pnpm-workspace.yaml | 6 +- 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 367ad96e2bad..1bfbf8eebc76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -294,11 +294,11 @@ catalogs: specifier: 1.2.11 version: 1.2.11 '@secretlint/secretlint-rule-pattern': - specifier: 13.0.7 - version: 13.0.7 + specifier: 13.1.0 + version: 13.1.0 '@secretlint/secretlint-rule-preset-recommend': - specifier: 13.0.7 - version: 13.0.7 + specifier: 13.1.0 + version: 13.1.0 '@sentry/bundler-plugin-core': specifier: 5.3.0 version: 5.3.0 @@ -732,8 +732,8 @@ catalogs: specifier: 0.27.11 version: 0.27.11 secretlint: - specifier: 13.0.7 - version: 13.0.7 + specifier: 13.1.0 + version: 13.1.0 semver: specifier: 7.8.5 version: 7.8.5 @@ -880,10 +880,10 @@ importers: version: 1.65.0 '@secretlint/secretlint-rule-pattern': specifier: 'catalog:' - version: 13.0.7(supports-color@10.2.2) + version: 13.1.0(supports-color@10.2.2) '@secretlint/secretlint-rule-preset-recommend': specifier: 'catalog:' - version: 13.0.7 + version: 13.1.0 dependency-cruiser: specifier: 'catalog:' version: 18.7.0 @@ -925,7 +925,7 @@ importers: version: 13.1.0(bluebird@3.7.2)(supports-color@10.2.2) secretlint: specifier: 'catalog:' - version: 13.0.7(supports-color@10.2.2) + version: 13.1.0(supports-color@10.2.2) shell-quote: specifier: 'catalog:' version: 1.11.0 @@ -8174,54 +8174,54 @@ packages: '@sec-ant/readable-stream@0.4.1': resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} - '@secretlint/config-creator@13.0.7': - resolution: {integrity: sha512-XIUr0UZfHN5Eb5k3w2Q0DXXFJ2brnOqx6YNaX5eoNdR74gI8d/7Uv5SGfnf345drecGu5QPqeta5VX4PpsG4hQ==} + '@secretlint/config-creator@13.1.0': + resolution: {integrity: sha512-Gi5xKBc4F0rLNtcbFs9Uw0B6nrT+eQ1gDi5ctyowH8WdJ3GusRnM7TtbVLLf80Gb9NY8yzyo6z37VGZ3qpPlvA==} engines: {node: '>=22.0.0'} - '@secretlint/config-loader@13.0.7': - resolution: {integrity: sha512-0jjO646AnOwTF/iYTfe1EE/tVW2PH/VWRVlCXypffaVHBnJOP6yprL4WCjrQs9h4XUfbQgGmX+86I0MkQ5pebA==} + '@secretlint/config-loader@13.1.0': + resolution: {integrity: sha512-h8iTXL8683xbrUguj8CvrjVZLqpjVpJf1SNMGABk/fLsLLFo6RJQ40fr4f+/jXnRUgLl5f4ni93jxEErMQ6jMQ==} engines: {node: '>=22.0.0'} - '@secretlint/core@13.0.7': - resolution: {integrity: sha512-IcOR87MpNjp/WTO7bVMsIj3qkhVD+Qr/oNaA0Xl4Ok1LqG4bjXu5RjiY0Kid70BoR9eCJgkoq5gNHDGXPx+o1g==} + '@secretlint/core@13.1.0': + resolution: {integrity: sha512-GL4qNP7G95zSdCpVOMeBVX6mROOko3uMuJNSXD+WmFG9vxChszbmTzpHRzogHHlr+TMqxHw5FE5LHl0OkB0luw==} engines: {node: '>=22.0.0'} - '@secretlint/formatter@13.0.7': - resolution: {integrity: sha512-oBrQzDgAOK5j0/uT0oWS8CaPkhf8E52+rfs0oTeBtcr9eKRjq9pFumnDBGi4Vnzg8OOpyt4vdthQRGD9KAbDSQ==} + '@secretlint/formatter@13.1.0': + resolution: {integrity: sha512-Lrh+XWDJ7U/w9Kvsk8J+EbdVSLeqJcsQxtb95mDfjKrQw9F1+teVR01md86fcOycnSRKc6h3NofxeYMECHLP9w==} engines: {node: '>=22.0.0'} - '@secretlint/node@13.0.7': - resolution: {integrity: sha512-8uMw20Ppf1aawhL5h0zELRb2+fHnrkQqj6VrL9EWQ70s7MAouieJxc4XtCnWjlqjC7d1l8sQnNC+hj0a0744dw==} + '@secretlint/node@13.1.0': + resolution: {integrity: sha512-jkWcPno7wee0Op7fKElThQZUnNYE04q8xUE1sroPP6MoR4DrEWEI8ETCqal7Gq2uKAUX6zzHzs9NhFYWGWpyGQ==} engines: {node: '>=22.0.0'} - '@secretlint/profiler@13.0.7': - resolution: {integrity: sha512-srhOnrrS8u6vkje+YhYZXoXXwgwZlt60x5q9C2vDjPHfkQcEXMXNDdtX7Dx1Bkw7GKuCNIn+3R5AEOphHikQ/Q==} + '@secretlint/profiler@13.1.0': + resolution: {integrity: sha512-Ss/n6FduYkhLLaqDP/CSH5i6Q3YpGd+x2CAnZWxjm9uvJbZpO8eiSnqqORayHC+FcoW3PwS/9wWbHmfEQ7noYw==} - '@secretlint/resolver@13.0.7': - resolution: {integrity: sha512-Ru3qBQqfi9s/uazHiVcyAvlQuq3X8q/8eXNqacZ0r/DvWtjb2JBBhIjzx/RrbfJhlsd5yjsrE6C1/Q710Em1Hw==} + '@secretlint/resolver@13.1.0': + resolution: {integrity: sha512-wzhzZpJsZFOFO2mHMGW38vinI2FgzOKxDXGvz9KCio/YEFckAbLwK5Gda2d37POtWTRMXXVCf0ijHhM9GRdSdQ==} - '@secretlint/secretlint-rule-pattern@13.0.7': - resolution: {integrity: sha512-h05l2ZJalQvD/udVQUPNOsIsBtNHx7gfLCvn9z4/IcGwxLgNoD+iDnYN7uZaerCbGGkgcKNMCXmaH+72rzYBuw==} + '@secretlint/secretlint-rule-pattern@13.1.0': + resolution: {integrity: sha512-ignkZmq1SBHCRj0BOxc7TYkIUtSABrkAxkrPl83Y5xDYZPCtFFiLwP4eGlYpbEr5bPE6rzh2fuZs0L4vXK/W0w==} engines: {node: '>=22.0.0'} - '@secretlint/secretlint-rule-preset-recommend@13.0.7': - resolution: {integrity: sha512-hfdYra+ZB6RmviEApxeL/YCx4ovBtpj0d9c+uhlCZaCikObjb8Sb8yqBN6g8/9tt7qD7LXGE3k9RtVvGK1fNVw==} + '@secretlint/secretlint-rule-preset-recommend@13.1.0': + resolution: {integrity: sha512-dPnplMyjJYpVCJDNTjpUA8c/AfoHbWANJJJWKroK50DGGhAB4Oumzk+XinBMyMMAwgOsjU9CB9lUHXDvObMVCg==} engines: {node: '>=22.0.0'} - '@secretlint/source-creator@13.0.7': - resolution: {integrity: sha512-agf2lHf3f5CRHl7ZSQV2NTx4niPOf9qkLnuowSGoqeWycK5PTuyinlTqp6iq0gQt6TBhvyFu3nKNkXcrB9jWxw==} + '@secretlint/source-creator@13.1.0': + resolution: {integrity: sha512-XTix5etCEZmF88YPQdmGP9n9Z2h/ESvVJ/Ueel7XcCQrjPXtZVXKaiHpcSUClK0Qdth1UQg7Bd2oZfXZJjozgA==} engines: {node: '>=22.0.0'} - '@secretlint/tester@13.0.7': - resolution: {integrity: sha512-Miuye3tZxxVCdbpHYFlYkC+YrpiL2P9IfcWhhSWaTdnB7v992wCc/tk+cQYt80sH0ejbloZYyOBnaDF5rNxUNQ==} + '@secretlint/tester@13.1.0': + resolution: {integrity: sha512-R4FajUOGnc7nYUChqI7TcIr5qdkdMCI2VUHeL7d/DKiqusEBZijZkY5qiKy/8LcMhirR/rAKx6T7lj5edHOa3A==} engines: {node: '>=22.0.0'} - '@secretlint/types@13.0.7': - resolution: {integrity: sha512-5DI1W8vTjBt5ZSrLXNMCX439f+36fzQLrSGi0JPu1vhBKl3QLxPu/ilPJ5x2Ul7pU3aWUrpRva9mvojSAi4h0A==} + '@secretlint/types@13.1.0': + resolution: {integrity: sha512-ZslrDXhpdfqp9Kp+9XZO5M/ehiwuIRCbjGZumfmE8crCvKqszirQKBxM4HPPsoWFUlf3H/eCNxx8vE93KY5I4g==} engines: {node: '>=22.0.0'} - '@secretlint/walker@13.0.7': - resolution: {integrity: sha512-hKCYKPcWO1UF9Q3l3W5NpxOJu3bRk8X+6qOZFe6acChmOpy2L0VMQZsbxaJkmRecZcTNZ2IYMWSAw0e6tn/McQ==} + '@secretlint/walker@13.1.0': + resolution: {integrity: sha512-VRU0UTiNzDBc1qFSO9bVOB8IUWyuvWRSm3xfUJfph04DZDxahV3M+vthMfC2uTahuAeM/vmjpMMDyHYLB/TTKA==} engines: {node: '>=22.0.0'} '@selderee/plugin-htmlparser2@0.12.0': @@ -15592,8 +15592,8 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - secretlint@13.0.7: - resolution: {integrity: sha512-eWqojzOU+9+fgJgBQ/wR5Agkr3uBwKwWZ7ed3Jol6ZxRIPA+z2kl4t4/qSxbhXauSmE0WJ6qLNIZbAVeq0raiA==} + secretlint@13.1.0: + resolution: {integrity: sha512-PIeyk3zy1ww1TTbJJ5OQWdkHV84+hI4cxpaIsb0u8MXl49nCNab2qyGjmRYPRbi2cSDNIdnz0Zm7kGfJO63ShA==} engines: {node: '>=22.0.0'} hasBin: true @@ -20322,91 +20322,90 @@ snapshots: '@sec-ant/readable-stream@0.4.1': {} - '@secretlint/config-creator@13.0.7': + '@secretlint/config-creator@13.1.0': dependencies: - '@secretlint/types': 13.0.7 + '@secretlint/types': 13.1.0 - '@secretlint/config-loader@13.0.7(supports-color@10.2.2)': + '@secretlint/config-loader@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/profiler': 13.0.7 - '@secretlint/resolver': 13.0.7 - '@secretlint/types': 13.0.7 + '@secretlint/profiler': 13.1.0 + '@secretlint/resolver': 13.1.0 + '@secretlint/types': 13.1.0 ajv: 8.20.0 debug: 4.4.3(supports-color@10.2.2) rc-config-loader: 4.1.4(supports-color@10.2.2) transitivePeerDependencies: - supports-color - '@secretlint/core@13.0.7(supports-color@10.2.2)': + '@secretlint/core@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/profiler': 13.0.7 - '@secretlint/types': 13.0.7 + '@secretlint/profiler': 13.1.0 + '@secretlint/types': 13.1.0 debug: 4.4.3(supports-color@10.2.2) structured-source: 4.0.0 transitivePeerDependencies: - supports-color - '@secretlint/formatter@13.0.7(supports-color@10.2.2)': + '@secretlint/formatter@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/resolver': 13.0.7 - '@secretlint/types': 13.0.7 + '@secretlint/resolver': 13.1.0 + '@secretlint/types': 13.1.0 '@textlint/linter-formatter': 15.8.0(supports-color@10.2.2) '@textlint/module-interop': 15.8.0 '@textlint/types': 15.8.0 chalk: 5.6.2 debug: 4.4.3(supports-color@10.2.2) pluralize: 8.0.0 - strip-ansi: 7.2.0 table: 6.9.0 terminal-link: 5.0.0 transitivePeerDependencies: - supports-color - '@secretlint/node@13.0.7(supports-color@10.2.2)': + '@secretlint/node@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/config-loader': 13.0.7(supports-color@10.2.2) - '@secretlint/core': 13.0.7(supports-color@10.2.2) - '@secretlint/formatter': 13.0.7(supports-color@10.2.2) - '@secretlint/profiler': 13.0.7 - '@secretlint/source-creator': 13.0.7 - '@secretlint/types': 13.0.7 + '@secretlint/config-loader': 13.1.0(supports-color@10.2.2) + '@secretlint/core': 13.1.0(supports-color@10.2.2) + '@secretlint/formatter': 13.1.0(supports-color@10.2.2) + '@secretlint/profiler': 13.1.0 + '@secretlint/source-creator': 13.1.0 + '@secretlint/types': 13.1.0 debug: 4.4.3(supports-color@10.2.2) p-map: 7.1.1 transitivePeerDependencies: - supports-color - '@secretlint/profiler@13.0.7': {} + '@secretlint/profiler@13.1.0': {} - '@secretlint/resolver@13.0.7': {} + '@secretlint/resolver@13.1.0': {} - '@secretlint/secretlint-rule-pattern@13.0.7(supports-color@10.2.2)': + '@secretlint/secretlint-rule-pattern@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/tester': 13.0.7(supports-color@10.2.2) - '@secretlint/types': 13.0.7 + '@secretlint/tester': 13.1.0(supports-color@10.2.2) + '@secretlint/types': 13.1.0 '@textlint/regexp-string-matcher': 2.0.2 micromatch: 4.0.8 transitivePeerDependencies: - supports-color - '@secretlint/secretlint-rule-preset-recommend@13.0.7': {} + '@secretlint/secretlint-rule-preset-recommend@13.1.0': {} - '@secretlint/source-creator@13.0.7': + '@secretlint/source-creator@13.1.0': dependencies: - '@secretlint/types': 13.0.7 + '@secretlint/types': 13.1.0 istextorbinary: 9.5.0 - '@secretlint/tester@13.0.7(supports-color@10.2.2)': + '@secretlint/tester@13.1.0(supports-color@10.2.2)': dependencies: - '@secretlint/config-loader': 13.0.7(supports-color@10.2.2) - '@secretlint/core': 13.0.7(supports-color@10.2.2) - '@secretlint/source-creator': 13.0.7 - '@secretlint/types': 13.0.7 + '@secretlint/config-loader': 13.1.0(supports-color@10.2.2) + '@secretlint/core': 13.1.0(supports-color@10.2.2) + '@secretlint/source-creator': 13.1.0 + '@secretlint/types': 13.1.0 transitivePeerDependencies: - supports-color - '@secretlint/types@13.0.7': {} + '@secretlint/types@13.1.0': {} - '@secretlint/walker@13.0.7': + '@secretlint/walker@13.1.0': dependencies: ignore: 7.0.14 picomatch: 4.0.7 @@ -29012,14 +29011,14 @@ snapshots: dependencies: loose-envify: 1.4.0 - secretlint@13.0.7(supports-color@10.2.2): + secretlint@13.1.0(supports-color@10.2.2): dependencies: - '@secretlint/config-creator': 13.0.7 - '@secretlint/formatter': 13.0.7(supports-color@10.2.2) - '@secretlint/node': 13.0.7(supports-color@10.2.2) - '@secretlint/profiler': 13.0.7 - '@secretlint/resolver': 13.0.7 - '@secretlint/walker': 13.0.7 + '@secretlint/config-creator': 13.1.0 + '@secretlint/formatter': 13.1.0(supports-color@10.2.2) + '@secretlint/node': 13.1.0(supports-color@10.2.2) + '@secretlint/profiler': 13.1.0 + '@secretlint/resolver': 13.1.0 + '@secretlint/walker': 13.1.0 debug: 4.4.3(supports-color@10.2.2) read-pkg: 10.1.0 transitivePeerDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4215d851efe3..9b6643e7fa94 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -256,11 +256,11 @@ catalog: '@octokit/core': 7.0.8 '@octokit/plugin-retry': 8.1.1 '@octokit/plugin-throttling': 11.0.5 - '@secretlint/secretlint-rule-pattern': 13.0.7 - '@secretlint/secretlint-rule-preset-recommend': 13.0.7 + '@secretlint/secretlint-rule-pattern': 13.1.0 + '@secretlint/secretlint-rule-preset-recommend': 13.1.0 knip: 6.44.2 lint-staged: 17.6.0 - secretlint: 13.0.7 + secretlint: 13.1.0 '@pnpm/releasing.versioning': 1100.3.8 '@pnpm/workspace.workspace-manifest-reader': 1100.3.2 execa: 10.2.1 From 11e5029033a4ee7b3b8bed5e520b884804e539fb Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:17:33 +0000 Subject: [PATCH 007/174] Update dependency tsc-alias to v1.9.10 --- apps/shade/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/shade/package.json b/apps/shade/package.json index e97e63e80b99..44470d6628bd 100644 --- a/apps/shade/package.json +++ b/apps/shade/package.json @@ -212,7 +212,7 @@ "remark-gfm": "4.0.1", "storybook": "catalog:", "tailwindcss": "catalog:", - "tsc-alias": "1.8.17", + "tsc-alias": "1.9.10", "typescript": "catalog:", "vite": "catalog:", "vite-plugin-svgr": "catalog:", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1bfbf8eebc76..f77107979786 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1898,8 +1898,8 @@ importers: specifier: 'catalog:' version: 4.3.3 tsc-alias: - specifier: 1.8.17 - version: 1.8.17 + specifier: 1.9.10 + version: 1.9.10 typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' @@ -16313,8 +16313,8 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - tsc-alias@1.8.17: - resolution: {integrity: sha512-EIduCZHqbNwPm8BZYfq1aD7BQ697A4h6uSGMOFQfYGoQwfrYFTKwYfy9Bv42YxHkduVBcn9Zx0DkX111DKskyg==} + tsc-alias@1.9.10: + resolution: {integrity: sha512-dsZvDB/wgAtRPFDHPYy7X7uqKFR4jJ7VB/2ndPGZQkIMQREz8q74fFsMZL4UmCbUztXhxoA1brKfqW7XzQeMqA==} engines: {node: '>=16.20.2'} hasBin: true @@ -29915,7 +29915,7 @@ snapshots: ts-interface-checker@0.1.13: {} - tsc-alias@1.8.17: + tsc-alias@1.9.10: dependencies: chokidar: 3.6.0 commander: 9.5.0 From 174bfb1a54113704973aa7de3eb088b6f86492df Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 06:41:07 +0000 Subject: [PATCH 008/174] Update dependency dependency-cruiser to v18.7.2 --- pnpm-lock.yaml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f77107979786..11350eb7144e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -541,7 +541,7 @@ catalogs: version: 3.1.2 dependency-cruiser: specifier: ^18.1.1 - version: 18.7.0 + version: 18.7.2 dequal: specifier: 2.0.3 version: 2.0.3 @@ -886,7 +886,7 @@ importers: version: 13.1.0 dependency-cruiser: specifier: 'catalog:' - version: 18.7.0 + version: 18.7.2 eslint: specifier: 'catalog:' version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) @@ -4557,7 +4557,7 @@ importers: version: 3.12.0 dependency-cruiser: specifier: 'catalog:' - version: 18.7.0 + version: 18.7.2 inquirer: specifier: 'catalog:' version: 8.2.7(@types/node@22.20.5) @@ -4676,7 +4676,7 @@ importers: version: 7.8.0 dependency-cruiser: specifier: 'catalog:' - version: 18.7.0 + version: 18.7.2 eslint: specifier: 'catalog:' version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) @@ -11189,8 +11189,8 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} - dependency-cruiser@18.7.0: - resolution: {integrity: sha512-WexT4OswA6Gy86ms2J7SJ4FJscN43dyS+i5skpbtXlPTFQW4yWbontjFip1TOBAVnc+U+9zdH0a56YTRZX/IGw==} + dependency-cruiser@18.7.2: + resolution: {integrity: sha512-3Pkco0Kx3GI8tG6DTUDfl9RSZVOXMqD+lvili8m0qw2+zhGFcZMyPspUgb7Crqps1UkL23SFXslpj7a9hj11+A==} engines: {node: ^22||^24||>=26} hasBin: true @@ -15622,6 +15622,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + send@0.19.2: resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} engines: {node: '>= 0.8.0'} @@ -23714,7 +23719,7 @@ snapshots: depd@2.0.0: {} - dependency-cruiser@18.7.0: + dependency-cruiser@18.7.2: dependencies: acorn: 8.19.0 acorn-jsx: 5.3.2(acorn@8.19.0) @@ -23723,7 +23728,7 @@ snapshots: acorn-walk: 8.3.5 commander: 15.0.0 enhanced-resolve: 5.26.0 - ignore: 7.0.12 + ignore: 7.0.14 interpret: 3.1.1 is-installed-globally: 1.0.1 json5: 2.2.3 @@ -23731,7 +23736,7 @@ snapshots: prompts: 2.4.2 rechoir: 0.8.0 safe-regex: 2.1.1 - semver: 7.8.5 + semver: 7.8.6 tsconfig-paths-webpack-plugin: 4.2.0 watskeburt: 6.0.0 @@ -29046,6 +29051,8 @@ snapshots: semver@7.8.5: {} + semver@7.8.6: {} + send@0.19.2(supports-color@10.2.2): dependencies: debug: 2.6.9(supports-color@10.2.2) From bcfe5bc0acd9ebc040229c1875ef6451454ff3be Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:17:51 +0000 Subject: [PATCH 009/174] Update dependency typescript-eslint to v8.72.1 --- .changeset/olive-swans-teach.md | 16 +++ pnpm-lock.yaml | 206 ++++++++++++++++---------------- pnpm-workspace.yaml | 2 +- 3 files changed, 120 insertions(+), 104 deletions(-) create mode 100644 .changeset/olive-swans-teach.md diff --git a/.changeset/olive-swans-teach.md b/.changeset/olive-swans-teach.md new file mode 100644 index 000000000000..37386708590c --- /dev/null +++ b/.changeset/olive-swans-teach.md @@ -0,0 +1,16 @@ +--- +"@tryghost/koenig-lexical": patch +"@tryghost/kg-utils": patch +"@tryghost/kg-unsplash-selector": patch +"@tryghost/kg-markdown-html-renderer": patch +"@tryghost/kg-lexical-html-renderer": patch +"@tryghost/kg-html-to-lexical": patch +"@tryghost/kg-default-transforms": patch +"@tryghost/kg-default-nodes": patch +"@tryghost/kg-default-cards": patch +"@tryghost/kg-converters": patch +"@tryghost/kg-clean-basic-html": patch +"@tryghost/kg-card-factory": patch +--- + +Updated dependencies diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11350eb7144e..62f1e8e5f1ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -786,8 +786,8 @@ catalogs: specifier: npm:@typescript/typescript6@6.0.2 version: 6.0.2 typescript-eslint: - specifier: 8.71.1 - version: 8.71.1 + specifier: 8.72.1 + version: 8.72.1 undici: specifier: 8.12.3 version: 8.12.3 @@ -1299,7 +1299,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vite: specifier: 'catalog:' version: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) @@ -2099,7 +2099,7 @@ importers: version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) eslint-plugin-no-relative-import-paths: specifier: 1.7.3 version: 1.7.3 @@ -2123,7 +2123,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) zod: specifier: 'catalog:' version: 4.6.7 @@ -2712,7 +2712,7 @@ importers: version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) globals: specifier: 17.14.0 version: 17.14.0 @@ -2757,7 +2757,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) validator: specifier: 'catalog:' version: 13.15.35 @@ -2785,7 +2785,7 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) simple-dom: specifier: 1.4.0 version: 1.4.0 @@ -2794,7 +2794,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -2818,7 +2818,7 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) jsdom: specifier: 'catalog:' version: 30.0.1(@noble/hashes@1.8.0) @@ -2827,7 +2827,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -2848,13 +2848,13 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -2900,7 +2900,7 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) jsdom: specifier: 'catalog:' version: 30.0.1(@noble/hashes@1.8.0) @@ -2912,7 +2912,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -2985,7 +2985,7 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) html-minifier-next: specifier: 'catalog:' version: 8.10.7 @@ -3000,7 +3000,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3040,13 +3040,13 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3098,13 +3098,13 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3156,7 +3156,7 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) prettier: specifier: 3.9.10 version: 3.9.10 @@ -3165,7 +3165,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3220,13 +3220,13 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3278,7 +3278,7 @@ importers: version: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) eslint-plugin-react: specifier: 'catalog:' version: 7.37.5(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) @@ -3311,7 +3311,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vite: specifier: 'catalog:' version: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) @@ -3348,13 +3348,13 @@ importers: version: 4.1.12(@vitest/browser@4.1.12)(vitest@4.1.12) eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) typescript: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vitest: specifier: 'catalog:' version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.5)(@vitest/browser-playwright@4.1.12)(@vitest/coverage-v8@4.1.12)(@vitest/ui@4.1.12)(jsdom@30.0.1(@noble/hashes@1.8.0))(msw@2.14.6(@types/node@22.20.5)(@typescript/typescript6@6.0.2))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) @@ -3528,7 +3528,7 @@ importers: version: 5.6.0 eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) eslint-plugin-react: specifier: 'catalog:' version: 7.37.5(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) @@ -3618,7 +3618,7 @@ importers: version: '@typescript/typescript6@6.0.2' typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) vite: specifier: 'catalog:' version: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) @@ -4448,13 +4448,13 @@ importers: version: 9.39.5 eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) globals: specifier: 'catalog:' version: 17.14.0 typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) tools/configs/eslint-react: dependencies: @@ -4466,7 +4466,7 @@ importers: version: link:../eslint eslint-plugin-ghost: specifier: 'catalog:' - version: 4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) + version: 4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) eslint-plugin-i18next: specifier: 6.1.5 version: 6.1.5 @@ -4490,7 +4490,7 @@ importers: version: 17.14.0 typescript-eslint: specifier: 'catalog:' - version: 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) tools/configs/oxlint: devDependencies: @@ -9397,63 +9397,63 @@ packages: '@types/yargs@17.0.35': resolution: {integrity: sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==} - '@typescript-eslint/eslint-plugin@8.71.1': - resolution: {integrity: sha512-nNlBf6HuotqMgZvSkWD5hNdemiBIxQ2NmrlgfcUIeZRs+BbakjscCQRq/Hb74EFVnFiSWWdL12JruqwBy3ERDw==} + '@typescript-eslint/eslint-plugin@8.72.1': + resolution: {integrity: sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.71.1 + '@typescript-eslint/parser': ^8.72.1 eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/parser@8.71.1': - resolution: {integrity: sha512-oM/5sAqz/l1v/zYK1qTOPrn2+JIrBGC1V6uNYucRO5gh6eT9vWJ/RhPbGE59byvZEUQ4VP6XkLBaS5Jti5jpvw==} + '@typescript-eslint/parser@8.72.1': + resolution: {integrity: sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/project-service@8.71.1': - resolution: {integrity: sha512-Oijc9RUsohHjncg6iGi7gCtjnEjYt9FWv9u6ygK8uKcHK5eLjLAkqERQ9BaytbpceOFdk6kifPCS/zAZE+A99g==} + '@typescript-eslint/project-service@8.72.1': + resolution: {integrity: sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/scope-manager@8.71.1': - resolution: {integrity: sha512-1YUDZXdTnXLlob03SFHBipdyMBsDVm7zoSz0ytTJ39dk5J1TgsTK03VlR/dLXG/RLLUrPcYbD4rp23BmHxHP0w==} + '@typescript-eslint/scope-manager@8.72.1': + resolution: {integrity: sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.71.1': - resolution: {integrity: sha512-oTvkml5SxXhgg+WWKhod5qWQICDXtOB+/Hi9VdPKFAANJ2b7YOgMffgvzXuqog7R6A/JtrzRf128dsxummyWhg==} + '@typescript-eslint/tsconfig-utils@8.72.1': + resolution: {integrity: sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/type-utils@8.71.1': - resolution: {integrity: sha512-kH3t3jZCYv2PZSBEWPKTariLrCaoF1CLoPitYFBJOhAGEwWnSRAtGEifrfrpBa4K9JlwWNZotgA5w3/wLSk/FQ==} + '@typescript-eslint/type-utils@8.72.1': + resolution: {integrity: sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/types@8.71.1': - resolution: {integrity: sha512-ybYnPTUwg3VQQOFEiBPLs8Jxl1ry2vXdn1kVKguomBbvxpetdu3MKTNDqFNUrlG8ylP9MpZosmXMFYlGQHk1oQ==} + '@typescript-eslint/types@8.72.1': + resolution: {integrity: sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.71.1': - resolution: {integrity: sha512-pSKSEK1JJpHs6KiKVtABCE4iJK5d7FLFzDXQNBQ2oRY7LEd3UwOt3TZemTgu9syTIf56dJWlTn/pdmrO9oKUXQ==} + '@typescript-eslint/typescript-estree@8.72.1': + resolution: {integrity: sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/utils@8.71.1': - resolution: {integrity: sha512-CBjT6gfAz3DW2j9Q4moFnqt208Aq+506sVGXfpRcyAeqn0EpayL0mjdWoCO2t3RC7GewNrFxdeehuEaPg6DMzQ==} + '@typescript-eslint/utils@8.72.1': + resolution: {integrity: sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - '@typescript-eslint/visitor-keys@8.71.1': - resolution: {integrity: sha512-0GxiUGqMU0qXJt58cBsiG3DP8lUmBaFo2vChtUX+CT7PnR3v/VGLLrzVP4K9r1lNiZXjHYefMBbPunplr09v6w==} + '@typescript-eslint/visitor-keys@8.72.1': + resolution: {integrity: sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript/typescript-aix-ppc64@7.0.2': @@ -16414,8 +16414,8 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript-eslint@8.71.1: - resolution: {integrity: sha512-oiNVPC3/NbV1FpaHU07l8O6ynqG9v4PAiW2WvTrAmZdR0f2HI/gE668ElMLCK7Xbsu5k2fK5C4fXNiq05j7/nQ==} + typescript-eslint@8.72.1: + resolution: {integrity: sha512-3Li9FfPmQp45nxEtFD1ZCrYFI3cYK5kpyNtmm1H7lMagm8u9sy6PTjy3ytwQZs7KNukOyKFHAZ6z6GjYFeaeXw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 @@ -21859,14 +21859,14 @@ snapshots: '@types/yargs-parser': 21.0.3 optional: true - '@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': + '@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/scope-manager': 8.71.1 - '@typescript-eslint/type-utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/visitor-keys': 8.71.1 + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.72.1 + '@typescript-eslint/type-utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/visitor-keys': 8.72.1 eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) ignore: 7.0.14 natural-compare: 1.4.0 @@ -21875,41 +21875,41 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': + '@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@typescript-eslint/scope-manager': 8.71.1 - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/typescript-estree': 8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/visitor-keys': 8.71.1 + '@typescript-eslint/scope-manager': 8.72.1 + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/visitor-keys': 8.72.1 debug: 4.4.3(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': + '@typescript-eslint/project-service@8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.71.1(@typescript/typescript6@6.0.2) - '@typescript-eslint/types': 8.71.1 + '@typescript-eslint/tsconfig-utils': 8.72.1(@typescript/typescript6@6.0.2) + '@typescript-eslint/types': 8.72.1 debug: 4.4.3(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.71.1': + '@typescript-eslint/scope-manager@8.72.1': dependencies: - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/visitor-keys': 8.71.1 + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/visitor-keys': 8.72.1 - '@typescript-eslint/tsconfig-utils@8.71.1(@typescript/typescript6@6.0.2)': + '@typescript-eslint/tsconfig-utils@8.72.1(@typescript/typescript6@6.0.2)': dependencies: typescript: '@typescript/typescript6@6.0.2' - '@typescript-eslint/type-utils@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': + '@typescript-eslint/type-utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/typescript-estree': 8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) debug: 4.4.3(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) ts-api-utils: 2.5.0(@typescript/typescript6@6.0.2) @@ -21917,14 +21917,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.71.1': {} + '@typescript-eslint/types@8.72.1': {} - '@typescript-eslint/typescript-estree@8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': + '@typescript-eslint/typescript-estree@8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/project-service': 8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/tsconfig-utils': 8.71.1(@typescript/typescript6@6.0.2) - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/visitor-keys': 8.71.1 + '@typescript-eslint/project-service': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/tsconfig-utils': 8.72.1(@typescript/typescript6@6.0.2) + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/visitor-keys': 8.72.1 debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.6 semver: 7.8.5 @@ -21934,20 +21934,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': + '@typescript-eslint/utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) - '@typescript-eslint/scope-manager': 8.71.1 - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/typescript-estree': 8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/scope-manager': 8.72.1 + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.71.1': + '@typescript-eslint/visitor-keys@8.72.1': dependencies: - '@typescript-eslint/types': 8.71.1 + '@typescript-eslint/types': 8.72.1 eslint-visitor-keys: 5.0.1 '@typescript/typescript-aix-ppc64@7.0.2': @@ -24194,7 +24194,7 @@ snapshots: lodash.snakecase: 4.1.1 lodash.upperfirst: 4.3.1 - eslint-plugin-ghost@4.0.1(@typescript-eslint/eslint-plugin@8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)): + eslint-plugin-ghost@4.0.1(@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)): dependencies: '@kapouer/eslint-plugin-no-return-in-loop': 1.0.0 eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) @@ -24203,8 +24203,8 @@ snapshots: eslint-plugin-n: 18.4.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(ts-declaration-location@1.0.7(@typescript/typescript6@6.0.2)) eslint-plugin-sort-imports-es6-autofix: 0.6.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/parser': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/eslint-plugin': 8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - ts-declaration-location @@ -24278,8 +24278,8 @@ snapshots: eslint-plugin-storybook@10.6.5(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/types': 8.71.1 - '@typescript-eslint/utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/types': 8.72.1 + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -24295,7 +24295,7 @@ snapshots: eslint-plugin-tailwindcss@4.4.0(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(tailwindcss@4.3.3): dependencies: - '@typescript-eslint/utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) postcss: 8.5.32 postcss-nested: 7.0.2(postcss@8.5.32) @@ -30030,12 +30030,12 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): + typescript-eslint@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.71.1(@typescript-eslint/parser@8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/parser': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - '@typescript-eslint/typescript-estree': 8.71.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/utils': 8.71.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/eslint-plugin': 8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9b6643e7fa94..e6748f398179 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -232,7 +232,7 @@ catalog: # `typescript: <7.x>` entry once typescript-eslint supports the TS7.1 API. typescript: 'npm:@typescript/typescript6@6.0.2' '@typescript/native': 'npm:typescript@7.0.2' - typescript-eslint: 8.71.1 + typescript-eslint: 8.72.1 undici: 8.12.3 validator: 13.15.35 vite: 8.1.6 From a58caf68c2118f93a1e20f71a5698cfa18f5cad3 Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:18:26 +0000 Subject: [PATCH 010/174] Update dependency stylelint to v18 --- .changeset/wicked-grapes-stand.md | 5 + pnpm-lock.yaml | 335 ++++++++---------------------- pnpm-workspace.yaml | 2 +- 3 files changed, 87 insertions(+), 255 deletions(-) create mode 100644 .changeset/wicked-grapes-stand.md diff --git a/.changeset/wicked-grapes-stand.md b/.changeset/wicked-grapes-stand.md new file mode 100644 index 000000000000..2f762631c3a6 --- /dev/null +++ b/.changeset/wicked-grapes-stand.md @@ -0,0 +1,5 @@ +--- +"@tryghost/koenig-lexical": patch +--- + +Updated dependencies diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62f1e8e5f1ec..120027f93847 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -759,8 +759,8 @@ catalogs: specifier: 10.6.5 version: 10.6.5 stylelint: - specifier: 17.14.1 - version: 17.14.1 + specifier: 18.0.0 + version: 18.0.0 supertest: specifier: 7.3.1 version: 7.3.1 @@ -3609,7 +3609,7 @@ importers: version: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) stylelint: specifier: 'catalog:' - version: 17.14.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + version: 18.0.0 tailwindcss: specifier: catalog:tailwind3 version: 3.4.19(tsx@4.23.15)(yaml@2.9.0) @@ -5067,12 +5067,6 @@ packages: resolution: {integrity: sha512-EVMD0SgJtOuFeg0lAVbCwa+qeTKILb87jqvLyUtQswGD9+ce2nB52Y5zbTF1Hc0MDFfbydcMcxb47jSdhikVHA==} engines: {node: '>= 10'} - '@cacheable/memory@2.2.0': - resolution: {integrity: sha512-CTLKqLItRCEixEAewD3/j9DB3/o96gpTPD4eJ1v+DGOlxZRZncRQkGYqqnAGCscYd6RNeXfGeiuCphsPtqyIfQ==} - - '@cacheable/utils@2.5.0': - resolution: {integrity: sha512-buipgOVDkkPXNR5+xBpDw7Zk2n1EvU7qBJCNUcL7rhQ//kfpOXPAvQ511Os0vpLYJ1pZnvudNytkQt2hst3wqA==} - '@clack/core@1.4.3': resolution: {integrity: sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==} engines: {node: '>= 20.12.0'} @@ -5133,12 +5127,12 @@ packages: resolution: {integrity: sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==} engines: {node: '>=20.19.0'} - '@csstools/css-calc@3.3.0': - resolution: {integrity: sha512-c5ihYsPkdG6JCkU2zTMm4+k6r7RXuGxtWYhu5DHMIiF1FHzrfmHL5so11AoFpUv/tu61xfcmT4AmKoFfMPoqdQ==} + '@csstools/css-calc@3.4.3': + resolution: {integrity: sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==} engines: {node: '>=20.19.0'} peerDependencies: - '@csstools/css-parser-algorithms': ^4.0.0 - '@csstools/css-tokenizer': ^4.0.0 + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 '@csstools/css-color-parser@4.1.10': resolution: {integrity: sha512-UZhQLIUyJaaMepqehrCODwCg2KW25vFvLWBmqYFaPclYvvxzj/sG8LBOhBFCp11i9uE7t1EyS+RAoV9tztPFyw==} @@ -5147,39 +5141,39 @@ packages: '@csstools/css-parser-algorithms': ^4.0.0 '@csstools/css-tokenizer': ^4.0.0 - '@csstools/css-parser-algorithms@4.0.0': - resolution: {integrity: sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==} + '@csstools/css-parser-algorithms@4.0.2': + resolution: {integrity: sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==} engines: {node: '>=20.19.0'} peerDependencies: - '@csstools/css-tokenizer': ^4.0.0 + '@csstools/css-tokenizer': ^4.0.2 - '@csstools/css-syntax-patches-for-csstree@1.1.7': - resolution: {integrity: sha512-fQ+05118eQS1cofO3aJpB5efgpBZMvIzwr/sbC8kDLVA5XLG8q1kJV5yzrUAI1f7lvhPnm8fgIjzFB8/O/5Dig==} + '@csstools/css-syntax-patches-for-csstree@1.1.16': + resolution: {integrity: sha512-LsDbJPP/B8cPasUJyTA5S99F7C4G93ngW8hUluXz8CFeOaaRnBPtBiIlvgcPYU0HmHNz8CXg+1vwFrIB4F6Dgw==} peerDependencies: css-tree: ^3.2.1 peerDependenciesMeta: css-tree: optional: true - '@csstools/css-tokenizer@4.0.0': - resolution: {integrity: sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==} + '@csstools/css-tokenizer@4.0.2': + resolution: {integrity: sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==} engines: {node: '>=20.19.0'} - '@csstools/media-query-list-parser@5.0.0': - resolution: {integrity: sha512-T9lXmZOfnam3eMERPsszjY5NK0jX8RmThmmm99FZ8b7z8yMaFZWKwLWGZuTwdO3ddRY5fy13GmmEYZXB4I98Eg==} + '@csstools/media-query-list-parser@5.0.2': + resolution: {integrity: sha512-qx19O8AbbLLbDSAcI6YOby/Vq8rV51psgIvlF5OZT/L8fQJDCyQifL6k+kYU4a8ySpzJ4RBzZkIs530bAn8y4Q==} engines: {node: '>=20.19.0'} peerDependencies: - '@csstools/css-parser-algorithms': ^4.0.0 - '@csstools/css-tokenizer': ^4.0.0 + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 - '@csstools/selector-resolve-nested@4.0.0': - resolution: {integrity: sha512-9vAPxmp+Dx3wQBIUwc1v7Mdisw1kbbaGqXUM8QLTgWg7SoPGYtXBsMXvsFs/0Bn5yoFhcktzxNZGNaUt0VjgjA==} + '@csstools/selector-resolve-nested@4.0.2': + resolution: {integrity: sha512-JpjNBJFA+4OnAHKRK4AMp8xrYyLhI9XapOeBlP2PhRU/IylSw+1ep3BFNTksBJnrTS3KT6kqKNVfpzLLwZUW5Q==} engines: {node: '>=20.19.0'} peerDependencies: postcss-selector-parser: ^7.1.1 - '@csstools/selector-specificity@6.0.0': - resolution: {integrity: sha512-4sSgl78OtOXEX/2d++8A83zHNTgwCJMaR24FvsYL7Uf/VS8HZk9PTwR51elTbGqMuwH3szLvvOXEaVnqn0Z3zA==} + '@csstools/selector-specificity@6.0.1': + resolution: {integrity: sha512-MBuqFIIvqk4S593MGAskTkPpEUUzZNvGzh8mMxEwl3oHwjQlXmqHEDxNbN3Y0Tsh+xjmem4GZjeg7I0qkwBivg==} engines: {node: '>=20.19.0'} peerDependencies: postcss-selector-parser: ^7.1.1 @@ -6109,12 +6103,6 @@ packages: '@kapouer/eslint-plugin-no-return-in-loop@1.0.0': resolution: {integrity: sha512-IXQp8N68L2fkk7p7RckBBhT/KwAX04GooIGjwzmY5THQanQvsmJpYgwC7A1Io2XDXBJzlGelQkP/C1SRM/aq8w==} - '@keyv/bigmap@1.3.1': - resolution: {integrity: sha512-WbzE9sdmQtKy8vrNPa9BRnwZh5UF4s1KTmSK0KUVLo3eff5BlQNNWDnFOouNpKfPKDnms9xynJjsMYjMaT/aFQ==} - engines: {node: '>= 18'} - peerDependencies: - keyv: ^5.6.0 - '@keyv/serialize@1.1.1': resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==} @@ -10422,9 +10410,6 @@ packages: resolution: {integrity: sha512-SVXGH037+Mo1aIMO5B2UcleR43FGjFdN+M8JObSyEoQ2Mn4CODRWx28gN5jiTF0n5ItsgtIZfyargMNs8GX4kg==} engines: {node: '>=18'} - cacheable@2.5.0: - resolution: {integrity: sha512-60cyAOytib/OzBw1JNSoSV/boK1AtHryDIjvVBk7XbN4ugfkM3+Sry7fEjNgPMGgOjuaZPAp8ruZ0Cxafwyq9g==} - call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -10836,6 +10821,10 @@ packages: resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} engines: {node: '>= 0.10'} + cosmiconfig@10.0.1: + resolution: {integrity: sha512-/zvGoYn0y27QTBmK+0B+oPdEPC4fKGUmJsMTQbDjqph00TrkqfVFW/M+C6ya54sYCgHC6QCwK/mI6djt8cEGHQ==} + engines: {node: ^22.18 || >= 24} + cosmiconfig@8.3.6: resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} @@ -10845,15 +10834,6 @@ packages: typescript: optional: true - cosmiconfig@9.0.2: - resolution: {integrity: sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==} - engines: {node: '>=14'} - peerDependencies: - typescript: '>=4.9.5' - peerDependenciesMeta: - typescript: - optional: true - countries-and-timezones@3.11.0: resolution: {integrity: sha512-amqnHZJyuaFol6Z9gmyDb/D5cS6OSZUMfT6Ovj2HMmEBykHfwfA6dih59rulQ2kWynW7XeCAOzJr60hWL64Anw==} engines: {node: '>=8.x', npm: '>=5.x'} @@ -10905,10 +10885,6 @@ packages: peerDependencies: postcss: ^8.0.9 - css-functions-list@3.3.3: - resolution: {integrity: sha512-8HFEBPKhOpJPEPu70wJJetjKta86Gw9+CCyCnB3sui2qQfOvRyqBy4IKLKKAwdMpWb2lHXWk9Wb4Z6AmaUT1Pg==} - engines: {node: '>=12'} - css-line-break@2.1.0: resolution: {integrity: sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==} @@ -11841,10 +11817,6 @@ packages: resolution: {integrity: sha512-/pXxRBtwxY9w8z7YbgsvIPPcPvFDsTbIkWwTQJhzNJPokj+TbN6ftmcv4j/pEQDvOCNnKGDzuk5Bo2oogIOiFg==} hasBin: true - fastest-levenshtein@1.0.16: - resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} - engines: {node: '>= 4.9.1'} - fastq@1.20.3: resolution: {integrity: sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==} @@ -11878,9 +11850,6 @@ packages: resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} engines: {node: '>=18'} - file-entry-cache@11.1.5: - resolution: {integrity: sha512-+PFTHITI08JIGhnNpGNI8T8inUpgZfk3GNEqfT9R2zZV2iFXg3CvqzSl/uEhs7TSGujYRELEANyDvS8Fj7+S7Q==} - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -11919,9 +11888,6 @@ packages: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} - flat-cache@6.1.23: - resolution: {integrity: sha512-f++BY9pTk+983xK1FLzlLpmM0i0z+jHmx3QESGkURMXujQZz1k5wzwX6hjnQ8goaD0B+sYnDK1yZ6MTyZfUaqA==} - flatted@3.4.2: resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} @@ -12098,14 +12064,6 @@ packages: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} engines: {node: '>=18'} - global-modules@2.0.0: - resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==} - engines: {node: '>=6'} - - global-prefix@3.0.0: - resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} - engines: {node: '>=6'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -12130,9 +12088,6 @@ packages: resolution: {integrity: sha512-c8B/VNLmxRcmqqenRA9t+9IyOjf9+V6lTxPaUJLqOCONdQkWZ0ETYgX0qbtJqPsgCNusT9MZ5Jeidw8Eb9tn2g==} engines: {node: '>=20'} - globjoin@0.1.4: - resolution: {integrity: sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==} - globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} @@ -12195,10 +12150,6 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hashery@1.5.1: - resolution: {integrity: sha512-iZyKG96/JwPz1N55vj2Ie2vXbhu440zfUfJvSwEqEbeLluk7NnapfGqa7LH0mOsnDxTF85Mx8/dyR6HfqcbmbQ==} - engines: {node: '>=20'} - hasown@2.0.4: resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} engines: {node: '>= 0.4'} @@ -12243,12 +12194,6 @@ packages: resolution: {integrity: sha512-AOLOEhvrV+iH92xXCnFr/5+3KjPKcI3xP63XJtX5spAnkznPdHijlIsUTpi7/9EhWqrTCekw5c5zh1K+YsVw7A==} engines: {node: '>=16.9.0'} - hookified@1.15.1: - resolution: {integrity: sha512-MvG/clsADq1GPM2KGo2nyfaWVyn9naPiXrqIe4jYjXNZQt238kWyOGrsyc/DmRAQ+Re6yeo6yX/yoNCG5KAEVg==} - - hookified@2.2.0: - resolution: {integrity: sha512-p/LgFzRN5FeoD3DLS6bkUapeye6E4SI6yJs6KetENd18S+FBthqYq2amJUWpt5z0EQwwHemidjY5OqJGEKm5uA==} - hosted-git-info@7.0.2: resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} engines: {node: ^16.14.0 || >=18.0.0} @@ -12281,10 +12226,6 @@ packages: '@swc/core': optional: true - html-tags@5.1.0: - resolution: {integrity: sha512-n6l5uca7/y5joxZ3LUePhzmBFUJ+U2YWzhMa8XUTecSeSlQiZdF5XAd/Q3/WUl0VsXgUwWi8I7CNIwdI5WN1SQ==} - engines: {node: '>=20.10'} - html-to-text@10.0.1: resolution: {integrity: sha512-GiVhRI1BatGARSCmlXWNCjDT0cWrwBWoeduLoV0WSKAgaV/wa+hUWy5LiQLUs4UwiUrE52ZCMfBGiKD87TDPrg==} engines: {node: '>=20.19.0'} @@ -12970,10 +12911,6 @@ packages: keyv@5.6.0: resolution: {integrity: sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==} - kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} @@ -13526,9 +13463,6 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - mathml-tag-names@4.0.0: - resolution: {integrity: sha512-aa6AU2Pcx0VP/XWnh8IGL0SYSgQHDT6Ucror2j2mXeFAlN3ahaNs8EZtG1YiticMkSLj3Gt6VPFfZogt7G5iFQ==} - mdast-util-compact@1.0.4: resolution: {integrity: sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg==} @@ -13596,10 +13530,6 @@ packages: mensch@0.3.4: resolution: {integrity: sha512-IAeFvcOnV9V0Yk+bFhYR07O3yNina9ANIN5MoXBKYJ/RLYPurd2d0yw14MDhpr9/momp0WofT1bPUh3hkzdi/g==} - meow@14.1.0: - resolution: {integrity: sha512-EDYo6VlmtnumlcBCbh1gLJ//9jvM/ndXHfVXIFrZVr6fGcwTUyCTFNTLCKuY3ffbK8L/+3Mzqnd58RojiZqHVw==} - engines: {node: '>=20'} - merge-descriptors@1.0.3: resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} @@ -14805,8 +14735,8 @@ packages: peerDependencies: postcss: ^8.1.0 - postcss-safe-parser@7.0.1: - resolution: {integrity: sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A==} + postcss-safe-parser@7.1.0: + resolution: {integrity: sha512-1WzZxRLaAFwEh6Do+zyGpjWV3nGJNxxhuh7Ubu/q1ICImMgZJnLwhoaEpRbG4pJppp2Y1ncL9ffA2f+LhrefQg==} engines: {node: '>=18.0'} peerDependencies: postcss: ^8.4.31 @@ -15043,10 +14973,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - qified@0.10.1: - resolution: {integrity: sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==} - engines: {node: '>=20'} - qs@6.16.1: resolution: {integrity: sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==} engines: {node: '>=0.6'} @@ -16028,9 +15954,9 @@ packages: peerDependencies: postcss: ^8.5.13 - stylelint@17.14.1: - resolution: {integrity: sha512-xVQwyiuxALUBNB2fBe0tmNemg9KqLtdj3T64mioFDar79B2cU8LIyz+3KL6LdiHs9NkeNfwxpKSaIVOY8f112g==} - engines: {node: '>=20.19.0'} + stylelint@18.0.0: + resolution: {integrity: sha512-kI10GsHXQvsH/AcklVZdQgwDuxtHi+A+h1Ujzd7h9LDf3e5jQiLQkWFlPtpynX3E6oVWHG1wo9v6dL0Mr+nnSA==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} hasBin: true sucrase@3.35.1: @@ -16061,9 +15987,6 @@ packages: svg-parser@2.0.4: resolution: {integrity: sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==} - svg-tags@1.0.0: - resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} - svgo@4.1.0: resolution: {integrity: sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==} engines: {node: '>=16'} @@ -16969,10 +16892,6 @@ packages: resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==} engines: {node: '>= 0.4'} - which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -17023,6 +16942,10 @@ packages: resolution: {integrity: sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==} engines: {node: ^20.17.0 || >=22.9.0} + write-file-atomic@8.0.0: + resolution: {integrity: sha512-dYwyZredl67GyLLIHJnRM3h2PcOmN5SkcgC7eM5DPDEOEl6dLFqVrMg3F1Ea32usj4VSVZtd2H4MtKTNOf6nPg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + ws@8.21.0: resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} @@ -17199,10 +17122,10 @@ snapshots: '@asamuzakjp/css-color@6.0.7': dependencies: - '@csstools/css-calc': 3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) - '@csstools/css-color-parser': 4.1.10(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) - '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) - '@csstools/css-tokenizer': 4.0.0 + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-color-parser': 4.1.10(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 lru-cache: 11.5.3 '@asamuzakjp/dom-selector@8.3.2': @@ -17688,18 +17611,6 @@ snapshots: '@breejs/later@4.2.0': {} - '@cacheable/memory@2.2.0': - dependencies: - '@cacheable/utils': 2.5.0 - '@keyv/bigmap': 1.3.1(keyv@5.6.0) - hookified: 1.15.1 - keyv: 5.6.0 - - '@cacheable/utils@2.5.0': - dependencies: - hashery: 1.5.1 - keyv: 5.6.0 - '@clack/core@1.4.3': dependencies: fast-wrap-ansi: 0.2.0 @@ -17827,38 +17738,38 @@ snapshots: '@csstools/color-helpers@6.1.0': {} - '@csstools/css-calc@3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + '@csstools/css-calc@3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': dependencies: - '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) - '@csstools/css-tokenizer': 4.0.0 + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 - '@csstools/css-color-parser@4.1.10(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + '@csstools/css-color-parser@4.1.10(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': dependencies: '@csstools/color-helpers': 6.1.0 - '@csstools/css-calc': 3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) - '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) - '@csstools/css-tokenizer': 4.0.0 + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 - '@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0)': + '@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2)': dependencies: - '@csstools/css-tokenizer': 4.0.0 + '@csstools/css-tokenizer': 4.0.2 - '@csstools/css-syntax-patches-for-csstree@1.1.7(css-tree@3.2.1)': + '@csstools/css-syntax-patches-for-csstree@1.1.16(css-tree@3.2.1)': optionalDependencies: css-tree: 3.2.1 - '@csstools/css-tokenizer@4.0.0': {} + '@csstools/css-tokenizer@4.0.2': {} - '@csstools/media-query-list-parser@5.0.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0)': + '@csstools/media-query-list-parser@5.0.2(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': dependencies: - '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) - '@csstools/css-tokenizer': 4.0.0 + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 - '@csstools/selector-resolve-nested@4.0.0(postcss-selector-parser@7.1.7)': + '@csstools/selector-resolve-nested@4.0.2(postcss-selector-parser@7.1.7)': dependencies: postcss-selector-parser: 7.1.7 - '@csstools/selector-specificity@6.0.0(postcss-selector-parser@7.1.7)': + '@csstools/selector-specificity@6.0.1(postcss-selector-parser@7.1.7)': dependencies: postcss-selector-parser: 7.1.7 @@ -18570,12 +18481,6 @@ snapshots: '@kapouer/eslint-plugin-no-return-in-loop@1.0.0': {} - '@keyv/bigmap@1.3.1(keyv@5.6.0)': - dependencies: - hashery: 1.5.1 - hookified: 1.15.1 - keyv: 5.6.0 - '@keyv/serialize@1.1.1': {} '@lexical/clipboard@0.13.1(lexical@0.13.1)': @@ -22924,14 +22829,6 @@ snapshots: normalize-url: 8.1.1 responselike: 4.0.2 - cacheable@2.5.0: - dependencies: - '@cacheable/memory': 2.2.0 - '@cacheable/utils': 2.5.0 - hookified: 1.15.1 - keyv: 5.6.0 - qified: 0.10.1 - call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -23350,21 +23247,17 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig@8.3.6(@typescript/typescript6@6.0.2): + cosmiconfig@10.0.1: dependencies: - import-fresh: 3.3.1 - js-yaml: 4.3.2 - parse-json: 5.2.0 - path-type: 4.0.0 - optionalDependencies: - typescript: '@typescript/typescript6@6.0.2' + env-paths: 2.2.1 + js-yaml: 5.4.3 - cosmiconfig@9.0.2(@typescript/typescript6@6.0.2): + cosmiconfig@8.3.6(@typescript/typescript6@6.0.2): dependencies: - env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.3.2 parse-json: 5.2.0 + path-type: 4.0.0 optionalDependencies: typescript: '@typescript/typescript6@6.0.2' @@ -23408,8 +23301,6 @@ snapshots: dependencies: postcss: 8.5.32 - css-functions-list@3.3.3: {} - css-line-break@2.1.0: dependencies: utrie: 1.0.2 @@ -24597,8 +24488,6 @@ snapshots: strnum: 2.5.1 xml-naming: 0.3.0 - fastest-levenshtein@1.0.16: {} - fastq@1.20.3: dependencies: reusify: 1.1.0 @@ -24628,10 +24517,6 @@ snapshots: dependencies: is-unicode-supported: 2.1.0 - file-entry-cache@11.1.5: - dependencies: - flat-cache: 6.1.23 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -24686,12 +24571,6 @@ snapshots: flatted: 3.4.2 keyv: 4.5.4 - flat-cache@6.1.23: - dependencies: - cacheable: 2.5.0 - flatted: 3.4.2 - hookified: 1.15.1 - flatted@3.4.2: {} flexsearch@0.7.43: {} @@ -24906,16 +24785,6 @@ snapshots: dependencies: ini: 4.1.1 - global-modules@2.0.0: - dependencies: - global-prefix: 3.0.0 - - global-prefix@3.0.0: - dependencies: - ini: 1.3.8 - kind-of: 6.0.3 - which: 1.3.1 - globals@14.0.0: {} globals@15.15.0: {} @@ -24946,8 +24815,6 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.4.0 - globjoin@0.1.4: {} - globrex@0.1.2: {} gopd@1.2.0: {} @@ -25024,10 +24891,6 @@ snapshots: dependencies: has-symbols: 1.1.0 - hashery@1.5.1: - dependencies: - hookified: 1.15.1 - hasown@2.0.4: dependencies: function-bind: 1.1.2 @@ -25113,10 +24976,6 @@ snapshots: hono@4.13.16: {} - hookified@1.15.1: {} - - hookified@2.2.0: {} - hosted-git-info@7.0.2: dependencies: lru-cache: 10.4.3 @@ -25145,8 +25004,6 @@ snapshots: svgo: 4.1.0 terser: 5.51.2 - html-tags@5.1.0: {} - html-to-text@10.0.1: dependencies: '@selderee/plugin-htmlparser2': 0.12.0(selderee@0.12.0) @@ -25312,7 +25169,8 @@ snapshots: inherits@2.0.4: {} - ini@1.3.8: {} + ini@1.3.8: + optional: true ini@2.0.0: {} @@ -25791,7 +25649,7 @@ snapshots: '@asamuzakjp/css-color': 6.0.7 '@asamuzakjp/dom-selector': 8.3.2 '@bramus/specificity': 2.4.2 - '@csstools/css-syntax-patches-for-csstree': 1.1.7(css-tree@3.2.1) + '@csstools/css-syntax-patches-for-csstree': 1.1.16(css-tree@3.2.1) '@exodus/bytes': 1.15.1(@noble/hashes@1.8.0) css-tree: 3.2.1 data-urls: 7.0.0(@noble/hashes@1.8.0) @@ -25911,8 +25769,6 @@ snapshots: dependencies: '@keyv/serialize': 1.1.1 - kind-of@6.0.3: {} - kleur@3.0.3: {} kleur@4.1.5: {} @@ -26409,8 +26265,6 @@ snapshots: math-intrinsics@1.1.0: {} - mathml-tag-names@4.0.0: {} - mdast-util-compact@1.0.4: dependencies: unist-util-visit: 1.4.1 @@ -26588,8 +26442,6 @@ snapshots: mensch@0.3.4: {} - meow@14.1.0: {} - merge-descriptors@1.0.3: {} merge-stream@2.0.0: @@ -28005,7 +27857,7 @@ snapshots: postcss: 8.5.32 thenby: 1.4.1 - postcss-safe-parser@7.0.1(postcss@8.5.32): + postcss-safe-parser@7.1.0(postcss@8.5.32): dependencies: postcss: 8.5.32 @@ -28288,10 +28140,6 @@ snapshots: punycode@2.3.1: {} - qified@0.10.1: - dependencies: - hookified: 2.2.0 - qs@6.16.1: dependencies: es-define-property: 1.0.1 @@ -29553,46 +29401,27 @@ snapshots: postcss: 8.5.32 postcss-selector-parser: 7.1.7 - stylelint@17.14.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2): + stylelint@18.0.0: dependencies: - '@csstools/css-calc': 3.3.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) - '@csstools/css-parser-algorithms': 4.0.0(@csstools/css-tokenizer@4.0.0) - '@csstools/css-syntax-patches-for-csstree': 1.1.7(css-tree@3.2.1) - '@csstools/css-tokenizer': 4.0.0 - '@csstools/media-query-list-parser': 5.0.0(@csstools/css-parser-algorithms@4.0.0(@csstools/css-tokenizer@4.0.0))(@csstools/css-tokenizer@4.0.0) - '@csstools/selector-resolve-nested': 4.0.0(postcss-selector-parser@7.1.7) - '@csstools/selector-specificity': 6.0.0(postcss-selector-parser@7.1.7) + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-syntax-patches-for-csstree': 1.1.16(css-tree@3.2.1) + '@csstools/css-tokenizer': 4.0.2 + '@csstools/media-query-list-parser': 5.0.2(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/selector-resolve-nested': 4.0.2(postcss-selector-parser@7.1.7) + '@csstools/selector-specificity': 6.0.1(postcss-selector-parser@7.1.7) colord: 2.10.0 - cosmiconfig: 9.0.2(@typescript/typescript6@6.0.2) - css-functions-list: 3.3.3 + cosmiconfig: 10.0.1 css-tree: 3.2.1 - debug: 4.4.3(supports-color@10.2.2) - fast-glob: 3.3.3 - fastest-levenshtein: 1.0.16 - file-entry-cache: 11.1.5 - global-modules: 2.0.0 - globby: 16.2.4 - globjoin: 0.1.4 - html-tags: 5.1.0 ignore: 7.0.14 import-meta-resolve: 4.2.0 - mathml-tag-names: 4.0.0 - meow: 14.1.0 - micromatch: 4.0.8 - normalize-path: 3.0.0 - picocolors: 1.1.1 + picomatch: 4.0.7 postcss: 8.5.32 - postcss-safe-parser: 7.0.1(postcss@8.5.32) + postcss-safe-parser: 7.1.0(postcss@8.5.32) postcss-selector-parser: 7.1.7 postcss-value-parser: 4.2.0 - string-width: 8.3.0 - supports-hyperlinks: 4.5.0 - svg-tags: 1.0.0 - table: 6.9.0 - write-file-atomic: 7.0.1 - transitivePeerDependencies: - - supports-color - - typescript + tinyglobby: 0.2.17 + write-file-atomic: 8.0.0 sucrase@3.35.1: dependencies: @@ -29637,8 +29466,6 @@ snapshots: svg-parser@2.0.4: {} - svg-tags@1.0.0: {} - svgo@4.1.0: dependencies: commander: 11.1.0 @@ -30680,10 +30507,6 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 - which@1.3.1: - dependencies: - isexe: 2.0.0 - which@2.0.2: dependencies: isexe: 2.0.0 @@ -30735,6 +30558,10 @@ snapshots: dependencies: signal-exit: 4.1.0 + write-file-atomic@8.0.0: + dependencies: + signal-exit: 4.1.0 + ws@8.21.0: {} ws@8.22.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e6748f398179..47f731b98ae9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -215,7 +215,7 @@ catalog: snakecase-keys: 9.0.2 sonner: 2.0.8 storybook: 10.6.5 - stylelint: 17.14.1 + stylelint: 18.0.0 supertest: 7.3.1 tailwindcss: 4.3.3 temporal-polyfill: 0.3.2 From 597644d862ef5e95120e2f4f6c5f2222bfac06cc Mon Sep 17 00:00:00 2001 From: Jonatan Svennberg Date: Wed, 11 Nov 2026 17:31:48 +0100 Subject: [PATCH 011/174] Removed the alpha tag from Shade's install advice ref https://linear.app/ghost/issue/BER-4121 Shade's skill, docs and README told people to install from npm's `alpha` tag because `latest` was older. Since publishing moved to `latest`, it's the other way round: `alpha` is frozen at 0.1.0-alpha.14, so anyone following the advice, the `build-ghost-app-ui` skill included, installed a release that's months old. A plain install now gets the newest one, so the advice names no tag, and the contributor docs say which tag each package publishes under. --- apps/shade/CONTRIBUTING.md | 5 +++-- apps/shade/README.md | 2 +- apps/shade/scripts/pack-local.ts | 2 +- apps/shade/skills/build-ghost-app-ui/SKILL.md | 2 +- apps/shade/src/docs/ghost-apps.mdx | 4 +--- apps/shade/test/unit/scripts/pack-local.test.ts | 2 +- docs/contributing/shipping.md | 7 ++++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/shade/CONTRIBUTING.md b/apps/shade/CONTRIBUTING.md index e195637e88ef..28df209374de 100644 --- a/apps/shade/CONTRIBUTING.md +++ b/apps/shade/CONTRIBUTING.md @@ -319,7 +319,8 @@ or a GIF and update or add the relevant stories. Shade is on the continuous publish lane as a `prerelease` entry in [`tools/scripts/release/publish-manifest.json`](../../tools/scripts/release/publish-manifest.json). When a merge to `main` changes what Shade ships, CI publishes the next -`0.1.0-alpha.N` under npm's `alpha` tag. The committed version selects the alpha -series and npm holds the counter, so no release commits or Git tags are created. +`0.1.0-alpha.N` under npm's `latest` tag, so a plain install gets the newest +release. The committed version selects the alpha series and npm holds the +counter, so no release commits or Git tags are created. See [Shipping](../../docs/contributing/shipping.md#continuous-lane) for the release gates and the unchanged-package check. diff --git a/apps/shade/README.md b/apps/shade/README.md index 25c1cc2e0092..9d2559b49ac1 100644 --- a/apps/shade/README.md +++ b/apps/shade/README.md @@ -19,7 +19,7 @@ integration. Shade does not ship a compiled stylesheet. For an existing React/Vite app: ```sh -pnpm add @tryghost/shade@alpha react@18 react-dom@18 +pnpm add @tryghost/shade react@18 react-dom@18 pnpm add -D tailwindcss@^4.1 @tailwindcss/vite@^4.1 ``` diff --git a/apps/shade/scripts/pack-local.ts b/apps/shade/scripts/pack-local.ts index b7f0cb34b47e..f8814fd7f15e 100644 --- a/apps/shade/scripts/pack-local.ts +++ b/apps/shade/scripts/pack-local.ts @@ -82,7 +82,7 @@ export function findTargetProblem( ); }); if (!dependsOnShade) { - return `${appDir}/package.json doesn't depend on ${PACKAGE_NAME}. Install the published package first: npm install ${PACKAGE_NAME}@alpha`; + return `${appDir}/package.json doesn't depend on ${PACKAGE_NAME}. Install the published package first: npm install ${PACKAGE_NAME}`; } const foreign = files.find((file) => file in FOREIGN_LOCKFILES); diff --git a/apps/shade/skills/build-ghost-app-ui/SKILL.md b/apps/shade/skills/build-ghost-app-ui/SKILL.md index 35e4740a6a1c..348c1a84e70e 100644 --- a/apps/shade/skills/build-ghost-app-ui/SKILL.md +++ b/apps/shade/skills/build-ghost-app-ui/SKILL.md @@ -31,7 +31,7 @@ When sources disagree, trust them in this order: Check each step against the app, and do the ones it's missing: -1. Install `@tryghost/shade@alpha` and its peers from npm; `latest` is older. +1. Install `@tryghost/shade` and its peers from npm. `npm create vite` scaffolds React 19, which npm refuses beside Shade, so move the React packages and types first, as [Install](https://shade.ghost.org/docs/ghost-apps.md#install) shows. diff --git a/apps/shade/src/docs/ghost-apps.mdx b/apps/shade/src/docs/ghost-apps.mdx index cb56592253b3..5bb8af44e900 100644 --- a/apps/shade/src/docs/ghost-apps.mdx +++ b/apps/shade/src/docs/ghost-apps.mdx @@ -24,15 +24,13 @@ That gives the agent `build-ghost-app-ui`, the starting point for an app's scree ## Install -Install Shade from the `alpha` tag. `@tryghost/shade` on its own installs `latest`, which points at an older alpha. - Shade's peers are React 18 and Tailwind CSS 4.1 or later. `npm create vite` scaffolds React 19, and npm refuses to add Shade beside it, so move the React types to 18 first, then add Shade with React 18: ```sh npm create vite@latest my-app -- --template react-ts --no-interactive cd my-app npm install -D @types/react@^18.3.0 @types/react-dom@^18.3.0 tailwindcss@^4.1 @tailwindcss/vite@^4.1 -npm install @tryghost/shade@alpha @fontsource/inter react@^18.3.1 react-dom@^18.3.1 +npm install @tryghost/shade @fontsource/inter react@^18.3.1 react-dom@^18.3.1 ``` Keep `skipLibCheck: true` from the Vite template's `tsconfig`. Without it, `tsc` fails inside Shade's own dependencies. diff --git a/apps/shade/test/unit/scripts/pack-local.test.ts b/apps/shade/test/unit/scripts/pack-local.test.ts index 00f05e5f628d..a1833d5abb23 100644 --- a/apps/shade/test/unit/scripts/pack-local.test.ts +++ b/apps/shade/test/unit/scripts/pack-local.test.ts @@ -35,7 +35,7 @@ describe('findTargetProblem', () => { }); it('accepts Shade as a dev dependency', () => { - const manifest = JSON.stringify({ devDependencies: { '@tryghost/shade': 'alpha' } }); + const manifest = JSON.stringify({ devDependencies: { '@tryghost/shade': 'latest' } }); expect(findTargetProblem(app, manifest, ['package.json', 'package-lock.json'])).toBeUndefined(); }); diff --git a/docs/contributing/shipping.md b/docs/contributing/shipping.md index f04965ae07a9..45deedce58f2 100644 --- a/docs/contributing/shipping.md +++ b/docs/contributing/shipping.md @@ -40,9 +40,10 @@ pins the line the package lives in, and npm holds the moving part. - `versioning: patch` pins `major.minor`. Each publish is the next patch in that line. The public apps use this. - `versioning: prerelease` pins `X.Y.Z-.0`. Each publish is the next - `X.Y.Z-.N`, under the `distTag` the entry names, never `latest`. Alpha - packages use this until they graduate to the changeset lane. Shade, the upgrade - adapter base and the app SDK publish this way under `alpha`. + `X.Y.Z-.N`, under the `distTag` the entry names. Alpha packages use this + until they graduate to the changeset lane. Shade and the app SDK publish this + way under `latest`, so a plain install gets their newest release, and the + upgrade adapter base under `alpha`. CI publishes only when the package really changed. The affected graph selects candidates; the job then builds each one at the live version, packs it, and From 7c92aaef02c3e4f2f77eaf7c24e94d370005f17c Mon Sep 17 00:00:00 2001 From: Jonatan Svennberg Date: Thu, 12 Nov 2026 08:37:36 +0100 Subject: [PATCH 012/174] Removed older-Core fallbacks from Ghost Apps in Admin (#32676) no ref Ghost Apps is behind a private Labs flag, so Admin can assume a matching Core for it. Admin still had code for older Cores that no Apps site runs. - Removed that code and its tests - Noted in Admin's README and a new Apps AGENTS.md that Apps doesn't need older-Core support - Noted in that AGENTS.md that the Admin API allowlist is temporary, until proper app permissions replace it --- .../src/api/app-installations.ts | 16 ++--- apps/admin/README.md | 4 ++ apps/admin/src/apps/AGENTS.md | 12 ++++ apps/admin/src/apps/app-page.tsx | 51 ++-------------- apps/admin/src/apps/apps.acceptance.test.tsx | 61 ------------------- apps/admin/src/apps/lib/not-found.test.ts | 18 +++--- apps/admin/src/apps/lib/not-found.ts | 13 ---- apps/admin/src/apps/lib/use-sidebar-apps.ts | 2 +- .../e2e-api/admin/app-installations.test.ts | 5 +- 9 files changed, 35 insertions(+), 147 deletions(-) create mode 100644 apps/admin/src/apps/AGENTS.md diff --git a/apps/admin-x-framework/src/api/app-installations.ts b/apps/admin-x-framework/src/api/app-installations.ts index 82ddd4a28140..a3e732764235 100644 --- a/apps/admin-x-framework/src/api/app-installations.ts +++ b/apps/admin-x-framework/src/api/app-installations.ts @@ -11,11 +11,8 @@ export interface AppInstallation { id: string; app_id: string; status: AppInstallationStatus; - /** - * Increments with every change to the installation, so a session can tell it has ended. Missing - * on Ghost versions from before app sessions. - */ - revision?: number; + /** Increments with every change to the installation, so a session can tell it has ended. */ + revision: number; manifest_url: string; manifest: AppManifest; icon_data_url: string | null; @@ -59,8 +56,7 @@ export interface AppInstallationPreview { * The app's origin, if the site's configuration trusts it, so Ghost didn't ask it to prove it * holds the app's key. Empty when it proved it. An app is one origin, so there's at most one. */ - /** Missing from a Ghost from before the identity check, which trusted no origin. */ - trusted_origins?: string[]; + trusted_origins: string[]; /** * The site's installation of the same app, if it has one: the manifest it was approved * with and where that was read from, and what would change. @@ -114,16 +110,13 @@ export const useBrowseAppInstallations = createQuery `/apps/installations/${id}/`; - /** * Unlike `useBrowseAppInstallations`, this also returns uninstalled apps. * That way their details page still loads. */ export const useReadAppInstallation = createQueryWithId({ dataType, - path: appInstallationPath, + path: (id) => `/apps/installations/${id}/`, defaultSearchParams: { include: 'history' }, }); @@ -133,7 +126,6 @@ export const useReadAppInstallation = createQueryWithId({ method: 'POST', diff --git a/apps/admin/README.md b/apps/admin/README.md index 128321734ec5..9e21f3073274 100644 --- a/apps/admin/README.md +++ b/apps/admin/README.md @@ -50,6 +50,10 @@ Add an acceptance test for the older-backend case. The social accounts settings and membership tiers tests contain current examples of hiding controls until their supporting settings are present. +Ghost Apps is the exception while `apps` is a private Labs flag: its Admin code +assumes a matching Core, with no older-backend fallbacks or tests. Origin, +framing, identity and allowlist checks still apply. + ### Code that fails to load Screens, the editor and the search modal load their code when first needed. A diff --git a/apps/admin/src/apps/AGENTS.md b/apps/admin/src/apps/AGENTS.md new file mode 100644 index 000000000000..2af0df3218b9 --- /dev/null +++ b/apps/admin/src/apps/AGENTS.md @@ -0,0 +1,12 @@ +# Ghost Apps agent guidance + +While `apps` is in `PRIVATE_FEATURES` (`ghost/core/shared/labs.js`), this code +and `admin-x-framework`'s app API hooks build against a matching Core only, +with no older-Core fallbacks or tests. Origin, framing, identity and allowlist +checks still apply. + +The bridge's Admin API allowlist (`ADMIN_API_ALLOWLIST` in +`packages/app-contracts/src/bridge/allowlist.ts`) is a stopgap until +Permissions and auth replaces it with app-scoped tokens checked on the server. +Change its routes when an app needs them, and leave scopes, consent and per-app +permissions to that project. diff --git a/apps/admin/src/apps/app-page.tsx b/apps/admin/src/apps/app-page.tsx index b2cbe45aa078..a100ace38129 100644 --- a/apps/admin/src/apps/app-page.tsx +++ b/apps/admin/src/apps/app-page.tsx @@ -21,9 +21,7 @@ import { } from '@tryghost/admin-x-framework'; import { type AppInstallation, - type AppInstallationsResponseType, type AppSession, - appInstallationPath, useBrowseAppInstallations, useReadAppInstallation, useStartAppSession, @@ -33,7 +31,6 @@ import { getSettingValue, useBrowseSettings } from '@tryghost/admin-x-framework/ import { type SiteData, useBrowseSite } from '@tryghost/admin-x-framework/api/site'; import type { User } from '@tryghost/admin-x-framework/api/users'; import { apiUrl } from '@tryghost/admin-x-framework/helpers'; -import { useFetchApi } from '@tryghost/admin-x-framework/hooks'; import { getSiteTimezone } from '@tryghost/admin-x-framework/utils/get-site-timezone'; import { editorReturnState } from '@/editor/api'; import { usePageTitle } from '@/hooks/use-document-title'; @@ -51,12 +48,7 @@ import { import { createAdminApiFetch } from './lib/bridge-fetch'; import { placeRoute } from './lib/bridge-places'; import { APP_FRAME_ALLOW, APP_FRAME_SANDBOX, isGhostHost } from './lib/frame'; -import { - isInstallationNotFound, - isSessionsRouteMissing, - sessionFailureOf, - type SessionFailure, -} from './lib/not-found'; +import { isInstallationNotFound, sessionFailureOf, type SessionFailure } from './lib/not-found'; import { reportAppsError } from './lib/report-error'; import { appRoute } from './lib/routes'; import { appPageUrl, servedFrom } from './lib/served-from'; @@ -173,15 +165,11 @@ const SESSION_END_SEARCH_PARAMS: Record = {}; * * This only sees changes this tab reads. Changes made in another tab, or by another staff user, are * left to the app token that comes with Permissions and auth. - * - * Ghost versions from before app sessions don't give installations a revision, so there's nothing - * to compare, and nothing is read. */ function useSessionEnd(session: AppSession, onEnded: () => void) { const [since] = useState(() => Date.now()); const started = session.installation.revision; const { data, dataUpdatedAt, isFetching } = useReadAppInstallation(session.installation.id, { - enabled: started !== undefined, defaultErrorHandler: false, // Without the history the details page shows; this one has no use for it. searchParams: SESSION_END_SEARCH_PARAMS, @@ -197,13 +185,7 @@ function useSessionEnd(session: AppSession, onEnded: () => void) { }); const revision = data?.app_installations[0]?.revision; useEffect(() => { - if ( - !isFetching && - dataUpdatedAt >= since && - started !== undefined && - revision !== undefined && - revision > started - ) { + if (!isFetching && dataUpdatedAt >= since && revision !== undefined && revision > started) { onEnded(); } }, [dataUpdatedAt, isFetching, onEnded, revision, started, since]); @@ -246,7 +228,7 @@ const AppFrame: React.FC<{ site: { url: site.url, title: site.title, timezone, locale: site.locale }, user: { id: user.id, role: user.roles[0]?.name ?? '' }, theme, - session: { revision: installation.revision ?? 0 }, + session: { revision: installation.revision }, path, }; // Read when the page connects, so the app starts with Admin's context at that moment. @@ -505,8 +487,7 @@ const NotInstalled: React.FC = () => ( /** * Starts a session of the app when the page opens, and again on `restart`. Ghost first re-checks * the app's manifest, and only its response decides what the page shows. No part of the app loads - * before then. Ghost versions from before app sessions can't re-check, so a plain read of the - * installation decides instead. + * before then. */ function useAppSession(installationId: string): { settled: boolean; @@ -515,7 +496,6 @@ function useAppSession(installationId: string): { /** Ends this session and starts a new one, for example after approving changes. */ restart: () => void; } { - const fetchApi = useFetchApi(); const { mutateAsync: start } = useStartAppSession(); const [generation, setGeneration] = useState(0); @@ -524,27 +504,8 @@ function useAppSession(installationId: string): { const { data, error, isPending } = useQuery({ queryKey: ['app-session', installationId, generation], // `null` when there's nothing to open, because a query can't return `undefined`. - queryFn: async (): Promise => { - try { - return (await start(installationId)).app_sessions[0] ?? null; - } catch (startError) { - if (!isSessionsRouteMissing(startError)) { - throw startError; - } - } - - // Admin and Core deploy independently, so this Admin may be talking to a Core from before app - // sessions, which has no route for them. The app then opens as it did before sessions: from a - // plain read of the installation, without a re-check, and pinned to the revision that read - // returned. - const read = await fetchApi( - apiUrl(appInstallationPath(installationId)), - ); - const installation = read.app_installations[0]; - // That Core's installations may not have a revision either. The app then gets revision 0, - // which never changes. - return installation ? { installation } : null; - }, + queryFn: async (): Promise => + (await start(installationId)).app_sessions[0] ?? null, staleTime: Infinity, gcTime: 0, retry: false, diff --git a/apps/admin/src/apps/apps.acceptance.test.tsx b/apps/admin/src/apps/apps.acceptance.test.tsx index f192e286b398..c7de08694923 100644 --- a/apps/admin/src/apps/apps.acceptance.test.tsx +++ b/apps/admin/src/apps/apps.acceptance.test.tsx @@ -95,27 +95,6 @@ const apiError = (status: number, message: string, code?: string) => headers: { 'content-type': 'application/json' }, }); -/** What Ghost returns for a request to an Admin API route it doesn't have. */ -const routeNotFound = () => - new Response( - JSON.stringify({ - errors: [ - { - message: 'Resource not found', - context: null, - type: 'NotFoundError', - details: null, - property: null, - help: null, - code: null, - id: 'b1e2c3d4-0000-4000-8000-000000000000', - ghostErrorCode: null, - }, - ], - }), - { status: 404, headers: { 'content-type': 'application/json' } }, - ); - /** * Sets `appFrameTimeouts.ready` to `ms` while `run` runs, or until `run` calls `restore` to give * the rest of the spec the usual timeout. @@ -549,24 +528,6 @@ describe('Managing apps', () => { expect(reinstalledSessionsApi.requests).toHaveLength(1); }); - it('doesn’t load an uninstalled app on a Ghost version without app sessions', async () => { - // A current Ghost refuses to start a session of an uninstalled app, as the next spec shows. A - // Ghost from before app sessions returns a plain 404 to the session start, and returns the app - // to the read. - const older = installation({ status: 'uninstalled' }); - delete older.revision; - fakeSessionStart('installation-1', routeNotFound()); - const readApi = fakeAdminEndpoint('GET', readPath('installation-1'), { - app_installations: [older], - }); - - await renderAdminApp(APP_ROUTE, { labs }); - - await expect.element(appsScreen.notInstalled()).toHaveTextContent('This app isn’t installed'); - await expect.element(appsScreen.frame()).not.toBeInTheDocument(); - expect(readApi.requests).toHaveLength(1); - }); - it('says the app isn’t installed when it was uninstalled or never installed', async () => { const id = 'abcdefabcdefabcdefabcdef'; fakeSessionStart(id, apiError(404, 'This app is not installed.', 'APP_NOT_INSTALLED')); @@ -676,28 +637,6 @@ describe('Managing apps', () => { expect(sessionsApi.requests).toHaveLength(2); }); - it('opens an app without a re-check on a Ghost version without app sessions', async () => { - // Admin and Core deploy independently. A Ghost from before app sessions returns a plain 404 - // when Admin starts a session, and its installations have no revision. - const older = installation(); - delete older.revision; - const { sessionsApi, readApi, set } = await fakeAppPage(installation()); - set(older); - sessionsApi.set(routeNotFound()); - - const { queryClient } = await renderAdminApp(APP_ROUTE, { labs }); - - await expect.element(appsScreen.frame()).toBeVisible(); - expect((await appState()).context?.session).toEqual({ revision: 0 }); - expect(sessionsApi.requests).toHaveLength(1); - // The installation is read once to open the app, without a re-check. It isn't read again to - // detect the session's end, even when the publisher comes back to the tab, because a missing - // revision never changes. - window.dispatchEvent(new Event('visibilitychange')); - await expect.poll(() => queryClient.isFetching()).toBe(0); - expect(readApi.requests).toHaveLength(1); - }); - it('ends the session when the installation’s revision increases, and starts a new one', async () => { const { sessionsApi, readApi, set } = await fakeAppPage(installation()); await renderAdminApp(APP_ROUTE, { labs }); diff --git a/apps/admin/src/apps/lib/not-found.test.ts b/apps/admin/src/apps/lib/not-found.test.ts index 7cf8c7ed1624..17956317717a 100644 --- a/apps/admin/src/apps/lib/not-found.test.ts +++ b/apps/admin/src/apps/lib/not-found.test.ts @@ -1,26 +1,22 @@ import { describe, expect, it } from 'vitest'; import { type ErrorResponse, JSONError } from '@tryghost/admin-x-framework/errors'; -import { isInstallationNotFound, isSessionsRouteMissing, sessionFailureOf } from './not-found'; +import { isInstallationNotFound, sessionFailureOf } from './not-found'; const apiError = (status: number, code: string | null) => new JSONError(new Response(null, { status }), { errors: [{ code, message: 'Not found' }], } as unknown as ErrorResponse); -describe('isSessionsRouteMissing', () => { - it('treats a plain 404 as a Ghost version without app sessions', () => { - expect(isSessionsRouteMissing(apiError(404, null))).toBe(true); - }); - - it('treats a 404 with APP_NOT_INSTALLED as the app not being installed', () => { - expect(isSessionsRouteMissing(apiError(404, 'APP_NOT_INSTALLED'))).toBe(false); +describe('isInstallationNotFound', () => { + it('treats any 404, or a 422 for a malformed id, as nothing to show', () => { expect(isInstallationNotFound(apiError(404, 'APP_NOT_INSTALLED'))).toBe(true); + expect(isInstallationNotFound(apiError(404, null))).toBe(true); + expect(isInstallationNotFound(apiError(422, null))).toBe(true); }); it('leaves other failures alone', () => { - expect(isSessionsRouteMissing(apiError(422, null))).toBe(false); - expect(isSessionsRouteMissing(apiError(500, null))).toBe(false); - expect(isSessionsRouteMissing(new Error('offline'))).toBe(false); + expect(isInstallationNotFound(apiError(500, null))).toBe(false); + expect(isInstallationNotFound(new Error('offline'))).toBe(false); }); }); diff --git a/apps/admin/src/apps/lib/not-found.ts b/apps/admin/src/apps/lib/not-found.ts index 31daabe570e1..fb150b46f623 100644 --- a/apps/admin/src/apps/lib/not-found.ts +++ b/apps/admin/src/apps/lib/not-found.ts @@ -10,19 +10,6 @@ export function isInstallationNotFound(error: unknown): boolean { return error instanceof APIError && [404, 422].includes(error.response?.status ?? 0); } -/** - * Whether starting a session failed because Ghost has no route for it. Ghost versions from before - * app sessions return a plain 404. Versions with the route return a 404 with their own code when an - * app isn't installed. - */ -export function isSessionsRouteMissing(error: unknown): boolean { - return ( - error instanceof APIError && - error.response?.status === 404 && - apiErrorOf(error)?.code !== 'APP_NOT_INSTALLED' - ); -} - /** Why starting a session failed, when Ghost couldn't use the app's manifest. */ export interface SessionFailure { /** The failure's own code, which the screen shows so the publisher can pass it on. */ diff --git a/apps/admin/src/apps/lib/use-sidebar-apps.ts b/apps/admin/src/apps/lib/use-sidebar-apps.ts index da68d65fff4b..d14218bb0a2b 100644 --- a/apps/admin/src/apps/lib/use-sidebar-apps.ts +++ b/apps/admin/src/apps/lib/use-sidebar-apps.ts @@ -55,7 +55,7 @@ export function useSidebarApps(): SidebarApps { const enabled = useFeatureFlag('apps'); const { data: currentUser } = useCurrentUser(); const visibleToUser = canSeeApps(currentUser, enabled); - // An older Ghost without the endpoint, or any failure, just hides the section. + // Any failure just hides the section. const { installations, pins } = useInstalledApps({ enabled: visibleToUser }); const { pathname, search } = useLocation(); diff --git a/ghost/test/e2e-api/admin/app-installations.test.ts b/ghost/test/e2e-api/admin/app-installations.test.ts index 9d0fcd3742b2..5ea3ca0204c9 100644 --- a/ghost/test/e2e-api/admin/app-installations.test.ts +++ b/ghost/test/e2e-api/admin/app-installations.test.ts @@ -2410,10 +2410,7 @@ describe('App installations Admin API', function () { await agent.get('apps/installations/').expectStatus(404); await agent.get(`apps/installations/${installation.id}/`).expectStatus(404); - // Admin uses this code to tell an uninstalled app from a Ghost without app sessions, - // so a disabled flag must not send it. - const { body } = await start(installation.id, 404); - assert.notEqual(body.errors?.[0]?.code, 'APP_NOT_INSTALLED'); + await start(installation.id, 404); await agent.delete(`apps/installations/${installation.id}/`).expectStatus(404); assert.equal((await service().read(installation.id)).status, 'active'); }); From 60a8a6c985949d798790b1c95ce3a13f2059e190 Mon Sep 17 00:00:00 2001 From: "tryghost-renovate[bot]" <269725441+tryghost-renovate[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 07:04:39 +0000 Subject: [PATCH 013/174] Update storybook monorepo to v10.6.6 --- .changeset/proud-pears-ring.md | 5 + pnpm-lock.yaml | 190 ++++++++++++++++++--------------- pnpm-workspace.yaml | 14 +-- 3 files changed, 118 insertions(+), 91 deletions(-) create mode 100644 .changeset/proud-pears-ring.md diff --git a/.changeset/proud-pears-ring.md b/.changeset/proud-pears-ring.md new file mode 100644 index 000000000000..2f762631c3a6 --- /dev/null +++ b/.changeset/proud-pears-ring.md @@ -0,0 +1,5 @@ +--- +"@tryghost/koenig-lexical": patch +--- + +Updated dependencies diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 120027f93847..7379df158037 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -309,20 +309,20 @@ catalogs: specifier: 5.4.1 version: 5.4.1 '@storybook/addon-docs': - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 '@storybook/addon-links': - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 '@storybook/preact-vite': - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 '@storybook/react': - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 '@storybook/react-vite': - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 '@tailwindcss/postcss': specifier: 4.3.3 version: 4.3.3 @@ -573,8 +573,8 @@ catalogs: specifier: 0.5.7 version: 0.5.7 eslint-plugin-storybook: - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 eslint-plugin-tailwindcss: specifier: 4.4.0 version: 4.4.0 @@ -756,8 +756,8 @@ catalogs: specifier: 2.0.8 version: 2.0.8 storybook: - specifier: 10.6.5 - version: 10.6.5 + specifier: 10.6.6 + version: 10.6.6 stylelint: specifier: 18.0.0 version: 18.0.0 @@ -1836,13 +1836,13 @@ importers: version: link:../../tools/configs/eslint-react '@storybook/addon-docs': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/addon-links': specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/react-vite': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) '@tailwindcss/postcss': specifier: 'catalog:' version: 4.3.3 @@ -1893,7 +1893,7 @@ importers: version: 4.0.1(supports-color@10.2.2) storybook: specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tailwindcss: specifier: 'catalog:' version: 4.3.3 @@ -1936,13 +1936,13 @@ importers: version: 1.65.0 '@storybook/addon-docs': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/addon-links': specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/preact-vite': specifier: 'catalog:' - version: 10.6.5(preact@10.29.8)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) + version: 10.6.6(preact@10.29.8)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) '@tryghost/i18n': specifier: workspace:* version: link:../../packages/i18n @@ -1966,7 +1966,7 @@ importers: version: 16.2.0(postcss@8.5.32) storybook: specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tailwindcss: specifier: catalog:tailwind3 version: 3.4.19(tsx@4.23.15)(yaml@2.9.0) @@ -3393,7 +3393,7 @@ importers: version: 9.39.5 '@etchteam/storybook-addon-status': specifier: 8.1.0 - version: 8.1.0(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 8.1.0(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@lexical/clipboard': specifier: 0.13.1 version: 0.13.1(lexical@0.13.1) @@ -3441,16 +3441,16 @@ importers: version: 0.6.1(prettier@3.9.10) '@storybook/addon-docs': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/addon-links': specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 10.6.6(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@storybook/react': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2) '@storybook/react-vite': specifier: 'catalog:' - version: 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) + version: 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) '@testing-library/dom': specifier: 'catalog:' version: 10.4.2 @@ -3537,7 +3537,7 @@ importers: version: 5.2.0(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) eslint-plugin-storybook: specifier: 'catalog:' - version: 10.6.5(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 10.6.6(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-plugin-tailwindcss: specifier: catalog:tailwind3 version: 3.18.3(tailwindcss@3.4.19(tsx@4.23.15)(yaml@2.9.0)) @@ -3606,7 +3606,7 @@ importers: version: 2.0.6(react@18.3.1) storybook: specifier: 'catalog:' - version: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) stylelint: specifier: 'catalog:' version: 18.0.0 @@ -4481,7 +4481,7 @@ importers: version: 0.5.7(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2)) eslint-plugin-storybook: specifier: 'catalog:' - version: 10.6.5(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 10.6.6(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-plugin-tailwindcss: specifier: 'catalog:' version: 4.4.0(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(tailwindcss@4.3.3) @@ -8436,31 +8436,31 @@ packages: '@standard-schema/utils@0.3.0': resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==} - '@storybook/addon-docs@10.6.5': - resolution: {integrity: sha512-Kt0pGLA+nwdu2g80p8jbdoiiKXxwQbhrY6uzMzq/0G1lytxpJUzrOQAM+GDcEbqyvpKr0u5d1q05/LPem/uooQ==} + '@storybook/addon-docs@10.6.6': + resolution: {integrity: sha512-yflMNPrxk+QNuH0dPFgUk+AhVOa+Cz48bKz3/72eFDB8viWS9R0mQVBvKUxTIHOSUyDbaRyQiIeaL/pCvwW2jg==} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 peerDependenciesMeta: '@types/react': optional: true - '@storybook/addon-links@10.6.5': - resolution: {integrity: sha512-O0DN6C3tRmrpMRZIuMD2SDLAgS02zI7Yca0h4RBiBKPxm7i6a9lwc7gqrZ9HCJHVFbfapub0bhj7BD3FK0XDsA==} + '@storybook/addon-links@10.6.6': + resolution: {integrity: sha512-WyFPmi01exHGHgqyqbnU2WpSNaJOCLOr0kFR7zBM+DwyFcUmgr8b6CwNpu8Mv+WmYdKMGxX6rlOVF/tDhCpOaA==} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 peerDependenciesMeta: '@types/react': optional: true react: optional: true - '@storybook/builder-vite@10.6.5': - resolution: {integrity: sha512-udrGjg3yt38pz4FxplypXxw1creIGS7N6QS8xfvTFM8MQNtPyojT/gZdd4fhX0dFrQx5MMuJEYJA5gUBiPsLtg==} + '@storybook/builder-vite@10.6.6': + resolution: {integrity: sha512-DIA992qGuPZpTZqupWuhw3upWc6Qphm0tQFfSnCpgr5Nlvhe0C5Mth9eYz7CUpy49szJ6eOgQ2V8ktKtKaXyNA==} peerDependencies: - storybook: ^10.6.5 + storybook: ^10.6.6 vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 '@storybook/global@5.0.0': @@ -8472,53 +8472,53 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - '@storybook/preact-vite@10.6.5': - resolution: {integrity: sha512-i2NFY+cLN6RPar5LvnX8FHLI5qkBsChnfq+4SMUPnib5Td+q6Wjy6Ui9n/d9QQ5A9NERjOJoOqwPFsZF0mHfcg==} + '@storybook/preact-vite@10.6.6': + resolution: {integrity: sha512-NZK5oSV6AlDnPDJMaZT3MQfT2JC9I1TgdYqpVjQnRsWgcXG2Y+50v29+Pj6E86UCRdM/Le9KbkPUsgxyrNaFcA==} peerDependencies: preact: '>=10' - storybook: ^10.6.5 + storybook: ^10.6.6 vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 - '@storybook/preact@10.6.5': - resolution: {integrity: sha512-1P8SAwBZeZIauWBwUEd5f3pDM8UoLDVO4c2/N9yKPm+4uPkDiBGHxTr4kXsC1BqaT3Kw/AhXRg4jXimyxF6vWA==} + '@storybook/preact@10.6.6': + resolution: {integrity: sha512-cs29o9nyjARKem4QhEx8OYZ8m/zFmC3qrPvbC1dP/0MuwZ4oRM7qVtm82jBHvbWT4io8vTQeIo8xerGISqThvA==} peerDependencies: preact: ^8.0.0||^10.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 - '@storybook/react-dom-shim@10.6.5': - resolution: {integrity: sha512-Qbbkp+5Otg32w8Ddav6rH6MGPiYVfEzrgn0HqbqlqS8kY+DRXo+NYXJwZTVSDSwrYPrfH+Ok2tV4uE8Zo0c3cg==} + '@storybook/react-dom-shim@10.6.6': + resolution: {integrity: sha512-yZNOsGoBvn+ywgf7WR+nHddBpIh/k24IOfAeMte6JA1rMB9defuPyhuMMENEyLfofqNYFnj1D+CB4XppnO3nBA==} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 '@types/react-dom': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 peerDependenciesMeta: '@types/react': optional: true '@types/react-dom': optional: true - '@storybook/react-vite@10.6.5': - resolution: {integrity: sha512-RsRF1drYtCku7+PMdRnuFt3EdG8Rn8I5G8ne0cBjn24xSn5Pbo9W+y9IoyD2llAeaeCpzEEdASY12wpKd3aCQA==} + '@storybook/react-vite@10.6.6': + resolution: {integrity: sha512-Km+avRI1fBr4efNKVBQwgfy6xf1jL6ObAT9H1A2N2Lv7TTc+C9n0Il8xqxDc5CX8zJFGW15Wns5qwl/I2YhKjA==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 typescript: '>= 4.9.x' vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - '@storybook/react@10.6.5': - resolution: {integrity: sha512-vvRjRe/O8NRiQbGyA7Ne6h2jbD6GjwNZFkMdHl+0kZH8Z/S9ZWWmKmjCySvH/OmgighdCOQ98tcfND7m65WQBg==} + '@storybook/react@10.6.6': + resolution: {integrity: sha512-m1f2+xOdG3Qo7YD69QPPWvQ5sI0YPoDorLgNxAJFC6ZsR2BKvduS3fNb2g9nXqUcHBR/X6b9s3uRZVHPIAsnsg==} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 '@types/react-dom': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.5 + storybook: ^10.6.6 typescript: '>= 4.9.x' peerDependenciesMeta: '@types/react': @@ -11585,8 +11585,8 @@ packages: peerDependencies: eslint: '>=7.7.0' - eslint-plugin-storybook@10.6.5: - resolution: {integrity: sha512-sQSRwmbqcyGVtjVGUSOPTM5TFjopoit3blQxMcsHeqmmR1PJsciLH/WjgG7CT+u2/F0HMJFsQa+TqJSFDxXwWQ==} + eslint-plugin-storybook@10.6.6: + resolution: {integrity: sha512-3bQT92I/MU2yZeBjIm+v2pe6q55V764jCMccUg+OSLsGOdJ+nRZ80W8FpjbecpdBdkO80yR56jVcqLFamDwZUA==} peerDependencies: eslint: '>=8' @@ -14061,6 +14061,28 @@ packages: targets: - cpu: x86 os: win32 + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-UccuOhOFsQ1MhipAyEX8e+pbGeMMfhCdvcwgd8VeObs= + type: binary + url: https://unofficial-builds.nodejs.org/download/release/v22.23.5/node-v22.23.5-linux-arm64-musl.tar.gz + targets: + - cpu: arm64 + os: linux + libc: musl + - resolution: + archive: tarball + bin: + node: bin/node + integrity: sha256-WRb60QoF5H8ty9cPmToDln/9UTMPQEFeyK/dmSjcEL4= + type: binary + url: https://unofficial-builds.nodejs.org/download/release/v22.23.5/node-v22.23.5-linux-x64-musl.tar.gz + targets: + - cpu: x64 + os: linux + libc: musl version: 22.23.5 hasBin: true @@ -15789,8 +15811,8 @@ packages: resolution: {integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==} engines: {node: '>=4', npm: '>=6'} - storybook@10.6.5: - resolution: {integrity: sha512-qurC38Nx4PDF9YIq6GO95dpUx8a3B9AZwlcHBo4cOI9At09ifjQRsqcwcdOf2YX0cpVhFKmHkI20SWCrxqYQrg==} + storybook@10.6.6: + resolution: {integrity: sha512-lCROrR6Fj+WDBoJu4yp6o/cqcg376Sg85hiUnTh00I0EStk8xFRvTdzRuNWHlLA8itQrkz6Lo/IqFZ1FVXMiAA==} hasBin: true peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -18131,10 +18153,10 @@ snapshots: '@eslint/core': 0.17.0 levn: 0.4.1 - '@etchteam/storybook-addon-status@8.1.0(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@etchteam/storybook-addon-status@8.1.0(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: lodash: 4.18.1 - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@exodus/bytes@1.15.1(@noble/hashes@1.8.0)': optionalDependencies: @@ -20588,14 +20610,14 @@ snapshots: '@standard-schema/utils@0.3.0': {} - '@storybook/addon-docs@10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@storybook/addon-docs@10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: '@mdx-js/react': 3.1.1(@types/react@18.3.31)(react@18.3.1) '@storybook/icons': 2.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@storybook/react-dom-shim': 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + '@storybook/react-dom-shim': 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) ts-dedent: 2.3.0 unplugin: 2.3.11 optionalDependencies: @@ -20603,17 +20625,17 @@ snapshots: transitivePeerDependencies: - '@types/react-dom' - '@storybook/addon-links@10.6.5(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@storybook/addon-links@10.6.6(@types/react@18.3.31)(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: '@storybook/global': 5.0.0 - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) optionalDependencies: '@types/react': 18.3.31 react: 18.3.1 - '@storybook/builder-vite@10.6.5(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': + '@storybook/builder-vite@10.6.6(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': dependencies: - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) ts-dedent: 2.3.0 vite: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) @@ -20624,43 +20646,43 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/preact-vite@10.6.5(preact@10.29.8)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': + '@storybook/preact-vite@10.6.6(preact@10.29.8)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': dependencies: - '@storybook/builder-vite': 10.6.5(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) - '@storybook/preact': 10.6.5(preact@10.29.8)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + '@storybook/builder-vite': 10.6.6(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) + '@storybook/preact': 10.6.6(preact@10.29.8)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) preact: 10.29.8 - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) vite: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) - '@storybook/preact@10.6.5(preact@10.29.8)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@storybook/preact@10.6.6(preact@10.29.8)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: '@storybook/global': 5.0.0 preact: 10.29.8 - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) ts-dedent: 2.3.0 - '@storybook/react-dom-shim@10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@storybook/react-dom-shim@10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) optionalDependencies: '@types/react': 18.3.31 '@types/react-dom': 18.3.7(@types/react@18.3.31) - '@storybook/react-vite@10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': + '@storybook/react-vite@10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.62.2)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0))': dependencies: '@joshwooding/vite-plugin-react-docgen-typescript': 0.7.0(@typescript/typescript6@6.0.2)(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) '@rollup/pluginutils': 5.4.0(rollup@4.62.2) - '@storybook/builder-vite': 10.6.5(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) - '@storybook/react': 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2) + '@storybook/builder-vite': 10.6.6(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(vite@8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0)) + '@storybook/react': 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2) empathic: 2.0.1 magic-string: 1.4.5 react: 18.3.1 react-docgen: 8.0.3(supports-color@10.2.2) react-dom: 18.3.1(react@18.3.1) resolve: 1.22.12 - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tsconfig-paths: 4.2.0 vite: 8.1.6(@types/node@22.20.5)(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(tsx@4.23.15)(yaml@2.9.0) optionalDependencies: @@ -20671,15 +20693,15 @@ snapshots: - rollup - supports-color - '@storybook/react@10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)': + '@storybook/react@10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(@typescript/typescript6@6.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(supports-color@10.2.2)': dependencies: '@storybook/global': 5.0.0 - '@storybook/react-dom-shim': 10.6.5(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + '@storybook/react-dom-shim': 10.6.6(@types/react-dom@18.3.7(@types/react@18.3.31))(@types/react@18.3.31)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) react: 18.3.1 react-docgen: 8.0.3(supports-color@10.2.2) react-docgen-typescript: 2.4.0(@typescript/typescript6@6.0.2) react-dom: 18.3.1(react@18.3.1) - storybook: 10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + storybook: 10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) optionalDependencies: '@types/react': 18.3.31 '@types/react-dom': 18.3.7(@types/react@18.3.31) @@ -24167,7 +24189,7 @@ snapshots: dependencies: eslint: 9.39.5(jiti@2.7.0)(supports-color@10.2.2) - eslint-plugin-storybook@10.6.5(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): + eslint-plugin-storybook@10.6.6(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@typescript-eslint/types': 8.72.1 '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@9.39.5(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -29184,7 +29206,7 @@ snapshots: stoppable@1.1.0: {} - storybook@10.6.5(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + storybook@10.6.6(@types/react@18.3.31)(prettier@3.9.10)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@storybook/global': 5.0.0 '@storybook/icons': 2.0.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 47f731b98ae9..9991e40ac5bb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -81,11 +81,11 @@ catalog: '@sentry/bundler-plugin-core': 5.3.0 '@sentry/react': 7.120.4 '@sentry/vite-plugin': 5.4.1 - '@storybook/addon-docs': 10.6.5 - '@storybook/addon-links': 10.6.5 - '@storybook/preact-vite': 10.6.5 - '@storybook/react': 10.6.5 - '@storybook/react-vite': 10.6.5 + '@storybook/addon-docs': 10.6.6 + '@storybook/addon-links': 10.6.6 + '@storybook/preact-vite': 10.6.6 + '@storybook/react': 10.6.6 + '@storybook/react-vite': 10.6.6 '@tailwindcss/postcss': 4.3.3 '@tailwindcss/vite': 4.3.3 '@tanstack/react-query': 5.105.1 @@ -163,7 +163,7 @@ catalog: eslint-plugin-react: 7.37.5 eslint-plugin-react-hooks: 5.2.0 eslint-plugin-react-refresh: 0.5.7 - eslint-plugin-storybook: 10.6.5 + eslint-plugin-storybook: 10.6.6 eslint-plugin-tailwindcss: 4.4.0 express: 4.22.3 flexsearch: 0.7.43 @@ -214,7 +214,7 @@ catalog: sirv: 3.0.2 snakecase-keys: 9.0.2 sonner: 2.0.8 - storybook: 10.6.5 + storybook: 10.6.6 stylelint: 18.0.0 supertest: 7.3.1 tailwindcss: 4.3.3 From 8da0ff958c5596f89e2003c8fca9d45ee348a6f0 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 12 Nov 2026 07:45:58 +0000 Subject: [PATCH 014/174] Changed the test worker count helper to TypeScript (#32794) `@internal/cfg-test-workers` was JavaScript with a hand-written `index.d.mts`. Its types could drift from the code, and nothing type-checked the source. It is now a single `index.ts` with no build step. Its three consumers load the TypeScript source directly: the Ghost Core database and Admin acceptance Vitest configs, and the browser E2E Playwright config. The package also gets its own `test:types`, following `tools/configs/oxlint/`. ### Testing - Loaded each consumer config by listing its tests: - `ghost`: `vitest list --filesOnly -c vitest.config.db.ts` - `apps/admin`: `vitest list --filesOnly -c vitest.acceptance.config.ts` - `e2e`: `playwright test --list --project=main` - Set `GHOST_TEST_MACHINE_SHARE=2` and confirmed each of those fails with the helper's own error, raised from `index.ts`. - `pnpm --filter @internal/cfg-test-workers test:types`, `pnpm lint:packages` and `pnpm lint:markdown` pass, as do oxlint, oxfmt and ESLint on the helper and the three config files. - Not run locally: the test suites themselves. --- pnpm-lock.yaml | 12 ++++++++++- tools/configs/README.md | 4 ++-- tools/configs/test-workers/index.d.mts | 12 ----------- .../test-workers/{index.mjs => index.ts} | 20 ++++++++++++++++--- tools/configs/test-workers/package.json | 16 +++++++++------ tools/configs/test-workers/tsconfig.json | 8 ++++++++ 6 files changed, 48 insertions(+), 24 deletions(-) delete mode 100644 tools/configs/test-workers/index.d.mts rename tools/configs/test-workers/{index.mjs => index.ts} (79%) create mode 100644 tools/configs/test-workers/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7379df158037..cdd8fb60b064 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4507,7 +4507,17 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' - tools/configs/test-workers: {} + tools/configs/test-workers: + devDependencies: + '@internal/cfg-typescript': + specifier: workspace:* + version: link:../typescript + '@types/node': + specifier: 'catalog:' + version: 22.20.5 + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' tools/configs/typescript: {} diff --git a/tools/configs/README.md b/tools/configs/README.md index dc9389f3033c..f0162d89bd89 100644 --- a/tools/configs/README.md +++ b/tools/configs/README.md @@ -15,8 +15,8 @@ workspace and compose the shared factories or presets. | `vitest/` | Shared test configuration | `@internal/cfg-vitest` | Configuration can use JavaScript, JSON, declarations or TypeScript according to -its loader. Custom Oxlint rules are TypeScript; their private workspace checks -them without adding a build or package API. Use the +its loader. Custom Oxlint rules and the test worker count are TypeScript; each +private workspace type-checks its own source without adding a build. Use the [ESLint guide](eslint/README.md) for factory composition, plugin dependency ownership and Oxlint scope changes. diff --git a/tools/configs/test-workers/index.d.mts b/tools/configs/test-workers/index.d.mts deleted file mode 100644 index 241adae76e15..000000000000 --- a/tools/configs/test-workers/index.d.mts +++ /dev/null @@ -1,12 +0,0 @@ -export interface TestWorkerOptions { - /** Memory one worker uses at its peak, including the browser or Ghost it drives. */ - memoryPerWorkerGB: number; - /** Cores one worker keeps busy. Default `1`. */ - cpusPerWorker?: number; - /** Default `1`. */ - min?: number; - /** Default no limit. */ - max?: number; -} - -export function testWorkerCount(options: TestWorkerOptions): number; diff --git a/tools/configs/test-workers/index.mjs b/tools/configs/test-workers/index.ts similarity index 79% rename from tools/configs/test-workers/index.mjs rename to tools/configs/test-workers/index.ts index 9f14aa79caf7..50cfb8b987e4 100644 --- a/tools/configs/test-workers/index.mjs +++ b/tools/configs/test-workers/index.ts @@ -1,5 +1,16 @@ import { availableParallelism, totalmem } from 'node:os'; +export interface TestWorkerOptions { + /** Memory one worker uses at its peak, including the browser or Ghost it drives. */ + memoryPerWorkerGB: number; + /** Cores one worker keeps busy. Default `1`. */ + cpusPerWorker?: number; + /** Default `1`. */ + min?: number; + /** Default no limit. */ + max?: number; +} + const GB = 1024 ** 3; // The rest of the machine needs memory too, and a machine that swaps runs @@ -32,10 +43,13 @@ function usableMemory() { * or a Ghost. Such workers can exhaust memory before they saturate the cores, * so take whichever limit is lower. `TEST_WORKERS_COUNT` sets an exact count * instead. - * - * @param {import('./index.d.mts').TestWorkerOptions} options */ -export function testWorkerCount({ memoryPerWorkerGB, cpusPerWorker = 1, min = 1, max = Infinity }) { +export function testWorkerCount({ + memoryPerWorkerGB, + cpusPerWorker = 1, + min = 1, + max = Infinity, +}: TestWorkerOptions): number { // A fractional count makes Vitest start a fork with no pool id const override = Math.floor(Number(process.env.TEST_WORKERS_COUNT)); if (override >= 1) { diff --git a/tools/configs/test-workers/package.json b/tools/configs/test-workers/package.json index 353bb96cd0f9..8afe69e2e183 100644 --- a/tools/configs/test-workers/package.json +++ b/tools/configs/test-workers/package.json @@ -5,14 +5,18 @@ "description": "Shared worker count for Ghost's expensive test suites", "license": "MIT", "files": [ - "index.mjs", - "index.d.mts" + "index.ts" ], "type": "module", "exports": { - ".": { - "types": "./index.d.mts", - "default": "./index.mjs" - } + ".": "./index.ts" + }, + "scripts": { + "test:types": "tsc6 --noEmit" + }, + "devDependencies": { + "@internal/cfg-typescript": "workspace:*", + "@types/node": "catalog:", + "typescript": "catalog:" } } diff --git a/tools/configs/test-workers/tsconfig.json b/tools/configs/test-workers/tsconfig.json new file mode 100644 index 000000000000..0f5c8b11b38e --- /dev/null +++ b/tools/configs/test-workers/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@internal/cfg-typescript/esm.json", + "compilerOptions": { + "noEmit": true, + "erasableSyntaxOnly": true + }, + "include": ["**/*.ts"] +} From 2c3387c2643998efeb298e69d5dba2de86b73e26 Mon Sep 17 00:00:00 2001 From: Renato Costa <130500381+renatoworks@users.noreply.github.com> Date: Thu, 12 Nov 2026 09:47:35 +0200 Subject: [PATCH 015/174] Changed phone custom fields to show calling codes in parentheses (#32818) ref https://linear.app/ghost/issue/DYA-242 The phone input's country list named each country with its code straight after it, as in "United Kingdom +44", so in a long list the eye had to find where the name ended before it could read the code. Stripe Checkout, where buyers already pick a country for their phone number, sets the code apart in parentheses, as in "United Kingdom (+44)". The label is built once in the shared package, so Admin and Portal both change with it, and searching by code still finds a country. --- .changeset/phone-codes-in-parentheses.md | 5 +++++ .../detail/member-detail-custom-fields.acceptance.test.tsx | 2 +- .../test/unit/components/pages/account-profile-page.test.jsx | 4 ++-- e2e/tests/portal/member-custom-fields.test.ts | 2 +- packages/metafield-types/src/phone.ts | 4 ++-- packages/metafield-types/test/phone.test.ts | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/phone-codes-in-parentheses.md diff --git a/.changeset/phone-codes-in-parentheses.md b/.changeset/phone-codes-in-parentheses.md new file mode 100644 index 000000000000..d34630d139f4 --- /dev/null +++ b/.changeset/phone-codes-in-parentheses.md @@ -0,0 +1,5 @@ +--- +"@tryghost/metafield-types": patch +--- + +Changed `phoneCountryOptions` to put each calling code in parentheses, such as `United Kingdom (+44)`. diff --git a/apps/admin/src/members/detail/member-detail-custom-fields.acceptance.test.tsx b/apps/admin/src/members/detail/member-detail-custom-fields.acceptance.test.tsx index 6711f1cab00b..b65211d3c087 100644 --- a/apps/admin/src/members/detail/member-detail-custom-fields.acceptance.test.tsx +++ b/apps/admin/src/members/detail/member-detail-custom-fields.acceptance.test.tsx @@ -281,7 +281,7 @@ describe('Member detail custom fields', () => { const listWidth = list.element().getBoundingClientRect().width; expect(Math.abs(listWidth - (phoneInputWidth ?? 0))).toBeLessThanOrEqual(2); await page.getByPlaceholder('Search countries...').fill('United Kingdom'); - await page.getByRole('option', { name: 'United Kingdom +44' }).click(); + await page.getByRole('option', { name: 'United Kingdom (+44)' }).click(); await expect .element(modal().getByRole('combobox', { name: 'Country code' })) .toHaveTextContent('+44'); diff --git a/apps/portal/test/unit/components/pages/account-profile-page.test.jsx b/apps/portal/test/unit/components/pages/account-profile-page.test.jsx index 19f5193efb08..485a976b11e8 100644 --- a/apps/portal/test/unit/components/pages/account-profile-page.test.jsx +++ b/apps/portal/test/unit/components/pages/account-profile-page.test.jsx @@ -174,9 +174,9 @@ describe('Account Profile Page', () => { fireEvent.click(picker(utils, 'Country code')); expect(searchBox(utils, 'Country code')).toHaveFocus(); fireEvent.change(searchBox(utils, 'Country code'), { target: { value: 'germ' } }); - expect(offered()).toEqual(['Germany +49']); + expect(offered()).toEqual(['Germany (+49)']); fireEvent.change(searchBox(utils, 'Country code'), { target: { value: '+33' } }); - expect(offered()).toEqual(['France +33']); + expect(offered()).toEqual(['France (+33)']); fireEvent.keyDown(searchBox(utils, 'Country code'), { key: 'Enter' }); expect(picker(utils, 'Country code')).toHaveTextContent('🇫🇷 +33'); diff --git a/e2e/tests/portal/member-custom-fields.test.ts b/e2e/tests/portal/member-custom-fields.test.ts index 6604ed58e57e..b548a7af30f5 100644 --- a/e2e/tests/portal/member-custom-fields.test.ts +++ b/e2e/tests/portal/member-custom-fields.test.ts @@ -282,7 +282,7 @@ test.describe('Portal - member custom fields', () => { // Found by its code, which three other countries share. await profile.phoneCountry(key).click(); await profile.listSearch('Country code').fill('+44'); - await profile.listOption('United Kingdom +44').click(); + await profile.listOption('United Kingdom (+44)').click(); await expect(profile.phoneCountry(key)).toHaveText('🇬🇧 +44'); // One the country has no number like is refused, with the reason under the input. diff --git a/packages/metafield-types/src/phone.ts b/packages/metafield-types/src/phone.ts index 800630e0584c..17e4f8768c63 100644 --- a/packages/metafield-types/src/phone.ts +++ b/packages/metafield-types/src/phone.ts @@ -872,13 +872,13 @@ function international(text: string, country: PhoneCountry | undefined): string /** * The countries a phone number can be from, out of `countries` as an app names them, each named - * with its code, such as `United Kingdom +44`, in the order given. + * with its code, such as `United Kingdom (+44)`, in the order given. */ export function phoneCountryOptions( countries: readonly { value: string; label: string }[], ): { value: PhoneCountry; label: string }[] { return countries.flatMap(({ value, label }) => - isPhoneCountry(value) ? [{ value, label: `${label} +${CALLING_CODES[value]}` }] : [], + isPhoneCountry(value) ? [{ value, label: `${label} (+${CALLING_CODES[value]})` }] : [], ); } diff --git a/packages/metafield-types/test/phone.test.ts b/packages/metafield-types/test/phone.test.ts index 6136a147af82..ce3fc7e108dd 100644 --- a/packages/metafield-types/test/phone.test.ts +++ b/packages/metafield-types/test/phone.test.ts @@ -121,7 +121,7 @@ describe('phone numbers in a browser', function () { { value: 'AQ', label: 'Antarctica' }, { value: 'GB', label: 'United Kingdom' }, ]), - [{ value: 'GB', label: 'United Kingdom +44' }], + [{ value: 'GB', label: 'United Kingdom (+44)' }], ); }); From 4fd8ea9617983cbb33a7ebf99fdfb5c019967a28 Mon Sep 17 00:00:00 2001 From: Jonatan Svennberg Date: Thu, 12 Nov 2026 09:18:06 +0100 Subject: [PATCH 016/174] Removed the app SDK's duplicate manifest types (#32811) no ref The app SDK kept its own copies of the signed manifest and manifest error types. Nothing checked them against the contracts package, which defines the same types. The SDK now imports them from the contracts, so there's one definition of each and they can't drift apart. --- packages/app-contracts/src/manifest/parse.ts | 1 + packages/app-sdk/src/backend/manifest.ts | 5 +++-- packages/app-sdk/src/shared/manifest.ts | 14 -------------- packages/app-sdk/src/tooling/types.ts | 7 ++++--- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/packages/app-contracts/src/manifest/parse.ts b/packages/app-contracts/src/manifest/parse.ts index d8163789f0dc..50918e025260 100644 --- a/packages/app-contracts/src/manifest/parse.ts +++ b/packages/app-contracts/src/manifest/parse.ts @@ -21,6 +21,7 @@ export interface ParseManifestOptions { allowLocalhost?: boolean; } +/** One problem with a manifest. */ export interface ManifestError { /** Where in the manifest the problem is, e.g. `surfaces[0].url`. Empty for the whole. */ path: string; diff --git a/packages/app-sdk/src/backend/manifest.ts b/packages/app-sdk/src/backend/manifest.ts index 27ef84bcdeb4..c690eb50bf24 100644 --- a/packages/app-sdk/src/backend/manifest.ts +++ b/packages/app-sdk/src/backend/manifest.ts @@ -1,6 +1,7 @@ -import type { SignedManifest } from '../shared/manifest.ts'; +import type { SignedManifest } from '@tryghost/app-contracts/identity'; -export { MANIFEST_PATH, type SignedManifest } from '../shared/manifest.ts'; +export { MANIFEST_PATH } from '../shared/manifest.ts'; +export type { SignedManifest }; /** * A response that serves the signed manifest, for a backend that doesn't serve it as a static diff --git a/packages/app-sdk/src/shared/manifest.ts b/packages/app-sdk/src/shared/manifest.ts index 5b0ce3e926fd..0ef231783e09 100644 --- a/packages/app-sdk/src/shared/manifest.ts +++ b/packages/app-sdk/src/shared/manifest.ts @@ -4,20 +4,6 @@ /** Where an app serves its signed manifest by convention, and where the SDK's tooling signs it for. */ export const MANIFEST_PATH = '/ghost-app.json'; -/** A signed manifest: flattened JWS JSON, as `ghost-app sign` or the Vite plugin writes it. */ -export interface SignedManifest { - protected: string; - payload: string; - signature: string; -} - -/** One problem with a manifest. */ -export interface ManifestError { - /** Where in the manifest the problem is, such as `surfaces[0].url`. Empty for the whole. */ - path: string; - message: string; -} - /** * Stands in for the site's own URL when checking a manifest as Ghost would, which nothing but * the site knows: a name that's never any site's, so the rest of the rules apply as Ghost diff --git a/packages/app-sdk/src/tooling/types.ts b/packages/app-sdk/src/tooling/types.ts index e23961dd3c97..a509c5bca2fe 100644 --- a/packages/app-sdk/src/tooling/types.ts +++ b/packages/app-sdk/src/tooling/types.ts @@ -1,9 +1,10 @@ import type { PublicKeyJwk } from './keys.ts'; -// Written out rather than taken from the contracts, whose manifest types are inferred from -// zod, so the declarations an app installs need nothing but these. +export type { SignedManifest } from '@tryghost/app-contracts/identity'; +export type { ManifestError } from '@tryghost/app-contracts/manifest'; -export type { ManifestError, SignedManifest } from '../shared/manifest.ts'; +// ManifestSource and AppManifest are written out, as the contracts infer theirs from zod, so +// the declarations an app installs need nothing but these. /** * What `ghost-app.json` holds: the manifest, without the fields the tooling adds when it From 49499c3f1f451867bca5a2f950d159a049e6c5cd Mon Sep 17 00:00:00 2001 From: Renato Costa <130500381+renatoworks@users.noreply.github.com> Date: Thu, 12 Nov 2026 10:21:21 +0200 Subject: [PATCH 017/174] Added suggested custom field names to the checkout settings (#32819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref https://linear.app/ghost/issue/DYA-241 Each "Save … as" picker in the checkout settings only ever makes one kind of field, and that field almost always gets the same name, so the new field form now starts with it: "Shipping Address", "Recipient Name" or "Phone". It saves a step in the most common setup, and a name searched for in the picker still wins. The names are in Title Case, as publishers already name their fields: across sites with custom fields, names such as "Shipping Address", "Mailing Address", "Job Title" and "Mobile Phone" outnumber sentence case. A field name is the publisher's own label rather than Ghost's interface copy, so it follows how they write theirs. Ghost refuses a name another field has, whatever its case, type or status, so a name that's taken isn't suggested and the form starts empty instead. "Shipping Address" and "Phone" already exist on several sites, some of those phones as short text fields the phone picker doesn't offer, so the clash is a real one rather than an edge case. --- .../checkout-fields.acceptance.test.tsx | 85 +++++++++++++++++++ .../membership/checkout/collect-settings.tsx | 10 ++- .../membership/checkout/phone-settings.tsx | 1 + .../membership/checkout/shipping-settings.tsx | 2 + .../custom-field-picker.tsx | 7 +- 5 files changed, 102 insertions(+), 3 deletions(-) diff --git a/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx b/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx index b0e297f80f9f..7dccaa1bb66d 100644 --- a/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx +++ b/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx @@ -235,6 +235,91 @@ describe('Checkout settings', () => { await expect.element(type).toBeDisabled(); }); + // Each of these pickers only ever makes one kind of field, so its form starts from the name + // that field almost always has. A name searched for is still the one the publisher meant. + it('starts a new field with the name it usually has, unless one was searched for', async () => { + const { modal } = await openCheckoutFields({ + design: { customize: false }, + shipping: { collect: false }, + phone: { collect: false }, + }); + await modal.getByRole('switch', { name: 'Shipping address' }).click(); + await modal.getByRole('switch', { name: 'Phone' }).click(); + const form = page.getByRole('dialog', { name: 'New custom field' }); + + for (const [picker, name] of [ + ['Save address as', 'Shipping Address'], + ['Save name as', 'Recipient Name'], + ['Save phone as', 'Phone'], + ]) { + await modal.getByRole('combobox', { name: picker }).click(); + await page.getByRole('option', { name: 'Add custom field' }).click(); + await expect.element(form.getByLabelText('Name')).toHaveValue(name); + await userEvent.keyboard('{Escape}'); + await expect.element(form).not.toBeInTheDocument(); + } + + await modal.getByRole('combobox', { name: 'Save phone as' }).click(); + await userEvent.fill(page.getByPlaceholder('Search fields...'), 'Mobile'); + await page.getByRole('option', { name: 'Add custom field' }).click(); + await expect.element(form.getByLabelText('Name')).toHaveValue('Mobile'); + }); + + // Ghost refuses a name another field has, whatever its type, case or status, so a taken name + // would only be refused on save. + it("doesn't suggest a name another field already has", async () => { + const archivedPhone = { + ...phoneField, + key: KeySchema.parse('phone'), + name: 'phone', + type: 'short_text', + status: 'archived', + } satisfies MemberCustomField; + const { modal } = await openCheckoutFields( + { design: { customize: false }, shipping: { collect: false }, phone: { collect: false } }, + [phoneField, archivedPhone], + ); + await modal.getByRole('switch', { name: 'Phone' }).click(); + + await modal.getByRole('combobox', { name: 'Save phone as' }).click(); + await page.getByRole('option', { name: 'Add custom field' }).click(); + await expect + .element(page.getByRole('dialog', { name: 'New custom field' }).getByLabelText('Name')) + .toHaveValue(''); + }); + + // Once a field is saved with the suggested name, that name is taken, so the next new field + // starts empty rather than with a name that would be refused. + it('stops suggesting a name once a field has been saved with it', async () => { + const savedPhone = { + ...phoneField, + key: KeySchema.parse('phone'), + name: 'Phone', + } satisfies MemberCustomField; + const fields = [phoneField]; + fakeAdminEndpoint('POST', '/members/metafields/custom/', () => { + fields.push(savedPhone); + return { members_metafields: [savedPhone] }; + }); + const { modal } = await openCheckoutFields( + { design: { customize: false }, shipping: { collect: false }, phone: { collect: false } }, + () => fields, + ); + await modal.getByRole('switch', { name: 'Phone' }).click(); + const picker = modal.getByRole('combobox', { name: 'Save phone as' }); + const form = page.getByRole('dialog', { name: 'New custom field' }); + + await picker.click(); + await page.getByRole('option', { name: 'Add custom field' }).click(); + await expect.element(form.getByLabelText('Name')).toHaveValue('Phone'); + await form.getByRole('button', { name: 'Save' }).click(); + await expect.element(picker).toHaveTextContent('Phone'); + + await picker.click(); + await page.getByRole('option', { name: 'Add custom field' }).click(); + await expect.element(form.getByLabelText('Name')).toHaveValue(''); + }); + // A site keeps its Stripe connection when the host switches its custom fields off, so it // can still reach these settings. Its fields read as archived, and the server refuses a new // one with the host's sentence. diff --git a/apps/admin/src/settings/membership/checkout/collect-settings.tsx b/apps/admin/src/settings/membership/checkout/collect-settings.tsx index 22d0727f9c31..44c404cd4461 100644 --- a/apps/admin/src/settings/membership/checkout/collect-settings.tsx +++ b/apps/admin/src/settings/membership/checkout/collect-settings.tsx @@ -94,9 +94,16 @@ export const Destination: React.FC<{ chosen: Array; value: string | null; error?: string; + /** The name a field created here starts with. */ + suggestedName?: string; onChange: (key: string) => void; -}> = ({ label, type, fields, chosen, value, error, onChange }) => { +}> = ({ label, type, fields, chosen, value, error, suggestedName, onChange }) => { const creatableTypes = useCreatableMemberCustomFieldTypes(); + // Ghost refuses a name another field has, in any case, archived or not, so a taken name isn't + // suggested: the form starts empty instead of with a name that can't be saved. + const nameIsFree = + suggestedName !== undefined && + !fields.some((field) => field.name.toLowerCase() === suggestedName.toLowerCase()); return ( diff --git a/apps/admin/src/settings/membership/checkout/phone-settings.tsx b/apps/admin/src/settings/membership/checkout/phone-settings.tsx index 9d5d0b6fbf68..084ae6c125ef 100644 --- a/apps/admin/src/settings/membership/checkout/phone-settings.tsx +++ b/apps/admin/src/settings/membership/checkout/phone-settings.tsx @@ -35,6 +35,7 @@ const PhoneSettings: React.FC<{ error={errors.phoneField} fields={fields} label="Save phone as" + suggestedName="Phone" type={PORT_FIELD[CHECKOUT_PORT.phone].type} value={state.fieldKey} onChange={(fieldKey) => set({ fieldKey })} diff --git a/apps/admin/src/settings/membership/checkout/shipping-settings.tsx b/apps/admin/src/settings/membership/checkout/shipping-settings.tsx index 5f4929cb72fb..819e6fb5c383 100644 --- a/apps/admin/src/settings/membership/checkout/shipping-settings.tsx +++ b/apps/admin/src/settings/membership/checkout/shipping-settings.tsx @@ -92,6 +92,7 @@ const ShippingSettings: React.FC<{ error={errors.shippingAddressField} fields={fields} label="Save address as" + suggestedName="Shipping Address" type={PORT_FIELD[CHECKOUT_PORT.shippingAddress].type} value={state.addressFieldKey} onChange={(addressFieldKey) => set({ addressFieldKey })} @@ -101,6 +102,7 @@ const ShippingSettings: React.FC<{ error={errors.shippingNameField} fields={fields} label="Save name as" + suggestedName="Recipient Name" type={PORT_FIELD[CHECKOUT_PORT.shippingName].type} value={state.nameFieldKey} onChange={(nameFieldKey) => set({ nameFieldKey })} diff --git a/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx b/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx index 3d5ee2f59b19..b02fd05a6d5b 100644 --- a/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx +++ b/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx @@ -46,6 +46,8 @@ export interface CustomFieldPickerProps { * with, narrowed with `creatableTypesAmong`. Omit, or leave empty, to hide the create action. */ createTypes?: CreatableMemberCustomFieldTypes; + /** The name a field created from this picker starts with, when nothing was searched for. */ + suggestedName?: string; } /** @@ -68,6 +70,7 @@ export function CustomFieldPicker({ invalid, onChange, createTypes, + suggestedName, }: CustomFieldPickerProps) { const [open, setOpen] = useState(false); // What the create popover hangs from. @@ -203,10 +206,10 @@ export function CustomFieldPicker({ forceMount onSelect={() => { // The create popover takes over from the list, keeping what was - // searched for. + // searched for, or starting from the suggested name when nothing was. setCreateSession((session) => ({ id: session.id + 1, - initialName: search.trim(), + initialName: search.trim() || suggestedName || '', })); // The last form's refusal was about a name that has gone with it. resetCreate(); From 48f1d0045e62b819a23f8f484ac5107f1718437f Mon Sep 17 00:00:00 2001 From: Jonatan Svennberg Date: Thu, 12 Nov 2026 09:47:52 +0100 Subject: [PATCH 018/174] Added a type check that keeps app failure codes in step across Ghost (#32713) no ref Core, Admin and the app SDK each wrote the app failure codes out as plain strings, so changing one in one place could leave the others out of step with nothing failing. The codes now live in one list: - Core and the SDK can only use codes on it - Admin's install screen must handle every code on it - A Core test catches codes the type-check can't see Behaviour is unchanged. --- .../install-dialog/install-dialog.tsx | 14 +-- apps/admin/src/apps/lib/install-failure.ts | 112 +++++++++--------- .../services/app-installations/CONTEXT.md | 4 + .../app-installations-repository.ts | 3 +- .../services/app-installations/fetch-icon.ts | 3 +- .../app-installations/fetch-manifest.ts | 9 +- .../app-installations/identity-check.ts | 9 +- .../app-installations/load-manifest.ts | 11 +- .../services/app-installations/service.ts | 13 +- .../app-installations/failure-codes.test.ts | 36 ++++++ packages/app-contracts/src/failure-codes.ts | 65 ++++++++++ packages/app-contracts/src/identity/codes.ts | 10 +- packages/app-contracts/src/index.ts | 7 ++ .../app-contracts/test/failure-codes.test.ts | 16 +++ packages/app-contracts/test/index.test.ts | 4 + packages/app-sdk/src/tooling/sign.ts | 4 +- 16 files changed, 226 insertions(+), 94 deletions(-) create mode 100644 ghost/test/unit/server/services/app-installations/failure-codes.test.ts create mode 100644 packages/app-contracts/src/failure-codes.ts create mode 100644 packages/app-contracts/test/failure-codes.test.ts diff --git a/apps/admin/src/apps/components/install-dialog/install-dialog.tsx b/apps/admin/src/apps/components/install-dialog/install-dialog.tsx index 668d513f9ed7..9fc9e661dfcc 100644 --- a/apps/admin/src/apps/components/install-dialog/install-dialog.tsx +++ b/apps/admin/src/apps/components/install-dialog/install-dialog.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { Dialog, DialogContent } from '@tryghost/shade/components'; import { toast } from 'sonner'; +import { isOutdatedReviewCode } from '@tryghost/app-contracts'; import { useNavigate } from '@tryghost/admin-x-framework'; import type { AppInstallationPreview } from '@tryghost/admin-x-framework/api/app-installations'; import { AlreadyInstalled } from './already-installed'; @@ -81,20 +82,17 @@ export const InstallDialog: React.FC = ({ manifestUrl, onClo } catch (error) { const apiError = apiErrorOf(error); const code = apiError?.code; - if (code === 'APP_MANIFEST_CHANGED' || code === 'APP_INSTALLATION_CHANGED') { - // The app, or the site's installation of it, is no longer what was reviewed. Ghost - // answers with the review as it stands now when it has one; otherwise ask for it. + if (isOutdatedReviewCode(code)) { + // Only a changed manifest or installation can carry the current review; otherwise + // fetch it. setNotice(CHANGED); const details: unknown = apiError?.details; - if (isPreview(details)) { + const sendsReview = code === 'APP_MANIFEST_CHANGED' || code === 'APP_INSTALLATION_CHANGED'; + if (sendsReview && isPreview(details)) { replace(details); } else { await reload(); } - } else if (code === 'APP_ALREADY_INSTALLED' || code === 'APP_INSTALLATION_UNINSTALLED') { - // Installed, or uninstalled, under the publisher: a fresh review of where it stands. - setNotice(CHANGED); - await reload(); } else { setConfirmFailure(installFailureOf(error)); } diff --git a/apps/admin/src/apps/lib/install-failure.ts b/apps/admin/src/apps/lib/install-failure.ts index 980cbf68a086..75099b169fa8 100644 --- a/apps/admin/src/apps/lib/install-failure.ts +++ b/apps/admin/src/apps/lib/install-failure.ts @@ -1,4 +1,4 @@ -import { isUnconfirmedAppCode } from '@tryghost/app-contracts'; +import { type AppFailureCode, isAppFailureCode } from '@tryghost/app-contracts'; import { JSONError, getErrorMessage } from '@tryghost/admin-x-framework/errors'; /** Something the app's developer has to fix, with what Ghost said about it. */ @@ -47,63 +47,61 @@ function problemsOf(details: unknown): InstallProblem[] { }); } +/** Undefined leaves the screen to show Ghost's own message. */ +type Reading = (detail: string, details: unknown) => InstallFailure | undefined; + +const unreachable: Reading = (detail) => ({ kind: 'unreachable', detail }); +const unconfirmed: Reading = (detail) => ({ kind: 'unconfirmed', detail }); +const problem = + (title: string): Reading => + (detail) => ({ kind: 'problems', problems: [{ title, detail }] }); +const notExplained: Reading = () => undefined; + +/** Keyed by every code, so a new one fails the type-check until this screen decides on it. */ +const READINGS: Record = { + APP_MANIFEST_UNREACHABLE: unreachable, + APP_CHALLENGE_UNREACHABLE: unreachable, + + // The installed app came first, so the link is refused as another developer's, without + // details. A session shows it as unconfirmed. + APP_IDENTITY_MISMATCH: () => ({ kind: 'another-developer' }), + APP_MANIFEST_SIGNATURE_INVALID: unconfirmed, + APP_BACKEND_KEY_RETIRED: unconfirmed, + APP_CHALLENGE_FAILED: unconfirmed, + // Refused before the signature is checked, so it's a manifest problem for the developer. + // A session shows it as unconfirmed. + APP_MANIFEST_URL_MISMATCH: problem('The app’s details are for another install link'), + + APP_MANIFEST_UNSIGNED: problem('The app’s details aren’t signed'), + APP_MANIFEST_URL_INVALID: problem('The install link isn’t valid'), + APP_MANIFEST_REDIRECTED: problem('The app’s details redirect to another site'), + APP_MANIFEST_NOT_JSON: problem('The app’s details aren’t in the expected format'), + APP_MANIFEST_TOO_LARGE: problem('The app’s details are too large'), + APP_MANIFEST_OTHER_APP: problem('This install link is for a different app'), + APP_MANIFEST_INVALID: (detail, details) => { + const problems = problemsOf(details); + return { + kind: 'problems', + problems: problems.length ? problems : [{ title: 'The app’s details aren’t valid', detail }], + }; + }, + + // The install dialog handles these itself. + APP_MANIFEST_CHANGED: notExplained, + APP_INSTALLATION_CHANGED: notExplained, + APP_ALREADY_INSTALLED: notExplained, + APP_INSTALLATION_UNINSTALLED: notExplained, + // Never the answer to a review. + APP_NOT_INSTALLED: notExplained, + APP_UNAVAILABLE: notExplained, +}; + /** Turns an error from previewing, installing or approving into what the screen shows. */ export function installFailureOf(error: unknown): InstallFailure { const apiError = apiErrorOf(error); - const detail = apiError?.context ?? ''; - - switch (apiError?.code) { - case 'APP_MANIFEST_UNREACHABLE': - case 'APP_CHALLENGE_UNREACHABLE': - return { kind: 'unreachable', detail }; - case 'APP_IDENTITY_MISMATCH': - return { kind: 'another-developer' }; - case 'APP_MANIFEST_UNSIGNED': - return { - kind: 'problems', - problems: [{ title: 'The app’s details aren’t signed', detail }], - }; - case 'APP_MANIFEST_URL_MISMATCH': - return { - kind: 'problems', - problems: [{ title: 'The app’s details are for another install link', detail }], - }; - case 'APP_MANIFEST_URL_INVALID': - return { kind: 'problems', problems: [{ title: 'The install link isn’t valid', detail }] }; - case 'APP_MANIFEST_REDIRECTED': - return { - kind: 'problems', - problems: [{ title: 'The app’s details redirect to another site', detail }], - }; - case 'APP_MANIFEST_NOT_JSON': - return { - kind: 'problems', - problems: [{ title: 'The app’s details aren’t in the expected format', detail }], - }; - case 'APP_MANIFEST_TOO_LARGE': - return { - kind: 'problems', - problems: [{ title: 'The app’s details are too large', detail }], - }; - case 'APP_MANIFEST_OTHER_APP': - return { - kind: 'problems', - problems: [{ title: 'This install link is for a different app', detail }], - }; - case 'APP_MANIFEST_INVALID': { - const problems = problemsOf((apiError as { details?: unknown }).details); - return { - kind: 'problems', - problems: problems.length - ? problems - : [{ title: 'The app’s details aren’t valid', detail }], - }; - } - default: - // A bad signature, a failed challenge, or a backend key a newer manifest replaced. - if (isUnconfirmedAppCode(apiError?.code)) { - return { kind: 'unconfirmed', detail }; - } - return { kind: 'error', message: getErrorMessage(error, FALLBACK_MESSAGE) }; - } + const code = apiError?.code; + const failure = isAppFailureCode(code) + ? READINGS[code](apiError?.context ?? '', apiError?.details) + : undefined; + return failure ?? { kind: 'error', message: getErrorMessage(error, FALLBACK_MESSAGE) }; } diff --git a/ghost/core/server/services/app-installations/CONTEXT.md b/ghost/core/server/services/app-installations/CONTEXT.md index 031aa861b4e1..4b658c528289 100644 --- a/ghost/core/server/services/app-installations/CONTEXT.md +++ b/ghost/core/server/services/app-installations/CONTEXT.md @@ -21,6 +21,10 @@ changes are defined in [App Contracts](../../../../../packages/app-contracts/CON 4. **Uninstall.** The installation ends and is kept as a record. Installing the app again starts a new installation. +Admin can only explain a failure code that App Contracts' `APP_FAILURE_CODES` +lists, so each code thrown here `satisfies AppFailureCode`. A unit test catches +one thrown without it, and one the list keeps after nothing here throws it. + ## Language ### Installations diff --git a/ghost/core/server/services/app-installations/app-installations-repository.ts b/ghost/core/server/services/app-installations/app-installations-repository.ts index 706b01382e0f..9b5af6aace90 100644 --- a/ghost/core/server/services/app-installations/app-installations-repository.ts +++ b/ghost/core/server/services/app-installations/app-installations-repository.ts @@ -1,3 +1,4 @@ +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import ObjectId from 'bson-objectid'; import type { Knex } from 'knex'; @@ -150,7 +151,7 @@ class LockedInstallation { export function alreadyInstalled(appId: string) { return new errors.ConflictError({ message: `The app ${appId} is already installed.`, - code: 'APP_ALREADY_INSTALLED', + code: 'APP_ALREADY_INSTALLED' satisfies AppFailureCode, }); } diff --git a/ghost/core/server/services/app-installations/fetch-icon.ts b/ghost/core/server/services/app-installations/fetch-icon.ts index f2d5d5f6ebc5..b0b3f9d0ef44 100644 --- a/ghost/core/server/services/app-installations/fetch-icon.ts +++ b/ghost/core/server/services/app-installations/fetch-icon.ts @@ -1,3 +1,4 @@ +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import type { GhostLogger } from '@tryghost/logging'; import type { AppIcon } from '@tryghost/app-contracts/manifest'; @@ -18,7 +19,7 @@ export type FetchIcon = (icon: AppIcon) => Promise; function invalidIcon(message: string) { return new errors.ValidationError({ message: 'The app manifest is not valid.', - code: 'APP_MANIFEST_INVALID', + code: 'APP_MANIFEST_INVALID' satisfies AppFailureCode, context: `icon.url: ${message}`, errorDetails: [{ path: 'icon.url', message }], }); diff --git a/ghost/core/server/services/app-installations/fetch-manifest.ts b/ghost/core/server/services/app-installations/fetch-manifest.ts index 8c9cdb0c984a..e655a4062b86 100644 --- a/ghost/core/server/services/app-installations/fetch-manifest.ts +++ b/ghost/core/server/services/app-installations/fetch-manifest.ts @@ -3,6 +3,7 @@ import { SIGNED_MANIFEST_MAX_BYTES, parseJsonText, } from '@tryghost/app-contracts/identity'; +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import type { GhostLogger } from '@tryghost/logging'; import type { AppFetchFailure, FetchFromApp } from './fetch-from-app'; @@ -32,7 +33,7 @@ function unreachable( logging.warn(failure.reason === 'unreachable' ? failure.cause : context); return new errors.ValidationError({ message: 'Could not load the app’s manifest.', - code: 'APP_MANIFEST_UNREACHABLE', + code: 'APP_MANIFEST_UNREACHABLE' satisfies AppFailureCode, context, }); } @@ -50,7 +51,7 @@ function manifestError( case 'redirected': return new errors.ValidationError({ message: 'The app’s manifest redirects to another host.', - code: 'APP_MANIFEST_REDIRECTED', + code: 'APP_MANIFEST_REDIRECTED' satisfies AppFailureCode, context: `${manifestUrl} redirects to ${failure.host}`, }); case 'too_large': @@ -61,7 +62,7 @@ function manifestError( export function manifestTooLarge(manifestUrl: string): errors.ValidationError { return new errors.ValidationError({ message: `The app’s manifest is larger than ${MANIFEST_MAX_BYTES / 1024} KB.`, - code: 'APP_MANIFEST_TOO_LARGE', + code: 'APP_MANIFEST_TOO_LARGE' satisfies AppFailureCode, context: manifestUrl, }); } @@ -101,7 +102,7 @@ export function parseJson(text: string, manifestUrl: string): unknown { } catch { throw new errors.ValidationError({ message: 'The app’s manifest is not JSON.', - code: 'APP_MANIFEST_NOT_JSON', + code: 'APP_MANIFEST_NOT_JSON' satisfies AppFailureCode, context: manifestUrl, }); } diff --git a/ghost/core/server/services/app-installations/identity-check.ts b/ghost/core/server/services/app-installations/identity-check.ts index e557f6088afe..b3c9d5cd0cce 100644 --- a/ghost/core/server/services/app-installations/identity-check.ts +++ b/ghost/core/server/services/app-installations/identity-check.ts @@ -1,3 +1,4 @@ +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import type { GhostLogger } from '@tryghost/logging'; import { @@ -95,7 +96,7 @@ function challengeUnreachable( logging.warn(failure.reason === 'unreachable' ? failure.cause : context); return new errors.ValidationError({ message: 'Could not reach the app to confirm it comes from its developer.', - code: 'APP_CHALLENGE_UNREACHABLE', + code: 'APP_CHALLENGE_UNREACHABLE' satisfies AppFailureCode, context, }); } @@ -103,7 +104,7 @@ function challengeUnreachable( function challengeFailed(origin: string, why: string) { return new errors.ValidationError({ message: 'Ghost couldn’t confirm the app comes from its developer.', - code: 'APP_CHALLENGE_FAILED', + code: 'APP_CHALLENGE_FAILED' satisfies AppFailureCode, context: `${origin}: ${why}`, }); } @@ -177,13 +178,13 @@ export function createIdentityChecker({ // No detail: the publisher is told it isn't from the same developer, never about keys. throw new errors.ValidationError({ message: 'This app doesn’t come from the same developer as the installed one.', - code: 'APP_IDENTITY_MISMATCH', + code: 'APP_IDENTITY_MISMATCH' satisfies AppFailureCode, }); } if (pinned?.retiredBackendKeys.has(loaded.backendKeyThumbprint)) { throw new errors.ValidationError({ message: 'Ghost couldn’t confirm the app comes from its developer.', - code: 'APP_BACKEND_KEY_RETIRED', + code: 'APP_BACKEND_KEY_RETIRED' satisfies AppFailureCode, context: 'backend_key has been replaced, and can’t be used again', }); } diff --git a/ghost/core/server/services/app-installations/load-manifest.ts b/ghost/core/server/services/app-installations/load-manifest.ts index 6e7d1c920a9c..ad1e345ef0d4 100644 --- a/ghost/core/server/services/app-installations/load-manifest.ts +++ b/ghost/core/server/services/app-installations/load-manifest.ts @@ -1,4 +1,5 @@ import { createHash } from 'node:crypto'; +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import type { GhostLogger } from '@tryghost/logging'; import { z } from 'zod'; @@ -87,7 +88,7 @@ export function createManifestLoader({ if (!address.success) { throw new errors.ValidationError({ message: 'The app manifest URL is not valid.', - code: 'APP_MANIFEST_URL_INVALID', + code: 'APP_MANIFEST_URL_INVALID' satisfies AppFailureCode, context: address.error, }); } @@ -97,7 +98,7 @@ export function createManifestLoader({ if (!signed.success) { throw new errors.ValidationError({ message: 'The app’s manifest is not signed.', - code: 'APP_MANIFEST_UNSIGNED', + code: 'APP_MANIFEST_UNSIGNED' satisfies AppFailureCode, context: signed.error, }); } @@ -107,13 +108,13 @@ export function createManifestLoader({ if (parsed.reason === 'manifest_url_mismatch') { throw new errors.ValidationError({ message: 'The app’s manifest is for another address.', - code: 'APP_MANIFEST_URL_MISMATCH', + code: 'APP_MANIFEST_URL_MISMATCH' satisfies AppFailureCode, context, }); } throw new errors.ValidationError({ message: 'The app manifest is not valid.', - code: 'APP_MANIFEST_INVALID', + code: 'APP_MANIFEST_INVALID' satisfies AppFailureCode, context, // Each problem separately, so Admin can list them for the app's developer. errorDetails: parsed.errors, @@ -125,7 +126,7 @@ export function createManifestLoader({ if (!verified.success) { throw new errors.ValidationError({ message: 'The app’s manifest signature is not valid.', - code: 'APP_MANIFEST_SIGNATURE_INVALID', + code: 'APP_MANIFEST_SIGNATURE_INVALID' satisfies AppFailureCode, context: verified.error, }); } diff --git a/ghost/core/server/services/app-installations/service.ts b/ghost/core/server/services/app-installations/service.ts index 235c4e538201..7706e8606de0 100644 --- a/ghost/core/server/services/app-installations/service.ts +++ b/ghost/core/server/services/app-installations/service.ts @@ -1,3 +1,4 @@ +import type { AppFailureCode } from '@tryghost/app-contracts'; import errors from '@tryghost/errors'; import type { Knex } from 'knex'; import type { AppManifest } from '@tryghost/app-contracts/manifest'; @@ -76,7 +77,7 @@ function notFound() { function notInstalled() { return new errors.NotFoundError({ message: 'This app is not installed.', - code: 'APP_NOT_INSTALLED', + code: 'APP_NOT_INSTALLED' satisfies AppFailureCode, }); } @@ -84,7 +85,7 @@ function notInstalled() { function uninstalled() { return new errors.ConflictError({ message: 'This app has been uninstalled.', - code: 'APP_INSTALLATION_UNINSTALLED', + code: 'APP_INSTALLATION_UNINSTALLED' satisfies AppFailureCode, }); } @@ -114,7 +115,7 @@ interface CheckedManifest { function forAnotherApp(appId: string) { return new errors.ValidationError({ message: `The reviewed manifest is for ${appId}, not the app that is installed.`, - code: 'APP_MANIFEST_OTHER_APP', + code: 'APP_MANIFEST_OTHER_APP' satisfies AppFailureCode, }); } @@ -448,7 +449,7 @@ export class AppInstallationsService { if (loaded.digest !== digest) { throw new errors.ConflictError({ message: 'The app changed while it was being reviewed.', - code: 'APP_MANIFEST_CHANGED', + code: 'APP_MANIFEST_CHANGED' satisfies AppFailureCode, errorDetails: await this.previewOf(checked), }); } @@ -466,7 +467,7 @@ export class AppInstallationsService { } return new errors.ConflictError({ message: 'The installation changed while the app was being reviewed.', - code: 'APP_INSTALLATION_CHANGED', + code: 'APP_INSTALLATION_CHANGED' satisfies AppFailureCode, errorDetails: await this.previewOf({ ...checked, installation }), }); } @@ -566,7 +567,7 @@ export class AppInstallationsService { if (loaded.manifest.id !== before.app_id) { throw new errors.ValidationError({ message: `${before.manifest_url} now serves ${loaded.manifest.id}.`, - code: 'APP_MANIFEST_OTHER_APP', + code: 'APP_MANIFEST_OTHER_APP' satisfies AppFailureCode, }); } await this.identity.check(loaded, pinned, fetched.started); diff --git a/ghost/test/unit/server/services/app-installations/failure-codes.test.ts b/ghost/test/unit/server/services/app-installations/failure-codes.test.ts new file mode 100644 index 000000000000..11b154190a68 --- /dev/null +++ b/ghost/test/unit/server/services/app-installations/failure-codes.test.ts @@ -0,0 +1,36 @@ +import assert from 'node:assert/strict'; +import { readFileSync, readdirSync } from 'node:fs'; +import path from 'node:path'; +import ts from 'typescript'; +import { APP_FAILURE_CODES } from '@tryghost/app-contracts'; + +const serviceRoot = path.resolve( + __dirname, + '../../../../../core/server/services/app-installations', +); + +/** Every `'APP_…'` string in the service, parsed so that comments don't count. */ +function codesInService(): Set { + const codes = new Set(); + const files = readdirSync(serviceRoot, { recursive: true, encoding: 'utf8' }); + for (const file of files.filter((name) => name.endsWith('.ts') && !name.endsWith('.d.ts'))) { + const text = readFileSync(path.join(serviceRoot, file), 'utf8'); + const visit = (node: ts.Node) => { + if (ts.isStringLiteralLike(node) && /^APP_[A-Z_]+$/.test(node.text)) { + codes.add(node.text); + } + ts.forEachChild(node, visit); + }; + visit(ts.createSourceFile(file, text, ts.ScriptTarget.Latest)); + } + return codes; +} + +describe('app installation failure codes', function () { + it('match the codes app-contracts lists for Admin', function () { + const thrown = codesInService(); + // Thrown at boot, when the site's apps config is invalid, so it never reaches Admin. + assert.ok(thrown.delete('APP_CONFIG_INVALID')); + assert.deepEqual([...thrown].sort(), [...APP_FAILURE_CODES].sort()); + }); +}); diff --git a/packages/app-contracts/src/failure-codes.ts b/packages/app-contracts/src/failure-codes.ts new file mode 100644 index 000000000000..cea0b2b4381a --- /dev/null +++ b/packages/app-contracts/src/failure-codes.ts @@ -0,0 +1,65 @@ +import { UNCONFIRMED_APP_CODES } from './identity/codes.ts'; + +/** Trying again may work. */ +const UNREACHABLE_APP_CODES = [ + /** Also when the app answers with an error or a bad redirect. */ + 'APP_MANIFEST_UNREACHABLE', + 'APP_CHALLENGE_UNREACHABLE', +] as const; + +/** Only the app's developer can fix these. */ +const UNUSABLE_MANIFEST_CODES = [ + 'APP_MANIFEST_URL_INVALID', + /** To another host. */ + 'APP_MANIFEST_REDIRECTED', + /** The signed manifest is over what Ghost reads, or its manifest over what Ghost stores. */ + 'APP_MANIFEST_TOO_LARGE', + 'APP_MANIFEST_NOT_JSON', + 'APP_MANIFEST_UNSIGNED', + /** Also for an invalid icon. The details list each problem. */ + 'APP_MANIFEST_INVALID', + 'APP_MANIFEST_OTHER_APP', +] as const; + +/** + * The publisher confirmed a review that's out of date. A changed manifest or installation + * carries the current review in the error's details when Ghost has one. + */ +export const OUTDATED_REVIEW_CODES = [ + 'APP_MANIFEST_CHANGED', + 'APP_INSTALLATION_CHANGED', + 'APP_ALREADY_INSTALLED', + 'APP_INSTALLATION_UNINSTALLED', +] as const; + +/** + * Admin can only explain a code listed here; any other shows as an unknown error. A Ghost + * core test checks the list against the codes the app installations service throws. + */ +export const APP_FAILURE_CODES = [ + ...UNREACHABLE_APP_CODES, + ...UNCONFIRMED_APP_CODES, + ...UNUSABLE_MANIFEST_CODES, + ...OUTDATED_REVIEW_CODES, + /** Also once uninstalled. */ + 'APP_NOT_INSTALLED', + /** A session failed because of the app, for a reason with no code of its own. */ + 'APP_UNAVAILABLE', +] as const; + +export type AppFailureCode = (typeof APP_FAILURE_CODES)[number]; + +const FAILURE_CODES: ReadonlySet = new Set(APP_FAILURE_CODES); + +/** Unlike `code in table`, false for names every object has, such as `constructor`. */ +export function isAppFailureCode(code: unknown): code is AppFailureCode { + return FAILURE_CODES.has(code); +} + +const OUTDATED_REVIEW: ReadonlySet = new Set(OUTDATED_REVIEW_CODES); + +export function isOutdatedReviewCode( + code: unknown, +): code is (typeof OUTDATED_REVIEW_CODES)[number] { + return OUTDATED_REVIEW.has(code); +} diff --git a/packages/app-contracts/src/identity/codes.ts b/packages/app-contracts/src/identity/codes.ts index 7e46213c777c..a0f45c27381f 100644 --- a/packages/app-contracts/src/identity/codes.ts +++ b/packages/app-contracts/src/identity/codes.ts @@ -1,11 +1,7 @@ /** - * The codes Ghost fails with when it couldn't confirm an app is the one it says it is, - * whether reviewing an install link or starting a session. They're kept apart from the - * codes for an app that is down or broken, because the publisher should hear something - * different: contact the developer, and don't install it again from a link, which is the - * one way a different developer's key gets pinned. - * - * Free of jose and zod, so Admin reads it from the root entry point. + * Ghost couldn't confirm the app is the one it says it is. Kept apart from an app that's down + * or broken because the publisher should hear something different: contact the developer, and + * don't install it again from a link, the one way a different developer's key gets pinned. */ export const UNCONFIRMED_APP_CODES = [ /** The manifest names another address than the one it was fetched from. */ diff --git a/packages/app-contracts/src/index.ts b/packages/app-contracts/src/index.ts index 8283c3785ef2..c30796c91899 100644 --- a/packages/app-contracts/src/index.ts +++ b/packages/app-contracts/src/index.ts @@ -10,6 +10,13 @@ * that never validate anything. Validation lives in the contract's own entry point. */ +export { + APP_FAILURE_CODES, + OUTDATED_REVIEW_CODES, + isAppFailureCode, + isOutdatedReviewCode, + type AppFailureCode, +} from './failure-codes.ts'; export { UNCONFIRMED_APP_CODES, isUnconfirmedAppCode, diff --git a/packages/app-contracts/test/failure-codes.test.ts b/packages/app-contracts/test/failure-codes.test.ts new file mode 100644 index 000000000000..f203838c5b01 --- /dev/null +++ b/packages/app-contracts/test/failure-codes.test.ts @@ -0,0 +1,16 @@ +import { describe, expect, it } from 'vitest'; + +import { APP_FAILURE_CODES, isAppFailureCode, isOutdatedReviewCode } from '../src/index.ts'; + +describe('APP_FAILURE_CODES', () => { + it('puts each code in one set only', () => { + expect(new Set(APP_FAILURE_CODES).size).toBe(APP_FAILURE_CODES.length); + }); + + it('is safe to look codes up by, unlike names every object has', () => { + expect(isAppFailureCode('APP_NOT_INSTALLED')).toBe(true); + expect(isAppFailureCode('constructor')).toBe(false); + expect(isOutdatedReviewCode('APP_INSTALLATION_UNINSTALLED')).toBe(true); + expect(isOutdatedReviewCode('APP_MANIFEST_INVALID')).toBe(false); + }); +}); diff --git a/packages/app-contracts/test/index.test.ts b/packages/app-contracts/test/index.test.ts index 747141629e30..1f4f3d89c59c 100644 --- a/packages/app-contracts/test/index.test.ts +++ b/packages/app-contracts/test/index.test.ts @@ -30,6 +30,7 @@ describe('the root entry point', () => { it('exposes only what depends on nothing', () => { expect(Object.keys(root).sort()).toEqual([ 'APP_ERROR_CODES', + 'APP_FAILURE_CODES', 'APP_ID_MAX_LENGTH', 'ARGUMENT_MESSAGES', 'BRIDGE_ERROR_CODES', @@ -39,6 +40,7 @@ describe('the root entry point', () => { 'FETCH_RESPONSE_STATUS_MIN', 'HELLO_MESSAGE_TYPE', 'HOST_ERROR_CODES', + 'OUTDATED_REVIEW_CODES', 'START_TIMEOUT_MS', 'TITLE_MAX_LENGTH', 'UNCONFIRMED_APP_CODES', @@ -46,11 +48,13 @@ describe('the root entry point', () => { 'appPageUrl', 'decodeBridgeError', 'encodeBridgeError', + 'isAppFailureCode', 'isConnectMessage', 'isContainedPath', 'isFetchResponse', 'isGhostHost', 'isLocalhost', + 'isOutdatedReviewCode', 'isPlainText', 'isRecord', 'isReservedRequestHeader', diff --git a/packages/app-sdk/src/tooling/sign.ts b/packages/app-sdk/src/tooling/sign.ts index 4eafb0bb1446..82fa5970eaef 100644 --- a/packages/app-sdk/src/tooling/sign.ts +++ b/packages/app-sdk/src/tooling/sign.ts @@ -1,6 +1,7 @@ import { readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; +import type { AppFailureCode } from '@tryghost/app-contracts'; import { SIGNED_MANIFEST_MAX_BYTES, parseJsonText, @@ -56,7 +57,8 @@ export type SignResult = errors: ManifestError[]; }; -type Refusal = Extract; +// Never if a code here stops being one Ghost answers with, so `refuse` stops compiling. +type Refusal = Extract; const refuse = (code: Refusal['code'], message: string, path = ''): Refusal => ({ success: false, From e211338510d422ed1700fa0e663e8cc51f9a83a2 Mon Sep 17 00:00:00 2001 From: Renato Costa <130500381+renatoworks@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:20:36 +0200 Subject: [PATCH 019/174] Added archived badges to the checkout settings pickers (#32820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref https://linear.app/ghost/issue/DYA-247 Archiving a custom field doesn't change what checkout asks for. Stripe Checkout, and Portal when a member changes tier, keep asking, and Ghost drops the answers for the archived field. The "Save … as" pickers showed only the field's name, so a setting that no longer saved anything looked as if it worked. A chosen archived field now shows an "Archived" badge, on the picker and in its list. Archived tiers in the same settings were marked with "(archived)" in their names, so they now get the same badge, keeping one way of saying it on one screen. The closed "Collect for" picker is one line that's cut off when long, so it shows the chosen names with archived ones first and a single badge at the end that always shows: "Archived" for one tier, or how many of several are. The list marks which. Lists with nothing archived, such as the countries list, keep their default rows. An archived tier is still searched as "Name (archived)", so it's found by "archived" and told apart from an active tier with the same name, as before. --- .../checkout-fields.acceptance.test.tsx | 103 +++++++++++++++++- .../membership/checkout/collect-settings.tsx | 62 +++++++++-- apps/admin/src/shared/archived-badge.tsx | 16 +++ .../custom-field-picker.tsx | 3 + 4 files changed, 176 insertions(+), 8 deletions(-) create mode 100644 apps/admin/src/shared/archived-badge.tsx diff --git a/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx b/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx index 7dccaa1bb66d..023bf9e482c6 100644 --- a/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx +++ b/apps/admin/src/settings/membership/checkout/checkout-fields.acceptance.test.tsx @@ -50,9 +50,10 @@ async function openCheckoutFields( config: StripeCheckoutConfig, fields: Parameters[0] = [phoneField], hostSettings?: HostSettings, + tiers = [freeTier, paidTier], ) { fakeSettingsScreens(); - fakeTiers([freeTier, paidTier]); + fakeTiers(tiers); fakeMemberCustomFields(fields); fakeAdminEndpoint('GET', '/stripe/checkout/config/', { checkout_config: [config] }); fakeAdminEndpoint('GET', '/custom_theme_settings/', { custom_theme_settings: [] }); @@ -320,6 +321,91 @@ describe('Checkout settings', () => { await expect.element(form.getByLabelText('Name')).toHaveValue(''); }); + // Archiving a field doesn't stop checkout asking for it, only saving the answers, so a chosen + // field that's archived says so rather than looking as if it works. + describe('with a chosen field or tier archived', () => { + const legacyTier = tier({ id: '645453f4d254799990dd0e23', name: 'Legacy', active: false }); + + async function openWithPhone(tierIds: string[], tiers = [freeTier, paidTier, legacyTier]) { + return openCheckoutFields( + { + design: { customize: false }, + shipping: { collect: false }, + phone: { collect: true, tier_ids: tierIds, custom_field_key: 'contact_phone' }, + }, + [{ ...phoneField, status: 'archived' }], + undefined, + tiers, + ); + } + + it('marks the field as archived on the picker and in its list', async () => { + const { modal } = await openWithPhone([paidTier.id]); + + const field = modal.getByRole('combobox', { name: 'Save phone as' }); + await expect.element(field.getByText('Archived', { exact: true })).toBeVisible(); + await field.click(); + await expect + .element(page.getByRole('option', { name: 'Contact phone Archived', exact: true })) + .toBeVisible(); + }); + + // The chosen tiers are one line, cut off when long, so they share one badge at its end, + // which always shows, and the list marks which are archived. + it('marks archived tiers with one badge on the picker and their own in the list', async () => { + const { modal } = await openWithPhone([paidTier.id, legacyTier.id]); + + const tiers = modal.getByRole('combobox', { name: 'Collect for' }); + await expect.element(tiers.getByText('Legacy, Supporter', { exact: true })).toBeVisible(); + await expect.element(tiers.getByText('1 archived', { exact: true })).toBeVisible(); + await tiers.click(); + await expect + .element(page.getByRole('option', { name: 'Legacy Archived', exact: true })) + .toBeVisible(); + await expect + .element(page.getByRole('option', { name: 'Supporter', exact: true })) + .toBeVisible(); + + // Found by what it is, as it was when "(archived)" was part of its name. + await userEvent.fill(page.getByPlaceholder('Search tiers...'), 'archived'); + await expect + .element(page.getByRole('option', { name: 'Legacy Archived', exact: true })) + .toBeVisible(); + await expect + .element(page.getByRole('option', { name: 'Supporter', exact: true })) + .not.toBeInTheDocument(); + }); + + it('says only "Archived" when the one tier chosen is archived', async () => { + const { modal } = await openWithPhone([legacyTier.id]); + + const tiers = modal.getByRole('combobox', { name: 'Collect for' }); + await expect.element(tiers.getByText('Legacy', { exact: true })).toBeVisible(); + await expect.element(tiers.getByText('Archived', { exact: true })).toBeVisible(); + }); + + // A tier archived and replaced by one with the same name is a row of its own, which the + // keyboard can move past and pick. + it('tells an archived tier from an active one with the same name', async () => { + const newLegacy = tier({ id: '645453f4d254799990dd0e24', name: 'Legacy' }); + const { modal, saveApi } = await openWithPhone( + [legacyTier.id], + [freeTier, paidTier, legacyTier, newLegacy], + ); + + await modal.getByRole('combobox', { name: 'Collect for' }).click(); + await userEvent.fill(page.getByPlaceholder('Search tiers...'), 'Legacy'); + await userEvent.keyboard('{ArrowDown}{Enter}{Escape}'); + await modal.getByRole('button', { name: 'Save' }).click(); + + await expect + .poll(() => saveApi.lastRequest?.body) + .toMatchObject({ + checkout_config: [{ phone: { tier_ids: [legacyTier.id, newLegacy.id] } }], + }); + }); + }); + // A site keeps its Stripe connection when the host switches its custom fields off, so it // can still reach these settings. Its fields read as archived, and the server refuses a new // one with the host's sentence. @@ -646,6 +732,21 @@ describe('Checkout settings', () => { ); } + // Nothing chosen is archived, so nothing says so, and the countries list is searched as before. + it('shows no archived badge when nothing chosen is archived', async () => { + const { modal } = await openEverySetting(); + await expect.element(modal.getByText(/archived/i)).not.toBeInTheDocument(); + + await modal.getByRole('combobox', { name: 'Countries' }).click(); + await userEvent.fill(page.getByPlaceholder('Search countries...'), 'United St'); + await expect + .element(page.getByRole('option', { name: 'United States', exact: true })) + .toBeVisible(); + await expect + .element(page.getByRole('listbox').getByText(/archived/i)) + .not.toBeInTheDocument(); + }); + it("opens a setting's dropdown from the dropdown only, never from its name", async () => { const { modal } = await openEverySetting(); diff --git a/apps/admin/src/settings/membership/checkout/collect-settings.tsx b/apps/admin/src/settings/membership/checkout/collect-settings.tsx index 44c404cd4461..eb61724489d6 100644 --- a/apps/admin/src/settings/membership/checkout/collect-settings.tsx +++ b/apps/admin/src/settings/membership/checkout/collect-settings.tsx @@ -4,6 +4,8 @@ import { ComboboxContent, ComboboxTrigger, ComboboxValue, + CommandCheck, + CommandItem, Field, FieldContent, FieldError, @@ -12,6 +14,7 @@ import { MultiSelectCombobox, Switch, } from '@tryghost/shade/components'; +import { ArchivedBadge } from '@/shared/archived-badge'; import { CustomFieldPicker } from '@/shared/member-custom-fields/custom-field-picker'; import { type MemberCustomField, @@ -43,7 +46,8 @@ export const SubRow: React.FC<{ export const MultiPicker: React.FC<{ label: string; searchPlaceholder: string; - options: Array<{ value: string; label: string }>; + /** Each option, and whether it's archived, which shows as a badge on the picker and its row. */ + options: Array<{ value: string; label: string; archived?: boolean }>; values: string[]; /** Shown while nothing is chosen, as a placeholder. */ empty: string; @@ -54,6 +58,7 @@ export const MultiPicker: React.FC<{ }> = ({ label, searchPlaceholder, options, values, empty, summary, invalid, onChange }) => { const [open, setOpen] = useState(false); const chosen = options.filter((option) => values.includes(option.value)); + const chosenArchived = chosen.filter((option) => option.archived); const shown = summary ?? (chosen.length @@ -62,17 +67,63 @@ export const MultiPicker: React.FC<{ values.length ? `${values.length} unavailable` : empty); + // The list searches an archived option as "Name (archived)", as it was labelled before it had a + // badge, so it's still found that way and told apart from an active one with the same name. + const archived = new Set(options.filter((option) => option.archived).map(({ value }) => value)); + const names = new Map(options.map((option) => [option.value, option.label])); return ( // Modal, like a select, so clicking away only closes it. The rows sit close together, and the // click would otherwise go on to whatever it lands on, such as switching a part off. - {shown} + + {!summary && chosenArchived.length ? ( + // One line, cut off when long, with the archived options first, then one badge that + // always shows: "Archived" for a single choice, or how many of several are. The list + // says which. + + + {[...chosenArchived, ...chosen.filter((option) => !option.archived)] + .map((option) => option.label) + .join(', ')} + + + {chosen.length === 1 ? 'Archived' : `${chosenArchived.length} archived`} + + + ) : ( + shown + )} + + option.archived ? { ...option, label: `${option.label} (archived)` } : option, + ) + : options + } + // Its own row only where an option is archived, with the badge after the name; every + // other list keeps the default row. + renderItem={ + archived.size + ? ({ option, isSelected, onSelect }) => ( + + + {names.get(option.value)} + + {archived.has(option.value) && } + + + ) + : undefined + } values={values} onChange={onChange} onClose={() => setOpen(false)} @@ -168,10 +219,7 @@ export const CollectRow: React.FC<{ .filter( (tier) => tier.active || (!state.allTiers && state.tierIds.includes(tier.id)), ) - .map((tier) => ({ - value: tier.id, - label: tier.active ? tier.name : `${tier.name} (archived)`, - }))} + .map((tier) => ({ value: tier.id, label: tier.name, archived: !tier.active }))} searchPlaceholder="Search tiers..." summary={state.allTiers ? 'All paid tiers' : undefined} values={state.allTiers ? activeTierIds : state.tierIds} diff --git a/apps/admin/src/shared/archived-badge.tsx b/apps/admin/src/shared/archived-badge.tsx new file mode 100644 index 000000000000..5f241fb337a9 --- /dev/null +++ b/apps/admin/src/shared/archived-badge.tsx @@ -0,0 +1,16 @@ +import { Badge } from '@tryghost/shade/components'; + +/** + * Marks a chosen tier or custom field that has since been archived, beside its name, so a + * setting that still points at it doesn't look as if it works as before. Says "Archived" unless + * told otherwise, such as how many of several are. + */ +export function ArchivedBadge({ children = 'Archived' }: { children?: string }) { + return ( + // A span, as it sits inside buttons and list rows. It never shrinks: a name beside it is cut + // off first, so the badge always shows. + + {children} + + ); +} diff --git a/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx b/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx index b02fd05a6d5b..8ad4676779c0 100644 --- a/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx +++ b/apps/admin/src/shared/member-custom-fields/custom-field-picker.tsx @@ -1,3 +1,4 @@ +import { ArchivedBadge } from '@/shared/archived-badge'; import CustomFieldIcon from '@/shared/member-custom-fields/custom-field-icon'; import { Combobox, @@ -145,6 +146,7 @@ export function CustomFieldPicker({ {selected.name} + {selected.status === 'archived' && } ) : ( 'Select...' @@ -188,6 +190,7 @@ export function CustomFieldPicker({ > {field.name} + {field.status === 'archived' && } {value === field.key && } ))} From b394b1663a8b4806086b915de73a81234ce1c5ee Mon Sep 17 00:00:00 2001 From: Rob Lester Date: Wed, 11 Nov 2026 17:03:48 +0000 Subject: [PATCH 020/174] Added a span for each event Stripe sends to the webhook ref https://linear.app/ghost/issue/DYA-25 Whether Ghost handles what Stripe sends it could only be read from request lines, which are kept for 32 days and don't say which event failed, so a site whose webhook fails every event looked much like one with a blip. Each event Stripe sends now records a span with the event's type. The span fails when Ghost answers Stripe with a failure, including when the event's signature doesn't show that Stripe sent it, so the feature health dashboard can hold webhook handling to a target, per site, over a year. The failure is logged once, as the span's exception line, in place of the two lines the webhook logged itself. --- .../server/services/stripe/stripe-service.js | 1 + ghost/core/server/services/stripe/tracking.ts | 41 ++++++- .../services/stripe/webhook-controller.js | 111 +++++++++--------- ghost/test/e2e-api/members/webhooks.test.js | 79 +++++++++++++ .../stripe/webhook-controller.test.js | 10 ++ 5 files changed, 181 insertions(+), 61 deletions(-) diff --git a/ghost/core/server/services/stripe/stripe-service.js b/ghost/core/server/services/stripe/stripe-service.js index c286ec8acae6..45da49216116 100644 --- a/ghost/core/server/services/stripe/stripe-service.js +++ b/ghost/core/server/services/stripe/stripe-service.js @@ -154,6 +154,7 @@ module.exports = class StripeService { invoiceEventService, checkoutSessionEventService, chargeRefundedEventService, + tracking, }); this.models = models; diff --git a/ghost/core/server/services/stripe/tracking.ts b/ghost/core/server/services/stripe/tracking.ts index c36a705a9359..0ec65b6679de 100644 --- a/ghost/core/server/services/stripe/tracking.ts +++ b/ghost/core/server/services/stripe/tracking.ts @@ -10,13 +10,15 @@ import { type Refusal, } from './checkout-session-params'; -// The spans and counts that record how buyers' Stripe Checkouts go. Their names and attributes are -// defined here, in one place, because the Stripe Checkout dashboard in TryGhost/k8s queries them -// by name: renaming one or an attribute breaks the dashboard until it's changed to match. +// The spans and counts that record how buyers' Stripe Checkouts go, and how Ghost handles what +// Stripe sends it. Their names and attributes are defined here, in one place, because the Stripe +// Checkout dashboard in TryGhost/k8s queries them by name: renaming one or an attribute breaks the +// dashboard until it's changed to match. // -// Two parts of Ghost record the spans. The members API's router records a -// `stripe_checkout.start` span for each checkout a buyer starts, and `StripeAPI` records a -// `stripe_checkout.session` span for each Checkout session it asks Stripe to create. Neither +// Several parts of Ghost record the spans. The members API's router records a +// `stripe_checkout.start` span for each checkout a buyer starts, `StripeAPI` records a +// `stripe_checkout.session` span for each Checkout session it asks Stripe to create, and the +// webhook controller records a `stripe.webhook` span for each event Stripe sends. None of them // touches its span. Each is handed an attempt object and reports to it what happened, in terms of // the checkout, and the functions below decide how each report is recorded on the span. The // checkout webhook counts each phone number a completed checkout collects, as @@ -53,6 +55,14 @@ interface CheckoutSessionAttempt { */ type PartOutcome = 'applied' | 'none' | 'refused' | 'dropped'; +/** What the webhook controller reports to a `stripe.webhook` span while it handles an event. */ +interface WebhookAttempt { + /** Called once Ghost has checked the event came from Stripe, with its type, such as `invoice.payment_succeeded`. */ + receiving(type: string): void; + /** Called when Ghost ignores the event, as it's for a customer whose events Ghost is set to ignore. */ + ignoring(): void; +} + /** * What became of the phone number a completed checkout collected: * @@ -97,6 +107,25 @@ export function stripeTracking({ tracer, meter }: { tracer: Tracer; meter: Meter ); }, + /** + * Records one `stripe.webhook` span for each event Stripe sends to Ghost's webhook, from the + * webhook starting on the request to Ghost answering Stripe. The span fails when Ghost answers + * with a failure, which makes Stripe send the event again later, including when the event's + * signature doesn't show it came from Stripe, as an `UnauthorizedError`. A request with no + * body or no signature at all isn't from Stripe, so it records no span. + * + * The `type` attribute holds the event's type, such as `checkout.session.completed`, and + * `ignored` is true for an event Ghost is set to ignore. + */ + webhook(handle: (attempt: WebhookAttempt) => Promise): Promise { + return tracer.track('stripe.webhook', (span) => + handle({ + receiving: (type) => span.setAttribute('type', type), + ignoring: () => span.setAttribute('ignored', true), + }), + ); + }, + /** * Records one `stripe_checkout.session` span for each Checkout session Ghost asks Stripe to * create for a buyer, with one attribute per part of the checkout saying what happened to diff --git a/ghost/core/server/services/stripe/webhook-controller.js b/ghost/core/server/services/stripe/webhook-controller.js index fa0793ea01d4..33cc6e004763 100644 --- a/ghost/core/server/services/stripe/webhook-controller.js +++ b/ghost/core/server/services/stripe/webhook-controller.js @@ -1,3 +1,4 @@ +const errors = require('@tryghost/errors'); const logging = require('@tryghost/logging'); const StripeAPI = require('./stripe-api'); @@ -9,8 +10,10 @@ module.exports = class WebhookController { * @param {import('./services/webhook/subscription-event-service')} deps.subscriptionEventService * @param {import('./services/webhook/invoice-event-service')} deps.invoiceEventService * @param {import('./services/webhook/charge-refunded-event-service')} deps.chargeRefundedEventService + * @param {Pick} deps.tracking */ constructor(deps) { + this.tracking = deps.tracking; this.checkoutSessionEventService = deps.checkoutSessionEventService; this.subscriptionEventService = deps.subscriptionEventService; this.invoiceEventService = deps.invoiceEventService; @@ -81,65 +84,63 @@ module.exports = class WebhookController { res.writeHead(400); return res.end(); } - let event; try { - event = this.webhookManager.parseWebhook(req.body, req.headers['stripe-signature']); - } catch (err) { - logging.error({ event: { name: 'stripe.webhook.signature_invalid' }, err }); - res.writeHead(401); - return res.end(); - } - - // Stripe shapes each event for the API version of the URL it was sent to. A different - // version means this event did not come through the URL Ghost registered, and fields - // may not be where Ghost reads them. - if (event.api_version !== StripeAPI.API_VERSION) { - logging.error( - { - event: { name: 'stripe.webhook.api_version_mismatch' }, - stripe_event_type: event.type, - api_version: event.api_version, - expected_api_version: StripeAPI.API_VERSION, - }, - 'Stripe sent a webhook rendered at a different API version than Ghost expects', - ); - } - - const customerId = this.getEventCustomerId(event); - if (this.shouldIgnoreEvent(event, customerId)) { - logging.info( - { - event: { name: 'stripe.webhook.ignored' }, - stripe_event_type: event.type, - customer_id: customerId, - }, - 'Ignored a Stripe webhook for a customer on stripeWebhookCustomerIgnoreList', - ); - - res.writeHead(200); - return res.end(); - } - - logging.info( - { - event: { name: 'stripe.webhook.received' }, - stripe_event_type: event.type, - stripe_event_id: event.id, - }, - 'Handling a Stripe webhook', - ); - - try { - await this.handleEvent(event); + await this.tracking.webhook(async (attempt) => { + let event; + try { + event = this.webhookManager.parseWebhook(req.body, req.headers['stripe-signature']); + } catch (err) { + throw new errors.UnauthorizedError({ + err, + message: "The webhook's signature doesn't show that Stripe sent it to this site.", + }); + } + attempt.receiving(event.type); + + // Stripe shapes each event for the API version of the URL it was sent to. A different + // version means this event did not come through the URL Ghost registered, and fields + // may not be where Ghost reads them. + if (event.api_version !== StripeAPI.API_VERSION) { + logging.error( + { + event: { name: 'stripe.webhook.api_version_mismatch' }, + stripe_event_type: event.type, + api_version: event.api_version, + expected_api_version: StripeAPI.API_VERSION, + }, + 'Stripe sent a webhook rendered at a different API version than Ghost expects', + ); + } + + const customerId = this.getEventCustomerId(event); + if (this.shouldIgnoreEvent(event, customerId)) { + attempt.ignoring(); + logging.info( + { + event: { name: 'stripe.webhook.ignored' }, + stripe_event_type: event.type, + customer_id: customerId, + }, + 'Ignored a Stripe webhook for a customer on stripeWebhookCustomerIgnoreList', + ); + return; + } + + logging.info( + { + event: { name: 'stripe.webhook.received' }, + stripe_event_type: event.type, + stripe_event_id: event.id, + }, + 'Handling a Stripe webhook', + ); + + await this.handleEvent(event); + }); res.writeHead(200); res.end(); } catch (err) { - logging.error({ - event: { name: 'stripe.webhook.handle_failed' }, - err, - stripe_event_type: event.type, - stripe_event_id: event.id, - }); + // The span has logged the error. Stripe sends the event again later. res.writeHead(err.statusCode || 500); res.end(); } diff --git a/ghost/test/e2e-api/members/webhooks.test.js b/ghost/test/e2e-api/members/webhooks.test.js index 173b91b59b99..e5cd2a74123c 100644 --- a/ghost/test/e2e-api/members/webhooks.test.js +++ b/ghost/test/e2e-api/members/webhooks.test.js @@ -46,6 +46,18 @@ const sinon = require('sinon'); let membersAgent; let adminAgent; +/** + * Each span recorded under `name`, as its outcome, the type of its error when it failed, and its + * attributes. + */ +function spansOf(metrics, name) { + return metrics.tracked(name).map(({ event, error, labels }) => ({ + outcome: event.outcome, + ...(error ? { error: error.type } : {}), + ...labels, + })); +} + function createStripeID(prefix) { return `${prefix}_${crypto.randomBytes(16).toString('hex')}`; } @@ -262,6 +274,73 @@ describe('Members API', function () { .expectStatus(401); }); + it('records a webhook whose signature does not show it came from Stripe as unauthorised', async function () { + const metrics = mockManager.mockMetrics(); + + await membersAgent + .post('/webhooks/stripe/') + .body({ fake: 'data' }) + .header('stripe-signature', 'dodgy') + .expectStatus(401); + + assert.deepEqual(spansOf(metrics, 'stripe.webhook'), [ + { outcome: 'failure', error: 'UnauthorizedError' }, + ]); + }); + + it('records an event it ignores, for a customer whose events it is set to ignore', async function () { + const stripeService = require('../../../core/server/services/stripe'); + stripeService.webhookController.configure({ webhookCustomerIgnoreList: ['cus_ignored'] }); + try { + const metrics = mockManager.mockMetrics(); + const webhookPayload = JSON.stringify({ + type: 'customer.subscription.updated', + data: { object: { id: 'sub_ignored', customer: 'cus_ignored' } }, + }); + + await membersAgent + .post('/webhooks/stripe/') + .body(webhookPayload) + .header('content-type', 'application/json') + .header( + 'stripe-signature', + stripe.webhooks.generateTestHeaderString({ + payload: webhookPayload, + secret: process.env.WEBHOOK_SECRET, + }), + ) + .expectStatus(200); + + assert.deepEqual(spansOf(metrics, 'stripe.webhook'), [ + { outcome: 'success', type: 'customer.subscription.updated', ignored: true }, + ]); + } finally { + stripeService.webhookController.configure({}); + } + }); + + it('records each event it handles by its type', async function () { + const metrics = mockManager.mockMetrics(); + const webhookPayload = JSON.stringify({ type: 'unknown', data: { id: 'id_123' } }); + + await membersAgent + .post('/webhooks/stripe/') + .body(webhookPayload) + .header('content-type', 'application/json') + .header( + 'stripe-signature', + stripe.webhooks.generateTestHeaderString({ + payload: webhookPayload, + secret: process.env.WEBHOOK_SECRET, + }), + ) + .expectStatus(200); + + assert.deepEqual(spansOf(metrics, 'stripe.webhook'), [ + { outcome: 'success', type: 'unknown' }, + ]); + }); + it('Responds with a 200 to unknown events with valid signature', async function () { const webhookPayload = JSON.stringify({ type: 'unknown', diff --git a/ghost/test/unit/server/services/stripe/webhook-controller.test.js b/ghost/test/unit/server/services/stripe/webhook-controller.test.js index f2b1406c7e55..7a221fe72172 100644 --- a/ghost/test/unit/server/services/stripe/webhook-controller.test.js +++ b/ghost/test/unit/server/services/stripe/webhook-controller.test.js @@ -1,6 +1,15 @@ const sinon = require('sinon'); const logging = require('@tryghost/logging'); const WebhookController = require('../../../../../core/server/services/stripe/webhook-controller'); +const { createTracer } = require('../../../../../core/server/lib/tracing/create-tracer'); +const { createMeter } = require('../../../../../core/server/lib/tracing/create-meter'); +const { stripeTracking } = require('../../../../../core/server/services/stripe/tracking'); + +const shipNothing = { transport: { metric: async () => null }, logging: { error() {} } }; +const tracking = stripeTracking({ + tracer: createTracer(shipNothing), + meter: createMeter(shipNothing), +}); describe('WebhookController', function () { let controller; @@ -15,6 +24,7 @@ describe('WebhookController', function () { checkoutSessionEventService: { handleEvent: sinon.stub(), handleDonationEvent: sinon.stub() }, chargeRefundedEventService: { handleEvent: sinon.stub() }, webhookManager: { parseWebhook: sinon.stub() }, + tracking, }; controller = new WebhookController(deps); From da3f52582929f2bc72f3ed396547c1072fc15a2a Mon Sep 17 00:00:00 2001 From: Rob Lester Date: Wed, 11 Nov 2026 17:04:23 +0000 Subject: [PATCH 021/174] Added who the buyer is and what was saved to the checkout spans ref https://linear.app/ghost/issue/DYA-25 A checkout that asks for a shipping address or phone number could only say whether Stripe was asked, never whether what the buyer typed reached the member, so a buyer could pay and leave the publisher without an address they needed and nobody would know. Each checkout a buyer completes now records a span saying what became of each part it asked for: saved, partly saved, refused by its field, left with nowhere to go, skipped because the buyer didn't prove they were the member, or failed. Both the start and the completion of a checkout say who the buyer is to the site, a new member, a member who signed in or a member only by the email typed in, so started checkouts can be set against completed ones for each, and the dashboards can tell free members upgrading apart from new signups. --- .../controllers/router-controller.js | 1 + .../webhook/checkout-session-event-service.js | 58 +++--- ghost/core/server/services/stripe/tracking.ts | 169 +++++++++++++++++- .../members/checkout-session-outcomes.test.ts | 54 ++++++ ghost/test/e2e-api/members/webhooks.test.js | 151 +++++++++++++++- .../server/services/donations/index.test.ts | 8 + .../checkout-session-event-service.test.js | 45 +++-- 7 files changed, 441 insertions(+), 45 deletions(-) diff --git a/ghost/core/server/services/members/members-api/controllers/router-controller.js b/ghost/core/server/services/members/members-api/controllers/router-controller.js index 049d00eb1b3d..5f6468062aba 100644 --- a/ghost/core/server/services/members/members-api/controllers/router-controller.js +++ b/ghost/core/server/services/members/members-api/controllers/router-controller.js @@ -827,6 +827,7 @@ module.exports = class RouterController { ); } } + attempt.buying({ existing: Boolean(member), verified: isAuthenticated }); await this._setAttributionMetadata(metadata); diff --git a/ghost/core/server/services/stripe/services/webhook/checkout-session-event-service.js b/ghost/core/server/services/stripe/services/webhook/checkout-session-event-service.js index b0d8ded7d7f3..77487e1c5d54 100644 --- a/ghost/core/server/services/stripe/services/webhook/checkout-session-event-service.js +++ b/ghost/core/server/services/stripe/services/webhook/checkout-session-event-service.js @@ -9,6 +9,7 @@ const { CHECKOUT_PORT } = require('@tryghost/checkout'); const { collectedFrom } = require('../checkout/completed-session'); const { COLLECTION_FLAG } = require('../../../stripe-checkout-config/models'); /** @typedef {import('../../../../lib/member-signup-contexts').SignupContext} SignupContext */ +/** @typedef {import('../../tracking').CheckoutCompletionAttempt} CheckoutCompletionAttempt */ function isStripeMetadataTrue(value) { return value === true || value === 'true'; @@ -121,7 +122,7 @@ module.exports = class CheckoutSessionEventService { /** * @param {object} deps * @param {import('../../stripe-api')} deps.api - * @param {Pick} deps.tracking + * @param {Pick} deps.tracking * @param {object} deps.memberRepository * @param {object} deps.donationRepository * @param {object} deps.giftService @@ -144,28 +145,32 @@ module.exports = class CheckoutSessionEventService { * @param {import('stripe').Stripe.Event.Type} [eventType] */ async handleEvent(session, eventType = 'checkout.session.completed') { - if (eventType === 'checkout.session.async_payment_failed') { - return; - } + return this.deps.tracking.checkoutCompletion(async (attempt) => { + if (eventType === 'checkout.session.async_payment_failed') { + return; + } - if (eventType === 'checkout.session.async_payment_succeeded') { - if (session.mode === 'payment' && isGiftCheckoutSession(session)) { - await this.handlePaymentEvent(session); + if (eventType === 'checkout.session.async_payment_succeeded') { + if (session.mode === 'payment' && isGiftCheckoutSession(session)) { + await this.handlePaymentEvent(session, attempt); + } + return; } - return; - } - if (session.mode === 'setup') { - await this.handleSetupEvent(session); - } + if (session.mode === 'setup') { + attempt.completing('setup'); + await this.handleSetupEvent(session); + } - if (session.mode === 'subscription') { - await this.handleSubscriptionEvent(session); - } + if (session.mode === 'subscription') { + attempt.completing('subscription'); + await this.handleSubscriptionEvent(session, attempt); + } - if (session.mode === 'payment') { - await this.handlePaymentEvent(session); - } + if (session.mode === 'payment') { + await this.handlePaymentEvent(session, attempt); + } + }); } /** @@ -174,8 +179,9 @@ module.exports = class CheckoutSessionEventService { * session as paid, whichever event carried it. * * @param {import('stripe').Stripe.Checkout.Session} session + * @param {CheckoutCompletionAttempt} attempt */ - async handlePaymentEvent(session) { + async handlePaymentEvent(session, attempt) { if (hasConflictingCheckoutFlowMetadata(session)) { logging.warn( { @@ -191,11 +197,13 @@ module.exports = class CheckoutSessionEventService { if (session.payment_status !== 'paid') { return; } + attempt.completing('gift'); await this.handleGiftEvent(session); return; } if (isDonationCheckoutSession(session)) { + attempt.completing('donation'); await this.handleDonationEvent(session); } } @@ -376,8 +384,9 @@ module.exports = class CheckoutSessionEventService { /** * Handles a `checkout.session.completed` event for a subscription * @param {import('stripe').Stripe.Checkout.Session} session + * @param {CheckoutCompletionAttempt} attempt */ - async handleSubscriptionEvent(session) { + async handleSubscriptionEvent(session, attempt) { const customer = await this.api.getCustomer(session.customer, { expand: ['subscriptions.data.default_payment_method'], }); @@ -399,6 +408,7 @@ module.exports = class CheckoutSessionEventService { const canUpdateMember = !memberPreexisted || session.metadata?.ghostSignupContext === SIGNUP_CONTEXTS.ALREADY_AUTHENTICATED; + attempt.buying({ existing: memberPreexisted, verified: canUpdateMember }); if (!member) { const metadataName = _.get(session, 'metadata.name'); @@ -496,6 +506,7 @@ module.exports = class CheckoutSessionEventService { await this.saveCollected(member.id, session, { canUpdateMember, wallet: walletOf(customer, session), + attempt, }); if (checkoutType !== 'upgrade') { @@ -527,8 +538,9 @@ module.exports = class CheckoutSessionEventService { * @param {object} options * @param {boolean} options.canUpdateMember Whether this checkout may write to the member's record * @param {import('../../tracking').CheckoutWallet} options.wallet The wallet the buyer paid with + * @param {CheckoutCompletionAttempt} options.attempt */ - async saveCollected(memberId, session, { canUpdateMember, wallet }) { + async saveCollected(memberId, session, { canUpdateMember, wallet, attempt }) { try { if (!this.deps.labs.isSet(COLLECTION_FLAG)) { return; @@ -537,6 +549,7 @@ module.exports = class CheckoutSessionEventService { if (collected.length === 0) { return; } + attempt.collecting(collected); // Counted so how often a wallet's number needs a country to be read, and what then becomes // of it, can be watched. /** @param {import('../../tracking').CollectedPhoneOutcome} outcome */ @@ -547,6 +560,7 @@ module.exports = class CheckoutSessionEventService { }; if (!canUpdateMember) { + attempt.skipping(); logging.warn( { event: { name: 'stripe_checkout.collection.save_skipped' }, @@ -564,6 +578,7 @@ module.exports = class CheckoutSessionEventService { const { plans, refused, kept } = await this.deps.metafieldBindings.planThrough(collected, { type: 'binding', }); + attempt.saving({ kept, refused }); if (plans.length > 0) { // Through the members service, like any other edit, so the change reaches webhooks. await this.deps.memberBREADService.updateWithMetafields({}, { id: memberId }, plans); @@ -593,6 +608,7 @@ module.exports = class CheckoutSessionEventService { } countPhone(phoneOutcome(kept, refused)); } catch (err) { + attempt.failing(); logging.error( { event: { name: 'stripe_checkout.collection.save_failed' }, diff --git a/ghost/core/server/services/stripe/tracking.ts b/ghost/core/server/services/stripe/tracking.ts index 0ec65b6679de..ea13555ba930 100644 --- a/ghost/core/server/services/stripe/tracking.ts +++ b/ghost/core/server/services/stripe/tracking.ts @@ -1,6 +1,8 @@ import type Stripe from 'stripe'; +import { COLLECTED_PARTS, portsOf, type CollectedPart } from '@tryghost/checkout'; import type { Meter } from '../../lib/tracing/meter'; import type { Tracer } from '../../lib/tracing/tracer'; +import { SECTION_OF } from '../stripe-checkout-config/models'; import type { CollectedPhone } from './services/checkout/completed-session'; import { CHECKOUT_PARTS, @@ -16,20 +18,53 @@ import { // dashboard until it's changed to match. // // Several parts of Ghost record the spans. The members API's router records a -// `stripe_checkout.start` span for each checkout a buyer starts, `StripeAPI` records a -// `stripe_checkout.session` span for each Checkout session it asks Stripe to create, and the -// webhook controller records a `stripe.webhook` span for each event Stripe sends. None of them +// `stripe_checkout.start` span for each checkout a buyer starts, and `StripeAPI` records a +// `stripe_checkout.session` span for each Checkout session it asks Stripe to create. The webhook +// controller records a `stripe.webhook` span for each event Stripe sends, and the checkout webhook +// records a `stripe_checkout.complete` span for each checkout a buyer completes. None of them // touches its span. Each is handed an attempt object and reports to it what happened, in terms of // the checkout, and the functions below decide how each report is recorded on the span. The -// checkout webhook counts each phone number a completed checkout collects, as +// checkout webhook also counts each phone number a completed checkout collects, as // `stripe_checkout.collected_phones`. type CheckoutType = 'subscription' | 'donation' | 'gift'; +/** + * A completed checkout's kind: one a buyer starts, or `setup`, which saves a member's new card for + * their subscription. + */ +type CompletedCheckoutType = CheckoutType | 'setup'; + +/** What a checkout knows of its buyer: whether they're already a member, and whether they proved it. */ +interface BuyerReport { + existing: boolean; + verified: boolean; +} + +/** + * Who a checkout's buyer is to the site: + * + * - `new`: not a member yet. + * - `signed_in`: a member who signed in before starting the checkout, such as a free member + * upgrading. + * - `unverified`: a member by the email address typed into the checkout, which doesn't prove the + * buyer owns it, so the checkout can't change the member's details. + */ +type Buyer = 'new' | 'signed_in' | 'unverified'; + +function buyerOf({ existing, verified }: BuyerReport): Buyer { + if (!existing) { + return 'new'; + } + return verified ? 'signed_in' : 'unverified'; +} + /** What the members API reports to a `stripe_checkout.start` span while it starts a checkout. */ interface CheckoutAttempt { /** Called once the members API knows Ghost offers the kind of checkout the buyer asked for. */ starting(type: CheckoutType): void; + /** Called once the members API has looked the buyer up. */ + buying(buyer: BuyerReport): void; } /** What `StripeAPI` reports to a `stripe_checkout.session` span while it creates a session. */ @@ -55,6 +90,49 @@ interface CheckoutSessionAttempt { */ type PartOutcome = 'applied' | 'none' | 'refused' | 'dropped'; +/** + * What became of what a completed checkout asked the buyer for, one collected part at a time: + * + * - `none`: the checkout didn't ask for the part, or Ghost doesn't save what checkouts collect. + * - `saved`: each of the part's answers was saved into its custom field. + * - `partly_saved`: some of the part's answers were saved, and the rest had no field to go to. + * - `no_destination`: none of the part's answers had a field to go to, as collection was switched + * off, or the part's fields archived or deleted, while the checkout was open. + * - `refused`: a custom field refused one of the part's answers, such as a wallet's phone number + * that no country the checkout knew could read. + * - `skipped`: Ghost saved nothing the checkout collected, as it couldn't tell the buyer was the + * member it would have saved onto. + * - `failed`: saving what the checkout collected failed. + */ +type CollectedPartOutcome = + | 'none' + | 'saved' + | 'partly_saved' + | 'no_destination' + | 'refused' + | 'skipped' + | 'failed'; + +/** What the checkout webhook reports to a `stripe_checkout.complete` span while it completes one. */ +export interface CheckoutCompletionAttempt { + /** Called once the webhook knows which kind of checkout completed. */ + completing(type: CompletedCheckoutType): void; + /** Called once the webhook has looked the buyer up. */ + buying(buyer: BuyerReport): void; + /** Called with what the checkout asked the buyer for and got back, by port, before any is saved. */ + collecting(answers: readonly { port: string }[]): void; + /** Called when Ghost saves nothing the checkout collected, as the buyer didn't prove who they are. */ + skipping(): void; + /** + * Called once Ghost has worked out what it can save of what the checkout collected: `kept` are + * the ports with a custom field to go to, and `refused` what those fields refused, each named by + * its port or a part of the port's value, such as `checkout.shipping.address.country`. + */ + saving(plan: { kept: ReadonlySet; refused: readonly { property: string }[] }): void; + /** Called when saving what the checkout collected fails. */ + failing(): void; +} + /** What the webhook controller reports to a `stripe.webhook` span while it handles an event. */ interface WebhookAttempt { /** Called once Ghost has checked the event came from Stripe, with its type, such as `invoice.payment_succeeded`. */ @@ -63,6 +141,29 @@ interface WebhookAttempt { ignoring(): void; } +/** A collected part's name on a span, the same name the `stripe_checkout.session` span gives it. */ +const collectedPartName = (part: CollectedPart) => partName(SECTION_OF[part]); + +/** + * What became of a part's answers, from the ports Ghost had answers for, the ports with a field to + * go to, and what those fields refused. + */ +function collectedOutcome( + ports: readonly string[], + { kept, refused }: { kept: ReadonlySet; refused: readonly { property: string }[] }, +): CollectedPartOutcome { + const refusedFor = (port: string) => + refused.some(({ property }) => property === port || property.startsWith(`${port}.`)); + if (ports.some(refusedFor)) { + return 'refused'; + } + const saved = ports.filter((port) => kept.has(port)).length; + if (saved === ports.length) { + return 'saved'; + } + return saved === 0 ? 'no_destination' : 'partly_saved'; +} + /** * What became of the phone number a completed checkout collected: * @@ -99,14 +200,70 @@ export function stripeTracking({ tracer, meter }: { tracer: Tracer; meter: Meter * When Ghost refuses the request, the span fails with the refusal's error type, such as * `BadRequestError` for a tier that doesn't exist, so the dashboard can count refusals * separately from failures. The `type` attribute holds the kind of checkout. A request for a - * kind Ghost doesn't offer is refused before `type` is set, so its span has no `type`. + * kind Ghost doesn't offer is refused before `type` is set, so its span has no `type`. The + * `member` attribute says who the buyer is to the site (see `Buyer`), so subscription + * checkouts started can be set against those completed, for each kind of buyer. */ checkout(start: (attempt: CheckoutAttempt) => Promise): Promise { return tracer.track('stripe_checkout.start', (span) => - start({ starting: (type) => span.setAttribute('type', type) }), + start({ + starting: (type) => span.setAttribute('type', type), + buying: (buyer) => span.setAttribute('member', buyerOf(buyer)), + }), ); }, + /** + * Records one `stripe_checkout.complete` span for each checkout event Stripe sends Ghost, from + * the webhook starting on the event to Ghost having done everything a completed checkout asks + * of it, such as making the buyer a paid member. The span fails when that fails, which fails + * the webhook, so Stripe sends the event again later. + * + * The `type` attribute holds the kind of checkout once Ghost completes it. An event that + * completes nothing has no `type`, such as a failed asynchronous payment, or a gift whose + * payment hasn't arrived yet, which gets a span with `type` when it does. So completed + * checkouts are the spans with a `type`. The `member` attribute says who the buyer is to the + * site (see `Buyer`), for a subscription. + * + * Each collected part has an attribute saying what became of what the checkout asked for (see + * `CollectedPartOutcome`). Saving what a checkout collected never fails the span: the money is + * already taken, so a failed save is recorded on the part rather than sending the event again. + * A completion that fails before Ghost reads what the checkout collected leaves every part + * `none`. + */ + checkoutCompletion( + complete: (attempt: CheckoutCompletionAttempt) => Promise, + ): Promise { + return tracer.track('stripe_checkout.complete', (span) => { + const record = (part: CollectedPart, outcome: CollectedPartOutcome) => + span.setAttribute(collectedPartName(part), outcome); + for (const part of COLLECTED_PARTS) { + record(part, 'none'); + } + // The ports each part had answers for, once the checkout says what it collected. + let asked: [CollectedPart, string[]][] = []; + return complete({ + completing: (type) => span.setAttribute('type', type), + buying: (buyer) => span.setAttribute('member', buyerOf(buyer)), + collecting(answers) { + asked = COLLECTED_PARTS.map((part): [CollectedPart, string[]] => [ + part, + portsOf(part).filter((port) => answers.some((answer) => answer.port === port)), + ]).filter(([, ports]) => ports.length > 0); + }, + skipping() { + asked.forEach(([part]) => record(part, 'skipped')); + }, + saving(plan) { + asked.forEach(([part, ports]) => record(part, collectedOutcome(ports, plan))); + }, + failing() { + asked.forEach(([part]) => record(part, 'failed')); + }, + }); + }); + }, + /** * Records one `stripe.webhook` span for each event Stripe sends to Ghost's webhook, from the * webhook starting on the request to Ghost answering Stripe. The span fails when Ghost answers diff --git a/ghost/test/e2e-api/members/checkout-session-outcomes.test.ts b/ghost/test/e2e-api/members/checkout-session-outcomes.test.ts index 5b321b217761..68fb8890c566 100644 --- a/ghost/test/e2e-api/members/checkout-session-outcomes.test.ts +++ b/ghost/test/e2e-api/members/checkout-session-outcomes.test.ts @@ -116,6 +116,60 @@ describe('Checkout session outcomes', function () { ]); }); + it('records who the buyer of each checkout is to the site', async function () { + const membersService = require('../../../core/server/services/members'); + const member = await models.Member.findOne({ email: 'member1@test.com' }); + const identity = await membersService.api.getMemberIdentityToken(member.get('transient_id')); + for (const buyer of [{}, { identity }, { customerEmail: 'member1@test.com' }]) { + await membersAgent + .post('/api/create-stripe-checkout-session/') + .body({ tierId: paidTierId, cadence: 'month', ...buyer }) + .expectStatus(200); + } + + expect(checkouts()).toMatchObject([ + { event: { outcome: 'success' }, labels: { member: 'new' } }, + { event: { outcome: 'success' }, labels: { member: 'signed_in' } }, + { event: { outcome: 'success' }, labels: { member: 'unverified' } }, + ]); + }); + + it('records each checkout event by the kind of checkout it completes, and none when it completes nothing', async function () { + mockManager.mockMail(); + const payment = (metadata: Record, paymentStatus = 'paid') => ({ + mode: 'payment', + payment_status: paymentStatus, + amount_total: 500, + currency: 'usd', + customer: null, + customer_details: { name: 'A reader', email: 'reader@example.com' }, + metadata, + }); + + await stripeMocker.sendWebhook({ + type: 'checkout.session.completed', + data: { object: payment({ ghost_donation: true }) }, + }); + // A gift paid with a method that settles later completes once Stripe says it has + await stripeMocker.sendWebhook({ + type: 'checkout.session.completed', + data: { object: payment({ ghost_gift: true }, 'unpaid') }, + }); + await stripeMocker.sendWebhook({ + type: 'checkout.session.async_payment_failed', + data: { object: payment({ ghost_gift: true }, 'unpaid') }, + }); + + assert.deepEqual( + metrics.tracked('stripe_checkout.complete').map(({ labels }) => labels), + [ + { type: 'donation', shipping: 'none', phone: 'none' }, + { shipping: 'none', phone: 'none' }, + { shipping: 'none', phone: 'none' }, + ], + ); + }); + it('records a checkout Ghost refused under its refusal, with no session', async function () { await membersAgent .post('/api/create-stripe-checkout-session/') diff --git a/ghost/test/e2e-api/members/webhooks.test.js b/ghost/test/e2e-api/members/webhooks.test.js index e5cd2a74123c..c5abe7081608 100644 --- a/ghost/test/e2e-api/members/webhooks.test.js +++ b/ghost/test/e2e-api/members/webhooks.test.js @@ -4647,6 +4647,8 @@ describe('Members API', function () { billingCountry = 'GB', // The wallet the buyer paid with, as Stripe names it, if they paid with one. wallet = undefined, + // What Ghost answers Stripe with. Nothing is read back from a failed checkout. + status = 200, } = {}, ) { const walletMethod = wallet && { @@ -4692,8 +4694,11 @@ describe('Members API', function () { 'stripe-signature', stripe.webhooks.generateTestHeaderString({ payload, secret: process.env.WEBHOOK_SECRET }), ) - .expectStatus(200); + .expectStatus(status); await DomainEvents.allSettled(); + if (status !== 200) { + return undefined; + } const { body: { members }, @@ -4717,6 +4722,150 @@ describe('Members API', function () { }); }); + it('records what became of each part each completed checkout asked for', async function () { + const metrics = mockManager.mockMetrics(); + + await completeCheckout('complete-both@example.com', { + asked: { shipping: true, phone: true }, + }); + // Longer than the recipient's short text field takes. + await completeCheckout('complete-refused@example.com', { name: 'x'.repeat(300) }); + await completeCheckout('complete-unasked@example.com', { asked: {} }); + + assert.deepEqual(spansOf(metrics, 'stripe_checkout.complete'), [ + { + outcome: 'success', + type: 'subscription', + member: 'new', + shipping: 'saved', + phone: 'saved', + }, + { + outcome: 'success', + type: 'subscription', + member: 'new', + shipping: 'refused', + phone: 'none', + }, + { + outcome: 'success', + type: 'subscription', + member: 'new', + shipping: 'none', + phone: 'none', + }, + ]); + }); + + it('records a part as partly saved, or with nowhere to go, while its fields are archived', async function () { + for (const key of ['recipient_name', 'contact_phone']) { + await adminAgent + .put(`/members/metafields/custom/${key}/`) + .body({ members_metafields: [{ status: 'archived' }] }) + .expectStatus(200); + } + const metrics = mockManager.mockMetrics(); + + await completeCheckout('complete-archived@example.com', { + asked: { shipping: true, phone: true }, + }); + + assert.deepEqual(spansOf(metrics, 'stripe_checkout.complete'), [ + { + outcome: 'success', + type: 'subscription', + member: 'new', + shipping: 'partly_saved', + phone: 'no_destination', + }, + ]); + }); + + it('records what it skipped for a member who checked out without signing in', async function () { + await adminAgent + .post('/members/') + .body({ members: [{ email: 'complete-unverified@example.com' }] }) + .expectStatus(201); + await adminAgent + .post('/members/') + .body({ members: [{ email: 'complete-signed-in@example.com' }] }) + .expectStatus(201); + const metrics = mockManager.mockMetrics(); + + // Both checkouts started after their member already existed. + const startedAt = Math.floor(Date.now() / 1000) + 1; + await completeCheckout('complete-unverified@example.com', { created: startedAt }); + await completeCheckout('complete-signed-in@example.com', { + created: startedAt, + metadata: { ghostSignupContext: 'already_authenticated' }, + }); + + assert.deepEqual(spansOf(metrics, 'stripe_checkout.complete'), [ + { + outcome: 'success', + type: 'subscription', + member: 'unverified', + shipping: 'skipped', + phone: 'none', + }, + { + outcome: 'success', + type: 'subscription', + member: 'signed_in', + shipping: 'saved', + phone: 'none', + }, + ]); + }); + + it('records what it failed to save, while the checkout itself completes', async function () { + const membersService = require('../../../core/server/services/members'); + // Nothing a checkout can send fails the save, so the member edit that saves what it + // collected fails here as a database write would. + sinon + .stub(membersService.api.memberBREADService, 'updateWithMetafields') + .rejects(new Error('The database went away.')); + const metrics = mockManager.mockMetrics(); + + await completeCheckout('complete-save-failed@example.com', { + asked: { shipping: true, phone: true }, + }); + + assert.deepEqual(spansOf(metrics, 'stripe_checkout.complete'), [ + { + outcome: 'success', + type: 'subscription', + member: 'new', + shipping: 'failed', + phone: 'failed', + }, + ]); + }); + + it('records a checkout it failed to complete, as it fails the webhook for Stripe to send again', async function () { + const membersService = require('../../../core/server/services/members'); + sinon + .stub(membersService.api.members, 'create') + .rejects(new Error('The database went away.')); + const metrics = mockManager.mockMetrics(); + + await completeCheckout('complete-failed@example.com', { status: 500 }); + + assert.deepEqual(spansOf(metrics, 'stripe_checkout.complete'), [ + { + outcome: 'failure', + error: 'Error', + type: 'subscription', + member: 'new', + shipping: 'none', + phone: 'none', + }, + ]); + assert.deepEqual(spansOf(metrics, 'stripe.webhook'), [ + { outcome: 'failure', error: 'Error', type: 'checkout.session.completed' }, + ]); + }); + // How often a wallet's number needs a country to be read, whether the checkout knew one, and // what became of it, never with the number itself. it("counts how a checkout's phone number came back and what became of it", async function () { diff --git a/ghost/test/unit/server/services/donations/index.test.ts b/ghost/test/unit/server/services/donations/index.test.ts index 75d8ed6ca8a7..0fb5bb42a1c7 100644 --- a/ghost/test/unit/server/services/donations/index.test.ts +++ b/ghost/test/unit/server/services/donations/index.test.ts @@ -7,6 +7,9 @@ import type { DonationPaymentEvent } from '../../../../../core/server/services/d // Keep the real CommonJS identities used by the factory and Stripe's composition. const models = require('../../../../../core/server/models'); const StripeService = require('../../../../../core/server/services/stripe/stripe-service'); +const { createTracer } = require('../../../../../core/server/lib/tracing/create-tracer'); +const { createMeter } = require('../../../../../core/server/lib/tracing/create-meter'); +const { stripeTracking } = require('../../../../../core/server/services/stripe/tracking'); const labs = require('../../../../../core/shared/labs'); const settingsCache = require('../../../../../core/shared/settings-cache'); const ROOT_PATH = require.resolve('../../../../../core/server/services/donations'); @@ -48,8 +51,13 @@ describe('donations root with its Stripe consumer', function () { // Boot constructs Stripe before initializing donations. The consumer must // look up the repository later, when the checkout webhook arrives. + const shipNothing = { transport: { metric: async () => null }, logging: { error() {} } }; stripe = new StripeService({ labs, + tracking: stripeTracking({ + tracer: createTracer(shipNothing), + meter: createMeter(shipNothing), + }), settingsCache, models, donationService: root, diff --git a/ghost/test/unit/server/services/stripe/services/webhooks/checkout-session-event-service.test.js b/ghost/test/unit/server/services/stripe/services/webhooks/checkout-session-event-service.test.js index 66577cbd5dd6..97cd431401e1 100644 --- a/ghost/test/unit/server/services/stripe/services/webhooks/checkout-session-event-service.test.js +++ b/ghost/test/unit/server/services/stripe/services/webhooks/checkout-session-event-service.test.js @@ -3,6 +3,15 @@ const errors = require('@tryghost/errors'); const sinon = require('sinon'); const CheckoutSessionEventService = require('../../../../../../../core/server/services/stripe/services/webhook/checkout-session-event-service'); +const { createTracer } = require('../../../../../../../core/server/lib/tracing/create-tracer'); +const { createMeter } = require('../../../../../../../core/server/lib/tracing/create-meter'); +const { stripeTracking } = require('../../../../../../../core/server/services/stripe/tracking'); + +const shipNothing = { transport: { metric: async () => null }, logging: { error() {} } }; +const tracking = stripeTracking({ + tracer: createTracer(shipNothing), + meter: createMeter(shipNothing), +}); describe('CheckoutSessionEventService', function () { let api, @@ -52,6 +61,7 @@ describe('CheckoutSessionEventService', function () { function createService(deps = {}) { return new CheckoutSessionEventService({ api, + tracking, memberRepository, donationRepository, giftService, @@ -945,7 +955,7 @@ describe('CheckoutSessionEventService', function () { }); }); - describe('handleSubscriptionEvent', function () { + describe('handleEvent for a subscription', function () { let service; let session; let customer; @@ -954,6 +964,7 @@ describe('CheckoutSessionEventService', function () { beforeEach(function () { service = createService(); session = { + mode: 'subscription', customer: 'cust_123', metadata: { name: 'Metadata Name', @@ -993,7 +1004,7 @@ describe('CheckoutSessionEventService', function () { api.getCustomer.resolves(customer); memberRepository.get.resolves(member); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledWith(api.getCustomer, 'cust_123', { expand: ['subscriptions.data.default_payment_method'], @@ -1005,7 +1016,7 @@ describe('CheckoutSessionEventService', function () { api.getCustomer.resolves(customer); memberRepository.get.resolves(null); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(memberRepository.create); const memberData = memberRepository.create.getCall(0).args[0]; @@ -1029,7 +1040,7 @@ describe('CheckoutSessionEventService', function () { memberRepository.get.resolves(null); session.metadata.name = 'Session Name'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(memberRepository.create); const memberData = memberRepository.create.getCall(0).args[0]; @@ -1046,7 +1057,7 @@ describe('CheckoutSessionEventService', function () { memberRepository.get.resolves(null); session.metadata.newsletters = 'invalid'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); const memberData = memberRepository.create.getCall(0).args[0]; assert.equal(memberData.email, 'customer@example.com'); @@ -1061,7 +1072,7 @@ describe('CheckoutSessionEventService', function () { // change member name customer.subscriptions.data[0].default_payment_method.billing_details.name = 'New Customer Name'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(memberRepository.update); const memberData = memberRepository.update.getCall(0).args[0]; @@ -1076,7 +1087,7 @@ describe('CheckoutSessionEventService', function () { // change member name customer.subscriptions.data[0].default_payment_method.billing_details.name = 'New Customer Name'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(memberRepository.update); const memberData = memberRepository.update.getCall(0).args[0]; @@ -1091,7 +1102,7 @@ describe('CheckoutSessionEventService', function () { // change member name customer.subscriptions.data[0].default_payment_method.billing_details.name = 'New Customer Name'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(memberRepository.update); const memberData = memberRepository.update.getCall(0).args[0]; @@ -1103,7 +1114,7 @@ describe('CheckoutSessionEventService', function () { memberRepository.get.resolves(member); session.metadata.ghostSignupContext = 'needs_magic_link_email'; - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.notCalled(memberRepository.update); sinon.assert.calledOnce(memberRepository.linkSubscription); @@ -1117,7 +1128,7 @@ describe('CheckoutSessionEventService', function () { member.get.withArgs('id').returns('member_123'); memberRepository.get.resolves(member); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnceWithExactly( memberRepository.update, @@ -1133,7 +1144,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'needs_magic_link_email'; isPaidWelcomeEmailActive.resolves(true); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(sendSignupEmail); sinon.assert.calledWith(sendSignupEmail, 'customer@example.com'); @@ -1146,7 +1157,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'has_precheckout_magic_link'; isPaidWelcomeEmailActive.resolves(false); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(sendSignupEmail); sinon.assert.calledWith(sendSignupEmail, 'customer@example.com'); @@ -1158,7 +1169,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'has_precheckout_magic_link'; isPaidWelcomeEmailActive.resolves(true); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.notCalled(sendSignupEmail); }); @@ -1169,7 +1180,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'already_authenticated'; isPaidWelcomeEmailActive.resolves(false); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(sendSignupEmail); sinon.assert.calledWith(sendSignupEmail, 'customer@example.com'); @@ -1181,7 +1192,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'already_authenticated'; isPaidWelcomeEmailActive.resolves(true); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.notCalled(sendSignupEmail); }); @@ -1192,7 +1203,7 @@ describe('CheckoutSessionEventService', function () { delete session.metadata.ghostSignupContext; isPaidWelcomeEmailActive.resolves(true); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.calledOnce(sendSignupEmail); sinon.assert.calledWith(sendSignupEmail, 'customer@example.com'); @@ -1206,7 +1217,7 @@ describe('CheckoutSessionEventService', function () { session.metadata.ghostSignupContext = 'has_precheckout_magic_link'; isPaidWelcomeEmailActive.resolves(false); - await service.handleSubscriptionEvent(session); + await service.handleEvent(session); sinon.assert.notCalled(sendSignupEmail); }); From b6524711c5548dc8e2443d2d0fba9b611c43a6ec Mon Sep 17 00:00:00 2001 From: Rob Lester Date: Wed, 11 Nov 2026 17:04:34 +0000 Subject: [PATCH 022/174] Added a span for each change of tier a member makes ref https://linear.app/ghost/issue/DYA-25 A member moving onto a tier that requires a shipping address or phone number is asked for them in Portal, and nothing recorded whether they answered, whether their answers were refused, or whether they were saved, so the team couldn't tell how often the requirements were met. Each change of plan to a tier through the members API now records a span saying whether answers came with it and, for each requirement of the new tier, whether its answers were saved, partly saved, left out, dropped for an archived field, or lost when saving failed after the tier changed, the way a completed checkout records what it asked for. A change refused for its answers fails the span, so refusals can be counted separately from changes that went through. --- .../services/members/account-service.ts | 3 + ghost/core/server/services/members/api.js | 2 + .../controllers/member-controller.js | 70 ++++++------ .../members/members-api/members-api.js | 2 + .../core/server/services/members/tracking.ts | 102 ++++++++++++++++++ .../e2e-api/members/member-answers.test.ts | 81 ++++++++++++++ .../controllers/member-controller.test.ts | 13 +++ 7 files changed, 241 insertions(+), 32 deletions(-) create mode 100644 ghost/core/server/services/members/tracking.ts diff --git a/ghost/core/server/services/members/account-service.ts b/ghost/core/server/services/members/account-service.ts index 11e6f46e7c45..51e7376bc23c 100644 --- a/ghost/core/server/services/members/account-service.ts +++ b/ghost/core/server/services/members/account-service.ts @@ -13,6 +13,7 @@ import { import { parseRequest } from '../../lib/parse-request'; import { COLLECTION_FLAG } from '../stripe-checkout-config/models'; import type { TierRequirement, TierRequirements } from '../tiers/requirements'; +import type { TierChangeAttempt } from './tracking'; /** * A member's own account: what they are shown about themselves, and what they may @@ -178,6 +179,7 @@ export class MemberAccountService { given: unknown, memberId: string, tier: { id: string; type: string }, + attempt: Pick, ): Promise { if (!this.#labs.isSet(COLLECTION_FLAG)) { return []; @@ -191,6 +193,7 @@ export class MemberAccountService { .map((port) => ({ port, value: answers[port] })), { type: 'member', id: memberId }, ); + attempt.answering({ required, answers, kept }); // Every refusal at once, each named as the request named the answer. Where a field refuses a // value a rule here also refuses, such as a country that isn't a code at all, the field's own diff --git a/ghost/core/server/services/members/api.js b/ghost/core/server/services/members/api.js index 511de22e0a31..93ee91ce2f65 100644 --- a/ghost/core/server/services/members/api.js +++ b/ghost/core/server/services/members/api.js @@ -29,6 +29,7 @@ const { t } = require('../../../shared/i18n'); const sentry = require('../../../shared/sentry'); const { tracer, meter } = require('../../lib/tracing'); const { stripeTracking } = require('../stripe/tracking'); +const { membersTracking } = require('./tracking'); const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000; const MAGIC_LINK_TOKEN_VALIDITY_AFTER_USAGE = 10 * 60 * 1000; @@ -297,6 +298,7 @@ function createApiInstance(config) { // initCore, so its guarded service is ready when the members API is built. checkouts: stripeCheckoutConfig.service.checkouts, tracking: stripeTracking({ tracer, meter }), + membersTracking: membersTracking({ tracer }), }); return membersApiInstance; diff --git a/ghost/core/server/services/members/members-api/controllers/member-controller.js b/ghost/core/server/services/members/members-api/controllers/member-controller.js index 9ef4ac88a83d..2a3f79159d7c 100644 --- a/ghost/core/server/services/members/members-api/controllers/member-controller.js +++ b/ghost/core/server/services/members/members-api/controllers/member-controller.js @@ -27,6 +27,7 @@ module.exports = class MemberController { * @param {any} deps.sendEmailWithMagicLink * @param {any} deps.settingsCache * @param {Pick} deps.account + * @param {Pick} deps.tracking */ constructor({ memberRepository, @@ -38,8 +39,10 @@ module.exports = class MemberController { sendEmailWithMagicLink, settingsCache, account, + tracking, }) { this._account = account; + this._tracking = tracking; this._memberRepository = memberRepository; this._productRepository = productRepository; this._paymentsService = paymentsService; @@ -277,40 +280,43 @@ module.exports = class MemberController { * @param {unknown} change.answers */ async _changePlan({ email, subscriptionId, tier, price, answers }) { - const changing = () => - this._memberRepository.updateSubscription({ + return this._tracking.tierChange({ answered: answers !== undefined }, async (attempt) => { + const changing = () => + this._memberRepository.updateSubscription({ + email, + subscription: { subscription_id: subscriptionId, price }, + }); + if (answers === undefined) { + return changing(); + } + + // The member's own subscription, or nothing is checked or saved: the change below would + // refuse anyone else's, and answers are only ever saved with a change. + const subscription = await this._memberRepository.getSubscription({ email, - subscription: { subscription_id: subscriptionId, price }, + subscription: { subscription_id: subscriptionId }, }); - if (answers === undefined) { - return changing(); - } - - // The member's own subscription, or nothing is checked or saved: the change below would - // refuse anyone else's, and answers are only ever saved with a change. - const subscription = await this._memberRepository.getSubscription({ - email, - subscription: { subscription_id: subscriptionId }, - }); - const [current, member] = await Promise.all([ - // `plan` is how a subscription names the Stripe price it's on. - this._productRepository.get({ stripe_price_id: subscription.plan.id }), - this._memberRepository.get({ email }), - ]); - const plans = - current?.id === tier.id - ? [] - : await this._account.planAnswers(answers, member.id, tier).catch((err) => { - throw err instanceof errors.ValidationError ? new AnswersRefused(err) : err; - }); - - await changing(); - await this._account.saveAnswers(member.id, plans).catch((err) => { - logging.error({ - event: { name: 'members.tier_change.answers_not_saved' }, - err, - member_id: member.id, - subscription_id: subscriptionId, + const [current, member] = await Promise.all([ + // `plan` is how a subscription names the Stripe price it's on. + this._productRepository.get({ stripe_price_id: subscription.plan.id }), + this._memberRepository.get({ email }), + ]); + const plans = + current?.id === tier.id + ? [] + : await this._account.planAnswers(answers, member.id, tier, attempt).catch((err) => { + throw err instanceof errors.ValidationError ? new AnswersRefused(err) : err; + }); + + await changing(); + await this._account.saveAnswers(member.id, plans).catch((err) => { + attempt.answersNotSaved(); + logging.error({ + event: { name: 'members.tier_change.answers_not_saved' }, + err, + member_id: member.id, + subscription_id: subscriptionId, + }); }); }); } diff --git a/ghost/core/server/services/members/members-api/members-api.js b/ghost/core/server/services/members/members-api/members-api.js index 98d61ba81ed4..383f1988eca8 100644 --- a/ghost/core/server/services/members/members-api/members-api.js +++ b/ghost/core/server/services/members/members-api/members-api.js @@ -77,6 +77,7 @@ module.exports = function MembersAPI({ tierRequirements, checkouts, tracking, + membersTracking, }) { const tokenService = new TokenService({ signingKeys, @@ -209,6 +210,7 @@ module.exports = function MembersAPI({ sendEmailWithMagicLink, settingsCache, account, + tracking: membersTracking, }); const routerController = new RouterController({ diff --git a/ghost/core/server/services/members/tracking.ts b/ghost/core/server/services/members/tracking.ts new file mode 100644 index 000000000000..c823b493157d --- /dev/null +++ b/ghost/core/server/services/members/tracking.ts @@ -0,0 +1,102 @@ +import { portsOf, type RequirementName } from '@tryghost/checkout'; +import type { Tracer } from '../../lib/tracing/tracer'; + +// The span a member's change of tier records. Its name and attributes are defined here, in one +// place, because the Stripe Checkout dashboard in TryGhost/k8s queries them by name: renaming one +// or an attribute breaks the dashboard until it's changed to match. The members API's member +// controller records the span, and reports to an attempt object what happened, in terms of the +// change, and the function below decides how each report is recorded on the span. + +/** + * What became of the answers a member gave to one requirement of the tier they changed to, the + * same way a completed checkout records what became of what it asked for: + * + * - `none`: they gave no answer to it, as a client may not know of the requirement. + * - `dropped`: none of its answers has a custom field to go to, as each one's field is archived. + * - `given`: its answers were given, and the change went no further, as it was refused, such as + * for an address outside the countries the tier ships to, or it failed. + * - `saved`: its answers were saved once the tier changed. + * - `partly_saved`: some of its answers were saved once the tier changed, and the rest had no + * field to go to. + * - `failed`: the tier changed, but saving its answers failed. + */ +type RequirementOutcome = 'none' | 'dropped' | 'given' | 'saved' | 'partly_saved' | 'failed'; + +/** What the members API reports to a `members.tier_change` span while a member changes tier. */ +export interface TierChangeAttempt { + /** + * Called once the answers are worked out, before the tier changes, with the requirements of the + * tier the member is changing to, the answers they gave by port, and the ports with a custom + * field to go to. + */ + answering(planned: { + required: readonly { name: RequirementName }[]; + answers: Readonly>>; + kept: ReadonlySet; + }): void; + /** Called when the tier changed but saving the answers failed. */ + answersNotSaved(): void; +} + +export type MembersTracking = ReturnType; + +export function membersTracking({ tracer }: { tracer: Tracer }) { + return { + /** + * Records one `members.tier_change` span for each change of a member's plan to a price of a + * tier through the members API, such as a member moving to another tier in Portal, from the + * change starting to the member's subscription being on the new price and their answers + * saved. A change that keeps the tier, such as one of billing period, is recorded too. + * + * The `answers` attribute is `given` when the change carried answers to what the tier + * requires, as Portal sends them, and `none` when it didn't, as a client that doesn't know of + * requirements changes tier without them. When answers come with a change onto another tier + * while checkouts collect answers, each requirement of the new tier has an attribute, named as + * the requirement, such as `shipping`, saying what became of its answers (see + * `RequirementOutcome`). A change without answers, one that keeps the tier, or one while + * checkouts don't collect answers, has none. The span fails with `AnswersRefused` when the + * change is refused for its answers, which leaves the member on their plan to correct them. + */ + tierChange( + { answered }: { answered: boolean }, + change: (attempt: TierChangeAttempt) => Promise, + ): Promise { + return tracer.track('members.tier_change', async (span) => { + const record = (name: RequirementName, outcome: RequirementOutcome) => + span.setAttribute(name, outcome); + span.setAttribute('answers', answered ? 'given' : 'none'); + // The requirements whose answers are saved once the tier changes, each with whether only + // some of them have a field to go to. + const saving: { name: RequirementName; partly: boolean }[] = []; + let notSaved = false; + const result = await change({ + answering({ required, answers, kept }) { + for (const { name } of required) { + const given = portsOf(name).filter((port) => Object.hasOwn(answers, port)); + const keptOf = given.filter((port) => kept.has(port)); + if (given.length === 0) { + record(name, 'none'); + } else if (keptOf.length === 0) { + record(name, 'dropped'); + } else { + record(name, 'given'); + saving.push({ name, partly: keptOf.length < given.length }); + } + } + }, + answersNotSaved() { + notSaved = true; + }, + }); + for (const { name, partly } of saving) { + if (notSaved) { + record(name, 'failed'); + } else { + record(name, partly ? 'partly_saved' : 'saved'); + } + } + return result; + }); + }, + }; +} diff --git a/ghost/test/e2e-api/members/member-answers.test.ts b/ghost/test/e2e-api/members/member-answers.test.ts index e76c31b9fd3a..629c2ff72b91 100644 --- a/ghost/test/e2e-api/members/member-answers.test.ts +++ b/ghost/test/e2e-api/members/member-answers.test.ts @@ -528,5 +528,86 @@ describe('Member answers by port', function () { ], ]); }); + + describe('as recorded for dashboards', function () { + let metrics: { tracked: (_name: string) => Record[] }; + const tierChanges = () => metrics.tracked('members.tier_change'); + + beforeEach(function () { + metrics = mockManager.mockMetrics(); + }); + + it('records a change of tier without answers, with no requirement', async function () { + await changeTier(toTierId, 204); + + expect(tierChanges()).toEqual([ + expect.objectContaining({ + event: expect.objectContaining({ outcome: 'success' }), + labels: { answers: 'none' }, + }), + ]); + }); + + it("records each requirement's answers as saved with the change", async function () { + await changeTier(toTierId, 204, ANSWERED); + + expect(tierChanges()).toMatchObject([ + { + event: { outcome: 'success' }, + labels: { answers: 'given', shipping: 'saved', phone: 'saved' }, + }, + ]); + }); + + it('records a requirement left out, and one whose field is archived', async function () { + await editField(phoneKey, { status: 'archived' }); + + await changeTier(toTierId, 204, { + 'checkout.phone': ANSWERED['checkout.phone'], + }); + + expect(tierChanges()).toMatchObject([ + { event: { outcome: 'success' }, labels: { shipping: 'none', phone: 'dropped' } }, + ]); + }); + + it('records a change refused for its answers', async function () { + await collect([toTierId], ['US']); + + await changeTier(toTierId, 422, ANSWERED); + + expect(tierChanges()).toMatchObject([ + { + event: { outcome: 'failure' }, + error: { type: 'AnswersRefused' }, + labels: { answers: 'given', shipping: 'given', phone: 'given' }, + }, + ]); + }); + + it('records a requirement as partly saved while one of its fields is archived', async function () { + await editField(recipientKey, { status: 'archived' }); + + await changeTier(toTierId, 204, ANSWERED); + + expect(tierChanges()).toMatchObject([ + { event: { outcome: 'success' }, labels: { shipping: 'partly_saved', phone: 'saved' } }, + ]); + }); + + it('records answers that failed to save once the tier changed', async function () { + const membersService = require('../../../core/server/services/members'); + sinon + .stub(membersService.api.memberBREADService, 'updateWithMetafields') + .rejects(new Error('The database went away.')); + sinon.stub(logging, 'error'); + + await changeTier(toTierId, 204, ANSWERED); + + expect(tierChanges()).toMatchObject([ + { event: { outcome: 'success' }, labels: { shipping: 'failed', phone: 'failed' } }, + ]); + }); + }); }); }); diff --git a/ghost/test/unit/server/services/members/members-api/controllers/member-controller.test.ts b/ghost/test/unit/server/services/members/members-api/controllers/member-controller.test.ts index 79f7d4d97cc3..6aece51a40da 100644 --- a/ghost/test/unit/server/services/members/members-api/controllers/member-controller.test.ts +++ b/ghost/test/unit/server/services/members/members-api/controllers/member-controller.test.ts @@ -1,6 +1,12 @@ import sinon from 'sinon'; // @ts-expect-error This module lacks type definitions. import MemberController from '../../../../../../../core/server/services/members/members-api/controllers/member-controller'; +import { createTracer } from '../../../../../../../core/server/lib/tracing/create-tracer'; +import { membersTracking } from '../../../../../../../core/server/services/members/tracking'; + +const tracking = membersTracking({ + tracer: createTracer({ transport: { metric: async () => null }, logging: { error() {} } }), +}); describe('MemberController', function () { describe('updateSubscription', function () { @@ -59,6 +65,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, productRepository, tiersService, @@ -108,6 +115,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, tiersService, tokenService, @@ -151,6 +159,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, tiersService, tokenService, @@ -205,6 +214,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, productRepository, StripePrice, @@ -253,6 +263,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, stripePlansService, tokenService, @@ -305,6 +316,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, stripePlansService, tokenService, @@ -356,6 +368,7 @@ describe('MemberController', function () { }; const controller = new MemberController({ + tracking, memberRepository, stripePlansService, tokenService, From fbcfb465d8145daaaf057b8d9f3c8710c1c57149 Mon Sep 17 00:00:00 2001 From: Rob Lester Date: Wed, 11 Nov 2026 17:18:06 +0000 Subject: [PATCH 023/174] Reported Stripe webhooks Ghost fails to handle to Sentry ref https://linear.app/ghost/issue/DYA-25 When Ghost failed to handle an event Stripe sent, such as a completed checkout whose member couldn't be saved, the failure was only logged, so nobody was told and a site could fail every event for days. Each failure now also goes to Sentry, where Ghost's setup keeps only the unexpected ones and leaves out expected refusals such as a webhook whose signature doesn't show Stripe sent it, so a broken site's errors show up beside every other server error. --- ghost/core/server/services/stripe/service.js | 2 ++ .../core/server/services/stripe/stripe-service.js | 3 +++ .../server/services/stripe/webhook-controller.js | 6 +++++- .../services/stripe/webhook-controller.test.js | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ghost/core/server/services/stripe/service.js b/ghost/core/server/services/stripe/service.js index fbb1eeaeac48..8d2a22404852 100644 --- a/ghost/core/server/services/stripe/service.js +++ b/ghost/core/server/services/stripe/service.js @@ -3,6 +3,7 @@ const StripeService = require('./stripe-service'); const logging = require('@tryghost/logging'); const { tracer, meter } = require('../../lib/tracing'); const { stripeTracking } = require('./tracking'); +const sentry = require('../../../shared/sentry'); const membersService = require('../members'); const config = require('../../../shared/config'); const settings = require('../../../shared/settings-cache'); @@ -42,6 +43,7 @@ const debouncedConfigureApi = _.debounce(() => { module.exports = new StripeService({ labs, tracking: stripeTracking({ tracer, meter }), + sentry, membersService, models: _.pick(models, [ 'Product', diff --git a/ghost/core/server/services/stripe/stripe-service.js b/ghost/core/server/services/stripe/stripe-service.js index 45da49216116..c6dc41b26a91 100644 --- a/ghost/core/server/services/stripe/stripe-service.js +++ b/ghost/core/server/services/stripe/stripe-service.js @@ -38,6 +38,7 @@ module.exports = class StripeService { * @param {object} deps * @param {*} deps.labs * @param {import('./tracking').StripeTracking} deps.tracking + * @param {{captureException(err: unknown): unknown}} deps.sentry * @param {*} deps.membersService * @param {*} deps.donationService * @param {*} deps.giftService @@ -55,6 +56,7 @@ module.exports = class StripeService { constructor({ labs, tracking, + sentry, membersService, donationService, giftService, @@ -155,6 +157,7 @@ module.exports = class StripeService { checkoutSessionEventService, chargeRefundedEventService, tracking, + sentry, }); this.models = models; diff --git a/ghost/core/server/services/stripe/webhook-controller.js b/ghost/core/server/services/stripe/webhook-controller.js index 33cc6e004763..dfa324205332 100644 --- a/ghost/core/server/services/stripe/webhook-controller.js +++ b/ghost/core/server/services/stripe/webhook-controller.js @@ -11,9 +11,11 @@ module.exports = class WebhookController { * @param {import('./services/webhook/invoice-event-service')} deps.invoiceEventService * @param {import('./services/webhook/charge-refunded-event-service')} deps.chargeRefundedEventService * @param {Pick} deps.tracking + * @param {{captureException(err: unknown): unknown}} deps.sentry */ constructor(deps) { this.tracking = deps.tracking; + this.sentry = deps.sentry; this.checkoutSessionEventService = deps.checkoutSessionEventService; this.subscriptionEventService = deps.subscriptionEventService; this.invoiceEventService = deps.invoiceEventService; @@ -140,7 +142,9 @@ module.exports = class WebhookController { res.writeHead(200); res.end(); } catch (err) { - // The span has logged the error. Stripe sends the event again later. + // The span has logged the error. Sentry keeps only the unexpected ones, as Ghost's Sentry + // setup drops every Ghost error whose status isn't 500. Stripe sends the event again later. + this.sentry.captureException(err); res.writeHead(err.statusCode || 500); res.end(); } diff --git a/ghost/test/unit/server/services/stripe/webhook-controller.test.js b/ghost/test/unit/server/services/stripe/webhook-controller.test.js index 7a221fe72172..ad72c0e3af09 100644 --- a/ghost/test/unit/server/services/stripe/webhook-controller.test.js +++ b/ghost/test/unit/server/services/stripe/webhook-controller.test.js @@ -25,6 +25,7 @@ describe('WebhookController', function () { chargeRefundedEventService: { handleEvent: sinon.stub() }, webhookManager: { parseWebhook: sinon.stub() }, tracking, + sentry: { captureException: sinon.stub() }, }; controller = new WebhookController(deps); @@ -255,6 +256,19 @@ describe('WebhookController', function () { sinon.assert.called(res.end); }); + it('reports an event it failed to handle to Sentry', async function () { + const failure = new Error('Unexpected error'); + deps.webhookManager.parseWebhook.returns({ + type: 'customer.subscription.created', + data: { object: { customer: 'cust_123' } }, + }); + deps.subscriptionEventService.handleSubscriptionEvent.throws(failure); + + await controller.handle(req, res); + + sinon.assert.calledOnceWithExactly(deps.sentry.captureException, failure); + }); + it('should handle charge.refunded event', async function () { const event = { type: 'charge.refunded', From 0d0e18d2aac139f1da90040e822d83f54db1d678 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 12 Nov 2026 10:11:57 +0000 Subject: [PATCH 024/174] Changed CI to run the unit tests in a shuffled order (#32822) fixes https://linear.app/ghost/issue/PLA-621/keep-the-unit-suite-passing-in-any-file-order Unit test files share a module registry per worker, so a test that leaks state, or relies on state another test left, only passes in the order files happen to run. That has reached main more than once. This fixes the tests that failed when shuffled, and makes CI shuffle the unit suite so the PR that adds such a dependency is the one that fails. CI sets `GHOST_UNIT_TEST_SEED` to the run ID, and `vitest.config.ts` then shuffles files and the tests inside them. This differs from `vitest.config.db.ts`, which shuffles only files, with a new seed each run: - **Tests too:** several failures were a test relying on an earlier test in the same file, which shuffling only files never catches. - **One seed per run:** the unit step retries up to three times, and a new order on retry could pass and hide the problem. Retries and job re-runs use the same order, and the printed seed reproduces it locally (see `docs/contributing/testing.md`). The fixes, one commit per cause: - Tests that shared a repository, renderer, cache or service root across a describe block now set up their own. - Config, settings stubs, event listeners and nock interceptors are restored. `mockManager.restore()` no longer re-adds the webmention discovery mocks, which its own comment reserves for the database suites. Unit files call `restore()` too, and those leftover mocks broke a test there. The database setup already re-adds them before and after every test. - Helper tests restore the Handlebars helpers and partials they register (`test/utils/handlebars-state.ts`). Suites that register through Ghost's helper service get a fresh copy of it, because the service remembers names and would skip re-registering them later. - The automations tests import their module after `vi.resetModules()`, since `vi.mock` has no effect on a module another file already loaded. - The importer tests give `processZip` disposable copies: when it failed, it deleted the checked-in zip fixture. One assertion changed: the recommendations suite for a disabled setting set it to `true`, and only passed when another suite left an empty result stubbed. It now disables the setting and expects the helper to render nothing. ## Testing - [x] Unit project in normal order, and shuffled at seeds 1 to 10: 804 files pass each time (805 after rebasing, at normal order and seeds 1 to 3) - [x] `GHOST_UNIT_TEST_SEED=19283746501 pnpm nx run ghost:test:unit --skip-nx-cache` prints the seed and passes - [x] `pnpm lint:oxlint`, ESLint on every changed Ghost file, `pnpm format:check` - [x] `tsc --noEmit` for `ghost` and `ghost/test` - [x] Database suites on MySQL, one at a time: integration (77 files, 1,263 tests) and legacy (464 tests) pass. In e2e, 201 of 206 files pass; the other 5 (`e2e-api/admin/actions.test.js` and four `e2e-server/*.isolated.test.ts` boot suites, mostly 15s timeouts) pass when rerun alone, on this branch and on its base - [x] The database tests that call `mockManager.restore()` inside a test pass: `content-import-job`, `members`, and the email-service `cards` and `batch-sending` tests --- .github/workflows/ci.yml | 8 ++ docs/contributing/testing.md | 28 ++++ .../unit/api/endpoints/automations.test.ts | 32 ++++- .../utils/serializers/output/default.test.js | 32 +++-- .../apps/private-blogging/controller.test.js | 12 +- .../test/unit/frontend/helpers/asset.test.ts | 30 ++-- .../unit/frontend/helpers/cancel-link.test.ts | 3 + .../frontend/helpers/comment-count.test.ts | 3 + .../test/unit/frontend/helpers/concat.test.ts | 3 + .../frontend/helpers/content-api-url.test.ts | 12 +- .../unit/frontend/helpers/content.test.ts | 7 + .../unit/frontend/helpers/foreach.test.ts | 3 + .../test/unit/frontend/helpers/match.test.ts | 3 + .../frontend/helpers/meta-description.test.ts | 11 +- .../unit/frontend/helpers/meta-title.test.ts | 15 +- .../unit/frontend/helpers/navigation.test.ts | 20 ++- .../unit/frontend/helpers/pagination.test.ts | 5 + .../test/unit/frontend/helpers/price.test.ts | 3 + .../frontend/helpers/recommendations.test.ts | 34 +++-- .../test/unit/frontend/helpers/search.test.ts | 3 + .../frontend/helpers/social-accounts.test.ts | 11 +- .../unit/frontend/helpers/social-url.test.ts | 13 +- .../test/unit/frontend/helpers/split.test.ts | 5 + .../theme-engine/handlebars/helpers.test.js | 13 +- .../theme-engine/handlebars/template.test.ts | 3 + ghost/test/unit/server/data/db/backup.test.js | 3 +- .../unit/server/data/importer/index.test.js | 36 +++-- .../server/lib/mailgun/mailgun-client.test.js | 2 + ghost/test/unit/server/models/user.test.js | 9 ++ .../automations/automations-api.test.ts | 15 +- .../email-event-processor.test.js | 7 +- .../email-service/email-renderer.test.js | 94 +++++++------ .../member-attribution/attribution.test.ts | 5 +- .../member-welcome-emails/index.test.ts | 35 +++-- .../post-scheduling/post-scheduling.test.js | 22 +++ .../server/services/themes/validate.test.js | 17 ++- .../server/services/tiers/tiers-api.test.js | 21 ++- .../unit/server/web/admin/controller.test.js | 3 +- .../test/utils/e2e-framework-mock-manager.js | 5 +- ghost/test/utils/handlebars-state.ts | 128 ++++++++++++++++++ ghost/vitest.config.ts | 13 ++ 41 files changed, 565 insertions(+), 162 deletions(-) create mode 100644 ghost/test/utils/handlebars-state.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caba9bdfacb7..11251afe20c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -812,6 +812,13 @@ jobs: # # Non-primary Node legs skip browser-only projects (see # unit_test_node_projects_str in job_setup). + # + # ghost's unit suite runs in a shuffled order seeded by + # GHOST_UNIT_TEST_SEED (see ghost/vitest.config.ts), so a test that + # only passes after another one fails here. Every attempt reuses the + # run's seed, so a retry can't hide that behind a different order. + # Vitest prints it as `Running tests with seed ""`; + # docs/contributing/testing.md covers rerunning that order locally. run: | if [ "${{ matrix.node }}" = "${{ needs.job_setup.outputs.node_version }}" ]; then PROJECTS="${{ needs.job_setup.outputs.unit_test_projects_str }}" @@ -846,6 +853,7 @@ jobs: FORCE_COLOR: 0 NX_SKIP_LOG_GROUPING: true logging__level: fatal + GHOST_UNIT_TEST_SEED: ${{ github.run_id }} - name: Check for unexpected file changes run: | diff --git a/docs/contributing/testing.md b/docs/contributing/testing.md index 317195cb88eb..7a6506707e9c 100644 --- a/docs/contributing/testing.md +++ b/docs/contributing/testing.md @@ -148,6 +148,34 @@ Compiling Core with `build:tsc` is unnecessary for source tests and leaves adjacent JavaScript files that can shadow later TypeScript edits in CommonJS imports. +### Unit test order + +Ghost Core's unit files share one module registry per worker, so state a file +leaves behind, such as a stub, a config override, a registered Handlebars helper +or an initialized service root, is still there for whichever file runs next. A +test must also not rely on another test in its file having run first. CI runs +the unit suite in a shuffled order, files and the tests inside them, to catch +both. + +The shuffle uses one seed per CI run, which Vitest prints near the top of the +unit test output: + +```text +Running tests with seed "19283746501" +``` + +To rerun that order locally, pass the same seed. The seed isn't part of Nx's +cache key, so skip the cache or Nx replays an earlier result: + +```bash +GHOST_UNIT_TEST_SEED=19283746501 pnpm nx run ghost:test:unit --skip-nx-cache +``` + +Re-running the CI job keeps the seed, so it fails the same way until the order +dependency is fixed. Fix it in the test that leaks or relies on state: restore +what it changes in `afterEach` or `afterAll`, and set up what it needs in its +own `beforeEach`. + From `ghost/`, `pnpm test:all` runs Ghost Core's unit, integration, server E2E, type and lint commands after its prerequisites have been prepared. diff --git a/ghost/test/unit/api/endpoints/automations.test.ts b/ghost/test/unit/api/endpoints/automations.test.ts index 648b4bf888e8..00728769b0cc 100644 --- a/ghost/test/unit/api/endpoints/automations.test.ts +++ b/ghost/test/unit/api/endpoints/automations.test.ts @@ -9,14 +9,11 @@ import { Frame } from '@tryghost/api-framework'; // @ts-expect-error @tryghost/domain-events currently lacks type declarations. import domainEvents from '@tryghost/domain-events'; -import { controller as automationsController } from '../../../../core/server/api/endpoints/automations'; -import { StartAutomationsPollEvent } from '../../../../core/server/services/automations/events/start-automations-poll-event'; -import * as automationsApi from '../../../../core/server/services/automations/automations-api'; -// @ts-expect-error This module lacks type definitions. -import labs from '../../../../core/shared/labs'; + +type AutomationsApi = typeof import('../../../../core/server/services/automations/automations-api'); vi.mock('../../../../core/server/services/automations/automations-api', async (importOriginal) => { - const actual = await importOriginal(); + const actual = await importOriginal(); return { ...actual, browse: vi.fn(), @@ -29,6 +26,29 @@ vi.mock('../../../../core/server/services/automations/automations-api', async (i describe('Automations controller', function () { let dispatchStub: sinon.SinonStub; + let automationsController: (typeof import('../../../../core/server/api/endpoints/automations'))['controller']; + let StartAutomationsPollEvent: (typeof import('../../../../core/server/services/automations/events/start-automations-poll-event'))['StartAutomationsPollEvent']; + let automationsApi: AutomationsApi; + let labs: { isSet: (flag: string) => boolean }; + + beforeAll(async function () { + // vi.mock only reaches modules loaded after it, and another file in this + // worker may already have loaded the controller with the real API + vi.resetModules(); + ({ controller: automationsController } = + await import('../../../../core/server/api/endpoints/automations')); + ({ StartAutomationsPollEvent } = + await import('../../../../core/server/services/automations/events/start-automations-poll-event')); + automationsApi = await import('../../../../core/server/services/automations/automations-api'); + // @ts-expect-error This module lacks type definitions. + labs = (await import('../../../../core/shared/labs')).default; + }); + + afterAll(function () { + // Don't leave modules loaded against the mocked API for later files + vi.doUnmock('../../../../core/server/services/automations/automations-api'); + vi.resetModules(); + }); beforeEach(function () { dispatchStub = sinon.stub(domainEvents, 'dispatch'); diff --git a/ghost/test/unit/api/endpoints/utils/serializers/output/default.test.js b/ghost/test/unit/api/endpoints/utils/serializers/output/default.test.js index a2dd4cb4024f..2640bc7597e3 100644 --- a/ghost/test/unit/api/endpoints/utils/serializers/output/default.test.js +++ b/ghost/test/unit/api/endpoints/utils/serializers/output/default.test.js @@ -132,12 +132,16 @@ describe('Unit: endpoints/utils/serializers/output/default', function () { }); it('.all() can map a single Bookshelf model with custom mapper', function () { - mappers.stuffs = sinon.stub().callsFake(function (res) { - return { - title: res.title, - custom: 'thing', - }; - }); + sinon.define( + mappers, + 'stuffs', + sinon.stub().callsFake(function (res) { + return { + title: res.title, + custom: 'thing', + }; + }), + ); const response = { toJSON: toJSONStub, @@ -160,12 +164,16 @@ describe('Unit: endpoints/utils/serializers/output/default', function () { }); it('.all() can map a Bookshelf collection with custom mapper', function () { - mappers.stuffs = sinon.stub().callsFake(function (res) { - return { - title: res.title, - custom: 'thing', - }; - }); + sinon.define( + mappers, + 'stuffs', + sinon.stub().callsFake(function (res) { + return { + title: res.title, + custom: 'thing', + }; + }), + ); const response = { data: [ diff --git a/ghost/test/unit/frontend/apps/private-blogging/controller.test.js b/ghost/test/unit/frontend/apps/private-blogging/controller.test.js index 13619832d48b..17dcdde789f2 100644 --- a/ghost/test/unit/frontend/apps/private-blogging/controller.test.js +++ b/ghost/test/unit/frontend/apps/private-blogging/controller.test.js @@ -13,6 +13,7 @@ const { color_to_rgba } = require('../../../../../core/frontend/helpers/color_to const contrast_text_color = require('../../../../../core/frontend/helpers/contrast_text_color'); const json = require('../../../../../core/frontend/helpers/json'); const { setupI18nTest, initLocale } = require('../../../../utils/i18n-test-utils'); +const { restoreHandlebarsAfterSuite } = require('../../../../utils/handlebars-state'); describe('Private Controller', function () { let res; @@ -107,6 +108,8 @@ describe('Private Controller', function () { }); describe('private.hbs template translation', function () { + restoreHandlebarsAfterSuite(); + const privateViewPath = path.join( __dirname, '../../../../../core/frontend/apps/private-blogging/lib/views/private.hbs', @@ -130,15 +133,6 @@ describe('private.hbs template translation', function () { }); }); - afterAll(function () { - hbs.handlebars.unregisterHelper('input_password'); - hbs.handlebars.unregisterHelper('color_to_rgba'); - hbs.handlebars.unregisterHelper('contrast_text_color'); - hbs.handlebars.unregisterHelper('json'); - hbs.handlebars.unregisterHelper('asset'); - hbs.handlebars.unregisterHelper('img_url'); - }); - function renderPrivateTemplate(context) { return compiledTemplate(context, { data: context, diff --git a/ghost/test/unit/frontend/helpers/asset.test.ts b/ghost/test/unit/frontend/helpers/asset.test.ts index a87ad0dd3542..fe0a286f92c8 100644 --- a/ghost/test/unit/frontend/helpers/asset.test.ts +++ b/ghost/test/unit/frontend/helpers/asset.test.ts @@ -19,19 +19,29 @@ describe('{{asset}} helper', function () { const localSettingsCache: Record = {}; beforeAll(function () { - configUtils.set({ useMinFiles: true }); - globalHash = String(asset('public/nonexistent.js')).split('?v=')[1] || ''; sinon.stub(settingsCache, 'get').callsFake(function (key: string) { return localSettingsCache[key]; }); }); - afterAll(async function () { - await configUtils.restore(); + afterAll(function () { sinon.restore(); }); + // Each test starts from the same config and settings, whichever ran before it. + // Nested blocks add their own config in beforeEach, after this one. + beforeEach(function () { + configUtils.set({ useMinFiles: true }); + for (const key of Object.keys(localSettingsCache)) { + delete localSettingsCache[key]; + } + }); + + afterEach(async function () { + await configUtils.restore(); + }); + describe('no subdirectory', function () { it('handles favicon correctly', function () { rendered = asset('favicon.ico'); @@ -93,15 +103,11 @@ describe('{{asset}} helper', function () { }); describe('different admin and site urls', function () { - beforeAll(function () { + beforeEach(function () { configUtils.set({ url: 'http://127.0.0.1' }); configUtils.set({ 'admin:url': 'http://localhost' }); }); - afterAll(async function () { - await configUtils.restore(); - }); - it('handles favicon correctly', function () { rendered = asset('favicon.ico'); assertExists(rendered); @@ -119,14 +125,10 @@ describe('{{asset}} helper', function () { }); describe('with contentBasedHash enabled', function () { - beforeAll(function () { + beforeEach(function () { configUtils.set({ 'caching:assets:contentBasedHash:enabled': true }); }); - afterAll(async function () { - await configUtils.restore(); - }); - it('uses file-based hash for ghost.css when it exists', function () { rendered = asset('public/ghost.css'); assertExists(rendered); diff --git a/ghost/test/unit/frontend/helpers/cancel-link.test.ts b/ghost/test/unit/frontend/helpers/cancel-link.test.ts index c7660ad0e9d4..2c990dbcad9d 100644 --- a/ghost/test/unit/frontend/helpers/cancel-link.test.ts +++ b/ghost/test/unit/frontend/helpers/cancel-link.test.ts @@ -11,11 +11,14 @@ import proxy from '../../../../core/frontend/services/proxy'; import configUtils from '../../../utils/config-utils'; import logging from '@tryghost/logging'; import { promisify } from 'node:util'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; const { labs } = proxy; const { hbs } = handlebarsService; describe('{{cancel_link}} helper', function () { + restoreHandlebarsAfterSuite(); + let labsStub: SinonStub; beforeAll(async function () { hbs.express4({ partialsDir: [configUtils.config.get('paths').helperTemplates] }); diff --git a/ghost/test/unit/frontend/helpers/comment-count.test.ts b/ghost/test/unit/frontend/helpers/comment-count.test.ts index 034163ff7538..3b07d24ab708 100644 --- a/ghost/test/unit/frontend/helpers/comment-count.test.ts +++ b/ghost/test/unit/frontend/helpers/comment-count.test.ts @@ -13,8 +13,11 @@ const { settingsCache } = proxy; // @ts-expect-error This module lacks type definitions. import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('{{comment_count}} helper', function () { + restoreHandlebarsAfterSuite(); + let internalKeys: InternalKeys; beforeAll(async function () { diff --git a/ghost/test/unit/frontend/helpers/concat.test.ts b/ghost/test/unit/frontend/helpers/concat.test.ts index e6108f486392..3a48ae934660 100644 --- a/ghost/test/unit/frontend/helpers/concat.test.ts +++ b/ghost/test/unit/frontend/helpers/concat.test.ts @@ -16,6 +16,7 @@ import { shouldCompileToExpectedWithGlobals, // @ts-expect-error This module lacks type definitions. } from './utils/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; const { handlebars } = handlebarsService.hbs; @@ -29,6 +30,8 @@ const draftPostData = { }; describe('{{concat}} helper', function () { + restoreHandlebarsAfterSuite(); + beforeAll(function () { handlebars.registerHelper('concat', concat); handlebars.registerHelper('url', url); diff --git a/ghost/test/unit/frontend/helpers/content-api-url.test.ts b/ghost/test/unit/frontend/helpers/content-api-url.test.ts index 76ec18e8bd9c..0979f924d4cc 100644 --- a/ghost/test/unit/frontend/helpers/content-api-url.test.ts +++ b/ghost/test/unit/frontend/helpers/content-api-url.test.ts @@ -20,11 +20,11 @@ describe('{{content_api_url}} helper', function () { }); describe('without sub-directory', function () { - beforeAll(function () { + beforeEach(function () { configUtils.set({ url: 'http://localhost:65535/', 'admin:url': 'https://admin.tld:65535' }); }); - afterAll(async function () { + afterEach(async function () { await configUtils.restore(); }); @@ -48,14 +48,14 @@ describe('{{content_api_url}} helper', function () { }); }); describe('with a sub-directory', function () { - beforeAll(function () { + beforeEach(function () { configUtils.set({ url: 'http://localhost:65535/blog', 'admin:url': 'https://admin.tld:65535/blog', }); }); - afterAll(async function () { + afterEach(async function () { await configUtils.restore(); }); @@ -79,11 +79,11 @@ describe('{{content_api_url}} helper', function () { }); }); describe('uses the site url if no admin:url is set', function () { - beforeAll(function () { + beforeEach(function () { configUtils.set({ url: 'http://localhost:65535/' }); }); - afterAll(async function () { + afterEach(async function () { await configUtils.restore(); }); diff --git a/ghost/test/unit/frontend/helpers/content.test.ts b/ghost/test/unit/frontend/helpers/content.test.ts index 1bb6b19fb632..36152d6f0fcf 100644 --- a/ghost/test/unit/frontend/helpers/content.test.ts +++ b/ghost/test/unit/frontend/helpers/content.test.ts @@ -19,10 +19,13 @@ import is from '../../../../core/frontend/helpers/is'; import t from '../../../../core/frontend/helpers/t'; // @ts-expect-error This module lacks type definitions. import { setupI18nTest, initLocale } from '../../../utils/i18n-test-utils'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; const { hbs } = handlebarsService; describe('{{content}} helper', function () { + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [configUtils.config.get('paths').helperTemplates] }); @@ -75,6 +78,8 @@ describe('{{content}} helper', function () { }); describe('{{content}} helper with no access', function () { + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [configUtils.config.get('paths').helperTemplates] }); @@ -229,6 +234,8 @@ describe('{{content}} helper with no access', function () { }); describe('{{content}} helper with custom template', function () { + restoreHandlebarsAfterSuite(); + let optionsData: undefined; beforeAll(async function () { hbs.express4({ partialsDir: [path.resolve(__dirname, './test_tpl')] }); diff --git a/ghost/test/unit/frontend/helpers/foreach.test.ts b/ghost/test/unit/frontend/helpers/foreach.test.ts index 4009b0523e97..d97fe5b88cbc 100644 --- a/ghost/test/unit/frontend/helpers/foreach.test.ts +++ b/ghost/test/unit/frontend/helpers/foreach.test.ts @@ -7,8 +7,11 @@ import foreach from '../../../../core/frontend/helpers/foreach'; import { assertExists, assertObjectMatches } from '../../../utils/assertions'; // @ts-expect-error This module lacks type definitions. import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('{{#foreach}} helper', function () { + restoreHandlebarsAfterSuite(); + type IterationData = { key: string | number; index: number; diff --git a/ghost/test/unit/frontend/helpers/match.test.ts b/ghost/test/unit/frontend/helpers/match.test.ts index 8b3118476492..28dd60068d5a 100644 --- a/ghost/test/unit/frontend/helpers/match.test.ts +++ b/ghost/test/unit/frontend/helpers/match.test.ts @@ -6,8 +6,11 @@ import _ from 'lodash'; import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; // @ts-expect-error This module lacks type definitions. import { SafeString } from 'express-hbs'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('Match helper', function () { + restoreHandlebarsAfterSuite(); + beforeAll(function () { registerHelper('match'); registerHelper('title'); diff --git a/ghost/test/unit/frontend/helpers/meta-description.test.ts b/ghost/test/unit/frontend/helpers/meta-description.test.ts index 18996f797565..4bcdc8d5d654 100644 --- a/ghost/test/unit/frontend/helpers/meta-description.test.ts +++ b/ghost/test/unit/frontend/helpers/meta-description.test.ts @@ -22,8 +22,15 @@ describe('{{meta_description}} helper', function () { sinon.restore(); }); + // Each test starts with no settings; nested blocks add theirs in beforeEach + beforeEach(function () { + for (const key of Object.keys(localSettingsCache)) { + delete localSettingsCache[key]; + } + }); + describe('no meta_description', function () { - beforeAll(function () { + beforeEach(function () { localSettingsCache.description = 'The professional publishing platform'; }); @@ -139,7 +146,7 @@ describe('{{meta_description}} helper', function () { }); describe('with meta_description', function () { - beforeAll(function () { + beforeEach(function () { localSettingsCache.meta_description = 'Meta description of the professional publishing platform'; }); diff --git a/ghost/test/unit/frontend/helpers/meta-title.test.ts b/ghost/test/unit/frontend/helpers/meta-title.test.ts index 315a6fa01bde..88d829fa8881 100644 --- a/ghost/test/unit/frontend/helpers/meta-title.test.ts +++ b/ghost/test/unit/frontend/helpers/meta-title.test.ts @@ -154,14 +154,7 @@ describe('{{meta_title}} helper', function () { }); describe('with meta_title', function () { - // The first test below stubs settingsCache.get and the rest of this - // block relies on that stub staying in place; restore it when the - // block finishes so the stub does not leak into other test files. - afterAll(function () { - sinon.restore(); - }); - - it('returns correct title for homepage when meta_title is defined', function () { + beforeEach(function () { sinon.stub(settingsCache, 'get').callsFake(function (key: string) { const settings: Record = { title: 'Ghost', @@ -169,7 +162,13 @@ describe('{{meta_title}} helper', function () { }; return settings[key]; }); + }); + afterEach(function () { + sinon.restore(); + }); + + it('returns correct title for homepage when meta_title is defined', function () { const rendered = meta_title.call({}, { data: { root: { context: ['home'] } } }); assertExists(rendered); diff --git a/ghost/test/unit/frontend/helpers/navigation.test.ts b/ghost/test/unit/frontend/helpers/navigation.test.ts index 763456d32bca..b8fe9d9d8ee1 100644 --- a/ghost/test/unit/frontend/helpers/navigation.test.ts +++ b/ghost/test/unit/frontend/helpers/navigation.test.ts @@ -5,6 +5,7 @@ import type { SinonStub } from 'sinon'; // @ts-expect-error This module lacks type definitions. import handlebarsService from '../../../../core/frontend/services/handlebars'; import configUtils from '../../../utils/config-utils'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; import path from 'path'; import { promisify } from 'node:util'; @@ -47,6 +48,8 @@ describe('{{navigation}} helper', function () { let optionsData: NavigationOptions; let labsStub: SinonStub; + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [configUtils.config.get('paths').helperTemplates], @@ -463,11 +466,18 @@ describe('{{navigation}} helper', function () { describe('{{navigation}} helper with custom template', function () { let optionsData: NavigationOptions; + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [path.resolve(__dirname, './test_tpl')] }); const cachePartials = promisify(hbs.cachePartials.bind(hbs)); await cachePartials(); + + hbs.registerHelper('link_class', link_class); + hbs.registerHelper('concat', concat); + hbs.registerHelper('url', url); + hbs.registerHelper('foreach', foreach); }); beforeEach(function () { @@ -534,6 +544,10 @@ describe('{{navigation}} helper with custom template', function () { describe('using compile', function () { let defaultGlobals: Record; + + // This block swaps in stand-in helpers and a site url the rest of the file doesn't expect + restoreHandlebarsAfterSuite(); + function compile(templateString: string) { const template = handlebars.compile(templateString); template.with = (locals: Record = {}, globals?: Record) => { @@ -550,7 +564,7 @@ describe('{{navigation}} helper with custom template', function () { handlebars.registerHelper('concat', concat); handlebars.registerHelper('url', concat); handlebars.registerHelper('navigation', navigation); - configUtils.config.set('url', 'https://siteurl.com'); + configUtils.set('url', 'https://siteurl.com'); defaultGlobals = { data: { site: { @@ -562,6 +576,10 @@ describe('{{navigation}} helper with custom template', function () { }; }); + afterAll(async function () { + await configUtils.restore(); + }); + it('can render both primary and secondary nav in order', function () { assert.equal( compile('{{navigation}}{{navigation type="secondary"}}').with({}), diff --git a/ghost/test/unit/frontend/helpers/pagination.test.ts b/ghost/test/unit/frontend/helpers/pagination.test.ts index 60165a7136c1..5cf8abce73d8 100644 --- a/ghost/test/unit/frontend/helpers/pagination.test.ts +++ b/ghost/test/unit/frontend/helpers/pagination.test.ts @@ -15,10 +15,13 @@ import t from '../../../../core/frontend/helpers/t'; import { setupI18nTest, initLocale } from '../../../utils/i18n-test-utils'; // @ts-expect-error This module lacks type definitions. import pagination from '../../../../core/frontend/helpers/pagination'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; const { hbs } = handlebarsService; describe('{{pagination}} helper', function () { + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [configUtils.config.get('paths').helperTemplates] }); @@ -209,6 +212,8 @@ describe('{{pagination}} helper', function () { }); describe('{{pagination}} helper with custom template', function () { + restoreHandlebarsAfterSuite(); + beforeAll(async function () { hbs.express4({ partialsDir: [path.resolve(__dirname, './test_tpl')] }); diff --git a/ghost/test/unit/frontend/helpers/price.test.ts b/ghost/test/unit/frontend/helpers/price.test.ts index 6b5620bbd78a..221ba205f22e 100644 --- a/ghost/test/unit/frontend/helpers/price.test.ts +++ b/ghost/test/unit/frontend/helpers/price.test.ts @@ -8,8 +8,11 @@ import price from '../../../../core/frontend/helpers/price'; import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; import logging from '@tryghost/logging'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('{{price}} helper', function () { + restoreHandlebarsAfterSuite(); + let logWarnStub: SinonStub; beforeEach(function () { diff --git a/ghost/test/unit/frontend/helpers/recommendations.test.ts b/ghost/test/unit/frontend/helpers/recommendations.test.ts index 5720c510f67b..766faf8dc265 100644 --- a/ghost/test/unit/frontend/helpers/recommendations.test.ts +++ b/ghost/test/unit/frontend/helpers/recommendations.test.ts @@ -7,6 +7,7 @@ import { endpoints as api } from '../../../../core/server/api'; // @ts-expect-error This module lacks type definitions. import handlebarsService from '../../../../core/frontend/services/handlebars'; import configUtils from '../../../utils/config-utils'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; import { html } from 'common-tags'; import loggingLib from '@tryghost/logging'; // @ts-expect-error This module lacks type definitions. @@ -31,6 +32,9 @@ describe('{{#recommendations}} helper', function () { let logging: Pick, 'error' | 'warn'>; /** @type {sinon.SinonStub} */ let settingsCacheGetStub: SinonStub; + let recommendationsApiStub: SinonStub; + + restoreHandlebarsAfterSuite(); beforeAll(async function () { hbs.express4({ @@ -43,14 +47,18 @@ describe('{{#recommendations}} helper', function () { // The recommendation template expects this helper hbs.registerHelper('foreach', foreach); hbs.registerHelper('readable_url', readable_url); + }); + // Every test starts from enabled recommendations and two results; nested + // blocks change that in their own beforeEach, which runs after this one + beforeEach(function () { // Stub settings cache settingsCacheGetStub = sinon.stub(settingsCache, 'get'); settingsCacheGetStub.withArgs('recommendations_enabled').returns(true); // Stub Recommendation Content API const meta = { pagination: {} }; - sinon.stub(api, 'recommendationsPublic').get(() => { + recommendationsApiStub = sinon.stub(api, 'recommendationsPublic').get(() => { return { browse: sinon.stub().resolves({ recommendations: [ @@ -81,7 +89,7 @@ describe('{{#recommendations}} helper', function () { }; }); - afterAll(function () { + afterEach(function () { sinon.restore(); }); @@ -126,8 +134,8 @@ describe('{{#recommendations}} helper', function () { }); describe('when there are no recommendations', function () { - beforeAll(function () { - sinon.stub(api, 'recommendationsPublic').get(() => { + beforeEach(function () { + recommendationsApiStub.get(() => { return { browse: () => { return new Promise((resolve) => { @@ -150,24 +158,23 @@ describe('{{#recommendations}} helper', function () { }); describe('when recommendations_enabled is false', function () { - beforeAll(function () { - settingsCacheGetStub.withArgs('recommendations_enabled').returns(true); + beforeEach(function () { + settingsCacheGetStub.withArgs('recommendations_enabled').returns(false); }); it('renders nothing', async function () { const response = await recommendations.call('recommendations'); - // No HTML is rendered - assert(response !== null && typeof response === 'object'); - assert.equal(response.string, ''); + // The helper returns before fetching recommendations or rendering anything + assert.equal(response, undefined); }); }); describe('when timeout is exceeded', function () { let clock: SinonFakeTimers; - beforeAll(function () { - sinon.stub(api, 'recommendationsPublic').get(() => { + beforeEach(function () { + recommendationsApiStub.get(() => { return { browse: () => { return new Promise((resolve) => { @@ -188,11 +195,8 @@ describe('{{#recommendations}} helper', function () { clock = sinon.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }); }); - afterEach(function () { + afterEach(async function () { clock.restore(); - }); - - afterAll(async function () { await configUtils.restore(); }); diff --git a/ghost/test/unit/frontend/helpers/search.test.ts b/ghost/test/unit/frontend/helpers/search.test.ts index d7b4a6cdc53b..63002f5817d4 100644 --- a/ghost/test/unit/frontend/helpers/search.test.ts +++ b/ghost/test/unit/frontend/helpers/search.test.ts @@ -1,8 +1,11 @@ import sinon from 'sinon'; // @ts-expect-error This module lacks type definitions. import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('Search helper', function () { + restoreHandlebarsAfterSuite(); + beforeAll(function () { registerHelper('search'); }); diff --git a/ghost/test/unit/frontend/helpers/social-accounts.test.ts b/ghost/test/unit/frontend/helpers/social-accounts.test.ts index 5922d78aa09f..80b2a4e18bcc 100644 --- a/ghost/test/unit/frontend/helpers/social-accounts.test.ts +++ b/ghost/test/unit/frontend/helpers/social-accounts.test.ts @@ -3,9 +3,11 @@ import errors from '@tryghost/errors'; // @ts-expect-error This module lacks type definitions. import handlebarsService from '../../../../core/frontend/services/handlebars'; // @ts-expect-error This module lacks type definitions. -import helpers from '../../../../core/frontend/services/helpers'; -// @ts-expect-error This module lacks type definitions. import social_accounts from '../../../../core/frontend/helpers/social_accounts'; +import { + freshHelperServiceForSuite, + restoreHandlebarsAfterSuite, +} from '../../../utils/handlebars-state'; const { handlebars } = handlebarsService.hbs; @@ -33,8 +35,11 @@ function compile(templateString: string) { } describe('{{#social_accounts}} helper', function () { + restoreHandlebarsAfterSuite(); + const helpers = freshHelperServiceForSuite(); + beforeAll(function () { - helpers.registerHelper('social_accounts', social_accounts); + helpers().registerHelper('social_accounts', social_accounts); defaultGlobals = { data: { diff --git a/ghost/test/unit/frontend/helpers/social-url.test.ts b/ghost/test/unit/frontend/helpers/social-url.test.ts index a736d6797fd8..fffb650fb5bb 100644 --- a/ghost/test/unit/frontend/helpers/social-url.test.ts +++ b/ghost/test/unit/frontend/helpers/social-url.test.ts @@ -2,9 +2,11 @@ import assert from 'node:assert/strict'; // @ts-expect-error This module lacks type definitions. import handlebarsService from '../../../../core/frontend/services/handlebars'; // @ts-expect-error This module lacks type definitions. -import helpers from '../../../../core/frontend/services/helpers'; -// @ts-expect-error This module lacks type definitions. import social_url from '../../../../core/frontend/helpers/social_url'; +import { + freshHelperServiceForSuite, + restoreHandlebarsAfterSuite, +} from '../../../utils/handlebars-state'; const { handlebars } = handlebarsService.hbs; @@ -34,10 +36,13 @@ function compile(templateString: string) { } describe('{{social_url}} helper', function () { + restoreHandlebarsAfterSuite(); + const helpers = freshHelperServiceForSuite(); + beforeAll(function () { // Register the helper using an object structure - helpers.registerHelper('social_url', social_url); - helpers.registerAlias('facebook_url', 'social_url'); + helpers().registerHelper('social_url', social_url); + helpers().registerAlias('facebook_url', 'social_url'); defaultGlobals = { data: { diff --git a/ghost/test/unit/frontend/helpers/split.test.ts b/ghost/test/unit/frontend/helpers/split.test.ts index 6cfcd0e9bbf7..bacf58410ccc 100644 --- a/ghost/test/unit/frontend/helpers/split.test.ts +++ b/ghost/test/unit/frontend/helpers/split.test.ts @@ -2,8 +2,11 @@ import { registerHelper, shouldCompileToExpected } from './utils/handlebars'; // @ts-expect-error This module lacks type definitions. import { SafeString } from '../../../../core/frontend/services/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../utils/handlebars-state'; describe('{{split}} helper in block mode', function () { + restoreHandlebarsAfterSuite(); + beforeAll(function () { registerHelper('split'); registerHelper('foreach'); @@ -98,6 +101,8 @@ describe('{{split}} helper in block mode', function () { }); describe('{{split}} helper in inline mode', function () { + restoreHandlebarsAfterSuite(); + beforeAll(function () { registerHelper('split'); registerHelper('foreach'); diff --git a/ghost/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js b/ghost/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js index 01b5b46e149c..158d6de0c867 100644 --- a/ghost/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js +++ b/ghost/test/unit/frontend/services/theme-engine/handlebars/helpers.test.js @@ -3,11 +3,16 @@ const fs = require('fs'); const path = require('path'); const _ = require('lodash'); const hbs = require('../../../../../../core/frontend/services/theme-engine/engine'); - -// Stuff we are testing -const helpers = require('../../../../../../core/frontend/services/helpers'); +const { + freshHelperServiceForSuite, + restoreHandlebarsAfterSuite, +} = require('../../../../../utils/handlebars-state'); describe('Helpers', function () { + restoreHandlebarsAfterSuite(); + // Stuff we are testing: a fresh helper service, so init registers every helper + const helpers = freshHelperServiceForSuite(); + const hbsHelpers = [ 'each', 'if', @@ -79,7 +84,7 @@ describe('Helpers', function () { describe('Load Core Helpers', function () { beforeAll(function () { hbs.express4(); - helpers.init(); + helpers().init(); }); // This will work when we finish refactoring diff --git a/ghost/test/unit/frontend/services/theme-engine/handlebars/template.test.ts b/ghost/test/unit/frontend/services/theme-engine/handlebars/template.test.ts index a40a264eb462..b26739652112 100644 --- a/ghost/test/unit/frontend/services/theme-engine/handlebars/template.test.ts +++ b/ghost/test/unit/frontend/services/theme-engine/handlebars/template.test.ts @@ -3,8 +3,11 @@ import errors from '@tryghost/errors'; import { assertExists } from '../../../../../utils/assertions'; // @ts-expect-error This module lacks type definitions. import { hbs, templates } from '../../../../../../core/frontend/services/handlebars'; +import { restoreHandlebarsAfterSuite } from '../../../../../utils/handlebars-state'; describe('Helpers Template', function () { + restoreHandlebarsAfterSuite(); + it('can execute a template', function () { hbs.registerPartial('test', '

Hello {{name}}

'); diff --git a/ghost/test/unit/server/data/db/backup.test.js b/ghost/test/unit/server/data/db/backup.test.js index c557ab5073a6..19060dbee6ef 100644 --- a/ghost/test/unit/server/data/db/backup.test.js +++ b/ghost/test/unit/server/data/db/backup.test.js @@ -9,8 +9,9 @@ describe('Backup', function () { let filenameStub; let fsStub; - afterEach(function () { + afterEach(async function () { sinon.restore(); + await configUtils.restore(); }); beforeEach(function () { diff --git a/ghost/test/unit/server/data/importer/index.test.js b/ghost/test/unit/server/data/importer/index.test.js index c4ac99d70b3a..7af76c06cfa6 100644 --- a/ghost/test/unit/server/data/importer/index.test.js +++ b/ghost/test/unit/server/data/importer/index.test.js @@ -201,16 +201,25 @@ describe('Importer', function () { // Step 1 of importing is loadFile describe('loadFile', function () { - // A failed processZip removes the directory it extracted, so the rejection - // cases below hand it a disposable directory instead of a fixture. + // A failed processZip removes the directory it extracted, so every case that + // runs it hands it a disposable copy rather than the checked-in fixture. That + // includes the cases expected to pass: one that fails, or times out and carries + // on after its stubs are restored, would otherwise delete the fixture. + const disposableDirectories = []; + async function disposableDirectory(fixture) { const directory = await fs.mkdtemp(path.join(os.tmpdir(), 'importer-fixture-')); + disposableDirectories.push(directory); if (fixture) { await fs.copy(fixture, directory); } return directory; } + afterEach(async function () { + await Promise.all(disposableDirectories.splice(0).map((directory) => fs.remove(directory))); + }); + it('knows when to process a file', async function () { const testFile = { name: 'myFile.json', path: '/my/path/myFile.json' }; const zipSpy = sinon.stub(ImportManager, 'processZip').returns(Promise.resolve({})); @@ -384,9 +393,8 @@ describe('Importer', function () { }); it('accepts a zip with a base directory', async function () { - const testDir = path.resolve( - __dirname, - '../../../../utils/fixtures/import/zips/zip-with-base-dir', + const testDir = await disposableDirectory( + path.resolve(__dirname, '../../../../utils/fixtures/import/zips/zip-with-base-dir'), ); const extractSpy = sinon .stub(ImportManager, 'extractZip') @@ -399,9 +407,8 @@ describe('Importer', function () { }); it('accepts a zip without a base directory', async function () { - const testDir = path.resolve( - __dirname, - '../../../../utils/fixtures/import/zips/zip-without-base-dir', + const testDir = await disposableDirectory( + path.resolve(__dirname, '../../../../utils/fixtures/import/zips/zip-without-base-dir'), ); const extractSpy = sinon .stub(ImportManager, 'extractZip') @@ -414,9 +421,8 @@ describe('Importer', function () { }); it('accepts a zip with an image directory', async function () { - const testDir = path.resolve( - __dirname, - '../../../../utils/fixtures/import/zips/zip-image-dir', + const testDir = await disposableDirectory( + path.resolve(__dirname, '../../../../utils/fixtures/import/zips/zip-image-dir'), ); const extractSpy = sinon .stub(ImportManager, 'extractZip') @@ -429,9 +435,11 @@ describe('Importer', function () { }); it('accepts a zip with uppercase image extensions', async function () { - const testDir = path.resolve( - __dirname, - '../../../../utils/fixtures/import/zips/zip-uppercase-extensions', + const testDir = await disposableDirectory( + path.resolve( + __dirname, + '../../../../utils/fixtures/import/zips/zip-uppercase-extensions', + ), ); const extractSpy = sinon .stub(ImportManager, 'extractZip') diff --git a/ghost/test/unit/server/lib/mailgun/mailgun-client.test.js b/ghost/test/unit/server/lib/mailgun/mailgun-client.test.js index e83c9f1e9416..9dc6a1776df0 100644 --- a/ghost/test/unit/server/lib/mailgun/mailgun-client.test.js +++ b/ghost/test/unit/server/lib/mailgun/mailgun-client.test.js @@ -66,6 +66,8 @@ describe('MailgunClient', function () { afterEach(function () { sinon.restore(); + // Interceptors a test registered but never hit would answer the next test's requests + nock.cleanAll(); }); describe('getBatchSize', function () { diff --git a/ghost/test/unit/server/models/user.test.js b/ghost/test/unit/server/models/user.test.js index b7f542dbc003..11c43377cb36 100644 --- a/ghost/test/unit/server/models/user.test.js +++ b/ghost/test/unit/server/models/user.test.js @@ -1235,6 +1235,15 @@ describe('Unit: models/user', function () { }); describe('ownerIdCache', function () { + // The cache lives on the shared User model, so start and end each test empty + beforeEach(function () { + models.User.ownerIdCache.clear(); + }); + + afterEach(function () { + models.User.ownerIdCache.clear(); + }); + it('should return null initially', function () { assert.equal(models.User.ownerIdCache.get(), null); }); diff --git a/ghost/test/unit/server/services/automations/automations-api.test.ts b/ghost/test/unit/server/services/automations/automations-api.test.ts index 81c00d1f8ea0..f8fa1733d443 100644 --- a/ghost/test/unit/server/services/automations/automations-api.test.ts +++ b/ghost/test/unit/server/services/automations/automations-api.test.ts @@ -5,8 +5,6 @@ import { vi } from 'vitest'; // @ts-expect-error @tryghost/domain-events currently lacks type declarations. import domainEvents from '@tryghost/domain-events'; -import * as automationsApi from '../../../../../core/server/services/automations/automations-api'; -import { StartAutomationsPollEvent } from '../../../../../core/server/services/automations/events/start-automations-poll-event'; import { EMPTY_EMAIL_LEXICAL, NON_EMPTY_EMAIL_LEXICAL, @@ -72,6 +70,19 @@ const buildEdge = (source: Readonly<{ id: string }>, target: Readonly<{ id: stri }); describe('automations API', function () { + let automationsApi: typeof import('../../../../../core/server/services/automations/automations-api'); + let StartAutomationsPollEvent: (typeof import('../../../../../core/server/services/automations/events/start-automations-poll-event'))['StartAutomationsPollEvent']; + + beforeAll(async function () { + // vi.mock only reaches modules loaded after it, and another file in this + // worker may already have loaded the API with its real repositories + vi.resetModules(); + automationsApi = + await import('../../../../../core/server/services/automations/automations-api'); + ({ StartAutomationsPollEvent } = + await import('../../../../../core/server/services/automations/events/start-automations-poll-event')); + }); + afterAll(function () { // Unit files share a worker module cache. Do not leave repositories imported // with these mocked dependencies for subsequent repository tests. diff --git a/ghost/test/unit/server/services/email-service/email-event-processor.test.js b/ghost/test/unit/server/services/email-service/email-event-processor.test.js index 00cc2b8f5d34..225adfec09b0 100644 --- a/ghost/test/unit/server/services/email-service/email-event-processor.test.js +++ b/ghost/test/unit/server/services/email-service/email-event-processor.test.js @@ -44,16 +44,15 @@ describe('Email Event Processor', function () { }); describe('getEmailId', function () { - let reuseProcessor; - it('Fetches from database', async function () { const emailId = await eventProcessor.getEmailId('provider-id'); assert.equal(emailId, 'fetched-email-id'); - reuseProcessor = eventProcessor; }); it('Returns from memory', async function () { + await eventProcessor.getEmailId('provider-id'); + sinon.stub(db, 'first').rejects('Should not be called'); - const emailId = await reuseProcessor.getEmailId('provider-id'); + const emailId = await eventProcessor.getEmailId('provider-id'); assert.equal(emailId, 'fetched-email-id'); }); }); diff --git a/ghost/test/unit/server/services/email-service/email-renderer.test.js b/ghost/test/unit/server/services/email-service/email-renderer.test.js index 4a68642b7705..a8156a7220d0 100644 --- a/ghost/test/unit/server/services/email-service/email-renderer.test.js +++ b/ghost/test/unit/server/services/email-service/email-renderer.test.js @@ -1058,7 +1058,11 @@ describe('Email renderer', function () { }); describe('getFromAddress', function () { - let siteTitle = 'Test Blog'; + let siteTitle; + beforeEach(function () { + siteTitle = 'Test Blog'; + }); + const emailRenderer = new EmailRenderer({ settingsCache: { get: (key) => { @@ -1121,32 +1125,38 @@ describe('Email renderer', function () { }); describe('getReplyToAddress', function () { - const emailAddressService = { - getAddress(addresses) { - return addresses; - }, - managedEmailEnabled: true, - }; - const emailRenderer = new EmailRenderer({ - settingsCache: { - get: (key) => { - if (key === 'title') { - return 'Test Blog'; - } + // Tests reconfigure the address service, so each one starts from a fresh one + let emailAddressService; + let emailRenderer; + + beforeEach(function () { + emailAddressService = { + getAddress(addresses) { + return addresses; }, - }, - settingsHelpers: { - getMembersSupportAddress: () => { - return 'support@example.com'; + managedEmailEnabled: true, + }; + emailRenderer = new EmailRenderer({ + settingsCache: { + get: (key) => { + if (key === 'title') { + return 'Test Blog'; + } + }, }, - getNoReplyAddress: () => { - return 'reply@example.com'; + settingsHelpers: { + getMembersSupportAddress: () => { + return 'support@example.com'; + }, + getNoReplyAddress: () => { + return 'reply@example.com'; + }, }, - }, - labs: { - isSet: () => false, - }, - emailAddressService, + labs: { + isSet: () => false, + }, + emailAddressService, + }); }); it('returns support address', function () { @@ -1246,25 +1256,29 @@ describe('Email renderer', function () { }); describe('getSegments', function () { - let emailRenderer = new EmailRenderer({ - renderers: { - lexical: { - render: () => { - return '

Lexical Test

'; + // Tests swap in their own renderer, so each one starts from the default + let emailRenderer; + beforeEach(function () { + emailRenderer = new EmailRenderer({ + renderers: { + lexical: { + render: () => { + return '

Lexical Test

'; + }, }, - }, - mobiledoc: { - render: () => { - return '

Mobiledoc Test

'; + mobiledoc: { + render: () => { + return '

Mobiledoc Test

'; + }, }, }, - }, - getPostUrl: () => { - return 'http://example.com/post-id'; - }, - labs: { - isSet: () => false, - }, + getPostUrl: () => { + return 'http://example.com/post-id'; + }, + labs: { + isSet: () => false, + }, + }); }); it('returns correct empty segment for post', async function () { diff --git a/ghost/test/unit/server/services/member-attribution/attribution.test.ts b/ghost/test/unit/server/services/member-attribution/attribution.test.ts index 2356e6521dda..79a14ac9f836 100644 --- a/ghost/test/unit/server/services/member-attribution/attribution.test.ts +++ b/ghost/test/unit/server/services/member-attribution/attribution.test.ts @@ -237,7 +237,8 @@ describe('AttributionBuilder', function () { }); it('Returns null referrer attribution', async function () { - attributionBuilder = new AttributionBuilder({ + // A builder of its own, so the shared one keeps its referrer translator + const nullReferrerBuilder = new AttributionBuilder({ urlTranslator, referrerTranslator: { getReferrerDetails() { @@ -250,7 +251,7 @@ describe('AttributionBuilder', function () { { id: '123', type: 'post', time: now + 124 }, { path: '/dir/unknown-page', time: now + 125 }, ]); - assertObjectMatches(await attributionBuilder.getAttribution(history), { + assertObjectMatches(await nullReferrerBuilder.getAttribution(history), { referrerSource: null, referrerMedium: null, referrerUrl: null, diff --git a/ghost/test/unit/server/services/member-welcome-emails/index.test.ts b/ghost/test/unit/server/services/member-welcome-emails/index.test.ts index 5c6440c5ba2d..0202f77b42d8 100644 --- a/ghost/test/unit/server/services/member-welcome-emails/index.test.ts +++ b/ghost/test/unit/server/services/member-welcome-emails/index.test.ts @@ -17,7 +17,11 @@ const automatedEmails = require('../../../../../core/server/api/endpoints/automa const automationEmailPreviews = require('../../../../../core/server/api/endpoints/automation-email-previews'); const constants = require('../../../../../core/server/services/member-welcome-emails/constants'); const MemberWelcomeEmailService = require('../../../../../core/server/services/member-welcome-emails/member-welcome-email-service'); -const root = require('../../../../../core/server/services/member-welcome-emails').default; +// The API endpoints hold this instance, so the consumer suite stubs it rather than a fresh root +const sharedRoot = require('../../../../../core/server/services/member-welcome-emails').default; +const ROOT_PATH = require.resolve('../../../../../core/server/services/member-welcome-emails'); + +type Root = (typeof import('../../../../../core/server/services/member-welcome-emails'))['default']; const { MESSAGES } = constants; @@ -92,19 +96,24 @@ const automationEmail = { automationRunStepId: 'step-id', }; -// The root retains one instance for the process. The initialization suite boots it first, and -// later suites boot it themselves when run alone, always through a stubbed emitter so the shared -// bus never gets a listener from this file. They reload it to reset the caches they exercise. +// The root retains one instance for the process, so each test loads a fresh copy and boots it +// itself, always through a stubbed emitter so the shared bus never gets a listener from this file. +// The cached module is put back afterwards, so no ready instance outlives this file. describe('Member welcome emails root', function () { const settings: Attributes = {}; let sendTransactional: sinon.SinonStub; - let localeListener: (model: { get: (key: string) => string }) => unknown; + let cachedRoot: NodeJS.Module | undefined; + let root: Root; beforeAll(function () { emailAddressService.init(); }); beforeEach(function () { + cachedRoot = require.cache[ROOT_PATH]; + delete require.cache[ROOT_PATH]; + root = require(ROOT_PATH).default; + Object.assign(settings, { title: 'Test Site', locale: 'en', accent_color: '#15212A' }); sinon.stub(settingsCache, 'get').callsFake((key) => settings[key as string]); sinon.stub(logging, 'info'); @@ -114,13 +123,16 @@ describe('Member welcome emails root', function () { }); afterEach(function () { + delete require.cache[ROOT_PATH]; + if (cachedRoot) { + require.cache[ROOT_PATH] = cachedRoot; + } sinon.restore(); for (const key of Object.keys(settings)) { delete settings[key]; } }); - // init is idempotent, so after the initialization suite this only returns the retained instance. async function initRoot() { const on = sinon.stub(events, 'on'); sinon.define(linkTracking, 'service', { addAutomationTrackingToUrl: sinon.stub() }); @@ -158,11 +170,11 @@ describe('Member welcome emails root', function () { await root.init(); sinon.assert.calledOnceWithExactly(on, 'settings.locale.edited', sinon.match.func); - localeListener = on.firstCall.args[1]; assert.ok(root.service instanceof MemberWelcomeEmailService); }); it('retains the same instance and listener across repeated init', async function () { + await initRoot(); const on = sinon.stub(events, 'on'); const service = root.service; @@ -174,6 +186,7 @@ describe('Member welcome emails root', function () { }); it('has no welcome content to send until loadMemberWelcomeEmails runs', async function () { + await initRoot(); const findAutomation = sinon.stub(models.Automation, 'findOne').resolves(welcomeRow()); await assert.rejects(root.service.send({ member, memberStatus: 'free' }), { @@ -185,6 +198,12 @@ describe('Member welcome emails root', function () { }); it('renders with the translator it built for the configured locale and follows locale edits', async function () { + settings.locale = 'fr'; + sinon.define(linkTracking, 'service', { addAutomationTrackingToUrl: sinon.stub() }); + const on = sinon.stub(events, 'on'); + await root.init(); + const localeListener: (model: { get: (key: string) => string }) => unknown = + on.firstCall.args[1]; sinon.stub(models.Newsletter, 'getDefaultNewsletter').resolves(newsletter('First')); sinon.stub(models.Automation, 'findOne').resolves(welcomeRow()); await root.service.loadMemberWelcomeEmails(); @@ -214,7 +233,7 @@ describe('Member welcome emails root', function () { previewAutomationEmail: sinon.stub().resolves({ html: '

Preview

' }), sendTestAutomationEmail: sinon.stub().resolves(), }; - sinon.stub(root, 'service').get(() => api); + sinon.stub(sharedRoot, 'service').get(() => api); sinon.stub(models.EmailDesignSetting, 'findOne').resolves(designSettings); }); diff --git a/ghost/test/unit/server/services/post-scheduling/post-scheduling.test.js b/ghost/test/unit/server/services/post-scheduling/post-scheduling.test.js index e692f5d863b4..ce182f70d331 100644 --- a/ghost/test/unit/server/services/post-scheduling/post-scheduling.test.js +++ b/ghost/test/unit/server/services/post-scheduling/post-scheduling.test.js @@ -82,6 +82,28 @@ describe('PostScheduling', function () { }); describe('constructor', function () { + // The constructor wires its handlers onto the shared events emitter, so + // take off the ones it added, and the scheduler mocks it never reached + const scheduleEvents = ['post', 'page'].flatMap((resource) => + ['scheduled', 'rescheduled', 'unscheduled'].map((event) => `${resource}.${event}`), + ); + let listenersBefore; + + beforeEach(function () { + listenersBefore = new Map(scheduleEvents.map((event) => [event, events.listeners(event)])); + }); + + afterEach(function () { + for (const event of scheduleEvents) { + for (const listener of events.listeners(event)) { + if (!listenersBefore.get(event).includes(listener)) { + events.removeListener(event, listener); + } + } + } + nock.cleanAll(); + }); + it('wires event handlers and starts the adapter', async function () { const post = Post.forge( testUtils.DataGenerator.forKnex.createPost({ diff --git a/ghost/test/unit/server/services/themes/validate.test.js b/ghost/test/unit/server/services/themes/validate.test.js index 93175e01bba9..a238f8d2058a 100644 --- a/ghost/test/unit/server/services/themes/validate.test.js +++ b/ghost/test/unit/server/services/themes/validate.test.js @@ -162,12 +162,17 @@ describe('Themes', function () { path: '/path/to/theme', }; - beforeAll(function () { - list.init(); + // A fresh gscan cache per test, so each one decides whether a result is cached + beforeEach(function () { + adapterStub = sinon.stub(adapterManager, 'getAdapter').returns(new InMemoryCache()); list.set(testTheme.name, testTheme); validate.init(); }); + afterEach(function () { + list.del(testTheme.name); + }); + it('Does an initial check if not cached yet', async function () { checkStub.resolves({}); formatStub.returns({ results: { error: [{ hello: 'world' }] } }); @@ -179,6 +184,12 @@ describe('Themes', function () { }); it('Reuses same result if called again', async function () { + checkStub.resolves({}); + formatStub.returns({ results: { error: [{ hello: 'world' }] } }); + await validate.getThemeErrors(testTheme.name); + checkStub.resetHistory(); + formatStub.resetHistory(); + const checkedTheme = await validate.getThemeErrors(testTheme.name); sinon.assert.notCalled(checkStub); sinon.assert.notCalled(formatStub); @@ -194,7 +205,7 @@ describe('Themes', function () { it('Silently fails when cache adapter throws', async function () { loggingStub = sinon.stub(logging, 'error'); - sinon.stub(adapterManager, 'getAdapter').returns({ + adapterStub.returns({ get: () => { throw new Error('test'); }, diff --git a/ghost/test/unit/server/services/tiers/tiers-api.test.js b/ghost/test/unit/server/services/tiers/tiers-api.test.js index 29573b8df0c4..d34d4963cc5d 100644 --- a/ghost/test/unit/server/services/tiers/tiers-api.test.js +++ b/ghost/test/unit/server/services/tiers/tiers-api.test.js @@ -10,7 +10,8 @@ describe('TiersAPI', function () { /** @type {TiersAPI} */ let api; - beforeAll(function () { + // A fresh repository per test, so each test sees only the tiers it adds + beforeEach(function () { repository = new InMemoryTierRepository(); api = new TiersAPI({ repository, @@ -83,7 +84,21 @@ describe('TiersAPI', function () { assert(updated.status === 'archived'); }); + function addPaidTier(name = 'My testing Tier') { + return api.add({ + name, + type: 'paid', + monthlyPrice: 5000, + yearlyPrice: 50000, + currency: 'usd', + }); + } + it('Can browse tiers', async function () { + await addPaidTier(); + await addPaidTier(); + await addPaidTier(); + const page = await api.browse(); assert(page.data.length === 3); @@ -91,6 +106,10 @@ describe('TiersAPI', function () { }); it('Can read a default tier', async function () { + const archived = await addPaidTier('Archived Tier'); + await api.edit(archived.id.toHexString(), { status: 'archived' }); + await addPaidTier(); + const defaultTier = await api.readDefaultTier(); assert.equal(defaultTier?.name, 'My testing Tier'); diff --git a/ghost/test/unit/server/web/admin/controller.test.js b/ghost/test/unit/server/web/admin/controller.test.js index 6fa59062ae7a..da88f73749d7 100644 --- a/ghost/test/unit/server/web/admin/controller.test.js +++ b/ghost/test/unit/server/web/admin/controller.test.js @@ -21,8 +21,9 @@ describe('Admin App', function () { ); }); - afterEach(function () { + afterEach(async function () { sinon.restore(); + await configUtils.restore(); }); it('adds x-frame-options header when adminFrameProtection is enabled (default)', function () { diff --git a/ghost/test/utils/e2e-framework-mock-manager.js b/ghost/test/utils/e2e-framework-mock-manager.js index fa0836f20c5a..1e79fbc49fef 100644 --- a/ghost/test/utils/e2e-framework-mock-manager.js +++ b/ghost/test/utils/e2e-framework-mock-manager.js @@ -590,9 +590,10 @@ const restore = () => { mailService.GhostMailer.prototype.sendMail = originalMailServiceSendMail; - // Disable network again after restoring sinon + // Disable network again after restoring sinon. The webmention discovery + // mocks are left to the DB lane's setup, which re-registers them after every + // test: unit files call restore() too, and must not inherit them. disableNetwork(); - mockWebmentionDiscoveryDomains(); }; module.exports = { diff --git a/ghost/test/utils/handlebars-state.ts b/ghost/test/utils/handlebars-state.ts new file mode 100644 index 000000000000..e9eaccda54c4 --- /dev/null +++ b/ghost/test/utils/handlebars-state.ts @@ -0,0 +1,128 @@ +// beforeAll and afterAll are the unit project's globals rather than imports: +// CommonJS test files require() this module, and Vitest can't be required. + +interface HandlebarsRegistry { + helpers: Record; + partials: Record; + registerHelper(name: string, helper: unknown): void; + unregisterHelper(name: string): void; + registerPartial(name: string, partial: unknown): void; + unregisterPartial(name: string): void; +} + +// The theme engine's Handlebars instance, which every helper and template shares +const themeHandlebars: HandlebarsRegistry = + require('../../core/frontend/services/theme-engine/engine').handlebars; + +function restoreEntries( + current: Record, + saved: Record, + register: (name: string, value: unknown) => void, + unregister: (name: string) => void, +) { + for (const name of Object.keys(current)) { + if (!(name in saved)) { + unregister(name); + } + } + for (const [name, value] of Object.entries(saved)) { + if (current[name] !== value) { + register(name, value); + } + } +} + +/** + * Records the helpers and partials registered on the theme Handlebars instance, + * and returns a function that puts them back. + */ +export function snapshotHandlebars(handlebars: HandlebarsRegistry = themeHandlebars): () => void { + const helpers = { ...handlebars.helpers }; + const partials = { ...handlebars.partials }; + + return () => { + restoreEntries( + handlebars.helpers, + helpers, + (name, helper) => handlebars.registerHelper(name, helper), + (name) => handlebars.unregisterHelper(name), + ); + restoreEntries( + handlebars.partials, + partials, + (name, partial) => handlebars.registerPartial(name, partial), + (name) => handlebars.unregisterPartial(name), + ); + }; +} + +/** + * Call first in a describe block that registers Handlebars helpers or + * partials: they are put back as they were once the block finishes. + * + * Unit test files share one module registry per worker, so a helper or partial + * a file registers, such as a stand-in helper or a test template partial, is + * otherwise still registered for whichever file runs next. A file that renders + * with a helper it never registered then passes only after one that did. + */ +export function restoreHandlebarsAfterSuite(): void { + let restore: () => void = () => {}; + + beforeAll(function () { + restore = snapshotHandlebars(); + }); + + afterAll(function () { + restore(); + }); +} + +interface HelperService { + registerHelper(name: string, helper: unknown): void; + registerAlias(alias: string, name: string): void; + init(): void; +} + +// The theme helper service remembers every name it has registered and skips it +// next time, even once the helper itself is gone from Handlebars +const helperServiceModules = ['index', 'registry', 'register-ghost-helpers'].map((name) => + require.resolve(`../../core/frontend/services/helpers/${name}`), +); + +/** + * Call in a describe block that registers helpers through Ghost's helper + * service, alongside restoreHandlebarsAfterSuite(). The block gets a fresh copy + * of the service, so the names it registers don't stay remembered by the shared + * one: there, a later helpers.init() would skip them and leave them missing. + * + * @returns a getter for the block's copy of the service + */ +export function freshHelperServiceForSuite(): () => HelperService { + let saved: (NodeJS.Module | undefined)[] = []; + let service: HelperService | undefined; + + beforeAll(function () { + saved = helperServiceModules.map((modulePath) => require.cache[modulePath]); + for (const modulePath of helperServiceModules) { + delete require.cache[modulePath]; + } + service = require(helperServiceModules[0]); + }); + + afterAll(function () { + helperServiceModules.forEach((modulePath, index) => { + delete require.cache[modulePath]; + if (saved[index]) { + require.cache[modulePath] = saved[index]; + } + }); + service = undefined; + }); + + return () => { + if (!service) { + throw new Error('The helper service is only available while its describe block runs'); + } + return service; + }; +} diff --git a/ghost/vitest.config.ts b/ghost/vitest.config.ts index bff66e781c3e..e56b680a8f0b 100644 --- a/ghost/vitest.config.ts +++ b/ghost/vitest.config.ts @@ -28,6 +28,15 @@ const resolveSnapshotPath = (testPath: string, snapExtension: string) => path.basename(testPath) + snapExtension, ); +// CI sets GHOST_UNIT_TEST_SEED to run the unit suite in a shuffled order, files +// and the tests inside them, so a test that only passes after another one fails +// in the PR that introduces it. One seed covers a whole CI run, retries +// included, so a retry can't pass by drawing a luckier order. Vitest prints it +// as `Running tests with seed ""`; docs/contributing/testing.md covers +// rerunning that order locally. +const shuffleSeed = Number(process.env.GHOST_UNIT_TEST_SEED) || undefined; +const sequence = shuffleSeed ? { shuffle: true, seed: shuffleSeed } : {}; + const unitConfig = { globals: true, environment: 'node' as const, @@ -52,6 +61,9 @@ const unitConfig = { export default defineConfig({ test: { resolveSnapshotPath, + // Set here as well as on the project: the reporter that prints the seed + // reads the root config, and the project's own run order reads its own. + sequence, // Local runs use the compact `dot` reporter. CI uses `default` // (names each file) plus `github-actions` for inline annotations. reporters: process.env.GITHUB_ACTIONS ? ['default', 'github-actions'] : ['dot'], @@ -78,6 +90,7 @@ export default defineConfig({ ...unitConfig, name: 'unit', isolate: false, + sequence, include: ['test/unit/**/*.test.{js,ts}'], exclude: ['**/node_modules/**'], }, From 9c850e1173c9e705c005cf441184bb15e8506948 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 12 Nov 2026 10:12:16 +0000 Subject: [PATCH 025/174] Added dependency boundary enforcement for all services (#32801) closes https://linear.app/ghost/issue/PLA-550/prevent-new-hidden-dependencies-in-service-implementations The service dependency rules only applied to services marked `migrated`, so a new hidden dependency in any other service passed CI. They now apply to every service. - **One scan.** `pnpm lint:boundaries` runs `tools/scripts/ci/check-boundaries.ts`, and the `gx services` reports read the same run. The separate audit mode and `GHOST_SERVICE_DEPENDENCY_AUDIT` are gone. - **Known violations.** The 352 existing violations are listed in `.dependency-cruiser-known-violations.json`. Lint fails on a new violation, a moved file, a stale or duplicate entry, and any entry for a migrated service. The file should only shrink. - **Four services are deferred.** `automations`, `members`, `members-metafields` and `stripe` change too often for a file-level list: they added most of the new violations over the previous 30 days, and a list covering them went stale within a day. Their 235 violations stay in reports and in the lint summary, but do not fail lint. A service leaves the list when it is migrated. - **Computed imports.** The scan only follows literal module names, so `import/no-dynamic-require` now rejects a computed `require()` or `import()` in service files. Two existing uses load an email template by name from their own folder and keep a narrow exception. CODEOWNERS covers the rule config, the known-violations file and the checker. Not covered here: removing a service's `migrated` marker together with its lint path still passes. That is the root contract rather than dependencies, and follows separately. Validation: - [x] `pnpm lint:boundaries`: 6029 modules, 352 known violations, 235 deferred - [x] `pnpm format:check`, `pnpm lint:oxlint`, `pnpm lint:docs` - [x] `tools/scripts`: `pnpm test:unit` (341 pass), `pnpm test:types`, `pnpm lint` - [x] `tools/gx`: `pnpm test:unit` (126 pass), `pnpm test:types`, `pnpm lint` - [x] The service inventory test (98 pass) - [x] Manual check: 19 bypass attempts against the real tree are rejected, including new and moved files, dynamic imports, re-exports, nested indexes, a dependency routed through a new `server/lib` file, and known-violation entries for migrated or deferred services - [ ] `pnpm check` did not pass locally. Format and lint pass. 19 test files failed in the parallel run and each passes when run alone; two gift-preview files need a longer timeout --- .dependency-cruiser-known-violations.json | 1762 +++++++++++++++++ .dependency-cruiser.cjs | 29 +- .github/CODEOWNERS | 5 + .oxlintrc.json | 7 + ghost/core/server/services/README.md | 55 +- .../comments-service-email-renderer.js | 1 + .../services/staff/staff-service-emails.js | 1 + package.json | 12 +- tools/configs/eslint/README.md | 2 +- tools/gx/README.md | 14 +- tools/gx/package.json | 4 +- tools/gx/services.ts | 32 +- tools/gx/test/create-service.test.ts | 13 +- tools/gx/test/services.test.ts | 57 +- tools/scripts/README.md | 8 +- tools/scripts/ci/check-boundaries.ts | 31 + tools/scripts/lib/dependency-boundaries.ts | 139 ++ tools/scripts/package.json | 4 +- tools/scripts/test/oxlint.test.ts | 25 +- .../scripts/test/service-dependencies.test.ts | 243 ++- 20 files changed, 2320 insertions(+), 124 deletions(-) create mode 100644 .dependency-cruiser-known-violations.json create mode 100644 tools/scripts/ci/check-boundaries.ts create mode 100644 tools/scripts/lib/dependency-boundaries.ts diff --git a/.dependency-cruiser-known-violations.json b/.dependency-cruiser-known-violations.json new file mode 100644 index 000000000000..f9b48c12c07a --- /dev/null +++ b/.dependency-cruiser-known-violations.json @@ -0,0 +1,1762 @@ +[ + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "ghost/core/server/data/db/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "ghost/core/server/lib/common/events.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "ghost/core/server/services/identity-tokens/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/activitypub/activity-pub-service-wrapper.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/adapter-paths.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/cache-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/jobs-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/redirects-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/route-settings-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/scheduling-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/sso-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/adapter-manager/base-classes.ts", + "to": "packages/adapters/storage-base/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/csv/parse.ts", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/csv/parse.ts", + "to": "papaparse" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/csv/serialize.ts", + "to": "papaparse" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/assets.ts", + "to": "ghost/core/server/data/importer/content-files.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/importer.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/importer.ts", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/media.ts", + "to": "ghost/core/server/services/media-inliner/origin-schemes.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/relations.ts", + "to": "@tryghost/validator" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/row.ts", + "to": "temporal-polyfill" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/source.ts", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/source.ts", + "to": "ghost/core/server/data/importer/import-archive.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/content-import/import/source.ts", + "to": "glob" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/redirect-config-parser.ts", + "to": "js-yaml" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/redirects-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/redirects-service.ts", + "to": "ghost/core/server/web/shared/dynamic-redirect-manager.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/redirects-service.ts", + "to": "ghost/core/shared/errify.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/utils.ts", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/custom-redirects/validation.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-address/email-address-service-wrapper.js", + "to": "@tryghost/validator" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-address/email-address-service-wrapper.js", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-address/email-address-service-wrapper.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-address/email-address-service-wrapper.js", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-address/email-address-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/automation-email-analytics-batch-processor.ts", + "to": "ghost/core/server/lib/mailgun/mailgun-message-id.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/email-analytics-service-wrapper.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/email-analytics-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/fetch-mailgun-events.ts", + "to": "ghost/core/server/lib/mailgun/mailgun-client.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/gift-email-analytics-batch-processor.ts", + "to": "ghost/core/server/lib/mailgun/mailgun-message-id.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/email-analytics-job-scheduler.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/email-analytics-job-scheduler.ts", + "to": "ghost/core/server/services/jobs-service/cron.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/email-analytics-job-scheduler.ts", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/index.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/index.js", + "to": "ghost/core/server/services/jobs-service/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/jobs/index.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/lib/queries.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/lib/queries.ts", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-analytics/newsletter-email-analytics-batch-processor.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/batch-sending-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/batch-sending-service.js", + "to": "ghost/core/server/lib/promise-pool.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-event-processor.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "clsx" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "fs" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "ghost/core/server/services/members/content-gating.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "koenig/kg-converters/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-renderer.js", + "to": "luxon" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "assert/strict" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/adapters/storage/utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/api/endpoints/utils/serializers/output/utils/url.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/data/db/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/lib/common/events.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/lib/image/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/lib/lexical.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/lib/mailgun/mailgun-client.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/audience-feedback/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/email-address/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/email-analytics/jobs/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/limits.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/link-tracking/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/member-attribution/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/members/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/server/services/url/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/shared/sentry.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service-wrapper.js", + "to": "packages/i18n/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/email-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/mailgun-email-provider.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/newsletter-email-event-storage.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/newsletter-email-event-storage.js", + "to": "ghost/core/server/lib/db-types/affected-rows.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/newsletter-email-event-storage.js", + "to": "ghost/core/server/lib/db-types/count.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/newsletter-email-event-storage.js", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/recipient-accounting.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/sending-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/sending-service.js", + "to": "@tryghost/validator" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-service/sending-status-schema.ts", + "to": "ghost/core/server/lib/db-types/count.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/email-suppression-list.js", + "to": "assert/strict" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/mailgun-email-suppression-list.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/mailgun-email-suppression-list.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/mailgun-email-suppression-list.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/mailgun-email-suppression-list.js", + "to": "ghost/core/server/services/email-service/events/email-bounced-event.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/mailgun-email-suppression-list.js", + "to": "ghost/core/server/services/email-service/events/spam-complaint-event.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/service.js", + "to": "ghost/core/server/lib/mailgun/mailgun-client.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/service.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/email-suppression-list/service.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-checkout-adapter.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-delivery-service.ts", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-delivery-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-email-renderer.ts", + "to": "fs" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-email-service.ts", + "to": "@tryghost/color-utils" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-email-service.ts", + "to": "ghost/core/server/lib/mailgun/mailgun-message-id.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift-service.ts", + "to": "luxon" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/gift.ts", + "to": "luxon" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/gifts/jobs/index.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/identity-tokens/identity-token-service-wrapper.js", + "to": "ghost/core/server/services/signing-keys/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/identity-tokens/identity-token-service-wrapper.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/identity-tokens/identity-token-service.ts", + "to": "jsonwebtoken" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/jobs-service.ts", + "to": "cron-validate" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/jobs-service.ts", + "to": "ghost/core/server/lib/after-commit.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/data/importer/jobs/content-import-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/content-import/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/content-import/jobs/content-csv-import-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/email-analytics/jobs/email-analytics-automation-fetch-latest-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/email-analytics/jobs/email-analytics-fetch-latest-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/email-analytics/jobs/email-analytics-gift-fetch-latest-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/email-service/jobs/send-email-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/gifts/jobs/clean-gifts-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/gifts/jobs/send-gift-reminders-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/media-inliner/external-media-inliner-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/members/jobs/clean-expired-comped-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/members/jobs/clean-tokens-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/members/jobs/members-import-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/mentions/process-webmention-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/mentions/send-webmentions-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/signing-keys/check-signing-keys-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/signing-keys/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/tinybird-sync/jobs/tinybird-sync-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/update-check/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/jobs-service/register-job-handlers.ts", + "to": "ghost/core/server/services/update-check/jobs/update-check-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/limits.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/limits.ts", + "to": "ghost/core/server/data/db/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/limits.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/limits.ts", + "to": "packages/limit-service/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-repository.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-repository.js", + "to": "ghost/core/shared/sentry.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-repository.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-tracking-service.js", + "to": "ghost/core/server/services/link-redirection/redirect-event.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-tracking-service.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-tracking-service.js", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/link-click-tracking-service.js", + "to": "packages/nql-string/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/link-tracking/post-link-repository.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "mppx/server" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/mpp-adapter.ts", + "to": "stripe" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "@x402/core/server" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "@x402/evm/exact/server" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "@x402/hono" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/adapters/x402-adapter.ts", + "to": "hono" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/content-loader.ts", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/eligibility.ts", + "to": "ghost/core/shared/machine-payments.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/service.ts", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/service.ts", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/service.ts", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/deposit-address-store.ts", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/deposit-address-store.ts", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/deposit-address-store.ts", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/deposit-address-store.ts", + "to": "stripe" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/payment-recorder.ts", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/payment-recorder.ts", + "to": "stripe" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/machine-payments/stripe/stripe-client-options.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/members-events/last-seen-at-cache.js", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/members-events/last-seen-at-updater.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/members-events/last-seen-at-updater.js", + "to": "ghost/core/server/services/email-service/events/email-opened-event.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/members-events/last-seen-at-updater.js", + "to": "ghost/core/shared/events/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/members-events/last-seen-at-updater.js", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "ghost/core/server/data/db/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/service.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/service.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/service.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/slack-notifications.js", + "to": "@tryghost/validator" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/slack-notifications.js", + "to": "@tryghost/version" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/slack-notifications.js", + "to": "ghost/core/server/lib/request-external.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/milestones/slack-notifications/slack-notifications.js", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/notifications/notifications.js", + "to": "@tryghost/version" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/notifications/notifications.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/notifications/notifications.js", + "to": "moment-timezone" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/notifications/notifications.js", + "to": "semver" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/notifications/sanitize-notification-html.ts", + "to": "sanitize-html" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/extract-metadata.ts", + "to": "chrono-node" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/extract-metadata.ts", + "to": "entities" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/extract-metadata.ts", + "to": "jsonrepair" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/extract-metadata.ts", + "to": "tldts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/extract-oembed.ts", + "to": "@extractus/oembed-extractor" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/oembed-service.js", + "to": "@extractus/oembed-extractor" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/oembed-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/oembed-service.js", + "to": "iconv-lite" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/oembed-service.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/oembed-service.js", + "to": "packages/image-transform/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/service.js", + "to": "ghost/core/server/lib/request-external.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/service.js", + "to": "ghost/core/server/services/adapter-manager/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/oembed/twitter-oembed-provider.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/application/offers-api.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/domain/models/shared/value-object.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/offer-bookshelf-repository.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/offer-bookshelf-repository.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/offer-bookshelf-repository.js", + "to": "ghost/core/shared/sentry.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/offer-bookshelf-repository.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/offers-module.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/service.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/service.js", + "to": "ghost/core/server/web/shared/dynamic-redirect-manager.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/offers/service.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/permissions/actions-map-cache.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/permissions/can-this.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/permissions/can-this.js", + "to": "ghost/core/server/models/role-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/permissions/can-this.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/permissions/providers.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "ghost/core/server/adapters/scheduling/build-signed-job.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "ghost/core/server/adapters/scheduling/get-scheduler-idempotency-key.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "ghost/core/server/lib/common/events.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/post-scheduling/post-scheduling.ts", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-email-handler.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-email-handler.js", + "to": "ghost/core/server/services/email-service/email-service.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-scheduling.js", + "to": "ghost/core/server/api/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-scheduling.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-scheduling.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-scheduling.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/post-scheduling.js", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-exporter.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-exporter.js", + "to": "stream" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/server/api/endpoints/utils/serializers/output/utils/url.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/server/services/email-service/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service-instance.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "ghost/core/server/api/endpoints/utils/api-filter-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "ghost/core/server/lib/after-commit.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "ghost/core/shared/events-ts/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/posts-service.js", + "to": "lodash/pick" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/posts/stats/post-stats.js", + "to": "ghost/core/server/data/db/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/remote-flags/remote-flags-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/route-settings/dynamic-routing-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/route-settings/dynamic-routing-service.js", + "to": "ghost/core/bridge.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/route-settings/dynamic-routing-service.js", + "to": "ghost/core/server/services/url/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/route-settings/route-settings-parser.ts", + "to": "js-yaml" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/route-settings/yaml-parser.js", + "to": "js-yaml" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings-helpers/settings-helpers.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings-helpers/settings-helpers.js", + "to": "net" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-bread-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-bread-service.js", + "to": "ghost/core/server/services/stripe/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-bread-service.js", + "to": "ghost/core/shared/sentry.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-bread-service.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/lib/common/events.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/lib/mail/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/lib/tracing/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/services/adapter-manager/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/services/email-address/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/services/limits.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/services/members/single-use-token-provider.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/server/services/settings-helpers/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-service.js", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-utils.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-utils.js", + "to": "@tryghost/validator" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/settings/settings-utils.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/activate.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/activation-bridge.js", + "to": "ghost/core/bridge.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/activation-bridge.js", + "to": "ghost/core/server/services/custom-theme-settings/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/installer.js", + "to": "@tryghost/request" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/installer.js", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/installer.js", + "to": "ghost/core/server/services/limits.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/installer.js", + "to": "os" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/list.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/loader.js", + "to": "ghost/core/server/lib/package-json/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/loader.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/storage.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/storage.js", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/storage.js", + "to": "ghost/core/server/services/custom-theme-settings/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/storage.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/theme-storage.js", + "to": "@tryghost/zip" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/theme-storage.js", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/theme-storage.js", + "to": "ghost/core/server/adapters/storage/LocalStorageBase.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/theme-storage.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/theme-storage.js", + "to": "os" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/to-json.js", + "to": "ghost/core/bridge.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/to-json.js", + "to": "ghost/core/server/lib/package-json/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/to-json.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/to-json.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/upload-size-limit-reporter.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/upload-size-limit-reporter.js", + "to": "ghost/core/shared/sentry.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "@tryghost/version" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "fs-extra" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "ghost/core/server/services/adapter-manager/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "ghost/core/shared/labs.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "gscan" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/themes/validate.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/tinybird-sync/tinybird-sync-service.ts", + "to": "ghost/core/server/services/jobs-service/cron.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/tinybird/tinybird-service-wrapper.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/tinybird/tinybird-service-wrapper.js", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/tinybird/tinybird-service-wrapper.js", + "to": "ghost/core/shared/settings-cache/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/tinybird/tinybird-service.js", + "to": "jsonwebtoken" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/update-check/update-check-service.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/update-check/update-check-service.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/update-check/update-check-service.js", + "to": "moment" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/lazy-find-resource.ts", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/lazy-url-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/lazy-url-service.ts", + "to": "ghost/core/shared/url-utils.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/permalink-matcher.ts", + "to": "path-match" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/routable-resources.js", + "to": "@tryghost/database-info" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/routable-resources.js", + "to": "ghost/core/server/data/schema/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/routable-resources.js", + "to": "ghost/core/server/models/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/url/router-filter.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/verification-trigger.js", + "to": "@tryghost/domain-events" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/verification-trigger.js", + "to": "ghost/core/shared/events/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/verification/verification-webhook-service.ts", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/verification/verification-webhook-service.ts", + "to": "@tryghost/request" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/verification/verification-webhook-service.ts", + "to": "ghost/core/shared/config/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/listen.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/serialize.js", + "to": "ghost/core/server/api/index.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/serialize.js", + "to": "ghost/core/server/services/members/utils.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/serialize.js", + "to": "lodash" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/serialize.js", + "to": "packages/api-framework/src/index.ts" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/webhook-trigger.js", + "to": "@tryghost/logging" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/webhook-trigger.js", + "to": "@tryghost/request" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/webhook-trigger.js", + "to": "@tryghost/version" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/webhook-trigger.js", + "to": "ghost/core/server/lib/request-external.js" + }, + { + "rule": "service-dependencies", + "from": "ghost/core/server/services/webhooks/webhook-trigger.js", + "to": "ghost/core/shared/config/index.ts" + } +] diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjs index e26c431f5675..6c530ad241cf 100644 --- a/.dependency-cruiser.cjs +++ b/.dependency-cruiser.cjs @@ -1,24 +1,13 @@ 'use strict'; -const { readFileSync } = require('node:fs'); -const path = require('node:path'); -const yaml = require('js-yaml'); const { sourceExclusions } = require('./tools/scripts/ci/service-dependency-resolver.mjs'); -// Keep service policy here. The audit applies it to every service; normal lint -// applies it only to entries marked migrated in the inventory. +// Service policy applies independently of inventory and migration status. const servicesRoot = 'ghost/core/server/services'; -const auditServices = process.env.GHOST_SERVICE_DEPENDENCY_AUDIT === '1'; -const { services } = yaml.load( - readFileSync(path.join(__dirname, servicesRoot, 'service-inventory.yaml'), 'utf8'), -); -const migratedServices = Object.entries(services) - .filter(([, entry]) => entry.migrated === true) - .map(([name]) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')) - .join('|'); const serviceImplementations = { - path: `^${servicesRoot}/(${auditServices ? '[^/]+' : migratedServices || '(?!)'})(?:/|$)`, - pathNot: `^${servicesRoot}/[^/]+/index\\.${auditServices ? '(?:js|ts)' : 'ts'}$`, + path: `^${servicesRoot}/([^/]+)(?:/|$)`, + // Legacy JS roots remain wiring candidates; nested indexes are implementations. + pathNot: `^${servicesRoot}/[^/]+/index\\.(?:js|ts)$`, }; // Explicit code-library and contract allowances, not application instances. @@ -364,12 +353,10 @@ module.exports = { webpackConfig: { fileName: './tools/scripts/ci/service-dependency-resolver.mjs' }, // Keep incoming edges to built packages visible without scanning their output. doNotFollow: { - path: auditServices - ? `^(?!${servicesRoot}/)` - : [ - 'node_modules', - '^(?!ghost/core/server/services/)(apps|ghost|packages|koenig)/.*/(build|built|dist)/', - ], + path: [ + 'node_modules', + '^(?!ghost/core/server/services/)(apps|ghost|packages|koenig)/.*/(build|built|dist)/', + ], }, // Skip our own tests and emitted companions. All source inside services stays visible: // a nested directory name must not hide a production dependency. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b38b9c6bef15..c666928a6cf0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,6 +16,11 @@ # Kernel /ghost/core/kernel/ @ErisDS +# Service dependency policy and reviewed legacy violations +/.dependency-cruiser.cjs @ErisDS +/.dependency-cruiser-known-violations.json @ErisDS +/tools/scripts/lib/dependency-boundaries.ts @ErisDS + # Inbox Links ghost/core/server/lib/get-inbox-links.ts @EvanHahn ghost/test/unit/server/lib/get-inbox-links.test.ts @EvanHahn diff --git a/.oxlintrc.json b/.oxlintrc.json index 750072dc9c3d..7335da530a62 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -275,6 +275,13 @@ "ghost/no-injected-service-libraries": "error" } }, + { + "files": ["ghost/core/server/services/**/*.{js,ts}"], + "plugins": ["import"], + "rules": { + "import/no-dynamic-require": ["error", { "esmodule": true }] + } + }, { "files": ["ghost/core/**/*.{js,ts}", "ghost/test/**/*.{js,ts}"], "rules": { diff --git a/ghost/core/server/services/README.md b/ghost/core/server/services/README.md index 774901a3d3f3..1a31d45761d7 100644 --- a/ghost/core/server/services/README.md +++ b/ghost/core/server/services/README.md @@ -74,7 +74,8 @@ belong. Import allowlisted libraries directly in the implementation; use `GhostLogger` for its injected logging type. The inventory entry uses `migrated: true`, and the root is added to Oxlint's -configured paths, so both root-shape and dependency checks apply immediately. +configured paths for root-shape checks. Dependency checks apply to every service +implementation independently of the marker. Its audit remains `pending`: the scaffold does not establish the capability's contracts. The initial `migration.reviewedAt` records the generator checkout revision, as its reason explains; review the implemented source before recording @@ -125,10 +126,11 @@ lifecycle work. ### Dependency boundaries -For migrated services, the root `index.ts` wires runtime dependencies and passes -them to the implementation. Other files in that service may import: +The root `index.ts` wires runtime dependencies and passes them to the +implementation. Dependency rules apply to every service, regardless of its +`migrated` marker or presence in the inventory. Implementation files may import: -- Files within the same service, except its root `index.ts`. +- Files within the same service, except its root `index.ts` or `index.js`. - Types, using explicit type-only imports. - The libraries and individual shared files in the [dependency-cruiser config](../../../../.dependency-cruiser.cjs). @@ -143,7 +145,7 @@ root is fine, including validating configuration with Zod and passing computed values such as `getUnixTime()`. `pnpm lint:oxlint` enforces direct constructor wiring with -`ghost/no-injected-service-libraries`. In migrated root `index.ts` files, it +`ghost/no-injected-service-libraries`. In root `index.ts` files, it rejects allowlisted imports and `const require()` bindings passed to constructors imported from within that service, including values in literal options objects and arrays. It reads the same allowlist and service scope as the boundary rule. @@ -154,7 +156,9 @@ Logging, config, settings, models, event buses and other service instances belong in the root wiring. Nested `index.ts` files are implementation files, not extra wiring roots. The rule covers static imports, `require()`, literal dynamic imports and re-exports. All implementation source inside a service is checked, including -nested folders named `test` or `fixtures`. +nested folders named `test` or `fixtures`. The scan cannot follow a computed +`require()` or `import()` argument, so `import/no-dynamic-require` rejects those +in every service file. Some dependencies look like libraries but are treated as instances: @@ -197,10 +201,41 @@ adjacent `build:tsc` output out of the report; ordinary JavaScript implementatio remain checked. Package exports resolve through their `source` condition when available, so workspace contracts are checked without relying on build output. -`pnpm lint:boundaries`, also run by `pnpm check` and CI, enforces these rules as -errors for every entry marked `migrated: true`. New implementation files inherit -the same rules. Marking a service migrated opts it into enforcement; review -changes to that marker as part of the migration. +`pnpm lint:boundaries`, also run by `pnpm check` and CI, checks all service +implementations in the same dependency-cruiser scan as Core and app boundaries. +Top-level `index.ts` and legacy `index.js` files are wiring roots and exempt; +nested indexes and standalone service files are checked. This preserves the +legacy audit's wiring exemption without making migration status an enforcement +switch. + +Existing violations are recorded in +[the known-violations file](../../../../.dependency-cruiser-known-violations.json). +Each entry names one rule, importing file and dependency. External packages use +the exact import specifier, including subpaths, so pnpm store locations do not +change the baseline. Local and workspace dependencies use resolved source paths. +Moving either file or adding a new import cannot inherit another entry's exception. + +CI rejects new violations, stale entries, duplicate entries and entries for +migrated services. When fixing a violation, remove its entry in the same change; +when marking a service migrated, remove all its entries. Do not regenerate the +file to accept new violations. The file should only shrink. Any exceptional +addition or move needs explicit review; CODEOWNERS covers it and the rule config. + +A few unmigrated services change too often for a file-level list to hold: it +would go stale between a pull request opening and merging. The checker's +[`deferredServices`](../../../../tools/scripts/lib/dependency-boundaries.ts) list +names them. Their violations stay in reports and in the lint summary count, but +do not fail lint and have no entries in the file. In those services, still pass +new dependencies in through whatever file already composes the service. A +service leaves the list when it is migrated. The list should only shrink, and a +service that is not named is checked from its first commit. + +The shared [boundary checker](../../../../tools/scripts/lib/dependency-boundaries.ts) +compares the current graph with this file. Native dependency-cruiser baselines +match resolved paths and silently retain stale entries, so they cannot enforce +this contract on their own. `gx services report` and `gx services audit` use the +same scan and file, retaining all current findings so migration reports still +show the remaining work. The allowlist names individual packages or files, with a reason for each. Review additions individually; do not allow whole shared directories or all diff --git a/ghost/core/server/services/comments/comments-service-email-renderer.js b/ghost/core/server/services/comments/comments-service-email-renderer.js index 9c11ef71af75..e02f03b0b8e5 100644 --- a/ghost/core/server/services/comments/comments-service-email-renderer.js +++ b/ghost/core/server/services/comments/comments-service-email-renderer.js @@ -22,6 +22,7 @@ class CommentsServiceEmailRenderer { async renderEmailTemplate(templateName, data) { const htmlTemplateSource = await this.readTemplate(templateName); const htmlTemplate = this.Handlebars.compile(htmlTemplateSource); + // oxlint-disable-next-line import/no-dynamic-require -- the template is chosen by name from this service's own folder const { renderText } = require(`./email-templates/${templateName}.txt`); const html = htmlTemplate(data); diff --git a/ghost/core/server/services/staff/staff-service-emails.js b/ghost/core/server/services/staff/staff-service-emails.js index 4ccfb8bd41ea..17d8ae71451a 100644 --- a/ghost/core/server/services/staff/staff-service-emails.js +++ b/ghost/core/server/services/staff/staff-service-emails.js @@ -665,6 +665,7 @@ class StaffServiceEmails { } async renderText(templateName, data) { + // oxlint-disable-next-line import/no-dynamic-require -- the template is chosen by name from this service's own folder const { renderText } = require(`./email-templates/${templateName}.txt`); let sharedData = {}; diff --git a/package.json b/package.json index 62b15cd32f56..94a19c4dd700 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "lint:agent-skills": "node tools/scripts/ci/check-agent-skill-links.ts", "lint:doc-links": "git ls-files -z '*.md' ':(exclude,glob).changeset/**' ':(exclude,glob)**/fixture/**' ':(exclude,glob)**/fixtures/**' | xargs -0 remark --use remark-validate-links --frail --quiet", "lint:markdown": "git ls-files -z '*.md' ':(exclude,glob).changeset/**' ':(exclude,glob)**/fixture/**' ':(exclude,glob)**/fixtures/**' | xargs -0 markdownlint-cli2 --config .markdownlint-cli2.jsonc", - "lint:boundaries": "depcruise ghost/core apps --config .dependency-cruiser.cjs", + "lint:boundaries": "node tools/scripts/ci/check-boundaries.ts", "lint:packages": "node tools/scripts/ci/check-internal-packages.ts", "lint:versioning": "node tools/scripts/ci/check-versioning-ignore.ts", "lint:docs": "pnpm lint:agent-skills && pnpm lint:agent-guidance && pnpm lint:markdown && pnpm lint:doc-links", @@ -127,20 +127,20 @@ "cache": true, "inputs": [ "{workspaceRoot}/.dependency-cruiser.cjs", + "{workspaceRoot}/.dependency-cruiser-known-violations.json", + "{workspaceRoot}/tools/scripts/ci/check-boundaries.ts", + "{workspaceRoot}/tools/scripts/lib/dependency-boundaries.ts", "{workspaceRoot}/tools/scripts/ci/service-dependency-resolver.mjs", "{workspaceRoot}/ghost/core/**/*", "{workspaceRoot}/ghost/package.json", "{workspaceRoot}/packages/**/*", "{workspaceRoot}/koenig/**/*", "{workspaceRoot}/apps/**/*", - "sharedGlobals", - { - "env": "GHOST_SERVICE_DEPENDENCY_AUDIT" - } + "sharedGlobals" ], "outputs": [], "options": { - "command": "depcruise ghost/core apps --config .dependency-cruiser.cjs" + "command": "node tools/scripts/ci/check-boundaries.ts" } }, "docker:up": { diff --git a/tools/configs/eslint/README.md b/tools/configs/eslint/README.md index 32c48f11a46d..dd5d680beafb 100644 --- a/tools/configs/eslint/README.md +++ b/tools/configs/eslint/README.md @@ -71,7 +71,7 @@ in `.oxlintrc.json`. Its standalone implementation is a root migrated; a tooling test compares them with the service inventory. Catalogue metadata validation remains separate from linting. -The Oxlint-only `ghost/no-injected-service-libraries` rule checks migrated +The Oxlint-only `ghost/no-injected-service-libraries` rule checks all TypeScript service roots for allowlisted libraries passed into local constructors. It reuses the service dependency policy in `.dependency-cruiser.cjs`; see the [services guide](../../../ghost/core/server/services/README.md#dependency-boundaries) diff --git a/tools/gx/README.md b/tools/gx/README.md index 2a45509df4b8..1ff8e0cccdb8 100644 --- a/tools/gx/README.md +++ b/tools/gx/README.md @@ -61,8 +61,9 @@ pnpm gx generate service delivery-receipts It creates a `defineService` root, a separate implementation with typed logging injection, and a starter root test. It adds `migrated: true` to the service -inventory and registers the root in Oxlint, enabling root and dependency checks -immediately. Existing service files, directories and tests are never overwritten. +inventory and registers the root in Oxlint for root-shape checks. Dependency +checks already apply to every service implementation. Existing service files, +directories and tests are never overwritten. The command prints the remaining steps, including choosing the right place for `init()` in boot. See [creating a service](../../ghost/core/server/services/README.md#creating-a-service) @@ -223,8 +224,13 @@ importing implementation files per target, largest first; it excludes unresolved and own-root findings. The native `audit` counts rule violations, so one import can appear under more than one rule. -The audit checks all entries and returns success when it finds violations. -`pnpm lint:boundaries` enforces the same rules for migrated services in CI. +All service commands use the same full dependency-cruiser scan and +known-violations file as `pnpm lint:boundaries`. Reports retain known and new +findings and return success when violations are found; boundary lint fails on +new violations or stale entries. Invalid known-violations files fail both. +Violations in services with deferred enforcement appear in reports but do not +fail boundary lint. +The native `audit` output includes Core and app boundaries as well as services. Legacy root `index.js` files are treated as wiring candidates. Computed paths such as `require(name)` cannot be resolved by the static audit. No violations does not mean ready to migrate: recorded blockers, runtime behavior and test diff --git a/tools/gx/package.json b/tools/gx/package.json index 443a9a840dee..c70823433bb7 100644 --- a/tools/gx/package.json +++ b/tools/gx/package.json @@ -68,7 +68,9 @@ ], "serviceReports": [ "{workspaceRoot}/.dependency-cruiser.cjs", - "{workspaceRoot}/tools/scripts/ci/service-dependency-resolver.mjs" + "{workspaceRoot}/tools/scripts/ci/service-dependency-resolver.mjs", + "{workspaceRoot}/.dependency-cruiser-known-violations.json", + "{workspaceRoot}/ghost/core/server/services/service-inventory.yaml" ], "serviceGenerator": [ "{workspaceRoot}/.editorconfig", diff --git a/tools/gx/services.ts b/tools/gx/services.ts index cfebe99fe92f..81eda79e7eaa 100644 --- a/tools/gx/services.ts +++ b/tools/gx/services.ts @@ -4,6 +4,7 @@ import path from 'node:path'; import { parseArgs } from 'node:util'; import yaml from 'js-yaml'; import { z } from 'zod'; +import { readDependencyBoundaries } from '../scripts/lib/dependency-boundaries.ts'; const servicesRoot = 'ghost/core/server/services/'; const repository = path.resolve(import.meta.dirname, '../..'); @@ -325,36 +326,9 @@ function frequencies(rows: Service[]) { } function readAudit() { - const result = spawnSync( - 'pnpm', - [ - 'exec', - 'depcruise', - servicesRoot, - '--config', - '.dependency-cruiser.cjs', - '--output-type', - 'json', - ], - { - cwd: repository, - env: { ...process.env, GHOST_SERVICE_DEPENDENCY_AUDIT: '1' }, - encoding: 'utf8', - maxBuffer: 32 * 1024 * 1024, - }, - ); - if (result.error) { - throw result.error; - } - if (result.status !== 0) { - throw new Error(result.stderr.trim() || `Dependency audit failed (exit ${result.status}).`); - } - if (result.stderr) { - process.stderr.write(result.stderr); - } - const data: unknown = JSON.parse(result.stdout); + const { graph: data } = readDependencyBoundaries(repository); auditSchema.parse(data); - return { data, json: result.stdout }; + return { data, json: JSON.stringify(data) }; } export function runServices(command: string, args: string[]) { diff --git a/tools/gx/test/create-service.test.ts b/tools/gx/test/create-service.test.ts index db612fc1a18f..82b7a9b110ee 100644 --- a/tools/gx/test/create-service.test.ts +++ b/tools/gx/test/create-service.test.ts @@ -17,6 +17,7 @@ import { afterEach, test } from 'node:test'; import { fileURLToPath } from 'node:url'; import yaml from 'js-yaml'; import { createService } from '../create-service.ts'; +import { readDependencyBoundaries } from '../../scripts/lib/dependency-boundaries.ts'; const repo = fileURLToPath(new URL('../../..', import.meta.url)); const requireRoot = createRequire(path.join(repo, 'package.json')); @@ -86,7 +87,6 @@ function run(root: string, binary: string, args: string[]) { ...process.env, FORCE_COLOR: undefined, NO_COLOR: '1', - GHOST_SERVICE_DEPENDENCY_AUDIT: undefined, }, }); assert.ifError(result.error); @@ -261,6 +261,8 @@ test('generated output passes real lint, boundary and inventory checks, which re }); symlinkSync(path.join(repo, 'node_modules'), path.join(root, 'node_modules')); symlinkSync(path.join(repo, 'ghost/node_modules'), path.join(root, 'ghost/node_modules')); + mkdirSync(path.join(root, 'apps')); + writeFileSync(path.join(root, '.dependency-cruiser-known-violations.json'), '[]'); createService({ name, rootDir: root }); // Keep the generated entry intact while removing the placeholder used by unit fixtures. writeFileSync( @@ -317,6 +319,9 @@ test('generated output passes real lint, boundary and inventory checks, which re graph.modules.some((module: { source: string }) => module.source === implementation), 'The implementation must actually be analyzed', ); + const boundaries = readDependencyBoundaries(root); + assert.deepEqual(boundaries.newViolations, []); + assert.deepEqual(boundaries.stale, []); success(run(path.join(root, 'ghost'), vitest, ['run', '--config', 'vitest.config.mts'])); success(run(path.join(root, 'ghost'), tsc, ['--noEmit'])); success(run(path.join(root, 'ghost'), tsc, ['--noEmit', '-p', 'test/tsconfig.json'])); @@ -342,6 +347,12 @@ test('generated output passes real lint, boundary and inventory checks, which re ]); assert.equal(invalidDependency.status, 1, invalidDependency.stdout + invalidDependency.stderr); assert.match(invalidDependency.stdout + invalidDependency.stderr, /service-dependencies/); + assert.ok( + readDependencyBoundaries(root).newViolations.some( + (violation) => + violation.from === implementation && violation.rule.name === 'service-dependencies', + ), + ); const inventory = yaml.load(read(root, inventoryPath)) as { services: Record }; delete inventory.services[name]; writeFileSync(path.join(root, inventoryPath), yaml.dump(inventory)); diff --git a/tools/gx/test/services.test.ts b/tools/gx/test/services.test.ts index b2397d4fa904..1c2b1ce81078 100644 --- a/tools/gx/test/services.test.ts +++ b/tools/gx/test/services.test.ts @@ -166,7 +166,7 @@ test('rejects incomplete assessments and invalid audit data instead of reporting }); async function fixture(t: TestContext) { - const root = await mkdtemp(join(import.meta.dirname, '../gx-services-')); + const root = await mkdtemp(join(tmpdir(), 'ghost-gx-services-')); t.after(() => rm(root, { recursive: true, force: true })); const write = async (file: string, source: string) => { await mkdir(dirname(join(root, file)), { recursive: true }); @@ -180,9 +180,16 @@ async function fixture(t: TestContext) { new URL('../../../.dependency-cruiser.cjs', import.meta.url), join(root, '.dependency-cruiser.cjs'), ); - const resolver = 'tools/scripts/ci/service-dependency-resolver.mjs'; - await mkdir(dirname(join(root, resolver)), { recursive: true }); - await cp(new URL(`../../../${resolver}`, import.meta.url), join(root, resolver)); + for (const file of [ + 'tools/scripts/ci/service-dependency-resolver.mjs', + 'tools/scripts/lib/dependency-boundaries.ts', + 'tools/scripts/ci/check-boundaries.ts', + ]) { + await mkdir(dirname(join(root, file)), { recursive: true }); + await cp(new URL(`../../../${file}`, import.meta.url), join(root, file)); + } + await write('.dependency-cruiser-known-violations.json', '[]'); + await write('apps/empty.ts', 'export {};'); await write('package.json', '{"type":"module"}'); await symlink(new URL('../node_modules', import.meta.url), join(root, 'node_modules')); await write( @@ -521,6 +528,48 @@ test('CLI help needs no audit and analyzer failures cannot produce clean reports } }); +test('reports and boundary lint share the graph and known-violations file', async (t) => { + const f = await fixture(t); + await f.write( + '.dependency-cruiser-known-violations.json', + JSON.stringify( + ['implementation', 'second'].map((name) => ({ + rule: 'service-dependencies', + from: `${services}/alpha/${name}.ts`, + to: 'ghost/core/shared/client.js', + })), + ), + ); + const lint = () => + spawnSync(process.execPath, [join(f.root, 'tools/scripts/ci/check-boundaries.ts')], { + cwd: tmpdir(), + encoding: 'utf8', + }); + assert.equal(lint().status, 0); + const report = f.run(['report', 'alpha', '--json']); + assert.equal(report.status, 0, report.stderr); + assert.equal(JSON.parse(report.stdout).findings.length, 2); + await f.write('apps/portal/forbidden.ts', "import '../admin-x-framework/implementation';"); + await f.write('apps/admin-x-framework/implementation.ts', 'export {};'); + const auditResult = f.run(['audit', '--output-type', 'json']); + assert.equal(auditResult.status, 0, auditResult.stderr); + const graph = JSON.parse(auditResult.stdout); + assert.equal(graph.summary.violations.length, 3); + const invalid = lint(); + assert.equal(invalid.status, 1); + assert.match(invalid.stderr, /public-apps-not-admin-libs/); + + await f.write( + `${services}/service-inventory.yaml`, + JSON.stringify({ services: { alpha: entry({ migrated: true }) } }), + ); + for (const command of ['report', 'audit']) { + const invalidReport = f.run([command]); + assert.equal(invalidReport.status, 1); + assert.match(invalidReport.stderr, /unmigrated inventory entry/); + } +}); + test('list help describes groups and invalid filters fail before the audit runs', async (t) => { const f = await fixture(t); await f.write('.dependency-cruiser.cjs', "throw new Error('Audit must not run');"); diff --git a/tools/scripts/README.md b/tools/scripts/README.md index 7c0772357221..9387bd0cec30 100644 --- a/tools/scripts/README.md +++ b/tools/scripts/README.md @@ -41,6 +41,7 @@ inventory is a reporting tool, although contributors can run it locally. | [compare-image-report.ts](./ci/compare-image-report.ts) | Compare production image file/size reports for CI summaries | Image-report CI step | | [e2e-shards.ts](./ci/e2e-shards.ts) | Plan browser-test shards and update recorded execution timings | Browser-test CI: plan / record; sparse checkout supported | | [nx-set-shas.ts](./ci/nx-set-shas.ts) | Select affected CI commit ranges from successful workflow history | CI job setup | +| [check-boundaries.ts](./ci/check-boundaries.ts) | Enforce dependency boundaries and reject stale known violations | pnpm lint:boundaries / CI | | [service-dependency-resolver.mjs](./ci/service-dependency-resolver.mjs) | Resolve authored Core source for Dependency Cruiser | Boundary lint and gx service dependency reports | | [summarize-admin-acceptance.ts](./ci/summarize-admin-acceptance.ts) | Render Admin acceptance-test results into a CI summary | Acceptance CI after test shards | | [typescript-inventory.ts](./ci/typescript-inventory.ts) | Measure tracked JS/TS adoption, dependencies and historical counts | pnpm inventory:typescript; TypeScript inventory workflow | @@ -155,8 +156,11 @@ boundary; see [its README](../../.github/scripts/i18n-review/README.md). Contributor reports live in [gx](../gx/README.md#service-migration-reports): `pnpm gx services audit` provides Dependency Cruiser's native reports and `pnpm gx services dependencies` summarises disallowed dependencies. Rules and -the allowlist remain in `.dependency-cruiser.cjs`; the resolver adapter in -`ci/` supports both reporting and boundary lint. The +the allowlist remain in `.dependency-cruiser.cjs`. The shared runner in +`lib/dependency-boundaries.ts` reads `.dependency-cruiser-known-violations.json` +and scans Core and apps once for both reports and `ci/check-boundaries.ts`. +The checker rejects new violations and stale entries; reports retain all findings. +The resolver adapter in `ci/` keeps authored source resolution consistent. The [services guide](../../ghost/core/server/services/README.md#dependency-boundaries) defines the policy. diff --git a/tools/scripts/ci/check-boundaries.ts b/tools/scripts/ci/check-boundaries.ts new file mode 100644 index 000000000000..890e6ff46f47 --- /dev/null +++ b/tools/scripts/ci/check-boundaries.ts @@ -0,0 +1,31 @@ +import path from 'node:path'; +import { + dependencyIdentity, + knownViolationsFile, + readDependencyBoundaries, +} from '../lib/dependency-boundaries.ts'; + +try { + const { graph, newViolations, stale, deferred } = readDependencyBoundaries( + path.resolve(import.meta.dirname, '../../..'), + ); + for (const violation of newViolations) { + const { rule, from, to } = dependencyIdentity(violation); + console.error(`error ${rule}: ${from} → ${to}`); + } + for (const { rule, from, to } of stale) { + console.error( + `error stale known violation: ${from} → ${to} [${rule}]. Remove it from ${knownViolationsFile}.`, + ); + } + if (newViolations.length || stale.length) { + process.exitCode = 1; + } else { + console.log( + `No new dependency violations (${graph.modules.length} modules, ${graph.summary.violations.length - deferred.length} known violations, ${deferred.length} in services with deferred enforcement).`, + ); + } +} catch (error) { + console.error(error instanceof Error ? error.message : String(error)); + process.exitCode = 1; +} diff --git a/tools/scripts/lib/dependency-boundaries.ts b/tools/scripts/lib/dependency-boundaries.ts new file mode 100644 index 000000000000..ccecbf355d81 --- /dev/null +++ b/tools/scripts/lib/dependency-boundaries.ts @@ -0,0 +1,139 @@ +import { spawnSync } from 'node:child_process'; +import { readFileSync } from 'node:fs'; +import { findPackageJSON } from 'node:module'; +import path from 'node:path'; +import type { ICruiseResult, IViolation } from 'dependency-cruiser'; +import yaml from 'js-yaml'; +import { z } from 'zod'; + +export const knownViolationsFile = '.dependency-cruiser-known-violations.json'; +const servicesRoot = 'ghost/core/server/services/'; +const knownViolationSchema = z.strictObject({ + rule: z.enum(['service-dependencies', 'service-own-root', 'service-unresolved']), + from: z.string().startsWith(servicesRoot), + to: z.string().min(1), +}); +const inventorySchema = z.object({ + services: z.record(z.string(), z.object({ migrated: z.boolean().optional() })), +}); +type KnownViolation = z.infer; + +// Unmigrated services that change too often for a file-level list to hold: it +// would go stale between a pull request opening and merging. Their findings +// stay in reports but neither fail lint nor appear in the known-violations +// file. Remove a name when its service is migrated. This list should only +// shrink; a service that is not named here is checked from its first commit. +export const deferredServices: readonly string[] = [ + 'automations', + 'members', + 'members-metafields', + 'stripe', +]; + +const serviceName = (file: string) => file.slice(servicesRoot.length).split('/')[0]!; +const isDeferred = (file: string) => + file.startsWith(servicesRoot) && deferredServices.includes(serviceName(file)); + +// External package locations vary between pnpm stores and CI. Keep their exact +// import specifier (including subpaths); local and workspace targets stay resolved +// so moving either end of an internal dependency needs explicit review. +export function dependencyIdentity(violation: IViolation) { + return { + rule: violation.rule.name, + from: violation.from, + to: + /(^|\/)node_modules\//.test(violation.to) && violation.unresolvedTo + ? violation.unresolvedTo + : violation.to, + }; +} + +const key = ({ rule, from, to }: { rule: string; from: string; to: string }) => + JSON.stringify([rule, from, to]); + +export function readKnownViolations(repository: string): KnownViolation[] { + const known = z + .array(knownViolationSchema) + .parse(JSON.parse(readFileSync(path.join(repository, knownViolationsFile), 'utf8'))); + const { services } = inventorySchema.parse( + yaml.load(readFileSync(path.join(repository, servicesRoot, 'service-inventory.yaml'), 'utf8')), + ); + for (const name of deferredServices) { + if (services[name]?.migrated) { + throw new Error( + `${name} is migrated, so its dependencies are enforced. Remove it from deferredServices.`, + ); + } + } + const seen = new Set(); + for (const item of known) { + const name = serviceName(item.from); + if (isDeferred(item.from)) { + throw new Error( + `${knownViolationsFile}: ${item.from} belongs to a service with deferred enforcement. Remove the entry.`, + ); + } + if (!services[name] || services[name].migrated) { + throw new Error( + `${knownViolationsFile}: ${item.from} must belong to an unmigrated inventory entry.`, + ); + } + if (seen.has(key(item))) { + throw new Error( + `${knownViolationsFile}: duplicate entry for ${item.from} → ${item.to} [${item.rule}].`, + ); + } + seen.add(key(item)); + } + return known; +} + +export function compareKnownViolations(graph: ICruiseResult, known: KnownViolation[]) { + const current = new Set(graph.summary.violations.map((item) => key(dependencyIdentity(item)))); + const accepted = new Set(known.map(key)); + const deferred = graph.summary.violations.filter((item) => isDeferred(item.from)); + return { + newViolations: graph.summary.violations.filter( + (item) => !isDeferred(item.from) && !accepted.has(key(dependencyIdentity(item))), + ), + stale: known.filter((item) => !current.has(key(item))), + deferred, + }; +} + +// Lint and contributor reports use this single scan and known-violations file. +// Reports retain all findings; only lint uses the comparison to decide success. +export function readDependencyBoundaries(repository: string) { + const known = readKnownViolations(repository); + const manifest = findPackageJSON('dependency-cruiser', import.meta.url); + if (!manifest) { + throw new Error('dependency-cruiser is not installed.'); + } + const { bin } = z + .object({ bin: z.object({ depcruise: z.string() }) }) + .parse(JSON.parse(readFileSync(manifest, 'utf8'))); + const cli = path.join(path.dirname(manifest), bin.depcruise); + const result = spawnSync( + process.execPath, + [cli, 'ghost/core', 'apps', '--config', '.dependency-cruiser.cjs', '--output-type', 'json'], + { + cwd: repository, + encoding: 'utf8', + maxBuffer: 64 * 1024 * 1024, + }, + ); + if (result.error) { + throw result.error; + } + if (result.status !== 0) { + throw new Error(result.stderr.trim() || `Dependency analysis failed (exit ${result.status}).`); + } + if (result.stderr) { + process.stderr.write(result.stderr); + } + const graph: ICruiseResult = JSON.parse(result.stdout); + if (!graph.modules?.length || !Array.isArray(graph.summary?.violations)) { + throw new Error('Dependency analysis returned no modules or an invalid report.'); + } + return { graph, ...compareKnownViolations(graph, known) }; +} diff --git a/tools/scripts/package.json b/tools/scripts/package.json index aa44432b7af1..6318d7d398a4 100644 --- a/tools/scripts/package.json +++ b/tools/scripts/package.json @@ -40,7 +40,9 @@ "nx": { "namedInputs": { "serviceDependencyContracts": [ - "{workspaceRoot}/.dependency-cruiser.cjs" + "{workspaceRoot}/.dependency-cruiser.cjs", + "{workspaceRoot}/.dependency-cruiser-known-violations.json", + "{workspaceRoot}/ghost/core/server/services/service-inventory.yaml" ], "adminTestContracts": [ "{workspaceRoot}/apps/admin/package.json", diff --git a/tools/scripts/test/oxlint.test.ts b/tools/scripts/test/oxlint.test.ts index 25f83ac22c91..bfefce15e47f 100644 --- a/tools/scripts/test/oxlint.test.ts +++ b/tools/scripts/test/oxlint.test.ts @@ -537,10 +537,19 @@ test('allows local library use, computed values, injected application dependenci assert.deepEqual(result.diagnostics, []); }); -test('limits injection enforcement to migrated TypeScript wiring roots', () => { +test('checks library injection in all TypeScript wiring roots regardless of migration status', () => { for (const filename of [ 'ghost/core/server/services/legacy/index.ts', 'ghost/core/server/services/unlisted/index.ts', + ]) { + const result = lint( + "import Service from './service'; import tpl from '@tryghost/tpl'; new Service({tpl});", + filename, + ); + assert.equal(result.status, 1, filename); + assert.equal(result.diagnostics.length, 1); + } + for (const filename of [ 'ghost/core/server/services/alpha/helper.ts', 'ghost/core/server/services/alpha/nested/index.ts', 'ghost/core/server/services/alpha/index.js', @@ -968,3 +977,17 @@ test('rejects any in exported service types only', () => { ].join('\n'); assert.equal(lint(shadowed, file).status, 0); }); + +test('rejects computed require and import in service files, which the boundary scan cannot follow', () => { + const source = ` + const name = ['@tryghost', 'logging'].join('/'); + module.exports = { eager: require(name), lazy: () => import(name), own: () => import('./helper') }; + `; + const service = lint(source, 'ghost/core/server/services/legacy/implementation.js'); + assert.deepEqual( + service.diagnostics.map(({ code }) => code), + ['import(no-dynamic-require)', 'import(no-dynamic-require)'], + ); + const elsewhere = lint(source, 'ghost/core/server/lib/implementation.js'); + assert.ok(!elsewhere.diagnostics.some(({ code }) => code === 'import(no-dynamic-require)')); +}); diff --git a/tools/scripts/test/service-dependencies.test.ts b/tools/scripts/test/service-dependencies.test.ts index 1a1e96ddc4a2..54222ed10472 100644 --- a/tools/scripts/test/service-dependencies.test.ts +++ b/tools/scripts/test/service-dependencies.test.ts @@ -1,12 +1,26 @@ import assert from 'node:assert/strict'; import { spawnSync } from 'node:child_process'; -import { mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; +import { + cpSync, + mkdirSync, + mkdtempSync, + readFileSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs'; import { findPackageJSON } from 'node:module'; import { tmpdir } from 'node:os'; import path from 'node:path'; import { it, type TestContext } from 'node:test'; import type { ICruiseResult } from 'dependency-cruiser'; +import yaml from 'js-yaml'; import ts from 'typescript'; +import { + deferredServices, + dependencyIdentity, + readKnownViolations, +} from '../lib/dependency-boundaries.ts'; const repository = path.resolve(import.meta.dirname, '../../..'); const services = 'ghost/core/server/services'; @@ -41,23 +55,32 @@ function fixture(t: TestContext, files: Record) { legacy: { kind: 'directory', disposition: 'migrate' }, }, }), + 'tools/scripts/package.json': '{"type":"module"}', + '.dependency-cruiser-known-violations.json': '[]', + 'apps/empty.ts': 'export {};', [config]: 'export const enabled = true; export interface Config {}', ...files, })) { write(file, source); } - for (const file of [resolver, 'node_modules/js-yaml']) { + for (const file of [ + 'tools/scripts/lib/dependency-boundaries.ts', + 'tools/scripts/ci/check-boundaries.ts', + ]) { + mkdirSync(path.dirname(path.join(root, file)), { recursive: true }); + cpSync(path.join(repository, file), path.join(root, file)); + } + for (const file of [resolver, 'node_modules/js-yaml', 'tools/scripts/node_modules']) { mkdirSync(path.dirname(path.join(root, file)), { recursive: true }); symlinkSync(path.join(repository, file), path.join(root, file)); } - const run = (output = 'json', audit = false, input = services) => { + const run = (output = 'json', input = services, args: string[] = []) => { const result = spawnSync( process.execPath, - [cli, input, '--config', '.dependency-cruiser.cjs', '--output-type', output], + [cli, input, '--config', '.dependency-cruiser.cjs', '--output-type', output, ...args], { cwd: root, encoding: 'utf8', - env: { ...process.env, GHOST_SERVICE_DEPENDENCY_AUDIT: audit ? '1' : '' }, }, ); assert.ifError(result.error); @@ -67,12 +90,19 @@ function fixture(t: TestContext, files: Record) { return { write, run, + root, + lint() { + return spawnSync(process.execPath, ['tools/scripts/ci/check-boundaries.ts'], { + cwd: root, + encoding: 'utf8', + }); + }, link(source: string, destination: string) { mkdirSync(path.dirname(path.join(root, destination)), { recursive: true }); symlinkSync(path.join(root, source), path.join(root, destination)); }, - graph(audit = false, input = services): ICruiseResult { - const result = run('json', audit, input); + graph(input = services): ICruiseResult { + const result = run('json', input); assert.equal(result.status, 0, result.stderr); const graph: ICruiseResult = JSON.parse(result.stdout); assert.ok(graph.modules.length > 0, 'The fixture must actually be analyzed'); @@ -90,7 +120,7 @@ const edges = (graph: ICruiseResult) => ) .sort(); -it('enforces migrated services and reports all services through native Markdown and JSON audit output', (t) => { +it('enforces every implementation independently of inventory and migration markers', (t) => { const f = fixture(t, { [`${alpha}/implementation.ts`]: "import '../../../shared/config';", [`${alpha}/index.js`]: "require('../../../shared/config');", @@ -99,49 +129,166 @@ it('enforces migrated services and reports all services through native Markdown [`${services}/unlisted/helper.ts`]: "import '../../../shared/config';", [`${services}/unlisted.ts`]: "import '../../shared/config';", }); + const expected = [ + `${alpha}/implementation.ts`, + `${services}/legacy/implementation.js`, + `${services}/unlisted.ts`, + `${services}/unlisted/helper.ts`, + ].sort(); assert.deepEqual( violations(f.graph()).map(([, from]) => from), - [`${alpha}/implementation.ts`, `${alpha}/index.js`], + expected, ); - assert.equal(f.run('err').status, 2, 'The native error reporter returns the violation count'); - const audit = f.graph(true); - assert.deepEqual( - violations(audit).map(([, from]) => from), - [ - `${alpha}/implementation.ts`, - `${services}/legacy/implementation.js`, - `${services}/unlisted.ts`, - `${services}/unlisted/helper.ts`, - ].sort(), - ); - const markdown = f.run('markdown', true); + assert.equal(f.run('err').status, 4); + const markdown = f.run('markdown'); assert.equal(markdown.status, 0); assert.ok(markdown.stdout.includes(`${services}/unlisted/helper.ts`)); - assert.ok(markdown.stdout.includes('service-dependencies')); - for (const migrated of [false, true]) { - f.write( - `${services}/service-inventory.yaml`, - JSON.stringify({ - services: { - alpha: { kind: 'directory', disposition: 'migrate' }, - legacy: { - kind: 'directory', - disposition: 'migrate', - ...(migrated ? { migrated: true } : {}), - }, - }, - }), - ); + for (const entries of [{ alpha: {} }, {}]) { + f.write(`${services}/service-inventory.yaml`, JSON.stringify({ services: entries })); assert.deepEqual( violations(f.graph()).map(([, from]) => from), - migrated ? [`${services}/legacy/implementation.js`, `${services}/legacy/index.js`] : [], + expected, ); - if (!migrated) { - assert.equal(f.run('err').status, 0, 'An empty migration set leaves legacy services alone'); - } } }); +it('rejects new and moved dependencies and stale entries through the boundary lint command', (t) => { + const from = `${services}/legacy/implementation.js`; + const known = { rule: 'service-dependencies', from, to: config }; + const f = fixture(t, { + [from]: "require('../../../shared/config');", + '.dependency-cruiser-known-violations.json': JSON.stringify([known]), + }); + const initial = f.lint(); + assert.equal(initial.status, 0, initial.stderr); + f.write(`${services}/legacy/new.js`, "require('../../../shared/config');"); + const added = f.lint(); + assert.equal(added.status, 1, added.stderr); + assert.match(added.stderr, /legacy\/new.js/); + f.write(from, ''); + const moved = f.lint(); + assert.equal(moved.status, 1, moved.stderr); + assert.match(moved.stderr, /error service-dependencies:.*legacy\/new.js/); + assert.match(moved.stderr, /stale known violation:.*legacy\/implementation.js/); + f.write(`${services}/legacy/new.js`, ''); + const fixed = f.lint(); + assert.equal(fixed.status, 1, fixed.stderr); + assert.match(fixed.stderr, /Remove it from .dependency-cruiser-known-violations.json/); + f.write('.dependency-cruiser-known-violations.json', '[]'); + assert.equal(f.lint().status, 0); +}); + +it('rejects known violations for migrated services, duplicates and non-service rules', (t) => { + const known = { rule: 'service-dependencies', from: `${alpha}/implementation.ts`, to: config }; + const f = fixture(t, { '.dependency-cruiser-known-violations.json': JSON.stringify([known]) }); + assert.throws(() => readKnownViolations(f.root), /unmigrated inventory entry/); + f.write(`${services}/service-inventory.yaml`, JSON.stringify({ services: { alpha: {} } })); + f.write('.dependency-cruiser-known-violations.json', JSON.stringify([known, known])); + assert.throws(() => readKnownViolations(f.root), /duplicate entry/); + f.write( + '.dependency-cruiser-known-violations.json', + JSON.stringify([{ ...known, rule: 'kernel-not-application' }]), + ); + assert.throws(() => readKnownViolations(f.root)); +}); + +it('keeps the checked-in known violations limited to unmigrated services', () => { + assert.doesNotThrow(() => readKnownViolations(repository)); +}); + +it('reports but does not gate services with deferred enforcement', (t) => { + const [deferred] = deferredServices; + assert.ok(deferred); + const from = `${services}/${deferred}/implementation.js`; + const f = fixture(t, { [from]: "require('../../../shared/config');" }); + const added = f.lint(); + assert.equal(added.status, 0, added.stderr); + assert.match(added.stdout, /0 known violations, 1 in services with deferred enforcement/); + assert.deepEqual(violations(f.graph()), [['service-dependencies', from, config]]); + + // A sibling that is not named is still gated from its first file. + f.write(`${services}/${deferred}-extra/implementation.js`, "require('../../../shared/config');"); + const sibling = f.lint(); + assert.equal(sibling.status, 1, sibling.stderr); + assert.match(sibling.stderr, new RegExp(`${deferred}-extra/implementation.js`)); + f.write(`${services}/${deferred}-extra/implementation.js`, ''); + + // Deferred services keep no entries, so the file cannot hide what they add. + f.write( + '.dependency-cruiser-known-violations.json', + JSON.stringify([{ rule: 'service-dependencies', from, to: config }]), + ); + assert.throws(() => readKnownViolations(f.root), /deferred enforcement/); + const listed = f.lint(); + assert.equal(listed.status, 1, listed.stderr); + + // Migrating a deferred service ends its deferral. + f.write('.dependency-cruiser-known-violations.json', '[]'); + f.write( + `${services}/service-inventory.yaml`, + JSON.stringify({ services: { [deferred]: { migrated: true } } }), + ); + assert.throws(() => readKnownViolations(f.root), /Remove it from deferredServices/); +}); + +it('defers enforcement only for unmigrated services in the inventory', () => { + const inventory = yaml.load( + readFileSync(path.join(repository, services, 'service-inventory.yaml'), 'utf8'), + ) as { services: Record }; + assert.deepEqual([...deferredServices], [...deferredServices].sort()); + for (const name of deferredServices) { + assert.ok(inventory.services[name], `${name} is not in the service inventory`); + assert.notEqual(inventory.services[name].migrated, true, `${name} is migrated`); + } +}); + +it('matches external packages across stores without merging subpaths or workspace targets', () => { + const violation = { + rule: { name: 'service-dependencies', severity: 'error' as const }, + from: `${alpha}/implementation.ts`, + to: '/store/one/node_modules/client/index.js', + unresolvedTo: 'client', + }; + const identity = dependencyIdentity(violation); + assert.deepEqual( + dependencyIdentity({ ...violation, to: '/store/two/node_modules/client/index.js' }), + identity, + ); + assert.notDeepEqual( + dependencyIdentity({ ...violation, unresolvedTo: 'client/private' }), + identity, + ); + assert.notDeepEqual(dependencyIdentity({ ...violation, from: `${alpha}/moved.ts` }), identity); + assert.equal( + dependencyIdentity({ ...violation, to: 'packages/client/src/index.ts' }).to, + 'packages/client/src/index.ts', + ); + assert.notDeepEqual( + dependencyIdentity({ ...violation, to: 'packages/client/src/index.ts' }), + dependencyIdentity({ ...violation, to: 'packages/client/src/moved.ts' }), + ); +}); + +it('continues enforcing non-service boundaries in the same scan', (t) => { + const f = fixture(t, { + 'ghost/core/kernel/forbidden.ts': "import '../shared/config';", + }); + const result = f.lint(); + assert.equal(result.status, 1, result.stderr); + assert.match(result.stderr, /kernel-not-application/); +}); + +it('keeps native ignore-known behavior documented: moves fail but stale entries are accepted', (t) => { + const from = `${services}/legacy/implementation.js`; + const f = fixture(t, { [from]: "require('../../../shared/config');" }); + f.write('native-baseline.json', JSON.stringify(f.graph().summary.violations)); + assert.equal(f.run('err', services, ['--ignore-known', 'native-baseline.json']).status, 0); + f.write(from, ''); + assert.equal(f.run('err', services, ['--ignore-known', 'native-baseline.json']).status, 0); + f.write(`${services}/legacy/moved.js`, "require('../../../shared/config');"); + assert.equal(f.run('err', services, ['--ignore-known', 'native-baseline.json']).status, 1); +}); + it('allows same-service code, explicit types, approved libraries and root wiring', (t) => { const f = fixture(t, { [`${alpha}/index.ts`]: "import '../../../shared/config';", @@ -821,7 +968,7 @@ it('preserves app boundaries and the test-selector allowance after workspace exp f.link(directory, `node_modules/${name}`); } f.write('packages/testing/test-data/src/selectors/member.ts', 'export const member = "member";'); - const graph = f.graph(false, 'apps'); + const graph = f.graph('apps'); const expected = [ [ 'framework-not-feature-apps', @@ -849,7 +996,7 @@ it('preserves app boundaries and the test-selector allowance after workspace exp f.write(output, "import '../../../packages/output-only/index.js';"); f.write('apps/activitypub/dist/unreferenced.js', 'export {};'); f.write('packages/output-only/index.js', 'export {};'); - const built = f.graph(false, 'apps'); + const built = f.graph('apps'); assert.deepEqual( violations(built), expected.map(([rule, from, to]) => [rule, from, to === '@tryghost/activitypub' ? output : to]), @@ -872,9 +1019,19 @@ it('preserves app boundaries and the test-selector allowance after workspace exp it('invalidates cached boundary checks and fixture tests when their configuration changes', () => { const root = JSON.parse(readFileSync(path.join(repository, 'package.json'), 'utf8')); assert.ok(root.nx.targets['lint:boundaries'].inputs.includes(`{workspaceRoot}/${resolver}`)); - for (const input of ['ghost/core/**/*', 'ghost/package.json', 'packages/**/*', 'koenig/**/*']) { + for (const input of [ + 'ghost/core/**/*', + 'ghost/package.json', + 'packages/**/*', + 'koenig/**/*', + '.dependency-cruiser-known-violations.json', + 'tools/scripts/lib/dependency-boundaries.ts', + 'tools/scripts/ci/check-boundaries.ts', + ]) { assert.ok(root.nx.targets['lint:boundaries'].inputs.includes(`{workspaceRoot}/${input}`)); } + assert.equal(root.scripts['lint:boundaries'], 'node tools/scripts/ci/check-boundaries.ts'); + assert.equal(root.nx.targets['lint:boundaries'].options.command, root.scripts['lint:boundaries']); const scripts = JSON.parse( readFileSync(path.join(repository, 'tools/scripts/package.json'), 'utf8'), ); From 95213daa793044808b63e1fb77b349d664828c69 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 12 Nov 2026 10:21:53 +0000 Subject: [PATCH 026/174] TypeScriptified leaf input validators (#32810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why Part of the gradual JavaScript → TypeScript migration of Ghost core, one small, faithful conversion at a time. This PR starts on `ghost/core/server/api/endpoints/utils/validators/input/`, converting the five input validators whose dependencies are all typed. Types only; no behaviour change. ## What Renamed with `git mv`, types added, CommonJS export shape (`module.exports = {...}`) kept, so the lazy getters in `validators/input/index.js` and the API framework keep working with zero caller edits: | Old | New | Source lines on `main` | | --- | --- | --- | | `validators/input/files.js` | `validators/input/files.ts` | 7 | | `validators/input/media.js` | `validators/input/media.ts` | 11 | | `validators/input/setup.js` | `validators/input/setup.ts` | 17 | | `validators/input/oembed.js` | `validators/input/oembed.ts` | 18 | | `validators/input/users.js` | `validators/input/users.ts` | 23 | Total 76 source lines. Edits are `require` → `import` (`@tryghost/debug`, `@tryghost/tpl`, `@tryghost/errors`, the TypeScript `services/limits`) and parameter types: `apiConfig: unknown` (name kept) and `frame` typed with `Frame` from `@tryghost/api-framework`, following `serializers/input/member-commenting.ts`: a local alias such as `type UsersFrame = Frame<{ data: { password: Array<...> } }>` where the validator reads `frame.data`, plain `Frame` for `setup` (it only reads `frame.options.context`), and the type-level intersection `Frame & { file: { size: number } }` for the upload validators, since `Frame.file` is `unknown`. `const debug = require('@tryghost/debug')(name)` becomes `import debugFactory from '@tryghost/debug'; const debug = debugFactory(name);`, the same pattern as `email-analytics/lib/queries.ts`. `service-inventory.yaml`: the 5 path lines naming `files.js`, `media.js` and `oembed.js` now point at the `.ts` files. `files` and `media` are short enough that GitHub shows them as delete + add (below git's default 50% rename similarity). They were moved with `git mv`; `git diff -M20% origin/main...HEAD --stat` pairs them: ``` .../utils/validators/input/{files.js => files.ts} | 7 +++++-- .../utils/validators/input/{media.js => media.ts} | 9 ++++++--- .../utils/validators/input/{oembed.js => oembed.ts} | 9 ++++++--- .../utils/validators/input/{setup.js => setup.ts} | 11 +++++++---- .../utils/validators/input/{users.js => users.ts} | 15 +++++++++++---- ghost/core/server/services/service-inventory.yaml | 10 +++++----- 6 files changed, 40 insertions(+), 21 deletions(-) ``` Converted tests: none. No unit test imports these five files (the existing `validators/input/*.test.js` cover `pages`, `posts`, `tags` and `webhooks`). Not converted from this directory: `password_reset`, `invitations`, `automated_emails` and `settings` (`@tryghost/validator` has no type declarations; every existing TypeScript import of it uses `@ts-expect-error`), `labels`, `members`, `snippets`, `tags`, `tiers`, `webhooks` (depend on the JavaScript `../utils/json-schema`), `pages`, `posts` (JavaScript `../utils/json-schema` and `models`), `invites` (JavaScript `models`), `automation_email_previews` (JavaScript `lib/lexical`), `index` (lazy-getter index of JavaScript validators). **Revision (review feedback):** the second commit replaces the ad-hoc structural `frame` shapes with the `Frame` type from `@tryghost/api-framework`. Types only; no TypeScript caller passes a plain object to these validators, so `Frame`'s private field breaks nothing (`pnpm test:types` passes). All checks below were re-run on the new head. ## How tested From `ghost/`: - `pnpm test:types`: passes - `pnpm lint:code`: passes - `pnpm test:single test/unit/server/services/service-inventory.test.ts`: passes (98 tests) - `pnpm test:unit`: the only failures are `mailgun-client.test.js`, `ghost-mailer.test.js` and `mailgun-email-suppression-list.test.ts`, which also fail on `main` in this environment - A throwaway (uncommitted) vitest check loaded the five modules through `validators/index.js`: same exported method names as before; `oembed.read` rejects with `BadRequestError` for a blank url, `setup.updateSetup` throws `NoPermissionError` without a user, `users.changePassword` rejects with `ValidationError` on mismatch and returns `undefined` on match. Covered by CI: `test/e2e-api/admin/{files,media,oembed,users,authentication}.test.js`. --- .../endpoints/utils/validators/input/files.js | 7 ----- .../endpoints/utils/validators/input/files.ts | 10 +++++++ .../endpoints/utils/validators/input/media.js | 11 ------- .../endpoints/utils/validators/input/media.ts | 14 +++++++++ .../validators/input/{oembed.js => oembed.ts} | 9 ++++-- .../endpoints/utils/validators/input/setup.js | 17 ----------- .../endpoints/utils/validators/input/setup.ts | 20 +++++++++++++ .../endpoints/utils/validators/input/users.js | 23 -------------- .../endpoints/utils/validators/input/users.ts | 30 +++++++++++++++++++ .../server/services/service-inventory.yaml | 10 +++---- 10 files changed, 85 insertions(+), 66 deletions(-) delete mode 100644 ghost/core/server/api/endpoints/utils/validators/input/files.js create mode 100644 ghost/core/server/api/endpoints/utils/validators/input/files.ts delete mode 100644 ghost/core/server/api/endpoints/utils/validators/input/media.js create mode 100644 ghost/core/server/api/endpoints/utils/validators/input/media.ts rename ghost/core/server/api/endpoints/utils/validators/input/{oembed.js => oembed.ts} (55%) delete mode 100644 ghost/core/server/api/endpoints/utils/validators/input/setup.js create mode 100644 ghost/core/server/api/endpoints/utils/validators/input/setup.ts delete mode 100644 ghost/core/server/api/endpoints/utils/validators/input/users.js create mode 100644 ghost/core/server/api/endpoints/utils/validators/input/users.ts diff --git a/ghost/core/server/api/endpoints/utils/validators/input/files.js b/ghost/core/server/api/endpoints/utils/validators/input/files.js deleted file mode 100644 index c6817dce24d9..000000000000 --- a/ghost/core/server/api/endpoints/utils/validators/input/files.js +++ /dev/null @@ -1,7 +0,0 @@ -const { limitService } = require('../../../../../services/limits'); - -module.exports = { - async upload(apiConfig, frame) { - await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); - }, -}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/files.ts b/ghost/core/server/api/endpoints/utils/validators/input/files.ts new file mode 100644 index 000000000000..bd9d8842a0ad --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/validators/input/files.ts @@ -0,0 +1,10 @@ +import type { Frame } from '@tryghost/api-framework'; +import { limitService } from '../../../../../services/limits'; + +type UploadFrame = Frame & { file: { size: number } }; + +module.exports = { + async upload(apiConfig: unknown, frame: UploadFrame) { + await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); + }, +}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/media.js b/ghost/core/server/api/endpoints/utils/validators/input/media.js deleted file mode 100644 index 23485844b373..000000000000 --- a/ghost/core/server/api/endpoints/utils/validators/input/media.js +++ /dev/null @@ -1,11 +0,0 @@ -const { limitService } = require('../../../../../services/limits'); - -module.exports = { - async upload(apiConfig, frame) { - await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); - }, - - async uploadThumbnail(apiConfig, frame) { - await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); - }, -}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/media.ts b/ghost/core/server/api/endpoints/utils/validators/input/media.ts new file mode 100644 index 000000000000..3799f060ed39 --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/validators/input/media.ts @@ -0,0 +1,14 @@ +import type { Frame } from '@tryghost/api-framework'; +import { limitService } from '../../../../../services/limits'; + +type UploadFrame = Frame & { file: { size: number } }; + +module.exports = { + async upload(apiConfig: unknown, frame: UploadFrame) { + await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); + }, + + async uploadThumbnail(apiConfig: unknown, frame: UploadFrame) { + await limitService.errorIfIsOverLimit('uploads', { currentCount: frame.file.size }); + }, +}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/oembed.js b/ghost/core/server/api/endpoints/utils/validators/input/oembed.ts similarity index 55% rename from ghost/core/server/api/endpoints/utils/validators/input/oembed.js rename to ghost/core/server/api/endpoints/utils/validators/input/oembed.ts index 5f9c52e7d9fb..4502617fb419 100644 --- a/ghost/core/server/api/endpoints/utils/validators/input/oembed.js +++ b/ghost/core/server/api/endpoints/utils/validators/input/oembed.ts @@ -1,12 +1,15 @@ -const tpl = require('@tryghost/tpl'); -const errors = require('@tryghost/errors'); +import type { Frame } from '@tryghost/api-framework'; +import tpl from '@tryghost/tpl'; +import errors from '@tryghost/errors'; + +type OembedFrame = Frame<{ data: { url?: string } }>; const messages = { noUrlProvided: 'No url provided.', }; module.exports = { - read(apiConfig, frame) { + read(apiConfig: unknown, frame: OembedFrame) { if (!frame.data.url || !frame.data.url.trim()) { return Promise.reject( new errors.BadRequestError({ diff --git a/ghost/core/server/api/endpoints/utils/validators/input/setup.js b/ghost/core/server/api/endpoints/utils/validators/input/setup.js deleted file mode 100644 index 9cfa3a23e839..000000000000 --- a/ghost/core/server/api/endpoints/utils/validators/input/setup.js +++ /dev/null @@ -1,17 +0,0 @@ -const debug = require('@tryghost/debug')('api:endpoints:utils:validators:input:updateSetup'); -const tpl = require('@tryghost/tpl'); -const errors = require('@tryghost/errors'); - -const messages = { - notTheBlogOwner: 'You are not the site owner.', -}; - -module.exports = { - updateSetup(apiConfig, frame) { - debug('resetPassword'); - - if (!frame.options.context || !frame.options.context.user) { - throw new errors.NoPermissionError({ message: tpl(messages.notTheBlogOwner) }); - } - }, -}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/setup.ts b/ghost/core/server/api/endpoints/utils/validators/input/setup.ts new file mode 100644 index 000000000000..4147cc5ab37a --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/validators/input/setup.ts @@ -0,0 +1,20 @@ +import type { Frame } from '@tryghost/api-framework'; +import debugFactory from '@tryghost/debug'; +import tpl from '@tryghost/tpl'; +import errors from '@tryghost/errors'; + +const debug = debugFactory('api:endpoints:utils:validators:input:updateSetup'); + +const messages = { + notTheBlogOwner: 'You are not the site owner.', +}; + +module.exports = { + updateSetup(apiConfig: unknown, frame: Frame) { + debug('resetPassword'); + + if (!frame.options.context || !frame.options.context.user) { + throw new errors.NoPermissionError({ message: tpl(messages.notTheBlogOwner) }); + } + }, +}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/users.js b/ghost/core/server/api/endpoints/utils/validators/input/users.js deleted file mode 100644 index d6910f12f69d..000000000000 --- a/ghost/core/server/api/endpoints/utils/validators/input/users.js +++ /dev/null @@ -1,23 +0,0 @@ -const debug = require('@tryghost/debug')('api:endpoints:utils:validators:input:users'); -const tpl = require('@tryghost/tpl'); -const errors = require('@tryghost/errors'); - -const messages = { - newPasswordsDoNotMatch: 'Your new passwords do not match', -}; - -module.exports = { - changePassword(apiConfig, frame) { - debug('changePassword'); - - const data = frame.data.password[0]; - - if (data.newPassword !== data.ne2Password) { - return Promise.reject( - new errors.ValidationError({ - message: tpl(messages.newPasswordsDoNotMatch), - }), - ); - } - }, -}; diff --git a/ghost/core/server/api/endpoints/utils/validators/input/users.ts b/ghost/core/server/api/endpoints/utils/validators/input/users.ts new file mode 100644 index 000000000000..53777de05b8d --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/validators/input/users.ts @@ -0,0 +1,30 @@ +import type { Frame } from '@tryghost/api-framework'; +import debugFactory from '@tryghost/debug'; +import tpl from '@tryghost/tpl'; +import errors from '@tryghost/errors'; + +const debug = debugFactory('api:endpoints:utils:validators:input:users'); + +type UsersFrame = Frame<{ + data: { password: Array<{ newPassword?: unknown; ne2Password?: unknown }> }; +}>; + +const messages = { + newPasswordsDoNotMatch: 'Your new passwords do not match', +}; + +module.exports = { + changePassword(apiConfig: unknown, frame: UsersFrame) { + debug('changePassword'); + + const data = frame.data.password[0]; + + if (data.newPassword !== data.ne2Password) { + return Promise.reject( + new errors.ValidationError({ + message: tpl(messages.newPasswordsDoNotMatch), + }), + ); + } + }, +}; diff --git a/ghost/core/server/services/service-inventory.yaml b/ghost/core/server/services/service-inventory.yaml index 52fc70a7d6de..63782b423ac8 100644 --- a/ghost/core/server/services/service-inventory.yaml +++ b/ghost/core/server/services/service-inventory.yaml @@ -5990,8 +5990,8 @@ services: - core/server/services/settings-helpers/settings-helpers.js - core/server/services/themes/installer.js - core/server/api/endpoints/themes.js - - core/server/api/endpoints/utils/validators/input/files.js - - core/server/api/endpoints/utils/validators/input/media.js + - core/server/api/endpoints/utils/validators/input/files.ts + - core/server/api/endpoints/utils/validators/input/media.ts - core/server/services/members-metafields/index.ts - core/server/services/members-metafields/custom-fields.ts tests: @@ -6073,8 +6073,8 @@ services: - core/server/data/db/connection.ts - core/server/services/newsletters/newsletters-service.js - core/server/services/email-service/email-service.js - - core/server/api/endpoints/utils/validators/input/files.js - - core/server/api/endpoints/utils/validators/input/media.js + - core/server/api/endpoints/utils/validators/input/files.ts + - core/server/api/endpoints/utils/validators/input/media.ts tests: - test/e2e-api/admin/host-limits.test.ts - test/e2e-api/admin/newsletters.test.js @@ -9843,7 +9843,7 @@ services: fields; a JSON mention page yields null metadata with its body and content type. sources: - core/server/api/endpoints/oembed.js - - core/server/api/endpoints/utils/validators/input/oembed.js + - core/server/api/endpoints/utils/validators/input/oembed.ts - core/server/api/endpoints/utils/serializers/output/oembed.js - core/server/api/endpoints/utils/serializers/output/mappers/oembed.js - core/server/web/api/endpoints/admin/routes.js From e39b66768632449c98bc59cc3bebad753f001a29 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 12 Nov 2026 10:24:06 +0000 Subject: [PATCH 027/174] TypeScriptified output serializer leaf mappers (#32807) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why Part of the gradual move of Ghost Core to TypeScript ([codebase direction](https://github.com/TryGhost/Ghost/blob/main/docs/codebase/direction.md)). These six Admin API output mappers are the ones in `serializers/output/mappers/` with no JavaScript dependencies (only `lodash`, which existing TypeScript in `ghost/core` already imports), so they convert without casts or suppressions. ## What Types-only conversion of 6 files in `ghost/core/server/api/endpoints/utils/serializers/output/mappers/` (152 source lines on `main`): | Old | New | | --- | --- | | `settings.js` | `settings.ts` | | `integrations.js` | `integrations.ts` | | `mentions.js` | `mentions.ts` | | `email-batches.js` | `email-batches.ts` | | `snippets.js` | `snippets.ts` | | `email-failures.js` | `email-failures.ts` | - `frame` is typed with `Frame` from `@tryghost/api-framework` (`import type`), following `serializers/input/member-commenting.ts` on main. `model` gets a structural type describing what each mapper reads from `toJSON(...)`. No logic changes and no new runtime statements. - `require('lodash')` becomes `import _ from 'lodash'`, matching the merged `input/utils/clean.ts`. - Each file keeps its `module.exports = ...` shape, so `mappers/index.js`, `output/emails.js`, `output/settings.js` and other JavaScript callers are unchanged. - `snippets`: the JSDoc `@param`/`@returns`/`@typedef` comments become the TypeScript parameter type. The `SerializedSnippet` fields keep their original types, and the return type is inferred from them. The JSDoc `import('bookshelf').Model` is replaced by a structural type: no TypeScript file in `ghost/core` imports `bookshelf` types, and their `Model.toJSON()` returns `any`. - Model types are written inline on the parameters. `mentions` has no imports, so TypeScript treats it as a global script, and a named alias there would be global. - `service-inventory.yaml`: 3 path lines updated (`integrations` ×2, `mentions` ×1). After stripping types with esbuild, each `.ts` file produces the same JavaScript as the original `.js` file. The only difference is the `lodash` import line in `settings`, `email-batches` and `email-failures`. I also loaded the files through `tsx` and through `tsc`'s CommonJS output: both export the same function and return the same results as before. `snippets.ts` is below git's 50% rename similarity, because its JSDoc was replaced by TypeScript syntax. GitHub therefore shows it as a delete plus an add. The other five are shown as renames. `git diff -M20% origin/main...HEAD --stat`: ``` .../mappers/{email-batches.js => email-batches.ts} | 8 +++-- .../{email-failures.js => email-failures.ts} | 8 +++-- .../mappers/{integrations.js => integrations.ts} | 12 ++++++- .../output/mappers/{mentions.js => mentions.ts} | 2 +- .../output/mappers/{settings.js => settings.ts} | 4 +-- .../output/mappers/{snippets.js => snippets.ts} | 37 +++++++++------------- ghost/core/server/services/service-inventory.yaml | 6 ++-- 7 files changed, 44 insertions(+), 33 deletions(-) ``` Converted tests: none. No unit test imports these files directly. `test/unit/api/endpoints/utils/serializers/output/mapper.test.js` exercises `integrations`, `snippets`, `email-batches` and `email-failures` through the still-JavaScript `mappers/index.js`, so it stays JavaScript (describe/it counts unchanged). Not converted from this directory (they depend on JavaScript modules): `authors`, `images`, `oembed`, `actions`, `pages`, `tags`, `users`, `index`, `emails`, `newsletters`, `offers`, `activity-feed-events`, `comments` and `posts`. Open PRs also touch `comments` and `posts`. **Review follow-up (second commit):** at review, the ad-hoc `frame: { options?: unknown }` types were replaced with the shared `Frame` type in `integrations`, `snippets`, `email-batches` and `email-failures`. `mentions` and `settings` take no `frame`. `Frame` has an ES private field, so a TypeScript caller passing a plain object would stop compiling. The only TypeScript caller is `test/integration/services/email-service/recipient-accounting.test.ts`, which loads `email-batches` with `require()` (untyped), so it is unaffected. `pnpm test:types` passes. The `import type` is erased, so the emitted JavaScript is unchanged. ## How tested From `ghost/`, on the current head: - `pnpm test:types`: passes - `pnpm lint:code`, `pnpm lint:test`: pass - `pnpm test:single` on the 19 unit tests that load these mappers through the output serializers (`output/*.test.*`, `server/.../output/*.test.*`, `output/mappers/{comments,users}.test.*`, `services/mentions/service.test.js`, `services/email-service/email-service-wrapper.test.js`): all pass - `pnpm test:single test/unit/server/services/service-inventory.test.ts`: passes On the first commit: - `pnpm test:unit`: the only failures are `mailgun-client.test.js`, `ghost-mailer.test.js` and `mailgun-email-suppression-list.test.ts`, which also fail on `main` in this environment Covered by CI: `test/e2e-api/admin/{integrations,snippets,mentions,settings,emails}.test.js`, `test/e2e-api/content/settings.test.js`, `test/integration/url-serialization.test.js`, `test/integration/services/email-service/recipient-accounting.test.ts`. --- .../{email-batches.js => email-batches.ts} | 8 +++-- .../{email-failures.js => email-failures.ts} | 8 +++-- .../output/mappers/integrations.js | 13 -------- .../output/mappers/integrations.ts | 23 +++++++++++++ .../mappers/{mentions.js => mentions.ts} | 2 +- .../mappers/{settings.js => settings.ts} | 4 +-- .../serializers/output/mappers/snippets.js | 33 ------------------- .../serializers/output/mappers/snippets.ts | 26 +++++++++++++++ .../server/services/service-inventory.yaml | 6 ++-- 9 files changed, 67 insertions(+), 56 deletions(-) rename ghost/core/server/api/endpoints/utils/serializers/output/mappers/{email-batches.js => email-batches.ts} (69%) rename ghost/core/server/api/endpoints/utils/serializers/output/mappers/{email-failures.js => email-failures.ts} (79%) delete mode 100644 ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.js create mode 100644 ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts rename ghost/core/server/api/endpoints/utils/serializers/output/mappers/{mentions.js => mentions.ts} (87%) rename ghost/core/server/api/endpoints/utils/serializers/output/mappers/{settings.js => settings.ts} (64%) delete mode 100644 ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.js create mode 100644 ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.ts diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.ts similarity index 69% rename from ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.js rename to ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.ts index e9f0a0fa0fcd..d6d87848a680 100644 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.js +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-batches.ts @@ -1,4 +1,5 @@ -const _ = require('lodash'); +import type { Frame } from '@tryghost/api-framework'; +import _ from 'lodash'; const batchFields = [ 'id', @@ -14,7 +15,10 @@ const batchFields = [ const countFields = ['recipients']; -const batchMapper = (model, frame) => { +const batchMapper = ( + model: { toJSON?: (options: unknown) => Record; [key: string]: unknown }, + frame: Frame, +) => { const jsonModel = model.toJSON ? model.toJSON(frame.options) : model; const response = _.pick(jsonModel, batchFields); diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.ts similarity index 79% rename from ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.js rename to ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.ts index f782d648aa76..4b81fa136694 100644 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.js +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/email-failures.ts @@ -1,4 +1,5 @@ -const _ = require('lodash'); +import type { Frame } from '@tryghost/api-framework'; +import _ from 'lodash'; const memberFields = ['id', 'uuid', 'name', 'email', 'avatar_image']; @@ -24,7 +25,10 @@ const emailRecipientFields = [ 'member_name', ]; -const failureMapper = (model, frame) => { +const failureMapper = ( + model: { toJSON?: (options: unknown) => Record; [key: string]: unknown }, + frame: Frame, +) => { const jsonModel = model.toJSON ? model.toJSON(frame.options) : model; const response = _.pick(jsonModel, failureFields); diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.js deleted file mode 100644 index 294a07dc02d0..000000000000 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = (model, frame) => { - const jsonModel = model.toJSON(frame.options); - - if (jsonModel.api_keys) { - jsonModel.api_keys.forEach((key) => { - if (key.type === 'admin') { - key.secret = `${key.id}:${key.secret}`; - } - }); - } - - return jsonModel; -}; diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts new file mode 100644 index 000000000000..97fafee87cbe --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts @@ -0,0 +1,23 @@ +import type { Frame } from '@tryghost/api-framework'; + +module.exports = ( + model: { + toJSON(options: unknown): { + api_keys?: Array<{ id: string; type: string; secret: string }>; + [key: string]: unknown; + }; + }, + frame: Frame, +) => { + const jsonModel = model.toJSON(frame.options); + + if (jsonModel.api_keys) { + jsonModel.api_keys.forEach((key) => { + if (key.type === 'admin') { + key.secret = `${key.id}:${key.secret}`; + } + }); + } + + return jsonModel; +}; diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.ts similarity index 87% rename from ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.js rename to ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.ts index f6c59bd3d81f..77132f2c3fd7 100644 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.js +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/mentions.ts @@ -1,4 +1,4 @@ -module.exports = (model) => { +module.exports = (model: { toJSON(): Record }) => { const json = model.toJSON(); return { diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.ts similarity index 64% rename from ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.js rename to ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.ts index 7ac14a19ed4f..6d44170642da 100644 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.js +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/settings.ts @@ -1,6 +1,6 @@ -const _ = require('lodash'); +import _ from 'lodash'; -module.exports = (attrs) => { +module.exports = (attrs: object[] | Record) => { if (Array.isArray(attrs)) { return attrs.map((setting) => { return _.pick(setting, ['key', 'value', 'is_read_only']); diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.js b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.js deleted file mode 100644 index e346cce234b3..000000000000 --- a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @param {import('bookshelf').Model} snippet - * @param {Frame} frame - * - * @returns {SerializedSnippet} - */ -module.exports = (snippet, frame) => { - const json = snippet.toJSON(frame.options); - - return { - id: json.id, - name: json.name, - mobiledoc: json.mobiledoc, - lexical: json.lexical, - created_at: json.created_at, - updated_at: json.updated_at, - }; -}; - -/** - * @typedef {Object} SerializedSnippet - * @prop {string} id - * @prop {string} [name] - * @prop {string} [mobiledoc] - * @prop {string} [lexical] - * @prop {string} created_at - * @prop {string} updated_at - */ - -/** - * @typedef {Object} Frame - * @prop {Object} options - */ diff --git a/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.ts b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.ts new file mode 100644 index 000000000000..4286aeeba37d --- /dev/null +++ b/ghost/core/server/api/endpoints/utils/serializers/output/mappers/snippets.ts @@ -0,0 +1,26 @@ +import type { Frame } from '@tryghost/api-framework'; + +module.exports = ( + snippet: { + toJSON(options: unknown): { + id: string; + name?: string; + mobiledoc?: string; + lexical?: string; + created_at: string; + updated_at: string; + }; + }, + frame: Frame, +) => { + const json = snippet.toJSON(frame.options); + + return { + id: json.id, + name: json.name, + mobiledoc: json.mobiledoc, + lexical: json.lexical, + created_at: json.created_at, + updated_at: json.updated_at, + }; +}; diff --git a/ghost/core/server/services/service-inventory.yaml b/ghost/core/server/services/service-inventory.yaml index 63782b423ac8..5270c77a5277 100644 --- a/ghost/core/server/services/service-inventory.yaml +++ b/ghost/core/server/services/service-inventory.yaml @@ -4995,7 +4995,7 @@ services: - core/server/api/endpoints/integrations.js - core/server/web/api/endpoints/admin/routes.js - core/server/api/endpoints/utils/serializers/input/integrations.js - - core/server/api/endpoints/utils/serializers/output/mappers/integrations.js + - core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts - core/server/models/integration.js tests: - test/e2e-api/admin/integrations.test.js @@ -5066,7 +5066,7 @@ services: - core/server/services/integrations/integrations-service.js - core/server/api/endpoints/integrations.js - core/server/api/endpoints/utils/serializers/input/integrations.js - - core/server/api/endpoints/utils/serializers/output/mappers/integrations.js + - core/server/api/endpoints/utils/serializers/output/mappers/integrations.ts - core/server/models/api-key.js tests: - test/e2e-api/admin/integrations.test.js @@ -8779,7 +8779,7 @@ services: - core/server/services/mentions/index.ts - core/server/api/endpoints/mentions.js - core/server/api/endpoints/utils/serializers/input/mentions.js - - core/server/api/endpoints/utils/serializers/output/mappers/mentions.js + - core/server/api/endpoints/utils/serializers/output/mappers/mentions.ts - core/server/web/api/endpoints/admin/routes.js - core/server/web/webmentions/routes.js - core/server/services/mentions/mention-controller.js From 11a8df053f90675a3704b96efe79d304fbce77ba Mon Sep 17 00:00:00 2001 From: Renato Costa <130500381+renatoworks@users.noreply.github.com> Date: Thu, 12 Nov 2026 12:35:53 +0200 Subject: [PATCH 028/174] Changed single-choice custom fields in Portal to mark the answer with a check (#32823) ref https://linear.app/ghost/issue/DYA-244 Every row of a list that takes one answer started with an empty radio circle, a column of identical circles down the left that said little, since only one row is ever picked. The list works as a menu: picking closes it. So, as Apple's menus do, rows now keep the marker's space at the start, keeping their text in line, and only the picked row shows a check there, in the site's accent colour. Lists that take several answers keep their checkboxes, the cue that more than one can be picked. The marker has no border at all rather than a transparent one, as high-contrast modes draw transparent borders in the text colour, which would have made every row a box, as in a list that takes several. That also leaves the "(None)" row's own hiding rule with nothing to hide, so it goes. Portal's script is about 100 bytes smaller gzipped. The tick in a multi-choice checkbox sat a pixel above the middle of its box on a 2x screen, and the single-choice check, which started from the same position, sat two to three pixels above the middle of the row's text. Chrome snaps the tick to whole pixels, so the offsets were measured at 1x, 2x and 3x and the ones closest to centred at all three were chosen: the checkbox tick is now centred at 2x and within a pixel at 1x and 3x, and the check is within a pixel of the text's middle at every scale. --- .../src/components/common/list-picker.tsx | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/apps/portal/src/components/common/list-picker.tsx b/apps/portal/src/components/common/list-picker.tsx index 4827c68fe4f6..bfc6caf328cb 100644 --- a/apps/portal/src/components/common/list-picker.tsx +++ b/apps/portal/src/components/common/list-picker.tsx @@ -278,7 +278,6 @@ export const ListPickerStyles = ` box-shadow: inset 0 0 0 2px var(--brandcolor); } - /* A box for several answers and a circle for one, the cue checkboxes and radios give. */ .gh-portal-listpicker-marker { position: relative; flex: none; @@ -288,13 +287,8 @@ export const ListPickerStyles = ` border-radius: 4px; } - .gh-portal-listpicker-marker.is-round { - border-radius: 50%; - } - - /* Keeps the row's text in line with the options' without a marker of its own. */ - .gh-portal-listpicker-marker.is-none { - visibility: hidden; + .gh-portal-listpicker-marker.is-check { + border: 0; } .gh-portal-listpicker-option[aria-selected="true"] .gh-portal-listpicker-marker { @@ -305,7 +299,7 @@ export const ListPickerStyles = ` .gh-portal-listpicker-option[aria-selected="true"] .gh-portal-listpicker-marker::after { content: ""; position: absolute; - top: 0.5px; + top: 1px; left: 3.5px; width: 3.5px; height: 7px; @@ -314,15 +308,16 @@ export const ListPickerStyles = ` transform: rotate(45deg); } - .gh-portal-listpicker-option[aria-selected="true"] .gh-portal-listpicker-marker.is-round::after { - top: 3px; - left: 3px; - width: 5px; - height: 5px; - border: 0; - border-radius: 50%; - background: var(--white); - transform: none; + .gh-portal-listpicker-option[aria-selected="true"] .gh-portal-listpicker-marker.is-check { + background: none; + } + + .gh-portal-listpicker-option[aria-selected="true"] .gh-portal-listpicker-marker.is-check::after { + top: 2px; + left: 4.5px; + width: 4px; + height: 8px; + border-color: var(--brandcolor); } /* In the sheet, rows are sized for a finger and the list takes the sheet's remaining height. */ @@ -698,13 +693,12 @@ export default function ListPicker({ onMouseDown={(event) => event.preventDefault()} onMouseMove={() => highlightRow(index, false)} > + {/* A box for several answers, the cue a checkbox gives. For one, a space where a check + marks the answer picked, as a menu marks its choice, keeping every row's text in + line. */}