Skip to content

Commit 7cec64d

Browse files
committed
Host typedoc on netlify #707
1 parent 53ada8d commit 7cec64d

13 files changed

+6525
-290
lines changed

CONTRIBUTE.md

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Guide for Atomic Data Rust contributors
1+
# Guide for Atomic-Server contributors
22

33
First things first: I'm glad you're reading this!
44
Join our [Discord](https://discord.gg/a72Rv2P) to chat with other people in the Atomic Data community.
@@ -13,16 +13,17 @@ Check out the [Roadmap](https://docs.atomicdata.dev/roadmap.html) if you want to
1313
## Table of contents
1414

1515
- [Table of contents](#table-of-contents)
16-
- [Running locally](#running-locally)
17-
- [Running locally (with local development browser)](#running-locally-with-local-development-browser)
18-
- [Compilation using Earthly](#compilation-using-earthly)
19-
- [Improve local compilation speed](#improve-local-compilation-speed)
20-
- [Cross compilation](#cross-compilation)
21-
- [IDE setup (VSCode)](#ide-setup-vscode)
22-
- [Branching](#branching)
16+
- [Running \& compiling](#running--compiling)
17+
- [Running locally (with local development browser)](#running-locally-with-local-development-browser)
18+
- [Debugging](#debugging)
19+
- [IDE setup (VSCode)](#ide-setup-vscode)
20+
- [Compilation using Earthly](#compilation-using-earthly)
21+
- [Improve local compilation speed](#improve-local-compilation-speed)
22+
- [Cross compilation](#cross-compilation)
23+
- [Git policy](#git-policy)
24+
- [Open a PR](#open-a-pr)
25+
- [Branching](#branching)
2326
- [Testing](#testing)
24-
- [Code coverage](#code-coverage)
25-
- [Debugging](#debugging)
2627
- [Performance monitoring / benchmarks](#performance-monitoring--benchmarks)
2728
- [Tracing](#tracing)
2829
- [Tracing with OpenTelemetry (and Jaeger)](#tracing-with-opentelemetry-and-jaeger)
@@ -31,25 +32,36 @@ Check out the [Roadmap](https://docs.atomicdata.dev/roadmap.html) if you want to
3132
- [Drill](#drill)
3233
- [Responsible disclosure / Coordinated Vulnerability Disclosure](#responsible-disclosure--coordinated-vulnerability-disclosure)
3334
- [Releases, Versioning and Tagging](#releases-versioning-and-tagging)
35+
- [CI situation](#ci-situation)
3436
- [Publishing manually - doing the CI's work](#publishing-manually---doing-the-cis-work)
3537
- [Building and publishing binaries](#building-and-publishing-binaries)
3638
- [Publishing to Cargo](#publishing-to-cargo)
3739
- [Publishing server to Docker](#publishing-server-to-docker)
3840
- [Deploying to atomicdata.dev](#deploying-to-atomicdatadev)
3941
- [Publishing atomic-cli to WAPM](#publishing-atomic-cli-to-wapm)
4042

41-
## Running locally
43+
## Running & compiling
4244

43-
Clone the repo and run `cargo run` from each folder (e.g. `cli` or `server`).
45+
TL;DR Clone the repo and run `cargo run` from each folder (e.g. `cli` or `server`).
4446

45-
## Running locally (with local development browser)
47+
### Running locally (with local development browser)
4648

4749
- Run `cargo run` to start the server
4850
- Go to `browser`, run `pnpm install` (if you haven't already), and run `pnpm dev` to start the browser
4951
- Visit your `localhost` in your locally running `atomic-data-browser` instance: (e.g. `http://localhost:5173/app/show?subject=http%3A%2F%2Flocalhost`)
50-
- use `cargo watch -- cargo run` to automatically recompile `atomic-server` when you push new assets using `pmpm build-server` in `atomic-data-browser`. This can be useful if you're debugging specific features that you can't reproduce while the front-end is hosted in vite.
52+
- use `cargo watch -- cargo run` to automatically recompile `atomic-server` when you update JS assets in `browser`
5153

52-
## Compilation using Earthly
54+
### Debugging
55+
56+
- **VSCode Users**: Install the `CodeLLDB` plugin, and press F5 to start debugging. Breakpoints, inspect... The good stuff.
57+
58+
### IDE setup (VSCode)
59+
60+
This project is primarily being developed in VSCode.
61+
That doesn't mean that you should, too, but it means you're less likely to run into issues.
62+
The `/.vscode` directory contains various tasks, recommended extensions, and some settings overwrites.
63+
64+
### Compilation using Earthly
5365

5466
There are `earthfile`s in `browser` and in `atomic-server`.
5567
These can be used by Earthly to build all steps, including a full docker image.
@@ -58,12 +70,12 @@ These can be used by Earthly to build all steps, including a full docker image.
5870
- `earthly --org ontola -P --satellite henk --artifact +e2e/test-results +pipeline`
5971
- `earthly --org ontola -P --satellite henk --artifact +build-server/atomic-server ./output/atomicserver`
6072

61-
## Improve local compilation speed
73+
### Improve local compilation speed
6274

6375
- Use the [`mold`](https://github.com/rui314/mold) linker + create a `.cargo/config.toml` and add `[build] rustflags = ["-C", "link-arg=-fuse-ld=lld"]`
6476
- Note: this is primarily for development on linux systems, as mold for macOS requires a paid license
6577

66-
## Cross compilation
78+
### Cross compilation
6779

6880
If you want to build `atomic-server` for some other target (e.g. building for linux from macOS), you can use the `cross` crate.
6981

@@ -73,21 +85,20 @@ cargo install cross
7385
cross build --target x86_64-unknown-linux-musl --bin atomic-server --release
7486
```
7587

88+
## Git policy
7689

77-
## IDE setup (VSCode)
90+
### Open a PR
7891

79-
This project is primarily being developed in VSCode.
80-
That doesn't mean that you should, too, but it means you're less likely to run into issues.
81-
The `/.vscode` directory contains various tasks, recommended extensions, and some settings overwrites.
92+
- Make sure your branch is up to date with `develop`.
93+
- Open a PR against `develop`.
94+
- Make sure all relevant tests / lint pass.
8295

83-
## Branching
96+
### Branching
8497

8598
Create new branches off `develop`. When an issue is ready for PR, open PR against `develop`.
8699

87100
## Testing
88101

89-
- All tests are run in CI
90-
91102
```sh
92103
# Make sure nextest is installed
93104
cargo install cargo-nextest
@@ -102,9 +113,12 @@ cargo run
102113
# now, open new terminal window
103114
cd server/e2e_tests/ && npm i && npm run test
104115
# if things go wrong, debug!
105-
npm run test-query {testname}
116+
pnpm run test-query {testname}
106117
```
107118

119+
<!--
120+
NOTE: NOT WORKING SINCE EARHTLY
121+
108122
## Code coverage
109123
110124
- Visible at https://app.codecov.io/gh/atomicdata-dev/atomic-server/
@@ -114,11 +128,7 @@ npm run test-query {testname}
114128
# install cargo-llvm-cov, see https://github.com/taiki-e/cargo-llvm-cov
115129
# Run the tests with a coverage report
116130
cargo llvm-cov --all-features --show-missing-lines
117-
```
118-
119-
## Debugging
120-
121-
- **VSCode Users**: Install the `CodeLLDB` plugin, and press F5 to start debugging. Breakpoints, inspect... The good stuff.
131+
``` -->
122132

123133
## Performance monitoring / benchmarks
124134

@@ -204,6 +214,11 @@ Note:
204214
- The version for `atomic-lib` is the most important, and dictates the versions of `cli` and `server`. When `lib` changes minor version, `cli` and `server` should follow.
205215
- After publishing, update the `./desktop/latest-version.json` file. This is used for auto-updating desktop distributions. See [tauri docs](https://tauri.studio/docs/distribution/updater).
206216

217+
### CI situation
218+
219+
- Github Action for `push`: builds + tests + docker (using `earthly`, see `Earthfile`)
220+
- Github Action for `tag`: create release + publish binaries
221+
207222
### Publishing manually - doing the CI's work
208223

209224
If the CI scripts for some reason do not do their job (buildin releases, docker file, publishing to cargo), you can follow these instructions:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ Front-end for Atomic-Server, built with React.
408408

409409
Library with `Store`, `Commit`, `JSON-AD` parsing, and more.
410410

411-
[**docs**](https://atomicdata-dev.github.io/atomic-data-browser/docs/modules/_tomic_lib.html)
411+
[**docs**](https://atomic-lib.netlify.app/modules/_tomic_lib)
412412

413413
### [`@tomic/react`](browser/react/README.md)
414414

@@ -424,7 +424,7 @@ Library with `Store`, `Commit`, `JSON-AD` parsing, and more.
424424

425425
React library with many useful hooks for rendering and editing Atomic Data.
426426

427-
[**docs**](https://atomicdata-dev.github.io/atomic-data-browser/docs/modules/_tomic_react.html)
427+
[**docs**](https://atomic-lib.netlify.app/modules/_tomic_react)
428428

429429
## Also check out
430430

browser/DOCS.MD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Atomic Data Typescript (@tomic) Docs
22

3-
Documentation for `@tomic/lib` and `@tomic/react`.
3+
Documentation for [`@tomic/lib`](/modules/_tomic_lib) and [`@tomic/react`](/modules/_tomic_react).
4+
5+
Hosted on [atomic-lib.netlify.app](https://atomic-lib.netlify.app/)
46

57
See [the Github repository](https://github.com/atomicdata-dev/atomic-data-browser) for more information and issues.

browser/Earthfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@ PROJECT ontola/atomic-server
33
FROM node:20.8.0-bookworm
44
WORKDIR browser
55

6-
pipeline:
7-
PIPELINE --push
8-
TRIGGER push develop
9-
TRIGGER push main
10-
TRIGGER pr develop
11-
ARG tag=latest
12-
BUILD +test
13-
BUILD +lint
14-
BUILD +build --tag=$tag
15-
166
all:
177
BUILD +build
188
BUILD +test
199
BUILD +lint
10+
BUILD +typedoc
2011

2112
deps:
2213
RUN curl -f https://get.pnpm.io/v6.14.js | node - add --global pnpm
@@ -41,3 +32,7 @@ build:
4132
FROM +deps
4233
RUN pnpm run build
4334
SAVE ARTIFACT ./data-browser/dist
35+
36+
typedoc:
37+
FROM +build
38+
RUN --secret NETLIFY_AUTH_TOKEN=NETLIFY_TOKEN pnpm run typedoc-publish

browser/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pnpm start # run the server!
3838

3939
Library with `Store`, `Commit`, `JSON-AD` parsing, and more.
4040

41-
[**docs**](https://atomicdata-dev.github.io/atomic-data-browser/docs/modules/_tomic_lib.html)
41+
[**docs**](https://atomic-lib.netlify.app/modules/_tomic_lib)
4242

4343
[→ Read more](lib/README.md)
4444

@@ -59,7 +59,7 @@ React library with many useful hooks for rendering and editing Atomic Data.
5959

6060
[**demo + template on codesandbox**](https://codesandbox.io/s/atomic-data-react-template-4y9qu?file=/src/MyResource.tsx:0-1223)
6161

62-
[**docs**](https://atomicdata-dev.github.io/atomic-data-browser/docs/modules/_tomic_react.html)
62+
[**docs**](https://atomic-lib.netlify.app/modules/_tomic_react)
6363

6464
[→ Read more](react/README.md)
6565

browser/lib/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# @tomic/lib: The Atomic Data library for typescript / javascript
22

3-
[**docs**](https://atomicdata-dev.github.io/atomic-data-browser/docs/modules/_tomic_lib.html)
3+
[**docs**](https://atomic-lib.netlify.app/modules/_tomic_lib)
44

55
Core typescript library for handling JSON-AD parsing, storing [Atomic Data](https://docs.atomicdata.dev/), signing Commits, and more.

browser/lib/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"version": "0.36.0",
32
"author": "Joep Meindertsma",
43
"dependencies": {
54
"@noble/ed25519": "1.6.0",
@@ -10,36 +9,37 @@
109
},
1110
"description": "",
1211
"devDependencies": {
12+
"@tomic/cli": "workspace:*",
1313
"@types/fast-json-stable-stringify": "^2.1.0",
1414
"chai": "^4.3.4",
1515
"typescript": "^4.8",
16-
"whatwg-fetch": "^3.6.2",
17-
"@tomic/cli": "workspace:*"
16+
"whatwg-fetch": "^3.6.2"
1817
},
1918
"files": [
2019
"dist"
2120
],
21+
"gitHead": "2172c73d8df4e5f273e6386676abc91b6c5b2707",
2222
"license": "MIT",
23-
"main-dev": "src/index.ts",
2423
"main": "dist/src/index.js",
24+
"main-dev": "src/index.ts",
2525
"name": "@tomic/lib",
2626
"publishConfig": {
2727
"access": "public"
2828
},
2929
"scripts": {
3030
"build": "tsc",
31+
"generate-ontologies": "ad-generate ontologies",
3132
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
3233
"lint-fix": "eslint ./src --ext .js,.jsx,.ts,.tsx --fix",
3334
"prepublishOnly": "pnpm run build && pnpm run lint-fix",
34-
"watch": "tsc --build --watch",
3535
"start": "pnpm watch",
3636
"test": "NODE_OPTIONS='--experimental-vm-modules' ../node_modules/jest/bin/jest.js",
3737
"tsc": "tsc --build",
3838
"typecheck": "tsc --noEmit",
39-
"generate-ontologies": "ad-generate ontologies"
39+
"watch": "tsc --build --watch"
4040
},
4141
"source": "src/index.ts",
4242
"type": "module",
4343
"types": "dist/src/index.d.ts",
44-
"gitHead": "2172c73d8df4e5f273e6386676abc91b6c5b2707"
44+
"version": "0.36.0"
4545
}

browser/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"eslint-plugin-react-hooks": "^4.3.0",
2121
"husky": "^8.0.3",
2222
"jest": "^29.0.2",
23+
"netlify-cli": "16.2.0",
2324
"prettier": "2.4.1",
2425
"prettier-plugin-jsdoc": "^0.3.24",
2526
"react": "^18.2.0",
@@ -42,7 +43,8 @@
4243
"test-e2e": "pnpm run --filter @tomic/e2e test-e2e",
4344
"test-query": "pnpm run --filter @tomic/e2e test-query",
4445
"start": "pnpm run -r --parallel start",
45-
"typedoc": "typedoc . --options typedoc.json",
46+
"typedoc": "typedoc --options ./typedoc.json",
47+
"typedoc-publish": "pnpm run typedoc && netlify deploy --dir data-browser/publish/docs/ --prod --auth $NETLIFY_AUTH_TOKEN --site atomic-lib",
4648
"typecheck": "pnpm run -r --parallel typecheck"
4749
},
4850
"husky": {

0 commit comments

Comments
 (0)