Skip to content

chore: optimize build system for local development #3891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/test-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ runs:
with:
bun-version: ${{ inputs.bun-version }}

# Reconfigure `package.json` files to use JS instead of TS
- name: DryPub - expand "publishConfig" inro package.json root
run: pnpm drypub && pnpm install
shell: bash

- name: Build
run: pnpm build
shell: bash
4 changes: 4 additions & 0 deletions .github/workflows/changesets-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
run: |
echo "CHANGESET_PR_TITLE=$(echo "ci(release): \`${{ env.RELEASE_VERSION }}\` @ \`${{ github.ref_name }}\`")" >> $GITHUB_ENV

- name: DryPub - expand "publishConfig" inro package.json root
run: pnpm drypub && pnpm install
shell: bash

- name: Build
run: pnpm build

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish-to-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
- name: CI Setup
uses: ./.github/actions/ci-setup

- name: DryPub - expand "publishConfig" inro package.json root
run: pnpm drypub && pnpm install
shell: bash

- name: Build
run: pnpm build

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}

- name: DryPub - expand "publishConfig" inro package.json root
run: pnpm drypub && pnpm install
shell: bash

- name: Build
run: pnpm build

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
"dev": "nodemon --config nodemon.config.json -x 'pnpm build:packages'",
"build": "turbo run build --cache-dir=.turbo",
"build:packages": "turbo run build --filter=!docs --filter=!template-*",
"ci:test": "./scripts/tests-ci.sh",
"pretest": "turbo run pretest",
"depcheck": "knip --include-libs --dependencies --tags=-knipignore",
"knip:fix": "knip --fix",
"depsync:lint": "syncpack list-mismatches",
"depsync:fix": "syncpack fix-mismatches",
"test": "vitest --run --coverage --config vitest.node.config.mts --project node $(scripts/tests-find.sh --node)",
"test:node": "vitest --run --coverage --config vitest.node.config.mts --project node $(scripts/tests-find.sh --node)",
"drypub": "pnpm tsx scripts/drypub.ts",
"test:browser": "vitest --run --coverage --config vitest.browser.config.mts --project browser $(scripts/tests-find.sh --browser)",
"test:drypub": "pnpm drypub && pnpm build && pnpm test",
"test:all": "run-p test:node test:browser",
"test:filter": "vitest --run --coverage false --config vitest.node.config.mts --project node",
"test:coverage-merge": "tsx ./scripts/tests-coverage-merge.ts",
Expand Down
24 changes: 18 additions & 6 deletions packages/abi-coder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,29 @@
"version": "0.101.0",
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
"engines": {
"node": "^18.20.3 || ^20.0.0 || ^22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"types": "./src/index.ts",
"require": "./src/index.ts",
"import": "./src/index.ts"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
}
},
"files": [
Expand Down
65 changes: 50 additions & 15 deletions packages/abi-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,73 @@
"description": "Generates Typescript definitions from Sway ABI Json files",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"bin": {
"fuels-typegen": "typegen.js"
"fuels-typegen": "typegen.ts"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
"engines": {
"node": "^18.20.3 || ^20.0.0 || ^22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"types": "./src/index.ts",
"require": "./src/index.ts",
"import": "./src/index.ts"
},
"./cli": {
"types": "./dist/cli.d.ts",
"require": "./dist/cli.js",
"import": "./dist/cli.mjs"
"types": "./src/cli.ts",
"require": "./src/cli.ts",
"import": "./src/cli.ts"
},
"./runTypegen": {
"types": "./dist/runTypegen.d.ts",
"require": "./dist/runTypegen.js",
"import": "./dist/runTypegen.mjs"
"types": "./src/runTypegen.ts",
"require": "./src/runTypegen.ts",
"import": "./src/runTypegen.ts"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"bin": {
"fuels-typegen": "typegen.js"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./cli": {
"types": "./dist/cli.d.ts",
"require": "./dist/cli.js",
"import": "./dist/cli.mjs"
},
"./runTypegen": {
"types": "./dist/runTypegen.d.ts",
"require": "./dist/runTypegen.js",
"import": "./dist/runTypegen.mjs"
}
},
"typesVersions": {
"*": {
"cli": [
"./dist/cli.d.ts"
],
"runTypegen": [
"./dist/runTypegen.d.ts"
]
}
}
},
"typesVersions": {
"*": {
"cli": [
"./dist/cli.d.ts"
"./src/cli.ts"
],
"runTypegen": [
"./dist/runTypegen.d.ts"
"./src/runTypegen.ts"
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/abi-typegen/typegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env tsx
require('./src/bin.js');
60 changes: 46 additions & 14 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,68 @@
"version": "0.101.0",
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
"engines": {
"node": "^18.20.3 || ^20.0.0 || ^22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"types": "./src/index.ts",
"require": "./src/index.ts",
"import": "./src/index.ts"
},
"./configs": {
"types": "./dist/configs.d.ts",
"require": "./dist/configs.js",
"import": "./dist/configs.mjs"
"types": "./src/configs.ts",
"require": "./src/configs.ts",
"import": "./src/configs.ts"
},
"./test-utils": {
"types": "./dist/test-utils.d.ts",
"require": "./dist/test-utils.js",
"import": "./dist/test-utils.mjs"
"types": "./src/test-utils.ts",
"require": "./src/test-utils.ts",
"import": "./src/test-utils.ts"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./configs": {
"types": "./dist/configs.d.ts",
"require": "./dist/configs.js",
"import": "./dist/configs.mjs"
},
"./test-utils": {
"types": "./dist/test-utils.d.ts",
"require": "./dist/test-utils.js",
"import": "./dist/test-utils.mjs"
}
},
"typesVersions": {
"*": {
"configs": [
"./dist/configs.d.ts"
],
"test-utils": [
"./dist/test-utils.d.ts"
]
}
}
},
"typesVersions": {
"*": {
"configs": [
"./dist/configs.d.ts"
"./src/configs.ts"
],
"test-utils": [
"./dist/test-utils.d.ts"
"./src/test-utils.ts"
]
}
},
Expand Down
44 changes: 34 additions & 10 deletions packages/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,52 @@
"version": "0.101.0",
"description": "Utilities for encoding and decoding addresses",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
"engines": {
"node": "^18.20.3 || ^20.0.0 || ^22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"types": "./src/index.ts",
"require": "./src/index.ts",
"import": "./src/index.ts"
},
"./configs": {
"types": "./dist/configs.d.ts",
"require": "./dist/configs.js",
"import": "./dist/configs.mjs"
"types": "./src/configs.ts",
"require": "./src/configs.ts",
"import": "./src/configs.ts"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./configs": {
"types": "./dist/configs.d.ts",
"require": "./dist/configs.js",
"import": "./dist/configs.mjs"
}
},
"typesVersions": {
"*": {
"configs": [
"./dist/configs.d.ts"
]
}
}
},
"typesVersions": {
"*": {
"configs": [
"./dist/configs.d.ts"
"./src/configs.ts"
]
}
},
Expand Down
44 changes: 34 additions & 10 deletions packages/contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,52 @@
"version": "0.101.0",
"description": "",
"author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"module": "src/index.ts",
"types": "src/index.ts",
"engines": {
"node": "^18.20.3 || ^20.0.0 || ^22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"types": "./src/index.ts",
"require": "./src/index.ts",
"import": "./src/index.ts"
},
"./test-utils": {
"types": "./dist/test-utils.d.ts",
"require": "./dist/test-utils.js",
"import": "./dist/test-utils.mjs"
"types": "./src/test-utils.ts",
"require": "./src/test-utils.ts",
"import": "./src/test-utils.ts"
}
},
"publishConfig": {
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./test-utils": {
"types": "./dist/test-utils.d.ts",
"require": "./dist/test-utils.js",
"import": "./dist/test-utils.mjs"
}
},
"typesVersions": {
"*": {
"test-utils": [
"./dist/test-utils.d.ts"
]
}
}
},
"typesVersions": {
"*": {
"test-utils": [
"./dist/test-utils.d.ts"
"./src/test-utils.ts"
]
}
},
Expand Down
Loading
Loading