Skip to content

Commit

Permalink
build: move forc builds to pretest and add build:packages (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedsalk authored Sep 28, 2023
1 parent 80e5381 commit 30076e6
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .changeset/perfect-apes-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
- name: Build
run: pnpm build

# linting of some tests depends on pretest being run so that it generates the necessary files
- name: Pretest
run: pnpm pretest

- name: Lint
run: pnpm lint

Expand Down
1 change: 0 additions & 1 deletion apps/demo-nodejs-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"type": "module",
"license": "Apache-2.0",
"scripts": {
"build": "pnpm test",
"test": "node ./index.mjs"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Simple demo using Typegen generated types",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"scripts": {
"build": "run-s build:forc build:types",
"pretest": "run-s build:forc build:types",
"build:forc": "pnpm fuels-forc build -p contract",
"build:types": "pnpm fuels typegen -i contract/out/debug/demo-contract-abi.json -o src/generated-types"
},
Expand Down
3 changes: 2 additions & 1 deletion apps/docs-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"private": true,
"scripts": {
"build": "pnpm fuels-forc build -p projects"
"pretest": "pnpm build:forc",
"build:forc": "pnpm fuels-forc build -p projects"
},
"devDependencies": {
"fuels": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
},
"packageManager": "[email protected]",
"scripts": {
"dev": "nodemon --config nodemon.config.json -x 'turbo run build --filter=!fuel-gauge'",
"dev": "nodemon --config nodemon.config.json -x 'pnpm build:packages'",
"build": "turbo run build",
"build:packages": "turbo run build --filter=!docs",
"ci:test": "./scripts/ci-test.sh",
"pretest": "turbo run pretest",
"test": "jest --no-cache --runInBand --coverage",
Expand Down
3 changes: 2 additions & 1 deletion packages/abi-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
"dist"
],
"scripts": {
"pretest": "pnpm fuels-forc build -p test/fixtures/forc-projects",
"pretest": "pnpm build:forc",
"build": "tsup",
"build:forc": "pnpm fuels-forc build -p test/fixtures/forc-projects",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-gauge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"scripts": {
"build": "run-s build:forc-projects build:process-predicates",
"build:forc-projects": "pnpm fuels-forc build -p fixtures/forc-projects",
"pretest": "run-s build:forc build:process-predicates",
"build:forc": "pnpm fuels-forc build -p fixtures/forc-projects",
"build:process-predicates": "tsx ./scripts/process-predicates.ts"
},
"license": "Apache-2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"dist"
],
"scripts": {
"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",
"prebuild": "pnpm build:operations",
"build": "tsup",
"build:schema": "get-graphql-schema http://localhost:4000/graphql > fuel-core-schema.graphql && prettier --write fuel-core-schema.graphql",
"build:operations": "pnpm graphql-codegen",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"dist"
],
"scripts": {
"prebuild": "pnpm build-forc-projects",
"pretest": "pnpm build:forc",
"build": "tsup",
"build-forc-projects": "./scripts/build-forc-projects.sh",
"build:forc": "pnpm fuels-forc build -p ./test/call-test-script",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"license": "Apache-2.0",
Expand Down
12 changes: 0 additions & 12 deletions packages/script/scripts/build-call-test-script.sh

This file was deleted.

5 changes: 0 additions & 5 deletions packages/script/scripts/build-forc-projects.sh

This file was deleted.

4 changes: 2 additions & 2 deletions packages/script/src/script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { join } from 'path';

import { jsonAbiMock, jsonAbiFragmentMock } from '../test/fixtures/mocks';

import { Script } from './script';
import { Script } from './index';

const scriptBin = readFileSync(
join(__dirname, './call-test-script/out/debug/call-test-script.bin')
join(__dirname, '../test/call-test-script/out/debug/call-test-script.bin')
);

const setup = async () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"dist"
],
"scripts": {
"pretest": "pnpm fuels-forc build -p test/forc-projects/simple",
"pretest": "pnpm build:forc",
"build": "tsup",
"build:forc": "pnpm fuels-forc build -p test/forc-projects/simple",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"license": "Apache-2.0",
Expand Down

0 comments on commit 30076e6

Please sign in to comment.