Skip to content

Commit

Permalink
chore: removing publishConfigs, using .d.ts for types (#1055)
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya authored Jun 28, 2023
1 parent 9af6cf9 commit cd47596
Show file tree
Hide file tree
Showing 99 changed files with 2,752 additions and 2,397 deletions.
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

0 comments on commit cd47596

Please sign in to comment.