Skip to content

Commit

Permalink
fix: change build tasks in order to use pnpm link correctly (#246)
Browse files Browse the repository at this point in the history
* fix: mjs dist path on package.json

* chore: use dist files as main target on package.json

* chore: add new instruction for build, watch and link
  • Loading branch information
pedronauck committed May 7, 2022
1 parent 4d3d5da commit d386afa
Show file tree
Hide file tree
Showing 23 changed files with 184 additions and 211 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const contract = MyContract__factory.connect(contractId, provider);
git clone git@github.com:FuelLabs/fuels-ts.git
cd fuels-ts
pnpm install
pnpm build
```

### Testing
Expand Down Expand Up @@ -137,6 +138,33 @@ This will run `services:run`, `tests` and then `services:clean`
> maybe you need to run `services:clean` after tests to clean docker containers and volumes. Because
> this can break your tests sometimes!
## 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 you run `tsup --watch` on all packages using Turborepo

### Local links using `pnpm link`

If you want to use local links for development purposes, you can execute this command in the root
of the directory:

```sh
$ pnpm -r exec pnpm link --global --dir ./
```

This will link all packages inside our monorepo in your global pnpm store, then iside the package
you want to use the linked package, just run:

```sh
$ pnpm link --global <pkg-name>
```

## License

The primary license for this repo is `Apache 2.0`, see [`LICENSE`](./LICENSE).
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
"scripts": {
"build": "turbo run build",
"build:watch": "turbo run build --parallel -- --watch",
"ci:test": "run-s services:run test services:clean",
"ci:test-coverage": "run-s services:run test:coverage services:clean",
"test": "jest",
Expand Down
19 changes: 8 additions & 11 deletions packages/abi-coder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/hasher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "Sha256 hash utility for Fuel",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/hdwallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "The Hierarchal Desterministic (HD) Wallet",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/keystore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "./index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/merkle-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
"version": "0.6.0",
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/merkle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/merklesum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/mnemonic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "Mnemonic implementation from BIP39",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
19 changes: 8 additions & 11 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"main": "src/index.ts",
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs.js"
}
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
},
"files": [
Expand Down
Loading

0 comments on commit d386afa

Please sign in to comment.