Skip to content
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

chore: removing publishConfigs, using .d.ts for types #1055

Merged
merged 47 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2611f00
Upgrading TSUP
arboleya Jun 8, 2023
d52a6e5
Refactoring TSUP base config
arboleya Jun 8, 2023
9bb3a3a
Adding new post-build script
arboleya Jun 8, 2023
0f80d35
Refactoring `packages/versions`
arboleya Jun 8, 2023
b976cd4
Refactoring `packages/wallet`
arboleya Jun 8, 2023
eab29c9
Refactoring `packages/fuels`
arboleya Jun 8, 2023
02d7da5
Residual experiments
arboleya Jun 8, 2023
4ed5b70
Refactoring `packages/abi-typegen`
arboleya Jun 8, 2023
2fe91a3
Re-adding default base index config
arboleya Jun 8, 2023
0e0f654
Refactoring `packages/abi-coder`
arboleya Jun 8, 2023
1d55fdf
Refactoring `packages/address`
arboleya Jun 8, 2023
1140888
Refactoring `packages/asm`
arboleya Jun 8, 2023
e9727db
DRYing tsup base configs
arboleya Jun 9, 2023
4168800
Refactoring `packages/contract`
arboleya Jun 9, 2023
3655110
Refactoring `packages/hasher`
arboleya Jun 9, 2023
2d6fbf5
Refactoring `packages/hdwallet`
arboleya Jun 9, 2023
2285040
Refactoring `packages/interfaces`
arboleya Jun 9, 2023
38773b6
Refactoring `packages/keystore`
arboleya Jun 9, 2023
0b516b8
Refactoring `packages/math`
arboleya Jun 9, 2023
5c3c973
Refactoring `packages/merkle`
arboleya Jun 9, 2023
44e4983
Refactoring `packages/mnemonic`
arboleya Jun 9, 2023
603091f
Refactoring `packages/predicate`
arboleya Jun 9, 2023
818167b
Refactoring `packages/program`
arboleya Jun 9, 2023
615b7fe
Refactoring `packages/providers`
arboleya Jun 9, 2023
92d356b
Refactoring `packages/script`
arboleya Jun 9, 2023
e1a5467
Refactoring `packages/signer`
arboleya Jun 9, 2023
704b6d5
Refactoring `packages/transaction`
arboleya Jun 9, 2023
9dcc49a
Refactoring `packages/utils`
arboleya Jun 9, 2023
5dbf528
Adjusting configs for `packages/versions`
arboleya Jun 9, 2023
981a9ae
Refactoring `packages/wallet-manager`
arboleya Jun 9, 2023
4acaaa5
Adjusting configs for `packages/wallet`
arboleya Jun 9, 2023
adad2e6
Adding missing config file for `packages/utils`
arboleya Jun 9, 2023
f67bf8e
Adding missing config file for `packages/wordlist`
arboleya Jun 9, 2023
8cdd877
Adding new tubo pipeline
arboleya Jun 9, 2023
284b967
Standardizing configs for `internal/tsup` package
arboleya Jun 9, 2023
fe5e219
Generating types conditionally on `postbuild` script
arboleya Jun 9, 2023
ad67fd1
Adding package to validate imports
arboleya Jun 9, 2023
835e3e1
Adding changeset
arboleya Jun 9, 2023
dd13c5a
Updating broken imports
arboleya Jun 9, 2023
f5e65fb
Lintfix
arboleya Jun 9, 2023
9f63afe
Merge branch 'master' into aa/chore/removing-publish-configs
arboleya Jun 9, 2023
426f214
Merging with master
arboleya Jun 19, 2023
6f9063d
Lintfix
arboleya Jun 19, 2023
d2f171f
Merge branch 'master' into aa/chore/removing-publish-configs
arboleya Jun 19, 2023
2234bc3
Merge branch 'master' into aa/chore/removing-publish-configs
arboleya Jun 28, 2023
bfff8e0
Merging with master
arboleya Jun 28, 2023
af8ec90
Considering `fuels` umbrella when validating imports
arboleya Jun 28, 2023
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
28 changes: 28 additions & 0 deletions .changeset/sharp-poems-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"@fuel-ts/abi-coder": patch
"@fuel-ts/abi-typegen": patch
"@fuel-ts/address": patch
"@fuel-ts/asm": patch
"@fuel-ts/contract": patch
"fuels": patch
"@fuel-ts/hasher": patch
"@fuel-ts/hdwallet": patch
"@fuel-ts/interfaces": patch
"@fuel-ts/keystore": patch
"@fuel-ts/math": patch
"@fuel-ts/merkle": patch
"@fuel-ts/mnemonic": patch
"@fuel-ts/predicate": patch
"@fuel-ts/program": patch
"@fuel-ts/providers": patch
"@fuel-ts/script": patch
"@fuel-ts/signer": patch
"@fuel-ts/transactions": patch
"@fuel-ts/utils": patch
"@fuel-ts/versions": patch
"@fuel-ts/wallet": patch
"@fuel-ts/wallet-manager": patch
"@fuel-ts/wordlists": patch
---

Removing `publishConfigs`, using `.dts` files with declaration maps (`.dts.map`)
2 changes: 1 addition & 1 deletion apps/docs-snippets/projects/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getForcProject } from '@fuel-ts/utils/test';
import { getForcProject } from '@fuel-ts/utils/test-utils';
import type { JsonFlatAbi } from 'fuels';
import { join } from 'path';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { safeExec } from '@fuel-ts/utils/test';
import { safeExec } from '@fuel-ts/utils/test-utils';
import { WalletUnlocked, FUEL_NETWORK_URL, Provider, Predicate, BN, getRandomB256 } from 'fuels';

import { SnippetProjectEnum, getSnippetProjectArtifacts } from '../../../projects';
Expand Down
5 changes: 5 additions & 0 deletions internal/check-imports/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This package validates importing all other packages.

It ensures all packages are ok and should `build` successfully.

If `build` fails, there might be something broken or misconfigured.
37 changes: 37 additions & 0 deletions internal/check-imports/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"private": true,
"name": "@internal/check-imports",
"files": [
"dist"
],
"scripts": {
"build": "tsc --noEmit"
},
"license": "Apache-2.0",
"dependencies": {
"@fuel-ts/abi-coder": "workspace:*",
"@fuel-ts/abi-typegen": "workspace:*",
"@fuel-ts/address": "workspace:*",
"@fuel-ts/asm": "workspace:*",
"@fuel-ts/contract": "workspace:*",
"@fuel-ts/hasher": "workspace:*",
"@fuel-ts/hdwallet": "workspace:*",
"@fuel-ts/interfaces": "workspace:*",
"@fuel-ts/keystore": "workspace:*",
"@fuel-ts/math": "workspace:*",
"@fuel-ts/merkle": "workspace:*",
"@fuel-ts/mnemonic": "workspace:*",
"@fuel-ts/predicate": "workspace:*",
"@fuel-ts/program": "workspace:*",
"@fuel-ts/providers": "workspace:*",
"@fuel-ts/script": "workspace:*",
"@fuel-ts/signer": "workspace:*",
"@fuel-ts/transactions": "workspace:*",
"@fuel-ts/utils": "workspace:*",
"@fuel-ts/versions": "workspace:*",
"@fuel-ts/wallet-manager": "workspace:*",
"@fuel-ts/wallet": "workspace:*",
"@fuel-ts/wordlists": "workspace:*",
"fuels": "workspace:^"
}
}
56 changes: 56 additions & 0 deletions internal/check-imports/src/imports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import * as abiCoder from '@fuel-ts/abi-coder';
import * as abiTypegen from '@fuel-ts/abi-typegen';
import * as address from '@fuel-ts/address';
import * as asm from '@fuel-ts/asm';
import * as contract from '@fuel-ts/contract';
// forc-bin
// fuels-gauge
import * as hasher from '@fuel-ts/hasher';
import * as hdwallet from '@fuel-ts/hdwallet';
import * as interfaces from '@fuel-ts/interfaces';
import * as keystore from '@fuel-ts/keystore';
import * as math from '@fuel-ts/math';
import * as merkle from '@fuel-ts/merkle';
import * as mnemonic from '@fuel-ts/mnemonic';
import * as predicate from '@fuel-ts/predicate';
import * as program from '@fuel-ts/program';
import * as providers from '@fuel-ts/providers';
import * as script from '@fuel-ts/script';
import * as signer from '@fuel-ts/signer';
// testcases
import * as transactions from '@fuel-ts/transactions';
import * as utils from '@fuel-ts/utils';
import * as versions from '@fuel-ts/versions';
import * as wallet from '@fuel-ts/wallet';
import * as walletManager from '@fuel-ts/wallet-manager';
import * as wordlists from '@fuel-ts/wordlists';
import * as fuels from 'fuels';

const { log } = console;

log([
abiCoder,
abiTypegen,
address,
asm,
contract,
fuels,
hasher,
hdwallet,
interfaces,
keystore,
math,
merkle,
mnemonic,
predicate,
program,
providers,
script,
signer,
transactions,
utils,
versions,
wallet,
walletManager,
wordlists,
]);
2 changes: 2 additions & 0 deletions internal/check-imports/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './references';
import './imports';
172 changes: 172 additions & 0 deletions internal/check-imports/src/references.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
import { AbiCoder, StringCoder } from '@fuel-ts/abi-coder';
import { AbiTypeGen } from '@fuel-ts/abi-typegen';
import { runCliAction } from '@fuel-ts/abi-typegen/cli';
import { runTypegen } from '@fuel-ts/abi-typegen/runTypegen';
import { Address } from '@fuel-ts/address';
import { NativeAssetId } from '@fuel-ts/address/configs';
import { VM_REGISTER_COUNT } from '@fuel-ts/asm';
import { ContractFactory } from '@fuel-ts/contract';
import { hashTransaction, hashMessage } from '@fuel-ts/hasher';
import { HDWallet } from '@fuel-ts/hdwallet';
import { AbstractPredicate } from '@fuel-ts/interfaces';
import { encrypt, decrypt } from '@fuel-ts/keystore';
import { BN } from '@fuel-ts/math';
import { DEFAULT_PRECISION, DEFAULT_MIN_PRECISION } from '@fuel-ts/math/configs';
import { SparseMerkleTree, constructTree } from '@fuel-ts/merkle';
import { Mnemonic } from '@fuel-ts/mnemonic';
import { Predicate } from '@fuel-ts/predicate';
import { FunctionInvocationScope } from '@fuel-ts/program';
import { PANIC_REASONS } from '@fuel-ts/program/configs';
import { Provider } from '@fuel-ts/providers';
import { Script } from '@fuel-ts/script';
import { Signer } from '@fuel-ts/signer';
import { InputCoinCoder } from '@fuel-ts/transactions';
import { GAS_PRICE_FACTOR } from '@fuel-ts/transactions/configs';
import { versions } from '@fuel-ts/versions';
import { runVersions } from '@fuel-ts/versions/cli';
import { Wallet } from '@fuel-ts/wallet';
import { WalletManager } from '@fuel-ts/wallet-manager';
import { FUEL_NETWORK_URL } from '@fuel-ts/wallet/configs';
import { generateTestWallet, seedTestWallet } from '@fuel-ts/wallet/test-utils';
import { english, Language } from '@fuel-ts/wordlists';
import { ScriptRequest } from 'fuels';

const { log } = console;

/**
* abi-coder
*/
log(AbiCoder);
log(StringCoder);
log(new StringCoder(8));

/**
* abi-typegen
*/
log(AbiTypeGen);
log(runTypegen);
log(runCliAction);
// log(assembleContracts); // nop;

/**
* address
*/
log(Address);
log(NativeAssetId);
log(Address.fromPublicKey('asdfasdf'));

/**
* asm
*/
log(VM_REGISTER_COUNT); // pnpm add add @fuel-ts/asm

/**
* contract
*/
log(ContractFactory);

/**
* fuels (reading class re-exported by umbrella)
*/
log(ScriptRequest);

/**
* hasher
*/
log(hashTransaction);
log(hashMessage);
log(GAS_PRICE_FACTOR);

/**
* hdwallet
*/
log(HDWallet);

/**
* interfaces
*/
log(AbstractPredicate);

/**
* keystore
*/
log(encrypt, decrypt);

/**
* math
*/
log(BN, DEFAULT_PRECISION);
log(DEFAULT_MIN_PRECISION);

/**
* merkle
*/
log(SparseMerkleTree, constructTree);

/**
* mnemonic
*/
log(Mnemonic);

/**
* predicate
*/
log(Predicate);

/**
* program
*/
log(FunctionInvocationScope);
log(PANIC_REASONS);

/**
* providers
*/
log(Provider);

/**
* script
*/
log(Script);

/**
* signer
*/
log(Signer);

/**
* testcases
*/

/**
* transactions
*/
log(InputCoinCoder);

/**
* versions
*/
log(runVersions);
log(versions);
// log(getSupportedVersions); // nop
// log(getUserVersions); // nop
// log(compareUserVersions); // nop
// log(colorizeUserVersion); // nop

/**
* wallet-manager
*/
log(WalletManager);

/**
* wallet
*/
log(Wallet);
log(generateTestWallet);
log(seedTestWallet);
log(FUEL_NETWORK_URL);

/**
* wordlists
*/
log(english, Language);
7 changes: 7 additions & 0 deletions internal/check-imports/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src"]
}
7 changes: 5 additions & 2 deletions internal/tsup/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"private": true,
"name": "@internal/tsup",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"types": "src/index.ts",
"files": [
"dist"
],
"scripts": {
"preinstall": "pnpm build",
"build": "tsup",
"build:watch": "tsup --watch"
"build:watch": "tsup --watch",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"license": "Apache-2.0"
}
Loading