doc-syncer 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -16
- package/package.json +6 -2
- package/src/cli.ts +40 -1
- package/tsconfig.json +22 -0
package/README.md
CHANGED
|
@@ -6,23 +6,17 @@ AI-powered documentation sync using Claude Code or Codex.
|
|
|
6
6
|
Code changes (PR/branch) → Agent analyzes → Docs updated
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
### Via npm (recommended)
|
|
9
|
+
## Prerequisites
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
npm install -g doc-syncer
|
|
15
|
-
```
|
|
11
|
+
### 1. Install Bun
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
This package requires Bun runtime:
|
|
18
14
|
|
|
19
15
|
```bash
|
|
20
|
-
|
|
21
|
-
cd doc-syncer
|
|
22
|
-
bun install
|
|
16
|
+
curl -fsSL https://bun.sh/install | bash
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
### 2. Install an AI agent
|
|
26
20
|
|
|
27
21
|
You need one of these AI agents installed:
|
|
28
22
|
|
|
@@ -35,13 +29,35 @@ claude # authenticate once
|
|
|
35
29
|
# Follow Codex CLI installation instructions
|
|
36
30
|
```
|
|
37
31
|
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
### Via Bun (recommended)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun install -g doc-syncer
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Via npm
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g doc-syncer
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From source
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/orlan0045/doc-syncer.git
|
|
50
|
+
cd doc-syncer
|
|
51
|
+
bun install
|
|
52
|
+
```
|
|
53
|
+
|
|
38
54
|
## Setup
|
|
39
55
|
|
|
40
|
-
|
|
56
|
+
Create your configuration file:
|
|
41
57
|
|
|
42
58
|
```bash
|
|
43
|
-
#
|
|
44
|
-
|
|
59
|
+
# Create config from example
|
|
60
|
+
doc-syncer init
|
|
45
61
|
|
|
46
62
|
# Edit with your repo paths
|
|
47
63
|
nano doc-syncer.config.yml
|
|
@@ -64,9 +80,12 @@ modes:
|
|
|
64
80
|
|
|
65
81
|
### Option 1: Config file (recommended)
|
|
66
82
|
|
|
67
|
-
Run:
|
|
68
|
-
|
|
69
83
|
```bash
|
|
84
|
+
# First time setup
|
|
85
|
+
doc-syncer init # create config file
|
|
86
|
+
# Edit doc-syncer.config.yml with your paths
|
|
87
|
+
|
|
88
|
+
# Then run
|
|
70
89
|
doc-syncer sync # run it
|
|
71
90
|
doc-syncer sync --dry-run # preview only
|
|
72
91
|
doc-syncer sync --mode backend # use specific mode from config
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doc-syncer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "AI-powered documentation sync using Claude Code or Codex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Andrii Orlov",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"src/",
|
|
31
31
|
"doc-syncer.config.example.yml",
|
|
32
|
+
"tsconfig.json",
|
|
32
33
|
"README.md",
|
|
33
34
|
"LICENSE"
|
|
34
35
|
],
|
|
@@ -42,6 +43,9 @@
|
|
|
42
43
|
"yaml": "^2.6.0"
|
|
43
44
|
},
|
|
44
45
|
"engines": {
|
|
45
|
-
"
|
|
46
|
+
"bun": ">=1.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/bun": "^1.3.5"
|
|
46
50
|
}
|
|
47
51
|
}
|
package/src/cli.ts
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* doc-syncer CLI entry point
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
+
* doc-syncer init
|
|
7
8
|
* doc-syncer sync [options]
|
|
8
9
|
* doc-syncer --help
|
|
9
10
|
*/
|
|
10
11
|
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { existsSync, copyFileSync } from "node:fs";
|
|
14
|
+
|
|
11
15
|
const args = Bun.argv.slice(2);
|
|
12
16
|
const command = args[0];
|
|
13
17
|
|
|
@@ -16,7 +20,9 @@ if (!command || command === "--help" || command === "-h") {
|
|
|
16
20
|
process.exit(0);
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
if (command === "
|
|
23
|
+
if (command === "init") {
|
|
24
|
+
handleInit();
|
|
25
|
+
} else if (command === "sync") {
|
|
20
26
|
// Remove 'sync' from args and run the sync script
|
|
21
27
|
Bun.argv.splice(2, 1);
|
|
22
28
|
await import("./doc-sync.ts");
|
|
@@ -26,14 +32,46 @@ if (command === "sync") {
|
|
|
26
32
|
process.exit(1);
|
|
27
33
|
}
|
|
28
34
|
|
|
35
|
+
function handleInit() {
|
|
36
|
+
const targetFile = join(process.cwd(), "doc-syncer.config.yml");
|
|
37
|
+
|
|
38
|
+
// Check if config already exists
|
|
39
|
+
if (existsSync(targetFile)) {
|
|
40
|
+
console.error("❌ Config file already exists: doc-syncer.config.yml");
|
|
41
|
+
console.log(" Delete it first or edit it directly");
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Find the example config file (relative to this script)
|
|
46
|
+
const exampleFile = join(import.meta.dir, "..", "doc-syncer.config.example.yml");
|
|
47
|
+
|
|
48
|
+
if (!existsSync(exampleFile)) {
|
|
49
|
+
console.error("❌ Example config file not found");
|
|
50
|
+
console.log(" Expected at:", exampleFile);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Copy the example config
|
|
55
|
+
try {
|
|
56
|
+
copyFileSync(exampleFile, targetFile);
|
|
57
|
+
console.log("✅ Created doc-syncer.config.yml");
|
|
58
|
+
console.log(" Edit this file with your repository paths");
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error("❌ Failed to create config file:", error.message);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
29
65
|
function printHelp() {
|
|
30
66
|
console.log(`
|
|
31
67
|
doc-syncer: AI-powered documentation sync
|
|
32
68
|
|
|
33
69
|
Usage:
|
|
70
|
+
doc-syncer init
|
|
34
71
|
doc-syncer sync [options]
|
|
35
72
|
|
|
36
73
|
Commands:
|
|
74
|
+
init Create doc-syncer.config.yml from example
|
|
37
75
|
sync Sync documentation based on code changes
|
|
38
76
|
|
|
39
77
|
Options:
|
|
@@ -48,6 +86,7 @@ Options:
|
|
|
48
86
|
-h, --help Show this help
|
|
49
87
|
|
|
50
88
|
Examples:
|
|
89
|
+
doc-syncer init # Create config file
|
|
51
90
|
doc-syncer sync # Use default mode
|
|
52
91
|
doc-syncer sync --mode esign # Use specific mode
|
|
53
92
|
doc-syncer sync --mode esign --dry-run # Preview mode
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["ESNext"],
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"allowImportingTsExtensions": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"composite": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"downlevelIteration": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"allowSyntheticDefaultImports": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"allowJs": true,
|
|
18
|
+
"types": [
|
|
19
|
+
"bun-types"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|