Skip to content

Commit

Permalink
Include low-level sdk in rustdoc/typedoc (#429)
Browse files Browse the repository at this point in the history
* Include low-level sdk in rustdoc/typedoc

* Change navbar organization (#436)

Co-authored-by: calintje <[email protected]>

---------

Co-authored-by: Calin <[email protected]>
Co-authored-by: calintje <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 95052f9 commit fa72f0a
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 20 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ members = [
]
exclude = [
"rust-sdk",
"ts-sdk"
"ts-sdk",
"docs"
]
1 change: 0 additions & 1 deletion docs/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "rimraf dist"
},
"devDependencies": {
"@orca-so/whirlpools": "*",
"@orca-so/whirlpools-sdk": "*",
"typedoc": "^0.26.10",
"typescript": "^5.6.3"
Expand Down
1 change: 1 addition & 0 deletions docs/legacy/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"entryPoints": ["../../legacy-sdk/whirlpool/src/index.ts"],
"entryPointStrategy": "resolve",
"githubPages": false,
"skipErrorChecking": true,
"out": "dist/legacy"
}
11 changes: 11 additions & 0 deletions docs/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "orca_whirlpools_docs"
version = "0.1.0"
publish = false
edition = "2021"

[dependencies]
orca_whirlpools_core = { path = "../../rust-sdk/core", features = ["wasm", "floats"] }
orca_whirlpools_client = { path = "../../rust-sdk/client", features = ["anchor", "core-types"] }
orca_whirlpools = { path = "../../rust-sdk/whirlpool" }

1 change: 1 addition & 0 deletions docs/rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rust
8 changes: 5 additions & 3 deletions docs/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"version": "0.0.0",
"private": true,
"scripts": {
"build": "cd ../../rust-sdk/whirlpool && cargo doc --lib --no-deps && cp -rf target/doc/. ../../docs/rust/dist",
"start": "cd ../../rust-sdk/whirlpool && cargo doc --lib --no-deps --open",
"build": "cargo doc --lib --no-deps && cp -rf target/doc/. dist",
"start": "cargo doc --lib --no-deps --open",
"clean": "rimraf dist"
},
"devDependencies": {
"@orca-so/whirlpools-rust": "*"
"@orca-so/whirlpools-rust": "*",
"@orca-so/whirlpools-rust-client": "*",
"@orca-so/whirlpools-rust-core": "*"
}
}
16 changes: 16 additions & 0 deletions docs/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![doc = include_str!("../README.md")]

pub mod orca_whirlpools_core {
#![doc = include_str!("../../../rust-sdk/core/README.md")]
pub use orca_whirlpools_core::*;
}

pub mod orca_whirlpools_client {
#![doc = include_str!("../../../rust-sdk/client/README.md")]
pub use orca_whirlpools_client::*;
}

pub mod orca_whirlpools {
#![doc = include_str!("../../../rust-sdk/whirlpool/README.md")]
pub use orca_whirlpools::*;
}
1 change: 1 addition & 0 deletions docs/ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Typescript
4 changes: 3 additions & 1 deletion docs/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
},
"devDependencies": {
"@orca-so/whirlpools": "*",
"@orca-so/whirlpools-sdk": "*",
"@orca-so/whirlpools-client": "*",
"@orca-so/whirlpools-core": "*",
"typedoc": "^0.26.10",
"typedoc-plugin-merge-modules": "^6.0.3",
"typescript": "^5.6.3"
}
}
12 changes: 9 additions & 3 deletions docs/ts/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"entryPoints": ["../../ts-sdk/whirlpool/src/index.ts"],
"entryPointStrategy": "resolve",
"entryPoints": [
"../../ts-sdk/core",
"../../ts-sdk/client",
"../../ts-sdk/whirlpool"
],
"entryPointStrategy": "packages",
"githubPages": false,
"out": "dist/ts"
"skipErrorChecking": true,
"out": "dist/ts",
"readme": "./README.md"
}
22 changes: 13 additions & 9 deletions docs/whirlpool/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,20 @@ export default {
items: [
{ to: "/", label: "Docs", position: "left" },
{
href: "/orca_whirlpools/",
label: "Rust SDK Reference",
label: "Whirlpools SDK Reference",
position: "left",
target: "_blank",
},
{
href: "/ts/",
label: "TS SDK Reference",
position: "left",
target: "_blank",
items: [
{
href: "/ts/",
label: "TS SDK Reference",
target: "_blank",
},
{
href: "/orca_whirlpools_docs/",
label: "Rust SDK Reference",
target: "_blank",
},
],
},
{
href: "/legacy/",
Expand Down
5 changes: 5 additions & 0 deletions ts-sdk/client/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": [
"./src/index.ts"
]
}
5 changes: 5 additions & 0 deletions ts-sdk/core/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": [
"./dist/nodejs/orca_whirlpools_core_js_bindings.d.ts"
]
}
5 changes: 5 additions & 0 deletions ts-sdk/whirlpool/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": [
"./src/index.ts"
]
}
16 changes: 14 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3071,7 +3071,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@orca-so/whirlpools-docs-legacy@workspace:docs/legacy"
dependencies:
"@orca-so/whirlpools": "npm:*"
"@orca-so/whirlpools-sdk": "npm:*"
typedoc: "npm:^0.26.10"
typescript: "npm:^5.6.3"
Expand All @@ -3083,6 +3082,8 @@ __metadata:
resolution: "@orca-so/whirlpools-docs-rust@workspace:docs/rust"
dependencies:
"@orca-so/whirlpools-rust": "npm:*"
"@orca-so/whirlpools-rust-client": "npm:*"
"@orca-so/whirlpools-rust-core": "npm:*"
languageName: unknown
linkType: soft

Expand All @@ -3091,8 +3092,10 @@ __metadata:
resolution: "@orca-so/whirlpools-docs-ts@workspace:docs/ts"
dependencies:
"@orca-so/whirlpools": "npm:*"
"@orca-so/whirlpools-sdk": "npm:*"
"@orca-so/whirlpools-client": "npm:*"
"@orca-so/whirlpools-core": "npm:*"
typedoc: "npm:^0.26.10"
typedoc-plugin-merge-modules: "npm:^6.0.3"
typescript: "npm:^5.6.3"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -15548,6 +15551,15 @@ __metadata:
languageName: node
linkType: hard

"typedoc-plugin-merge-modules@npm:^6.0.3":
version: 6.0.3
resolution: "typedoc-plugin-merge-modules@npm:6.0.3"
peerDependencies:
typedoc: 0.26.x
checksum: 10c0/1a1687c1dcbe521e7868384d1a58c05a9f1ebf210f55d89b6e5f386ced5d04219464909b809d29008314bf826af5e194ff75f417605497e2673c659242f16a7e
languageName: node
linkType: hard

"typedoc@npm:^0.26.10":
version: 0.26.10
resolution: "typedoc@npm:0.26.10"
Expand Down

0 comments on commit fa72f0a

Please sign in to comment.