Skip to content

Commit e7810e8

Browse files
danbot315Daniel Clayton
andauthored
docs: improve npm package docs for @dotgithub/core and @dotgithub/cli (#22)
* docs: expand npm package documentation for core and cli * docs: emphasize TypeScript authoring workflow in package descriptions --------- Co-authored-by: Daniel Clayton <dan@Daniels-Mac-mini.local>
1 parent d820310 commit e7810e8

3 files changed

Lines changed: 96 additions & 7 deletions

File tree

.changeset/green-coats-share.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@dotgithub/core": patch
3+
"@dotgithub/cli": patch
4+
---
5+
6+
Improve npm package documentation for both core and CLI with clearer usage examples, command flows, and direct documentation links.

packages/cli/README.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,54 @@
11
# @dotgithub/cli
22

3-
CLI for DotGitHub workflow scaffolding and synthesis.
3+
CLI for scaffolding, managing, and synthesizing DotGitHub workflows from TypeScript definitions.
44

55
## Install
66

77
```bash
88
npm install -g @dotgithub/cli
9-
# or
9+
```
10+
11+
Or run without installing globally:
12+
13+
```bash
1014
npx @dotgithub/cli --help
1115
```
1216

17+
## Commands (quick overview)
18+
19+
```bash
20+
# Initialize DotGitHub config/files
21+
dotgithub init
22+
23+
# Add pinned GitHub Actions to your config
24+
dotgithub add actions/checkout@v4
25+
26+
# Generate workflow files
27+
dotgithub synth
28+
```
29+
30+
Aliases:
31+
32+
```bash
33+
dgh --help
34+
dotgithub --help
35+
```
36+
37+
## Typical TypeScript workflow
38+
39+
1. `dotgithub init`
40+
2. `dotgithub add <org/repo@version>`
41+
3. author/update your workflow constructs in **TypeScript**
42+
4. `dotgithub synth` to generate YAML
43+
5. commit generated workflow files
44+
1345
## Docs
1446

15-
- <https://github.com/azwebmaster/dotgithub#readme>
16-
- <https://github.com/azwebmaster/dotgithub/tree/main/docs>
47+
- Main docs: <https://github.com/azwebmaster/dotgithub#readme>
48+
- Guides: <https://github.com/azwebmaster/dotgithub/tree/main/docs>
49+
- CLI source/context: <https://github.com/azwebmaster/dotgithub/tree/main/packages/cli>
50+
51+
## Repository
52+
53+
- Source: <https://github.com/azwebmaster/dotgithub>
54+
- Issues: <https://github.com/azwebmaster/dotgithub/issues>

packages/core/README.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,59 @@
11
# @dotgithub/core
22

3-
Core library for DotGitHub: type-safe constructs and workflow generation utilities.
3+
Type-safe TypeScript library for defining and generating GitHub Actions workflows using DotGitHub constructs.
4+
5+
## What this package is
6+
7+
`@dotgithub/core` is the programmatic engine behind DotGitHub. It provides:
8+
9+
- strongly typed workflow models
10+
- construct primitives for jobs/workflows/shared workflows
11+
- generation/synthesis helpers for writing `.github/workflows/*.yml`
12+
13+
If you want to author reusable CI/CD logic in TypeScript (instead of hand-writing YAML), this is the package you use.
414

515
## Install
616

717
```bash
818
npm install @dotgithub/core
919
```
1020

21+
## Quick example
22+
23+
```ts
24+
import { createWorkflow } from '@dotgithub/core';
25+
26+
const workflow = createWorkflow({
27+
on: {
28+
push: { branches: ['main'] },
29+
},
30+
jobs: {
31+
test: {
32+
'runs-on': 'ubuntu-latest',
33+
steps: [
34+
{ uses: 'actions/checkout@v4' },
35+
{ run: 'npm ci' },
36+
{ run: 'npm test' },
37+
],
38+
},
39+
},
40+
});
41+
42+
// synthesize with your DotGitHub pipeline
43+
```
44+
45+
## When to use `@dotgithub/core` vs `@dotgithub/cli`
46+
47+
- Use **`@dotgithub/core`** for library/SDK style usage in code.
48+
- Use **`@dotgithub/cli`** when you want command-driven setup and synthesis.
49+
1150
## Docs
1251

13-
- <https://github.com/azwebmaster/dotgithub#readme>
14-
- <https://github.com/azwebmaster/dotgithub/tree/main/docs>
52+
- Main docs: <https://github.com/azwebmaster/dotgithub#readme>
53+
- Guides: <https://github.com/azwebmaster/dotgithub/tree/main/docs>
54+
- API/reference context: <https://github.com/azwebmaster/dotgithub/tree/main/packages/core>
55+
56+
## Repository
57+
58+
- Source: <https://github.com/azwebmaster/dotgithub>
59+
- Issues: <https://github.com/azwebmaster/dotgithub/issues>

0 commit comments

Comments
 (0)