From 955bf6a8dc6059cea34cf1d618e70b3d8e3218dd Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Tue, 25 Feb 2025 15:36:31 +0900 Subject: [PATCH] feat: add update warning to create-cli and make it single command like before --- package-lock.json | 59 ++++++++++++++++++++++++++++++++ packages/create-cli/package.json | 15 ++++++-- 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa0f1caa..7571a143 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19750,6 +19750,7 @@ "@oclif/core": "4.2.7", "@oclif/plugin-help": "6.2.25", "@oclif/plugin-plugins": "5.4.33", + "@oclif/plugin-warn-if-update-available": "3.1.33", "axios": "1.7.4", "chalk": "4.1.2", "debug": "4.3.4", @@ -19870,6 +19871,40 @@ "node": ">=18.0.0" } }, + "packages/create-cli/node_modules/@oclif/plugin-warn-if-update-available": { + "version": "3.1.33", + "resolved": "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-3.1.33.tgz", + "integrity": "sha512-JqbE7YOrf2w1AbedyhdWR2OMkgOUV46esOGZZdPIhh3CCoKwPHZfmEf0o93vVITqDLkxoGrWR6MkFVcuKNAvsA==", + "license": "MIT", + "dependencies": { + "@oclif/core": "^4", + "ansis": "^3.10.0", + "debug": "^4.4.0", + "http-call": "^5.2.2", + "lodash": "^4.17.21", + "registry-auth-token": "^5.0.3" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/create-cli/node_modules/@oclif/plugin-warn-if-update-available/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "packages/create-cli/node_modules/@types/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.4.2.tgz", @@ -24779,6 +24814,7 @@ "@oclif/core": "4.2.7", "@oclif/plugin-help": "6.2.25", "@oclif/plugin-plugins": "5.4.33", + "@oclif/plugin-warn-if-update-available": "3.1.33", "@types/config": "3.3.3", "@types/debug": "4.1.7", "@types/glob": "8.0.0", @@ -24862,6 +24898,29 @@ "@oclif/core": "^4" } }, + "@oclif/plugin-warn-if-update-available": { + "version": "3.1.33", + "resolved": "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-3.1.33.tgz", + "integrity": "sha512-JqbE7YOrf2w1AbedyhdWR2OMkgOUV46esOGZZdPIhh3CCoKwPHZfmEf0o93vVITqDLkxoGrWR6MkFVcuKNAvsA==", + "requires": { + "@oclif/core": "^4", + "ansis": "^3.10.0", + "debug": "^4.4.0", + "http-call": "^5.2.2", + "lodash": "^4.17.21", + "registry-auth-token": "^5.0.3" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "requires": { + "ms": "^2.1.3" + } + } + } + }, "@types/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.4.2.tgz", diff --git a/packages/create-cli/package.json b/packages/create-cli/package.json index d053fb87..7a545cc0 100644 --- a/packages/create-cli/package.json +++ b/packages/create-cli/package.json @@ -37,14 +37,25 @@ ], "oclif": { "bin": "create-cli", - "commands": "./dist/commands", - "default": "bootstrap" + "commands": { + "strategy": "single", + "target": "./dist/commands/bootstrap" + }, + "plugins": [ + "@oclif/plugin-help", + "@oclif/plugin-warn-if-update-available" + ], + "warn-if-update-available": { + "timeoutInDays": 30, + "message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>. To update, run `npm install -D checkly@latest`" + } }, "homepage": "https://github.com/checkly/checkly-cli#readme", "dependencies": { "@oclif/core": "4.2.7", "@oclif/plugin-help": "6.2.25", "@oclif/plugin-plugins": "5.4.33", + "@oclif/plugin-warn-if-update-available": "3.1.33", "axios": "1.7.4", "chalk": "4.1.2", "debug": "4.3.4",