Skip to content

Improve paths validation/expansion on fuels init command #3406

Closed
@arboleya

Description

When running this:

mkdir temp && cd temp && \
  pnpm init && pnpm add fuels && \
  forc new --contract counter && \
  pnpm fuels init --contracts ./counter/* --output ./sway-types && \
  cat fuels.config.ts

We end up with:

// fuels.config.ts
import { createConfig } from 'fuels';

export default createConfig({
  contracts: [
        'counter/Forc.toml',
  ],
  output: './src/sway-types',
});

Notes:

  1. If you try to build the resulting project with pnpm fuels build, you'll get an error
  2. The contract's path should be counter and not counter/Forc.toml
  3. Perhaps this is caused by using a wildcard in ./counter/* during the init command — note that the counter directory does not contains other/multiple contracts inside of it. It is the contract.

We should review the path's validation and expansion and improve tests around this.

Metadata

Assignees

Labels

bugIssue is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions