Skip to content

Commit

Permalink
chore: set global typedoc command
Browse files Browse the repository at this point in the history
  • Loading branch information
cedoor committed Sep 9, 2023
1 parent 88d3ff8 commit 5db6b84
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 167 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ node_modules/
# Generate output
dist
build
docs/*
!docs/CNAME
!docs/index.html
docs

# Hardhat
cache
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<a href="https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/incremental-merkle-tree">
@zk-kit/incremental-merkle-tree
</a>
<a href="https://zkkit.appliedzkp.org/incremental-merkle-tree">
<a href="https://zkkit.pse.dev/modules/_zk_kit_incremental_merkle_tree">
(docs)
</a>
</td>
Expand Down Expand Up @@ -118,7 +118,7 @@
<a href="https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/sparse-merkle-tree">
@zk-kit/sparse-merkle-tree
</a>
<a href="https://zkkit.appliedzkp.org/sparse-merkle-tree/">
<a href="https://zkkit.pse.dev/modules/_zk_kit_sparse_merkle_tree">
(docs)
</a>
</td>
Expand Down Expand Up @@ -272,7 +272,3 @@ grep -r -l "sparse-merkle-tree" . | xargs sed -i 's/sparse-merkle-tree/my-packag
#### How can I create benchmarks for my library?

You can see some examples in the `benchmarks` folder. All you have to do is create a file that exports a function to run your benchmark in that folder, and add that function to the `index.ts` file. The `yarn benchmarks` command can be run with no parameters (it will run all the benchmarks), or you can specify the name of your benchmark file to run just that. When you run the command it will create a `benchmarks/results` folder with your results.

#### How can I publish the documentation of my library with Typedocs?

You just need to insert the NPM `docs` command in your `package.json` file, as in the other packages. This command will be executed by Yarn and the output of `typedocs` will be placed in the `docs` folder of the root directory, which will be used to deploy the documentation websites by the Github `docs` workflow whenever the `main` branch is updated.
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

107 changes: 0 additions & 107 deletions docs/index.html

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prettier": "prettier -c .",
"prettier:write": "prettier -w .",
"benchmarks": "rimraf benchmarks/results && ts-node benchmarks/index.ts",
"docs": "yarn workspaces foreach --no-private run docs",
"docs": "typedoc --cname zkkit.pse.dev --githubPages true",
"commit": "cz",
"precommit": "lint-staged",
"postinstall": "yarn build && husky install"
Expand Down Expand Up @@ -69,6 +69,7 @@
"rollup": "^2.64.0",
"ts-node": "^10.4.0",
"tslib": "^2.3.1",
"typedoc": "^0.25.1",
"typescript": "^4.5.4"
},
"config": {
Expand Down
6 changes: 2 additions & 4 deletions packages/incremental-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"scripts": {
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
"prepublishOnly": "yarn build",
"docs": "typedoc src/index.ts --out ../../docs/incremental-merkle-tree"
"prepublishOnly": "yarn build"
},
"publishConfig": {
"access": "public"
Expand All @@ -37,7 +36,6 @@
"circomlibjs": "^0.0.8",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.32.1",
"typedoc": "^0.22.11"
"rollup-plugin-typescript2": "^0.32.1"
}
}
3 changes: 3 additions & 0 deletions packages/incremental-merkle-tree/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["src/index.ts"]
}
6 changes: 2 additions & 4 deletions packages/lazytower/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@
"scripts": {
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
"prepublishOnly": "yarn build",
"docs": "typedoc src/index.ts --out ../../docs/lazytower"
"prepublishOnly": "yarn build"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.32.1",
"typedoc": "^0.22.11"
"rollup-plugin-typescript2": "^0.32.1"
},
"dependencies": {
"poseidon-lite": "^0.2.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/lazytower/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["src/index.ts"]
}
6 changes: 2 additions & 4 deletions packages/sparse-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"scripts": {
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
"prepublishOnly": "yarn build",
"docs": "typedoc src/index.ts --out ../../docs/sparse-merkle-tree"
"prepublishOnly": "yarn build"
},
"publishConfig": {
"access": "public"
Expand All @@ -44,7 +43,6 @@
"crypto-js": "^4.1.1",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.32.1",
"typedoc": "^0.22.11"
"rollup-plugin-typescript2": "^0.32.1"
}
}
3 changes: 3 additions & 0 deletions packages/sparse-merkle-tree/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entryPoints": ["src/index.ts"]
}
6 changes: 6 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"entryPoints": ["packages/*"],
"name": "ZK-kit",
"entryPointStrategy": "packages",
"exclude": ["**/*.sol", "**/*.circom", "**/rollup-plugin-rust"]
}
Loading

0 comments on commit 5db6b84

Please sign in to comment.