diff --git a/.changes/clack-prompts-update-v1.md b/.changes/clack-prompts-update-v1.md new file mode 100644 index 00000000..ba5d4700 --- /dev/null +++ b/.changes/clack-prompts-update-v1.md @@ -0,0 +1,5 @@ +--- +"covector": patch:deps +--- + +Upgrade `@clack/prompts` to v1. diff --git a/package-lock.json b/package-lock.json index f196a7cc..dc7171f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -405,24 +405,31 @@ } }, "node_modules/@clack/core": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.4.1.tgz", - "integrity": "sha512-Pxhij4UXg8KSr7rPek6Zowm+5M22rbd2g1nfojHJkxp5YkFqiZ2+YLEM/XGVIzvGOcM0nqjIFxrpDwWRZYWYjA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.4.2.tgz", + "integrity": "sha512-0Ty/1Gfm+Kb07sXcuESjyKfwEhSy4Ns1AgeEisHb/bDY5fWme0tTeTkU14T1Gmcs17YIjB/teiDe4uaCghbYqQ==", "license": "MIT", "dependencies": { - "picocolors": "^1.0.0", + "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 20.12.0" } }, "node_modules/@clack/prompts": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.10.0.tgz", - "integrity": "sha512-H3rCl6CwW1NdQt9rE3n373t7o5cthPv7yUoxF2ytZvyvlJv89C5RYMJu83Hed8ODgys5vpBU0GKxIRG83jd8NQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.6.0.tgz", + "integrity": "sha512-EYlRokl8szrP9Z25qT5aepMdBjzBvHF9ZEhzIiUBc9guz/T31EqRgvD0QSgZcpE93xiwrr+OkB4nz0BZyF6fSA==", "license": "MIT", "dependencies": { - "@clack/core": "0.4.1", - "picocolors": "^1.0.0", + "@clack/core": "1.4.2", + "fast-string-width": "^3.0.2", + "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 20.12.0" } }, "node_modules/@covector/apply": { @@ -2157,6 +2164,30 @@ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", "license": "MIT" }, + "node_modules/fast-string-truncated-width": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "license": "MIT" + }, + "node_modules/fast-string-width": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "license": "MIT", + "dependencies": { + "fast-string-truncated-width": "^3.0.2" + } + }, + "node_modules/fast-wrap-ansi": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", + "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", + "license": "MIT", + "dependencies": { + "fast-string-width": "^3.0.2" + } + }, "node_modules/fast-xml-builder": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", @@ -3035,6 +3066,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -4292,7 +4324,7 @@ "version": "0.12.5", "license": "Apache-2.0", "dependencies": { - "@clack/prompts": "^0.10.0", + "@clack/prompts": "^1.6.0", "@covector/apply": "0.10.0", "@covector/assemble": "0.12.0", "@covector/changelog": "0.12.0", @@ -4313,7 +4345,7 @@ "@types/yargs": "^17.0.33" }, "engines": { - "node": ">=18" + "node": ">=20.12" } }, "packages/files": { @@ -4666,21 +4698,22 @@ } }, "@clack/core": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.4.1.tgz", - "integrity": "sha512-Pxhij4UXg8KSr7rPek6Zowm+5M22rbd2g1nfojHJkxp5YkFqiZ2+YLEM/XGVIzvGOcM0nqjIFxrpDwWRZYWYjA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.4.2.tgz", + "integrity": "sha512-0Ty/1Gfm+Kb07sXcuESjyKfwEhSy4Ns1AgeEisHb/bDY5fWme0tTeTkU14T1Gmcs17YIjB/teiDe4uaCghbYqQ==", "requires": { - "picocolors": "^1.0.0", + "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" } }, "@clack/prompts": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.10.0.tgz", - "integrity": "sha512-H3rCl6CwW1NdQt9rE3n373t7o5cthPv7yUoxF2ytZvyvlJv89C5RYMJu83Hed8ODgys5vpBU0GKxIRG83jd8NQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.6.0.tgz", + "integrity": "sha512-EYlRokl8szrP9Z25qT5aepMdBjzBvHF9ZEhzIiUBc9guz/T31EqRgvD0QSgZcpE93xiwrr+OkB4nz0BZyF6fSA==", "requires": { - "@clack/core": "0.4.1", - "picocolors": "^1.0.0", + "@clack/core": "1.4.2", + "fast-string-width": "^3.0.2", + "fast-wrap-ansi": "^0.2.0", "sisteransi": "^1.0.5" } }, @@ -5731,7 +5764,7 @@ "covector": { "version": "file:packages/covector", "requires": { - "@clack/prompts": "^0.10.0", + "@clack/prompts": "^1.6.0", "@covector/apply": "0.10.0", "@covector/assemble": "0.12.0", "@covector/changelog": "0.12.0", @@ -5865,6 +5898,27 @@ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" }, + "fast-string-truncated-width": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==" + }, + "fast-string-width": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "requires": { + "fast-string-truncated-width": "^3.0.2" + } + }, + "fast-wrap-ansi": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", + "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", + "requires": { + "fast-string-width": "^3.0.2" + } + }, "fast-xml-builder": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", @@ -6370,7 +6424,8 @@ "picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true }, "picomatch": { "version": "4.0.4", diff --git a/package.json b/package.json index 1a918f45..06083164 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "author": "Jacob Bolda ", "license": "Apache-2.0", "scripts": { - "covector": "node --conditions=development --import=tsx ./packages/covector/bin/covector.mjs", + "covector": "node --conditions=development ./packages/covector/bin/covector.mjs", "build": "npm run build --workspaces --if-present", "build:action": "npm run build:action -w action", "run:action:source": "npm run run:source -w action", diff --git a/packages/action/src/comment/postGithubComment.ts b/packages/action/src/comment/postGithubComment.ts index cb46da05..9c64ab5e 100644 --- a/packages/action/src/comment/postGithubComment.ts +++ b/packages/action/src/comment/postGithubComment.ts @@ -2,7 +2,7 @@ import { DefaultArtifactClient } from "@actions/artifact"; import fs from "node:fs/promises"; import path from "node:path"; import type { getOctokit } from "@actions/github"; -import { until, Operation } from "effection"; +import { until, type Operation } from "effection"; import { Logger } from "@covector/types"; export function* postGithubComment({ diff --git a/packages/changelog/src/get.ts b/packages/changelog/src/get.ts index b4167cac..c2bde424 100644 --- a/packages/changelog/src/get.ts +++ b/packages/changelog/src/get.ts @@ -1,4 +1,4 @@ -import { all, Operation } from "effection"; +import { all, type Operation } from "effection"; import { readChangelog } from "@covector/files"; import type { diff --git a/packages/changelog/src/write.ts b/packages/changelog/src/write.ts index 7e007800..016ef087 100644 --- a/packages/changelog/src/write.ts +++ b/packages/changelog/src/write.ts @@ -1,4 +1,4 @@ -import { all, Operation } from "effection"; +import { all, type Operation } from "effection"; import { writeChangelog } from "@covector/files"; import type { LoadedFile } from "@covector/types"; diff --git a/packages/covector/package.json b/packages/covector/package.json index 92c66169..2596944f 100644 --- a/packages/covector/package.json +++ b/packages/covector/package.json @@ -9,7 +9,7 @@ "url": "https://github.com/jbolda/covector.git" }, "engines": { - "node": ">=18" + "node": ">=20.12" }, "type": "module", "exports": { @@ -32,7 +32,7 @@ "test": "vitest" }, "dependencies": { - "@clack/prompts": "^0.10.0", + "@clack/prompts": "^1.6.0", "@covector/apply": "0.10.0", "@covector/assemble": "0.12.0", "@covector/changelog": "0.12.0", diff --git a/packages/covector/src/add.ts b/packages/covector/src/add.ts index cc248d49..8ed5af29 100644 --- a/packages/covector/src/add.ts +++ b/packages/covector/src/add.ts @@ -94,7 +94,7 @@ export const add = function* ({ text({ message: `Please summarize the changes that occurred.`, validate(value) { - if (value.length === 0) return "You must enter a summary."; + if (!value || value.length === 0) return "You must enter a summary."; }, }), ); @@ -117,7 +117,7 @@ export const add = function* ({ message: `Please name the change file.`, initialValue: branchName, validate(answer) { - if (answer.length === 0) return "You must enter a file name."; + if (!answer || answer.length === 0) return "You must enter a file name."; if (!answer.endsWith(".md")) return "File name must end with the .md file extension."; if (existsSync(join(cwd, changeFolder, `${answer}`))) diff --git a/packages/covector/src/init.ts b/packages/covector/src/init.ts index 689d570e..d1642873 100644 --- a/packages/covector/src/init.ts +++ b/packages/covector/src/init.ts @@ -4,7 +4,7 @@ import { intro, outro, group, cancel, text, confirm } from "@clack/prompts"; import * as fs from "fs/promises"; import type { Dir } from "fs"; import path from "path"; -import { Operation, all, until } from "effection"; +import { type Operation, all, until } from "effection"; import { readPkgFile } from "@covector/files"; import type { Logger, Covector, PackageFile } from "@covector/types"; diff --git a/packages/covector/src/version.ts b/packages/covector/src/version.ts index cef99f05..5f38be23 100644 --- a/packages/covector/src/version.ts +++ b/packages/covector/src/version.ts @@ -19,7 +19,7 @@ import type { ChangeContext, ConfigFile, } from "@covector/types"; -import { until, Operation } from "effection"; +import { until, type Operation } from "effection"; export function* version({ logger,