Skip to content

Commit

Permalink
chore!: upgrade commander to12.1.0 (#2620)
Browse files Browse the repository at this point in the history
* fix(fuels): removed -p flag, bumped commander dep to latest

* change version in lock file

* Update seven-moles-live.md

* Update .changeset/seven-moles-live.md

Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>

---------

Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
  • Loading branch information
YaTut1901 and petertonysmith94 authored Jun 26, 2024
1 parent c846bfb commit a6c45fd
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 204 deletions.
7 changes: 7 additions & 0 deletions .changeset/seven-moles-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"fuels": minor
"create-fuels": patch
"@fuel-ts/abi-typegen": patch
---

chore!: upgrade `commander` to`12.1.0`
2 changes: 1 addition & 1 deletion apps/docs/src/guide/fuels-cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ npx fuels@{{fuels}} help build

```console
Options:
-p, --path <path> Path to project root (default: "/Users/anderson/Code/fuel/fuels-ts/apps/docs")
--path <path> Path to project root (default: "/Users/anderson/Code/fuel/fuels-ts/apps/docs")
-d, --deploy Deploy contracts after build (auto-starts a `fuel-core` node if needed)
-h, --help Display help
```
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@fuel-ts/interfaces": "workspace:^",
"@fuel-ts/utils": "workspace:*",
"@fuel-ts/versions": "workspace:*",
"commander": "^9.4.1",
"commander": "12.1.0",
"glob": "^10.2.6",
"handlebars": "^4.7.8",
"mkdirp": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@iarna/toml": "^2.2.5",
"chalk": "4",
"commander": "^9.4.1",
"commander": "12.1.0",
"ora": "5.4.1",
"prompts": "^2.4.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"bundle-require": "^5.0.0",
"chalk": "4",
"chokidar": "^3.5.3",
"commander": "^9.4.1",
"commander": "12.1.0",
"esbuild": "^0.19.3",
"glob": "^10.2.6",
"handlebars": "^4.7.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const configureCli = () => {
* Defining local commands
*/

const pathOption = new Option('-p, --path <path>', 'Path to project root').default(process.cwd());
const pathOption = new Option('--path <path>', 'Path to project root').default(process.cwd());

let command: Command;

Expand Down
6 changes: 3 additions & 3 deletions packages/fuels/src/cli/commands/withBinaryPaths.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { program } from 'commander';
import { Command } from 'commander';

import { fuelsConfig } from '../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../test/utils/mockLogger';
Expand All @@ -12,9 +12,9 @@ const mockAllDeps = (
) => {
const { forcPath, fuelCorePath, configPath } = params;

const command = program
const command = new Command()
.command(Commands.versions)
.option('-p, --path <path>', 'Path to project root', configPath);
.option('--path <path>', 'Path to project root', configPath);

const runVersions = vi.fn();

Expand Down
6 changes: 3 additions & 3 deletions packages/fuels/src/cli/commands/withConfig.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { program } from 'commander';
import { Command } from 'commander';

import { fuelsConfig } from '../../../test/fixtures/fuels.config';
import { mockLogger } from '../../../test/utils/mockLogger';
Expand Down Expand Up @@ -32,9 +32,9 @@ describe('withConfig', () => {

const configPath = '/a/real/path';

const command = program
const command = new Command()
.command(Commands.deploy)
.option('-p, --path <path>', 'Path to project root', configPath);
.option('--path <path>', 'Path to project root', configPath);

const loadConfig = vi.spyOn(loadConfigMod, 'loadConfig').mockImplementation(() => {
if (params?.shouldErrorOnLoadConfig) {
Expand Down
2 changes: 1 addition & 1 deletion packages/fuels/test/features/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('init', () => {
const write = vi.spyOn(process.stdout, 'write').mockReturnValue(true);
const exit = vi.spyOn(process, 'exit').mockResolvedValue({} as never);

await runCommand(Commands.init, ['-p', paths.root, '-o', paths.outputDir]);
await runCommand(Commands.init, ['--path', paths.root, '-o', paths.outputDir]);

expect(exit).toHaveBeenCalledTimes(1);
expect(exit).toHaveBeenCalledWith(1);
Expand Down
8 changes: 4 additions & 4 deletions packages/fuels/test/utils/runCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export async function runInit(params: InitParams) {
value ? (flags as string[]) : [];

const flags = [
flag(['-p', root], root),
flag(['--path', root], root),
flag(['-o', output], output),
flag(['-w', workspace], workspace),
flag(['--contracts', contracts], contracts),
Expand All @@ -130,16 +130,16 @@ export async function runInit(params: InitParams) {

export async function runBuild(params: BuildParams) {
const { root, deploy } = params;
const flags = [['-p', root], deploy ? ['--deploy'] : []].flat();
const flags = [['--path', root], deploy ? ['--deploy'] : []].flat();
return runCommand(Commands.build, flags);
}

export async function runDeploy(params: BaseParams) {
return runCommand(Commands.deploy, ['-p', params.root]);
return runCommand(Commands.deploy, ['--path', params.root]);
}

export async function runDev(params: BaseParams) {
return runCommand(Commands.dev, ['-p', params.root]);
return runCommand(Commands.dev, ['--path', params.root]);
}

/**
Expand Down
Loading

0 comments on commit a6c45fd

Please sign in to comment.