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

feat: add contracts tooling #635

Closed
wants to merge 143 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
0e5f17f
feat: add contracts cli
luizstacio Nov 30, 2022
bc2321c
feat: add test for contracts cli
luizstacio Dec 1, 2022
5ab8f79
chore: update docs
luizstacio Dec 1, 2022
208df8c
chore: improve doc and update output help
luizstacio Dec 1, 2022
8e17d40
chore: add changeset
luizstacio Dec 1, 2022
0996dd9
test: add tests for using generated files
luizstacio Dec 2, 2022
2d1a044
Merge branch 'master' into ls/contracts-cli
luizstacio Dec 2, 2022
c140bd4
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ls/contrac…
luizstacio Dec 5, 2022
c831bcc
merge
luizstacio Dec 16, 2022
591816a
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ls/contrac…
luizstacio Dec 24, 2022
4894bea
feat: user abi-typegen
luizstacio Dec 24, 2022
03960e7
Merge branch 'ls/contracts-cli' of github.com:FuelLabs/fuels-ts into …
luizstacio Dec 24, 2022
3c83b30
Merge branch 'master' into ls/contracts-cli
luizstacio Jan 9, 2023
3ae24f0
feat: use abi-typegen
luizstacio Jan 10, 2023
f5bd707
chore: update lock file
luizstacio Jan 10, 2023
ce64ba3
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ls/contrac…
luizstacio Jan 31, 2023
4a34c12
save
luizstacio Feb 1, 2023
2b0ea75
merge
luizstacio Mar 6, 2023
6469a9c
feat: update contracts cli
luizstacio Mar 7, 2023
2c426fd
feat: add tests for run and deploy
luizstacio Mar 7, 2023
401394c
feat: add test no name
luizstacio Mar 7, 2023
4e93575
feat: add workspace config
luizstacio Mar 7, 2023
705f8e8
refact: clean code and better organize
luizstacio Mar 7, 2023
771f849
merge
luizstacio Mar 8, 2023
569fd03
feat: update typegen and fix tests
luizstacio Mar 8, 2023
034b92e
test: add individual action tests
luizstacio Mar 8, 2023
93a0dc9
test: add tests for utils and services
luizstacio Mar 9, 2023
4c7e416
test: improve tests and refactor cli tests
luizstacio Mar 9, 2023
574f30f
test: improve docs
luizstacio Mar 9, 2023
2dbbb9f
feat: improve docs
luizstacio Mar 9, 2023
2009767
Merge branch 'master' into ls/contracts-cli
luizstacio Mar 9, 2023
81c95bf
feat: update changeset text
luizstacio Mar 9, 2023
f29c8de
test: fix all tests
luizstacio Mar 9, 2023
5de98ee
feat: fix contracts bin
luizstacio Mar 9, 2023
caf5a32
fix: move from import to require and fix path param
luizstacio Mar 9, 2023
32ecf0f
fix: mock path
luizstacio Mar 9, 2023
bf04f7e
fix: bundle of contracts cli
luizstacio Mar 10, 2023
fcdddc9
feat: update way bin are generated to avoid bad dependencie bundling
luizstacio Mar 11, 2023
26edc0c
feat: remove types
luizstacio Mar 11, 2023
99aa58d
feat: add types to ignore folder
luizstacio Mar 11, 2023
d398cc8
Merge branch 'master' into ls/contracts-cli
luizstacio Mar 11, 2023
e63b454
fix: use fuels-contracts locally
luizstacio Mar 14, 2023
11f7cfc
feat: add to cache output folder types on example-contract
luizstacio Mar 14, 2023
965f7e1
feat: add predicates and scripts on fuels-contracts cli
luizstacio Mar 15, 2023
c7445aa
feat: update config file name and add predicates and scripts
luizstacio Mar 15, 2023
9b706ad
revert: example contract
luizstacio Mar 15, 2023
d03bb1e
feat: move cli to fuels
luizstacio Mar 15, 2023
592b22e
feat: move cli to fuels
luizstacio Mar 15, 2023
98d760b
feat: fix typegen script
luizstacio Mar 15, 2023
e0957e4
feat: add lock file
luizstacio Mar 15, 2023
92fe505
feat: ignore types on examples
luizstacio Mar 15, 2023
1812562
fix: changeset
luizstacio Mar 15, 2023
616ec9d
chore: skip test
luizstacio Mar 16, 2023
f3a98f0
test: unskip test
luizstacio Mar 16, 2023
84a4def
Merge branch 'master' into ls/contracts-cli
luizstacio Mar 25, 2023
f76b067
Merge branch 'master' into ls/contracts-cli
Dhaiwat10 Jul 13, 2023
6faae24
replace `forc-bin` with `fuels-forc` and more fixes
Dhaiwat10 Jul 13, 2023
54d1f33
Merge branch 'master' into ls/contracts-cli
Dhaiwat10 Jul 13, 2023
4eec0ba
fix lint errors
Dhaiwat10 Jul 13, 2023
1cee1eb
Merge branch 'ls/contracts-cli' of https://github.com/FuelLabs/fuels-…
Dhaiwat10 Jul 13, 2023
4fb7f08
fix prettier issues
Dhaiwat10 Jul 13, 2023
1bdb365
fix failing tests
Dhaiwat10 Jul 13, 2023
326e254
use relative link instead of a dead absolute url
Dhaiwat10 Jul 13, 2023
c6ef392
Merge branch 'master' into ls/contracts-cli
Dhaiwat10 Jul 17, 2023
fa455a9
fix ts error
Dhaiwat10 Jul 17, 2023
d799032
try local forc when in ci
Dhaiwat10 Jul 17, 2023
5c3c632
Merge branch 'master' into ls/contracts-cli
arboleya Jul 22, 2023
47d32c3
Merge branch 'master' into ls/contracts-cli
Dhaiwat10 Jul 25, 2023
f3e8aca
add `abiPath` to `deployContract` action
Dhaiwat10 Jul 25, 2023
c3dc181
fix import
Dhaiwat10 Jul 25, 2023
740bff0
Merge branch 'master' into ls/contracts-cli
arboleya Jul 25, 2023
1c50026
Merge branch 'master' into ls/contracts-cli
arboleya Jul 26, 2023
97d580f
Merge branch 'master' into ls/contracts-cli
arboleya Jul 28, 2023
102037e
Merge branch 'master' into ls/contracts-cli
arboleya Jul 31, 2023
44afd02
Merge branch 'master' into ls/contracts-cli
arboleya Jul 31, 2023
392f6a2
Updating example contract
arboleya Jul 31, 2023
8ceece9
Adding bin wrappers as a dependency on `fuels`
arboleya Jul 31, 2023
412cb47
Merge branch 'master' into ls/contracts-cli
arboleya Aug 1, 2023
b62dd32
Merge branch 'master' into ls/contracts-cli
arboleya Aug 2, 2023
a4d363c
Removing Forc validations - it is an internal dependency now
arboleya Aug 9, 2023
5e89ee0
Adjusting commands’ description
arboleya Aug 10, 2023
2978112
Reducing indentation levels; aborting method prematurely if necessary
arboleya Aug 16, 2023
b440902
Adding TODO
arboleya Aug 16, 2023
74932c6
DRYing and formatting file
arboleya Aug 16, 2023
897a8bd
Renaming action
arboleya Aug 17, 2023
2850bc0
Start drafting new actions
arboleya Aug 17, 2023
7124f66
Removing unnecessary await of non-promise method
arboleya Aug 23, 2023
73fcce3
Properly configuring Handlebars, evolving `init` action
arboleya Aug 23, 2023
d2b5236
Adding missing `glob` dependency
arboleya Aug 23, 2023
a9169ff
Adding new config prop; improving `dev` action
arboleya Aug 23, 2023
edeb251
Renaming variable
arboleya Aug 23, 2023
c219df2
Creating directory on the fly when necessary
arboleya Aug 23, 2023
7802518
Start trimming event listeners
arboleya Aug 23, 2023
e61eddc
Merge branch 'master' into ls/contracts-cli
arboleya Aug 23, 2023
e5ef677
Running CLI synchronously and moving error logging one level up
arboleya Aug 23, 2023
07f57cc
Suggesting the use of env variables for sensitive data
arboleya Aug 23, 2023
447a415
Reviewing `dependencies` vs `devDependencies`
arboleya Aug 23, 2023
2519ff3
Sorting lines
arboleya Aug 23, 2023
c01fedf
DRY - reusing `DeployContractOptions` type from `@fuel-ts/contract`
arboleya Aug 23, 2023
8cd23a0
Using system binaries conditionally
arboleya Aug 23, 2023
21a3db2
Removing residual package; already deleted in `master`
arboleya Aug 23, 2023
6e6612c
Tyop
arboleya Aug 23, 2023
c1fcd26
Fixing broken import
arboleya Aug 23, 2023
716f5de
Fixing method
arboleya Aug 23, 2023
6a151f3
Rolling back async parsing
arboleya Aug 24, 2023
11da51b
Removing `default` flag from `dev` CLI command
arboleya Aug 24, 2023
f6bcc13
Creating temp dir if it doesn’t exist
arboleya Aug 24, 2023
055bc42
Fixing a couple of tests
arboleya Aug 24, 2023
88b0a1f
Removing unused imports
arboleya Aug 24, 2023
57cb3d5
Fixing a bunch of details that got messed up during this PR’s lifetime
arboleya Aug 24, 2023
e6efc96
Removing deadlinks
arboleya Aug 24, 2023
1184acc
Merge branch 'master' into ls/contracts-cli
arboleya Aug 24, 2023
b350b4a
Merge branch 'master' into ls/contracts-cli
arboleya Aug 25, 2023
0856da3
DRY types, reviewing properties, adding missing configs
arboleya Aug 25, 2023
85b9cb1
Loading type defs in package entry point
arboleya Aug 25, 2023
36f4e38
Fixing a couple broken tests
arboleya Aug 25, 2023
36f9987
Adjusting file watching in `dev` action
arboleya Aug 25, 2023
2bb160d
Formatting
arboleya Aug 25, 2023
921c3fa
Adding `get-port` to the mix
arboleya Aug 25, 2023
3eb922a
Implementing custom params during `fuel-core` initialization
arboleya Aug 25, 2023
2b2f681
Removing idle listeners
arboleya Aug 25, 2023
cb40864
Formatting
arboleya Aug 25, 2023
91dd161
Assembling `providerUrl` dynamically when spinning up fuel node
arboleya Aug 25, 2023
bab986f
Modifying config copy; injecting `providerUrl` dynamically
arboleya Aug 25, 2023
e3f47b6
Standardizing es6 module imports
arboleya Aug 25, 2023
533d34e
Fixing command flags, handling another exception
arboleya Aug 25, 2023
31a2f56
Changing clone strategy, adjusting docs
arboleya Aug 25, 2023
06b804c
Merge branch 'master' into ls/contracts-cli
arboleya Sep 9, 2023
b374cbc
Copying by destructuring instead
arboleya Sep 10, 2023
e6988e0
Properly computing bin absolute path
arboleya Sep 10, 2023
0eeaaa3
Temporarily reducing error validatons
arboleya Sep 10, 2023
cf4dd9a
Merge branch 'ls/contracts-cli' of github.com:fuellabs/fuels-ts into …
arboleya Sep 10, 2023
d672ac5
Lintfix
arboleya Sep 10, 2023
1f2f4be
Merge branch 'master' into ls/contracts-cli
arboleya Sep 11, 2023
59651c9
Lintfix
arboleya Sep 11, 2023
e22948b
Merging with master
arboleya Sep 20, 2023
d0e377a
Making `providerUrl` required in parsed config
arboleya Sep 20, 2023
35d8f1a
Fixing utility helper for accommodating the new Provider signature
arboleya Sep 20, 2023
a27e1de
Updating helper utility usages and fixing broken tests
arboleya Sep 20, 2023
5c04dc2
Fixing test [async] expectation
arboleya Sep 20, 2023
db657cb
Properly resetting env variable
arboleya Sep 20, 2023
66cee78
Fixing residual broken tests
arboleya Sep 20, 2023
08142be
Fixing all remaining broken tests
arboleya Sep 20, 2023
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
Prev Previous commit
Next Next commit
feat: use abi-typegen
luizstacio committed Jan 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 3ae24f0febcde5cd6d368567aec1c323175f4550
1 change: 0 additions & 1 deletion packages/abi-typegen/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.base.json",

"compilerOptions": {
"outDir": "./dist",
"rootDir": "./",
27 changes: 13 additions & 14 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -5,41 +5,40 @@
"description": "Enable developers to build, deploy, generate types and replace contracts id",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"main": "src/index.ts",
"bin": {
"contracts": "./dist/bin.js"
"fuels-contracts": "dist/bin.js"
},
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": "./dist/cli.js"
"./cli": "./dist/cli.js"
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": "./dist/cli.js"
}
"module": "dist/index.mjs"
},
"files": [
"dist/"
],
"scripts": {
"build": "tsup"
"build": "tsup --dts"
},
"dependencies": {
"@ethersproject/bytes": "^5.7.0",
"@fuel-ts/abi-typegen": "workspace:*",
"@fuel-ts/abi-coder": "workspace:*",
"@fuel-ts/contract": "workspace:*",
"@fuel-ts/providers": "workspace:*",
"@fuel-ts/transactions": "workspace:*",
"@fuel-ts/wallet": "workspace:*",
"bundle-require": "^3.1.0",
"commander": "^9.4.1",
"fuels": "workspace:*",
"esbuild": "^0.16.16",
"joycon": "^3.1.1",
"typescript": "^4.8.4",
"yup": "^0.32.11"
5 changes: 3 additions & 2 deletions packages/contracts/src/actions/deployContractBinary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { JsonAbi } from '@fuel-ts/abi-coder';
import { ContractFactory } from '@fuel-ts/contract';
import type { WalletUnlocked } from '@fuel-ts/wallet';
import { readFileSync } from 'fs';
import type { JsonAbi, WalletUnlocked } from 'fuels';
import { ContractFactory } from 'fuels';

import { getABIPath, getBinaryPath } from '../helpers/sway';
import { log } from '../log';
2 changes: 1 addition & 1 deletion packages/contracts/src/actions/getWalletInstance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Wallet } from 'fuels';
import { Wallet } from '@fuel-ts/wallet';

import type { ContractsConfig } from '../types';

3 changes: 2 additions & 1 deletion packages/contracts/src/bin/bin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
import { run } from './cli';

run(process.argv);
run();
75 changes: 23 additions & 52 deletions packages/contracts/src/bin/cli.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,40 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Command } from 'commander';
import { resolve } from 'path';

import { buildContracts } from '../actions/buildContracts';
import { deployContracts } from '../actions/deployContracts';
import { runAll } from '../actions/runAll';
import { buildTypes } from '../actions/typegen/buildTypes';
import { loadConfig } from '../helpers/loader';
import { error } from '../log';
import type { ContractsConfig, Event } from '../types';
import { createAction } from '../helpers/createAction';
import { Commands } from '../types';

const program = new Command('contracts');
export function configureCliOptions(program: Command) {
program.option('-c, --config <path>', 'Root folder where the config file is located', './');

function action<CType extends Commands>(
command: CType,
func: (config: ContractsConfig) => Promise<Extract<Event, { type: CType }>['data']>
) {
return async () => {
const options = program.opts();
const configPath = resolve(process.cwd(), options.config);
const config = await loadConfig(configPath);
try {
const eventData = await func(config);
config.onSuccess?.({
type: command,
path: {
cwd: process.cwd(),
config: configPath,
},
data: eventData as any,
});
} catch (err: any) {
error(err.message ? err.message : err);
config.onFailure?.(err);
process.exit();
}
};
}
program
.command(Commands.build)
.description('Build Sway contracts and generate types')
.action(createAction(program, Commands.build, buildContracts));

program
.name('contracts')
.description('Utility to build, deploy and generate types for Sway Contracts')
.option('-c, --config <path>', 'Root folder where the config file is located', './');
program
.command(Commands.deploy)
.description('Deploy contract to fuel network')
.action(createAction(program, Commands.deploy, deployContracts));

program
.command(Commands.build)
.description('Build Sway contracts and generate types')
.action(action(Commands.build, async (config) => buildContracts(config)));
program
.command(Commands.run)
.description('Build Sway contracts, generate types and deploy contracts to fuel network')
.action(createAction(program, Commands.run, runAll));

program
.command(Commands.deploy)
.description('Deploy contract to fuel network')
.action(action(Commands.deploy, (config) => deployContracts(config)));
program
.command(Commands.types)
.description('Generate contract types')
.action(createAction(program, Commands.types, buildTypes));
}

program
.command(Commands.run)
.description('Build Sway contracts, generate types and deploy contracts to fuel network')
.action(action(Commands.run, (config) => runAll(config)));
export function run(argv: string[] = process.argv) {
const program = new Command('contracts');

program
.command(Commands.types)
.description('Generate contract types')
.action(action(Commands.types, (config) => buildTypes(config)));
configureCliOptions(program);

export function run(argv: string[]) {
program.parse(argv);
}
40 changes: 40 additions & 0 deletions packages/contracts/src/helpers/createAction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Command } from 'commander';
import { resolve } from 'path';

import { error } from '../log';
import type { Commands, ContractsConfig, Event } from '../types';

import { loadConfig } from './loader';

export function createAction<CType extends Commands>(
program: Command,
command: CType,
func: (config: ContractsConfig) => Promise<Extract<Event, { type: CType }>['data']>
) {
return async () => {
try {
const options = program.opts();
const configPath = resolve(process.cwd(), options.config);
const config = await loadConfig(configPath);
try {
const eventData = await func(config);
config.onSuccess?.({
type: command,
path: {
cwd: process.cwd(),
config: configPath,
},
data: eventData as any,
});
} catch (err: any) {
error(err.message ? err.message : err);
config.onFailure?.(err);
process.exit();
}
} catch (err: any) {
error(err.message ? err.message : err);
process.exit();
}
};
}
7 changes: 1 addition & 6 deletions packages/contracts/src/helpers/loader.ts
Original file line number Diff line number Diff line change
@@ -45,10 +45,5 @@ export async function loadConfig(cwd: string): Promise<ContractsConfig> {
return normalizeConfigPaths(cwd, config);
}

return {
types: {
output: '',
},
contracts: [],
};
throw new Error('Config file not found!');
}
4 changes: 3 additions & 1 deletion packages/contracts/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { BytesLike, CreateTransactionRequestLike, StorageSlot } from 'fuels';
import type { BytesLike } from '@ethersproject/bytes';
import type { CreateTransactionRequestLike } from '@fuel-ts/providers';
import type { StorageSlot } from '@fuel-ts/transactions';

export type DeployContractOptions = {
salt?: BytesLike;
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable global-require */
import { Provider } from '@fuel-ts/providers';
import type { WalletUnlocked } from '@fuel-ts/wallet';
import { TestUtils } from '@fuel-ts/wallet';
import { execSync } from 'child_process';
import { existsSync, readFileSync } from 'fs';
import type { WalletUnlocked } from 'fuels';
import { Provider, TestUtils } from 'fuels';
import { existsSync } from 'fs';
import { join } from 'path';
import rimraf from 'rimraf';

@@ -48,19 +49,4 @@ describe('Contracts Scripts', () => {
expect(contractsOutput).toHaveProperty('CONTRACT_FOO');
expect(contractsOutput).toHaveProperty('CONTRACT_BAR');
});

test('the generated types and contracts ids should work', async () => {
// We need to use require here because the generated files are not available
// before the previous test is finished
const { CONTRACT_FOO, CONTRACT_BAR } = require('./contracts.json');
// eslint-disable-next-line @typescript-eslint/naming-convention, import/extensions
const { FooAbi__factory, BarAbi__factory } = require('./types');
const foo = FooAbi__factory.connect(CONTRACT_FOO, wallet);
const bar = BarAbi__factory.connect(CONTRACT_BAR, wallet);

const { value: fooResult } = await foo.functions.foo().get();
expect(fooResult.toNumber()).toEqual(12345);
const { value: batResult } = await bar.functions.bar().get();
expect(batResult).toEqual('0x0000000000000000000000000000000000000000000000000000000000000100');
});
});
2 changes: 1 addition & 1 deletion packages/contracts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -5,5 +5,5 @@
"rootDir": "./",
"baseUrl": "./"
},
"include": ["src", "test"]
"include": ["src", "test-project"]
}
5 changes: 0 additions & 5 deletions packages/contracts/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -6,13 +6,8 @@ export default defineConfig((options) => ({
cli: 'src/bin/cli.ts',
bin: 'src/bin/bin.ts',
},
noExternal: [],
format: ['cjs', 'esm', 'iife'],
splitting: false,
sourcemap: true,
clean: false,
minify: !options.watch,
loader: {
'.hbs': 'text',
},
}));
1 change: 1 addition & 0 deletions packages/fuels/package.json
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@
"@fuel-ts/wallet": "workspace:*",
"@fuel-ts/wallet-manager": "workspace:*",
"@fuel-ts/wordlists": "workspace:*",
"@fuel-ts/contracts": "workspace:*",
"commander": "^9.4.1"
},
"scripts": {
8 changes: 6 additions & 2 deletions packages/fuels/src/cli.test.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ describe('cli.js', () => {
const version = jest.spyOn(Command.prototype, 'version');
const command = jest.spyOn(Command.prototype, 'command');
const description = jest.spyOn(Command.prototype, 'description');
const action = jest.spyOn(Command.prototype, 'action');
const parse = jest.spyOn(Command.prototype, 'parse').mockImplementation();

// executing
@@ -30,7 +29,12 @@ describe('cli.js', () => {
'generate typescript from contract abi json files'
);

expect(action).toHaveBeenCalledTimes(2);
expect(command).toHaveBeenNthCalledWith(3, 'contracts');
expect(description).toHaveBeenNthCalledWith(
3,
'utility to build, deploy and generate types for Sway Contracts'
);

expect(parse).toHaveBeenCalledTimes(1);
expect(parse).toHaveBeenCalledWith(argv);
});
8 changes: 7 additions & 1 deletion packages/fuels/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { configureCliOptions as configureTypegenCliOptions } from '@fuel-ts/abi-typegen/cli';
import { configureCliOptions as configureContractsCliOptions } from '@fuel-ts/contracts/cli';
import { versions } from '@fuel-ts/versions';
import { run as runVersions } from '@fuel-ts/versions/cli';
import { Command } from 'commander';
@@ -19,9 +20,14 @@ export function run(argv: string[]) {
const typegen = program
.command('typegen')
.description(`generate typescript from contract abi json files`);

configureTypegenCliOptions(typegen);

// routing `contracts` sub-command
const contracts = program
.command('contracts')
.description('utility to build, deploy and generate types for Sway Contracts');
configureContractsCliOptions(contracts);

// vroom vroom
program.parse(argv);
}
283 changes: 280 additions & 3 deletions pnpm-lock.yaml

Large diffs are not rendered by default.