Skip to content

Commit

Permalink
feat: implement TypeDoc in Provider (#1178)
Browse files Browse the repository at this point in the history
* feat: add typedoc to the program package

* feat: add typedoc interfaces to post build script

* docs: add typedoc doc blocks to program package files

* chore: linting

* chore: changeset

* feat: add typedoc to the providers package

* feat: add enums to typedoc post build script

* docs: add tpyedoc doc blocks to provider classes and functions

* chore: changeset

* feat: add docs links for providers

* feat: add missing enum regex cleanup in typedoc postbuil

---------

Co-authored-by: danielbate <--global>
  • Loading branch information
danielbate committed Aug 11, 2023
1 parent 7717d7f commit abcc11c
Show file tree
Hide file tree
Showing 31 changed files with 495 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .changeset/eight-paws-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
13 changes: 12 additions & 1 deletion apps/docs/scripts/typedoc-postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ const apiDocsDir = join(docsDir, '/api');
const classesDir = join(apiDocsDir, '/classes');
const modulesDir = join(apiDocsDir, '/modules');
const interfacesDir = join(apiDocsDir, '/interfaces_typedoc');
const enumsDir = join(apiDocsDir, '/enums');

const filesToRemove = ['api/modules.md', 'api/classes', 'api/modules', 'api/interfaces_typedoc'];
const filesToRemove = [
'api/modules.md',
'api/classes',
'api/modules',
'api/interfaces_typedoc',
'api/enums',
];

const filePathReplacements: RegexReplacement[] = [];

Expand Down Expand Up @@ -77,9 +84,12 @@ const alterFileStructure = async () => {
const modulesFiles = readdirSync(modulesDir);
const classesFiles = readdirSync(classesDir);
const interfacesFiles = readdirSync(interfacesDir);
const enumsFiles = readdirSync(enumsDir);

const files = [
...classesFiles.map((c) => ({ name: c, path: classesDir })),
...interfacesFiles.map((i) => ({ name: i, path: interfacesDir })),
...enumsFiles.map((e) => ({ name: e, path: enumsDir })),
];

await modulesFiles.forEach((modulesFile) => {
Expand Down Expand Up @@ -133,6 +143,7 @@ const recreateInternalLinks = () => {
{ regex: '../modules/', replacement: '/api/' },
{ regex: '../classes/', replacement: '/api/' },
{ regex: '../interfaces/', replacement: '/api/' },
{ regex: '../enums/', replacement: '/api/' },
{ regex: 'fuel_ts_', replacement: '' },
{ regex: '/api//api/', replacement: '/api/' },
// Resolves `[plugin:vite:vue] Element is missing end tag.` error
Expand Down
1 change: 1 addition & 0 deletions apps/docs/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"../../packages/program",
"../../packages/contract",
"../../packages/script",
"../../packages/providers"
],
"out": "src/api",
"githubPages": false,
Expand Down
1 change: 1 addition & 0 deletions packages/providers/src/coin-quantity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type CoinQuantityLike =
| { amount: BigNumberish; assetId?: BytesLike; max?: BigNumberish };
export type CoinQuantity = { amount: BN; assetId: string; max?: BN };

/** @hidden */
export const coinQuantityfy = (coinQuantityLike: CoinQuantityLike): CoinQuantity => {
let assetId;
let amount;
Expand Down
Loading

0 comments on commit abcc11c

Please sign in to comment.