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

chore!: upgrade commander to12.1.0 #2620

Merged
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
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")
YaTut1901 marked this conversation as resolved.
Show resolved Hide resolved
-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
Loading