Skip to content

Commit

Permalink
Merge branch 'master' into YaTut1901/fix/bump-commander
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 authored Jun 26, 2024
2 parents 221c240 + c835e53 commit 6a415d2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-bugs-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-fuels": patch
---

feat: add `fuel-toolchain.toml` to `create fuels` template
20 changes: 20 additions & 0 deletions packages/create-fuels/test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { versions } from '@fuel-ts/versions';
import toml from '@iarna/toml';
import { mkdirSync, readFileSync } from 'fs';
import { join } from 'path';

Expand Down Expand Up @@ -52,6 +54,24 @@ describe('CLI', () => {
expect(originalTemplateFiles.sort()).toEqual(testProjectFiles.sort());
});

test('create-fuels checks the versions on the fuel-toolchain file', async () => {
const args = generateArgv(paths.root);

await runScaffoldCli({
program: setupProgram(),
args,
});

const fuelToolchainPath = join(paths.root, 'sway-programs', 'fuel-toolchain.toml');
const fuelToolchain = readFileSync(fuelToolchainPath, 'utf-8');
const parsedFuelToolchain = toml.parse(fuelToolchain);

const { toolchain, components } = parsedFuelToolchain;

expect(toolchain).toEqual({ channel: 'testnet' });
expect(components).toEqual({ forc: versions.FORC, 'fuel-core': versions.FUEL_CORE });
});

test('should rewrite for the appropriate package manager', async () => {
const args = generateArgv(paths.root, 'bun');

Expand Down
6 changes: 6 additions & 0 deletions templates/nextjs/sway-programs/fuel-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[toolchain]
channel = "testnet"

[components]
forc = "0.60.0"
fuel-core = "0.30.0"

0 comments on commit 6a415d2

Please sign in to comment.