Skip to content

Commit f47d0f3

Browse files
authored
feat: js docs (#13)
* feat: initial js docs * feat: add examples to relations * feat: add examples to triples * feat: graphuri scheme docs * feat: add js docs for dynamic entities * feat: add changeset
1 parent 27d293a commit f47d0f3

30 files changed

+1200
-13
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/smart-rings-cry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphprotocol/grc-20': patch
3+
---
4+
5+
Adds JS Doc comments to APIs

abis.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
/**
2+
* This module provides ABIs for known smart contracts used in the knowledge graph.
3+
*
4+
* @since 0.0.6
5+
*/
6+
17
export * from './src/abis/index.js';

constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* This module provides common constants used in the knowledge graph.
3+
*
4+
* @since 0.0.6
5+
*/
6+
17
import { Position, PositionRange } from './src/position.js';
28

39
export const INITIAL_RELATION_INDEX_VALUE = Position.createBetween(PositionRange.FIRST);

contracts.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
// GOVERNANCE PLUGIN ADDRESSES
2-
// from the plugin-repo-info.json in geo-contracts after deploying
3-
// Jul 15, 2024 – L3 Testnet
1+
/**
2+
* This module provides the known contract addresses for smart contracts
3+
* used in the knowledge graph.
4+
*
5+
* @since 0.0.6
6+
*/
7+
8+
/**
9+
* Mainnet contract addresses
10+
*/
411
export const MAINNET = {
512
SPACE_PLUGIN_REPO_ADDRESS: '0xd9559df98e4103CDf0A119d4bff1537B383E462c',
613
PERSONAL_SPACE_ADMIN_PLUGIN_REPO_ADDRESS: '0xa00870c6501349E126E71Dc1705fBaa2B5aeac0d',
@@ -10,6 +17,9 @@ export const MAINNET = {
1017
PLUGIN_SETUP_PROCESSOR_ADDRESS: '0xfcC0Aba63c1F1f887099EAB0d1A624A5B7A82Fc2',
1118
};
1219

20+
/**
21+
* Testnet contract addresses
22+
*/
1323
export const TESTNET = {
1424
SPACE_PLUGIN_REPO_ADDRESS: '0x0701454b0e80C53Ee8c3e0805616424758D7E7Fd',
1525
PERSONAL_SPACE_ADMIN_PLUGIN_REPO_ADDRESS: '0xAe8Ac47e5f3bDa62F6D1BD140AB8e1926D867355',

index.ts

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
export * from './src/types.js';
22

3+
/**
4+
* This module provides utility functions for working knowledge graph
5+
* identifiers in TypeScript.
6+
*
7+
* @since 0.0.6
8+
*/
39
export * as ID from './src/id.js';
10+
11+
/**
12+
* This module provides utility functions for working with base58 ids
13+
* in TypeScript.
14+
*
15+
* @since 0.0.6
16+
*/
417
export { BASE58_ALLOWED_CHARS, decodeBase58ToUUID, encodeBase58 } from './src/core/base58.js';
18+
519
export {
620
getAcceptEditorArguments,
721
getAcceptSubspaceArguments,
@@ -10,12 +24,51 @@ export {
1024
getRemoveEditorArguments,
1125
getRemoveSubspaceArguments,
1226
} from './src/encodings/index.js';
27+
28+
/**
29+
* This module provides utility functions for working with knowledge graph
30+
* images in TypeScript.
31+
*
32+
* @since 0.0.6
33+
*/
1334
export { Account } from './src/account.js';
14-
export { TextBlock, DataBlock } from './src/blocks.js';
35+
36+
export { TextBlock, DataBlock, ImageBlock } from './src/blocks.js';
37+
38+
/**
39+
* This module provides utility functions for working with knowledge graph
40+
* images in TypeScript.
41+
*
42+
* @since 0.0.6
43+
*/
1544
export { Image } from './src/image.js';
45+
1646
export { Position, PositionRange } from './src/position.js';
47+
48+
/**
49+
* This module provides utility functions for working with Triples in TypeScript.
50+
*
51+
* @since 0.0.6
52+
*/
1753
export { Triple } from './src/triple.js';
54+
55+
/**
56+
* This module provides utility functions for working with Relations in TypeScript.
57+
*
58+
* @since 0.0.6
59+
*/
1860
export { Relation } from './src/relation.js';
61+
62+
/**
63+
* This module provides utility functions for working with Graph URIs in TypeScript.
64+
*
65+
* @since 0.0.6
66+
*/
1967
export { GraphUrl } from './src/scheme.js';
68+
69+
/**
70+
* Provides ids for commonly used entities across the Knowledge Graph.
71+
*/
2072
export { SYSTEM_IDS, NETWORK_IDS, CONTENT_IDS } from './src/system-ids.js';
73+
2174
export { getChecksumAddress } from './src/core/get-checksum-address.js';

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"name": "@graphprotocol/grc-20",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"license": "MIT",
55
"module": "./dist/index.js",
66
"types": "./dist/index.d.ts",
77
"main": "./dist/index.js",
88
"ascMain": "./dist/index.js",
99
"type": "module",
10-
"files": ["dist"],
10+
"files": [
11+
"dist"
12+
],
1113
"exports": {
1214
"./package.json": "./package.json",
1315
".": "./dist/index.js",
@@ -26,6 +28,7 @@
2628
"dependencies": {
2729
"@biomejs/biome": "^1.9.4",
2830
"@bufbuild/protobuf": "^1.9.0",
31+
"@changesets/cli": "^2.27.12",
2932
"@ethersproject/abi": "^5.6.4",
3033
"@ethersproject/providers": "^5.6.8",
3134
"@types/uuid": "^9.0.8",
@@ -43,5 +46,5 @@
4346
"prettier": "^3.2.5",
4447
"typescript": "^5.4.5"
4548
},
46-
"packageManager": "[email protected]"
49+
"packageManager": "[email protected]"
4750
}

0 commit comments

Comments
 (0)