Skip to content

Commit

Permalink
fix: support for packages with multi bin entry-points (#661)
Browse files Browse the repository at this point in the history
* Adding missing `runTypegen` entry for `abi-typegen` tsup configs
* Enabling `package.json` “exports” keyword via `tsconfig` “module” config
* DRY, fixing exports, standardizing `package.json` for selected packages
* Updating broken imports
* Including docker images when resetting the local environment
* Adding changeset
* Editing changeset
  • Loading branch information
arboleya authored Dec 14, 2022
1 parent 789ed6a commit 9bf1d41
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 39 deletions.
7 changes: 7 additions & 0 deletions .changeset/quick-squids-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fuel-ts/abi-typegen": patch
"fuels": patch
"@fuel-ts/versions": patch
---

fixing support for packages with multi `bin` entry-points
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ services-run:
services-clean:
docker ps --filter name=fuels-ts* -aq | xargs docker stop | xargs docker rm -f
docker volume ls --filter name=fuels-ts* -q | xargs docker volume rm
docker image ls --filter "reference=fuels-ts*" -q | xargs docker rmi
23 changes: 10 additions & 13 deletions packages/abi-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"typedocMain": "./src/index.ts",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"main": "src/index.ts",
"bin": {
"fuels-typegen": "dist/bin.js"
},
Expand All @@ -14,22 +15,18 @@
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": "./dist/cli.js",
"./dist/runTypegen": "./dist/runTypegen.js"
"./cli": {
"require": "./dist/cli.js",
"default": "./dist/cli.mjs"
},
"./runTypegen": {
"require": "./dist/runTypegen.js",
"default": "./dist/runTypegen.mjs"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": "./dist/cli.js",
"./dist/runTypegen": "./dist/runTypegen.js"
}
"module": "dist/index.mjs"
},
"files": [
"dist"
Expand Down
1 change: 1 addition & 0 deletions packages/abi-typegen/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default defineConfig((options) => ({
index: 'src/index.ts',
cli: 'src/cli.ts',
bin: 'src/bin.ts',
runTypegen: 'src/runTypegen.ts',
},
format: ['cjs', 'esm', 'iife'],
splitting: false,
Expand Down
30 changes: 17 additions & 13 deletions packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
"version": "0.25.0",
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"typedoc": {
"entryPoint": "src/index.ts"
},
"typedoc": "src/index.ts",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"main": "src/index.ts",
"bin": "./dist/bin.js",
"bin": {
"fuels": "./dist/bin.js"
},
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": {
"require": "./dist/dist.js",
"default": "./dist/dist.mjs"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
}
"module": "dist/index.mjs"
},
"files": [
"dist"
Expand Down
4 changes: 2 additions & 2 deletions packages/fuels/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { configureCliOptions as routeTypeGen } from '@fuel-ts/abi-typegen/dist/cli';
import { configureCliOptions as routeTypeGen } from '@fuel-ts/abi-typegen/cli';
import { versions } from '@fuel-ts/versions';
import { run as runVersions } from '@fuel-ts/versions/dist/cli';
import { run as runVersions } from '@fuel-ts/versions/cli';
import { Command } from 'commander';

export function run(argv: string[]) {
Expand Down
17 changes: 7 additions & 10 deletions packages/versions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"description": "Validates supported versions of the Fuel toolchain",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"typedocMain": "./src/index.ts",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"main": "src/index.ts",
"bin": {
"fuels-versions": "dist/bin.js"
Expand All @@ -13,19 +15,14 @@
"require": "./dist/index.js",
"default": "./dist/index.mjs"
},
"./dist/cli": "./dist/cli.js"
"./cli": {
"require": "./dist/cli.js",
"default": "./dist/cli.mjs"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
}
}
"module": "dist/index.mjs"
},
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"declarationMap": true,
"esModuleInterop": true,
"lib": ["ES2021"],
"module": "commonjs",
"module": "NodeNext",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
Expand Down

0 comments on commit 9bf1d41

Please sign in to comment.