From 31c555b64ef5012896fb8594c28365cdebd4dc50 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Tue, 27 Aug 2024 16:51:51 +0100 Subject: [PATCH 1/5] feat!: remove deprecated renamed plugins --- package-lock.json | 15 +- plugins/backend-app/.toolkitrc.yml | 4 - plugins/backend-app/CHANGELOG.md | 396 ---------------------- plugins/backend-app/index.js | 0 plugins/backend-app/package.json | 26 -- plugins/backend-app/readme.md | 5 - plugins/circleci-heroku/.toolkitrc.yml | 11 - plugins/circleci-heroku/CHANGELOG.md | 434 ------------------------- plugins/circleci-heroku/index.js | 0 plugins/circleci-heroku/package.json | 34 -- plugins/circleci-heroku/readme.md | 8 - release-please-config.json | 2 - 12 files changed, 2 insertions(+), 933 deletions(-) delete mode 100644 plugins/backend-app/.toolkitrc.yml delete mode 100644 plugins/backend-app/CHANGELOG.md delete mode 100644 plugins/backend-app/index.js delete mode 100644 plugins/backend-app/package.json delete mode 100644 plugins/backend-app/readme.md delete mode 100644 plugins/circleci-heroku/.toolkitrc.yml delete mode 100644 plugins/circleci-heroku/CHANGELOG.md delete mode 100644 plugins/circleci-heroku/index.js delete mode 100644 plugins/circleci-heroku/package.json delete mode 100644 plugins/circleci-heroku/readme.md diff --git a/package-lock.json b/package-lock.json index a11fca05f..50c23b309 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6424,10 +6424,6 @@ "resolved": "plugins/babel", "link": true }, - "node_modules/@dotcom-tool-kit/backend-app": { - "resolved": "plugins/backend-app", - "link": true - }, "node_modules/@dotcom-tool-kit/backend-heroku-app": { "resolved": "plugins/backend-heroku-app", "link": true @@ -6448,10 +6444,6 @@ "resolved": "plugins/circleci-deploy", "link": true }, - "node_modules/@dotcom-tool-kit/circleci-heroku": { - "resolved": "plugins/circleci-heroku", - "link": true - }, "node_modules/@dotcom-tool-kit/circleci-npm": { "resolved": "plugins/circleci-npm", "link": true @@ -31190,6 +31182,7 @@ "plugins/backend-app": { "name": "@dotcom-tool-kit/backend-app", "version": "3.2.6", + "extraneous": true, "license": "ISC", "dependencies": { "@dotcom-tool-kit/backend-heroku-app": "^3.1.6" @@ -31301,6 +31294,7 @@ "plugins/circleci-heroku": { "name": "@dotcom-tool-kit/circleci-heroku", "version": "3.2.6", + "extraneous": true, "license": "ISC", "dependencies": { "@dotcom-tool-kit/circleci-deploy": "^3.4.5", @@ -31315,11 +31309,6 @@ "dotcom-tool-kit": "3.x" } }, - "plugins/circleci-heroku/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, "plugins/circleci-npm": { "name": "@dotcom-tool-kit/circleci-npm", "version": "5.3.5", diff --git a/plugins/backend-app/.toolkitrc.yml b/plugins/backend-app/.toolkitrc.yml deleted file mode 100644 index 17d4d01f7..000000000 --- a/plugins/backend-app/.toolkitrc.yml +++ /dev/null @@ -1,4 +0,0 @@ -plugins: - - '@dotcom-tool-kit/backend-heroku-app' - -version: 2 diff --git a/plugins/backend-app/CHANGELOG.md b/plugins/backend-app/CHANGELOG.md deleted file mode 100644 index f1ca72718..000000000 --- a/plugins/backend-app/CHANGELOG.md +++ /dev/null @@ -1,396 +0,0 @@ -# Changelog - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.0 to ^2.0.1 - * @dotcom-tool-kit/npm bumped from ^2.0.0 to ^2.0.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.1 to ^2.0.2 - * @dotcom-tool-kit/npm bumped from ^2.0.1 to ^2.0.2 - * @dotcom-tool-kit/node bumped from ^2.0.0 to ^2.0.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.2 to ^2.0.3 - * @dotcom-tool-kit/npm bumped from ^2.0.2 to ^2.0.3 - * @dotcom-tool-kit/node bumped from ^2.0.1 to ^2.0.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.3 to ^2.0.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.4 to ^2.0.5 - * @dotcom-tool-kit/npm bumped from ^2.0.3 to ^2.0.4 - * @dotcom-tool-kit/node bumped from ^2.0.2 to ^2.1.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.5 to ^2.0.6 - * @dotcom-tool-kit/npm bumped from ^2.0.4 to ^2.0.5 - * @dotcom-tool-kit/node bumped from ^2.1.0 to ^2.1.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.6 to ^2.0.7 - * @dotcom-tool-kit/npm bumped from ^2.0.5 to ^2.0.6 - * @dotcom-tool-kit/node bumped from ^2.1.1 to ^2.1.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.7 to ^2.0.8 - * @dotcom-tool-kit/npm bumped from ^2.0.6 to ^2.0.7 - * @dotcom-tool-kit/node bumped from ^2.1.2 to ^2.1.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.8 to ^2.0.9 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.9 to ^2.0.10 - * @dotcom-tool-kit/npm bumped from ^2.0.7 to ^2.0.8 - * @dotcom-tool-kit/node bumped from ^2.1.3 to ^2.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.10 to ^2.0.11 - * @dotcom-tool-kit/npm bumped from ^2.0.8 to ^2.0.9 - * @dotcom-tool-kit/node bumped from ^2.2.0 to ^2.2.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.11 to ^2.0.12 - * @dotcom-tool-kit/npm bumped from ^2.0.9 to ^2.0.10 - * @dotcom-tool-kit/node bumped from ^2.2.1 to ^2.2.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.0.12 to ^2.1.0 - * @dotcom-tool-kit/npm bumped from ^2.0.10 to ^2.0.11 - * @dotcom-tool-kit/node bumped from ^2.2.2 to ^2.2.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.2.0 to ^2.2.1 - * @dotcom-tool-kit/node bumped from ^2.2.4 to ^2.2.5 - * @dotcom-tool-kit/npm bumped from ^2.0.12 to ^2.0.13 - * @dotcom-tool-kit/secret-squirrel bumped from ^1.0.10 to ^1.0.11 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.0 to ^1.0.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.1 to ^1.0.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.2 to ^1.0.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.3 to ^1.0.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.4 to ^1.0.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.0 to ^2.1.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.1 to ^2.1.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.2 to ^2.1.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.3 to ^2.1.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.4 to ^2.1.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.5 to ^2.1.6 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.6 to ^2.1.7 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.7 to ^2.1.8 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.8 to ^2.1.9 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.9 to ^2.1.10 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.10 to ^2.1.11 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.1.11 to ^3.0.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.0 to ^3.0.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.1 to ^3.0.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.2 to ^3.0.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.3 to ^3.0.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.4 to ^3.0.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.5 to ^3.0.6 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.6 to ^3.0.7 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.7 to ^3.0.8 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.8 to ^3.0.9 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.9 to ^3.0.10 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.10 to ^3.0.11 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.11 to ^3.0.12 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.0 to ^3.1.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.1 to ^3.1.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.2 to ^3.1.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.3 to ^3.1.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.4 to ^3.1.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.1.5 to ^3.1.6 - -## [3.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v3.1.24...backend-app-v3.2.0) (2024-01-11) - - -### Features - -* add support for Node v20 ([759ac10](https://github.com/Financial-Times/dotcom-tool-kit/commit/759ac10e309885e99f54ae431c301c32ee04f972)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^3.0.12 to ^3.1.0 - -## [3.1.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v3.0.0...backend-app-v3.1.0) (2023-04-28) - - -### Features - -* specify Node 18 support in all packages' engines fields ([3b55c79](https://github.com/Financial-Times/dotcom-tool-kit/commit/3b55c79f3f55b448f1a92fcf842dab6a8906ea70)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^2.0.0 to ^2.1.0 - -## [3.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v2.2.5...backend-app-v3.0.0) (2023-04-18) - - -### ⚠ BREAKING CHANGES - -* drop support for Node 14 across all packages - -### Miscellaneous Chores - -* drop support for Node 14 across all packages ([aaee178](https://github.com/Financial-Times/dotcom-tool-kit/commit/aaee178b535a51f9c75a882d78ffd8e8aa3eac60)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/backend-heroku-app bumped from ^1.0.5 to ^2.0.0 - -## [2.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v2.1.1...backend-app-v2.2.0) (2023-01-24) - - -### Features - -* split heroku logic into separate plugins ([331ae1a](https://github.com/Financial-Times/dotcom-tool-kit/commit/331ae1a11a17da0baa7db4e0c15a10a8420b6fb8)) - -## [2.1.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v2.0.13...backend-app-v2.1.0) (2022-12-14) - - -### Features - -* **backend-app:** add secret-squirrel as dep ([f90c30e](https://github.com/Financial-Times/dotcom-tool-kit/commit/f90c30eb6a1c53cff064ac83d919bf2bd69b5983)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-heroku bumped from ^2.1.0 to ^2.2.0 - * @dotcom-tool-kit/node bumped from ^2.2.3 to ^2.2.4 - * @dotcom-tool-kit/npm bumped from ^2.0.11 to ^2.0.12 - * @dotcom-tool-kit/secret-squirrel bumped from ^1.0.9 to ^1.0.10 - -## [2.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/backend-app-v1.9.0...backend-app-v2.0.0) (2022-04-19) - - -### Miscellaneous Chores - -* release 2.0 version for all packages ([42dc5d3](https://github.com/Financial-Times/dotcom-tool-kit/commit/42dc5d39bf330b9bca4121d062470904f9c6918d)) diff --git a/plugins/backend-app/index.js b/plugins/backend-app/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/backend-app/package.json b/plugins/backend-app/package.json deleted file mode 100644 index 6bee10311..000000000 --- a/plugins/backend-app/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@dotcom-tool-kit/backend-app", - "version": "3.2.6", - "description": "", - "main": "index.js", - "keywords": [], - "author": "FT.com Platforms Team ", - "license": "ISC", - "dependencies": { - "@dotcom-tool-kit/backend-heroku-app": "^3.1.6" - }, - "repository": { - "type": "git", - "url": "https://github.com/financial-times/dotcom-tool-kit.git", - "directory": "plugins/backend-app" - }, - "bugs": "https://github.com/financial-times/dotcom-tool-kit/issues", - "homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/plugins/backend-app", - "peerDependencies": { - "dotcom-tool-kit": "3.x" - }, - "engines": { - "node": "18.x || 20.x", - "npm": "7.x || 8.x || 9.x || 10.x" - } -} diff --git a/plugins/backend-app/readme.md b/plugins/backend-app/readme.md deleted file mode 100644 index 13e900de3..000000000 --- a/plugins/backend-app/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# @dotcom-tool-kit/backend-app - -## Deprecated - -This plugin is deprecated. It is kept to preserve backwards compatibility for projects that previously depended on it, but just imports the `backend-heroku-app`, which supersedes this plugin. diff --git a/plugins/circleci-heroku/.toolkitrc.yml b/plugins/circleci-heroku/.toolkitrc.yml deleted file mode 100644 index 332016f76..000000000 --- a/plugins/circleci-heroku/.toolkitrc.yml +++ /dev/null @@ -1,11 +0,0 @@ -plugins: - - '@dotcom-tool-kit/circleci-deploy' - - '@dotcom-tool-kit/heroku' - -commands: - 'deploy:review': HerokuReview - 'deploy:staging': HerokuStaging - 'deploy:production': HerokuProduction - 'teardown:staging': HerokuTeardown - -version: 2 diff --git a/plugins/circleci-heroku/CHANGELOG.md b/plugins/circleci-heroku/CHANGELOG.md deleted file mode 100644 index 8e75dd4b2..000000000 --- a/plugins/circleci-heroku/CHANGELOG.md +++ /dev/null @@ -1,434 +0,0 @@ -# Changelog - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^2.0.0 to ^2.0.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.0.0 to ^2.0.1 - * @dotcom-tool-kit/heroku bumped from ^2.0.1 to ^2.0.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.0.1 to ^2.1.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^2.0.2 to ^2.0.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.0 to ^2.1.1 - * @dotcom-tool-kit/heroku bumped from ^2.0.3 to ^2.0.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.1 to ^2.1.2 - * @dotcom-tool-kit/heroku bumped from ^2.0.4 to ^2.0.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.2 to ^2.1.3 - * @dotcom-tool-kit/heroku bumped from ^2.0.5 to ^2.0.6 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.3 to ^2.1.4 - * @dotcom-tool-kit/heroku bumped from ^2.0.6 to ^2.0.7 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^2.0.7 to ^2.0.8 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.4 to ^2.1.5 - * @dotcom-tool-kit/heroku bumped from ^2.0.8 to ^2.0.9 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.5 to ^2.1.6 - * @dotcom-tool-kit/heroku bumped from ^2.0.9 to ^2.0.10 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^3.0.1 to ^3.0.2 - * @dotcom-tool-kit/heroku bumped from ^2.1.2 to ^2.1.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^1.0.0 to ^2.0.0 - * @dotcom-tool-kit/heroku bumped from ^2.1.3 to ^2.1.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^2.0.0 to ^2.0.1 - * @dotcom-tool-kit/heroku bumped from ^2.1.4 to ^2.1.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^2.0.1 to ^2.0.2 - * @dotcom-tool-kit/heroku bumped from ^2.1.5 to ^2.1.6 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^2.0.2 to ^2.0.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^2.0.3 to ^2.1.0 - * @dotcom-tool-kit/heroku bumped from ^2.1.6 to ^2.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.1.0 to ^3.1.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.1.1 to ^3.1.2 - * @dotcom-tool-kit/heroku bumped from ^3.1.0 to ^3.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.1.2 to ^3.2.0 - * @dotcom-tool-kit/heroku bumped from ^3.2.0 to ^3.2.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.0 to ^3.2.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.1 to ^3.2.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.2 to ^3.2.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.3 to ^3.2.4 - * @dotcom-tool-kit/heroku bumped from ^3.2.1 to ^3.2.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.5 to ^3.2.6 - * @dotcom-tool-kit/heroku bumped from ^3.2.3 to ^3.3.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.0 to ^3.3.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.6 to ^3.2.7 - * @dotcom-tool-kit/heroku bumped from ^3.3.1 to ^3.3.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.2 to ^3.3.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.7 to ^3.2.8 - * @dotcom-tool-kit/heroku bumped from ^3.3.3 to ^3.3.4 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.4 to ^3.3.5 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.5 to ^3.3.6 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.6 to ^3.3.7 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.7 to ^3.3.8 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.8 to ^3.3.9 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.9 to ^3.3.10 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.10 to ^3.3.11 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.11 to ^3.3.12 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.12 to ^3.3.13 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/heroku bumped from ^3.3.13 to ^3.3.14 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.8 to ^3.2.9 - * @dotcom-tool-kit/heroku bumped from ^3.3.14 to ^3.3.15 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.3.0 to ^3.4.0 - * @dotcom-tool-kit/heroku bumped from ^3.4.0 to ^3.4.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.4.0 to ^3.4.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.4.1 to ^3.4.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.4.2 to ^3.4.3 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.4.3 to ^3.4.4 - * @dotcom-tool-kit/heroku bumped from ^3.4.1 to ^3.4.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.4.4 to ^3.4.5 - -## [3.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v3.1.24...circleci-heroku-v3.2.0) (2024-01-11) - - -### Features - -* add support for Node v20 ([759ac10](https://github.com/Financial-Times/dotcom-tool-kit/commit/759ac10e309885e99f54ae431c301c32ee04f972)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.9 to ^3.3.0 - * @dotcom-tool-kit/heroku bumped from ^3.3.15 to ^3.4.0 - -## [3.1.8](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v3.1.7...circleci-heroku-v3.1.8) (2023-07-04) - - -### Bug Fixes - -* **circleci-heroku:** point to index.js file in package.json ([e548ec5](https://github.com/Financial-Times/dotcom-tool-kit/commit/e548ec5e7ca26c901fcde806729e0597773b0fdc)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.2.4 to ^3.2.5 - * @dotcom-tool-kit/heroku bumped from ^3.2.2 to ^3.2.3 - -## [3.1.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v3.0.0...circleci-heroku-v3.1.0) (2023-04-28) - - -### Features - -* specify Node 18 support in all packages' engines fields ([3b55c79](https://github.com/Financial-Times/dotcom-tool-kit/commit/3b55c79f3f55b448f1a92fcf842dab6a8906ea70)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^3.0.0 to ^3.1.0 - * @dotcom-tool-kit/heroku bumped from ^3.0.0 to ^3.1.0 - -## [3.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v2.3.5...circleci-heroku-v3.0.0) (2023-04-18) - - -### ⚠ BREAKING CHANGES - -* drop support for Node 14 across all packages - -### Miscellaneous Chores - -* drop support for Node 14 across all packages ([aaee178](https://github.com/Financial-Times/dotcom-tool-kit/commit/aaee178b535a51f9c75a882d78ffd8e8aa3eac60)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci-deploy bumped from ^2.1.0 to ^3.0.0 - * @dotcom-tool-kit/heroku bumped from ^2.2.0 to ^3.0.0 - -## [2.3.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v2.2.1...circleci-heroku-v2.3.0) (2023-01-24) - - -### Features - -* split heroku logic into separate plugins ([331ae1a](https://github.com/Financial-Times/dotcom-tool-kit/commit/331ae1a11a17da0baa7db4e0c15a10a8420b6fb8)) - -## [2.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v2.1.0...circleci-heroku-v2.2.0) (2022-12-14) - - -### Features - -* **circleci-heroku:** add heroku-provision to Nightly workflow ([63baa6e](https://github.com/Financial-Times/dotcom-tool-kit/commit/63baa6e942ad87ef82d6804d5541bb22f8ac2c94)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^3.0.0 to ^3.0.1 - * @dotcom-tool-kit/heroku bumped from ^2.1.1 to ^2.1.2 - -## [2.1.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v2.0.12...circleci-heroku-v2.1.0) (2022-12-08) - - -### Features - -* **circleci-heroku:** add support for using a Cypress docker image ([59f914a](https://github.com/Financial-Times/dotcom-tool-kit/commit/59f914aefdb7beae5e8ea0fac314efbc7194d802)) - - -### Bug Fixes - -* **circleci-heroku:** run provision step even for nori/renovate builds ([6f48e8c](https://github.com/Financial-Times/dotcom-tool-kit/commit/6f48e8c5d7cb39296222487b34617f491fc4c20e)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.7 to ^3.0.0 - * @dotcom-tool-kit/heroku bumped from ^2.1.0 to ^2.1.1 - -### [2.0.12](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v2.0.11...circleci-heroku-v2.0.12) (2022-11-09) - - -### Bug Fixes - -* add tslib to individual plugins ([142363e](https://github.com/Financial-Times/dotcom-tool-kit/commit/142363edb2a82ebf4dc3c8e1b392888ebfd7dc89)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^2.1.6 to ^2.1.7 - * @dotcom-tool-kit/heroku bumped from ^2.0.10 to ^2.1.0 - -## [2.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/circleci-heroku-v1.9.0...circleci-heroku-v2.0.0) (2022-04-19) - - -### Miscellaneous Chores - -* release 2.0 version for all packages ([42dc5d3](https://github.com/Financial-Times/dotcom-tool-kit/commit/42dc5d39bf330b9bca4121d062470904f9c6918d)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/circleci bumped from ^1.9.0 to ^2.0.0 - * @dotcom-tool-kit/heroku bumped from ^1.9.0 to ^2.0.0 diff --git a/plugins/circleci-heroku/index.js b/plugins/circleci-heroku/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/plugins/circleci-heroku/package.json b/plugins/circleci-heroku/package.json deleted file mode 100644 index 69f3ec49e..000000000 --- a/plugins/circleci-heroku/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@dotcom-tool-kit/circleci-heroku", - "version": "3.2.6", - "description": "", - "main": "index.js", - "scripts": { - "test": "cd ../../ ; npx jest --silent --projects plugins/circleci-heroku" - }, - "keywords": [], - "author": "FT.com Platforms Team ", - "license": "ISC", - "dependencies": { - "@dotcom-tool-kit/circleci-deploy": "^3.4.5", - "@dotcom-tool-kit/heroku": "^3.4.2", - "tslib": "^2.3.1" - }, - "repository": { - "type": "git", - "url": "https://github.com/financial-times/dotcom-tool-kit.git", - "directory": "plugins/circleci-heroku" - }, - "bugs": "https://github.com/financial-times/dotcom-tool-kit/issues", - "homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/plugins/circleci-heroku", - "volta": { - "extends": "../../package.json" - }, - "peerDependencies": { - "dotcom-tool-kit": "3.x" - }, - "engines": { - "node": "18.x || 20.x", - "npm": "7.x || 8.x || 9.x || 10.x" - } -} diff --git a/plugins/circleci-heroku/readme.md b/plugins/circleci-heroku/readme.md deleted file mode 100644 index c5dc3ccd2..000000000 --- a/plugins/circleci-heroku/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# @dotcom-tool-kit/circleci-heroku - -## Deprecated - -This plugin is deprecated. It is kept to preserve backwards compatibility for projects that previously depended on it, but just imports the `heroku` plugin as well as the new `circleci-deploy` plugin, which supersedes this plugin. It also sets the hooks exported by `circleci-deploy` to use the `heroku` tasks by default. - -The `circleci-deploy` exports the same hooks that this plugin used to, but is renamed to be more generic – making explicit its support for other services to deploy to such as Serverless. - diff --git a/release-please-config.json b/release-please-config.json index b444ce935..15e77c012 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -25,12 +25,10 @@ "release-type": "simple" }, "plugins/babel": {}, - "plugins/backend-app": {}, "plugins/backend-heroku-app": {}, "plugins/backend-serverless-app": {}, "plugins/circleci": {}, "plugins/circleci-deploy": {}, - "plugins/circleci-heroku": {}, "plugins/circleci-npm": {}, "plugins/component": {}, "plugins/cypress": {}, From dd755f878bb71239d91a04a1095d75d0c78c32f7 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Tue, 27 Aug 2024 16:56:32 +0100 Subject: [PATCH 2/5] feat(pa11y)!: remove deprecated plugin --- lib/schemas/src/plugins.ts | 1 - lib/schemas/src/tasks.ts | 2 - lib/schemas/src/tasks/pa11y.ts | 11 - package-lock.json | 560 +----------------------------- plugins/circleci-deploy/readme.md | 18 +- plugins/pa11y/.toolkitrc.yml | 10 - plugins/pa11y/CHANGELOG.md | 248 ------------- plugins/pa11y/jest.config.js | 5 - plugins/pa11y/package.json | 40 --- plugins/pa11y/readme.md | 43 --- plugins/pa11y/src/tasks/pa11y.ts | 27 -- plugins/pa11y/test/pa11y.test.ts | 50 --- plugins/pa11y/tsconfig.json | 28 -- release-please-config.json | 1 - tsconfig.json | 3 - 15 files changed, 24 insertions(+), 1023 deletions(-) delete mode 100644 lib/schemas/src/tasks/pa11y.ts delete mode 100644 plugins/pa11y/.toolkitrc.yml delete mode 100644 plugins/pa11y/CHANGELOG.md delete mode 100644 plugins/pa11y/jest.config.js delete mode 100644 plugins/pa11y/package.json delete mode 100644 plugins/pa11y/readme.md delete mode 100644 plugins/pa11y/src/tasks/pa11y.ts delete mode 100644 plugins/pa11y/test/pa11y.test.ts delete mode 100644 plugins/pa11y/tsconfig.json diff --git a/lib/schemas/src/plugins.ts b/lib/schemas/src/plugins.ts index ad3f1ea26..ff21d7203 100644 --- a/lib/schemas/src/plugins.ts +++ b/lib/schemas/src/plugins.ts @@ -20,7 +20,6 @@ export const legacyPluginOptions: Record = { '@dotcom-tool-kit/n-test': 'NTest', '@dotcom-tool-kit/node': 'Node', '@dotcom-tool-kit/nodemon': 'Nodemon', - '@dotcom-tool-kit/pa11y': 'Pa11y', '@dotcom-tool-kit/prettier': 'Prettier', '@dotcom-tool-kit/typescript': 'TypeScript', '@dotcom-tool-kit/upload-assets-to-s3': 'UploadAssetsToS3', diff --git a/lib/schemas/src/tasks.ts b/lib/schemas/src/tasks.ts index 80b20ba62..1a13ace22 100644 --- a/lib/schemas/src/tasks.ts +++ b/lib/schemas/src/tasks.ts @@ -5,7 +5,6 @@ import { JestSchema } from './tasks/jest' import { MochaSchema } from './tasks/mocha' import { NodeSchema } from './tasks/node' import { NodemonSchema } from './tasks/nodemon' -import { Pa11ySchema } from './tasks/pa11y' import { PrettierSchema } from './tasks/prettier' import { TypeScriptSchema } from './tasks/typescript' import { UploadAssetsToS3Schema } from './tasks/upload-assets-to-s3' @@ -32,7 +31,6 @@ export const TaskSchemas = { NpmPrune: z.object({}).describe('Prune development npm dependencies.'), NpmPublish: z.object({}).describe('Publish package to the npm registry.'), NTest: SmokeTestSchema, - Pa11y: Pa11ySchema, Prettier: PrettierSchema, ServerlessDeploy: z.object({}).describe('Deploy a serverless function'), ServerlessProvision: z.object({}).describe('Provision a review serverless function'), diff --git a/lib/schemas/src/tasks/pa11y.ts b/lib/schemas/src/tasks/pa11y.ts deleted file mode 100644 index 261d3f552..000000000 --- a/lib/schemas/src/tasks/pa11y.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { z } from 'zod' - -export const Pa11ySchema = z - .object({ - configFile: z.string().optional().describe('Path to the config file') - }) - .describe('runs `pa11y-ci` to execute Pa11y tests') - -export type Pa11yOptions = z.infer - -export const Schema = Pa11ySchema diff --git a/package-lock.json b/package-lock.json index 50c23b309..26ab0ada0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6536,10 +6536,6 @@ "resolved": "lib/options", "link": true }, - "node_modules/@dotcom-tool-kit/pa11y": { - "resolved": "plugins/pa11y", - "link": true - }, "node_modules/@dotcom-tool-kit/package-json-hook": { "resolved": "plugins/package-json-hook", "link": true @@ -10399,14 +10395,6 @@ "p-retry": "*" } }, - "node_modules/@types/pa11y": { - "version": "5.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/puppeteer": "^3" - } - }, "node_modules/@types/pacote": { "version": "11.1.3", "dev": true, @@ -10430,14 +10418,6 @@ "@types/node": "*" } }, - "node_modules/@types/puppeteer": { - "version": "3.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/request": { "version": "2.48.8", "license": "MIT", @@ -11405,14 +11385,6 @@ "node": ">=8" } }, - "node_modules/array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-unique": { "version": "0.3.2", "license": "MIT", @@ -11715,14 +11687,6 @@ "version": "1.11.0", "license": "MIT" }, - "node_modules/axe-core": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.2.tgz", - "integrity": "sha512-LVAaGp/wkkgYJcjmHsoKx4juT1aQvJyPcW09MLCjVTh3V2cc6PnyempiLMNH5iMdfIX/zdbjUx2KDjMLCTdPeA==", - "engines": { - "node": ">=12" - } - }, "node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -11960,20 +11924,6 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==" }, - "node_modules/bfj": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.0.2.tgz", - "integrity": "sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw==", - "dependencies": { - "bluebird": "^3.5.5", - "check-types": "^11.1.1", - "hoopy": "^0.1.4", - "tryer": "^1.0.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, "node_modules/big.js": { "version": "5.2.2", "license": "MIT", @@ -12037,6 +11987,7 @@ }, "node_modules/boolbase": { "version": "1.0.0", + "dev": true, "license": "ISC" }, "node_modules/bowser": { @@ -12589,58 +12540,6 @@ "node": "*" } }, - "node_modules/check-types": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz", - "integrity": "sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==" - }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", - "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" - }, - "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" - } - }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/cheerio/node_modules/parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "dependencies": { - "entities": "^4.3.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/child-process-ext": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/child-process-ext/-/child-process-ext-2.1.1.tgz", @@ -13129,6 +13028,7 @@ }, "node_modules/commander": { "version": "6.2.1", + "dev": true, "license": "MIT", "engines": { "node": ">= 6" @@ -13956,6 +13856,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -13972,6 +13873,7 @@ }, "node_modules/css-what": { "version": "6.1.0", + "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">= 6" @@ -14581,11 +14483,6 @@ "node": ">=8" } }, - "node_modules/devtools-protocol": { - "version": "0.0.869402", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.869402.tgz", - "integrity": "sha512-VvlVYY+VDJe639yHs5PHISzdWTLL3Aw8rO4cvUtwvoxFd6FHbE4OpHHcde52M6096uYYazAmd4l0o5VuFRO2WA==" - }, "node_modules/dezalgo": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", @@ -14653,6 +14550,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -14672,6 +14570,7 @@ }, "node_modules/domelementtype": { "version": "2.3.0", + "dev": true, "funding": [ { "type": "github", @@ -14684,6 +14583,7 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -14698,6 +14598,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "dev": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -14942,6 +14843,7 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "dev": true, "engines": { "node": ">=0.12" }, @@ -16187,14 +16089,6 @@ "license": "MIT", "optional": true }, - "node_modules/file-url": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/file-url/-/file-url-3.0.0.tgz", - "integrity": "sha512-g872QGsHexznxkIAdK8UiZRe7SkE6kvylShU4Nsj8NvfvZag7S0QuQ4IgvPDkk75HxgjIVDwycFTDAgIiO4nDA==", - "engines": { - "node": ">=8" - } - }, "node_modules/filename-reserved-regex": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", @@ -17338,41 +17232,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hogan.js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/hogan.js/-/hogan.js-3.0.2.tgz", - "integrity": "sha512-RqGs4wavGYJWE07t35JQccByczmNUXQT0E12ZYV1VKYu5UiAU9lsos/yBAcf840+zrUQQxgVduCR5/B8nNtibg==", - "dependencies": { - "mkdirp": "0.3.0", - "nopt": "1.0.10" - }, - "bin": { - "hulk": "bin/hulk" - } - }, - "node_modules/hogan.js/node_modules/mkdirp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", - "integrity": "sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==", - "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", - "engines": { - "node": "*" - } - }, - "node_modules/hogan.js/node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/hook-std": { "version": "2.0.0", "license": "MIT", @@ -17380,14 +17239,6 @@ "node": ">=8" } }, - "node_modules/hoopy": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", - "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==", - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/hosted-git-info": { "version": "4.1.0", "license": "ISC", @@ -17412,37 +17263,11 @@ "version": "4.0.0", "license": "ISC" }, - "node_modules/html_codesniffer": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/html_codesniffer/-/html_codesniffer-2.5.1.tgz", - "integrity": "sha512-vcz0yAaX/OaV6sdNHuT9alBOKkSxYb8h5Yq26dUqgi7XmCgGUSa7U9PiY1PBXQFMjKv1wVPs5/QzHlGuxPDUGg==", - "engines": { - "node": ">=6" - } - }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" }, - "node_modules/htmlparser2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", - "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "entities": "^4.3.0" - } - }, "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", @@ -17887,14 +17712,6 @@ "node": ">=8" } }, - "node_modules/is": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", - "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", - "engines": { - "node": "*" - } - }, "node_modules/is-accessor-descriptor": { "version": "0.1.6", "license": "MIT", @@ -22737,18 +22554,6 @@ "node": ">=6" } }, - "node_modules/node.extend": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-2.0.2.tgz", - "integrity": "sha512-pDT4Dchl94/+kkgdwyS2PauDFjZG0Hk0IcHIB+LkW27HLDtdoeMxHTxZh39DYbPP8UflWXWj9JcdDozF+YDOpQ==", - "dependencies": { - "has": "^1.0.3", - "is": "^3.2.1" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/nodemon": { "version": "2.0.16", "hasInstallScript": true, @@ -23344,6 +23149,7 @@ }, "node_modules/nth-check": { "version": "2.0.1", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" @@ -23782,294 +23588,6 @@ "node": ">=6" } }, - "node_modules/pa11y": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/pa11y/-/pa11y-6.1.1.tgz", - "integrity": "sha512-2NzqA3D9CUlDWj8WuOI4fM2P0qM1d/IUxsRRpzCOfDT5eMR1oEgmUwW2TAk+f90ff/GVck0BewdYT4et4BANew==", - "dependencies": { - "axe-core": "^4.0.2", - "bfj": "~7.0.2", - "commander": "~8.0.0", - "envinfo": "~7.8.1", - "hogan.js": "^3.0.2", - "html_codesniffer": "^2.5.1", - "kleur": "~4.1.4", - "node.extend": "~2.0.2", - "p-timeout": "~4.1.0", - "puppeteer": "~9.1.1", - "semver": "~7.3.5" - }, - "bin": { - "pa11y": "bin/pa11y.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/pa11y-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/pa11y-ci/-/pa11y-ci-3.0.1.tgz", - "integrity": "sha512-DUtEIhEG3Ofds7qRuplq0DdCb9doILRlzcRctFNzo4QUNmVy4iZfM3u51A9cqoPo2irCJZoo5BzfiFrcriY2IQ==", - "dependencies": { - "async": "~2.6.3", - "cheerio": "~1.0.0-rc.10", - "commander": "~6.2.1", - "globby": "~6.1.0", - "kleur": "~4.1.4", - "lodash": "~4.17.21", - "node-fetch": "~2.6.1", - "pa11y": "~6.1.0", - "protocolify": "~3.0.0", - "puppeteer": "~9.1.1", - "wordwrap": "~1.0.0" - }, - "bin": { - "pa11y-ci": "bin/pa11y-ci.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/pa11y-ci/node_modules/array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", - "dependencies": { - "array-uniq": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pa11y-ci/node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/pa11y-ci/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y-ci/node_modules/globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", - "dependencies": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pa11y-ci/node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/pa11y-ci/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y-ci/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pa11y-ci/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y-ci/node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pa11y-ci/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y-ci/node_modules/puppeteer": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-9.1.1.tgz", - "integrity": "sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==", - "deprecated": "Version no longer supported. Upgrade to @latest", - "hasInstallScript": true, - "dependencies": { - "debug": "^4.1.0", - "devtools-protocol": "0.0.869402", - "extract-zip": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "pkg-dir": "^4.2.0", - "progress": "^2.0.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "tar-fs": "^2.0.0", - "unbzip2-stream": "^1.3.3", - "ws": "^7.2.3" - }, - "engines": { - "node": ">=10.18.1" - } - }, - "node_modules/pa11y/node_modules/commander": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.0.0.tgz", - "integrity": "sha512-Xvf85aAtu6v22+E5hfVoLHqyul/jyxh91zvqk/ioJTQuJR7Z78n7H558vMPKanPSRgIEeZemT92I2g9Y8LPbSQ==", - "engines": { - "node": ">= 12" - } - }, - "node_modules/pa11y/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y/node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/pa11y/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pa11y/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y/node_modules/p-timeout": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", - "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", - "engines": { - "node": ">=10" - } - }, - "node_modules/pa11y/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pa11y/node_modules/puppeteer": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-9.1.1.tgz", - "integrity": "sha512-W+nOulP2tYd/ZG99WuZC/I5ljjQQ7EUw/jQGcIb9eu8mDlZxNY2SgcJXTLG9h5gRvqA3uJOe4hZXYsd3EqioMw==", - "deprecated": "Version no longer supported. Upgrade to @latest", - "hasInstallScript": true, - "dependencies": { - "debug": "^4.1.0", - "devtools-protocol": "0.0.869402", - "extract-zip": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", - "pkg-dir": "^4.2.0", - "progress": "^2.0.1", - "proxy-from-env": "^1.1.0", - "rimraf": "^3.0.2", - "tar-fs": "^2.0.0", - "unbzip2-stream": "^1.3.3", - "ws": "^7.2.3" - }, - "engines": { - "node": ">=10.18.1" - } - }, "node_modules/package-json": { "version": "6.5.0", "license": "MIT", @@ -24512,29 +24030,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", - "dependencies": { - "domhandler": "^5.0.2", - "parse5": "^7.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", - "dependencies": { - "entities": "^4.3.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, "node_modules/parseurl": { "version": "1.3.3", "license": "MIT", @@ -24749,6 +24244,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -24757,6 +24253,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "peer": true, "dependencies": { "pinkie": "^2.0.0" }, @@ -25106,26 +24603,6 @@ "node": ">= 6" } }, - "node_modules/protocolify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/protocolify/-/protocolify-3.0.0.tgz", - "integrity": "sha512-PuvDJOkKJMVQx8jSNf8E5g0bJw/UTKm30mTjFHg4N30c8sefgA5Qr/f8INKqYBKfvP/MUSJrj+z1Smjbq4/3rQ==", - "dependencies": { - "file-url": "^3.0.0", - "prepend-http": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/protocolify/node_modules/prepend-http": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-3.0.1.tgz", - "integrity": "sha512-BLxfZh+m6UiAiCPZFJ4+vYoL7NrRs5XgCTRrjseATAggXhdZKKxn+JUNmuVYWY23bDHgaEHodxw8mnmtVEDtHw==", - "engines": { - "node": ">=8" - } - }, "node_modules/proxy-from-env": { "version": "1.1.0", "license": "MIT" @@ -29066,11 +28543,6 @@ "version": "1.3.0", "license": "MIT" }, - "node_modules/tryer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", - "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" - }, "node_modules/ts-jest": { "version": "29.1.2", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", @@ -30771,6 +30243,7 @@ }, "node_modules/wordwrap": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/worker-farm": { @@ -30885,6 +30358,7 @@ "node_modules/ws": { "version": "7.5.7", "license": "MIT", + "peer": true, "engines": { "node": ">=8.3.0" }, @@ -32467,6 +31941,7 @@ "plugins/pa11y": { "name": "@dotcom-tool-kit/pa11y", "version": "0.5.3", + "extraneous": true, "license": "ISC", "dependencies": { "@dotcom-tool-kit/base": "^3.4.1", @@ -32484,11 +31959,6 @@ "dotcom-tool-kit": "3.x" } }, - "plugins/pa11y/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, "plugins/package-json-hook": { "name": "@dotcom-tool-kit/package-json-hook", "version": "4.2.0", diff --git a/plugins/circleci-deploy/readme.md b/plugins/circleci-deploy/readme.md index 4e1975765..5f0004d7a 100644 --- a/plugins/circleci-deploy/readme.md +++ b/plugins/circleci-deploy/readme.md @@ -35,12 +35,12 @@ See [manually adding jobs to your CircleCI config](https://github.com/Financial- ## Hooks -| Event | Description | Installed to...| Default Tasks -|-|-|-|-| -| `deploy:review` | Create and test review app | `deploy-review` job in `.circle/config.yml` | HerokuReview | -| `deploy:staging` | Deploy app to staging | `deploy-staging` job in `.circle/config.yml` | HerokuStaging | -| `test:review` | Run smoke tests | `e2e-test-review` job in `.circle/config.yml` | NTest, Pa11y | -| `teardown:review` | Teardown review lambda | `e2e-test-review` job in `.circle/config.yml` | ServerlessTeardown | -| `test:staging` | Run smoke tests on staging | `e2e-test-staging` job in `.circle/config.yml` | NTest | -| `teardown:staging` | Scale down staging | `e2e-test-staging` job in `.circle/config.yml` | HerokuTeardown | -| `deploy:production` | Deploy to production | `deploy-production` job in `.circle/config.yml` | HerokuProduction | +| Event | Description | Installed to... | Default Tasks | +| ------------------- | -------------------------- | ----------------------------------------------- | ------------------ | +| `deploy:review` | Create and test review app | `deploy-review` job in `.circle/config.yml` | HerokuReview | +| `deploy:staging` | Deploy app to staging | `deploy-staging` job in `.circle/config.yml` | HerokuStaging | +| `test:review` | Run smoke tests | `e2e-test-review` job in `.circle/config.yml` | NTest | +| `teardown:review` | Teardown review lambda | `e2e-test-review` job in `.circle/config.yml` | ServerlessTeardown | +| `test:staging` | Run smoke tests on staging | `e2e-test-staging` job in `.circle/config.yml` | NTest | +| `teardown:staging` | Scale down staging | `e2e-test-staging` job in `.circle/config.yml` | HerokuTeardown | +| `deploy:production` | Deploy to production | `deploy-production` job in `.circle/config.yml` | HerokuProduction | diff --git a/plugins/pa11y/.toolkitrc.yml b/plugins/pa11y/.toolkitrc.yml deleted file mode 100644 index 5abe58fe5..000000000 --- a/plugins/pa11y/.toolkitrc.yml +++ /dev/null @@ -1,10 +0,0 @@ -plugins: - - '@dotcom-tool-kit/doppler' - -tasks: - Pa11y: './lib/tasks/pa11y' - -commands: - 'test:local': Pa11y - -version: 2 diff --git a/plugins/pa11y/CHANGELOG.md b/plugins/pa11y/CHANGELOG.md deleted file mode 100644 index 56bba27ec..000000000 --- a/plugins/pa11y/CHANGELOG.md +++ /dev/null @@ -1,248 +0,0 @@ -# Changelog - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.3.0 to ^2.4.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.5.0 to ^2.5.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.5.1 to ^2.6.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.6.0 to ^2.6.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.6.2 to ^2.7.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.7.0 to ^2.7.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.7.1 to ^2.8.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.9.0 to ^2.9.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.9.1 to ^2.9.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.9.2 to ^2.10.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.1.0 to ^3.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.2.0 to ^3.3.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.3.0 to ^3.3.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.4.0 to ^3.4.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.4.1 to ^3.5.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.6.0 to ^3.6.1 - -## [0.5.2](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.5.1...pa11y-v0.5.2) (2024-01-11) - - -### Features - -* add support for Node v20 ([759ac10](https://github.com/Financial-Times/dotcom-tool-kit/commit/759ac10e309885e99f54ae431c301c32ee04f972)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.5.0 to ^3.6.0 - -## [0.5.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.4.6...pa11y-v0.5.0) (2023-11-17) - - -### ⚠ BREAKING CHANGES - -* **pa11y:** run pa11y locally and not on CI - -### Features - -* **pa11y:** add deprecation warning ([3dfac8b](https://github.com/Financial-Times/dotcom-tool-kit/commit/3dfac8b2ad149891a2cae3b70f1f8262ea14fe53)) -* **pa11y:** run pa11y locally and not on CI ([9f7bf63](https://github.com/Financial-Times/dotcom-tool-kit/commit/9f7bf631c44e4cb68315b77062d41c6de42c6159)) - -## [0.4.5](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.4.4...pa11y-v0.4.5) (2023-09-19) - - -### Features - -* migrate plugins to use Doppler instead of Vault ([e9611ef](https://github.com/Financial-Times/dotcom-tool-kit/commit/e9611efa3457fbf3ba8d0c00ed6fbb9e0ce203b1)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.3.1 to ^3.4.0 - -## [0.4.1](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.4.0...pa11y-v0.4.1) (2023-04-28) - - -### Features - -* specify Node 18 support in all packages' engines fields ([3b55c79](https://github.com/Financial-Times/dotcom-tool-kit/commit/3b55c79f3f55b448f1a92fcf842dab6a8906ea70)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^3.0.0 to ^3.1.0 - -## [0.4.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.3.13...pa11y-v0.4.0) (2023-04-18) - - -### ⚠ BREAKING CHANGES - -* drop support for Node 14 across all packages - -### Miscellaneous Chores - -* drop support for Node 14 across all packages ([aaee178](https://github.com/Financial-Times/dotcom-tool-kit/commit/aaee178b535a51f9c75a882d78ffd8e8aa3eac60)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.10.0 to ^3.0.0 - -## [0.3.10](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.3.9...pa11y-v0.3.10) (2023-03-07) - - -### Bug Fixes - -* tidy up references in tsconfig files ([159b602](https://github.com/Financial-Times/dotcom-tool-kit/commit/159b6021e93922ebe6e4ca74297ad7a1c93290b3)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.8.0 to ^2.9.0 - -### [0.3.6](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.3.5...pa11y-v0.3.6) (2022-11-09) - - -### Bug Fixes - -* add tslib to individual plugins ([142363e](https://github.com/Financial-Times/dotcom-tool-kit/commit/142363edb2a82ebf4dc3c8e1b392888ebfd7dc89)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.6.1 to ^2.6.2 - -### [0.3.3](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.3.2...pa11y-v0.3.3) (2022-08-11) - - -### Bug Fixes - -* set process.env.TEST_URL to review app name in pa11y ([3128a4b](https://github.com/Financial-Times/dotcom-tool-kit/commit/3128a4bd938ac86a5a96fa6f3d893ddb73434995)) - -### [0.3.2](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.3.1...pa11y-v0.3.2) (2022-08-09) - - -### Bug Fixes - -* **pa11y:** resolve path to pa11y-ci binary ([763ec14](https://github.com/Financial-Times/dotcom-tool-kit/commit/763ec147f635d427be467531bde3f651ec93d55e)) - -## [0.3.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.2.1...pa11y-v0.3.0) (2022-07-27) - - -### ⚠ BREAKING CHANGES - -* **pa11y:** Instead of passing static options to Pa11y, calling the pa11y-ci binary instead reads config defined in a .pa11yci[.js[on]] file. Seeing as this can be a .js file, the config can be dynamically generated, making the tooling much more flexible. This was how n-gage interfaced with Pa11y. - -### Features - -* **pa11y:** allow Pa11y to use config defined in .pa11yci ([cf0908c](https://github.com/Financial-Times/dotcom-tool-kit/commit/cf0908c7963e802cfedb955da36607c976aa57dd)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/types bumped from ^2.4.0 to ^2.5.0 - -## [0.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.1.3...pa11y-v0.2.0) (2022-07-12) - - -### ⚠ BREAKING CHANGES - -* **pa11y:** remove Pa11y task from staging test hook - -### Bug Fixes - -* **pa11y:** remove Pa11y task from staging test hook ([dea7d5a](https://github.com/Financial-Times/dotcom-tool-kit/commit/dea7d5a61dcc7cde81e6c09fd44667b339948cbf)) - -## [0.1.3](https://github.com/Financial-Times/dotcom-tool-kit/compare/pa11y-v0.1.2...pa11y-v0.1.3) (2022-06-23) - - -### Bug Fixes - -* **pa11y:** add suggestion to error messages and fix typos ([e2c2eaa](https://github.com/Financial-Times/dotcom-tool-kit/commit/e2c2eaa54f1597f770fb6dc54e0fdfc6db9b9ba0)) -* **pa11y:** use proper Heroku domain when testing review apps ([4c75752](https://github.com/Financial-Times/dotcom-tool-kit/commit/4c757522f0560719e7280ddd6ff20ff4a508179b)) diff --git a/plugins/pa11y/jest.config.js b/plugins/pa11y/jest.config.js deleted file mode 100644 index 2ea38bb31..000000000 --- a/plugins/pa11y/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -const base = require('../../jest.config.base') - -module.exports = { - ...base.config -} diff --git a/plugins/pa11y/package.json b/plugins/pa11y/package.json deleted file mode 100644 index b282b2559..000000000 --- a/plugins/pa11y/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@dotcom-tool-kit/pa11y", - "version": "0.5.3", - "description": "pa11y", - "main": "lib", - "scripts": { - "test": "cd ../../ ; npx jest --silent --projects plugins/pa11y" - }, - "keywords": [ - "pa11y" - ], - "author": "FT.com Platforms Team ", - "license": "ISC", - "dependencies": { - "@dotcom-tool-kit/base": "^3.4.1", - "pa11y-ci": "^3.0.1", - "tslib": "^2.3.1" - }, - "repository": { - "type": "git", - "url": "https://github.com/financial-times/dotcom-tool-kit.git", - "directory": "plugins/pa11y" - }, - "bugs": "https://github.com/financial-times/dotcom-tool-kit/issues", - "homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/plugins/pa11y", - "files": [ - "/lib", - ".toolkitrc.yml" - ], - "peerDependencies": { - "dotcom-tool-kit": "3.x" - }, - "devDependencies": { - "@types/pa11y": "^5.3.4" - }, - "engines": { - "node": "18.x || 20.x", - "npm": "7.x || 8.x || 9.x || 10.x" - } -} diff --git a/plugins/pa11y/readme.md b/plugins/pa11y/readme.md deleted file mode 100644 index 9741615c5..000000000 --- a/plugins/pa11y/readme.md +++ /dev/null @@ -1,43 +0,0 @@ -# @dotcom-tool-kit/pa11y [DEPRECATED] - -A plugin to run [Pa11y](https://github.com/pa11y/pa11y) accessibility tests. This plugin uses [Pa11y CI](https://github.com/pa11y/pa11y-ci) to run the tests. - -## Deprecation warning (04/10/2023) - -Customer Products no longer recommends using Pa11y for Accessibility testing. This package will be deleted by the end of the year ([CPP-1719](https://financialtimes.atlassian.net/browse/CPP-1719)). We suggest flowing the [Accessibility Guidance in Tech Hub](https://tech.in.ft.com/tech-topics/front-end-development/accessibility) to setup Accessibility testing. - -Read more about this decision here: https://financialtimes.atlassian.net/wiki/spaces/CPP/blog/2023/10/04/8161493012/Deprecation+of+Pa11y+in+Customer+Products - -## Installation - -With Tool Kit [already set up](https://github.com/financial-times/dotcom-tool-kit#installing-and-using-tool-kit), install this plugin as a dev dependency: - -```sh -npm install --save-dev @dotcom-tool-kit/pa11y -``` - -And add it to your repo's `.toolkitrc.yml`: - -```yaml -plugins: - - '@dotcom-tool-kit/pa11y' -``` - - -## Tasks - -### `Pa11y` - -runs `pa11y-ci` to execute Pa11y tests -#### Task options - -| Property | Description | Type | -| :----------- | :---------------------- | :------- | -| `configFile` | Path to the config file | `string` | - -_All properties are optional._ - - -## To note - -This plugin will define `process.env.TEST_URL` with the Heroku review app URL which can be used in your Pa11y CI config file. diff --git a/plugins/pa11y/src/tasks/pa11y.ts b/plugins/pa11y/src/tasks/pa11y.ts deleted file mode 100644 index 1b13e81a9..000000000 --- a/plugins/pa11y/src/tasks/pa11y.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { hookFork, waitOnExit } from '@dotcom-tool-kit/logger' -import { Task } from '@dotcom-tool-kit/base' -import type { Pa11ySchema } from '@dotcom-tool-kit/schemas/lib/tasks/pa11y' -import { fork } from 'child_process' -import { readState } from '@dotcom-tool-kit/state' - -const pa11yCIPath = require.resolve('pa11y-ci/bin/pa11y-ci') - -export default class Pa11y extends Task<{ task: typeof Pa11ySchema }> { - async run(): Promise { - const localState = readState('local') - const reviewState = readState('review') - - if (localState) { - process.env.TEST_URL = `https://local.ft.com:${localState.port}` - } else if (reviewState) { - process.env.TEST_URL = `https://${reviewState.appName}.herokuapp.com` - } - - const args = this.options.configFile ? ['--config', this.options.configFile] : [] - - this.logger.info(`running pa11y-ci ${args.join(' ')}`) - const child = fork(pa11yCIPath, args, { silent: true }) - hookFork(this.logger, 'pa11y', child) - return waitOnExit('pa11y-ci', child) - } -} diff --git a/plugins/pa11y/test/pa11y.test.ts b/plugins/pa11y/test/pa11y.test.ts deleted file mode 100644 index 9b9c8d5dd..000000000 --- a/plugins/pa11y/test/pa11y.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { describe, it, expect, jest } from '@jest/globals' -import Pa11y from '../src/tasks/pa11y' -import winston, { Logger } from 'winston' -import EventEmitter from 'events' -import * as state from '@dotcom-tool-kit/state' - -const appName = 'test-app-name' -const logger = winston as unknown as Logger - -jest.mock('child_process', () => ({ - fork: jest.fn(() => { - // return a fake emitter that immediately sends an "exit" event, so the pa11y task resolves - const emitter = new EventEmitter() - process.nextTick(() => { - emitter.emit('exit', 0) - }) - return emitter - }) -})) -jest.mock('@dotcom-tool-kit/logger') -jest.mock('@dotcom-tool-kit/state') - -describe('pa11y', () => { - let MOCK_ENV: 'local' | 'ci' = 'local' - beforeEach(() => { - jest.mocked(state.readState).mockImplementation((stateType) => { - let returnState - if (stateType === 'local' && MOCK_ENV === 'local') { - returnState = { port: 5050 } as state.LocalState - } else if (stateType === 'review' && MOCK_ENV === 'ci') { - returnState = { appName } as state.ReviewState - } - return returnState - }) - }) - it("sets process.env.TEST_URL as a herokuapp url if readState('review') is truthy", async () => { - MOCK_ENV = 'ci' - const pa11y = new Pa11y(logger, 'Pa11y', {}, {}) - await pa11y.run() - - expect(process.env.TEST_URL).toBe(`https://${appName}.herokuapp.com`) - }) - it("sets process.env.TEST_URL as a local env url if readState('local') is truthy", async () => { - MOCK_ENV = 'local' - const pa11y = new Pa11y(logger, 'Pa11y', {}, {}) - await pa11y.run() - - expect(process.env.TEST_URL).toBe(`https://local.ft.com:5050`) - }) -}) diff --git a/plugins/pa11y/tsconfig.json b/plugins/pa11y/tsconfig.json deleted file mode 100644 index 6f290624f..000000000 --- a/plugins/pa11y/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": "../../tsconfig.settings.json", - "compilerOptions": { - "outDir": "lib", - "rootDir": "src", - "lib": [ - "ES2019", - "DOM" - ] - }, - "references": [ - { - "path": "../../lib/base" - }, - { - "path": "../../lib/logger" - }, - { - "path": "../../lib/error" - }, - { - "path": "../../lib/schemas" - } - ], - "include": [ - "src/**/*" - ] -} diff --git a/release-please-config.json b/release-please-config.json index 15e77c012..7375dacf8 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -46,7 +46,6 @@ "plugins/nodemon": {}, "plugins/npm": {}, "plugins/package-json-hook": {}, - "plugins/pa11y": {}, "plugins/prettier": {}, "plugins/serverless": {}, "plugins/typescript": {}, diff --git a/tsconfig.json b/tsconfig.json index 44b614346..c59c6a002 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -109,9 +109,6 @@ { "path": "plugins/circleci-npm" }, - { - "path": "plugins/pa11y" - }, { "path": "plugins/component" }, From 3af9cf917989a8505e5a96cf9a4afccdd25815d2 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Wed, 28 Aug 2024 12:03:01 +0100 Subject: [PATCH 3/5] feat(vault)!: remove references to Vault --- .../files/conflict-resolution/.toolkitrc.yml | 5 +- core/cli/test/files/duplicate/.toolkitrc.yml | 5 +- core/create/src/prompts/oidc.ts | 14 +- lib/doppler/.toolkitrc.yml | 3 - lib/doppler/package.json | 1 - lib/doppler/src/index.ts | 81 +----- lib/doppler/test/index.test.ts | 27 +- lib/doppler/tsconfig.json | 3 - lib/schemas/src/plugins.ts | 4 +- lib/schemas/src/plugins/vault.ts | 15 - lib/vault/.toolkitrc.yml | 2 - lib/vault/CHANGELOG.md | 262 ------------------ lib/vault/jest.config.js | 6 - lib/vault/package.json | 45 --- lib/vault/src/declarations.d.ts | 13 - lib/vault/src/index.ts | 195 ------------- lib/vault/test/index.test.ts | 109 -------- lib/vault/tsconfig.json | 19 -- package-lock.json | 77 +---- .../heroku/src/promoteStagingToProduction.ts | 11 +- plugins/heroku/src/setConfigVars.ts | 118 -------- plugins/heroku/src/tasks/production.ts | 2 +- plugins/heroku/src/tasks/review.ts | 2 - plugins/heroku/src/tasks/staging.ts | 4 - .../test/promoteStagingToProduction.test.ts | 18 +- plugins/heroku/test/setConfigVars.test.ts | 120 -------- plugins/heroku/test/tasks/production.test.ts | 2 +- plugins/heroku/test/tasks/review.test.ts | 31 +-- plugins/heroku/test/tasks/staging.test.ts | 33 +-- release-please-config.json | 1 - tsconfig.json | 3 - 31 files changed, 47 insertions(+), 1184 deletions(-) delete mode 100644 lib/schemas/src/plugins/vault.ts delete mode 100644 lib/vault/.toolkitrc.yml delete mode 100644 lib/vault/CHANGELOG.md delete mode 100644 lib/vault/jest.config.js delete mode 100644 lib/vault/package.json delete mode 100644 lib/vault/src/declarations.d.ts delete mode 100644 lib/vault/src/index.ts delete mode 100644 lib/vault/test/index.test.ts delete mode 100644 lib/vault/tsconfig.json delete mode 100644 plugins/heroku/src/setConfigVars.ts delete mode 100644 plugins/heroku/test/setConfigVars.test.ts diff --git a/core/cli/test/files/conflict-resolution/.toolkitrc.yml b/core/cli/test/files/conflict-resolution/.toolkitrc.yml index 69eecfe01..6bf88a62a 100644 --- a/core/cli/test/files/conflict-resolution/.toolkitrc.yml +++ b/core/cli/test/files/conflict-resolution/.toolkitrc.yml @@ -9,9 +9,8 @@ options: '@dotcom-tool-kit/heroku': pipeline: tool-kit-test systemCode: tool-kit-test - '@dotcom-tool-kit/vault': - team: platforms - app: tool-kit-test + '@dotcom-tool-kit/doppler': + project: tool-kit-test tasks: HerokuProduction: scaling: diff --git a/core/cli/test/files/duplicate/.toolkitrc.yml b/core/cli/test/files/duplicate/.toolkitrc.yml index 15a2b4078..aa7925b18 100644 --- a/core/cli/test/files/duplicate/.toolkitrc.yml +++ b/core/cli/test/files/duplicate/.toolkitrc.yml @@ -8,9 +8,8 @@ options: pipeline: tool-kit-test systemCode: tool-kit-test - '@dotcom-tool-kit/vault': - team: platforms - app: tool-kit-test + '@dotcom-tool-kit/doppler': + project: tool-kit-test tasks: HerokuProduction: scaling: diff --git a/core/create/src/prompts/oidc.ts b/core/create/src/prompts/oidc.ts index aa72e9c3f..50867b746 100644 --- a/core/create/src/prompts/oidc.ts +++ b/core/create/src/prompts/oidc.ts @@ -252,11 +252,10 @@ export default async function oidcPrompt({ toolKitConfig }: OidcParams): Promise cloudformationTemplate.setIn(policyPath, cloudformationTemplate.createNode(previousDocument)) // HACK:20240213:IM Guess Doppler project name to use in Parameter - // store path using the same logic we use to infer the name from Tool - // Kit vault plugin options. The class tries to read the options from - // the global options object so let's set these options based on what's - // been selected during the options prompt. - setOptions('@dotcom-tool-kit/vault', toolKitConfig.options.plugins['@dotcom-tool-kit/vault']) + // store path using the same logic we used to use to infer the name + // from Tool Kit vault plugin options. The class tries to read the + // options from the global options object so let's set these options + // based on what's been selected during the options prompt. setOptions('@dotcom-tool-kit/doppler', toolKitConfig.options.plugins['@dotcom-tool-kit/doppler']) const dopplerProjectName = new DopplerEnvVars(winstonLogger, 'prod').options.project const ssmAction = 'ssm:GetParameter' @@ -304,10 +303,7 @@ export default async function oidcPrompt({ toolKitConfig }: OidcParams): Promise let githubUsername try { - // We've already grabbed access tokens via the Doppler library, so we know - // that the Doppler credentials are stored in an environment variable, which - // we can use to get the current user's login ID. - const octokit = new Octokit({ auth: `token ${process.env.VAULT_AUTH_GITHUB_TOKEN}` }) + const octokit = new Octokit({ auth: `token ${dopplerEnv.GITHUB_ACCESS_TOKEN}` }) const resp = await octokit.rest.users.getAuthenticated() githubUsername = resp.data.login } catch (err) { diff --git a/lib/doppler/.toolkitrc.yml b/lib/doppler/.toolkitrc.yml index 672166f4d..22817d2a9 100644 --- a/lib/doppler/.toolkitrc.yml +++ b/lib/doppler/.toolkitrc.yml @@ -1,4 +1 @@ -plugins: - - '@dotcom-tool-kit/vault' - version: 2 diff --git a/lib/doppler/package.json b/lib/doppler/package.json index 5f7149c1f..0cdbaf0bf 100644 --- a/lib/doppler/package.json +++ b/lib/doppler/package.json @@ -10,7 +10,6 @@ "@dotcom-tool-kit/error": "^3.2.0", "@dotcom-tool-kit/logger": "^3.4.1", "@dotcom-tool-kit/options": "^3.2.1", - "@dotcom-tool-kit/vault": "^3.2.1", "tslib": "^2.3.1" }, "keywords": [], diff --git a/lib/doppler/src/index.ts b/lib/doppler/src/index.ts index d5855b39d..a894576b2 100644 --- a/lib/doppler/src/index.ts +++ b/lib/doppler/src/index.ts @@ -1,57 +1,22 @@ import { spawn } from 'node:child_process' -import fs from 'node:fs' import type { Logger } from 'winston' import { ToolKitError } from '@dotcom-tool-kit/error' import { styles, waitOnExit } from '@dotcom-tool-kit/logger' import { getOptions } from '@dotcom-tool-kit/options' -import * as Vault from '@dotcom-tool-kit/vault' import type { DopplerOptions as ConfiguredDopplerOptions } from '@dotcom-tool-kit/schemas/lib/plugins/doppler' export type Environment = 'prod' | 'ci' | 'dev' type DopplerOptions = Required export type DopplerSecrets = Record -export type Source = 'doppler' | 'vault' -export interface SecretsWithSource { - secrets: DopplerSecrets - source: Source -} - -const dopplerEnvToVaultMap: Record = { - prod: 'production', - ci: 'continuous-integration', - dev: 'development' -} - -let hasLoggedMigrationWarning = false export class DopplerEnvVars { options: DopplerOptions constructor(private logger: Logger, public environment: Environment, options?: DopplerOptions) { - let dopplerOptions = options ?? getOptions('@dotcom-tool-kit/doppler') - if (!(dopplerOptions && dopplerOptions.project)) { - // HACK:20230829:IM check the project passed to the Vault options too so - // that projects don't have to make any changes to their Tool Kit config - const projectName = getOptions('@dotcom-tool-kit/vault')?.app - // HACK:20231020:IM Projects without an associated biz ops system require - // a repo_ prefix in their name. We don't have a biz ops key (yet) so - // let's just try and infer whether it deploys anything based on the - // existence of config files. This won't always be correct and in those - // cases users should set a @dotcom-tool-kit/doppler option. - const isRepo = !( - fs.existsSync('Procfile') || - fs.existsSync('serverless.yml') || - fs.existsSync('serverless.yaml') - ) - const project = isRepo ? `repo_${projectName}` : projectName - logger.warn( - `Doppler options not found so falling back to Vault options (guessing Doppler project is named ${project})` - ) - dopplerOptions = { project } - } + const dopplerOptions = options ?? getOptions('@dotcom-tool-kit/doppler') if (!(dopplerOptions && dopplerOptions.project)) { const error = new ToolKitError('Doppler options not found in your Tool Kit configuration') error.details = `"project" is needed to get your app's secrets from doppler, e.g. @@ -102,18 +67,7 @@ export class DopplerEnvVars { } async get(): Promise { - const { secrets } = await this.getWithSource() - return secrets - } - - // TODO:20221023:IM remove this function once we drop Vault support and keep - // logic in get() instead - async getWithSource(): Promise { - // don't fallback to Vault if the project has doppler options set up - // explicitly already - const migratedToolKitToDoppler = Boolean(getOptions('@dotcom-tool-kit/doppler')?.project) - - if (migratedToolKitToDoppler && process.env.CIRCLECI) { + if (process.env.CIRCLECI && process.env.NODE_ENV !== 'test') { const error = new ToolKitError('Doppler options cannot be dynamically accessed within CircleCI') error.details = this.environment === 'ci' @@ -123,36 +77,9 @@ export class DopplerEnvVars { } const secrets = await this.invokeCLI() - if (secrets) { - return { secrets, source: 'doppler' } - } - if (migratedToolKitToDoppler) { + if (!secrets) { throw new ToolKitError('failed to get secrets from Doppler') } - - // fall back to Vault - if (!hasLoggedMigrationWarning) { - // TODO:20230919:IM enable this logging message once we're ready to shuffle people over to Doppler - // this.logger.warn( - // `getting Doppler secrets failed so falling back to the ${styles.warningHighlight( - // 'DEPRECATED' - // )} Vault secrets manager. please consider migrating to/fixing issues with Doppler.` - // ) - this.logger.warn('falling back to Vault') - hasLoggedMigrationWarning = true - } - - return { secrets: await this.fallbackToVault(), source: 'vault' } - } - - // HACK:20221024:IM This function is here just to enable projects that have - // migrated to Doppler to use the logic in this class that converts between - // Doppler and Vault project names. We should remove this function once we - // drop Vault support. - fallbackToVault(): Promise { - const vault = new Vault.VaultEnvVars(this.logger, { - environment: dopplerEnvToVaultMap[this.environment] - }) - return vault.get() + return secrets } } diff --git a/lib/doppler/test/index.test.ts b/lib/doppler/test/index.test.ts index f0d46e1aa..1813491e1 100644 --- a/lib/doppler/test/index.test.ts +++ b/lib/doppler/test/index.test.ts @@ -1,12 +1,10 @@ import spawk from 'spawk' import winston, { Logger } from 'winston' -import { VaultEnvVars } from '@dotcom-tool-kit/vault' +import { ToolKitError } from '@dotcom-tool-kit/error' import { DopplerEnvVars } from '../src/index' -const logger = (winston as unknown) as Logger +const logger = winston as unknown as Logger -jest.mock('@dotcom-tool-kit/vault') -const mockedVaultEnvVars = jest.mocked(VaultEnvVars) spawk.preventUnmatched() const environment = 'dev' @@ -29,33 +27,30 @@ describe(`Doppler CLI invocations`, () => { spawk.done() }) - it("should fall back to Vault when Doppler isn't installed", async () => { + it("should throw an error when Doppler isn't installed", async () => { + expect.assertions(1) const interceptor = spawk.spawn('doppler', expectedArgs) /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- * spawk type definitions are out of date **/ ;(interceptor as any).spawnError('ENOENT') - const env = await doppler.get() - expect(env).toBeUndefined() - expect(mockedVaultEnvVars.mock.instances[0].get).toHaveBeenCalled() + await expect(doppler.get()).rejects.toThrow(ToolKitError) spawk.done() }) - it('should fall back to Vault when Doppler prints an error', async () => { + it('should throw an error when Doppler prints an error', async () => { + expect.assertions(1) const interceptor = spawk.spawn('doppler', expectedArgs) interceptor.stderr('doppler had an issue') - const env = await doppler.get() - expect(env).toBeUndefined() - expect(mockedVaultEnvVars.mock.instances[0].get).toHaveBeenCalled() + await expect(doppler.get()).rejects.toThrow(ToolKitError) spawk.done() }) - it('should fall back to Vault when the JSON is unparseable', async () => { + it('should throw an error when the JSON is unparseable', async () => { + expect.assertions(1) const interceptor = spawk.spawn('doppler', expectedArgs) interceptor.stdout(JSON.stringify(testEnvironment).slice(0, 20)) - const env = await doppler.get() - expect(env).toBeUndefined() - expect(mockedVaultEnvVars.mock.instances[0].get).toHaveBeenCalled() + await expect(doppler.get()).rejects.toThrow(ToolKitError) spawk.done() }) }) diff --git a/lib/doppler/tsconfig.json b/lib/doppler/tsconfig.json index b90c2969e..e0c3331fe 100644 --- a/lib/doppler/tsconfig.json +++ b/lib/doppler/tsconfig.json @@ -10,9 +10,6 @@ { "path": "../options" }, - { - "path": "../vault" - }, { "path": "../schemas" } diff --git a/lib/schemas/src/plugins.ts b/lib/schemas/src/plugins.ts index ff21d7203..9bcb05db9 100644 --- a/lib/schemas/src/plugins.ts +++ b/lib/schemas/src/plugins.ts @@ -7,7 +7,6 @@ import { HerokuSchema } from './plugins/heroku' import { LintStagedNpmSchema } from './plugins/lint-staged-npm' import { NextRouterSchema } from './plugins/next-router' import { ServerlessSchema } from './plugins/serverless' -import { VaultSchema } from './plugins/vault' import { type InferSchemaOptions } from './infer' // TODO:KB:20240412 remove legacyPluginOptions in a future major version @@ -33,8 +32,7 @@ export const PluginSchemas = { '@dotcom-tool-kit/heroku': HerokuSchema, '@dotcom-tool-kit/lint-staged-npm': LintStagedNpmSchema, '@dotcom-tool-kit/next-router': NextRouterSchema, - '@dotcom-tool-kit/serverless': ServerlessSchema, - '@dotcom-tool-kit/vault': VaultSchema + '@dotcom-tool-kit/serverless': ServerlessSchema } export type PluginOptions = InferSchemaOptions diff --git a/lib/schemas/src/plugins/vault.ts b/lib/schemas/src/plugins/vault.ts deleted file mode 100644 index 7d4f3fecf..000000000 --- a/lib/schemas/src/plugins/vault.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { z } from 'zod' - -// In theory, these fields should be required as Vault won't work without them, -// but not every app that pulls in the Vault plugin actually needs to use -// Vault, e.g., an app that uses the `nodemon` plugin with the `useVault` -// option set to false. -export const VaultSchema = z - .object({ - team: z.string(), - app: z.string() - }) - .partial() -export type VaultOptions = z.infer - -export const Schema = VaultSchema diff --git a/lib/vault/.toolkitrc.yml b/lib/vault/.toolkitrc.yml deleted file mode 100644 index d48cfb24d..000000000 --- a/lib/vault/.toolkitrc.yml +++ /dev/null @@ -1,2 +0,0 @@ - -version: 2 diff --git a/lib/vault/CHANGELOG.md b/lib/vault/CHANGELOG.md deleted file mode 100644 index bc734461a..000000000 --- a/lib/vault/CHANGELOG.md +++ /dev/null @@ -1,262 +0,0 @@ -# Changelog - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.0 to ^2.0.1 - * @dotcom-tool-kit/types bumped from ^2.0.0 to ^2.1.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.1 to ^2.0.2 - * @dotcom-tool-kit/types bumped from ^2.1.0 to ^2.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.2 to ^2.0.3 - * @dotcom-tool-kit/types bumped from ^2.2.0 to ^2.3.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.3 to ^2.0.4 - * @dotcom-tool-kit/types bumped from ^2.3.0 to ^2.4.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.4 to ^2.0.5 - * @dotcom-tool-kit/types bumped from ^2.4.0 to ^2.5.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.5 to ^2.0.6 - * @dotcom-tool-kit/types bumped from ^2.5.0 to ^2.5.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.6 to ^2.0.7 - * @dotcom-tool-kit/types bumped from ^2.5.1 to ^2.6.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.7 to ^2.0.8 - * @dotcom-tool-kit/types bumped from ^2.6.0 to ^2.6.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.9 to ^2.0.10 - * @dotcom-tool-kit/types bumped from ^2.6.2 to ^2.7.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.10 to ^2.0.11 - * @dotcom-tool-kit/types bumped from ^2.7.0 to ^2.7.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.11 to ^2.0.12 - * @dotcom-tool-kit/types bumped from ^2.7.1 to ^2.8.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.12 to ^2.0.13 - * @dotcom-tool-kit/types bumped from ^2.8.0 to ^2.9.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.13 to ^2.0.14 - * @dotcom-tool-kit/types bumped from ^2.9.0 to ^2.9.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.14 to ^2.0.15 - * @dotcom-tool-kit/types bumped from ^2.9.1 to ^2.9.2 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.0 to ^3.1.1 - * @dotcom-tool-kit/types bumped from ^3.1.0 to ^3.2.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.1 to ^3.1.2 - * @dotcom-tool-kit/types bumped from ^3.2.0 to ^3.3.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.3 to ^3.1.4 - * @dotcom-tool-kit/types bumped from ^3.3.1 to ^3.4.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.4 to ^3.1.5 - * @dotcom-tool-kit/types bumped from ^3.4.0 to ^3.4.1 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.5 to ^3.1.6 - * @dotcom-tool-kit/types bumped from ^3.4.1 to ^3.5.0 - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.2.0 to ^3.2.1 - * @dotcom-tool-kit/types bumped from ^3.6.0 to ^3.6.1 - -## [3.2.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v3.1.7...vault-v3.2.0) (2024-01-11) - - -### Features - -* add support for Node v20 ([759ac10](https://github.com/Financial-Times/dotcom-tool-kit/commit/759ac10e309885e99f54ae431c301c32ee04f972)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/error bumped from ^3.1.0 to ^3.2.0 - * @dotcom-tool-kit/options bumped from ^3.1.6 to ^3.2.0 - * @dotcom-tool-kit/types bumped from ^3.5.0 to ^3.6.0 - -## [3.1.5](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v3.1.4...vault-v3.1.5) (2023-10-09) - - -### Bug Fixes - -* remove n-logger from the vault library ([07a62b3](https://github.com/Financial-Times/dotcom-tool-kit/commit/07a62b35df61f8956d2d1fcb865c443ffdab40d6)) - -## [3.1.3](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v3.1.2...vault-v3.1.3) (2023-07-04) - - -### Bug Fixes - -* install Reliability Kit ESLint config and fix errors found ([35a6f77](https://github.com/Financial-Times/dotcom-tool-kit/commit/35a6f7754c33f58789b201594ed5d1000e029f1c)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^3.1.2 to ^3.1.3 - * @dotcom-tool-kit/types bumped from ^3.3.0 to ^3.3.1 - -## [3.1.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v3.0.0...vault-v3.1.0) (2023-04-28) - - -### Features - -* specify Node 18 support in all packages' engines fields ([3b55c79](https://github.com/Financial-Times/dotcom-tool-kit/commit/3b55c79f3f55b448f1a92fcf842dab6a8906ea70)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/error bumped from ^3.0.0 to ^3.1.0 - * @dotcom-tool-kit/options bumped from ^3.0.0 to ^3.1.0 - * @dotcom-tool-kit/types bumped from ^3.0.0 to ^3.1.0 - -## [3.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v2.0.16...vault-v3.0.0) (2023-04-18) - - -### ⚠ BREAKING CHANGES - -* drop support for Node 14 across all packages - -### Miscellaneous Chores - -* drop support for Node 14 across all packages ([aaee178](https://github.com/Financial-Times/dotcom-tool-kit/commit/aaee178b535a51f9c75a882d78ffd8e8aa3eac60)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/error bumped from ^2.0.1 to ^3.0.0 - * @dotcom-tool-kit/options bumped from ^2.0.16 to ^3.0.0 - * @dotcom-tool-kit/types bumped from ^2.10.0 to ^3.0.0 - -## [2.0.16](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v2.0.15...vault-v2.0.16) (2023-04-05) - - -### Bug Fixes - -* **vault:** bump n-fetch version to remove isomorphic-fetch instance ([11893bd](https://github.com/Financial-Times/dotcom-tool-kit/commit/11893bdbb51e240145f6dc0d2090dabd1fc2828a)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/options bumped from ^2.0.15 to ^2.0.16 - * @dotcom-tool-kit/types bumped from ^2.9.2 to ^2.10.0 - -### [2.0.9](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v2.0.8...vault-v2.0.9) (2022-11-09) - - -### Bug Fixes - -* add tslib to individual plugins ([142363e](https://github.com/Financial-Times/dotcom-tool-kit/commit/142363edb2a82ebf4dc3c8e1b392888ebfd7dc89)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/error bumped from ^2.0.0 to ^2.0.1 - * @dotcom-tool-kit/options bumped from ^2.0.8 to ^2.0.9 - * @dotcom-tool-kit/types bumped from ^2.6.1 to ^2.6.2 - -## [2.0.0](https://github.com/Financial-Times/dotcom-tool-kit/compare/vault-v1.9.0...vault-v2.0.0) (2022-04-19) - - -### Miscellaneous Chores - -* release 2.0 version for all packages ([42dc5d3](https://github.com/Financial-Times/dotcom-tool-kit/commit/42dc5d39bf330b9bca4121d062470904f9c6918d)) - - -### Dependencies - -* The following workspace dependencies were updated - * dependencies - * @dotcom-tool-kit/error bumped from ^1.9.0 to ^2.0.0 - * @dotcom-tool-kit/options bumped from ^1.9.0 to ^2.0.0 - * @dotcom-tool-kit/types bumped from ^1.9.0 to ^2.0.0 diff --git a/lib/vault/jest.config.js b/lib/vault/jest.config.js deleted file mode 100644 index 91d4858ef..000000000 --- a/lib/vault/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -const base = require('../../jest.config.base') - -module.exports = { - ...base.config, - moduleDirectories: ['node_modules'] -} diff --git a/lib/vault/package.json b/lib/vault/package.json deleted file mode 100644 index 43c16e233..000000000 --- a/lib/vault/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@dotcom-tool-kit/vault", - "version": "3.2.1", - "description": "", - "main": "lib", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "@dotcom-tool-kit/error": "^3.2.0", - "@dotcom-tool-kit/options": "^3.2.1", - "@financial-times/n-fetch": "^1.0.0", - "fs": "0.0.1-security", - "os": "^0.1.2", - "path": "^0.12.7", - "superagent": "^6.1.0", - "tslib": "^2.3.1" - }, - "keywords": [], - "author": "FT.com Platforms Team ", - "license": "ISC", - "repository": { - "type": "git", - "url": "https://github.com/financial-times/dotcom-tool-kit.git", - "directory": "lib/circleci" - }, - "bugs": "https://github.com/financial-times/dotcom-tool-kit/issues", - "homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/lib/vault", - "files": [ - "/lib", - ".toolkitrc.yml" - ], - "volta": { - "extends": "../../package.json" - }, - "devDependencies": { - "@dotcom-tool-kit/schemas": "^1.0.0", - "@types/jest": "^27.0.2", - "winston": "^3.5.1" - }, - "engines": { - "node": "18.x || 20.x", - "npm": "7.x || 8.x || 9.x || 10.x" - } -} diff --git a/lib/vault/src/declarations.d.ts b/lib/vault/src/declarations.d.ts deleted file mode 100644 index c55bdbad5..000000000 --- a/lib/vault/src/declarations.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module '@financial-times/n-fetch' { - function fetch( - url: string, - options?: { - headers?: { - [header: string]: string - } - body?: string - method?: string - } - ): Promise - export = fetch -} diff --git a/lib/vault/src/index.ts b/lib/vault/src/index.ts deleted file mode 100644 index 25d425fb3..000000000 --- a/lib/vault/src/index.ts +++ /dev/null @@ -1,195 +0,0 @@ -import fetch from '@financial-times/n-fetch' -import { promises as fs } from 'fs' -import path from 'path' -import os from 'os' -import type { Logger } from 'winston' -import { ToolKitError } from '@dotcom-tool-kit/error' -import { getOptions } from '@dotcom-tool-kit/options' -import { VaultOptions } from '@dotcom-tool-kit/schemas/lib/plugins/vault' - -const VAULT_ROLE_ID = process.env.VAULT_ROLE_ID -const VAULT_SECRET_ID = process.env.VAULT_SECRET_ID -const VAULT_ADDR = 'https://vault.in.ft.com/v1' - -export type Environment = 'production' | 'continuous-integration' | 'development' - -export type VaultSettings = { - environment: Environment - vaultPath?: VaultOptions -} - -type ReturnFetch = { - data: Secrets - status: number -} - -type Secrets = { - [key: string]: string -} - -type RequiredShared = { - [key: string]: { - [key: string]: string[] - } -} - -type Token = { - auth: { - client_token: string - } -} - -export class VaultEnvVars { - vaultPath: VaultOptions - environment: string - vaultTokenFile: string - logger: Logger - - constructor(logger: Logger, { environment, vaultPath }: VaultSettings) { - this.logger = logger - - this.environment = environment - const options = vaultPath || getOptions('@dotcom-tool-kit/vault') - if (!options || !('team' in options && 'app' in options)) { - const error = new ToolKitError('Vault options not found in your Tool Kit configuration') - error.details = `"team" and "app" are needed to get your app's secrets from vault, e.g. - options: - '@dotcom-tool-kit/vault': - team: "next", - app: "your-app" - ` - throw error - } - - this.vaultPath = options - this.vaultTokenFile = path.join(os.homedir(), '.vault-token') - } - - async get(): Promise { - const token = await this.getAuthToken() - return this.fetchSecrets(token) - } - - private async fetchTest(token: string): Promise { - try { - await fetch(`${VAULT_ADDR}/secret?help=1`, { - headers: { 'X-Vault-Token': token } - }) - return true - } catch { - return false - } - } - - private async getLocalToken(): Promise { - try { - this.logger.debug('checking for current vault token') - const vaultToken = await fs.readFile(this.vaultTokenFile, { - encoding: 'utf8' - }) - this.logger.debug('testing current vault token') - const isValidToken = await this.fetchTest(vaultToken) - if (isValidToken) { - this.logger.verbose('success testing current vault token!') - return vaultToken - } else { - const message = 'current vault token invalid, requesting new one...' - this.logger.error(message) - throw new ToolKitError(message) - } - } catch { - throw new ToolKitError('no current vault token found, requesting new token....') - } - } - - private async getTokenFromVault(githubToken: string) { - try { - this.logger.info(`you are not logged in to vault, logging you in...`) - const token = await fetch(`${VAULT_ADDR}/auth/github/login`, { - method: 'POST', - headers: { 'Content-type': 'application/json' }, - body: JSON.stringify({ token: githubToken }) - }) - await fs.writeFile(this.vaultTokenFile, token.auth.client_token) - return token.auth.client_token - } catch { - throw new ToolKitError('unable to complete vault authentication') - } - } - - private async getAuthToken(): Promise { - const VAULT_AUTH_GITHUB_TOKEN = process.env.VAULT_AUTH_GITHUB_TOKEN - const CIRCLECI = process.env.CIRCLECI - if (CIRCLECI) { - try { - const json = await fetch(`${VAULT_ADDR}/auth/approle/login`, { - method: 'POST', - headers: { 'Content-type': 'application/json' }, - body: JSON.stringify({ role_id: VAULT_ROLE_ID, secret_id: VAULT_SECRET_ID }) - }) - return json.auth.client_token - } catch { - const error = new ToolKitError(`Vault login failed`) - error.details = `Please check your VAULT_ROLE_ID and VAULT_SECRET_ID environment variables are present` - throw error - } - } else { - // developer's local machine - try { - const token = await this.getLocalToken() - return token - } catch { - if (VAULT_AUTH_GITHUB_TOKEN) { - const token = await this.getTokenFromVault(VAULT_AUTH_GITHUB_TOKEN) - return token - } else { - const error = new ToolKitError(`VAULT_AUTH_GITHUB_TOKEN variable is not set`) - error.details = `Follow the guide at https://github.com/Financial-Times/vault/wiki/Getting-Started-With-Vault` - throw error - } - } - } - } - - private async fetchSecrets(token: string): Promise { - const headers = { - headers: { 'X-Vault-Token': token } - } - - try { - this.logger.debug(`vault add: ${VAULT_ADDR}, team: ${this.vaultPath.team}, env: ${this.environment}`) - const allShared = await fetch( - `${VAULT_ADDR}/secret/teams/${this.vaultPath.team}/shared/${this.environment}`, - headers - ).then((json) => json.data) - this.logger.debug(`allShared: ${Object.keys(allShared)}`) - - const appEnv = await fetch( - `${VAULT_ADDR}/secret/teams/${this.vaultPath.team}/${this.vaultPath.app}/${this.environment}`, - headers - ).then((json) => json.data) - this.logger.debug(`appEnv: ${Object.keys(appEnv)}`) - - const appShared = await fetch( - `${VAULT_ADDR}/secret/teams/${this.vaultPath.team}/${this.vaultPath.app}/shared`, - headers - ).then((json) => json.data) - this.logger.debug(`appShared: ${JSON.stringify(appShared)}`) - - const required: Secrets = {} - - appShared.env.forEach((envVar) => { - if (allShared.hasOwnProperty(envVar)) { - required[envVar] = allShared[envVar] - } - }) - this.logger.debug(`required: ${Object.keys(required)}`) - - return Object.assign({}, required, appEnv) - } catch { - const error = new ToolKitError(`Unable to retrieve secrets from vault`) - error.details = `Please check that your system code is correct` - throw error - } - } -} diff --git a/lib/vault/test/index.test.ts b/lib/vault/test/index.test.ts deleted file mode 100644 index b7395d338..000000000 --- a/lib/vault/test/index.test.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { describe, it, beforeAll, beforeEach, afterAll, jest, expect } from '@jest/globals' -import { VaultEnvVars } from '../src/index' -import fetch from '@financial-times/n-fetch' -import fs from 'fs' -import winston, { Logger } from 'winston' - -const logger = winston as unknown as Logger - -let CIRCLECI: string -if (process.env.CIRCLECI) { - CIRCLECI = process.env.CIRCLECI -} -const VAULT_AUTH_GITHUB_TOKEN = process.env.VAULT_AUTH_GITHUB_TOKEN || undefined - -jest.mock('@financial-times/n-fetch') - -const mockedFetch = jest.mocked(fetch, true) - -jest.mock('path', () => { - return { - join: jest.fn(() => '.vault-token') - } -}) - -jest.mock('fs', () => ({ - promises: { - writeFile: jest.fn(), - readFile: jest.fn(() => { - if (process.env.VAULT_AUTH_GITHUB_TOKEN === 'hij') { - throw new Error('file not found') - } else { - return 'zzz' - } - }) - } -})) - -const vault = new VaultEnvVars(logger, { - environment: 'development', - vaultPath: { - app: 'test-app', - team: 'test-team' - } -}) - -describe(`local vault token retrieval`, () => { - beforeAll(() => { - delete process.env.CIRCLECI - }) - - beforeEach(() => { - jest.clearAllMocks() - }) - - afterAll(() => { - if (CIRCLECI) { - process.env.CIRCLECI = CIRCLECI - } - process.env.VAULT_AUTH_GITHUB_TOKEN = VAULT_AUTH_GITHUB_TOKEN - }) - - it('should handle a .vault-token file being present but expired', async () => { - mockedFetch.mockImplementationOnce(async () => Promise.reject()) - mockedFetch.mockImplementationOnce(async () => Promise.resolve({ auth: { client_token: 'aaa' } })) - process.env.VAULT_AUTH_GITHUB_TOKEN = 'abc' - const token = await vault['getAuthToken']() - - expect(fs.promises.readFile).toBeCalledTimes(1) - expect(mockedFetch).toBeCalledTimes(2) - expect(token).toEqual('aaa') - }) - - it('should retrieve an in-date token from .vault-token if present', async () => { - process.env.VAULT_AUTH_GITHUB_TOKEN = 'def' - mockedFetch.mockImplementationOnce(async () => Promise.resolve()) - const token = await vault['getAuthToken']() - - expect(fs.promises.readFile).toBeCalledTimes(1) - expect(mockedFetch).toBeCalledTimes(1) - expect(token).toEqual('zzz') - }) - - it('if no file found, it should retreive a token from vault when a github token env var is present', async () => { - mockedFetch.mockResolvedValue({ auth: { client_token: 'bbb' } }) - process.env.VAULT_AUTH_GITHUB_TOKEN = 'hij' - const token = await vault['getAuthToken']() - - expect(fs.promises.readFile).toBeCalledTimes(1) - expect(mockedFetch).toBeCalledTimes(1) - expect(token).toEqual('bbb') - }) - - it('should throw if authentication is denied', async () => { - mockedFetch.mockResolvedValue(Promise.reject()) - process.env.VAULT_AUTH_GITHUB_TOKEN = 'hij' - - await expect(vault['getAuthToken']()).rejects.toThrow() - }) - - it('should write a new token to file', async () => { - mockedFetch.mockImplementationOnce(async () => Promise.reject()) - mockedFetch.mockImplementationOnce(async () => ({ auth: { client_token: 'ccc' } })) - process.env.VAULT_AUTH_GITHUB_TOKEN = 'abc' - const token = await vault['getAuthToken']() - - expect(fs.promises.writeFile).toBeCalledTimes(1) - expect(token).toEqual('ccc') - }) -}) diff --git a/lib/vault/tsconfig.json b/lib/vault/tsconfig.json deleted file mode 100644 index e2e650b6b..000000000 --- a/lib/vault/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.settings.json", - "references": [ - { - "path": "../error" - }, - { - "path": "../options" - }, - { - "path": "../schemas" - } - ], - "compilerOptions": { - "outDir": "lib", - "rootDir": "src" - }, - "include": ["src/**/*"] -} diff --git a/package-lock.json b/package-lock.json index 26ab0ada0..e81ef43c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1217,7 +1217,6 @@ "@dotcom-tool-kit/error": "^3.2.0", "@dotcom-tool-kit/logger": "^3.4.1", "@dotcom-tool-kit/options": "^3.2.1", - "@dotcom-tool-kit/vault": "^3.2.1", "tslib": "^2.3.1" }, "devDependencies": { @@ -1429,6 +1428,7 @@ "lib/vault": { "name": "@dotcom-tool-kit/vault", "version": "3.2.1", + "extraneous": true, "license": "ISC", "dependencies": { "@dotcom-tool-kit/error": "^3.2.0", @@ -1450,11 +1450,6 @@ "npm": "7.x || 8.x || 9.x || 10.x" } }, - "lib/vault/node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" - }, "lib/wait-for-ok": { "name": "@dotcom-tool-kit/wait-for-ok", "version": "3.2.0", @@ -6572,10 +6567,6 @@ "resolved": "lib/validated", "link": true }, - "node_modules/@dotcom-tool-kit/vault": { - "resolved": "lib/vault", - "link": true - }, "node_modules/@dotcom-tool-kit/wait-for-ok": { "resolved": "lib/wait-for-ok", "link": true @@ -7035,20 +7026,6 @@ "npm": "7.x || 8.x" } }, - "node_modules/@financial-times/n-fetch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@financial-times/n-fetch/-/n-fetch-1.0.0.tgz", - "integrity": "sha512-6ayYnrlSJZvGU8/ZJEskxYH2kdvwJU/aL9MSXc3FmPj3dft7ecMxsB4p8PsWeJamHyd8EjaL7Mwm63LR2DwePg==", - "dependencies": { - "@dotcom-reliability-kit/logger": "^2.2.7", - "http-errors": "^1.6.1", - "node-fetch": "^2.0.0" - }, - "engines": { - "node": "16.x || 18.x", - "npm": "7.x || 8.x || 9.x" - } - }, "node_modules/@financial-times/package-json": { "version": "3.0.0", "license": "MIT" @@ -16458,10 +16435,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/fs": { - "version": "0.0.1-security", - "license": "ISC" - }, "node_modules/fs-constants": { "version": "1.0.0", "license": "MIT" @@ -17273,20 +17246,6 @@ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, - "node_modules/http-errors": { - "version": "1.8.1", - "license": "MIT", - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/http-proxy": { "version": "1.18.1", "license": "MIT", @@ -23426,10 +23385,6 @@ "version": "1.0.3", "license": "MIT" }, - "node_modules/os": { - "version": "0.1.2", - "license": "MIT" - }, "node_modules/os-browserify": { "version": "0.3.0", "license": "MIT" @@ -24044,14 +23999,6 @@ "node": ">=0.10.0" } }, - "node_modules/path": { - "version": "0.12.7", - "license": "MIT", - "dependencies": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, "node_modules/path-browserify": { "version": "0.0.1", "license": "MIT" @@ -26939,10 +26886,6 @@ "version": "1.0.5", "license": "MIT" }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "license": "ISC" - }, "node_modules/sha.js": { "version": "2.4.11", "license": "(MIT AND BSD-3-Clause)", @@ -28455,13 +28398,6 @@ "node": ">=0.10.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, "node_modules/token-types": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", @@ -29252,21 +29188,10 @@ "node": ">=0.10.0" } }, - "node_modules/util": { - "version": "0.10.4", - "license": "MIT", - "dependencies": { - "inherits": "2.0.3" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "license": "MIT" }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "license": "ISC" - }, "node_modules/utils-merge": { "version": "1.0.1", "license": "MIT", diff --git a/plugins/heroku/src/promoteStagingToProduction.ts b/plugins/heroku/src/promoteStagingToProduction.ts index b53ef5267..aa1063746 100644 --- a/plugins/heroku/src/promoteStagingToProduction.ts +++ b/plugins/heroku/src/promoteStagingToProduction.ts @@ -3,14 +3,9 @@ import { ToolKitError } from '@dotcom-tool-kit/error' import { readState } from '@dotcom-tool-kit/state' import { gtg } from './gtg' import type { Logger } from 'winston' -import { setAppConfigVars } from './setConfigVars' import { HerokuApiResPost } from 'heroku-client' -async function promoteStagingToProduction( - logger: Logger, - slug: string, - systemCode?: string -): Promise { +async function promoteStagingToProduction(logger: Logger, slug: string): Promise { const state = readState(`production`) if (!state) { @@ -32,10 +27,6 @@ async function promoteStagingToProduction( .then((response) => gtg(logger, response.app.name, 'production')) ) - for (const id of appIds) { - await setAppConfigVars(logger, id, 'prod', systemCode) - } - return Promise.all(latestRelease) } diff --git a/plugins/heroku/src/setConfigVars.ts b/plugins/heroku/src/setConfigVars.ts deleted file mode 100644 index 13e60207b..000000000 --- a/plugins/heroku/src/setConfigVars.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { Logger } from 'winston' -import { DopplerEnvVars, Environment } from '@dotcom-tool-kit/doppler' -import { getOptions } from '@dotcom-tool-kit/options' -import heroku, { extractHerokuError } from './herokuClient' -import type { HerokuApiResGetRegion, HerokuApiResPipeline } from 'heroku-client' - -type Stage = 'test' | 'development' | 'review' | 'staging' | 'production' - -async function setAppConfigVars( - logger: Logger, - appIdName: string, - environment: Environment, - systemCode?: string -): Promise { - // HACK:20221024:IM We need to call Vault to check whether a project has - // migrated to Doppler yet, and sync Vault secrets if it hasn't, but this - // function should be removed entirely once we drop support for Vault. The - // secret is only stored in Vault's continuous-integration folder so check - // that and then get the passed argument later if the secret isn't present. - // We can skip this call if we find the project has already added options for - // doppler in the Tool Kit configuration. - const migratedToolKitToDoppler = Boolean(getOptions('@dotcom-tool-kit/doppler')?.project) - if (migratedToolKitToDoppler) { - return - } - const dopplerEnvVars = new DopplerEnvVars(logger, 'ci') - let configVars = await dopplerEnvVars.fallbackToVault() - // HACK:20221023:IM don't overwrite secrets when the project has already - // migrated from Vault to Doppler – Doppler will handle the secret syncing - // for us - if (configVars.MIGRATED_TO_DOPPLER) { - return - } - if (environment !== 'ci') { - const dopplerEnvVars = new DopplerEnvVars(logger, environment) - configVars = await dopplerEnvVars.fallbackToVault() - } - - logger.info(`setting config vars for ${appIdName}`) - - const { region } = await heroku - .get(`/apps/${appIdName}`) - .catch(extractHerokuError(`getting region for app ${appIdName}`)) - configVars.REGION = region.name.toUpperCase() - - if (systemCode) { - configVars.SYSTEM_CODE = systemCode - } - await heroku - .patch(`/apps/${appIdName}/config-vars`, { - body: configVars - }) - .catch(extractHerokuError(`getting configuration variables for app ${appIdName}`)) - - logger.verbose('the following values have been set:', Object.keys(configVars).join(', ')) - - logger.info(`${appIdName} config vars have been updated successfully.`) -} - -async function setStageConfigVars( - logger: Logger, - stage: Stage, - environment: Environment, - pipelineName: string, - systemCode?: string -): Promise { - // HACK:20221024:IM We need to call Vault to check whether a project has - // migrated to Doppler yet, and sync Vault secrets if it hasn't, but this - // function should be removed entirely once we drop support for Vault. The - // secret is only stored in Vault's continuous-integration folder so check - // that and then get the passed argument later if the secret isn't present. - // We can skip this call if we find the project has already added options for - // doppler in the Tool Kit configuration. - const migratedToolKitToDoppler = Boolean(getOptions('@dotcom-tool-kit/doppler')?.project) - if (migratedToolKitToDoppler) { - return - } - const dopplerEnvVars = new DopplerEnvVars(logger, 'ci') - let configVars = await dopplerEnvVars.fallbackToVault() - // HACK:20221023:IM don't overwrite secrets when the project has already - // migrated from Vault to Doppler – Doppler will handle the secret syncing - // for us - if (configVars.MIGRATED_TO_DOPPLER) { - return - } - if (environment !== 'ci') { - const dopplerEnvVars = new DopplerEnvVars(logger, environment) - configVars = await dopplerEnvVars.fallbackToVault() - } - - logger.info(`setting config vars for ${stage} stage`) - - if (systemCode) { - configVars.SYSTEM_CODE = systemCode - } - // Some of our code expects review apps to have their NODE_ENV set to - // 'branch' so that they can change behaviour for them (e.g., mocking out - // writes to production DB's.) - if (stage === 'review') { - configVars.NODE_ENV = 'branch' - } - const pipeline = await heroku - .get(`/pipelines/${pipelineName}`) - .catch(extractHerokuError(`getting pipeline ${pipelineName}`)) - await heroku - .patch(`/pipelines/${pipeline.id}/stage/${stage}/config-vars`, { - body: configVars - }) - .catch( - extractHerokuError(`setting configuration variables for ${stage} stage in pipeline ${pipelineName}`) - ) - - logger.verbose('the following values have been set:', Object.keys(configVars).join(', ')) - - logger.info(`config vars for ${stage} stage have been updated successfully.`) -} - -export { setAppConfigVars, setStageConfigVars } diff --git a/plugins/heroku/src/tasks/production.ts b/plugins/heroku/src/tasks/production.ts index a265de8c1..a71b9213b 100644 --- a/plugins/heroku/src/tasks/production.ts +++ b/plugins/heroku/src/tasks/production.ts @@ -35,7 +35,7 @@ export default class HerokuProduction extends Task<{ } const promote = async () => { this.logger.verbose('promoting staging to production....') - await promoteStagingToProduction(this.logger, slugId, this.pluginOptions.systemCode) + await promoteStagingToProduction(this.logger, slugId) this.logger.info('staging has been successfully promoted to production') } diff --git a/plugins/heroku/src/tasks/review.ts b/plugins/heroku/src/tasks/review.ts index faa4127dc..b170624f9 100644 --- a/plugins/heroku/src/tasks/review.ts +++ b/plugins/heroku/src/tasks/review.ts @@ -2,7 +2,6 @@ import { Task } from '@dotcom-tool-kit/base' import { getHerokuReviewApp } from '../getHerokuReviewApp' import { buildHerokuReviewApp } from '../buildHerokuReviewApp' import { gtg } from '../gtg' -import { setStageConfigVars } from '../setConfigVars' import { writeState } from '@dotcom-tool-kit/state' import { HerokuSchema } from '@dotcom-tool-kit/schemas/lib/plugins/heroku' import { ToolKitError } from '@dotcom-tool-kit/error' @@ -15,7 +14,6 @@ export default class HerokuReview extends Task<{ plugin: typeof HerokuSchema }> const pipeline = await herokuClient .get(`/pipelines/${this.pluginOptions.pipeline}`) .catch(extractHerokuError(`getting pipeline ${this.pluginOptions.pipeline}`)) - await setStageConfigVars(this.logger, 'review', 'prod', pipeline.id) let reviewAppId = await getHerokuReviewApp(this.logger, pipeline.id) diff --git a/plugins/heroku/src/tasks/staging.ts b/plugins/heroku/src/tasks/staging.ts index 77b6c026c..9642aaa7a 100644 --- a/plugins/heroku/src/tasks/staging.ts +++ b/plugins/heroku/src/tasks/staging.ts @@ -1,7 +1,6 @@ import { Task } from '@dotcom-tool-kit/base' import { ToolKitError } from '@dotcom-tool-kit/error' import { getHerokuStagingApp } from '../getHerokuStagingApp' -import { setAppConfigVars } from '../setConfigVars' import { createBuild } from '../createBuild' import { repeatedCheckForBuildSuccess } from '../repeatedCheckForBuildSuccess' import { scaleDyno } from '../scaleDyno' @@ -19,9 +18,6 @@ export default class HerokuStaging extends Task<{ plugin: typeof HerokuSchema }> this.logger.verbose(`retrieving staging app details...`) const appName = await getHerokuStagingApp() - // setting config vars on staging from the doppler production directory - await setAppConfigVars(this.logger, appName, 'prod', this.pluginOptions.systemCode) - // create build from latest commit, even on no change const buildDetails = await createBuild(this.logger, appName) diff --git a/plugins/heroku/test/promoteStagingToProduction.test.ts b/plugins/heroku/test/promoteStagingToProduction.test.ts index 1a1b70379..fc82d4c0f 100644 --- a/plugins/heroku/test/promoteStagingToProduction.test.ts +++ b/plugins/heroku/test/promoteStagingToProduction.test.ts @@ -3,9 +3,8 @@ import { promoteStagingToProduction } from '../src/promoteStagingToProduction' import heroku from '../src/herokuClient' import { gtg } from '../src/gtg' import winston, { Logger } from 'winston' -import { setAppConfigVars } from '../src/setConfigVars' -const logger = (winston as unknown) as Logger +const logger = winston as unknown as Logger const slugId = 'slug-id' const appIds = ['app-id-1', 'app-id-2'] @@ -16,12 +15,6 @@ const goodHerokuResponse = [ const mockHerokuPost = jest.spyOn(heroku, 'post') -jest.mock('../src/setConfigVars', () => { - return { - setAppConfigVars: jest.fn() - } -}) - jest.mock('../src/gtg', () => { return { gtg: jest.fn() @@ -35,15 +28,6 @@ jest.mock('@dotcom-tool-kit/state', () => { }) describe('promoteStagingToProduction', () => { - it('calls setConfigVars for each appIds', async () => { - mockHerokuPost.mockImplementationOnce(async () => Promise.resolve(goodHerokuResponse[0])) - mockHerokuPost.mockImplementationOnce(async () => Promise.resolve(goodHerokuResponse[1])) - const systemCode = 'test-app' - await promoteStagingToProduction(logger, slugId, systemCode) - expect(setAppConfigVars).toHaveBeenNthCalledWith(1, logger, 'app-id-1', 'prod', systemCode) - expect(setAppConfigVars).toHaveBeenNthCalledWith(2, logger, 'app-id-2', 'prod', systemCode) - }) - it('calls heroku api for each app', async () => { mockHerokuPost.mockImplementationOnce(async () => Promise.resolve(goodHerokuResponse[0])) mockHerokuPost.mockImplementationOnce(async () => Promise.resolve(goodHerokuResponse[1])) diff --git a/plugins/heroku/test/setConfigVars.test.ts b/plugins/heroku/test/setConfigVars.test.ts deleted file mode 100644 index d5b708d97..000000000 --- a/plugins/heroku/test/setConfigVars.test.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { describe, it, expect, jest } from '@jest/globals' -import { setAppConfigVars, setStageConfigVars } from '../src/setConfigVars' -import { DopplerEnvVars } from '@dotcom-tool-kit/doppler' -import heroku from '../src/herokuClient' -import winston, { Logger } from 'winston' -const logger = (winston as unknown) as Logger -type DopplerPath = { - project: string -} -const environment = 'prod' -const appName = 'test-staging-app-name' -const dopplerPath: DopplerPath = { - project: 'doppler-app' -} -const systemCode = 'test-system-code' -const pipeline = { - id: 'test-pipeline-id' -} -const pipelineName = 'test-pipeline-name' - -const secrets: Record = { - secret1: 'secret-1', - secret2: 'secret-2', - secret3: 'secret-3' -} - -const prodPatchBody = { - body: { - REGION: 'EU', - SYSTEM_CODE: 'test-system-code', - ...secrets - } -} - -const reviewPatchBody = { - body: secrets -} -class DopplerEnvVarsMock { - dopplerPath: DopplerPath - constructor(_dopplerPath: DopplerPath, public environment: string, private migrated: boolean) { - this.dopplerPath = dopplerPath - } - fallbackToVault() { - return this.environment === 'ci' ? { MIGRATED_TO_DOPPLER: this.migrated ? 'true' : undefined } : secrets - } -} -jest.mock('../src/herokuClient', () => { - const originalModule = jest.requireActual('../src/herokuClient') as object - return { - __esmodule: true, - ...originalModule, - patch: jest.fn(async (str: string) => { - if (str.includes('wrong')) { - throw new Error() - } - }), - get: jest.fn(async (str: string) => { - if (str.includes('wrong')) { - throw new Error() - } - return { - id: 'test-pipeline-id', - region: { - name: 'eu' - } - } - }) - } -}) -const DopplerEnvVarsMocked = jest.mocked(DopplerEnvVars, true) -jest.mock('@dotcom-tool-kit/doppler') -function mockDopplerEnvVars(migrated: boolean) { - DopplerEnvVarsMocked.mockImplementation( - (dopplerPath, environment) => new DopplerEnvVarsMock(dopplerPath, environment, migrated) - ) -} - -describe('setConfigVars', () => { - beforeEach(() => { - DopplerEnvVarsMocked.mockReset() - mockDopplerEnvVars(false) - }) - - it('passes its settings to doppler env vars and receives secrets ', async () => { - await setAppConfigVars(logger, appName, environment, systemCode) - - expect(DopplerEnvVars).toHaveBeenLastCalledWith(logger, environment) - }) - - it('sends an update to the app with the correct path and body for prod and staging', async () => { - await setAppConfigVars(logger, appName, environment, systemCode) - - expect(heroku.patch).toBeCalledWith('/apps/test-staging-app-name/config-vars', prodPatchBody) - }) - - it('sends an update to the app with the correct path and body for review-app', async () => { - await setStageConfigVars(logger, 'review', 'prod', pipelineName) - - expect(heroku.patch).toBeCalledWith(`/pipelines/${pipeline.id}/stage/review/config-vars`, reviewPatchBody) - }) - - it('app function throws if the app was not patched with config vars', async () => { - await expect(setAppConfigVars(logger, 'wrong-app-name', environment, systemCode)).rejects.toThrowError() - }) - - it('stage function throws if the app was not patched with config vars', async () => { - await expect(setStageConfigVars(logger, 'review', environment, 'wrong-pipeline')).rejects.toThrowError() - }) - - it('resolves if successful', async () => { - await expect(setAppConfigVars(logger, appName, environment, systemCode)).resolves.not.toThrow() - }) - - it("does not set config vars when we've migrated to Doppler", async () => { - mockDopplerEnvVars(true) - await setAppConfigVars(logger, appName, environment, systemCode) - - expect(heroku.patch).not.toBeCalled() - }) -}) diff --git a/plugins/heroku/test/tasks/production.test.ts b/plugins/heroku/test/tasks/production.test.ts index 3e0d1a987..70f799a77 100644 --- a/plugins/heroku/test/tasks/production.test.ts +++ b/plugins/heroku/test/tasks/production.test.ts @@ -30,7 +30,7 @@ describe('staging', () => { const task = new Production(logger, 'HerokuProduction', pluginOptions, productionOptions) await task.run() - expect(utils.promoteStagingToProduction).toBeCalledWith(expect.anything(), 'slug-id', 'next-health') + expect(utils.promoteStagingToProduction).toBeCalledWith(expect.anything(), 'slug-id') }) it('should resolve when completed successfully', async () => { diff --git a/plugins/heroku/test/tasks/review.test.ts b/plugins/heroku/test/tasks/review.test.ts index 26e4e0b7f..670b4e7da 100644 --- a/plugins/heroku/test/tasks/review.test.ts +++ b/plugins/heroku/test/tasks/review.test.ts @@ -1,12 +1,11 @@ import { describe, it, expect, jest } from '@jest/globals' import Review from '../../src/tasks/review' import { getHerokuReviewApp } from '../../src/getHerokuReviewApp' -import { setStageConfigVars } from '../../src/setConfigVars' import { gtg } from '../../src/gtg' import heroku from '../../src/herokuClient' import winston, { Logger } from 'winston' -const logger = (winston as unknown) as Logger +const logger = winston as unknown as Logger type State = { [key: string]: string @@ -38,12 +37,6 @@ jest.mock('../../src/getHerokuReviewApp', () => { } }) -jest.mock('../../src/setConfigVars', () => { - return { - setStageConfigVars: jest.fn() - } -}) - jest.mock('@dotcom-tool-kit/state', () => { return { writeState: jest.fn((environment: string, { appId }) => { @@ -60,7 +53,7 @@ jest.mock('../../src/gtg', () => { describe('review', () => { it('should call pass in the pipeline id to heroku api call', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) await task.run() @@ -69,7 +62,7 @@ describe('review', () => { }) it('should return review app id from get heroku review app', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) await task.run() @@ -78,7 +71,7 @@ describe('review', () => { }) it('should fail if either doppler option is missing', async () => { - let task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + let task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) try { await task.run() @@ -86,7 +79,7 @@ describe('review', () => { expect(err).toBeTruthy() } - task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) try { await task.run() @@ -95,16 +88,8 @@ describe('review', () => { } }) - it('should call setStageConfigVars with doppler project', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) - - await task.run() - - expect(setStageConfigVars).toBeCalledWith(expect.anything(), 'review', 'prod', 'test-pipeline-id') - }) - it('should write app id to state', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) await task.run() @@ -112,7 +97,7 @@ describe('review', () => { }) it('should call gtg with appName', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) await task.run() @@ -121,7 +106,7 @@ describe('review', () => { it('should throw an error if it fails', async () => { pipeline = 'wrong-pipeline-name' - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '', scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) try { await task.run() diff --git a/plugins/heroku/test/tasks/staging.test.ts b/plugins/heroku/test/tasks/staging.test.ts index 6fdad4479..eab4c5646 100644 --- a/plugins/heroku/test/tasks/staging.test.ts +++ b/plugins/heroku/test/tasks/staging.test.ts @@ -2,7 +2,6 @@ import { describe, it, expect, jest } from '@jest/globals' import Staging from '../../src/tasks/staging' import { getPipelineCouplings } from '../../src/getPipelineCouplings' import { getHerokuStagingApp } from '../../src/getHerokuStagingApp' -import { setAppConfigVars } from '../../src/setConfigVars' import { scaleDyno } from '../../src/scaleDyno' import { setStagingSlug } from '../../src/setStagingSlug' import { repeatedCheckForBuildSuccess } from '../../src/repeatedCheckForBuildSuccess' @@ -10,7 +9,7 @@ import { gtg } from '../../src/gtg' import winston, { Logger } from 'winston' import { createBuild } from '../../src/createBuild' -const logger = (winston as unknown) as Logger +const logger = winston as unknown as Logger const pipeline = 'test-pipeline' const appName = 'test-appName' @@ -34,12 +33,6 @@ jest.mock('../../src/getHerokuStagingApp', () => { } }) -jest.mock('../../src/setConfigVars', () => { - return { - setAppConfigVars: jest.fn(() => false) - } -}) - jest.mock('../../src/createBuild', () => { return { createBuild: jest.fn(() => buildInfo) @@ -76,7 +69,7 @@ describe('staging', () => { }) it('should call pipeline couplings with pipeline option', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() @@ -85,7 +78,7 @@ describe('staging', () => { }) it('should return appName from get heroku staging', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() @@ -93,16 +86,8 @@ describe('staging', () => { expect(getHerokuStagingApp).toReturnWith(appName) }) - it('should call setAppConfigVars with doppler project and system code', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) - - await task.run() - - expect(setAppConfigVars).toBeCalledWith(expect.anything(), 'test-appName', 'prod', systemCode) - }) - it('should call createBuild with app name', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() @@ -110,21 +95,21 @@ describe('staging', () => { }) it(`should call repeatedCheckForBuildSuccess if the slug id isn't present`, async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() expect(repeatedCheckForBuildSuccess).toBeCalledWith(expect.anything(), appName, buildInfo.id) }) it('should call setStagingSlug with app name and slug id', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() expect(setStagingSlug).toBeCalledWith(expect.anything(), appName, slugId) }) it('should call scaleDyno', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() @@ -132,7 +117,7 @@ describe('staging', () => { }) it('should call gtg with appName', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await task.run() @@ -140,7 +125,7 @@ describe('staging', () => { }) it('should resolve successfully when complete', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode, scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) await expect(task.run()).resolves.not.toThrow() }) diff --git a/release-please-config.json b/release-please-config.json index 7375dacf8..6e9b55e8b 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -18,7 +18,6 @@ "lib/schemas": {}, "lib/state": {}, "lib/validated": {}, - "lib/vault": {}, "lib/wait-for-ok": {}, "orb": { "package-name": "orb", diff --git a/tsconfig.json b/tsconfig.json index c59c6a002..07176eefa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,9 +7,6 @@ { "path": "lib/state" }, - { - "path": "lib/vault" - }, { "path": "lib/doppler" }, From be00602133549c551f8a79bcbb57f9a723ae9e7c Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Thu, 29 Aug 2024 10:44:31 +0100 Subject: [PATCH 4/5] feat(heroku)!: remove systemCode option This was only needed for setting the SYSTEM_CODE environment variable in Heroku config. Doppler projects handle that instead now. --- .../files/conflict-resolution/.toolkitrc.yml | 1 - core/cli/test/files/duplicate/.toolkitrc.yml | 1 - lib/schemas/src/plugins/heroku.ts | 8 +------- plugins/heroku/readme.md | 7 +++---- plugins/heroku/test/tasks/production.test.ts | 3 +-- plugins/heroku/test/tasks/review.test.ts | 14 +++++++------- plugins/heroku/test/tasks/staging.test.ts | 17 ++++++++--------- 7 files changed, 20 insertions(+), 31 deletions(-) diff --git a/core/cli/test/files/conflict-resolution/.toolkitrc.yml b/core/cli/test/files/conflict-resolution/.toolkitrc.yml index 6bf88a62a..af7e6425a 100644 --- a/core/cli/test/files/conflict-resolution/.toolkitrc.yml +++ b/core/cli/test/files/conflict-resolution/.toolkitrc.yml @@ -8,7 +8,6 @@ options: plugins: '@dotcom-tool-kit/heroku': pipeline: tool-kit-test - systemCode: tool-kit-test '@dotcom-tool-kit/doppler': project: tool-kit-test tasks: diff --git a/core/cli/test/files/duplicate/.toolkitrc.yml b/core/cli/test/files/duplicate/.toolkitrc.yml index aa7925b18..2a1aa7419 100644 --- a/core/cli/test/files/duplicate/.toolkitrc.yml +++ b/core/cli/test/files/duplicate/.toolkitrc.yml @@ -6,7 +6,6 @@ options: plugins: '@dotcom-tool-kit/heroku': pipeline: tool-kit-test - systemCode: tool-kit-test '@dotcom-tool-kit/doppler': project: tool-kit-test diff --git a/lib/schemas/src/plugins/heroku.ts b/lib/schemas/src/plugins/heroku.ts index fdcd995eb..a0a02ae80 100644 --- a/lib/schemas/src/plugins/heroku.ts +++ b/lib/schemas/src/plugins/heroku.ts @@ -6,11 +6,6 @@ export const HerokuSchema = z.object({ .string() .describe( "the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID]" - ), - systemCode: z - .string() - .describe( - "your app's Biz Ops system code. this can be found at https://biz-ops.in.ft.com/System/[SYSTEM_CODE]" ) }) @@ -18,6 +13,5 @@ export type HerokuOptions = z.infer export const Schema = HerokuSchema export const generators: PromptGenerators = { - pipeline: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.herokuApps[0]?.pipelineName, - systemCode: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.code + pipeline: async (logger, prompt, onCancel, bizOpsSystem) => bizOpsSystem?.herokuApps[0]?.pipelineName } diff --git a/plugins/heroku/readme.md b/plugins/heroku/readme.md index 9dbac5ec2..516e4c32a 100644 --- a/plugins/heroku/readme.md +++ b/plugins/heroku/readme.md @@ -70,10 +70,9 @@ Scale down the Heroku staging app once it's no longer needed. ### `@dotcom-tool-kit/heroku` -| Property | Description | Type | -| :-------------------- | :-------------------------------------------------------------------------------------------------------------- | :------- | -| **`pipeline`** (\*) | the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID] | `string` | -| **`systemCode`** (\*) | your app's Biz Ops system code. this can be found at https://biz-ops.in.ft.com/System/[SYSTEM_CODE] | `string` | +| Property | Description | Type | +| :------------------ | :-------------------------------------------------------------------------------------------------------------- | :------- | +| **`pipeline`** (\*) | the ID of your app's Heroku pipeline. this can be found at https://dashboard.heroku.com/pipelines/[PIPELINE_ID] | `string` | _(\*) Required._ diff --git a/plugins/heroku/test/tasks/production.test.ts b/plugins/heroku/test/tasks/production.test.ts index 70f799a77..fd953e2ea 100644 --- a/plugins/heroku/test/tasks/production.test.ts +++ b/plugins/heroku/test/tasks/production.test.ts @@ -16,8 +16,7 @@ const mockPromoteStagingToProduction = jest.spyOn(utils, 'promoteStagingToProduc jest.spyOn(Production.prototype, 'fetchIfAppHasDeployed').mockImplementation(() => Promise.resolve(true)) const pluginOptions = { - pipeline: 'next-health', - systemCode: 'next-health' + pipeline: 'next-health' } const productionOptions = { diff --git a/plugins/heroku/test/tasks/review.test.ts b/plugins/heroku/test/tasks/review.test.ts index 670b4e7da..665c4e775 100644 --- a/plugins/heroku/test/tasks/review.test.ts +++ b/plugins/heroku/test/tasks/review.test.ts @@ -53,7 +53,7 @@ jest.mock('../../src/gtg', () => { describe('review', () => { it('should call pass in the pipeline id to heroku api call', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -62,7 +62,7 @@ describe('review', () => { }) it('should return review app id from get heroku review app', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -71,7 +71,7 @@ describe('review', () => { }) it('should fail if either doppler option is missing', async () => { - let task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + let task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() @@ -79,7 +79,7 @@ describe('review', () => { expect(err).toBeTruthy() } - task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() @@ -89,7 +89,7 @@ describe('review', () => { }) it('should write app id to state', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -97,7 +97,7 @@ describe('review', () => { }) it('should call gtg with appName', async () => { - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) await task.run() @@ -106,7 +106,7 @@ describe('review', () => { it('should throw an error if it fails', async () => { pipeline = 'wrong-pipeline-name' - const task = new Review(logger, 'HerokuReview', { pipeline, systemCode: '' }, { scaling: {} }) + const task = new Review(logger, 'HerokuReview', { pipeline }, { scaling: {} }) try { await task.run() diff --git a/plugins/heroku/test/tasks/staging.test.ts b/plugins/heroku/test/tasks/staging.test.ts index eab4c5646..188368a93 100644 --- a/plugins/heroku/test/tasks/staging.test.ts +++ b/plugins/heroku/test/tasks/staging.test.ts @@ -13,7 +13,6 @@ const logger = winston as unknown as Logger const pipeline = 'test-pipeline' const appName = 'test-appName' -const systemCode = 'test-systemCode' const buildInfo = { id: 'build-id', slug: null, @@ -69,7 +68,7 @@ describe('staging', () => { }) it('should call pipeline couplings with pipeline option', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -78,7 +77,7 @@ describe('staging', () => { }) it('should return appName from get heroku staging', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -87,7 +86,7 @@ describe('staging', () => { }) it('should call createBuild with app name', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -95,21 +94,21 @@ describe('staging', () => { }) it(`should call repeatedCheckForBuildSuccess if the slug id isn't present`, async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() expect(repeatedCheckForBuildSuccess).toBeCalledWith(expect.anything(), appName, buildInfo.id) }) it('should call setStagingSlug with app name and slug id', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() expect(setStagingSlug).toBeCalledWith(expect.anything(), appName, slugId) }) it('should call scaleDyno', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -117,7 +116,7 @@ describe('staging', () => { }) it('should call gtg with appName', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await task.run() @@ -125,7 +124,7 @@ describe('staging', () => { }) it('should resolve successfully when complete', async () => { - const task = new Staging(logger, 'HerokuStaging', { pipeline, systemCode }, { scaling: {} }) + const task = new Staging(logger, 'HerokuStaging', { pipeline }, { scaling: {} }) await expect(task.run()).resolves.not.toThrow() }) From dc008ff156054a5fa61b4e7b4b8bdd638d6ab57f Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Mon, 2 Sep 2024 16:42:54 +0100 Subject: [PATCH 5/5] feat!: remove backwards compatibility-preserving hacks --- lib/schemas/src/prompts.ts | 3 +-- plugins/circleci/src/circleci-config.ts | 17 +++++++++-------- plugins/n-test/src/tasks/n-test.ts | 4 +--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/schemas/src/prompts.ts b/lib/schemas/src/prompts.ts index 50a339b08..9310d5e13 100644 --- a/lib/schemas/src/prompts.ts +++ b/lib/schemas/src/prompts.ts @@ -16,8 +16,7 @@ export type SchemaPromptGenerator = ( logger: Logger, prompt: typeof prompts, onCancel: () => void, - // HACK:20231209:IM add bizOpsSystem as optional parameter to maintain - // backwards compatibility + // bizOpsSystem will be undefined if project is not a system bizOpsSystem?: BizOpsSystem ) => Promise // This type defines an interface you can use to export prompt generators. The diff --git a/plugins/circleci/src/circleci-config.ts b/plugins/circleci/src/circleci-config.ts index c8171d8a1..3813febd2 100644 --- a/plugins/circleci/src/circleci-config.ts +++ b/plugins/circleci/src/circleci-config.ts @@ -76,15 +76,16 @@ export type CircleCIState = CircleConfig */ export type CircleCIStatePartial = PartialDeep +// Make this function lazy so that the global options object will have been +// populated first. const getNodeVersions = (): Array => { - // HACK: This function should only ever be called after the Tool Kit options - // are loaded so that we can see which node versions are specified. However, - // older versions of the other CircleCI plugins may not do this properly, so - // to avoid a breaking change we fall back to creating an array with a single - // empty string. The first executor is named 'node' without any reference to - // the version so the plugins which don't support matrices don't need to know - // the version option. - return getOptions('@dotcom-tool-kit/circleci')?.cimgNodeVersions ?? [''] + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- + * Tool Kit will try and parse options for every plugin it loads which has a + * schema. If we're running this code the @dotcom-tool-kit/circleci has by + * definition been loaded, and there is a schema associated with it. So the + * option field will be guaranteed to be present. + **/ + return getOptions('@dotcom-tool-kit/circleci')!.cimgNodeVersions } /* Applies a verion identifier for all but the first (and therefore default) diff --git a/plugins/n-test/src/tasks/n-test.ts b/plugins/n-test/src/tasks/n-test.ts index f9569c274..68825ea84 100644 --- a/plugins/n-test/src/tasks/n-test.ts +++ b/plugins/n-test/src/tasks/n-test.ts @@ -10,9 +10,7 @@ export default class NTest extends Task<{ task: typeof SmokeTestSchema }> { // if we've built a review or staging app, test against that, not the app in the config if (appState) { - // HACK:20231003:IM keep the old logic of using the app name as the - // subdomain to maintain backwards compatibility - this.options.host = appState.url ? appState.url : `https://${appState.appName}.herokuapp.com` + this.options.host = appState.url // HACK:20231003:IM n-test naively appends paths to the host URL so // expects there to be no trailing slash if (this.options.host.endsWith('/')) {