conventional-changelog
conventional-changelog copied to clipboard
writer: fails to build; argument not assignable to parameter
https://github.com/conventional-changelog/conventional-changelog/blob/521912a52ec34c46bb1546806633e5f9b1921057/packages/conventional-changelog-writer/src/options.ts#L80
Assuming pnpm i && pnpm build is the correct procedure, this line produces the following error when trying to build:
> pnpm -r --parallel --if-present build
Scope: 19 of 20 workspace projects
.../conventional-changelog-preset-loader build$ tsc -p tsconfig.build.json
packages/conventional-changelog build$ tsc -p tsconfig.build.json
packages/conventional-changelog-writer build$ tsc -p tsconfig.build.json
packages/conventional-commits-filter build$ tsc -p tsconfig.build.json
packages/conventional-commits-parser build$ tsc -p tsconfig.build.json
packages/conventional-recommended-bump build$ tsc -p tsconfig.build.json
packages/git-client build$ tsc -p tsconfig.build.json
packages/standard-changelog build$ tsc -p tsconfig.build.json
packages/conventional-commits-parser build: Done
packages/conventional-recommended-bump build: Done
.../conventional-changelog-preset-loader build: Done
packages/conventional-commits-filter build: Done
packages/conventional-changelog-writer build: src/options.ts(80,35): error TS2345: Argument of type 'SortBy<PickStrings<Commit>>' is not assignable to parameter of type 'string | string[] | Comparator<PickStrings<Commit>> | undefined'.
packages/conventional-changelog-writer build: Type 'PickStringsKeys<PickStrings<Commit>>[]' is not assignable to type 'string | string[] | Comparator<PickStrings<Commit>> | undefined'.
packages/conventional-changelog-writer build: Type 'PickStringsKeys<PickStrings<Commit>>[]' is not assignable to type 'string[]'.
packages/conventional-changelog-writer build: Type 'PickStringsKeys<PickStrings<Commit>>' is not assignable to type 'string'.
packages/conventional-changelog-writer build: Type 'undefined' is not assignable to type 'string'.
packages/conventional-changelog-writer build: Failed
/.../Projects/conventional-changelog/packages/conventional-changelog-writer:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] build: `tsc -p tsconfig.build.json`
Exit status 2
packages/git-client build: Done
packages/standard-changelog build: ../conventional-changelog-writer/src/options.ts(80,35): error TS2345: Argument of type 'SortBy<PickStrings<Commit>>' is not assignable to parameter of type 'string | string[] | Comparator<PickStrings<Commit>> | undefined'.
packages/standard-changelog build: Type 'PickStringsKeys<PickStrings<Commit>>[]' is not assignable to type 'string | string[] | Comparator<PickStrings<Commit>> | undefined'.
packages/standard-changelog build: Type 'PickStringsKeys<PickStrings<Commit>>[]' is not assignable to type 'string[]'.
packages/standard-changelog build: Type 'PickStringsKeys<PickStrings<Commit>>' is not assignable to type 'string'.
packages/standard-changelog build: Type 'undefined' is not assignable to type 'string'.
packages/standard-changelog build: Failed
ELIFECYCLE Command failed with exit code 2.
Here is the error in vscode.
Would adding Required<> be a valid fix here?
commitsSort: createComparator(prefinalOptions.commitsSort as SortBy<Required<PickStrings<Commit>>>),
@roydukkey Hi. All tests pass the check successfully
https://github.com/conventional-changelog/conventional-changelog/actions/runs/14772639031/job/41475203816
Also I checked it locally:
conventional-changelog(master)$ git fetch origin master && git reset --hard origin/master
From github.com:conventional-changelog/conventional-changelog
* branch master -> FETCH_HEAD
HEAD is now at 521912a chore(deps): update dependency vite to v6.0.15 [security] (#1367)
conventional-changelog(master)$ pnpm i
Scope: all 20 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 535ms
conventional-changelog(master)$ pnpm test:types
> [email protected] test:types /Users/dangreen/github/conventional-changelog
> pnpm -r --parallel --if-present test:types
Scope: 19 of 20 workspace projects
packages/conventional-changelog test:types$ tsc --noEmit
.../conventional-changelog-preset-loader test:types$ tsc --noEmit
packages/conventional-changelog-writer test:types$ tsc --noEmit
packages/conventional-commits-filter test:types$ tsc --noEmit
packages/conventional-commits-parser test:types$ tsc --noEmit
packages/conventional-recommended-bump test:types$ tsc --noEmit
packages/git-client test:types$ tsc --noEmit
packages/standard-changelog test:types$ tsc --noEmit
packages/conventional-commits-filter test:types: Done
.../conventional-changelog-preset-loader test:types: Done
packages/git-client test:types: Done
packages/conventional-commits-parser test:types: Done
packages/conventional-recommended-bump test:types: Done
packages/standard-changelog test:types: Done
packages/conventional-changelog-writer test:types: Done
packages/conventional-changelog test:types: Done
conventional-changelog(master)$ pnpm build
> [email protected] build /Users/dangreen/github/conventional-changelog
> pnpm -r --parallel --if-present build
Scope: 19 of 20 workspace projects
packages/conventional-changelog build$ tsc -p tsconfig.build.json
.../conventional-changelog-preset-loader build$ tsc -p tsconfig.build.json
packages/conventional-changelog-writer build$ tsc -p tsconfig.build.json
packages/conventional-commits-filter build$ tsc -p tsconfig.build.json
packages/conventional-commits-parser build$ tsc -p tsconfig.build.json
packages/conventional-recommended-bump build$ tsc -p tsconfig.build.json
packages/git-client build$ tsc -p tsconfig.build.json
packages/standard-changelog build$ tsc -p tsconfig.build.json
packages/conventional-commits-filter build: Done
.../conventional-changelog-preset-loader build: Done
packages/conventional-commits-parser build: Done
packages/git-client build: Done
packages/conventional-changelog-writer build: Done
packages/conventional-recommended-bump build: Done
packages/standard-changelog build: Done
packages/conventional-changelog build: Done
conventional-changelog(master)$