Skip to content

Commit 9ccf252

Browse files
purplecabbageJesse MacFadyen
authored andcommitted
Force true (#849)
* aio app build --force-build default to true * Force build during deploy
1 parent 84e92f3 commit 9ccf252

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/commands/app/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ Build.flags = {
167167
allowNo: true
168168
}),
169169
'force-build': Flags.boolean({
170-
description: '[default: false] Force a build even if one already exists',
171-
default: false,
170+
description: '[default: true] Force a build even if one already exists',
171+
default: true,
172172
allowNo: true
173173
}),
174174
'content-hash': Flags.boolean({

src/commands/app/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Deploy.flags = {
328328
'force-build': Flags.boolean({
329329
description: '[default: true] Force a build even if one already exists',
330330
exclusive: ['no-build'], // no-build
331-
default: false,
331+
default: true,
332332
allowNo: true
333333
}),
334334
'content-hash': Flags.boolean({

test/commands/app/build.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ test('flags', async () => {
182182

183183
expect(typeof TheCommand.flags['force-build']).toBe('object')
184184
expect(typeof TheCommand.flags['force-build'].description).toBe('string')
185-
expect(TheCommand.flags['force-build'].default).toEqual(false)
185+
expect(TheCommand.flags['force-build'].default).toEqual(true)
186186
expect(TheCommand.flags['force-build'].allowNo).toEqual(true)
187187

188188
expect(typeof TheCommand.flags['content-hash']).toBe('object')
@@ -327,7 +327,7 @@ describe('run', () => {
327327
expect(spinner.succeed).toHaveBeenCalledWith(expect.stringContaining('Built 3 action(s) for \'application\''))
328328
expect(command.error).toHaveBeenCalledTimes(0)
329329
expect(mockRuntimeLib.buildActions).toHaveBeenCalledTimes(1)
330-
expect(mockRuntimeLib.buildActions).toHaveBeenCalledWith(appConfig.application, ['a', 'b', 'c'], false)
330+
expect(mockRuntimeLib.buildActions).toHaveBeenCalledWith(appConfig.application, ['a', 'b', 'c'], true)
331331
expect(mockWebLib.bundle).toHaveBeenCalledTimes(0)
332332
})
333333

test/commands/app/deploy.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ test('flags', async () => {
226226

227227
expect(typeof TheCommand.flags['force-build']).toBe('object')
228228
expect(typeof TheCommand.flags['force-build'].description).toBe('string')
229-
expect(TheCommand.flags['force-build'].default).toEqual(false)
229+
expect(TheCommand.flags['force-build'].default).toEqual(true)
230230
expect(TheCommand.flags['force-build'].allowNo).toEqual(true)
231231

232232
expect(typeof TheCommand.flags['content-hash']).toBe('object')
@@ -327,7 +327,7 @@ describe('run', () => {
327327
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
328328
expect(command.buildOneExt).toHaveBeenCalledWith('application',
329329
appConfig.application,
330-
expect.objectContaining({ 'force-build': false, verbose: true }),
330+
expect.objectContaining({ verbose: true, 'force-build': true }),
331331
expect.anything())
332332
})
333333

@@ -343,7 +343,7 @@ describe('run', () => {
343343
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
344344
expect(command.buildOneExt).toHaveBeenCalledWith('application',
345345
appConfig.application,
346-
expect.objectContaining({ 'force-build': false, 'web-assets': false }),
346+
expect.objectContaining({ 'web-assets': false, 'force-build': true }),
347347
expect.anything())
348348
})
349349

@@ -413,7 +413,7 @@ describe('run', () => {
413413

414414
expect(command.buildOneExt).toHaveBeenCalledWith('application',
415415
appConfig.application,
416-
expect.objectContaining({ 'force-build': false, 'web-assets': false, action: ['a', 'b', 'c'] }),
416+
expect.objectContaining({ 'web-assets': false, action: ['a', 'b', 'c'], 'force-build': true }),
417417
expect.anything())
418418
expect(mockRuntimeLib.deployActions).toHaveBeenCalledWith(appConfig.application, {
419419
filterEntities: { actions: ['a', 'b', 'c'] },
@@ -435,7 +435,7 @@ describe('run', () => {
435435

436436
expect(command.buildOneExt).toHaveBeenCalledWith('application',
437437
appConfig.application,
438-
expect.objectContaining({ 'force-build': false, 'web-assets': false, action: ['c'] }),
438+
expect.objectContaining({ 'web-assets': false, action: ['c'], 'force-build': true }),
439439
expect.anything())
440440
expect(mockRuntimeLib.deployActions).toHaveBeenCalledWith(appConfig.application, {
441441
filterEntities: { actions: ['c'] },
@@ -458,7 +458,7 @@ describe('run', () => {
458458
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
459459
expect(command.buildOneExt).toHaveBeenCalledWith('application',
460460
appConfig.application,
461-
expect.objectContaining({ 'force-build': false, 'web-assets': false }),
461+
expect.objectContaining({ 'web-assets': false, 'force-build': true }),
462462
expect.anything())
463463
})
464464

@@ -485,7 +485,7 @@ describe('run', () => {
485485
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
486486
expect(command.buildOneExt).toHaveBeenCalledWith('application',
487487
appConfig.application,
488-
expect.objectContaining({ 'force-build': false, actions: false }),
488+
expect.objectContaining({ actions: false, 'force-build': true }),
489489
expect.anything())
490490
})
491491

@@ -503,7 +503,7 @@ describe('run', () => {
503503
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
504504
expect(command.buildOneExt).toHaveBeenCalledWith('application',
505505
appConfig.application,
506-
expect.objectContaining({ 'force-build': false, actions: false }),
506+
expect.objectContaining({ actions: false, 'force-build': true }),
507507
expect.anything())
508508
})
509509

@@ -520,7 +520,7 @@ describe('run', () => {
520520
expect(command.buildOneExt).toHaveBeenCalledTimes(1)
521521
expect(command.buildOneExt).toHaveBeenCalledWith('application',
522522
appConfig.application,
523-
expect.objectContaining({ 'force-build': false }),
523+
expect.objectContaining({ 'force-build': true }),
524524
expect.anything())
525525
})
526526

0 commit comments

Comments
 (0)