Skip to content

Commit bec0f36

Browse files
committed
CLI recursive defaults to true
1 parent 5775b0f commit bec0f36

6 files changed

Lines changed: 37 additions & 6 deletions

File tree

packages/cli/__tests__/cli-deploy-stage-unique-names.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('CLIDeployTestFixture Migrate', () => {
2323

2424
it('should emulate terminal commands with database operations', async () => {
2525
const terminalCommands = `
26-
lql deploy --recursive --database ${testDb.name} --yes --no-usePlan --package unique-names
26+
lql deploy --database ${testDb.name} --yes --no-usePlan --package unique-names
2727
`;
2828

2929
const results = await fixture.runTerminalCommands(terminalCommands, {
@@ -35,7 +35,7 @@ describe('CLIDeployTestFixture Migrate', () => {
3535

3636
it('should emulate terminal commands with database operations usePlan', async () => {
3737
const terminalCommands = `
38-
lql deploy --recursive --database ${testDb.name} --yes --usePlan --package unique-names
38+
lql deploy --database ${testDb.name} --yes --usePlan --package unique-names
3939
`;
4040

4141
const results = await fixture.runTerminalCommands(terminalCommands, {

packages/cli/__tests__/deploy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('CLI Deploy Command', () => {
9090
expect(await testDb.exists('table', 'myfirstapp.users')).toBe(true);
9191
expect(await testDb.exists('table', 'myfirstapp.products')).toBe(true);
9292

93-
const revertCommands = `lql revert --database $database --yes`;
93+
const revertCommands = `lql revert --database $database --package my-first --yes`;
9494
await fixture.runTerminalCommands(revertCommands, {
9595
database: testDb.name
9696
}, true);

packages/cli/src/commands/deploy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ export default async (
7878
message: 'Are you sure you want to proceed?',
7979
required: true
8080
},
81+
{
82+
name: 'recursive',
83+
type: 'confirm',
84+
message: 'Deploy recursively through dependencies?',
85+
useDefault: true,
86+
default: true,
87+
required: false
88+
},
8189
{
8290
name: 'tx',
8391
type: 'confirm',

packages/cli/src/commands/revert.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ export default async (
5454
message: 'Are you sure you want to proceed?',
5555
required: true
5656
},
57+
{
58+
name: 'recursive',
59+
type: 'confirm',
60+
message: 'Deploy recursively through dependencies?',
61+
useDefault: true,
62+
default: true,
63+
required: false
64+
},
5765
{
5866
name: 'tx',
5967
type: 'confirm',
@@ -65,7 +73,7 @@ export default async (
6573
];
6674

6775
let { yes, recursive, cwd, tx } = await prompter.prompt(argv, questions);
68-
76+
6977
if (!yes) {
7078
log.info('Operation cancelled.');
7179
return;

packages/cli/src/commands/verify.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ export default async (
4545
message: 'Select database'
4646
});
4747

48-
const questions: Question[] = [];
48+
const questions: Question[] = [
49+
{
50+
name: 'recursive',
51+
type: 'confirm',
52+
message: 'Deploy recursively through dependencies?',
53+
useDefault: true,
54+
default: true,
55+
required: false
56+
},
57+
];
4958

5059
let { recursive, cwd } = await prompter.prompt(argv, questions);
5160

packages/cli/test-utils/CLIDeployTestFixture.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ export class CLIDeployTestFixture extends TestFixture {
217217

218218
if (token.startsWith('--')) {
219219
const key = token.substring(2);
220-
if (i + 1 < tokens.length && !tokens[i + 1].startsWith('--')) {
220+
221+
// Handle --no-<thing> pattern by setting <thing>: false
222+
if (key.startsWith('no-')) {
223+
const baseKey = key.substring(3); // Remove 'no-' prefix
224+
argv[baseKey] = false;
225+
i += 1;
226+
} else if (i + 1 < tokens.length && !tokens[i + 1].startsWith('--')) {
221227
argv[key] = tokens[i + 1];
222228
i += 2;
223229
} else {

0 commit comments

Comments
 (0)