Skip to content

Commit ef2ed1e

Browse files
morealclaude
andcommitted
Add mise check task for workspace: protocol validation
The pnpm workspace: protocol requires a version specifier (*, ^, or ~). Using "workspace:" without a specifier is invalid but pnpm doesn't report a clear error, which can cause issues with tools like moonrepo. This adds a check:manifest:workspace-protocol task that detects invalid patterns and fails the CI check if found. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e4f8233 commit ef2ed1e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mise.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ depends = [
4646
"check:types",
4747
"check:md",
4848
"check-versions",
49+
"check:manifest:workspace-protocol",
4950
]
5051

5152
[tasks."check:fmt"]
@@ -75,6 +76,17 @@ else
7576
fi
7677
'''
7778

79+
[tasks."check:manifest:workspace-protocol"]
80+
description = "Check for invalid workspace: specifiers without version (*, ^, ~)"
81+
run = '''
82+
if grep -rE '"workspace:"[[:space:]]*[,}]' --include='package.json' .; then
83+
echo "Error: Found invalid workspace: specifier without *, ^, or ~"
84+
echo "Valid formats: workspace:*, workspace:^, workspace:~"
85+
exit 1
86+
fi
87+
echo "All workspace: specifiers are valid"
88+
'''
89+
7890
[tasks.fmt]
7991
description = "Format the codebase"
8092
run = "deno fmt && hongdown --write"

0 commit comments

Comments
 (0)