pixotope-documentalist 1.0.0
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 +189 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/models/index.d.ts +64 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +34 -0
- package/dist/models/index.js.map +1 -0
- package/dist/parser/commentExtractor.d.ts +12 -0
- package/dist/parser/commentExtractor.d.ts.map +1 -0
- package/dist/parser/commentExtractor.js +132 -0
- package/dist/parser/commentExtractor.js.map +1 -0
- package/dist/parser/fileScanner.d.ts +2 -0
- package/dist/parser/fileScanner.d.ts.map +1 -0
- package/dist/parser/fileScanner.js +48 -0
- package/dist/parser/fileScanner.js.map +1 -0
- package/dist/parser/index.d.ts +4 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +10 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/tagParser.d.ts +9 -0
- package/dist/parser/tagParser.d.ts.map +1 -0
- package/dist/parser/tagParser.js +235 -0
- package/dist/parser/tagParser.js.map +1 -0
- package/dist/pipeline.d.ts +31 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +147 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/publisher/confluenceApi.d.ts +33 -0
- package/dist/publisher/confluenceApi.d.ts.map +1 -0
- package/dist/publisher/confluenceApi.js +131 -0
- package/dist/publisher/confluenceApi.js.map +1 -0
- package/dist/publisher/diff.d.ts +6 -0
- package/dist/publisher/diff.d.ts.map +1 -0
- package/dist/publisher/diff.js +54 -0
- package/dist/publisher/diff.js.map +1 -0
- package/dist/publisher/index.d.ts +3 -0
- package/dist/publisher/index.d.ts.map +1 -0
- package/dist/publisher/index.js +9 -0
- package/dist/publisher/index.js.map +1 -0
- package/dist/renderer/components.d.ts +9 -0
- package/dist/renderer/components.d.ts.map +1 -0
- package/dist/renderer/components.js +161 -0
- package/dist/renderer/components.js.map +1 -0
- package/dist/renderer/confluenceHtml.d.ts +6 -0
- package/dist/renderer/confluenceHtml.d.ts.map +1 -0
- package/dist/renderer/confluenceHtml.js +128 -0
- package/dist/renderer/confluenceHtml.js.map +1 -0
- package/dist/renderer/index.d.ts +3 -0
- package/dist/renderer/index.d.ts.map +1 -0
- package/dist/renderer/index.js +14 -0
- package/dist/renderer/index.js.map +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# pixotope-documentalist
|
|
2
|
+
|
|
3
|
+
Parses JSDoc-style API documentation comments from source files (TypeScript, JavaScript, Python) and publishes them as formatted pages to Confluence.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install pixotope-documentalist
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run directly with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx pixotope-documentalist publish --config ./config.yml
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
1. Add doc comments to your source files
|
|
20
|
+
2. Create a `config.yml` pointing to your sources and Confluence pages
|
|
21
|
+
3. Set environment variables for Confluence auth
|
|
22
|
+
4. Run `npx pixotope-documentalist publish`
|
|
23
|
+
|
|
24
|
+
## Comment Format
|
|
25
|
+
|
|
26
|
+
### TypeScript / JavaScript
|
|
27
|
+
|
|
28
|
+
Use JSDoc-style block comments with `@api` as the entry tag:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
/**
|
|
32
|
+
* @api CopyShowFileToLocal
|
|
33
|
+
* @group Shows
|
|
34
|
+
* @kind call
|
|
35
|
+
* @description Copies a show file from the server to this machine.
|
|
36
|
+
* @param {string} ShowName - Name of the show to copy.
|
|
37
|
+
* @param {boolean} [Overwrite=false] - Whether to overwrite existing file.
|
|
38
|
+
* @returns {boolean} Success - Whether the copy succeeded.
|
|
39
|
+
* @example Copy a show
|
|
40
|
+
* >>> {"Type":"Call","Target":"Machine1-Daemon","Method":"CopyShowFileToLocal"}
|
|
41
|
+
* >>> {"Params":{"ShowName":"Show1"}}
|
|
42
|
+
* <<< {"Type":"CallResult","Method":"CopyShowFileToLocal"}
|
|
43
|
+
* <<< {"Result":{"Success":true}}
|
|
44
|
+
* @warning This may take a while for large files.
|
|
45
|
+
* @since 23.3.0
|
|
46
|
+
*/
|
|
47
|
+
export const copyShowFileToDisk = async (...) => { ... };
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Python
|
|
51
|
+
|
|
52
|
+
Use `#` comment blocks:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
# @api DiscoverDevices
|
|
56
|
+
# @group Network
|
|
57
|
+
# @kind call
|
|
58
|
+
# @description Discovers available devices on the local network.
|
|
59
|
+
# @param {string} Subnet - The subnet to scan.
|
|
60
|
+
# @param {integer} Timeout - Scan timeout in milliseconds.
|
|
61
|
+
# @returns {boolean} Success - Whether the scan completed.
|
|
62
|
+
def discover_devices(subnet: str, timeout: int) -> dict:
|
|
63
|
+
pass
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Tag Reference
|
|
67
|
+
|
|
68
|
+
| Tag | Required | Description |
|
|
69
|
+
|-----|----------|-------------|
|
|
70
|
+
| `@api` | Yes | Endpoint name (displayed as title) |
|
|
71
|
+
| `@group` | No | Section grouping header |
|
|
72
|
+
| `@kind` | No | `call` (default), `get`, `set` |
|
|
73
|
+
| `@description` | No | Multi-line description (continues until next tag) |
|
|
74
|
+
| `@param` | No | `{type} Name - Description`. `[Name]` = optional, `[Name=default]` = with default |
|
|
75
|
+
| `@returns` | No | `{type} Name - Description` |
|
|
76
|
+
| `@example` | No | Title on first line, `>>>` for request messages, `<<<` for response messages |
|
|
77
|
+
| `@warning` | No | Warning/note text |
|
|
78
|
+
| `@since` | No | Version when this was introduced |
|
|
79
|
+
| `@deprecated` | No | Deprecation notice |
|
|
80
|
+
| `@internal` | No | Flag to exclude from published docs |
|
|
81
|
+
| `@value` | No | For state docs: `{type} Name - Description` |
|
|
82
|
+
|
|
83
|
+
## Configuration
|
|
84
|
+
|
|
85
|
+
Create a `config.yml` in your project:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
confluence:
|
|
89
|
+
base_url: "https://your-domain.atlassian.net/wiki/rest/api/content"
|
|
90
|
+
|
|
91
|
+
source_root: "."
|
|
92
|
+
|
|
93
|
+
documents:
|
|
94
|
+
- id: daemon_calls
|
|
95
|
+
title: "Daemon API - Calls"
|
|
96
|
+
confluence_id:
|
|
97
|
+
master: "1234567890"
|
|
98
|
+
release: "0987654321"
|
|
99
|
+
sources:
|
|
100
|
+
- path: "packages/Daemon/src/endpoints/calls.ts"
|
|
101
|
+
|
|
102
|
+
- id: daemon_get
|
|
103
|
+
title: "Daemon API - Get"
|
|
104
|
+
confluence_id:
|
|
105
|
+
master: "1111111111"
|
|
106
|
+
release: "2222222222"
|
|
107
|
+
sources:
|
|
108
|
+
- path: "packages/Daemon/src/endpoints/get.ts"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `source_root`: base path for resolving relative source paths (relative to config file location)
|
|
112
|
+
- `confluence_id.master`: page ID for master/development docs
|
|
113
|
+
- `confluence_id.release`: page ID for release docs
|
|
114
|
+
|
|
115
|
+
## CLI Commands
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Parse source files and output JSON (for debugging)
|
|
119
|
+
npx pixotope-documentalist parse --config ./config.yml --verbose
|
|
120
|
+
|
|
121
|
+
# Parse + render to HTML files locally (no API calls)
|
|
122
|
+
npx pixotope-documentalist preview --config ./config.yml
|
|
123
|
+
|
|
124
|
+
# Parse + render + upload to Confluence
|
|
125
|
+
npx pixotope-documentalist publish --config ./config.yml --target master
|
|
126
|
+
|
|
127
|
+
# Show what would change without publishing
|
|
128
|
+
npx pixotope-documentalist diff --config ./config.yml --target master
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Options
|
|
132
|
+
|
|
133
|
+
| Option | Description | Default |
|
|
134
|
+
|--------|-------------|---------|
|
|
135
|
+
| `-c, --config <path>` | Path to config.yml | `config.yml` |
|
|
136
|
+
| `-d, --document <id>` | Process only this document | all documents |
|
|
137
|
+
| `-t, --target <env>` | `master` or `release` | `master` |
|
|
138
|
+
| `--version-stamp <ver>` | Version stamp | `local` |
|
|
139
|
+
| `-v, --verbose` | Verbose logging | off |
|
|
140
|
+
|
|
141
|
+
## Environment Variables
|
|
142
|
+
|
|
143
|
+
| Variable | Purpose |
|
|
144
|
+
|----------|---------|
|
|
145
|
+
| `CONFLUENCE_USER` | Confluence account email |
|
|
146
|
+
| `CONFLUENCE_TOKEN` | Confluence API token ([generate here](https://id.atlassian.com/manage-profile/security/api-tokens)) |
|
|
147
|
+
| `PIXOTOPE_DOCS_NPM_TOKEN` | npm publish auth token (only for publishing the package) |
|
|
148
|
+
|
|
149
|
+
Create a `.env` file (git-ignored) for local use:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
CONFLUENCE_USER=your.email@pixotope.com
|
|
153
|
+
CONFLUENCE_TOKEN=your_api_token
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Development
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Install dependencies
|
|
160
|
+
npm install
|
|
161
|
+
|
|
162
|
+
# Run locally with ts-node
|
|
163
|
+
npx ts-node src/index.ts preview --config example/config.yml
|
|
164
|
+
|
|
165
|
+
# Run tests
|
|
166
|
+
npm test
|
|
167
|
+
|
|
168
|
+
# Build
|
|
169
|
+
npm run build
|
|
170
|
+
|
|
171
|
+
# Publish to npm
|
|
172
|
+
npm publish
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Example
|
|
176
|
+
|
|
177
|
+
The `example/` folder contains a self-contained demo:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npx ts-node src/index.ts preview --config example/config.yml
|
|
181
|
+
# Check output in example/output/formatted/
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Supported File Types
|
|
185
|
+
|
|
186
|
+
- `.ts`, `.tsx` (TypeScript)
|
|
187
|
+
- `.js`, `.jsx` (JavaScript)
|
|
188
|
+
- `.py` (Python)
|
|
189
|
+
- `.h`, `.cpp`, `.hpp` (C++)
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA6CrD;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadConfig = loadConfig;
|
|
7
|
+
exports.resolveSourcePath = resolveSourcePath;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
11
|
+
function loadConfig(configPath) {
|
|
12
|
+
const absolutePath = path_1.default.resolve(configPath);
|
|
13
|
+
if (!fs_1.default.existsSync(absolutePath)) {
|
|
14
|
+
throw new Error(`Config file not found: ${absolutePath}`);
|
|
15
|
+
}
|
|
16
|
+
const content = fs_1.default.readFileSync(absolutePath, "utf-8");
|
|
17
|
+
const raw = yaml_1.default.parse(content);
|
|
18
|
+
if (!raw.confluence?.base_url) {
|
|
19
|
+
throw new Error("Config missing required field: confluence.base_url");
|
|
20
|
+
}
|
|
21
|
+
if (!raw.documents || !Array.isArray(raw.documents)) {
|
|
22
|
+
throw new Error("Config missing required field: documents (array)");
|
|
23
|
+
}
|
|
24
|
+
const config = {
|
|
25
|
+
confluence: {
|
|
26
|
+
base_url: raw.confluence.base_url,
|
|
27
|
+
},
|
|
28
|
+
source_root: raw.source_root || ".",
|
|
29
|
+
documents: raw.documents.map((doc) => {
|
|
30
|
+
if (!doc.id)
|
|
31
|
+
throw new Error("Document missing required field: id");
|
|
32
|
+
if (!doc.title)
|
|
33
|
+
throw new Error("Document missing required field: title");
|
|
34
|
+
if (!doc.confluence_id)
|
|
35
|
+
throw new Error(`Document "${doc.id}" missing required field: confluence_id`);
|
|
36
|
+
if (!doc.sources || !Array.isArray(doc.sources)) {
|
|
37
|
+
throw new Error(`Document "${doc.id}" missing required field: sources (array)`);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
id: doc.id,
|
|
41
|
+
title: doc.title,
|
|
42
|
+
confluenceId: {
|
|
43
|
+
master: String(doc.confluence_id.master || ""),
|
|
44
|
+
release: String(doc.confluence_id.release || ""),
|
|
45
|
+
},
|
|
46
|
+
sources: doc.sources.map((s) => ({
|
|
47
|
+
path: typeof s === "string" ? s : s.path,
|
|
48
|
+
})),
|
|
49
|
+
};
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
return config;
|
|
53
|
+
}
|
|
54
|
+
function resolveSourcePath(sourceRoot, sourcePath, configDir) {
|
|
55
|
+
const resolvedRoot = path_1.default.resolve(configDir, sourceRoot);
|
|
56
|
+
return path_1.default.resolve(resolvedRoot, sourcePath);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
|
+
const config_1 = require("./config");
|
|
11
|
+
const pipeline_1 = require("./pipeline");
|
|
12
|
+
// Load .env file from cwd
|
|
13
|
+
dotenv_1.default.config();
|
|
14
|
+
const program = new commander_1.Command();
|
|
15
|
+
program
|
|
16
|
+
.name("pixotope-documentalist")
|
|
17
|
+
.description("Parse API documentation from source files and publish to Confluence")
|
|
18
|
+
.version("1.0.0");
|
|
19
|
+
function makeOptions(cmd) {
|
|
20
|
+
const configPath = path_1.default.resolve(cmd.config || "config.yml");
|
|
21
|
+
const configDir = path_1.default.dirname(configPath);
|
|
22
|
+
return {
|
|
23
|
+
config: (0, config_1.loadConfig)(configPath),
|
|
24
|
+
configDir,
|
|
25
|
+
document: cmd.document,
|
|
26
|
+
target: cmd.target || "master",
|
|
27
|
+
version: cmd.versionStamp || "local",
|
|
28
|
+
verbose: cmd.verbose || false,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
program
|
|
32
|
+
.command("parse")
|
|
33
|
+
.description("Parse source files and output intermediate JSON")
|
|
34
|
+
.option("-c, --config <path>", "Path to config.yml", "config.yml")
|
|
35
|
+
.option("-d, --document <id>", "Process only this document")
|
|
36
|
+
.option("-v, --verbose", "Verbose logging")
|
|
37
|
+
.action((cmd) => {
|
|
38
|
+
const options = makeOptions(cmd);
|
|
39
|
+
(0, pipeline_1.runParse)(options);
|
|
40
|
+
});
|
|
41
|
+
program
|
|
42
|
+
.command("preview")
|
|
43
|
+
.description("Parse + render to HTML files (no API calls)")
|
|
44
|
+
.option("-c, --config <path>", "Path to config.yml", "config.yml")
|
|
45
|
+
.option("-d, --document <id>", "Process only this document")
|
|
46
|
+
.option("-v, --verbose", "Verbose logging")
|
|
47
|
+
.action((cmd) => {
|
|
48
|
+
const options = makeOptions(cmd);
|
|
49
|
+
(0, pipeline_1.runPreview)(options);
|
|
50
|
+
});
|
|
51
|
+
program
|
|
52
|
+
.command("publish")
|
|
53
|
+
.description("Parse + render + upload to Confluence")
|
|
54
|
+
.option("-c, --config <path>", "Path to config.yml", "config.yml")
|
|
55
|
+
.option("-d, --document <id>", "Process only this document")
|
|
56
|
+
.option("-t, --target <env>", "master or release", "master")
|
|
57
|
+
.option("--version-stamp <ver>", "Version stamp", "local")
|
|
58
|
+
.option("-v, --verbose", "Verbose logging")
|
|
59
|
+
.action(async (cmd) => {
|
|
60
|
+
const options = makeOptions(cmd);
|
|
61
|
+
await (0, pipeline_1.runPublish)(options);
|
|
62
|
+
});
|
|
63
|
+
program
|
|
64
|
+
.command("diff")
|
|
65
|
+
.description("Show what would change without publishing")
|
|
66
|
+
.option("-c, --config <path>", "Path to config.yml", "config.yml")
|
|
67
|
+
.option("-d, --document <id>", "Process only this document")
|
|
68
|
+
.option("-t, --target <env>", "master or release", "master")
|
|
69
|
+
.option("-v, --verbose", "Verbose logging")
|
|
70
|
+
.action(async (cmd) => {
|
|
71
|
+
const options = makeOptions(cmd);
|
|
72
|
+
await (0, pipeline_1.runDiff)(options);
|
|
73
|
+
});
|
|
74
|
+
program.parse();
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,gDAAwB;AACxB,oDAA4B;AAC5B,qCAAsC;AACtC,yCAAwF;AAExF,0BAA0B;AAC1B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B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
+
type: string;
|
|
4
|
+
description: string;
|
|
5
|
+
optional: boolean;
|
|
6
|
+
default?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Example {
|
|
9
|
+
description: string;
|
|
10
|
+
request: string[];
|
|
11
|
+
response: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface Endpoint {
|
|
14
|
+
name: string;
|
|
15
|
+
kind: "call" | "get" | "set";
|
|
16
|
+
description: string;
|
|
17
|
+
params: Param[];
|
|
18
|
+
returns: Param[];
|
|
19
|
+
warnings: string[];
|
|
20
|
+
examples: Example[];
|
|
21
|
+
since?: string;
|
|
22
|
+
deprecated?: string;
|
|
23
|
+
internal: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface Value {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
children: Value[];
|
|
30
|
+
}
|
|
31
|
+
export interface Group {
|
|
32
|
+
header: string;
|
|
33
|
+
description: string;
|
|
34
|
+
endpoints: Endpoint[];
|
|
35
|
+
values: Value[];
|
|
36
|
+
}
|
|
37
|
+
export interface Document {
|
|
38
|
+
title: string;
|
|
39
|
+
version: string;
|
|
40
|
+
confluenceId: string;
|
|
41
|
+
groups: Group[];
|
|
42
|
+
}
|
|
43
|
+
export interface DocumentConfig {
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
confluenceId: {
|
|
47
|
+
master: string;
|
|
48
|
+
release: string;
|
|
49
|
+
};
|
|
50
|
+
sources: {
|
|
51
|
+
path: string;
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
54
|
+
export interface Config {
|
|
55
|
+
confluence: {
|
|
56
|
+
base_url: string;
|
|
57
|
+
};
|
|
58
|
+
source_root: string;
|
|
59
|
+
documents: DocumentConfig[];
|
|
60
|
+
}
|
|
61
|
+
export declare function createEndpoint(name: string, kind?: Endpoint["kind"]): Endpoint;
|
|
62
|
+
export declare function createGroup(header?: string): Group;
|
|
63
|
+
export declare function createDocument(title?: string): Document;
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,QAAQ,CAAC,MAAM,CAAU,GAAG,QAAQ,CAWtF;AAED,wBAAgB,WAAW,CAAC,MAAM,GAAE,MAAW,GAAG,KAAK,CAOtD;AAED,wBAAgB,cAAc,CAAC,KAAK,GAAE,MAAW,GAAG,QAAQ,CAO3D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEndpoint = createEndpoint;
|
|
4
|
+
exports.createGroup = createGroup;
|
|
5
|
+
exports.createDocument = createDocument;
|
|
6
|
+
function createEndpoint(name, kind = "call") {
|
|
7
|
+
return {
|
|
8
|
+
name,
|
|
9
|
+
kind,
|
|
10
|
+
description: "",
|
|
11
|
+
params: [],
|
|
12
|
+
returns: [],
|
|
13
|
+
warnings: [],
|
|
14
|
+
examples: [],
|
|
15
|
+
internal: false,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function createGroup(header = "") {
|
|
19
|
+
return {
|
|
20
|
+
header,
|
|
21
|
+
description: "",
|
|
22
|
+
endpoints: [],
|
|
23
|
+
values: [],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createDocument(title = "") {
|
|
27
|
+
return {
|
|
28
|
+
title,
|
|
29
|
+
version: "",
|
|
30
|
+
confluenceId: "",
|
|
31
|
+
groups: [createGroup()],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;AAkEA,wCAWC;AAED,kCAOC;AAED,wCAOC;AA7BD,SAAgB,cAAc,CAAC,IAAY,EAAE,OAAyB,MAAM;IAC1E,OAAO;QACL,IAAI;QACJ,IAAI;QACJ,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;AACJ,CAAC;AAED,SAAgB,WAAW,CAAC,SAAiB,EAAE;IAC7C,OAAO;QACL,MAAM;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,EAAE;KACX,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc,CAAC,QAAgB,EAAE;IAC/C,OAAO;QACL,KAAK;QACL,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RawDocBlock {
|
|
2
|
+
lines: string[];
|
|
3
|
+
startLine: number;
|
|
4
|
+
filePath: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Extract documentation blocks from a source file.
|
|
8
|
+
* - JS/TS: Extracts /** ... * / blocks that contain @api tags
|
|
9
|
+
* - Python: Extracts consecutive # lines that contain @api tags
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractDocBlocks(filePath: string): RawDocBlock[];
|
|
12
|
+
//# sourceMappingURL=commentExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commentExtractor.d.ts","sourceRoot":"","sources":["../../src/parser/commentExtractor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAahE"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractDocBlocks = extractDocBlocks;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
/**
|
|
10
|
+
* Extract documentation blocks from a source file.
|
|
11
|
+
* - JS/TS: Extracts /** ... * / blocks that contain @api tags
|
|
12
|
+
* - Python: Extracts consecutive # lines that contain @api tags
|
|
13
|
+
*/
|
|
14
|
+
function extractDocBlocks(filePath) {
|
|
15
|
+
const content = fs_1.default.readFileSync(filePath, "utf-8");
|
|
16
|
+
const ext = path_1.default.extname(filePath).toLowerCase();
|
|
17
|
+
if ([".ts", ".tsx", ".js", ".jsx", ".h", ".cpp", ".hpp"].includes(ext)) {
|
|
18
|
+
return extractJSDocBlocks(content, filePath);
|
|
19
|
+
}
|
|
20
|
+
if (ext === ".py") {
|
|
21
|
+
return extractPythonDocBlocks(content, filePath);
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract /** ... * / blocks from JS/TS/C++ files.
|
|
27
|
+
* Only returns blocks that contain at least one @api tag.
|
|
28
|
+
*/
|
|
29
|
+
function extractJSDocBlocks(content, filePath) {
|
|
30
|
+
const blocks = [];
|
|
31
|
+
const lines = content.split("\n");
|
|
32
|
+
let inBlock = false;
|
|
33
|
+
let blockLines = [];
|
|
34
|
+
let blockStartLine = 0;
|
|
35
|
+
for (let i = 0; i < lines.length; i++) {
|
|
36
|
+
const line = lines[i];
|
|
37
|
+
const trimmed = line.trim();
|
|
38
|
+
if (!inBlock) {
|
|
39
|
+
// Check for /** start
|
|
40
|
+
if (trimmed.startsWith("/**")) {
|
|
41
|
+
inBlock = true;
|
|
42
|
+
blockStartLine = i + 1; // 1-indexed
|
|
43
|
+
blockLines = [];
|
|
44
|
+
// Handle single-line: /** @api Foo */
|
|
45
|
+
if (trimmed.endsWith("*/") && trimmed.length > 5) {
|
|
46
|
+
const inner = trimmed.slice(3, -2).trim();
|
|
47
|
+
blockLines.push(inner);
|
|
48
|
+
inBlock = false;
|
|
49
|
+
if (hasDocTag(blockLines)) {
|
|
50
|
+
blocks.push({ lines: blockLines, startLine: blockStartLine, filePath });
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// First line may have content after /**
|
|
55
|
+
const afterOpen = trimmed.slice(3).trim();
|
|
56
|
+
if (afterOpen) {
|
|
57
|
+
blockLines.push(afterOpen);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// Inside a block
|
|
63
|
+
if (trimmed.endsWith("*/")) {
|
|
64
|
+
// Last line — may have content before */
|
|
65
|
+
const beforeClose = trimmed.slice(0, -2).trim();
|
|
66
|
+
const cleaned = stripLeadingStar(beforeClose);
|
|
67
|
+
if (cleaned) {
|
|
68
|
+
blockLines.push(cleaned);
|
|
69
|
+
}
|
|
70
|
+
inBlock = false;
|
|
71
|
+
if (hasDocTag(blockLines)) {
|
|
72
|
+
blocks.push({ lines: blockLines, startLine: blockStartLine, filePath });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Middle line — strip leading " * "
|
|
77
|
+
blockLines.push(stripLeadingStar(trimmed));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return blocks;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Extract consecutive # comment blocks from Python files.
|
|
85
|
+
* Only returns blocks that contain at least one @api tag.
|
|
86
|
+
*/
|
|
87
|
+
function extractPythonDocBlocks(content, filePath) {
|
|
88
|
+
const blocks = [];
|
|
89
|
+
const lines = content.split("\n");
|
|
90
|
+
let blockLines = [];
|
|
91
|
+
let blockStartLine = 0;
|
|
92
|
+
for (let i = 0; i < lines.length; i++) {
|
|
93
|
+
const trimmed = lines[i].trim();
|
|
94
|
+
if (trimmed.startsWith("#")) {
|
|
95
|
+
if (blockLines.length === 0) {
|
|
96
|
+
blockStartLine = i + 1;
|
|
97
|
+
}
|
|
98
|
+
// Strip # prefix and trim
|
|
99
|
+
const commentContent = trimmed.replace(/^#+\s?/, "");
|
|
100
|
+
blockLines.push(commentContent);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// Non-comment line — flush block if it has @api
|
|
104
|
+
if (blockLines.length > 0) {
|
|
105
|
+
if (hasDocTag(blockLines)) {
|
|
106
|
+
blocks.push({ lines: blockLines, startLine: blockStartLine, filePath });
|
|
107
|
+
}
|
|
108
|
+
blockLines = [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Flush remaining
|
|
113
|
+
if (blockLines.length > 0 && hasDocTag(blockLines)) {
|
|
114
|
+
blocks.push({ lines: blockLines, startLine: blockStartLine, filePath });
|
|
115
|
+
}
|
|
116
|
+
return blocks;
|
|
117
|
+
}
|
|
118
|
+
function stripLeadingStar(line) {
|
|
119
|
+
// Remove leading "* " or "*"
|
|
120
|
+
if (line.startsWith("* "))
|
|
121
|
+
return line.slice(2);
|
|
122
|
+
if (line.startsWith("*"))
|
|
123
|
+
return line.slice(1);
|
|
124
|
+
return line;
|
|
125
|
+
}
|
|
126
|
+
function hasDocTag(lines) {
|
|
127
|
+
return lines.some((line) => {
|
|
128
|
+
const trimmed = line.trim();
|
|
129
|
+
return trimmed.startsWith("@api") || trimmed.startsWith("@group");
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=commentExtractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commentExtractor.js","sourceRoot":"","sources":["../../src/parser/commentExtractor.ts"],"names":[],"mappings":";;;;;AAcA,4CAaC;AA3BD,4CAAoB;AACpB,gDAAwB;AAQxB;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAEjD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvE,OAAO,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QAClB,OAAO,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,OAAe,EAAE,QAAgB;IAC3D,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,IAAI,OAAO,GAAG,KAAK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