Skip to content

Commit

Permalink
chore: fix turbo configs for pretest (#1442)
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya authored Nov 19, 2023
1 parent e3a798f commit 4f4b328
Show file tree
Hide file tree
Showing 263 changed files with 150 additions and 121 deletions.
9 changes: 9 additions & 0 deletions .changeset/chilly-grapes-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@fuel-ts/abi-coder": patch
"@fuel-ts/script": patch
"@fuel-ts/utils": patch
---

- Standardizing all forc projects across all packages
- Fixing turbo caching configs for `pretest` pipeline
- Reducing verbosity of `pretest` pipeline
11 changes: 11 additions & 0 deletions apps/demo-typegen/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"pretest": {
"outputMode": "errors-only",
"inputs": ["contract/src/*.sw", "contract/Forc.toml"],
"outputs": ["contract/out/debug/**"]
}
}
}
2 changes: 1 addition & 1 deletion apps/docs-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"pretest": "pnpm build:forc",
"build:forc": "pnpm fuels-forc build -p projects"
"build:forc": "pnpm fuels-forc build -p test/fixtures/forc-projects"
},
"devDependencies": {
"fuels": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider } from 'fuels';
import { BN, BaseAssetId } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { FUEL_NETWORK_URL, Provider, WalletUnlocked } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Provider, WalletUnlocked } from 'fuels';
import { ContractFactory } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { Wallet, BN, BaseAssetId, Provider, FUEL_NETWORK_URL } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BaseAssetId, type Contract, type Provider } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFileSync } from 'fs';
import { Provider, FUEL_NETWORK_URL, Wallet, ContractFactory } from 'fuels';
import { join } from 'path';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand All @@ -13,7 +13,7 @@ describe(__filename, () => {
beforeAll(async () => {
const wallet = await getTestWallet();
PRIVATE_KEY = wallet.privateKey;
projectsPath = join(__dirname, '../../../projects');
projectsPath = join(__dirname, '../../../test/fixtures/forc-projects');

contractName = DocSnippetProjectsEnum.ECHO_VALUES;
});
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/contracts/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider, WalletUnlocked } from 'fuels';
import { BN, ContractFactory } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/contracts/logs.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider } from 'fuels';
import { BN } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AbstractAddress, WalletUnlocked } from 'fuels';
import { ContractFactory, Contract } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/contracts/multicalls.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider } from 'fuels';
import { BaseAssetId, BN, ContractFactory } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { safeExec } from '@fuel-ts/errors/test-utils';
import { BaseAssetId, Wallet, BN, Contract } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider } from 'fuels';
import { BN } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/predicates/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FUEL_NETWORK_URL, Provider, Predicate } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';

describe(__filename, () => {
const { abiContents: jsonAbi, binHexlified: binary } = getDocsSnippetsForcProject(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WalletUnlocked, Predicate, BaseAssetId, BN, getRandomB256 } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
BaseAssetId,
} from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BN, ContractFactory, BaseAssetId, ScriptTransactionRequest } from 'fuels';
import type { CoinQuantityLike, Contract, WalletUnlocked } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { defaultTxParams, getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { WalletUnlocked } from 'fuels';
import { Script, BN } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/arrays.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { BN } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/bits512.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { Wallet } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/bytes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract, Bytes } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe('Bytes', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/conversion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
randomBytes,
} from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';

describe(__filename, () => {
const { abiContents: abi } = getDocsSnippetsForcProject(DocSnippetProjectsEnum.ECHO_VALUES);
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/enums.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/evm-address.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { B256AddressEvm, Contract, EvmAddress } from 'fuels';
import { Address } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe('EvMAddress', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/options.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/raw-slice.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract, BN, RawSlice } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe('RawSlice', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/std-string.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contract, StdString } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe('StdString', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/string.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BN, Contract } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/tuples.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { BN } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs-snippets/src/guide/types/vector.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract } from 'fuels';
import { BN, getRandomB256 } from 'fuels';

import { DocSnippetProjectsEnum } from '../../../projects';
import { DocSnippetProjectsEnum } from '../../../test/fixtures/forc-projects';
import { createAndDeployContractFromProject } from '../../utils';

describe(__filename, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Contract, Provider, TxParams, WalletUnlocked } from 'fuels';
import { Address, BN, ContractFactory, BaseAssetId, Wallet } from 'fuels';

import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../projects';
import { DocSnippetProjectsEnum, getDocsSnippetsForcProject } from '../../../test/fixtures/forc-projects';
import { getTestWallet } from '../../utils';

describe(__filename, () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/docs-snippets/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
ContractFactory,
} from 'fuels';

import type { DocSnippetProjectsEnum } from '../projects';
import { getDocsSnippetsForcProject } from '../projects';
import type { DocSnippetProjectsEnum } from '../test/fixtures/forc-projects';
import { getDocsSnippetsForcProject } from '../test/fixtures/forc-projects';

export const getTestWallet = async (seedQuantities?: CoinQuantityLike[]) => {
// create a provider using the Fuel network URL
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/docs/src/guide/abi-typegen/using-generated-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ console.log({ value, logs });

Consider the following predicate:

<<< @/../../../packages/fuel-gauge/fixtures/forc-projects/predicate-main-args-struct/src/main.sw#Predicate-main-args{ts:line-numbers}
<<< @/../../../packages/fuel-gauge/test/fixtures/forc-projects/predicate-main-args-struct/src/main.sw#Predicate-main-args{ts:line-numbers}

Now, after generating types via:

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/configurable-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This feature provides flexibility for dynamic contract environments. It allows a

Below is an example of a contract in which we declare four configurable constants:

<<< @/../../docs-snippets/projects/echo-configurables/src/main.sw#configurable-constants-1{rust:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/echo-configurables/src/main.sw#configurable-constants-1{rust:line-numbers}

In this contract, we have a function `echo_configurables` that returns the values of the configurable constants.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/contract-balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `Contract` class includes a method called `getBalance` that retrieves the av

Consider a simple contract that transfers a specified amount of a given asset to an address:

<<< @/../../docs-snippets/projects/transfer-to-address/src/main.sw#contract-balance-2{rust:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/transfer-to-address/src/main.sw#contract-balance-2{rust:line-numbers}

The `transfer` function has three parameters:

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/contracts/inter-contract-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ In this example, we have a `SimpleToken` contract representing a basic token con

Here's a simple token contract that allows holding balances:

<<< @/../../docs-snippets/projects/simple-token/src/main.sw#inter-contract-calls-1{ts:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/simple-token/src/main.sw#inter-contract-calls-1{ts:line-numbers}

### Contract: `TokenDepositor`

The `TokenDepositor` contract imports the `SimpleToken` contract and calls its `deposit` function to deposit tokens:

<<< @/../../docs-snippets/projects/token-depositor/src/main.sw#inter-contract-calls-2{ts:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/token-depositor/src/main.sw#inter-contract-calls-2{ts:line-numbers}

## Inter-contract calls using the SDK

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ When you log a value within a contract method, it generates a log entry that is

Consider the following example contract:

<<< @/../../docs-snippets/projects/log-values/src/main.sw#log-1{rust:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/log-values/src/main.sw#log-1{rust:line-numbers}

To access the logged values in TypeScript, use the `logs` property in the `FunctionInvocationResult` of a contract call result. The logs data will be stored in an `Array<any>`:

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/the-fuelvm-binary-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ When you compile your Sway code using the `forc build` command, it generates a b

For example, consider the following smart contract:

<<< @/../../docs-snippets/projects/echo-values/src/main.sw#understanding-fuel-binary-file{ts:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/echo-values/src/main.sw#understanding-fuel-binary-file{ts:line-numbers}

After running `forc build`, a binary file will be generated with the following content:

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/guide/cookbook/custom-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ There may be scenarios where you need to build out transactions that involve mul

Consider the following script that transfers multiple assets to a contract:

<<< @/../../docs-snippets/projects/script-transfer-to-contract/src/main.sw#custom-transactions-1{ts:line-numbers}
<<< @/../../docs-snippets/test/fixtures/forc-projects/script-transfer-to-contract/src/main.sw#custom-transactions-1{ts:line-numbers}

This script can be executed by creating a `ScriptTransactionRequest`, appending the resource and contract inputs/outputs and then sending the transaction, as follows:

<<< @/../../docs-snippets/src/guide/scripts/script-custom-transaction.test.ts#custom-transactions-2{ts:line-numbers}
<<< @/../../docs-snippets/src/guide/scripts/script-custom-transaction.test.ts#custom-transactions-2{ts:line-numbers}
Loading

0 comments on commit 4f4b328

Please sign in to comment.