Git Product home page Git Product logo

Comments (8)

YaTut1901 avatar YaTut1901 commented on August 18, 2024 2

by the way, when I run tests on latest master, I get the same errors
And some other errors because of incorrect usage of Command and program from commander:
packages/fuels/src/cli/commands/withBinaryPaths.test.ts:

1 import { program } from 'commander';
15 const command = program
16     .command(Commands.versions)

It is not creating new command, but rather use the global one. That leads to such error messages:
Error: cannot add command 'versions' as already have command 'versions'
For me seems better way is:

1 import { Command } from 'commander';
15 const command = new Command()
16     .command(Commands.versions)

from fuels-ts.

petertonysmith94 avatar petertonysmith94 commented on August 18, 2024 1

hello, I can try it

@YaTut1901 Go for it! If you need any help, don't hesitate to ask 😄

from fuels-ts.

YaTut1901 avatar YaTut1901 commented on August 18, 2024 1

@petertonysmith94, I am running tests with bumped dependency and they are failing because of commands clashing. Here it is, in file packages/fuels/src/cli.ts:

45: const pathOption = new Option('-p, --path <path>', 'Path to project root').default(process.cwd());
58: .addOption(new Option(`-p, --predicates ${arg}`, `${desc} Predicates`).conflicts('workspace'))

updated commander doesn`t want to accept same options "-p", should they be renamed?

from fuels-ts.

petertonysmith94 avatar petertonysmith94 commented on August 18, 2024 1

@petertonysmith94, I am running tests with bumped dependency and they are failing because of commands clashing. Here it is, in file packages/fuels/src/cli.ts:

45: const pathOption = new Option('-p, --path <path>', 'Path to project root').default(process.cwd());
58: .addOption(new Option(`-p, --predicates ${arg}`, `${desc} Predicates`).conflicts('workspace'))

updated commander doesn't want to accept same options "-p", should they be renamed?

@YaTut1901 Great catch!

Not sure how this hasn't been an issue before, as they are conflicting flags. I'd suggest changing the path option to be capital P, as I would guess this would be a less breaking change to end users.

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

from fuels-ts.

arboleya avatar arboleya commented on August 18, 2024 1

Oh wow, how come did this get this far? 🤦‍♂️

@petertonysmith94 I'd say we don't need a shortcut for path, so it can be just --path. In my experience, the --path option is not very used, and having a case where we'd have -P and -p simultaneously may look weird. It works, but we can avoid it and favor clarity over brevity.

It is good to note that this will be a [small] breaking change.

from fuels-ts.

YaTut1901 avatar YaTut1901 commented on August 18, 2024

hello, I can try it

from fuels-ts.

YaTut1901 avatar YaTut1901 commented on August 18, 2024

@petertonysmith94 is there any other issues need to be completed?

from fuels-ts.

petertonysmith94 avatar petertonysmith94 commented on August 18, 2024

@YaTut1901 Check out the good first issues - just pop a message on the issue :D

from fuels-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.