refactor: use oclif variadic args instead of strict=false#782
refactor: use oclif variadic args instead of strict=false#782
Conversation
Replace `strict = false` + manual argv parsing with `multiple: true` on Args.string() in doctor, documents delete, and install commands. This uses oclif's built-in variadic argument support (added in @oclif/core 4.10.0) for proper parsing, validation, and help output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @rexxars's task in 1m 4s —— View job Review
Coverage drop in test('runs only specified check when check name is provided', async () => {
const {error, stdout} = await testCommand(DoctorCommand, ['cli'])
expect(error).toBeUndefined()
expect(stdout).toContain('CLI Installation')
})
No issues with |
Coverage Delta
Comparing 3 changed files against main @ Overall Coverage
|
The simulateOAuthCallback helper used a single 100ms delay before connecting to the local auth server. On Windows CI, the server may not be listening yet, causing ECONNREFUSED. Add retry logic with backoff and use 127.0.0.1 directly to avoid IPv6 resolution delays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📦 Bundle Stats —
|
| Metric | Value | vs main (c37431d) | vs v6.2.1 |
|---|---|---|---|
| Internal (raw) | 2.1 KB | - | - |
| Internal (gzip) | 799 B | - | - |
| Bundled (raw) | 11.06 MB | - | +9.12 MB, +470.6% |
| Bundled (gzip) | 2.07 MB | - | +1.60 MB, +335.8% |
| Import time | 852ms | +2ms, +0.2% | +41ms, +5.1% |
bin:sanity
| Metric | Value | vs main (c37431d) | vs v6.2.1 |
|---|---|---|---|
| Internal (raw) | 975 B | - | - |
| Internal (gzip) | 460 B | - | - |
| Bundled (raw) | 9.83 MB | - | +9.12 MB, +1286.7% |
| Bundled (gzip) | 1.77 MB | - | +1.60 MB, +940.0% |
| Import time | NaNs | - | NaNs, NaN% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (c37431d6) · v1.2.1 (npm)
| Metric | Value | vs main (c37431d) | vs v1.2.1 |
|---|---|---|---|
| Internal (raw) | 92.2 KB | - | +3.9 KB, +4.4% |
| Internal (gzip) | 21.6 KB | - | +1.1 KB, +5.5% |
| Bundled (raw) | 21.72 MB | - | +9.16 MB, +72.9% |
| Bundled (gzip) | 3.45 MB | - | +1.61 MB, +87.2% |
| Import time | 798ms | +3ms, +0.3% | +46ms, +6.1% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage Delta
Comparing 3 changed files against main @ Overall Coverage
|
oclif validates args against `options` before run(), so the filter could never reject anything. Cast directly instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📦 Bundle Stats —
|
| Metric | Value | vs main (c37431d) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.95 MB | -120.3 KB, -1.1% |
| Bundled (gzip) | 2.06 MB | -20.4 KB, -1.0% |
| Import time | 823ms | -21ms, -2.5% |
bin:sanity
| Metric | Value | vs main (c37431d) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.95s | -5ms, -0.2% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (c37431d6)
| Metric | Value | vs main (c37431d) |
|---|---|---|
| Internal (raw) | 92.3 KB | +96 B, +0.1% |
| Internal (gzip) | 21.6 KB | +18 B, +0.1% |
| Bundled (raw) | 21.53 MB | -118.6 KB, -0.5% |
| Bundled (gzip) | 3.41 MB | -20.5 KB, -0.6% |
| Import time | 784ms | +0ms, +0.1% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (c37431d6)
| Metric | Value | vs main (c37431d) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage Delta
Comparing 3 changed files against main @ Overall Coverage
|
Summary
We could wait and see if oclif/core#1568 lands which will improve this further by automatically narrowing arg types.
strict = false+ manualargvparsing with oclif's nativemultiple: trueonArgs.string()indoctor,documents delete, andinstallcommandsdoctorcommand's check names viaoptions: [...]instead of manual validationexecremainsstrict = falsesince it's a genuine passthrough caseTest plan
doctorcommand validates check names via oclif'soptions(error message changed from custom to oclif'sExpected X to be one of...)sanity doctor cli studio,sanity documents delete id1 id2,sanity install pkg1 pkg2🤖 Generated with Claude Code