Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create-fuels install dependencies by default #2779

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/rare-ducks-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

fix: `create-fuels` install dependencies by default
2 changes: 1 addition & 1 deletion packages/create-fuels/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const runScaffoldCli = async ({

fileCopySpinner.succeed('Copied template files!');

if (opts['no-install'] === false) {
if (opts.install) {
const installDepsSpinner = ora({
text: 'Installing dependencies..',
color: 'green',
Expand Down
8 changes: 8 additions & 0 deletions packages/create-fuels/src/lib/setupProgram.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('setupProgram', () => {
expect(program.opts().pnpm).toBe(true);
expect(program.opts().npm).toBe(true);
expect(program.opts().bun).toBe(true);
expect(program.opts().install).toBe(true);
});

test('setupProgram - no args', () => {
Expand All @@ -19,5 +20,12 @@ describe('setupProgram', () => {
expect(program.opts().pnpm).toBe(undefined);
expect(program.opts().npm).toBe(undefined);
expect(program.opts().bun).toBe(undefined);
expect(program.opts().install).toBe(true);
});

test('setupProgram - `--no-install`', () => {
const program = setupProgram();
program.parse(['', '', 'test-project-name', '--no-install']);
expect(program.opts().install).toBe(false);
});
});
4 changes: 2 additions & 2 deletions packages/create-fuels/src/lib/setupProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ProgramOptions {
npm?: boolean;
bun?: boolean;
verbose?: boolean;
'no-install'?: boolean;
install?: boolean;
}

export const setupProgram = () => {
Expand All @@ -21,7 +21,7 @@ export const setupProgram = () => {
.option('--npm', 'Use npm to install dependencies')
.option('--bun', 'Use bun to install dependencies')
.option('--verbose', 'Enable verbose logging')
.option('--no-install', `Do not install dependencies after scaffolding`, false)
.option('--no-install', 'Do not install dependencies')
.addHelpCommand()
.showHelpAfterError(true);
return program;
Expand Down
Loading