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

Improve paths validation/expansion on fuels init command #3406

Open
arboleya opened this issue Nov 20, 2024 · 1 comment
Open

Improve paths validation/expansion on fuels init command #3406

arboleya opened this issue Nov 20, 2024 · 1 comment
Labels
bug Issue is a bug

Comments

@arboleya
Copy link
Member

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 pnpn 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.

@arboleya arboleya added the bug Issue is a bug label Nov 20, 2024
@arboleya arboleya changed the title Improve paths validation on fuels init command Improve paths validation/expansion on fuels init command Nov 20, 2024
@arboleya
Copy link
Member Author

cc @bajpai244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant