From fc804927227509a0980160b4b9396cf78ffaf8c3 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:00:30 -0300 Subject: [PATCH 01/41] Adding new workspace for tooling stuff --- pnpm-workspace.yaml | 1 + tooling/tsup/index.js | 47 +++++++++++++++++++++++++++++++++++++++ tooling/tsup/package.json | 5 +++++ 3 files changed, 53 insertions(+) create mode 100644 tooling/tsup/index.js create mode 100644 tooling/tsup/package.json diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0e5a0737c3d..af315f4abc7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - "packages/*" - "apps/*" + - "tooling/*" diff --git a/tooling/tsup/index.js b/tooling/tsup/index.js new file mode 100644 index 00000000000..45e27d96ab7 --- /dev/null +++ b/tooling/tsup/index.js @@ -0,0 +1,47 @@ +/** + * [NOTE.1] + * All `primary` DTS files must import `secondary` ones + * for all packages witgh multiple entry-points; which is done + * via the `dts.banner` property that you can see in use below. + * + * [NOTE.2] + * Due to the limitations of TSUP config files, this + * approach was used. It basically exports ready-to-go + * configurations for most used configs in the monorepo. + */ + +/** @type { import('tsup').Options } */ +exports.index = { + clean: true, + dts: true, + entry: ['src/index.ts'], + format: ['cjs', 'esm', 'iife'], + minify: false, + sourcemap: true, + splitting: false, +}; + +/** @type { import('tsup').Options[] } */ +exports.indexAndConfig = [ + { + ...exports.index, + entry: { index: 'src/index.ts' }, + dts: { banner: `import './configs';` }, + }, + { + ...exports.index, + entry: { configs: 'src/configs.ts' }, + }, +]; + +/** @type { import('tsup').Options[] } */ +exports.indexBinAndCli = [ + { + ...exports.index, + dts: { banner: `import './bin'; import './cli';` }, + }, + { + ...exports.index, + entry: { bin: 'src/bin.ts', cli: 'src/cli.ts' }, + }, +]; diff --git a/tooling/tsup/package.json b/tooling/tsup/package.json new file mode 100644 index 00000000000..ca8ac9f4574 --- /dev/null +++ b/tooling/tsup/package.json @@ -0,0 +1,5 @@ +{ + "private": true, + "name": "@tooling/tsup", + "main": "index.js" +} From d43948665ecac45e2722d8d2f04a0d33f086d0e9 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:03:23 -0300 Subject: [PATCH 02/41] Re-configuring `tsup.config.ts` and `package.json` for all packages --- packages/abi-coder/package.json | 25 +++++------ packages/abi-coder/tsup.config.ts | 12 +----- packages/abi-typegen/package.json | 58 ++++++++++---------------- packages/abi-typegen/tsup.config.ts | 48 ++++++++++++++------- packages/address/package.json | 49 ++++++++++------------ packages/address/tsup.config.ts | 15 +------ packages/contract/package.json | 23 +++++----- packages/contract/tsup.config.ts | 12 +----- packages/forc-bin/package.json | 5 ++- packages/forc-bin/tsup.config.ts | 13 ++---- packages/fuels/package.json | 51 +++++++++------------- packages/fuels/tsup.config.ts | 41 +++++++++++------- packages/hasher/package.json | 25 +++++------ packages/hasher/tsup.config.ts | 12 +----- packages/hdwallet/package.json | 25 ++++++----- packages/hdwallet/tsup.config.ts | 12 +----- packages/interfaces/package.json | 27 ++++++------ packages/interfaces/tsup.config.ts | 12 +----- packages/keystore/package.json | 25 ++++++----- packages/keystore/tsup.config.ts | 12 +----- packages/math/package.json | 39 ++++++++--------- packages/math/tsup.config.ts | 15 +------ packages/merkle-shared/package.json | 25 ++++++----- packages/merkle-shared/tsup.config.ts | 12 +----- packages/merkle/package.json | 25 ++++++----- packages/merkle/tsup.config.ts | 12 +----- packages/merklesum/package.json | 25 ++++++----- packages/merklesum/tsup.config.ts | 12 +----- packages/mnemonic/package.json | 25 ++++++----- packages/mnemonic/tsup.config.ts | 12 +----- packages/predicate/package.json | 29 ++++++------- packages/predicate/tsup.config.ts | 12 +----- packages/program/package.json | 35 +++++++--------- packages/program/tsup.config.ts | 15 +------ packages/providers/package.json | 25 +++++------ packages/providers/tsup.config.ts | 12 +----- packages/script/package.json | 27 ++++++------ packages/script/tsup.config.ts | 12 +----- packages/signer/package.json | 25 +++++------ packages/signer/tsup.config.ts | 12 +----- packages/sparsemerkle/package.json | 25 ++++++----- packages/sparsemerkle/tsup.config.ts | 12 +----- packages/transactions/package.json | 37 +++++++--------- packages/transactions/tsup.config.ts | 38 +++++++++++------ packages/versions/package.json | 45 ++++++++------------ packages/versions/tsup.config.ts | 16 +------ packages/wallet-manager/package.json | 27 ++++++------ packages/wallet-manager/tsup.config.ts | 12 +----- packages/wallet/package.json | 51 ++++++++++------------ packages/wallet/tsup.config.ts | 42 ++++++++++++------- packages/wordlists/package.json | 25 ++++++----- packages/wordlists/tsup.config.ts | 12 +----- 52 files changed, 511 insertions(+), 739 deletions(-) diff --git a/packages/abi-coder/package.json b/packages/abi-coder/package.json index 61a143846ed..7615e6a364a 100644 --- a/packages/abi-coder/package.json +++ b/packages/abi-coder/package.json @@ -4,24 +4,23 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/abi": "^5.7.0", @@ -34,9 +33,7 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/versions": "workspace:*", + "@tooling/tsup": "workspace:*", "type-fest": "^3.1.0" - }, - "scripts": { - "build": "tsup --dts" } } diff --git a/packages/abi-coder/tsup.config.ts b/packages/abi-coder/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/abi-coder/tsup.config.ts +++ b/packages/abi-coder/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/abi-typegen/package.json b/packages/abi-typegen/package.json index d19643b19b6..a3e4a160a56 100644 --- a/packages/abi-typegen/package.json +++ b/packages/abi-typegen/package.json @@ -4,12 +4,24 @@ "description": "Generates Typescript definitions from Sway ABI Json files", "author": "Fuel Labs (https://fuel.network/)", "bin": { - "fuels-typegen": "dist/bin.global.js" + "fuels-typegen": "dist/bin.js" }, "exports": { - ".": "./src/index.ts", - "./cli": "./src/cli.ts", - "./runTypegen": "./src/runTypegen.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./cli": { + "require": "./dist/cli.js", + "import": "./dist/cli.mjs", + "types": "./dist/cli.d.ts" + }, + "./runTypegen": { + "require": "./dist/runTypegen.js", + "import": "./dist/runTypegen.mjs", + "types": "./dist/runTypegen.d.ts" + } }, "typesVersions": { "*": { @@ -25,11 +37,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "bin": { - "fuels-typegen": "dist/bin.js" - }, "typesVersions": { "*": { "index.d.ts": [ @@ -42,28 +49,16 @@ "./dist/runTypegen.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./cli": { - "import": "./dist/cli.mjs", - "require": "./dist/cli.js", - "types": "./dist/cli.d.ts" - }, - "./runTypegen": { - "import": "./dist/runTypegen.mjs", - "require": "./dist/runTypegen.js", - "types": "./dist/runTypegen.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch", + "pretest": "pnpm forc build -p test/fixtures/forc-projects" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -77,21 +72,12 @@ "rimraf": "^3.0.2" }, "devDependencies": { + "@tooling/tsup": "workspace:*", "@types/glob": "^8.0.0", "@types/lodash.uniq": "^4.5.7", "@types/lodash.upperfirst": "^4.3.7", "@types/mkdirp": "^1.0.2", "@types/rimraf": "^3.0.2", "forc-bin": "workspace:*" - }, - "scripts": { - "build": "tsup --dts", - "build:watch": "tsup --dts --watch", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts", - "inject:cli": "echo \"import './cli.d.ts';\" >> ./dist/index.d.ts", - "inject:runTypegen": "echo \"import './runTypegen.d.ts';\" >> ./dist/index.d.ts", - "pretest": "pnpm forc build -p test/fixtures/forc-projects" } } diff --git a/packages/abi-typegen/tsup.config.ts b/packages/abi-typegen/tsup.config.ts index 1f1579a48c9..b6f350860a0 100644 --- a/packages/abi-typegen/tsup.config.ts +++ b/packages/abi-typegen/tsup.config.ts @@ -1,19 +1,37 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; +import type { Options } from 'tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - cli: 'src/cli.ts', - bin: 'src/bin.ts', - runTypegen: 'src/runTypegen.ts', - }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, +const primary = { + index: 'src/index.ts', +}; + +const secondaries = { + cli: 'src/cli.ts', + bin: 'src/bin.ts', + runTypegen: 'src/runTypegen.ts', +}; + +const commonOptions: Options = { + ...index, loader: { '.hbs': 'text', }, -})); +}; + +const configs: Options[] = [ + { + ...commonOptions, + entry: { ...primary }, + dts: { + banner: Object.keys(secondaries) + .map((key) => `import './${key}';`) + .join('\n'), + }, + }, + { + ...commonOptions, + entry: { ...secondaries }, + }, +]; + +export default configs; diff --git a/packages/address/package.json b/packages/address/package.json index b32139fa936..ae925af068d 100644 --- a/packages/address/package.json +++ b/packages/address/package.json @@ -4,13 +4,21 @@ "description": "Utilities for encoding and decoding addresses", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts", - "./configs": "./src/configs.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./configs": { + "require": "./dist/configs.js", + "import": "./dist/configs.mjs", + "types": "./dist/configs.d.ts" + } }, "typesVersions": { "*": { - "*": [ - "./src/*" + "index": [ + "./src/index.ts" ], "configs": [ "./src/configs.ts" @@ -18,8 +26,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -29,40 +35,27 @@ "./dist/configs.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./configs": { - "import": "./dist/configs.mjs", - "require": "./dist/configs.js", - "types": "./dist/configs.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { - "@fuel-ts/interfaces": "workspace:*", - "@fuel-ts/keystore": "workspace:*", - "@fuel-ts/versions": "workspace:*", "@ethersproject/bytes": "^5.7.0", "@ethersproject/logger": "^5.7.0", "@ethersproject/sha2": "^5.7.0", + "@fuel-ts/interfaces": "workspace:*", + "@fuel-ts/keystore": "workspace:*", + "@fuel-ts/versions": "workspace:*", "bech32": "^2.0.0" }, "devDependencies": { - "@fuel-ts/testcases": "workspace:*" - }, - "scripts": { - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts" + "@fuel-ts/testcases": "workspace:*", + "@tooling/tsup": "workspace:*" } } diff --git a/packages/address/tsup.config.ts b/packages/address/tsup.config.ts index 156f2219ca0..6d0e60cc618 100644 --- a/packages/address/tsup.config.ts +++ b/packages/address/tsup.config.ts @@ -1,14 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { indexAndConfig } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - configs: 'src/configs.ts', - }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default indexAndConfig; diff --git a/packages/contract/package.json b/packages/contract/package.json index fb211d530f7..408eb631188 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -4,26 +4,22 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], "scripts": { - "build": "tsup --dts" + "build": "tsup", + "build:watch": "tsup --watch" }, "license": "Apache-2.0", "dependencies": { @@ -41,6 +37,7 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "forc-bin": "workspace:*" + "forc-bin": "workspace:*", + "@tooling/tsup": "workspace:*" } } diff --git a/packages/contract/tsup.config.ts b/packages/contract/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/contract/tsup.config.ts +++ b/packages/contract/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/forc-bin/package.json b/packages/forc-bin/package.json index eae39403fef..7254f2f7596 100644 --- a/packages/forc-bin/package.json +++ b/packages/forc-bin/package.json @@ -11,7 +11,7 @@ ], "license": "Apache-2.0", "scripts": { - "preinstall": "tsup --dts", + "preinstall": "tsup", "install": "node ./dist/install.js", "update": "node ./dist/update.js && node ./dist/install.js" }, @@ -24,5 +24,8 @@ "dependencies": { "node-fetch": "^2.6.7", "shelljs": "^0.8.5" + }, + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/forc-bin/tsup.config.ts b/packages/forc-bin/tsup.config.ts index 18b639af945..b0dbb6f45b3 100644 --- a/packages/forc-bin/tsup.config.ts +++ b/packages/forc-bin/tsup.config.ts @@ -1,11 +1,6 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ +export default { + ...index, entry: ['src/index.ts', 'src/cli.ts', 'src/install.ts', 'src/update.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +}; diff --git a/packages/fuels/package.json b/packages/fuels/package.json index 8e3c3377d09..a377d822e95 100644 --- a/packages/fuels/package.json +++ b/packages/fuels/package.json @@ -4,12 +4,19 @@ "description": "Fuel TS SDK", "author": "Fuel Labs (https://fuel.network/)", "bin": { - "fuels": "dist/bin.global.js" + "fuels": "dist/bin.js" }, "exports": { - ".": "./src/index.ts", - "./cli": "./src/cli.ts", - "./runTypegen": "./src/runTypegen.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./cli": { + "require": "./dist/cli.js", + "import": "./dist/cli.mjs", + "types": "./dist/cli.d.ts" + } }, "typesVersions": { "*": { @@ -22,11 +29,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "bin": { - "fuels": "dist/bin.js" - }, "typesVersions": { "*": { "index.d.ts": [ @@ -36,23 +38,16 @@ "./dist/cli.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./cli": { - "import": "./dist/cli.mjs", - "require": "./dist/cli.js", - "types": "./dist/cli.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch", + "prepublishOnly": "cp ../../README.md ./README.md" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -65,8 +60,8 @@ "@fuel-ts/interfaces": "workspace:*", "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", - "@fuel-ts/merkle": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*", + "@fuel-ts/merkle": "workspace:*", "@fuel-ts/merklesum": "workspace:*", "@fuel-ts/mnemonic": "workspace:*", "@fuel-ts/predicate": "workspace:*", @@ -78,18 +73,12 @@ "@fuel-ts/testcases": "workspace:*", "@fuel-ts/transactions": "workspace:*", "@fuel-ts/versions": "workspace:*", - "@fuel-ts/wallet": "workspace:*", "@fuel-ts/wallet-manager": "workspace:*", + "@fuel-ts/wallet": "workspace:*", "@fuel-ts/wordlists": "workspace:*", "commander": "^9.4.1" }, - "scripts": { - "build": "tsup --dts", - "build:watch": "tsup --dts --watch", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts", - "inject:cli": "echo \"import './cli.d.ts';\" >> ./dist/index.d.ts", - "prepublishOnly": "cp ../../README.md ./README.md" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/fuels/tsup.config.ts b/packages/fuels/tsup.config.ts index 2ee63b12fa2..96eaeeeafa3 100644 --- a/packages/fuels/tsup.config.ts +++ b/packages/fuels/tsup.config.ts @@ -1,18 +1,29 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; +import type { Options } from 'tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - cli: 'src/cli.ts', - bin: 'src/bin.ts', +const primary = { + index: 'src/index.ts', +}; + +const secondaries = { + bin: 'src/bin.ts', + cli: 'src/cli.ts', +}; + +const configs: Options[] = [ + { + ...index, + entry: { ...primary }, + dts: { + banner: Object.keys(secondaries) + .map((key) => `import './${key}';`) + .join('\n'), + }, }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, - loader: { - '.hbs': 'text', + { + ...index, + entry: { ...secondaries }, }, -})); +]; + +export default configs; diff --git a/packages/hasher/package.json b/packages/hasher/package.json index 0f442f55ece..0b6cbd7a6f5 100644 --- a/packages/hasher/package.json +++ b/packages/hasher/package.json @@ -4,24 +4,23 @@ "description": "Sha256 hash utility for Fuel", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -35,9 +34,7 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", + "@tooling/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7" - }, - "scripts": { - "build": "tsup --dts" } } diff --git a/packages/hasher/tsup.config.ts b/packages/hasher/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/hasher/tsup.config.ts +++ b/packages/hasher/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/hdwallet/package.json b/packages/hdwallet/package.json index 9cd80f4e93d..fc897fa6f7b 100644 --- a/packages/hdwallet/package.json +++ b/packages/hdwallet/package.json @@ -4,24 +4,23 @@ "description": "The Hierarchal Desterministic (HD) Wallet", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/basex": "^5.7.0", @@ -31,7 +30,7 @@ "@fuel-ts/mnemonic": "workspace:*", "@fuel-ts/signer": "workspace:*" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/hdwallet/tsup.config.ts b/packages/hdwallet/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/hdwallet/tsup.config.ts +++ b/packages/hdwallet/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/interfaces/package.json b/packages/interfaces/package.json index ef1d7c635ce..e46006440d1 100644 --- a/packages/interfaces/package.json +++ b/packages/interfaces/package.json @@ -1,30 +1,29 @@ { "name": "@fuel-ts/interfaces", "version": "0.41.0", - "description": "", + "description": "A couple common shared interfaces", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": {}, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/interfaces/tsup.config.ts b/packages/interfaces/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/interfaces/tsup.config.ts +++ b/packages/interfaces/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/keystore/package.json b/packages/keystore/package.json index e2999dcf6a5..5c259cf8c31 100644 --- a/packages/keystore/package.json +++ b/packages/keystore/package.json @@ -4,30 +4,29 @@ "description": "Utilities for encrypting and decrypting data", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/pbkdf2": "^5.7.0" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/keystore/tsup.config.ts b/packages/keystore/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/keystore/tsup.config.ts +++ b/packages/keystore/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/math/package.json b/packages/math/package.json index acdb9cc130a..c2e752fdcbe 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,11 +1,19 @@ { "name": "@fuel-ts/math", "version": "0.41.0", - "description": "", + "description": "Math utilities", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts", - "./configs": "./src/configs.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./configs": { + "require": "./dist/configs.js", + "import": "./dist/configs.mjs", + "types": "./dist/configs.d.ts" + } }, "typesVersions": { "*": { @@ -18,8 +26,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -29,32 +35,21 @@ "./dist/configs.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./configs": { - "import": "./dist/configs.mjs", - "require": "./dist/configs.js", - "types": "./dist/configs.d.ts" - } } }, "files": [ "dist" ], - "license": "Apache-2.0", "scripts": { - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts" + "build": "tsup", + "build:watch": "tsup --watch" }, + "license": "Apache-2.0", "dependencies": { "@types/bn.js": "^5.1.1", "bn.js": "^5.2.1" + }, + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/math/tsup.config.ts b/packages/math/tsup.config.ts index 156f2219ca0..6d0e60cc618 100644 --- a/packages/math/tsup.config.ts +++ b/packages/math/tsup.config.ts @@ -1,14 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { indexAndConfig } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - configs: 'src/configs.ts', - }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default indexAndConfig; diff --git a/packages/merkle-shared/package.json b/packages/merkle-shared/package.json index fe1596fb03c..5420284f4dc 100644 --- a/packages/merkle-shared/package.json +++ b/packages/merkle-shared/package.json @@ -4,30 +4,29 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/sha2": "^5.7.0" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/merkle-shared/tsup.config.ts b/packages/merkle-shared/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/merkle-shared/tsup.config.ts +++ b/packages/merkle-shared/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/merkle/package.json b/packages/merkle/package.json index 0fc0e0ddc87..52391b0012c 100644 --- a/packages/merkle/package.json +++ b/packages/merkle/package.json @@ -4,30 +4,29 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/merkle/tsup.config.ts b/packages/merkle/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/merkle/tsup.config.ts +++ b/packages/merkle/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/merklesum/package.json b/packages/merklesum/package.json index 25766dba109..94f165bcee9 100644 --- a/packages/merklesum/package.json +++ b/packages/merklesum/package.json @@ -4,30 +4,29 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/merklesum/tsup.config.ts b/packages/merklesum/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/merklesum/tsup.config.ts +++ b/packages/merklesum/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/mnemonic/package.json b/packages/mnemonic/package.json index f6fee673c4b..73c414b1e93 100644 --- a/packages/mnemonic/package.json +++ b/packages/mnemonic/package.json @@ -4,24 +4,23 @@ "description": "Mnemonic implementation from BIP39", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/basex": "^5.7.0", @@ -31,7 +30,7 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/wordlists": "workspace:*" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/mnemonic/tsup.config.ts b/packages/mnemonic/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/mnemonic/tsup.config.ts +++ b/packages/mnemonic/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/predicate/package.json b/packages/predicate/package.json index 99af75ee3b0..15d168e0801 100644 --- a/packages/predicate/package.json +++ b/packages/predicate/package.json @@ -4,26 +4,22 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], "scripts": { - "build": "tsup --dts" + "build": "tsup", + "build:watch": "tsup --watch" }, "license": "Apache-2.0", "dependencies": { @@ -32,13 +28,14 @@ "@fuel-ts/abi-coder": "workspace:*", "@fuel-ts/address": "workspace:*", "@fuel-ts/interfaces": "workspace:*", - "@fuel-ts/versions": "workspace:*", - "@fuel-ts/wallet": "workspace:*", + "@fuel-ts/merkle": "workspace:*", "@fuel-ts/providers": "workspace:*", "@fuel-ts/transactions": "workspace:*", - "@fuel-ts/merkle": "workspace:*" + "@fuel-ts/versions": "workspace:*", + "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@fuel-ts/math": "workspace:*" + "@fuel-ts/math": "workspace:*", + "@tooling/tsup": "workspace:*" } } diff --git a/packages/predicate/tsup.config.ts b/packages/predicate/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/predicate/tsup.config.ts +++ b/packages/predicate/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/program/package.json b/packages/program/package.json index fc6d2eb8ec3..c835a8ec279 100644 --- a/packages/program/package.json +++ b/packages/program/package.json @@ -4,8 +4,16 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts", - "./configs": "./src/configs.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./configs": { + "require": "./dist/configs.js", + "import": "./dist/configs.mjs", + "types": "./dist/configs.d.ts" + } }, "typesVersions": { "*": { @@ -18,8 +26,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -29,28 +35,14 @@ "./dist/configs.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./configs": { - "import": "./dist/configs.mjs", - "require": "./dist/configs.js", - "types": "./dist/configs.d.ts" - } } }, "files": [ "dist" ], "scripts": { - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts" + "build": "tsup", + "build:watch": "tsup --watch" }, "license": "Apache-2.0", "dependencies": { @@ -58,14 +50,15 @@ "@ethersproject/logger": "^5.7.0", "@fuel-ts/abi-coder": "workspace:*", "@fuel-ts/address": "workspace:*", - "@fuel-ts/math": "workspace:*", "@fuel-ts/interfaces": "workspace:*", + "@fuel-ts/math": "workspace:*", "@fuel-ts/providers": "workspace:*", "@fuel-ts/transactions": "workspace:*", "@fuel-ts/versions": "workspace:*", "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { + "@tooling/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/program/tsup.config.ts b/packages/program/tsup.config.ts index 156f2219ca0..6d0e60cc618 100644 --- a/packages/program/tsup.config.ts +++ b/packages/program/tsup.config.ts @@ -1,14 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { indexAndConfig } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - configs: 'src/configs.ts', - }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default indexAndConfig; diff --git a/packages/providers/package.json b/packages/providers/package.json index 19493721630..25131fc13ca 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -4,20 +4,15 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" @@ -26,7 +21,8 @@ "update-schema": "get-graphql-schema http://localhost:4000/graphql > fuel-core-schema.graphql && prettier --write fuel-core-schema.graphql", "build-operations": "pnpm graphql-codegen", "prebuild": "pnpm build-operations", - "build": "tsup --dts" + "build": "tsup", + "build:watch": "tsup --watch" }, "license": "Apache-2.0", "dependencies": { @@ -39,16 +35,17 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/transactions": "workspace:*", - "graphql": "^16.6.0", "graphql-request": "^5.0.0", "graphql-tag": "^2.12.6", + "graphql": "^16.6.0", "lodash.clonedeep": "^4.5.0" }, "devDependencies": { "@graphql-codegen/cli": "^2.13.7", - "@graphql-codegen/typescript": "^2.8.0", "@graphql-codegen/typescript-graphql-request": "^4.5.7", "@graphql-codegen/typescript-operations": "^2.5.5", + "@graphql-codegen/typescript": "^2.8.0", + "@tooling/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7", "get-graphql-schema": "^2.1.2", "typescript": "^4.8.4" diff --git a/packages/providers/tsup.config.ts b/packages/providers/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/providers/tsup.config.ts +++ b/packages/providers/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/script/package.json b/packages/script/package.json index 8ba0ac98c08..1b8a9d5ff1b 100644 --- a/packages/script/package.json +++ b/packages/script/package.json @@ -4,20 +4,15 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" @@ -25,22 +20,24 @@ "license": "Apache-2.0", "scripts": { "prebuild": "pnpm build-forc-projects", - "build": "tsup --dts", + "build": "tsup", + "build:watch": "tsup --watch", "build-forc-projects": "./scripts/build-forc-projects.sh" }, "dependencies": { - "@fuel-ts/abi-typegen": "workspace:*", "@ethersproject/bytes": "^5.7.0", "@fuel-ts/abi-coder": "workspace:*", + "@fuel-ts/abi-typegen": "workspace:*", + "@fuel-ts/address": "workspace:*", "@fuel-ts/interfaces": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/program": "workspace:*", "@fuel-ts/providers": "workspace:*", - "@fuel-ts/wallet": "workspace:*", "@fuel-ts/transactions": "workspace:*", - "@fuel-ts/address": "workspace:*" + "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { + "@tooling/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/script/tsup.config.ts b/packages/script/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/script/tsup.config.ts +++ b/packages/script/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/signer/package.json b/packages/signer/package.json index d83704a8abe..76c28776a68 100644 --- a/packages/signer/package.json +++ b/packages/signer/package.json @@ -4,24 +4,23 @@ "description": "Secp256k1 signer for the Fuel Network", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -34,9 +33,7 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", + "@tooling/tsup": "workspace:*", "@types/elliptic": "^6.4.14" - }, - "scripts": { - "build": "tsup --dts" } } diff --git a/packages/signer/tsup.config.ts b/packages/signer/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/signer/tsup.config.ts +++ b/packages/signer/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/sparsemerkle/package.json b/packages/sparsemerkle/package.json index 15ff4dd9583..f8cb24df485 100644 --- a/packages/sparsemerkle/package.json +++ b/packages/sparsemerkle/package.json @@ -4,30 +4,29 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" }, - "scripts": { - "build": "tsup --dts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/sparsemerkle/tsup.config.ts b/packages/sparsemerkle/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/sparsemerkle/tsup.config.ts +++ b/packages/sparsemerkle/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/transactions/package.json b/packages/transactions/package.json index 1b2ee81ed49..50ff63371de 100644 --- a/packages/transactions/package.json +++ b/packages/transactions/package.json @@ -4,8 +4,16 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts", - "./configs": "./src/configs.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./configs": { + "require": "./dist/configs.js", + "import": "./dist/configs.mjs", + "types": "./dist/configs.d.ts" + } }, "typesVersions": { "*": { @@ -18,8 +26,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -29,23 +35,15 @@ "./dist/configs.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./configs": { - "import": "./dist/configs.mjs", - "require": "./dist/configs.js", - "types": "./dist/configs.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -54,10 +52,7 @@ "@fuel-ts/math": "workspace:*", "@fuel-ts/address": "workspace:*" }, - "scripts": { - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts" + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/transactions/tsup.config.ts b/packages/transactions/tsup.config.ts index 156f2219ca0..00a2c3857ba 100644 --- a/packages/transactions/tsup.config.ts +++ b/packages/transactions/tsup.config.ts @@ -1,14 +1,28 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; +import type { Options } from 'tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - configs: 'src/configs.ts', +const primary = { + index: 'src/index.ts', +}; + +const secondaries = { + configs: 'src/configs.ts', +}; + +const configs: Options[] = [ + { + ...index, + entry: { ...primary }, + dts: { + banner: Object.keys(secondaries) + .map((key) => `import './${key}';`) + .join('\n'), + }, }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); + { + ...index, + entry: { ...secondaries }, + }, +]; + +export default configs; diff --git a/packages/versions/package.json b/packages/versions/package.json index 2bf20eaa65b..dfe128fb200 100644 --- a/packages/versions/package.json +++ b/packages/versions/package.json @@ -4,11 +4,19 @@ "description": "Validates supported versions of the Fuel toolchain", "author": "Fuel Labs (https://fuel.network/)", "bin": { - "fuels-versions": "dist/bin.global.js" + "fuels-versions": "dist/bin.js" }, "exports": { - ".": "./src/index.ts", - "./cli": "./src/cli.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./cli": { + "require": "./dist/cli.js", + "import": "./dist/cli.mjs", + "types": "./dist/cli.d.ts" + } }, "typesVersions": { "*": { @@ -21,11 +29,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "bin": { - "fuels-versions": "dist/bin.js" - }, "typesVersions": { "*": { "index.d.ts": [ @@ -35,23 +38,16 @@ "./dist/cli.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./cli": { - "import": "./dist/cli.mjs", - "require": "./dist/cli.js", - "types": "./dist/cli.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "prebuild": "ts-node ./scripts/rewriteVersions.ts", + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "chalk": "4", @@ -59,15 +55,8 @@ "semver": "^7.3.8" }, "devDependencies": { + "@tooling/tsup": "workspace:*", "@types/cli-table": "^0.3.1", "@types/semver": "^7.3.13" - }, - "scripts": { - "prebuild": "ts-node ./scripts/rewriteVersions.ts", - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts", - "inject:cli": "echo \"import './cli.d.ts';\" >> ./dist/index.d.ts" } } diff --git a/packages/versions/tsup.config.ts b/packages/versions/tsup.config.ts index 90c97c63c31..c7a20ef170c 100644 --- a/packages/versions/tsup.config.ts +++ b/packages/versions/tsup.config.ts @@ -1,15 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { indexBinAndCli } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - cli: 'src/cli.ts', - bin: 'src/bin.ts', - }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default indexBinAndCli; diff --git a/packages/wallet-manager/package.json b/packages/wallet-manager/package.json index ba5012da3c8..30648d05e98 100644 --- a/packages/wallet-manager/package.json +++ b/packages/wallet-manager/package.json @@ -4,24 +4,23 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@fuel-ts/address": "workspace:*", @@ -33,9 +32,7 @@ }, "devDependencies": { "@fuel-ts/hasher": "workspace:*", - "@fuel-ts/signer": "workspace:*" - }, - "scripts": { - "build": "tsup --dts" + "@fuel-ts/signer": "workspace:*", + "@tooling/tsup": "workspace:*" } } diff --git a/packages/wallet-manager/tsup.config.ts b/packages/wallet-manager/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/wallet-manager/tsup.config.ts +++ b/packages/wallet-manager/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; diff --git a/packages/wallet/package.json b/packages/wallet/package.json index ad67f955c67..9511aaca496 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -4,9 +4,21 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts", - "./configs": "./src/configs.ts", - "./test-utils": "./test/utils/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./configs": { + "require": "./dist/configs.js", + "import": "./dist/configs.mjs", + "types": "./dist/configs.d.ts" + }, + "./test-utils": { + "require": "./dist/test-utils.js", + "import": "./dist/test-utils.mjs", + "types": "./dist/test-utils.d.ts" + } }, "typesVersions": { "*": { @@ -22,8 +34,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -36,28 +46,15 @@ "./dist/test-utils.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./test-utils": { - "import": "./dist/test-utils.mjs", - "require": "./dist/test-utils.js", - "types": "./dist/test-utils.d.ts" - }, - "./configs": { - "import": "./dist/configs.mjs", - "require": "./dist/configs.js", - "types": "./dist/configs.d.ts" - } } }, "files": [ "dist" ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, "license": "Apache-2.0", "dependencies": { "@ethersproject/bytes": "^5.7.0", @@ -75,13 +72,7 @@ "devDependencies": { "@fuel-ts/address": "workspace:*", "@fuel-ts/keystore": "workspace:*", - "@fuel-ts/testcases": "workspace:*" - }, - "scripts": { - "build": "tsup --dts", - "postbuild": "pnpm run inject:secondary:entrypoints", - "inject:secondary:entrypoints": "run-p inject:*", - "inject:configs": "echo \"import './configs.d.ts';\" >> ./dist/index.d.ts", - "inject:test-utils": "echo \"import './test-utils.d.ts';\" >> ./dist/index.d.ts" + "@fuel-ts/testcases": "workspace:*", + "@tooling/tsup": "workspace:*" } } diff --git a/packages/wallet/tsup.config.ts b/packages/wallet/tsup.config.ts index 609962b7312..04ab30756c3 100644 --- a/packages/wallet/tsup.config.ts +++ b/packages/wallet/tsup.config.ts @@ -1,15 +1,29 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; - -export default defineConfig((options) => ({ - entry: { - index: 'src/index.ts', - configs: 'src/configs.ts', - 'test-utils': 'test/utils/index.ts', +import { index } from '@tooling/tsup'; +import type { Options } from 'tsup'; + +const primary = { + index: 'src/index.ts', +}; + +const secondaries = { + configs: 'src/configs.ts', + 'test-utils': 'test/utils/index.ts', +}; + +const configs: Options[] = [ + { + ...index, + entry: { ...primary }, + dts: { + banner: Object.keys(secondaries) + .map((key) => `import './${key}';`) + .join('\n'), + }, }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); + { + ...index, + entry: { ...secondaries }, + }, +]; + +export default configs; diff --git a/packages/wordlists/package.json b/packages/wordlists/package.json index 8d476a757d4..b5f10ae1760 100644 --- a/packages/wordlists/package.json +++ b/packages/wordlists/package.json @@ -4,26 +4,25 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/index.ts" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } }, "types": "src/index.ts", "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - } - } + "types": "dist/index.d.ts" }, "files": [ "dist" ], - "license": "Apache-2.0", "scripts": { - "build": "tsup --dts" + "build": "tsup", + "build:watch": "tsup --watch" + }, + "license": "Apache-2.0", + "devDependencies": { + "@tooling/tsup": "workspace:*" } } diff --git a/packages/wordlists/tsup.config.ts b/packages/wordlists/tsup.config.ts index e64b3dfa770..25701e9e314 100644 --- a/packages/wordlists/tsup.config.ts +++ b/packages/wordlists/tsup.config.ts @@ -1,11 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@tooling/tsup'; -export default defineConfig((options) => ({ - entry: ['src/index.ts'], - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); +export default index; From e7b042f42256d95dc8d588c19b122f913609b327 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:03:37 -0300 Subject: [PATCH 03/41] Fixing broken mock --- packages/abi-typegen/test/utils/mockVersions.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/abi-typegen/test/utils/mockVersions.ts b/packages/abi-typegen/test/utils/mockVersions.ts index 8f0351fd05d..ce7421caeb2 100644 --- a/packages/abi-typegen/test/utils/mockVersions.ts +++ b/packages/abi-typegen/test/utils/mockVersions.ts @@ -1,5 +1,19 @@ import * as versionsMod from '@fuel-ts/versions'; +// TODO: Check if there's a better alternative to this +/** + * This makes it possible to mock modules that are exported + * from package's index files, using exports syntax such as: + * + * export * from '...' + * + * https://stackoverflow.com/a/72885576 + */ +jest.mock('@fuel-ts/versions', () => ({ + __esModule: true, + ...jest.requireActual('@fuel-ts/versions'), +})); + export function mockVersions( values: { FUELS: string; From 5e91d01facabff8559be730faa4e036e3b7c1124 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:03:47 -0300 Subject: [PATCH 04/41] Adding simple TODO --- packages/interfaces/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/interfaces/src/index.ts b/packages/interfaces/src/index.ts index c7c53ee9ba6..d572fd0f63a 100644 --- a/packages/interfaces/src/index.ts +++ b/packages/interfaces/src/index.ts @@ -1,5 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable max-classes-per-file */ + +// TODO: Consider re-distritubing interfaces near their original packages + // #region Bech32-HRP export type Bech32Address = `fuel${string}`; // #endregion Bech32-HRP From fabc5417ecedec710b6706a7b438c3d3feaaeb92 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:03:54 -0300 Subject: [PATCH 05/41] Updating lock file --- pnpm-lock.yaml | 97 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8cc71854a59..40939a88376 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -196,6 +196,9 @@ importers: '@fuel-ts/versions': specifier: workspace:* version: link:../versions + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup type-fest: specifier: ^3.1.0 version: 3.2.0 @@ -230,6 +233,9 @@ importers: specifier: ^3.0.2 version: 3.0.2 devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup '@types/glob': specifier: ^8.0.0 version: 8.0.0 @@ -276,6 +282,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/contract: dependencies: @@ -316,6 +325,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -350,6 +362,10 @@ importers: shelljs: specifier: ^0.8.5 version: 0.8.5 + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/fuel-gauge: dependencies: @@ -447,6 +463,10 @@ importers: commander: specifier: ^9.4.1 version: 9.4.1 + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/hasher: dependencies: @@ -478,6 +498,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 @@ -502,8 +525,16 @@ importers: '@fuel-ts/signer': specifier: workspace:* version: link:../signer + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup - packages/interfaces: {} + packages/interfaces: + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/keystore: dependencies: @@ -513,6 +544,10 @@ importers: '@ethersproject/pbkdf2': specifier: ^5.7.0 version: 5.7.0 + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/math: dependencies: @@ -522,6 +557,10 @@ importers: bn.js: specifier: ^5.2.1 version: 5.2.1 + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/merkle: dependencies: @@ -531,6 +570,10 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/merkle-shared: dependencies: @@ -540,6 +583,10 @@ importers: '@ethersproject/sha2': specifier: ^5.7.0 version: 5.7.0 + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/merklesum: dependencies: @@ -549,6 +596,10 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/mnemonic: dependencies: @@ -570,6 +621,10 @@ importers: '@fuel-ts/wordlists': specifier: workspace:* version: link:../wordlists + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/predicate: dependencies: @@ -607,6 +662,9 @@ importers: '@fuel-ts/math': specifier: workspace:* version: link:../math + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/program: dependencies: @@ -641,6 +699,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -699,6 +760,9 @@ importers: '@graphql-codegen/typescript-operations': specifier: ^2.5.5 version: 2.5.7(graphql@16.6.0) + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 @@ -742,6 +806,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -773,6 +840,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup '@types/elliptic': specifier: ^6.4.14 version: 6.4.14 @@ -785,6 +855,10 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/testcases: {} @@ -805,6 +879,10 @@ importers: '@fuel-ts/math': specifier: workspace:* version: link:../math + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/versions: dependencies: @@ -818,6 +896,9 @@ importers: specifier: ^7.3.8 version: 7.3.8 devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup '@types/cli-table': specifier: ^0.3.1 version: 0.3.1 @@ -867,6 +948,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup packages/wallet-manager: dependencies: @@ -895,8 +979,17 @@ importers: '@fuel-ts/signer': specifier: workspace:* version: link:../signer + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup + + packages/wordlists: + devDependencies: + '@tooling/tsup': + specifier: workspace:* + version: link:../../tooling/tsup - packages/wordlists: {} + tooling/tsup: {} packages: From 955c40cac45fc59e462b80ac9f6ca338bc799205 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:18:44 -0300 Subject: [PATCH 06/41] Adding changeset --- .changeset/slimy-drinks-nail.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .changeset/slimy-drinks-nail.md diff --git a/.changeset/slimy-drinks-nail.md b/.changeset/slimy-drinks-nail.md new file mode 100644 index 00000000000..d6d8754c7c0 --- /dev/null +++ b/.changeset/slimy-drinks-nail.md @@ -0,0 +1,30 @@ +--- +"@fuel-ts/abi-coder": minor +"@fuel-ts/abi-typegen": minor +"@fuel-ts/address": minor +"@fuel-ts/contract": minor +"forc-bin": minor +"fuels": minor +"@fuel-ts/hasher": minor +"@fuel-ts/hdwallet": minor +"@fuel-ts/interfaces": minor +"@fuel-ts/keystore": minor +"@fuel-ts/math": minor +"@fuel-ts/merkle": minor +"@fuel-ts/merkle-shared": minor +"@fuel-ts/merklesum": minor +"@fuel-ts/mnemonic": minor +"@fuel-ts/predicate": minor +"@fuel-ts/program": minor +"@fuel-ts/providers": minor +"@fuel-ts/script": minor +"@fuel-ts/signer": minor +"@fuel-ts/sparsemerkle": minor +"@fuel-ts/transactions": minor +"@fuel-ts/versions": minor +"@fuel-ts/wallet": minor +"@fuel-ts/wallet-manager": minor +"@fuel-ts/wordlists": minor +--- + +Revamping all packages configs, enabling local installation From a2dbdc2d6c433fa94682a7bc8a802aef61a16332 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 11:31:41 -0300 Subject: [PATCH 07/41] Renaming workspace --- {tooling => internal}/tsup/index.js | 0 {tooling => internal}/tsup/package.json | 2 +- packages/abi-coder/package.json | 2 +- packages/abi-coder/tsup.config.ts | 2 +- packages/abi-typegen/package.json | 2 +- packages/abi-typegen/tsup.config.ts | 2 +- packages/address/package.json | 2 +- packages/address/tsup.config.ts | 2 +- packages/contract/package.json | 4 +- packages/contract/tsup.config.ts | 2 +- packages/example-contract/package.json | 4 +- packages/forc-bin/package.json | 2 +- packages/forc-bin/tsup.config.ts | 2 +- packages/fuels/package.json | 6 +- packages/fuels/tsup.config.ts | 2 +- packages/hasher/package.json | 2 +- packages/hasher/tsup.config.ts | 2 +- packages/hdwallet/package.json | 2 +- packages/hdwallet/tsup.config.ts | 2 +- packages/interfaces/package.json | 2 +- packages/interfaces/tsup.config.ts | 2 +- packages/keystore/package.json | 2 +- packages/keystore/tsup.config.ts | 2 +- packages/math/package.json | 2 +- packages/math/tsup.config.ts | 2 +- packages/merkle-shared/package.json | 2 +- packages/merkle-shared/tsup.config.ts | 2 +- packages/merkle/package.json | 2 +- packages/merkle/tsup.config.ts | 2 +- packages/merklesum/package.json | 2 +- packages/merklesum/tsup.config.ts | 2 +- packages/mnemonic/package.json | 2 +- packages/mnemonic/tsup.config.ts | 2 +- packages/predicate/package.json | 2 +- packages/predicate/tsup.config.ts | 2 +- packages/program/package.json | 2 +- packages/program/tsup.config.ts | 2 +- packages/providers/package.json | 6 +- packages/providers/tsup.config.ts | 2 +- packages/script/package.json | 2 +- packages/script/tsup.config.ts | 2 +- packages/signer/package.json | 2 +- packages/signer/tsup.config.ts | 2 +- packages/sparsemerkle/package.json | 2 +- packages/sparsemerkle/tsup.config.ts | 2 +- packages/transactions/package.json | 2 +- packages/transactions/tsup.config.ts | 2 +- packages/versions/package.json | 2 +- packages/versions/tsup.config.ts | 2 +- packages/wallet-manager/package.json | 2 +- packages/wallet-manager/tsup.config.ts | 2 +- packages/wallet/package.json | 2 +- packages/wallet/tsup.config.ts | 2 +- packages/wordlists/package.json | 10 +-- packages/wordlists/tsup.config.ts | 2 +- pnpm-lock.yaml | 108 ++++++++++++------------ pnpm-workspace.yaml | 4 +- 57 files changed, 120 insertions(+), 120 deletions(-) rename {tooling => internal}/tsup/index.js (100%) rename {tooling => internal}/tsup/package.json (61%) diff --git a/tooling/tsup/index.js b/internal/tsup/index.js similarity index 100% rename from tooling/tsup/index.js rename to internal/tsup/index.js diff --git a/tooling/tsup/package.json b/internal/tsup/package.json similarity index 61% rename from tooling/tsup/package.json rename to internal/tsup/package.json index ca8ac9f4574..a03b6b69d53 100644 --- a/tooling/tsup/package.json +++ b/internal/tsup/package.json @@ -1,5 +1,5 @@ { "private": true, - "name": "@tooling/tsup", + "name": "@internal/tsup", "main": "index.js" } diff --git a/packages/abi-coder/package.json b/packages/abi-coder/package.json index 7615e6a364a..c409c3dd9a4 100644 --- a/packages/abi-coder/package.json +++ b/packages/abi-coder/package.json @@ -33,7 +33,7 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/versions": "workspace:*", - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "type-fest": "^3.1.0" } } diff --git a/packages/abi-coder/tsup.config.ts b/packages/abi-coder/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/abi-coder/tsup.config.ts +++ b/packages/abi-coder/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/abi-typegen/package.json b/packages/abi-typegen/package.json index a3e4a160a56..a7ed3490d61 100644 --- a/packages/abi-typegen/package.json +++ b/packages/abi-typegen/package.json @@ -72,7 +72,7 @@ "rimraf": "^3.0.2" }, "devDependencies": { - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "@types/glob": "^8.0.0", "@types/lodash.uniq": "^4.5.7", "@types/lodash.upperfirst": "^4.3.7", diff --git a/packages/abi-typegen/tsup.config.ts b/packages/abi-typegen/tsup.config.ts index b6f350860a0..1b84818ab3e 100644 --- a/packages/abi-typegen/tsup.config.ts +++ b/packages/abi-typegen/tsup.config.ts @@ -1,4 +1,4 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; import type { Options } from 'tsup'; const primary = { diff --git a/packages/address/package.json b/packages/address/package.json index ae925af068d..f39c4b53cd4 100644 --- a/packages/address/package.json +++ b/packages/address/package.json @@ -56,6 +56,6 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/address/tsup.config.ts b/packages/address/tsup.config.ts index 6d0e60cc618..b6eb9482b7f 100644 --- a/packages/address/tsup.config.ts +++ b/packages/address/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@tooling/tsup'; +import { indexAndConfig } from '@internal/tsup'; export default indexAndConfig; diff --git a/packages/contract/package.json b/packages/contract/package.json index 408eb631188..8214d921b56 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -37,7 +37,7 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "forc-bin": "workspace:*", - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*", + "forc-bin": "workspace:*" } } diff --git a/packages/contract/tsup.config.ts b/packages/contract/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/contract/tsup.config.ts +++ b/packages/contract/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/example-contract/package.json b/packages/example-contract/package.json index 81894d90c85..5eb910fd717 100644 --- a/packages/example-contract/package.json +++ b/packages/example-contract/package.json @@ -9,9 +9,9 @@ }, "license": "Apache-2.0", "dependencies": { + "@ethersproject/bytes": "^5.7.0", "@fuel-ts/wallet": "workspace:*", - "fuels": "workspace:*", - "@ethersproject/bytes": "^5.7.0" + "fuels": "workspace:*" }, "devDependencies": { "forc-bin": "workspace:*", diff --git a/packages/forc-bin/package.json b/packages/forc-bin/package.json index 7254f2f7596..eb540816771 100644 --- a/packages/forc-bin/package.json +++ b/packages/forc-bin/package.json @@ -26,6 +26,6 @@ "shelljs": "^0.8.5" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/forc-bin/tsup.config.ts b/packages/forc-bin/tsup.config.ts index b0dbb6f45b3..8e194975296 100644 --- a/packages/forc-bin/tsup.config.ts +++ b/packages/forc-bin/tsup.config.ts @@ -1,4 +1,4 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default { ...index, diff --git a/packages/fuels/package.json b/packages/fuels/package.json index a377d822e95..77d5bbd1852 100644 --- a/packages/fuels/package.json +++ b/packages/fuels/package.json @@ -60,8 +60,8 @@ "@fuel-ts/interfaces": "workspace:*", "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", - "@fuel-ts/merkle-shared": "workspace:*", "@fuel-ts/merkle": "workspace:*", + "@fuel-ts/merkle-shared": "workspace:*", "@fuel-ts/merklesum": "workspace:*", "@fuel-ts/mnemonic": "workspace:*", "@fuel-ts/predicate": "workspace:*", @@ -73,12 +73,12 @@ "@fuel-ts/testcases": "workspace:*", "@fuel-ts/transactions": "workspace:*", "@fuel-ts/versions": "workspace:*", - "@fuel-ts/wallet-manager": "workspace:*", "@fuel-ts/wallet": "workspace:*", + "@fuel-ts/wallet-manager": "workspace:*", "@fuel-ts/wordlists": "workspace:*", "commander": "^9.4.1" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/fuels/tsup.config.ts b/packages/fuels/tsup.config.ts index 96eaeeeafa3..37f5dcb1351 100644 --- a/packages/fuels/tsup.config.ts +++ b/packages/fuels/tsup.config.ts @@ -1,4 +1,4 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; import type { Options } from 'tsup'; const primary = { diff --git a/packages/hasher/package.json b/packages/hasher/package.json index 0b6cbd7a6f5..9e2d64b4099 100644 --- a/packages/hasher/package.json +++ b/packages/hasher/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7" } } diff --git a/packages/hasher/tsup.config.ts b/packages/hasher/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/hasher/tsup.config.ts +++ b/packages/hasher/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/hdwallet/package.json b/packages/hdwallet/package.json index fc897fa6f7b..a750a9c27ac 100644 --- a/packages/hdwallet/package.json +++ b/packages/hdwallet/package.json @@ -31,6 +31,6 @@ "@fuel-ts/signer": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/hdwallet/tsup.config.ts b/packages/hdwallet/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/hdwallet/tsup.config.ts +++ b/packages/hdwallet/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/interfaces/package.json b/packages/interfaces/package.json index e46006440d1..eb391d69151 100644 --- a/packages/interfaces/package.json +++ b/packages/interfaces/package.json @@ -24,6 +24,6 @@ "license": "Apache-2.0", "dependencies": {}, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/interfaces/tsup.config.ts b/packages/interfaces/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/interfaces/tsup.config.ts +++ b/packages/interfaces/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/keystore/package.json b/packages/keystore/package.json index 5c259cf8c31..7dd5e58c390 100644 --- a/packages/keystore/package.json +++ b/packages/keystore/package.json @@ -27,6 +27,6 @@ "@ethersproject/pbkdf2": "^5.7.0" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/keystore/tsup.config.ts b/packages/keystore/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/keystore/tsup.config.ts +++ b/packages/keystore/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/math/package.json b/packages/math/package.json index c2e752fdcbe..2b07c2db4f9 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -50,6 +50,6 @@ "bn.js": "^5.2.1" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/math/tsup.config.ts b/packages/math/tsup.config.ts index 6d0e60cc618..b6eb9482b7f 100644 --- a/packages/math/tsup.config.ts +++ b/packages/math/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@tooling/tsup'; +import { indexAndConfig } from '@internal/tsup'; export default indexAndConfig; diff --git a/packages/merkle-shared/package.json b/packages/merkle-shared/package.json index 5420284f4dc..7c14845ccc6 100644 --- a/packages/merkle-shared/package.json +++ b/packages/merkle-shared/package.json @@ -27,6 +27,6 @@ "@ethersproject/sha2": "^5.7.0" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/merkle-shared/tsup.config.ts b/packages/merkle-shared/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/merkle-shared/tsup.config.ts +++ b/packages/merkle-shared/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/merkle/package.json b/packages/merkle/package.json index 52391b0012c..77272826d5f 100644 --- a/packages/merkle/package.json +++ b/packages/merkle/package.json @@ -27,6 +27,6 @@ "@fuel-ts/merkle-shared": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/merkle/tsup.config.ts b/packages/merkle/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/merkle/tsup.config.ts +++ b/packages/merkle/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/merklesum/package.json b/packages/merklesum/package.json index 94f165bcee9..e0a16e8a836 100644 --- a/packages/merklesum/package.json +++ b/packages/merklesum/package.json @@ -27,6 +27,6 @@ "@fuel-ts/merkle-shared": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/merklesum/tsup.config.ts b/packages/merklesum/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/merklesum/tsup.config.ts +++ b/packages/merklesum/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/mnemonic/package.json b/packages/mnemonic/package.json index 73c414b1e93..5d4e27f6a5c 100644 --- a/packages/mnemonic/package.json +++ b/packages/mnemonic/package.json @@ -31,6 +31,6 @@ "@fuel-ts/wordlists": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/mnemonic/tsup.config.ts b/packages/mnemonic/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/mnemonic/tsup.config.ts +++ b/packages/mnemonic/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/predicate/package.json b/packages/predicate/package.json index 15d168e0801..d473e754ca5 100644 --- a/packages/predicate/package.json +++ b/packages/predicate/package.json @@ -36,6 +36,6 @@ }, "devDependencies": { "@fuel-ts/math": "workspace:*", - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/predicate/tsup.config.ts b/packages/predicate/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/predicate/tsup.config.ts +++ b/packages/predicate/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/program/package.json b/packages/program/package.json index c835a8ec279..3f41a2f6b79 100644 --- a/packages/program/package.json +++ b/packages/program/package.json @@ -58,7 +58,7 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/program/tsup.config.ts b/packages/program/tsup.config.ts index 6d0e60cc618..b6eb9482b7f 100644 --- a/packages/program/tsup.config.ts +++ b/packages/program/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@tooling/tsup'; +import { indexAndConfig } from '@internal/tsup'; export default indexAndConfig; diff --git a/packages/providers/package.json b/packages/providers/package.json index 25131fc13ca..7d06dab1ee6 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -35,17 +35,17 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/transactions": "workspace:*", + "graphql": "^16.6.0", "graphql-request": "^5.0.0", "graphql-tag": "^2.12.6", - "graphql": "^16.6.0", "lodash.clonedeep": "^4.5.0" }, "devDependencies": { "@graphql-codegen/cli": "^2.13.7", + "@graphql-codegen/typescript": "^2.8.0", "@graphql-codegen/typescript-graphql-request": "^4.5.7", "@graphql-codegen/typescript-operations": "^2.5.5", - "@graphql-codegen/typescript": "^2.8.0", - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7", "get-graphql-schema": "^2.1.2", "typescript": "^4.8.4" diff --git a/packages/providers/tsup.config.ts b/packages/providers/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/providers/tsup.config.ts +++ b/packages/providers/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/script/package.json b/packages/script/package.json index 1b8a9d5ff1b..0d17e3c119a 100644 --- a/packages/script/package.json +++ b/packages/script/package.json @@ -37,7 +37,7 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/script/tsup.config.ts b/packages/script/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/script/tsup.config.ts +++ b/packages/script/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/signer/package.json b/packages/signer/package.json index 76c28776a68..4de85cce998 100644 --- a/packages/signer/package.json +++ b/packages/signer/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "@types/elliptic": "^6.4.14" } } diff --git a/packages/signer/tsup.config.ts b/packages/signer/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/signer/tsup.config.ts +++ b/packages/signer/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/sparsemerkle/package.json b/packages/sparsemerkle/package.json index f8cb24df485..0dfe954f39f 100644 --- a/packages/sparsemerkle/package.json +++ b/packages/sparsemerkle/package.json @@ -27,6 +27,6 @@ "@fuel-ts/merkle-shared": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/sparsemerkle/tsup.config.ts b/packages/sparsemerkle/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/sparsemerkle/tsup.config.ts +++ b/packages/sparsemerkle/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/transactions/package.json b/packages/transactions/package.json index 50ff63371de..0d34d9b863b 100644 --- a/packages/transactions/package.json +++ b/packages/transactions/package.json @@ -53,6 +53,6 @@ "@fuel-ts/address": "workspace:*" }, "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/transactions/tsup.config.ts b/packages/transactions/tsup.config.ts index 00a2c3857ba..298b9c82e3c 100644 --- a/packages/transactions/tsup.config.ts +++ b/packages/transactions/tsup.config.ts @@ -1,4 +1,4 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; import type { Options } from 'tsup'; const primary = { diff --git a/packages/versions/package.json b/packages/versions/package.json index dfe128fb200..952f24f4e4b 100644 --- a/packages/versions/package.json +++ b/packages/versions/package.json @@ -55,7 +55,7 @@ "semver": "^7.3.8" }, "devDependencies": { - "@tooling/tsup": "workspace:*", + "@internal/tsup": "workspace:*", "@types/cli-table": "^0.3.1", "@types/semver": "^7.3.13" } diff --git a/packages/versions/tsup.config.ts b/packages/versions/tsup.config.ts index c7a20ef170c..66e3a6c691b 100644 --- a/packages/versions/tsup.config.ts +++ b/packages/versions/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexBinAndCli } from '@tooling/tsup'; +import { indexBinAndCli } from '@internal/tsup'; export default indexBinAndCli; diff --git a/packages/wallet-manager/package.json b/packages/wallet-manager/package.json index 30648d05e98..0a0246707a5 100644 --- a/packages/wallet-manager/package.json +++ b/packages/wallet-manager/package.json @@ -33,6 +33,6 @@ "devDependencies": { "@fuel-ts/hasher": "workspace:*", "@fuel-ts/signer": "workspace:*", - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/wallet-manager/tsup.config.ts b/packages/wallet-manager/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/wallet-manager/tsup.config.ts +++ b/packages/wallet-manager/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 9511aaca496..58c0db699f9 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -73,6 +73,6 @@ "@fuel-ts/address": "workspace:*", "@fuel-ts/keystore": "workspace:*", "@fuel-ts/testcases": "workspace:*", - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" } } diff --git a/packages/wallet/tsup.config.ts b/packages/wallet/tsup.config.ts index 04ab30756c3..18b972c4825 100644 --- a/packages/wallet/tsup.config.ts +++ b/packages/wallet/tsup.config.ts @@ -1,4 +1,4 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; import type { Options } from 'tsup'; const primary = { diff --git a/packages/wordlists/package.json b/packages/wordlists/package.json index b5f10ae1760..67c83b0c150 100644 --- a/packages/wordlists/package.json +++ b/packages/wordlists/package.json @@ -2,6 +2,7 @@ "name": "@fuel-ts/wordlists", "version": "0.41.0", "description": "", + "license": "Apache-2.0", "author": "Fuel Labs (https://fuel.network/)", "exports": { ".": { @@ -11,9 +12,6 @@ } }, "types": "src/index.ts", - "publishConfig": { - "types": "dist/index.d.ts" - }, "files": [ "dist" ], @@ -21,8 +19,10 @@ "build": "tsup", "build:watch": "tsup --watch" }, - "license": "Apache-2.0", "devDependencies": { - "@tooling/tsup": "workspace:*" + "@internal/tsup": "workspace:*" + }, + "publishConfig": { + "types": "dist/index.d.ts" } } diff --git a/packages/wordlists/tsup.config.ts b/packages/wordlists/tsup.config.ts index 25701e9e314..4c7f2f0354f 100644 --- a/packages/wordlists/tsup.config.ts +++ b/packages/wordlists/tsup.config.ts @@ -1,3 +1,3 @@ -import { index } from '@tooling/tsup'; +import { index } from '@internal/tsup'; export default index; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40939a88376..5fea6155512 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,8 @@ importers: specifier: workspace:* version: link:../../packages/fuels + internal/tsup: {} + packages/abi-coder: dependencies: '@ethersproject/abi': @@ -196,9 +198,9 @@ importers: '@fuel-ts/versions': specifier: workspace:* version: link:../versions - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup type-fest: specifier: ^3.1.0 version: 3.2.0 @@ -233,9 +235,9 @@ importers: specifier: ^3.0.2 version: 3.0.2 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup '@types/glob': specifier: ^8.0.0 version: 8.0.0 @@ -282,9 +284,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/contract: dependencies: @@ -325,9 +327,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -363,9 +365,9 @@ importers: specifier: ^0.8.5 version: 0.8.5 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/fuel-gauge: dependencies: @@ -464,9 +466,9 @@ importers: specifier: ^9.4.1 version: 9.4.1 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/hasher: dependencies: @@ -498,9 +500,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 @@ -526,15 +528,15 @@ importers: specifier: workspace:* version: link:../signer devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/interfaces: devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/keystore: dependencies: @@ -545,9 +547,9 @@ importers: specifier: ^5.7.0 version: 5.7.0 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/math: dependencies: @@ -558,9 +560,9 @@ importers: specifier: ^5.2.1 version: 5.2.1 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/merkle: dependencies: @@ -571,9 +573,9 @@ importers: specifier: workspace:* version: link:../merkle-shared devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/merkle-shared: dependencies: @@ -584,9 +586,9 @@ importers: specifier: ^5.7.0 version: 5.7.0 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/merklesum: dependencies: @@ -597,9 +599,9 @@ importers: specifier: workspace:* version: link:../merkle-shared devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/mnemonic: dependencies: @@ -622,9 +624,9 @@ importers: specifier: workspace:* version: link:../wordlists devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/predicate: dependencies: @@ -662,9 +664,9 @@ importers: '@fuel-ts/math': specifier: workspace:* version: link:../math - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/program: dependencies: @@ -699,9 +701,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -760,9 +762,9 @@ importers: '@graphql-codegen/typescript-operations': specifier: ^2.5.5 version: 2.5.7(graphql@16.6.0) - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 @@ -806,9 +808,9 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -840,9 +842,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup '@types/elliptic': specifier: ^6.4.14 version: 6.4.14 @@ -856,9 +858,9 @@ importers: specifier: workspace:* version: link:../merkle-shared devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/testcases: {} @@ -880,9 +882,9 @@ importers: specifier: workspace:* version: link:../math devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/versions: dependencies: @@ -896,9 +898,9 @@ importers: specifier: ^7.3.8 version: 7.3.8 devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup '@types/cli-table': specifier: ^0.3.1 version: 0.3.1 @@ -948,9 +950,9 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/wallet-manager: dependencies: @@ -979,17 +981,15 @@ importers: '@fuel-ts/signer': specifier: workspace:* version: link:../signer - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup + version: link:../../internal/tsup packages/wordlists: devDependencies: - '@tooling/tsup': + '@internal/tsup': specifier: workspace:* - version: link:../../tooling/tsup - - tooling/tsup: {} + version: link:../../internal/tsup packages: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index af315f4abc7..afafccfe04d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: - - "packages/*" - "apps/*" - - "tooling/*" + - "internal/*" + - "packages/*" From 82f1e1145475c7f992a1b4016ab85fe462101334 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 12:11:20 -0300 Subject: [PATCH 08/41] Using Typescript for internal package --- internal/tsup/package.json | 17 ++++++++++- internal/tsup/{index.js => src/index.ts} | 36 ++++++++++++++++-------- internal/tsup/tsup.config.ts | 3 ++ packages/address/tsup.config.ts | 4 +-- packages/math/tsup.config.ts | 4 +-- packages/program/tsup.config.ts | 4 +-- 6 files changed, 50 insertions(+), 18 deletions(-) rename internal/tsup/{index.js => src/index.ts} (70%) create mode 100644 internal/tsup/tsup.config.ts diff --git a/internal/tsup/package.json b/internal/tsup/package.json index a03b6b69d53..31a120443d2 100644 --- a/internal/tsup/package.json +++ b/internal/tsup/package.json @@ -1,5 +1,20 @@ { "private": true, "name": "@internal/tsup", - "main": "index.js" + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } + }, + "types": "src/index.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "tsup", + "build:watch": "tsup --watch" + }, + "license": "Apache-2.0" } diff --git a/internal/tsup/index.js b/internal/tsup/src/index.ts similarity index 70% rename from internal/tsup/index.js rename to internal/tsup/src/index.ts index 45e27d96ab7..797ba8cfdf0 100644 --- a/internal/tsup/index.js +++ b/internal/tsup/src/index.ts @@ -3,15 +3,20 @@ * All `primary` DTS files must import `secondary` ones * for all packages witgh multiple entry-points; which is done * via the `dts.banner` property that you can see in use below. - * + */ + +/** * [NOTE.2] * Due to the limitations of TSUP config files, this * approach was used. It basically exports ready-to-go * configurations for most used configs in the monorepo. */ -/** @type { import('tsup').Options } */ -exports.index = { +/** + * Entrypoints: + * - src/index.ts + */ +export const index = { clean: true, dts: true, entry: ['src/index.ts'], @@ -21,27 +26,36 @@ exports.index = { splitting: false, }; -/** @type { import('tsup').Options[] } */ -exports.indexAndConfig = [ +/** + * Entrypoints: + * - src/index.ts + * - src/configs.ts + */ +export const indexAndConfigs = [ { - ...exports.index, + ...index, entry: { index: 'src/index.ts' }, dts: { banner: `import './configs';` }, }, { - ...exports.index, + ...index, entry: { configs: 'src/configs.ts' }, }, ]; -/** @type { import('tsup').Options[] } */ -exports.indexBinAndCli = [ +/** + * Entrypoints: + * - src/index.ts + * - src/bin.ts + * - src/cli.ts + */ +export const indexBinAndCli = [ { - ...exports.index, + ...index, dts: { banner: `import './bin'; import './cli';` }, }, { - ...exports.index, + ...index, entry: { bin: 'src/bin.ts', cli: 'src/cli.ts' }, }, ]; diff --git a/internal/tsup/tsup.config.ts b/internal/tsup/tsup.config.ts new file mode 100644 index 00000000000..0018dc0108b --- /dev/null +++ b/internal/tsup/tsup.config.ts @@ -0,0 +1,3 @@ +import { index } from './src'; + +export default index; diff --git a/packages/address/tsup.config.ts b/packages/address/tsup.config.ts index b6eb9482b7f..bf518b39c4b 100644 --- a/packages/address/tsup.config.ts +++ b/packages/address/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@internal/tsup'; +import { indexAndConfigs } from '@internal/tsup'; -export default indexAndConfig; +export default indexAndConfigs; diff --git a/packages/math/tsup.config.ts b/packages/math/tsup.config.ts index b6eb9482b7f..bf518b39c4b 100644 --- a/packages/math/tsup.config.ts +++ b/packages/math/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@internal/tsup'; +import { indexAndConfigs } from '@internal/tsup'; -export default indexAndConfig; +export default indexAndConfigs; diff --git a/packages/program/tsup.config.ts b/packages/program/tsup.config.ts index b6eb9482b7f..bf518b39c4b 100644 --- a/packages/program/tsup.config.ts +++ b/packages/program/tsup.config.ts @@ -1,3 +1,3 @@ -import { indexAndConfig } from '@internal/tsup'; +import { indexAndConfigs } from '@internal/tsup'; -export default indexAndConfig; +export default indexAndConfigs; From 8457e2af542ecc6daf11fefb0a4c7e1c7c29c3e4 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 12:20:44 -0300 Subject: [PATCH 09/41] Building package ahead of time for early availability --- internal/tsup/package.json | 1 + internal/tsup/src/index.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/tsup/package.json b/internal/tsup/package.json index 31a120443d2..bf00704745b 100644 --- a/internal/tsup/package.json +++ b/internal/tsup/package.json @@ -13,6 +13,7 @@ "dist" ], "scripts": { + "preinstall": "pnpm build", "build": "tsup", "build:watch": "tsup --watch" }, diff --git a/internal/tsup/src/index.ts b/internal/tsup/src/index.ts index 797ba8cfdf0..5c6c0bef68d 100644 --- a/internal/tsup/src/index.ts +++ b/internal/tsup/src/index.ts @@ -12,11 +12,13 @@ * configurations for most used configs in the monorepo. */ +import type { Options } from 'tsup'; + /** * Entrypoints: * - src/index.ts */ -export const index = { +export const index: Options = { clean: true, dts: true, entry: ['src/index.ts'], @@ -31,7 +33,7 @@ export const index = { * - src/index.ts * - src/configs.ts */ -export const indexAndConfigs = [ +export const indexAndConfigs: Options[] = [ { ...index, entry: { index: 'src/index.ts' }, @@ -49,7 +51,7 @@ export const indexAndConfigs = [ * - src/bin.ts * - src/cli.ts */ -export const indexBinAndCli = [ +export const indexBinAndCli: Options[] = [ { ...index, dts: { banner: `import './bin'; import './cli';` }, From 0705762da1afdcb66a3400863f7a8d66322c91ce Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 12:54:57 -0300 Subject: [PATCH 10/41] Docs --- internal/tsup/src/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/tsup/src/index.ts b/internal/tsup/src/index.ts index 5c6c0bef68d..65c96d3e1c1 100644 --- a/internal/tsup/src/index.ts +++ b/internal/tsup/src/index.ts @@ -1,15 +1,16 @@ /** * [NOTE.1] - * All `primary` DTS files must import `secondary` ones - * for all packages witgh multiple entry-points; which is done - * via the `dts.banner` property that you can see in use below. + * All `primary` DTS files must import `secondary` ones for all + * packages containing multiple entry-points. We do this by injecting + * the required `import` lines in the primary DTS file via the + * TSUP `dts.banner` config property. */ /** * [NOTE.2] - * Due to the limitations of TSUP config files, this - * approach was used. It basically exports ready-to-go - * configurations for most used configs in the monorepo. + * Due to the limitations of TSUP regarding config inheritance, we + * exports ready-to-go configurations for most used scenarios in the + * monorepo. More complex configs can be done in isolation. */ import type { Options } from 'tsup'; From 3f81569594e129f7a01708e6c4fffa8872274f73 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 12:56:18 -0300 Subject: [PATCH 11/41] Enabling pr release --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index dfb450b5430..d7291bad39f 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - if: false + # if: false permissions: write-all steps: - name: Checkout From 02762ef419f248d9a6c69821541ffbae299ea7be Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 13:36:02 -0300 Subject: [PATCH 12/41] Adjusting dependencies split --- packages/abi-coder/package.json | 4 +++- packages/hasher/package.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/abi-coder/package.json b/packages/abi-coder/package.json index c409c3dd9a4..473522ffe40 100644 --- a/packages/abi-coder/package.json +++ b/packages/abi-coder/package.json @@ -33,7 +33,9 @@ "@fuel-ts/keystore": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/versions": "workspace:*", - "@internal/tsup": "workspace:*", "type-fest": "^3.1.0" + }, + "devDependencies": { + "@internal/tsup": "workspace:*" } } diff --git a/packages/hasher/package.json b/packages/hasher/package.json index 9e2d64b4099..782874be5f8 100644 --- a/packages/hasher/package.json +++ b/packages/hasher/package.json @@ -34,7 +34,9 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", - "@internal/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7" + }, + "optionalDependencies": { + "@internal/tsup": "workspace:*" } } From 30914918c2b6f19e757f42ff22deec04f470071e Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 13:59:33 -0300 Subject: [PATCH 13/41] Updating lock file --- pnpm-lock.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5fea6155512..2989172d754 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -198,12 +198,13 @@ importers: '@fuel-ts/versions': specifier: workspace:* version: link:../versions - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup type-fest: specifier: ^3.1.0 version: 3.2.0 + devDependencies: + '@internal/tsup': + specifier: workspace:* + version: link:../../internal/tsup packages/abi-typegen: dependencies: @@ -496,13 +497,14 @@ importers: lodash.clonedeep: specifier: ^4.5.0 version: 4.5.0 + optionalDependencies: + '@internal/tsup': + specifier: workspace:* + version: link:../../internal/tsup devDependencies: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 From 9bb81d1177fb39a516bc4c412cdfafea77a6dfd2 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 14:14:43 -0300 Subject: [PATCH 14/41] Re-stitching internal dependencies --- package.json | 11 +-- packages/abi-coder/package.json | 3 - packages/abi-typegen/package.json | 1 - packages/address/package.json | 3 +- packages/contract/package.json | 1 - packages/forc-bin/package.json | 3 - packages/fuels/package.json | 3 - packages/hasher/package.json | 3 - packages/hdwallet/package.json | 3 - packages/interfaces/package.json | 6 +- packages/keystore/package.json | 3 - packages/math/package.json | 3 - packages/merkle-shared/package.json | 3 - packages/merkle/package.json | 3 - packages/merklesum/package.json | 3 - packages/mnemonic/package.json | 3 - packages/predicate/package.json | 3 +- packages/program/package.json | 1 - packages/providers/package.json | 1 - packages/script/package.json | 1 - packages/signer/package.json | 1 - packages/sparsemerkle/package.json | 3 - packages/transactions/package.json | 3 - packages/versions/package.json | 1 - packages/wallet-manager/package.json | 3 +- packages/wallet/package.json | 3 +- packages/wordlists/package.json | 3 - pnpm-lock.yaml | 100 ++------------------------- 28 files changed, 16 insertions(+), 162 deletions(-) diff --git a/package.json b/package.json index d2db9f90880..d5a0f5c862a 100644 --- a/package.json +++ b/package.json @@ -45,17 +45,17 @@ "@changesets/changelog-github": "^0.4.7", "@changesets/cli": "^2.25.0", "@ethersproject/bytes": "^5.7.0", + "@internal/tsup": "workspace:*", "@jest/types": "^29.5.0", "@types/jest": "^29.5.0", - "@types/node": "18.15.3", "@types/node-fetch": "^2.6.2", + "@types/node": "18.15.3", "@types/shelljs": "^0.8.11", "@types/web": "^0.0.65", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", "conventional-changelog-angular": "^5.0.13", "dotenv": "^9.0.2", - "eslint": "^8.26.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^16.2.0", "eslint-config-prettier": "^8.5.0", @@ -64,16 +64,17 @@ "eslint-plugin-jsdoc": "^37.9.7", "eslint-plugin-jsx-a11y": "^6.6.1", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react": "^7.31.10", "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react": "^7.31.10", "eslint-plugin-tsdoc": "^0.2.17", + "eslint": "^8.26.0", "ethers": "^5.7.2", "forc-bin": "workspace:*", "husky": "^8.0.3", - "jest": "^29.5.0", "jest-text-transformer": "^1.0.4", - "markdownlint": "^0.23.1", + "jest": "^29.5.0", "markdownlint-cli": "^0.27.1", + "markdownlint": "^0.23.1", "npm-run-all": "^4.1.5", "open": "^8.4.0", "prettier": "^2.7.1", diff --git a/packages/abi-coder/package.json b/packages/abi-coder/package.json index 473522ffe40..dd9fd67e421 100644 --- a/packages/abi-coder/package.json +++ b/packages/abi-coder/package.json @@ -34,8 +34,5 @@ "@fuel-ts/math": "workspace:*", "@fuel-ts/versions": "workspace:*", "type-fest": "^3.1.0" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/abi-typegen/package.json b/packages/abi-typegen/package.json index a7ed3490d61..64b8cb4741e 100644 --- a/packages/abi-typegen/package.json +++ b/packages/abi-typegen/package.json @@ -72,7 +72,6 @@ "rimraf": "^3.0.2" }, "devDependencies": { - "@internal/tsup": "workspace:*", "@types/glob": "^8.0.0", "@types/lodash.uniq": "^4.5.7", "@types/lodash.upperfirst": "^4.3.7", diff --git a/packages/address/package.json b/packages/address/package.json index f39c4b53cd4..3316d793cba 100644 --- a/packages/address/package.json +++ b/packages/address/package.json @@ -55,7 +55,6 @@ "bech32": "^2.0.0" }, "devDependencies": { - "@fuel-ts/testcases": "workspace:*", - "@internal/tsup": "workspace:*" + "@fuel-ts/testcases": "workspace:*" } } diff --git a/packages/contract/package.json b/packages/contract/package.json index 8214d921b56..93f047cff43 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -37,7 +37,6 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@internal/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/forc-bin/package.json b/packages/forc-bin/package.json index eb540816771..835e18dbc60 100644 --- a/packages/forc-bin/package.json +++ b/packages/forc-bin/package.json @@ -24,8 +24,5 @@ "dependencies": { "node-fetch": "^2.6.7", "shelljs": "^0.8.5" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/fuels/package.json b/packages/fuels/package.json index 77d5bbd1852..6fb031cd315 100644 --- a/packages/fuels/package.json +++ b/packages/fuels/package.json @@ -77,8 +77,5 @@ "@fuel-ts/wallet-manager": "workspace:*", "@fuel-ts/wordlists": "workspace:*", "commander": "^9.4.1" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/hasher/package.json b/packages/hasher/package.json index 782874be5f8..d2fc41c3599 100644 --- a/packages/hasher/package.json +++ b/packages/hasher/package.json @@ -35,8 +35,5 @@ "devDependencies": { "@fuel-ts/testcases": "workspace:*", "@types/lodash.clonedeep": "^4.5.7" - }, - "optionalDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/hdwallet/package.json b/packages/hdwallet/package.json index a750a9c27ac..f3ba8e31f16 100644 --- a/packages/hdwallet/package.json +++ b/packages/hdwallet/package.json @@ -29,8 +29,5 @@ "@fuel-ts/math": "workspace:*", "@fuel-ts/mnemonic": "workspace:*", "@fuel-ts/signer": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/interfaces/package.json b/packages/interfaces/package.json index eb391d69151..749b7a7ff64 100644 --- a/packages/interfaces/package.json +++ b/packages/interfaces/package.json @@ -21,9 +21,5 @@ "build": "tsup", "build:watch": "tsup --watch" }, - "license": "Apache-2.0", - "dependencies": {}, - "devDependencies": { - "@internal/tsup": "workspace:*" - } + "license": "Apache-2.0" } diff --git a/packages/keystore/package.json b/packages/keystore/package.json index 7dd5e58c390..22814f72e5e 100644 --- a/packages/keystore/package.json +++ b/packages/keystore/package.json @@ -25,8 +25,5 @@ "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/pbkdf2": "^5.7.0" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/math/package.json b/packages/math/package.json index 2b07c2db4f9..24c5fdb8d4a 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -48,8 +48,5 @@ "dependencies": { "@types/bn.js": "^5.1.1", "bn.js": "^5.2.1" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/merkle-shared/package.json b/packages/merkle-shared/package.json index 7c14845ccc6..cb55045c387 100644 --- a/packages/merkle-shared/package.json +++ b/packages/merkle-shared/package.json @@ -25,8 +25,5 @@ "dependencies": { "@ethersproject/bytes": "^5.7.0", "@ethersproject/sha2": "^5.7.0" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/merkle/package.json b/packages/merkle/package.json index 77272826d5f..4c19db9aba8 100644 --- a/packages/merkle/package.json +++ b/packages/merkle/package.json @@ -25,8 +25,5 @@ "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/merklesum/package.json b/packages/merklesum/package.json index e0a16e8a836..e228c0c5487 100644 --- a/packages/merklesum/package.json +++ b/packages/merklesum/package.json @@ -25,8 +25,5 @@ "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/mnemonic/package.json b/packages/mnemonic/package.json index 5d4e27f6a5c..84db64e8361 100644 --- a/packages/mnemonic/package.json +++ b/packages/mnemonic/package.json @@ -29,8 +29,5 @@ "@ethersproject/sha2": "^5.7.0", "@fuel-ts/keystore": "workspace:*", "@fuel-ts/wordlists": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/predicate/package.json b/packages/predicate/package.json index d473e754ca5..bb46508c312 100644 --- a/packages/predicate/package.json +++ b/packages/predicate/package.json @@ -35,7 +35,6 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@fuel-ts/math": "workspace:*", - "@internal/tsup": "workspace:*" + "@fuel-ts/math": "workspace:*" } } diff --git a/packages/program/package.json b/packages/program/package.json index 3f41a2f6b79..e5f207406b1 100644 --- a/packages/program/package.json +++ b/packages/program/package.json @@ -58,7 +58,6 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@internal/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/providers/package.json b/packages/providers/package.json index 7d06dab1ee6..5cb202c5f40 100644 --- a/packages/providers/package.json +++ b/packages/providers/package.json @@ -45,7 +45,6 @@ "@graphql-codegen/typescript": "^2.8.0", "@graphql-codegen/typescript-graphql-request": "^4.5.7", "@graphql-codegen/typescript-operations": "^2.5.5", - "@internal/tsup": "workspace:*", "@types/lodash.clonedeep": "^4.5.7", "get-graphql-schema": "^2.1.2", "typescript": "^4.8.4" diff --git a/packages/script/package.json b/packages/script/package.json index 0d17e3c119a..aefbaf29c46 100644 --- a/packages/script/package.json +++ b/packages/script/package.json @@ -37,7 +37,6 @@ "@fuel-ts/wallet": "workspace:*" }, "devDependencies": { - "@internal/tsup": "workspace:*", "forc-bin": "workspace:*" } } diff --git a/packages/signer/package.json b/packages/signer/package.json index 4de85cce998..29037f8b3d8 100644 --- a/packages/signer/package.json +++ b/packages/signer/package.json @@ -33,7 +33,6 @@ }, "devDependencies": { "@fuel-ts/testcases": "workspace:*", - "@internal/tsup": "workspace:*", "@types/elliptic": "^6.4.14" } } diff --git a/packages/sparsemerkle/package.json b/packages/sparsemerkle/package.json index 0dfe954f39f..8b4ec1bf568 100644 --- a/packages/sparsemerkle/package.json +++ b/packages/sparsemerkle/package.json @@ -25,8 +25,5 @@ "dependencies": { "@fuel-ts/math": "workspace:*", "@fuel-ts/merkle-shared": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/transactions/package.json b/packages/transactions/package.json index 0d34d9b863b..e7920dd4dd6 100644 --- a/packages/transactions/package.json +++ b/packages/transactions/package.json @@ -51,8 +51,5 @@ "@fuel-ts/abi-coder": "workspace:*", "@fuel-ts/math": "workspace:*", "@fuel-ts/address": "workspace:*" - }, - "devDependencies": { - "@internal/tsup": "workspace:*" } } diff --git a/packages/versions/package.json b/packages/versions/package.json index 952f24f4e4b..1e54db834ca 100644 --- a/packages/versions/package.json +++ b/packages/versions/package.json @@ -55,7 +55,6 @@ "semver": "^7.3.8" }, "devDependencies": { - "@internal/tsup": "workspace:*", "@types/cli-table": "^0.3.1", "@types/semver": "^7.3.13" } diff --git a/packages/wallet-manager/package.json b/packages/wallet-manager/package.json index 0a0246707a5..e1e32870f8a 100644 --- a/packages/wallet-manager/package.json +++ b/packages/wallet-manager/package.json @@ -32,7 +32,6 @@ }, "devDependencies": { "@fuel-ts/hasher": "workspace:*", - "@fuel-ts/signer": "workspace:*", - "@internal/tsup": "workspace:*" + "@fuel-ts/signer": "workspace:*" } } diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 58c0db699f9..38316100571 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -72,7 +72,6 @@ "devDependencies": { "@fuel-ts/address": "workspace:*", "@fuel-ts/keystore": "workspace:*", - "@fuel-ts/testcases": "workspace:*", - "@internal/tsup": "workspace:*" + "@fuel-ts/testcases": "workspace:*" } } diff --git a/packages/wordlists/package.json b/packages/wordlists/package.json index 67c83b0c150..315f87ea581 100644 --- a/packages/wordlists/package.json +++ b/packages/wordlists/package.json @@ -19,9 +19,6 @@ "build": "tsup", "build:watch": "tsup --watch" }, - "devDependencies": { - "@internal/tsup": "workspace:*" - }, "publishConfig": { "types": "dist/index.d.ts" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2989172d754..294f6477c3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ importers: '@ethersproject/bytes': specifier: ^5.7.0 version: 5.7.0 + '@internal/tsup': + specifier: workspace:* + version: link:internal/tsup '@jest/types': specifier: ^29.5.0 version: 29.5.0 @@ -201,10 +204,6 @@ importers: type-fest: specifier: ^3.1.0 version: 3.2.0 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/abi-typegen: dependencies: @@ -236,9 +235,6 @@ importers: specifier: ^3.0.2 version: 3.0.2 devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup '@types/glob': specifier: ^8.0.0 version: 8.0.0 @@ -285,9 +281,6 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/contract: dependencies: @@ -328,9 +321,6 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -365,10 +355,6 @@ importers: shelljs: specifier: ^0.8.5 version: 0.8.5 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/fuel-gauge: dependencies: @@ -466,10 +452,6 @@ importers: commander: specifier: ^9.4.1 version: 9.4.1 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/hasher: dependencies: @@ -497,10 +479,6 @@ importers: lodash.clonedeep: specifier: ^4.5.0 version: 4.5.0 - optionalDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup devDependencies: '@fuel-ts/testcases': specifier: workspace:* @@ -529,16 +507,8 @@ importers: '@fuel-ts/signer': specifier: workspace:* version: link:../signer - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup - packages/interfaces: - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup + packages/interfaces: {} packages/keystore: dependencies: @@ -548,10 +518,6 @@ importers: '@ethersproject/pbkdf2': specifier: ^5.7.0 version: 5.7.0 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/math: dependencies: @@ -561,10 +527,6 @@ importers: bn.js: specifier: ^5.2.1 version: 5.2.1 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/merkle: dependencies: @@ -574,10 +536,6 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/merkle-shared: dependencies: @@ -587,10 +545,6 @@ importers: '@ethersproject/sha2': specifier: ^5.7.0 version: 5.7.0 - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/merklesum: dependencies: @@ -600,10 +554,6 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/mnemonic: dependencies: @@ -625,10 +575,6 @@ importers: '@fuel-ts/wordlists': specifier: workspace:* version: link:../wordlists - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/predicate: dependencies: @@ -666,9 +612,6 @@ importers: '@fuel-ts/math': specifier: workspace:* version: link:../math - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/program: dependencies: @@ -703,9 +646,6 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -764,9 +704,6 @@ importers: '@graphql-codegen/typescript-operations': specifier: ^2.5.5 version: 2.5.7(graphql@16.6.0) - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup '@types/lodash.clonedeep': specifier: ^4.5.7 version: 4.5.7 @@ -810,9 +747,6 @@ importers: specifier: workspace:* version: link:../wallet devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup forc-bin: specifier: workspace:* version: link:../forc-bin @@ -844,9 +778,6 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup '@types/elliptic': specifier: ^6.4.14 version: 6.4.14 @@ -859,10 +790,6 @@ importers: '@fuel-ts/merkle-shared': specifier: workspace:* version: link:../merkle-shared - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/testcases: {} @@ -883,10 +810,6 @@ importers: '@fuel-ts/math': specifier: workspace:* version: link:../math - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/versions: dependencies: @@ -900,9 +823,6 @@ importers: specifier: ^7.3.8 version: 7.3.8 devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup '@types/cli-table': specifier: ^0.3.1 version: 0.3.1 @@ -952,9 +872,6 @@ importers: '@fuel-ts/testcases': specifier: workspace:* version: link:../testcases - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup packages/wallet-manager: dependencies: @@ -983,15 +900,8 @@ importers: '@fuel-ts/signer': specifier: workspace:* version: link:../signer - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup - packages/wordlists: - devDependencies: - '@internal/tsup': - specifier: workspace:* - version: link:../../internal/tsup + packages/wordlists: {} packages: From 4277a96922efaf7080c34dacb528077a3e9dfe51 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 14:50:23 -0300 Subject: [PATCH 15/41] Adjusting tsup configs for `forc-bin` --- packages/forc-bin/tsup.config.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/forc-bin/tsup.config.ts b/packages/forc-bin/tsup.config.ts index 8e194975296..660888cc44b 100644 --- a/packages/forc-bin/tsup.config.ts +++ b/packages/forc-bin/tsup.config.ts @@ -1,6 +1,17 @@ -import { index } from '@internal/tsup'; +/** + * We don't inherit from '@internal/tsup' for this + * case because at this point, the package might not + * have been built yet, since this config will probably + * be called before the `build` even starts. + */ +// import { index } from '@internal/tsup'; export default { - ...index, + clean: true, + dts: true, entry: ['src/index.ts', 'src/cli.ts', 'src/install.ts', 'src/update.ts'], + format: ['cjs', 'esm', 'iife'], + minify: false, + sourcemap: true, + splitting: false, }; From ae476a34f9211e850ca230d21bf3b90b195c1b61 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 15:02:46 -0300 Subject: [PATCH 16/41] Lintfix --- packages/forc-bin/tsup.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/forc-bin/tsup.config.ts b/packages/forc-bin/tsup.config.ts index 660888cc44b..dbf12be2a7a 100644 --- a/packages/forc-bin/tsup.config.ts +++ b/packages/forc-bin/tsup.config.ts @@ -1,4 +1,4 @@ -/** +/* * We don't inherit from '@internal/tsup' for this * case because at this point, the package might not * have been built yet, since this config will probably From 9ab72b3653c9cf329760908335d95fc6b2d62353 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 16:29:27 -0300 Subject: [PATCH 17/41] Configuring `nodemon` for optimal file-watch performance --- nodemon.config.json | 15 +++++++++++++++ package.json | 2 +- pnpm-lock.yaml | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 nodemon.config.json diff --git a/nodemon.config.json b/nodemon.config.json new file mode 100644 index 00000000000..38f5d28b1bc --- /dev/null +++ b/nodemon.config.json @@ -0,0 +1,15 @@ +{ + "verbose": true, + "ext": "ts", + "watch": "packages", + "ignore": [ + "**/__generated__/**", + "**/*.js", + "**/*.mjs", + "**/dist/**", + "**/Forc.lock", + "**/getSupportedVersions.ts", + "**/out/debug/**", + "packages/example-contract/src/example-contract-types/**" + ] +} diff --git a/package.json b/package.json index d5a0f5c862a..d70523e842f 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "packageManager": "pnpm@8.1.1", "scripts": { + "dev": "nodemon --config nodemon.config.json -x 'turbo run build --filter=!fuel-gauge'", "build": "turbo run build", - "build:watch": "turbo run build --parallel -- --watch", "ci:test": "./scripts/ci-test.sh", "pretest": "turbo run pretest", "test": "jest --no-cache --runInBand --coverage", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 294f6477c3d..93403068760 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,6 +103,9 @@ importers: markdownlint-cli: specifier: ^0.27.1 version: 0.27.1 + nodemon: + specifier: ^2.0.22 + version: 2.0.22 npm-run-all: specifier: ^4.1.5 version: 4.1.5 From 9efdd8afffbc85d6e341152153bdfe78bed9da64 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 16:29:33 -0300 Subject: [PATCH 18/41] Sorting --- package.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d70523e842f..8fd1cff79d4 100644 --- a/package.json +++ b/package.json @@ -48,14 +48,15 @@ "@internal/tsup": "workspace:*", "@jest/types": "^29.5.0", "@types/jest": "^29.5.0", - "@types/node-fetch": "^2.6.2", "@types/node": "18.15.3", + "@types/node-fetch": "^2.6.2", "@types/shelljs": "^0.8.11", "@types/web": "^0.0.65", "@typescript-eslint/eslint-plugin": "^5.40.1", "@typescript-eslint/parser": "^5.40.1", "conventional-changelog-angular": "^5.0.13", "dotenv": "^9.0.2", + "eslint": "^8.26.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^16.2.0", "eslint-config-prettier": "^8.5.0", @@ -64,17 +65,17 @@ "eslint-plugin-jsdoc": "^37.9.7", "eslint-plugin-jsx-a11y": "^6.6.1", "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react": "^7.31.10", + "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-tsdoc": "^0.2.17", - "eslint": "^8.26.0", "ethers": "^5.7.2", "forc-bin": "workspace:*", "husky": "^8.0.3", - "jest-text-transformer": "^1.0.4", "jest": "^29.5.0", - "markdownlint-cli": "^0.27.1", + "jest-text-transformer": "^1.0.4", "markdownlint": "^0.23.1", + "markdownlint-cli": "^0.27.1", + "nodemon": "^2.0.22", "npm-run-all": "^4.1.5", "open": "^8.4.0", "prettier": "^2.7.1", From 6e4a5f429f1f540ba12242c34ba5df3610a144ce Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 16:29:39 -0300 Subject: [PATCH 19/41] Docs --- CONTRIBUTING.md | 161 ++++++++++++++++++++++++++++++------------------ README.md | 75 ++++++++++------------ 2 files changed, 131 insertions(+), 105 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6ada02ac76..ec455c98c6a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,10 @@ -## 💚 Contributing To Fuel TypeScript SDK +# Contributing To Fuel TypeScript SDK -Thanks for your interest in contributing to the Fuel TypeScript SDK! This document outlines the process for installing dependencies, setting up for development, and conventions for contributing. +Thanks for your interest in contributing to the Fuel TypeScript SDK! -## Finding Something to Work On +This document outlines the process for installing dependencies, setting up for development, and conventions for contributing. + +# Finding Something to Work On There are many ways in which you may contribute to the project, some of which involve coding knowledge and some which do not. A few examples include: @@ -14,7 +16,7 @@ Check out our [Help Wanted](https://github.com/FuelLabs/fuels-ts/issues?q=is%3Ao If you are planning something big, for example, changes related to multiple components or changes to current behaviors, make sure to [open an issue](https://github.com/FuelLabs/fuels-ts/issues/new) to discuss with us before starting on the implementation. -### Setup +# Setting up ```sh git clone git@github.com:FuelLabs/fuels-ts.git @@ -23,9 +25,76 @@ pnpm install pnpm build ``` -## Testing +# Developing + +For building everything in watch-mode, run: + +```sh +# build all projects in watch-mode +pnpm dev +``` + +File watching is done by `nodemon` for increased performance. + +Check `nodemon.config.json` for all settings. + +> **Note**: You can `pnpm dev` a single package: +> +> ```sh +> cd packages/abi-coder +> pnpm dev +> ``` + +# Using local sym-linked packages + +First, we need to link our `fuels` package globally in our local `global pnpm store`: + +```sh +cd fuels-ts/packages/fuels +pnpm link --global +``` + +Let's check it out: + +```sh +pnpm list --global +``` + +Cool, now on the root directory of `my-local-project`: + +```sh +cd my-local-project +pnpm link --global fuels +``` + +That's it — `my-local-project` is now using our local version of `fuels`. + +The same can be done with all other packages: + +```sh +cd fuels-ts/packages/wallet +pnpm link --global + +# ... + +pnpm list --global # validating + +# ... + +cd my-local-project +pnpm link --global @fuel-ts/wallet +``` + +> **Warning** When using your local version of `fuels`, remember that you need to run `pnpm build` on every change you do to source files, otherwise the changes won't be propagated to dependent apps using it. More often, you'll want to use `pnpm dev`. + +See also: + +- [Developing](#Developing) + +# Testing In order to run tests locally, you need `fuel-core` running as a docker container. + To do that run this command in your terminal: ```sh @@ -37,10 +106,15 @@ And then run the tests in another terminal tab: ```sh # run all tests pnpm test -# run tests and get coverage -pnpm test -- --coverage + +# run tests while passing other flags to sub-program +pnpm test -- --coverage --my-other-flag + # run tests for a specific package -pnpm --filter @fuel-ts/contract run test +pnpm test packages/my-desired-package + +# run tests for a specific file +pnpm test packages/my-desired-package/src/my.test.ts ``` Or if you want to run docker and all tests serially you can do: @@ -51,10 +125,10 @@ pnpm ci:test This will run `services:run`, `test` and then `services:clean` -> The tests may break if you are running your tests locally using`services:run` in a separate terminal. +> The tests may break if you are running your tests locally using `services:run` in a separate terminal. > To fix this run `services:clean` to clean docker containers and volumes. -## Commit Convention +# Commit Convention Before you create a Pull Request, please check whether your commits comply with the commit conventions used in this repository. @@ -79,7 +153,7 @@ the following categories: - `chore`: all changes to the repository that do not fit into any of the above categories -## Steps to PR +# Steps to PR 1. Fork the fuels-ts repository and clone your fork @@ -100,74 +174,39 @@ the following categories: > `pnpm changeset add --empty` to generate an empty changeset file to document > your changes. -## Git Hooks +# Git Hooks The SDK utilizes a pre-push git hook to validate your contribution before review. This is a script that will run automatically before changes are pushed to the remote repository. Within the SDK, the pre-push script will run code linting. > This can be overridden using the `--no-verify` flag when pushing. -## Build and watch all packages - -If you want to work locally using realtime builds, open in one terminal tab build in watch mode -on all packages from the root directory: - -```sh -pnpm build:watch -``` - -This command will run `tsup --watch` on all packages using Turborepo - -## Using linked packages - -This will link all packages inside our monorepo in your `global pnpm store`, enabling you to use `fuels-ts` packages via links in -your local projects. - -### On `fuels-ts` root directory - -```sh -pnpm -r exec pnpm link --global --dir ./ -``` - -You can use [build watch](#build-and-watch-all-packages). - -### On `your project` root directory - -```sh -pnpm link --global fuels -``` +# Updating Forc version -Or for specfic packages just use `pnpm link @fuel-ts/`, ex; +The following script will upgrade Forc to the latest version on GitHub, remove all lockfiles so the latest stdlib can be used, and rebuild all projects: ```sh -pnpm link --global @fuel-ts/wallet +pnpm forc:update ``` -### Troubleshooting - -If you're linking for the first time, you might need: +After this you should run tests and fix any incompatibilities. -```sh - pnpm setup -``` +# Updating Fuel Core version -If it still have problems, you might need to setup again (As `pnpm` releases new version, the global folder structure may change) +Manually edit the `services/fuel-core/Dockerfile`, add the right version, and then: ```sh - pnpm setup +pnpm services:clean # causes rebuilding of the Docker image +pnpm test:ci ``` -## Updating Forc version +If all tests pass, that's it. -The following script will upgrade Forc to the latest version on GitHub, remove all lockfiles so the latest stdlib can be used, and rebuild all projects: +Otherwise, you have work to do. -```sh -pnpm forc:update -``` - -After this you should run tests and fix any incompatibilities. - -## FAQ +# FAQ ### Why is the prefix `fuels` and not `fuel`? -In order to make the SDK for Fuel feel familiar with those coming from the [ethers.js](https://github.com/ethers-io/ethers.js) ecosystem, this project opted for an `s` at the end. The `fuels-*` family of SDKs is inspired by The Ethers Project. +In order to make the SDK for Fuel feel familiar with those coming from the [ethers.js](https://github.com/ethers-io/ethers.js) ecosystem, this project opted for an `s` at the end. + +The `fuels-*` family of SDKs is inspired by The Ethers Project. diff --git a/README.md b/README.md index 935b5fa5cf3..875ab23a20d 100644 --- a/README.md +++ b/README.md @@ -10,56 +10,30 @@ [![docs](https://img.shields.io/badge/docs-fuels.ts-brightgreen.svg?style=flat)](https://fuellabs.github.io/fuels-ts/) [![discord](https://img.shields.io/badge/chat%20on-discord-orange?&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/xfpK4Pe) -## Table of contents +# Resources + +The [documentation](https://fuellabs.github.io/fuels-ts) site is your main stop for resources. - [Quickstart](https://fuellabs.github.io/fuel-docs/master/quickstart/developer-quickstart.html) - [Documentation](https://fuellabs.github.io/fuels-ts) -- [Install](#install) -- [Import](#import) -- [Interacting with Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/managing-deployed-contracts.html) -- [Generate Types from ABI](https://fuellabs.github.io/fuels-ts/guide/abi-typegen/generating-types-from-abi.html) - - [Using Generated Types](https://fuellabs.github.io/fuels-ts/guide/abi-typegen/using-generated-types.html) -- [Deploying Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/deploying-contracts) -- [CLI](#cli) + - [Wallets](https://fuellabs.github.io/fuels-ts/guide/wallets/) + - [Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/interacting-with-contracts.html) + - [Scripts](https://fuellabs.github.io/fuels-ts/guide/scripts/) + - [Predicates](https://fuellabs.github.io/fuels-ts/guide/predicates/) + - [ABI Typegen](https://fuellabs.github.io/fuels-ts/guide/abi-typegen/) - [Contributing](https://github.com/FuelLabs/fuels-ts/blob/master/CONTRIBUTING.md) -- [License](#license) - -## Quickstart - -We recommend starting with the [Quickstart](https://fuellabs.github.io/fuel-docs/master/quickstart/developer-quickstart.html) to speed-up and build your first DApp using Fuel. - -- [Other example projects](https://github.com/FuelLabs/sway-applications) - -## Documentation - -You can find in-depth [usage and examples in our Guide](https://fuellabs.github.io/fuels-ts/guide), or deep-dive into the internals with our detailed [SDK Documentation](https://fuellabs.github.io/fuels-ts). - -## The Fuel Ecosystem - -Learn more about the Fuel Ecosystem. - -- [🌴 Sway](https://fuellabs.github.io/sway/) the new language. Empowering everyone to build reliable and efficient smart contracts. -- [🧰 Forc](https://fuellabs.github.io/sway/v0.30.1/forc/index.html) the Fuel toolbox. Build, deploy and manage your sway projects. -- [⚙️ Fuel Core](https://github.com/FuelLabs/fuel-core) the new FuelVM, a blazingly fast blockchain VM. -- [🔗 Fuel Specs](https://github.com/FuelLabs/fuel-specs) the Fuel protocol specifications. -- [🦀 RUST SDK](https://github.com/FuelLabs/fuels-rs) a robust SDK in rust. -- [⚡ Fuel Network](https://fuel.network/) the project. +- [The Fuel Forum](https://forum.fuel.network/) +- [The Fuel Ecosystem](#the-fuel-ecosystem) -## Install - -#### YARN - -```sh -yarn add fuels -``` - -#### NPM +# Install ```sh npm install fuels --save ``` -## Import +# Import + +Simple example usages. ```ts import { Wallet } from "fuels"; @@ -71,13 +45,13 @@ console.log(Wallet.generate()); console.log(new Wallet("0x0000...0000")); ``` -## CLI +# CLI Fuels include some utility commands via built-in CLI tool. ```console -$ yarn add fuels -$ yarn exec fuels -h +$ npm add fuels +$ npx fuels --help Usage: fuels [options] [command] Options: @@ -90,6 +64,19 @@ Commands: help [command] display help for command ``` -## License +# The Fuel Ecosystem + +Learn more about the Fuel Ecosystem. + +- [🌴 Sway](https://fuellabs.github.io/sway/) — The new language, empowering everyone to build reliable and efficient smart contracts +- [🧰 Forc](https://fuellabs.github.io/sway/v0.30.1/forc/index.html) — The Fuel toolbox: _Build, deploy and manage your sway projects_ +- [⚙️ Fuel Core](https://github.com/FuelLabs/fuel-core) — The new FuelVM, a blazingly fast blockchain VM +- [🔗 Fuel Specs](https://github.com/FuelLabs/fuel-specs) — The Fuel protocol specifications +- [💼 Fuels Wallet](https://github.com/FuelLabs/fuels-wallet) — The Official Fuels Wallet +- [🦀 Rust SDK](https://github.com/FuelLabs/fuels-rs) — A robust SDK in rust +- [⚡ Fuel Network](https://fuel.network/) — The project +- [📚 The Fuel Forum](https://forum.fuel.network/) — Ask questions, get updates, and contribute to a modular future + +# License The primary license for this repo is `Apache 2.0`, see [`LICENSE`](https://github.com/FuelLabs/fuels-ts/blob/master/LICENSE). From 932cf2a605ab63b1ee1d5f113a129cf9d458ec04 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 5 May 2023 17:08:04 -0300 Subject: [PATCH 20/41] DRY tsup config for `fuels` --- packages/fuels/tsup.config.ts | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/packages/fuels/tsup.config.ts b/packages/fuels/tsup.config.ts index 37f5dcb1351..66e3a6c691b 100644 --- a/packages/fuels/tsup.config.ts +++ b/packages/fuels/tsup.config.ts @@ -1,29 +1,3 @@ -import { index } from '@internal/tsup'; -import type { Options } from 'tsup'; +import { indexBinAndCli } from '@internal/tsup'; -const primary = { - index: 'src/index.ts', -}; - -const secondaries = { - bin: 'src/bin.ts', - cli: 'src/cli.ts', -}; - -const configs: Options[] = [ - { - ...index, - entry: { ...primary }, - dts: { - banner: Object.keys(secondaries) - .map((key) => `import './${key}';`) - .join('\n'), - }, - }, - { - ...index, - entry: { ...secondaries }, - }, -]; - -export default configs; +export default indexBinAndCli; From e8f2ce49cb0f2b331c39d62019b9ece8c99480ef Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 May 2023 10:08:53 -0300 Subject: [PATCH 21/41] Moving commands from external script to `package.json` --- packages/example-contract/package.json | 3 ++- packages/example-contract/scripts/build.sh | 9 --------- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100755 packages/example-contract/scripts/build.sh diff --git a/packages/example-contract/package.json b/packages/example-contract/package.json index 5eb910fd717..4a87542caff 100644 --- a/packages/example-contract/package.json +++ b/packages/example-contract/package.json @@ -5,7 +5,8 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "scripts": { - "build": "./scripts/build.sh" + "prebuild": "forc build", + "build": "fuels typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" }, "license": "Apache-2.0", "dependencies": { diff --git a/packages/example-contract/scripts/build.sh b/packages/example-contract/scripts/build.sh deleted file mode 100755 index fafc52bddfa..00000000000 --- a/packages/example-contract/scripts/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# We run install again to make sure `fuels typegen` CLI is correct setup -# this issue ocorrus becuase the CLI tool is under the same monorepo -pnpm install -pnpm forc build -pnpm fuels typegen -i out/debug/example-contract-abi.json -o src/example-contract-types From abdc0aaec1e9c3a28d764fa2688afbd4ce46af80 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 May 2023 10:10:33 -0300 Subject: [PATCH 22/41] Re-configuring newly added `utils` package --- packages/utils/package.json | 31 +++++++++++++------------------ packages/utils/tsup.config.ts | 26 ++++++++++++++------------ 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/packages/utils/package.json b/packages/utils/package.json index acb1bb02a3d..d66d6b66510 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -4,8 +4,16 @@ "description": "Utilities (and test utilities) collection", "author": "Fuel Labs (https://fuel.network/)", "exports": { - ".": "./src/utils/index.ts", - "./test": "./src/test-utils/index.ts" + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./test": { + "import": "./dist/test.mjs", + "require": "./dist/test.js", + "types": "./dist/test.d.ts" + } }, "typesVersions": { "*": { @@ -18,8 +26,6 @@ } }, "publishConfig": { - "main": "dist/index.js", - "module": "dist/index.mjs", "typesVersions": { "*": { "index.d.ts": [ @@ -29,28 +35,17 @@ "./dist/test.d.ts" ] } - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./test": { - "import": "./dist/test.mjs", - "require": "./dist/test.js", - "types": "./dist/test.d.ts" - } } }, "files": [ "dist" ], - "license": "Apache-2.0", "scripts": { "pretest": "cd test/forc-projects/simple && forc build", - "build": "tsup --dts" + "build": "tsup", + "build:watch": "tsup --watch" }, + "license": "Apache-2.0", "dependencies": { "lodash.upperfirst": "^4.3.1", "rimraf": "^3.0.2" diff --git a/packages/utils/tsup.config.ts b/packages/utils/tsup.config.ts index fd017bb2968..38863e29cf4 100644 --- a/packages/utils/tsup.config.ts +++ b/packages/utils/tsup.config.ts @@ -1,14 +1,16 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { defineConfig } from 'tsup'; +import { index } from '@internal/tsup'; +import type { Options } from 'tsup'; -export default defineConfig((options) => ({ - entry: { - index: 'src/utils/index.ts', - test: 'src/test-utils/index.ts', +const entrypoints: Options[] = [ + { + ...index, + entry: { index: 'src/utils/index.ts' }, + dts: { banner: `import './test';` }, }, - format: ['cjs', 'esm', 'iife'], - splitting: false, - sourcemap: true, - clean: false, - minify: !options.watch, -})); + { + ...index, + entry: { test: 'src/test-utils/index.ts' }, + }, +]; + +export default entrypoints; From a6423c674d11098af81b2f0fd2da16d59a1d38bf Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 May 2023 10:25:49 -0300 Subject: [PATCH 23/41] Referencing bin directly (symlink is broken at first execution) --- packages/example-contract/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/example-contract/package.json b/packages/example-contract/package.json index 4a87542caff..3f23b7fd2ea 100644 --- a/packages/example-contract/package.json +++ b/packages/example-contract/package.json @@ -6,7 +6,7 @@ "author": "Fuel Labs (https://fuel.network/)", "scripts": { "prebuild": "forc build", - "build": "fuels typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" + "build": "node ./node_modules/fuels/dist/bin.js typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" }, "license": "Apache-2.0", "dependencies": { From 5fe8d3cdaf67166528433ffd9fec100e661b6bc7 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Mon, 8 May 2023 18:46:48 -0300 Subject: [PATCH 24/41] Fixing workflow, ensuring only the first regex match is used (head -1) --- .github/workflows/pr-release.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 01d5e7e2a43..34ad25146b1 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -33,21 +33,18 @@ jobs: run: | pnpm changeset:next git add .changeset/fuel-labs-ci.md - pnpm changeset version --snapshot pr-${{ github.event.pull_request.number }} - echo "version=$(pnpm changeset publish --tag pr-${{ github.event.pull_request.number }})" >> $GITHUB_OUTPUT + pnpm changeset version --snapshot pr-${{ env.PR_NUMBER }} + changetsets=$(pnpm changeset publish --tag pr-${{ env.PR_NUMBER }}) + published_version=$(echo "$changetsets" | grep -oP '@\K([0-9]+\.){2}[0-9]+-pr-${{ env.PR_NUMBER }}-\d+' | head -1) + echo "published_version=$published_version" >> $GITHUB_OUTPUT env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set published version - run: | - published_version=$(echo "${{ steps.release.outputs.version }}" | grep -oP '@\K([0-9]+\.){2}[0-9]+-pr-${{ github.event.pull_request.number }}-\d+') - echo "published_version=$published_version" >> $GITHUB_OUTPUT - id: set_version + PR_NUMBER: ${{ github.event.pull_request.number }} - uses: mshick/add-pr-comment@v2 with: message: | - This PR is published in NPM with version **${{ steps.set_version.outputs.published_version }}** + This PR is published in NPM with version **${{ steps.release.outputs.published_version }}** env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5b565aa81dc2c180fb4e27f342565538c44d0506 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Wed, 10 May 2023 10:43:17 -0300 Subject: [PATCH 25/41] Improving docs --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec455c98c6a..bf4fc6f3b76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ cd my-local-project pnpm link --global @fuel-ts/wallet ``` -> **Warning** When using your local version of `fuels`, remember that you need to run `pnpm build` on every change you do to source files, otherwise the changes won't be propagated to dependent apps using it. More often, you'll want to use `pnpm dev`. +> **Warning** When using local symlinked `fuels-ts` in `your-local-project`, remember to `pnpm build` the SDK whenever you change a source file to reflect the changes on `your-local-project`. To automate this, you can use `pnpm dev`, which will keep watching and compiling everything automatically while developing. See also: From 59651dae69229b427a0efb3506c5482fb7f0dac7 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Wed, 10 May 2023 15:06:00 -0300 Subject: [PATCH 26/41] Turning off PR auto-release --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 34ad25146b1..9b48fc2352a 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - # if: false + if: false permissions: write-all steps: - name: Checkout From 9fbd9445806d06810a0fae7051c3b7e319834cbd Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 06:54:26 -0300 Subject: [PATCH 27/41] Update CONTRIBUTING.md Co-authored-by: Daniel Bate --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf4fc6f3b76..d62c46e4d15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Thanks for your interest in contributing to the Fuel TypeScript SDK! -This document outlines the process for installing dependencies, setting up for development, and conventions for contributing. +This document outlines the process for installing dependencies, setting up for development and conventions for contributing. # Finding Something to Work On From 55685626580533b14270c35309be158177d13949 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 07:02:02 -0300 Subject: [PATCH 28/41] Resetting docker env before (and after) running tests --- scripts/ci-test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ci-test.sh b/scripts/ci-test.sh index 47b732ef72b..67d75443463 100755 --- a/scripts/ci-test.sh +++ b/scripts/ci-test.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Run cleanup +pnpm services:clean + # Run setup pnpm services:run echo $@ From 14082fa44187f4f25fcc85643a238598bcd6d070 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 07:37:46 -0300 Subject: [PATCH 29/41] Better organizing scripts --- packages/example-contract/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/example-contract/package.json b/packages/example-contract/package.json index 3f23b7fd2ea..a0865eca695 100644 --- a/packages/example-contract/package.json +++ b/packages/example-contract/package.json @@ -5,8 +5,9 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "scripts": { - "prebuild": "forc build", - "build": "node ./node_modules/fuels/dist/bin.js typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" + "build": "run-s build:forc build:types", + "build:forc": "pnpm forc build", + "build:types": "node ./node_modules/fuels/dist/cjs/bin.js typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" }, "license": "Apache-2.0", "dependencies": { From 42727212344dd848b1f667c188e7c5562d92e1db Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 08:19:18 -0300 Subject: [PATCH 30/41] Marking package as a core module (installed on the monorepo root) --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 8b0acf6799e..ddf64c2d1a4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { 'plugin:@typescript-eslint/recommended', ], settings: { + 'import/core-modules': ['@internal/tsup'], jsdoc: { mode: 'typescript', }, From 80ca770ab09e55e9df280427a4c168fe0ebccd5b Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 08:23:22 -0300 Subject: [PATCH 31/41] Fixing binary path --- packages/example-contract/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/example-contract/package.json b/packages/example-contract/package.json index a0865eca695..80ea8f9c101 100644 --- a/packages/example-contract/package.json +++ b/packages/example-contract/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "run-s build:forc build:types", "build:forc": "pnpm forc build", - "build:types": "node ./node_modules/fuels/dist/cjs/bin.js typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" + "build:types": "node ./node_modules/fuels/dist/bin.js typegen -i out/debug/example-contract-abi.json -o src/example-contract-types" }, "license": "Apache-2.0", "dependencies": { From 2733db30a8e4468d2fd7307890c382d493c53c6d Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 08:32:38 -0300 Subject: [PATCH 32/41] Publishing a new PR version --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 9b48fc2352a..34ad25146b1 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - if: false + # if: false permissions: write-all steps: - name: Checkout From 8d823a64fce915f9c389fc3529f166ef57df7105 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 09:08:41 -0300 Subject: [PATCH 33/41] Fixing residual merge problems (using `tsx`). --- packages/versions/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/versions/package.json b/packages/versions/package.json index 1e54db834ca..cd16731c0de 100644 --- a/packages/versions/package.json +++ b/packages/versions/package.json @@ -44,7 +44,7 @@ "dist" ], "scripts": { - "prebuild": "ts-node ./scripts/rewriteVersions.ts", + "prebuild": "tsx ./scripts/rewriteVersions.ts", "build": "tsup", "build:watch": "tsup --watch" }, From 75da28a85013ae23c3fd44e5775f5ae9e68e570a Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Thu, 11 May 2023 09:58:14 -0300 Subject: [PATCH 34/41] Disabling PR auto-publish --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 34ad25146b1..9b48fc2352a 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - # if: false + if: false permissions: write-all steps: - name: Checkout From ea6553584f4d7e3b8c627b733fa7e35333ca56bf Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 19 May 2023 07:55:22 -0300 Subject: [PATCH 35/41] Enabling PR auto-publish --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 9b48fc2352a..34ad25146b1 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - if: false + # if: false permissions: write-all steps: - name: Checkout From ac8468908e4f4d6296209bd50ce991fb9e1dece8 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 19 May 2023 07:55:42 -0300 Subject: [PATCH 36/41] Disabling PR auto-publish --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 34ad25146b1..9b48fc2352a 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - # if: false + if: false permissions: write-all steps: - name: Checkout From 5c2948dd7b7c193e495c0080bfc84a5a89f533f5 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 26 May 2023 10:02:39 -0300 Subject: [PATCH 37/41] Fixing broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 875ab23a20d..538af6ab785 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The [documentation](https://fuellabs.github.io/fuels-ts) site is your main stop - [Quickstart](https://fuellabs.github.io/fuel-docs/master/quickstart/developer-quickstart.html) - [Documentation](https://fuellabs.github.io/fuels-ts) - [Wallets](https://fuellabs.github.io/fuels-ts/guide/wallets/) - - [Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/interacting-with-contracts.html) + - [Contracts](https://fuellabs.github.io/fuels-ts/guide/contracts/) - [Scripts](https://fuellabs.github.io/fuels-ts/guide/scripts/) - [Predicates](https://fuellabs.github.io/fuels-ts/guide/predicates/) - [ABI Typegen](https://fuellabs.github.io/fuels-ts/guide/abi-typegen/) From 110e7fa0fca0184848c31186059a823eba50f1af Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 26 May 2023 16:09:48 -0300 Subject: [PATCH 38/41] Re-adding lost `nodemon` dep after merge conflicts --- package.json | 1 + pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index 7cb0beb149b..ba13334de20 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "husky": "^8.0.3", "jest": "^29.5.0", "jest-text-transformer": "^1.0.4", + "nodemon": "^2.0.22", "npm-run-all": "^4.1.5", "open": "^8.4.0", "prettier": "^2.7.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 256bbf971f6..5aa75f96f58 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,6 +100,9 @@ importers: jest-text-transformer: specifier: ^1.0.4 version: 1.0.4 + nodemon: + specifier: ^2.0.22 + version: 2.0.22 npm-run-all: specifier: ^4.1.5 version: 4.1.5 From 47bd0518e2ecb3e18f8db39575b8cfd4398feee0 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 26 May 2023 16:09:59 -0300 Subject: [PATCH 39/41] Docs --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d62c46e4d15..711867c5877 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -192,7 +192,7 @@ After this you should run tests and fix any incompatibilities. # Updating Fuel Core version -Manually edit the `services/fuel-core/Dockerfile`, add the right version, and then: +Manually edit the `.docker/fuel-core/Dockerfile` file, add the right version, and then: ```sh pnpm services:clean # causes rebuilding of the Docker image From 8a8a67271bf3512a39eea581654ea234df7509b8 Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 26 May 2023 17:41:48 -0300 Subject: [PATCH 40/41] Enabling PR auto-publish --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 9b48fc2352a..34ad25146b1 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - if: false + # if: false permissions: write-all steps: - name: Checkout From fa8cf365913d9ce96dc53a1fccb4abc5859eca2b Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Fri, 26 May 2023 17:42:38 -0300 Subject: [PATCH 41/41] Disabling PR auto-publish --- .github/workflows/pr-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index 34ad25146b1..9b48fc2352a 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -8,7 +8,7 @@ jobs: name: "Release PR to npm" runs-on: ubuntu-latest # comment out if:false to enable release PR to npm - # if: false + if: false permissions: write-all steps: - name: Checkout