Skip to content

Commit 02ac98e

Browse files
authored
feat: adding new versions package (#616)
1 parent 3de5ee5 commit 02ac98e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1384
-92
lines changed

.changeset/tame-bugs-act.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@fuel-ts/abi-coder": minor
3+
"@fuel-ts/address": minor
4+
"@fuel-ts/contract": minor
5+
"forc-bin": minor
6+
"fuels": minor
7+
"@fuel-ts/predicate": minor
8+
"@fuel-ts/providers": minor
9+
"@fuel-ts/versions": minor
10+
---
11+
12+
Adding new `versions` package for exposing and managing compatibility versions of Fuel toolchain components

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
auto-install-peers=true
2+
enable-pre-post-scripts=true

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- [Dependencies](#dependencies)
2222
- [Using Generated Types](https://fuellabs.github.io/fuels-ts/guide/types/using-generated-types)
2323
- [Deploying Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/deploying-contracts)
24+
- [CLI](/#CLI)
2425
- [Contributing](./docs/CONTRIBUTING.md)
2526
- [License](#license)
2627

@@ -72,6 +73,24 @@ console.log(Wallet.generate());
7273
console.log(new Wallet("0x0000...0000"));
7374
```
7475

76+
## CLI
77+
78+
Fuels include some utility commnands via built-in CLI tool.
79+
80+
```console
81+
$ yarn add fuels
82+
$ yarn exec fuels -h
83+
Usage: fuels [options] [command]
84+
85+
Options:
86+
-V, --version output the version number
87+
-h, --help display help for command
88+
89+
Commands:
90+
versions checks for version incompatibilities
91+
help [command] display help for command
92+
```
93+
7594
## License
7695

7796
The primary license for this repo is `Apache 2.0`, see [`LICENSE`](./LICENSE).

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"name": "fuels-ts",
3-
"version": "0.7.0",
3+
"version": "0.0.0",
44
"description": "Fuel TS SDK",
55
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
6-
"main": "index.js",
76
"private": true,
87
"engines": {
98
"node": ">=14.19.0",

packages/abi-coder/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
"@ethersproject/sha2": "^5.7.0",
3333
"@ethersproject/strings": "^5.7.0",
3434
"@fuel-ts/math": "workspace:*",
35+
"@fuel-ts/versions": "workspace:*",
3536
"type-fest": "^3.1.0"
3637
},
3738
"scripts": {
38-
"build": "tsup --dts --env.BUILD_VERSION $BUILD_VERSION"
39+
"build": "tsup --dts"
3940
}
4041
}

packages/abi-coder/src/abi-coder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { BytesLike } from '@ethersproject/bytes';
33
import { concat, arrayify } from '@ethersproject/bytes';
44
import { Logger } from '@ethersproject/logger';
5+
import { versions } from '@fuel-ts/versions';
56

67
import type { DecodedValue, InputValue } from './coders/abstract-coder';
78
import type Coder from './coders/abstract-coder';
@@ -30,7 +31,7 @@ import {
3031
import type { JsonAbiFragmentType } from './json-abi';
3132
import { filterEmptyParams, getVectorAdjustments, hasOptionTypes } from './utilities';
3233

33-
const logger = new Logger(process.env.BUILD_VERSION || '~');
34+
const logger = new Logger(versions.FUELS);
3435

3536
export default class AbiCoder {
3637
constructor() {

packages/abi-coder/src/coders/abstract-coder.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { BytesLike } from '@ethersproject/bytes';
22
import { Logger } from '@ethersproject/logger';
33
import type { BN } from '@fuel-ts/math';
4+
import { versions } from '@fuel-ts/versions';
45

5-
const logger = new Logger(process.env.BUILD_VERSION || '~');
6+
const logger = new Logger(versions.FUELS);
67

78
type Primitive = string | number | boolean;
89

packages/abi-coder/src/interface.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { arrayify, concat, hexlify } from '@ethersproject/bytes';
44
import { Logger } from '@ethersproject/logger';
55
import { sha256 } from '@ethersproject/sha2';
66
import { toUtf8Bytes } from '@ethersproject/strings';
7+
import { versions } from '@fuel-ts/versions';
78

89
import AbiCoder from './abi-coder';
910
import type { InputValue } from './coders/abstract-coder';
@@ -20,7 +21,7 @@ import type {
2021
import { isFlatJsonAbi, ABI, isReferenceType } from './json-abi';
2122
import { filterEmptyParams } from './utilities';
2223

23-
const logger = new Logger(process.env.BUILD_VERSION || '~');
24+
const logger = new Logger(versions.FUELS);
2425

2526
const coerceFragments = (value: ReadonlyArray<JsonAbiFragment>): Array<Fragment> => {
2627
const fragments: Array<Fragment> = [];

packages/address/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@fuel-ts/constants": "workspace:*",
2828
"@fuel-ts/interfaces": "workspace:*",
2929
"@fuel-ts/keystore": "workspace:*",
30+
"@fuel-ts/versions": "workspace:*",
3031
"@ethersproject/bytes": "^5.7.0",
3132
"@ethersproject/logger": "^5.7.0",
3233
"@ethersproject/sha2": "^5.7.0",

packages/address/src/address.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Logger } from '@ethersproject/logger';
22
import { sha256 } from '@ethersproject/sha2';
33
import { AbstractAddress } from '@fuel-ts/interfaces';
44
import type { Bech32Address, B256Address } from '@fuel-ts/interfaces';
5+
import { versions } from '@fuel-ts/versions';
56

67
import {
78
normalizeBech32,
@@ -12,7 +13,7 @@ import {
1213
getRandomB256,
1314
} from './utils';
1415

15-
const logger = new Logger(process.env.BUILD_VERSION || '~');
16+
const logger = new Logger(versions.FUELS);
1617

1718
export default class Address extends AbstractAddress {
1819
readonly bech32Address: Bech32Address;

0 commit comments

Comments
 (0)