Skip to content

Commit d935e04

Browse files
committed
refactor(deploy): rename the --json verdict field to isDeployable
1 parent 2b93f0f commit d935e04

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/@sanity/cli/src/actions/deploy/__tests__/deploymentPlan.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ describe('deploymentPlanToJson', () => {
6666
expect(json).toEqual({
6767
applicationType: 'studio',
6868
applicationVersion: '3.99.0',
69-
deployable: false,
7069
errors: {'No studio hostname configured': 'Set `studioHost`'},
7170
files: [{path: 'dist/index.html', size: 1_048_576}],
71+
isDeployable: false,
7272
totalBytes: 1_048_576,
7373
warnings: ['The autoUpdates config has moved'],
7474
})
@@ -77,11 +77,11 @@ describe('deploymentPlanToJson', () => {
7777
test('an error without a solution maps to null', () => {
7878
const json = deploymentPlanToJson(studioPlan([{message: 'boom', status: 'fail'}]))
7979
expect(json.errors).toEqual({boom: null})
80-
expect(json.deployable).toBe(false)
80+
expect(json.isDeployable).toBe(false)
8181
})
8282

83-
test('deployable is true when no check failed', () => {
84-
expect(deploymentPlanToJson(studioPlan([{message: 'ok', status: 'pass'}])).deployable).toBe(
83+
test('isDeployable is true when no check failed', () => {
84+
expect(deploymentPlanToJson(studioPlan([{message: 'ok', status: 'pass'}])).isDeployable).toBe(
8585
true,
8686
)
8787
})

packages/@sanity/cli/src/actions/deploy/deploymentPlan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ function totalBytes(files: DeploymentFile[]): number {
7373
export function deploymentPlanToJson(plan: DeploymentPlan): {
7474
applicationType: DeploymentPlan['type']
7575
applicationVersion: string | null
76-
deployable: boolean
7776
errors: Record<string, string | null>
7877
files: DeploymentFile[]
78+
isDeployable: boolean
7979
totalBytes: number
8080
warnings: string[]
8181
} {
@@ -89,9 +89,9 @@ export function deploymentPlanToJson(plan: DeploymentPlan): {
8989
return {
9090
applicationType: plan.type,
9191
applicationVersion: plan.version,
92-
deployable: isDeployable(plan),
9392
errors,
9493
files: plan.files,
94+
isDeployable: isDeployable(plan),
9595
totalBytes: totalBytes(plan.files),
9696
warnings,
9797
}

packages/@sanity/cli/test/integration/commands/deploy.studio.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ describe('#deploy studio', () => {
315315
const plan = JSON.parse(stdout)
316316
expect(plan.applicationType).toBe('studio')
317317
expect(typeof plan.applicationVersion).toBe('string')
318-
expect(plan.deployable).toBe(true)
318+
expect(plan.isDeployable).toBe(true)
319319
expect(plan.errors).toEqual({})
320320
expect(Array.isArray(plan.warnings)).toBe(true)
321321
expect(plan.files).toContainEqual(expect.objectContaining({path: 'dist/index.html'}))

0 commit comments

Comments
 (0)