Skip to content

Commit 5babd09

Browse files
authored
docs: chunky overhaul (#3129)
* improve overall docs structure and things
1 parent d94a3b4 commit 5babd09

File tree

630 files changed

+35716
-2027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

630 files changed

+35716
-2027
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
description: How to edit guide code examples and regenerate snippets
3+
globs: sdks/guides/**/*,frontend/docs/pages/guides/**/*.mdx,examples/*/guides/**/*
4+
alwaysApply: false
5+
---
6+
7+
# Guide Snippet Workflow
8+
9+
## Source of truth
10+
11+
All guide code lives in `sdks/guides/{lang}/`. The files under `examples/{lang}/guides/` are **generated** mirrors. Never edit the `examples/` copies directly.
12+
13+
## Snippet markers
14+
15+
Use `# > Step Title` (or `// >` for TS/Go) to open a snippet and `# !!` (or `// !!`) to close it. The generator converts the title to snake_case for the snippet key (e.g. `# > Step 04 Rate Limited Scrape` → `step_04_rate_limited_scrape`).
16+
17+
## Referencing snippets in MDX
18+
19+
```
20+
snippets.{lang}.guides.{guide_dir}.{file_stem}.{snippet_key}
21+
```
22+
23+
Example: `snippets.python.guides.web_scraping.worker.step_01_define_scrape_task`
24+
25+
## Regenerating
26+
27+
After editing any file in `sdks/guides/`, run:
28+
29+
```
30+
cd frontend/snippets && python3 generate.py
31+
```
32+
33+
This regenerates both `examples/*/guides/` mirror files and `frontend/docs/lib/generated/snippets/index.ts`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: Writing style conventions for Hatchet documentation
3+
globs: frontend/docs/**/*.mdx
4+
alwaysApply: false
5+
---
6+
7+
# Docs Writing Style
8+
9+
## Punctuation
10+
11+
- Do NOT use em dashes (—). Use commas, parentheses, or separate sentences instead.
12+
- Prefer short, direct sentences over long compound ones.
13+
14+
## Phrases to Avoid
15+
16+
- Do not use "under the hood." Just state the fact directly.
17+
18+
## Terminology
19+
20+
- Do not use the word "cycle" to describe agent loops. Use "child spawning" or "self-spawning child task" instead.
21+
- Use "durable task" (not "durable function" or "durable workflow step") for the core execution primitive.
22+
- Link concept terms to their concept pages on first use (e.g. `[durable task](/concepts/durable-workflows/durable-task-execution)`).

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ linters:
5555
paths:
5656
- third_party$
5757
- builtin$
58-
- examples$
58+
- ^examples/
5959
- '(.+)_test\.go'
6060
- "cmd/hatchet-loadtest/rampup/(.+).go"
6161
formatters:
@@ -71,4 +71,4 @@ formatters:
7171
paths:
7272
- third_party$
7373
- builtin$
74-
- examples$
74+
- ^examples/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ repos:
1717
rev: v2.7.2
1818
hooks:
1919
- id: golangci-lint
20-
args: ["--config=.golangci.yml"]
21-
exclude: ^examples/
20+
args: ["--config=.golangci.yml", "--allow-parallel-runners"]
21+
exclude: ^(examples/|sdks/guides/go/)

Taskfile.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,26 @@ tasks:
212212
lint:
213213
cmds:
214214
- task: lint-go
215+
- task: lint-go-guides
216+
- task: lint-python-guides
217+
- task: lint-typescript-guides
218+
- task: lint-ruby-guides
215219
- task: lint-app
216220
- task: lint-docs
217221
lint-go:
218222
cmd: golangci-lint run ./... --config .golangci.yml
223+
lint-go-guides:
224+
dir: sdks/guides/go
225+
cmd: golangci-lint run ./... --config .golangci.yml
226+
lint-python-guides:
227+
dir: sdks/guides/python
228+
cmd: poetry run ruff check .
229+
lint-typescript-guides:
230+
dir: sdks/guides/typescript
231+
cmd: pnpm install && pnpm run lint:check
232+
lint-ruby-guides:
233+
dir: sdks/guides/ruby
234+
cmd: bundle install && bundle exec rubocop
219235
lint-app:
220236
dir: frontend/app
221237
cmd: pnpm run lint:check

cmd/hatchet-cli/cli/templates/typescript/bun/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"typescript": "^5.9.3"
1717
},
1818
"dependencies": {
19-
"@hatchet-dev/typescript-sdk": "^1.10.3"
19+
"@hatchet-dev/typescript-sdk": "1.10.3"
2020
}
2121
}

cmd/hatchet-cli/cli/templates/typescript/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"typescript": "^5.9.3"
1717
},
1818
"dependencies": {
19-
"@hatchet-dev/typescript-sdk": "^1.10.3"
19+
"@hatchet-dev/typescript-sdk": "1.10.3"
2020
}
2121
}

cmd/hatchet-cli/cli/templates/typescript/pnpm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"typescript": "^5.9.3"
1717
},
1818
"dependencies": {
19-
"@hatchet-dev/typescript-sdk": "^1.10.3"
19+
"@hatchet-dev/typescript-sdk": "1.10.3"
2020
},
2121
"pnpm": {
2222
"overrides": {

cmd/hatchet-cli/cli/templates/typescript/pnpm/pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/hatchet-cli/cli/templates/typescript/yarn/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"typescript": "^5.9.3"
1717
},
1818
"dependencies": {
19-
"@hatchet-dev/typescript-sdk": "^1.10.3"
19+
"@hatchet-dev/typescript-sdk": "1.10.3"
2020
}
2121
}

0 commit comments

Comments
 (0)