pixotope-documentalist 1.2.4 → 1.2.6
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 +197 -179
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -3
- package/dist/config.js.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/parser/fileScanner.d.ts +10 -0
- package/dist/parser/fileScanner.d.ts.map +1 -1
- package/dist/parser/fileScanner.js +16 -0
- package/dist/parser/fileScanner.js.map +1 -1
- package/dist/parser/index.d.ts +2 -1
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +4 -1
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/interfaceParser.d.ts +20 -0
- package/dist/parser/interfaceParser.d.ts.map +1 -0
- package/dist/parser/interfaceParser.js +532 -0
- package/dist/parser/interfaceParser.js.map +1 -0
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +65 -9
- package/dist/pipeline.js.map +1 -1
- package/dist/publisher/confluenceApi.d.ts +7 -7
- package/dist/publisher/confluenceApi.d.ts.map +1 -1
- package/dist/publisher/confluenceApi.js +17 -25
- package/dist/publisher/confluenceApi.js.map +1 -1
- package/dist/renderer/components.d.ts.map +1 -1
- package/dist/renderer/components.js +40 -2
- package/dist/renderer/components.js.map +1 -1
- package/dist/renderer/confluenceHtml.d.ts +2 -1
- package/dist/renderer/confluenceHtml.d.ts.map +1 -1
- package/dist/renderer/confluenceHtml.js +7 -21
- package/dist/renderer/confluenceHtml.js.map +1 -1
- package/package.json +50 -44
package/README.md
CHANGED
|
@@ -1,179 +1,197 @@
|
|
|
1
|
-
# pixotope-documentalist
|
|
2
|
-
|
|
3
|
-
Parses JSDoc-style API documentation comments from source files (TypeScript, JavaScript, Python, Rust) 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
|
-
### Rust
|
|
67
|
-
|
|
68
|
-
Use `///` triple-slash doc comments (consecutive lines form one block):
|
|
69
|
-
|
|
70
|
-
```rust
|
|
71
|
-
/// @api DiscoverDevices
|
|
72
|
-
/// @group Network
|
|
73
|
-
/// @kind call
|
|
74
|
-
/// @description Discovers available devices on the local network.
|
|
75
|
-
/// @param {string} Subnet - The subnet to scan.
|
|
76
|
-
/// @param {integer} Timeout - Scan timeout in milliseconds.
|
|
77
|
-
/// @returns {boolean} Success - Whether the scan completed.
|
|
78
|
-
pub fn discover_devices(subnet: &str, timeout: u64) {
|
|
79
|
-
// ...
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Tag Reference
|
|
84
|
-
|
|
85
|
-
| Tag | Required | Description |
|
|
86
|
-
|-----|----------|-------------|
|
|
87
|
-
| `@api` | Yes | Endpoint name (displayed as title) |
|
|
88
|
-
| `@group` | No | Section grouping header |
|
|
89
|
-
| `@kind` | No | `call` (default), `get`, `set`, `state` (supports both Get and Set) |
|
|
90
|
-
| `@description` | No | Multi-line description (continues until next tag) |
|
|
91
|
-
| `@param` | No | `{type} Name - Description`. `[Name]` = optional, `[Name=default]` = with default |
|
|
92
|
-
| `@returns` | No | `{type} Name - Description` |
|
|
93
|
-
| `@example` | No | Title on first line, `>>>` for request messages, `<<<` for response messages |
|
|
94
|
-
| `@warning` | No | Warning/note text |
|
|
95
|
-
| `@since` | No | Version when this was introduced |
|
|
96
|
-
| `@deprecated` | No | Deprecation notice |
|
|
97
|
-
| `@internal` | No | Flag to exclude from published docs |
|
|
98
|
-
| `@value` | No | For state docs: `{type} Name - Description` |
|
|
99
|
-
|
|
100
|
-
## Configuration
|
|
101
|
-
|
|
102
|
-
Create a `config.yml` in your project:
|
|
103
|
-
|
|
104
|
-
```yaml
|
|
105
|
-
confluence:
|
|
106
|
-
base_url: "https://your-domain.atlassian.net/wiki/rest/api/content"
|
|
107
|
-
|
|
108
|
-
source_root: "."
|
|
109
|
-
|
|
110
|
-
documents:
|
|
111
|
-
- id: daemon_calls
|
|
112
|
-
title: "Daemon API - Calls"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- `
|
|
131
|
-
- `
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# Parse
|
|
140
|
-
npx pixotope-documentalist
|
|
141
|
-
|
|
142
|
-
# Parse + render
|
|
143
|
-
npx pixotope-documentalist
|
|
144
|
-
|
|
145
|
-
#
|
|
146
|
-
npx pixotope-documentalist
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
|
|
163
|
-
| `
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
1
|
+
# pixotope-documentalist
|
|
2
|
+
|
|
3
|
+
Parses JSDoc-style API documentation comments from source files (TypeScript, JavaScript, Python, Rust) 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
|
+
### Rust
|
|
67
|
+
|
|
68
|
+
Use `///` triple-slash doc comments (consecutive lines form one block):
|
|
69
|
+
|
|
70
|
+
```rust
|
|
71
|
+
/// @api DiscoverDevices
|
|
72
|
+
/// @group Network
|
|
73
|
+
/// @kind call
|
|
74
|
+
/// @description Discovers available devices on the local network.
|
|
75
|
+
/// @param {string} Subnet - The subnet to scan.
|
|
76
|
+
/// @param {integer} Timeout - Scan timeout in milliseconds.
|
|
77
|
+
/// @returns {boolean} Success - Whether the scan completed.
|
|
78
|
+
pub fn discover_devices(subnet: &str, timeout: u64) {
|
|
79
|
+
// ...
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Tag Reference
|
|
84
|
+
|
|
85
|
+
| Tag | Required | Description |
|
|
86
|
+
|-----|----------|-------------|
|
|
87
|
+
| `@api` | Yes | Endpoint name (displayed as title) |
|
|
88
|
+
| `@group` | No | Section grouping header |
|
|
89
|
+
| `@kind` | No | `call` (default), `get`, `set`, `state` (supports both Get and Set) |
|
|
90
|
+
| `@description` | No | Multi-line description (continues until next tag) |
|
|
91
|
+
| `@param` | No | `{type} Name - Description`. `[Name]` = optional, `[Name=default]` = with default |
|
|
92
|
+
| `@returns` | No | `{type} Name - Description` |
|
|
93
|
+
| `@example` | No | Title on first line, `>>>` for request messages, `<<<` for response messages |
|
|
94
|
+
| `@warning` | No | Warning/note text |
|
|
95
|
+
| `@since` | No | Version when this was introduced |
|
|
96
|
+
| `@deprecated` | No | Deprecation notice |
|
|
97
|
+
| `@internal` | No | Flag to exclude from published docs |
|
|
98
|
+
| `@value` | No | For state docs: `{type} Name - Description` |
|
|
99
|
+
|
|
100
|
+
## Configuration
|
|
101
|
+
|
|
102
|
+
Create a `config.yml` in your project:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
confluence:
|
|
106
|
+
base_url: "https://your-domain.atlassian.net/wiki/rest/api/content"
|
|
107
|
+
|
|
108
|
+
source_root: "."
|
|
109
|
+
|
|
110
|
+
documents:
|
|
111
|
+
- id: daemon_calls
|
|
112
|
+
title: "Daemon API - Calls"
|
|
113
|
+
description: "Covers all call-type RPC endpoints." # optional — plain string or path to a .md file
|
|
114
|
+
confluence_id:
|
|
115
|
+
master: "1234567890"
|
|
116
|
+
release: "0987654321"
|
|
117
|
+
sources:
|
|
118
|
+
- path: "packages/Daemon/src/endpoints/calls.ts" # single file
|
|
119
|
+
|
|
120
|
+
- id: daemon_all
|
|
121
|
+
title: "Daemon API - All"
|
|
122
|
+
description: "docs/daemon_overview.md" # optional — reads and renders the .md file
|
|
123
|
+
confluence_id:
|
|
124
|
+
master: "3333333333"
|
|
125
|
+
release: "4444444444"
|
|
126
|
+
sources:
|
|
127
|
+
- path: "packages/Daemon/src/endpoints/" # entire folder (recursive)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- `source_root`: base path for resolving relative source paths (relative to config file location)
|
|
131
|
+
- `confluence_id.master`: page ID for master/development docs
|
|
132
|
+
- `confluence_id.release`: page ID for release docs
|
|
133
|
+
- `description` *(optional)*: text rendered at the top of the Confluence page body, beneath the page title. Accepts either a plain string or a path to a `.md` file (resolved relative to the config file). Markdown is rendered to HTML.
|
|
134
|
+
- `sources[].path`: can point to a **single file** or a **folder**. When a folder is given, all supported files inside are scanned recursively. `node_modules` and hidden directories are skipped. Supported extensions: `.ts`, `.tsx`, `.js`, `.jsx`, `.py`, `.rs`, `.h`, `.cpp`, `.hpp`.
|
|
135
|
+
|
|
136
|
+
## CLI Commands
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Parse source files and output JSON (for debugging)
|
|
140
|
+
npx pixotope-documentalist parse -c ./config.yml --verbose
|
|
141
|
+
|
|
142
|
+
# Parse + render to HTML files locally (no API calls)
|
|
143
|
+
npx pixotope-documentalist preview -c ./config.yml
|
|
144
|
+
|
|
145
|
+
# Parse + render + upload to Confluence (skips if content unchanged)
|
|
146
|
+
npx pixotope-documentalist publish -c ./config.yml -t master
|
|
147
|
+
|
|
148
|
+
# Parse + render + force-upload to Confluence (always writes, skips diff check)
|
|
149
|
+
npx pixotope-documentalist update -c ./config.yml -t release
|
|
150
|
+
|
|
151
|
+
# Show what would change without publishing
|
|
152
|
+
npx pixotope-documentalist diff -c ./config.yml -t master
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Commands
|
|
156
|
+
|
|
157
|
+
| Command | Description |
|
|
158
|
+
|---------|-------------|
|
|
159
|
+
| `parse` | Parse sources → JSON (debug output in `output/collected/`) |
|
|
160
|
+
| `preview` | Parse + render → HTML files (in `output/formatted/`) |
|
|
161
|
+
| `publish` | Parse + render + upload to Confluence. Skips if content is unchanged. |
|
|
162
|
+
| `update` | Parse + render + force-upload to Confluence. Always writes, no diff check. |
|
|
163
|
+
| `diff` | Show what would change without publishing |
|
|
164
|
+
|
|
165
|
+
### Options
|
|
166
|
+
|
|
167
|
+
All options support both short (`-c`) and long (`--config`) forms.
|
|
168
|
+
|
|
169
|
+
| Option | Description | Default |
|
|
170
|
+
|--------|-------------|---------|
|
|
171
|
+
| `-c, --config <path>` | Path to config.yml | `config.yml` |
|
|
172
|
+
| `-d, --document <id>` | Process only this document | all documents |
|
|
173
|
+
| `-t, --target <env>` | `master` or `release` | `master` |
|
|
174
|
+
| `--version-stamp <ver>` | Version stamp | `local` |
|
|
175
|
+
| `-v, --verbose` | Verbose logging | off |
|
|
176
|
+
|
|
177
|
+
## Environment Variables
|
|
178
|
+
|
|
179
|
+
| Variable | Purpose |
|
|
180
|
+
|----------|---------|
|
|
181
|
+
| `CONFLUENCE_USER` | Confluence account email |
|
|
182
|
+
| `CONFLUENCE_TOKEN` | Confluence API token ([generate here](https://id.atlassian.com/manage-profile/security/api-tokens)) |
|
|
183
|
+
|
|
184
|
+
Create a `.env` file (git-ignored) for local use:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
CONFLUENCE_USER=your.email@pixotope.com
|
|
188
|
+
CONFLUENCE_TOKEN=your_api_token
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Supported File Types
|
|
192
|
+
|
|
193
|
+
- `.ts`, `.tsx` (TypeScript)
|
|
194
|
+
- `.js`, `.jsx` (JavaScript)
|
|
195
|
+
- `.py` (Python)
|
|
196
|
+
- `.rs` (Rust)
|
|
197
|
+
- `.h`, `.cpp`, `.hpp` (C++)
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,CAiErD;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR"}
|
package/dist/config.js
CHANGED
|
@@ -36,16 +36,37 @@ function loadConfig(configPath) {
|
|
|
36
36
|
if (!doc.sources || !Array.isArray(doc.sources)) {
|
|
37
37
|
throw new Error(`Document "${doc.id}" missing required field: sources (array)`);
|
|
38
38
|
}
|
|
39
|
+
let description;
|
|
40
|
+
if (doc.description) {
|
|
41
|
+
const rawDesc = String(doc.description);
|
|
42
|
+
if (rawDesc.endsWith(".md")) {
|
|
43
|
+
const mdPath = path_1.default.resolve(path_1.default.dirname(absolutePath), rawDesc);
|
|
44
|
+
if (fs_1.default.existsSync(mdPath)) {
|
|
45
|
+
description = fs_1.default.readFileSync(mdPath, "utf-8");
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
description = rawDesc;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
description = rawDesc;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
39
55
|
return {
|
|
40
56
|
id: doc.id,
|
|
41
57
|
title: doc.title,
|
|
58
|
+
description,
|
|
42
59
|
confluenceId: {
|
|
43
60
|
master: String(doc.confluence_id.master || ""),
|
|
44
61
|
release: String(doc.confluence_id.release || ""),
|
|
45
62
|
},
|
|
46
|
-
sources: doc.sources.map((s) =>
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
sources: doc.sources.map((s) => {
|
|
64
|
+
const srcPath = typeof s === "string" ? s : s.path;
|
|
65
|
+
const srcMode = typeof s === "object" && s.mode === "interfaces" ? "interfaces"
|
|
66
|
+
: typeof s === "object" && s.mode === "comments" ? "comments"
|
|
67
|
+
: undefined;
|
|
68
|
+
return { path: srcPath, mode: srcMode };
|
|
69
|
+
}),
|
|
49
70
|
};
|
|
50
71
|
}),
|
|
51
72
|
};
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"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AC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBACnD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,YAAqB;wBACtF,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,UAAmB;4BACtE,CAAC,CAAC,SAAS,CAAC;oBACd,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gBAC1C,CAAC,CAAC;aACH,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,iBAAiB,CAC/B,UAAkB,EAClB,UAAkB,EAClB,SAAiB;IAEjB,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACzD,OAAO,cAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,18 @@ program
|
|
|
60
60
|
const options = makeOptions(cmd);
|
|
61
61
|
await (0, pipeline_1.runPublish)(options);
|
|
62
62
|
});
|
|
63
|
+
program
|
|
64
|
+
.command("update")
|
|
65
|
+
.description("Parse + render + force-upload to Confluence (skips diff check)")
|
|
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("--version-stamp <ver>", "Version stamp", "local")
|
|
70
|
+
.option("-v, --verbose", "Verbose logging")
|
|
71
|
+
.action(async (cmd) => {
|
|
72
|
+
const options = makeOptions(cmd);
|
|
73
|
+
await (0, pipeline_1.runUpdate)(options);
|
|
74
|
+
});
|
|
63
75
|
program
|
|
64
76
|
.command("diff")
|
|
65
77
|
.description("Show what would change without publishing")
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,gDAAwB;AACxB,oDAA4B;AAC5B,qCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,gDAAwB;AACxB,oDAA4B;AAC5B,qCAAsC;AACtC,yCAAmG;AAEnG,0BAA0B;AAC1B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,wBAAwB,CAAC;KAC9B,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,SAAS,WAAW,CAAC,GAAQ;IAC3B,MAAM,UAAU,GAAG,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE3C,OAAO;QACL,MAAM,EAAE,IAAA,mBAAU,EAAC,UAAU,CAAC;QAC9B,SAAS;QACT,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,QAAQ;QAC9B,OAAO,EAAE,GAAG,CAAC,YAAY,IAAI,OAAO;QACpC,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,KAAK;KAC9B,CAAC;AACJ,CAAC;AAED,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,iDAAiD,CAAC;KAC9D,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,YAAY,CAAC;KACjE,MAA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AAC;KAC7E,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,YAAY,CAAC;KACjE,MAAM,CAAC,qBAAqB,EAAE,4BAA4B,CAAC;KAC3D,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,CAAC;KAC3D,MAAM,CAAC,uBAAuB,EAAE,eAAe,EAAE,OAAO,CAAC;KACzD,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;KAC1C,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAA,oBAAS,EAAC,OAAO,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,YAAY,CAAC;KACjE,MAAM,CAAC,qBAAqB,EAAE,4BAA4B,CAAC;KAC3D,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,CAAC;KAC3D,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;KAC1C,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAA,kBAAO,EAAC,OAAO,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -40,15 +40,18 @@ export interface Document {
|
|
|
40
40
|
confluenceId: string;
|
|
41
41
|
groups: Group[];
|
|
42
42
|
}
|
|
43
|
+
export type SourceMode = "comments" | "interfaces";
|
|
43
44
|
export interface DocumentConfig {
|
|
44
45
|
id: string;
|
|
45
46
|
title: string;
|
|
47
|
+
description?: string;
|
|
46
48
|
confluenceId: {
|
|
47
49
|
master: string;
|
|
48
50
|
release: string;
|
|
49
51
|
};
|
|
50
52
|
sources: {
|
|
51
53
|
path: string;
|
|
54
|
+
mode?: SourceMode;
|
|
52
55
|
}[];
|
|
53
56
|
}
|
|
54
57
|
export interface Config {
|
|
@@ -1 +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,GAAG,OAAO,CAAC;IACvC,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,C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"}
|
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;AAqEA,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"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
export declare function scanPath(filePath: string): string[];
|
|
2
|
+
/**
|
|
3
|
+
* Detect whether a file should be parsed as TypeScript interfaces or as
|
|
4
|
+
* JSDoc-style comment blocks.
|
|
5
|
+
*
|
|
6
|
+
* A file is treated as "interfaces" mode when it contains a `@kind interface`
|
|
7
|
+
* directive in any comment style (///, //, #, *).
|
|
8
|
+
*
|
|
9
|
+
* Otherwise the file is treated as "comments" mode (the default).
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectFileMode(filePath: string): "comments" | "interfaces";
|
|
2
12
|
//# sourceMappingURL=fileScanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileScanner.d.ts","sourceRoot":"","sources":["../../src/parser/fileScanner.ts"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBnD"}
|
|
1
|
+
{"version":3,"file":"fileScanner.d.ts","sourceRoot":"","sources":["../../src/parser/fileScanner.ts"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBnD;AA+CD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAI1E"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.scanPath = scanPath;
|
|
7
|
+
exports.detectFileMode = detectFileMode;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const SUPPORTED_EXTENSIONS = new Set([
|
|
@@ -71,4 +72,19 @@ function scanDirectory(dirPath) {
|
|
|
71
72
|
function isSupportedFile(filePath) {
|
|
72
73
|
return SUPPORTED_EXTENSIONS.has(path_1.default.extname(filePath).toLowerCase());
|
|
73
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Detect whether a file should be parsed as TypeScript interfaces or as
|
|
77
|
+
* JSDoc-style comment blocks.
|
|
78
|
+
*
|
|
79
|
+
* A file is treated as "interfaces" mode when it contains a `@kind interface`
|
|
80
|
+
* directive in any comment style (///, //, #, *).
|
|
81
|
+
*
|
|
82
|
+
* Otherwise the file is treated as "comments" mode (the default).
|
|
83
|
+
*/
|
|
84
|
+
function detectFileMode(filePath) {
|
|
85
|
+
const content = fs_1.default.readFileSync(filePath, "utf-8");
|
|
86
|
+
if (/(?:\/\/\/?|#|\*)\s*@kind\s+interface\b/m.test(content))
|
|
87
|
+
return "interfaces";
|
|
88
|
+
return "comments";
|
|
89
|
+
}
|
|
74
90
|
//# sourceMappingURL=fileScanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileScanner.js","sourceRoot":"","sources":["../../src/parser/fileScanner.ts"],"names":[],"mappings":";;;;;AAeA,4BAkBC;
|
|
1
|
+
{"version":3,"file":"fileScanner.js","sourceRoot":"","sources":["../../src/parser/fileScanner.ts"],"names":[],"mappings":";;;;;AAeA,4BAkBC;AAwDD,wCAIC;AA7FD,4CAAoB;AACpB,gDAAwB;AAExB,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH,SAAgB,QAAQ,CAAC,QAAgB;IACvC,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAExC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrD,CAAC;IAED,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,IAAI,GAAG,cAAI,CAAC,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AAC,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO,oBAAoB,CAAC,GAAG,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACxE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC7C,MAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,IAAI,yCAAyC,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,YAAY,CAAC;IACjF,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { scanPath } from "./fileScanner";
|
|
1
|
+
export { scanPath, detectFileMode } from "./fileScanner";
|
|
2
2
|
export { extractDocBlocks, RawDocBlock } from "./commentExtractor";
|
|
3
3
|
export { blocksToDocument } from "./tagParser";
|
|
4
|
+
export { parseInterfacesFromFile } from "./interfaceParser";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/parser/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.blocksToDocument = exports.extractDocBlocks = exports.scanPath = void 0;
|
|
3
|
+
exports.parseInterfacesFromFile = exports.blocksToDocument = exports.extractDocBlocks = exports.detectFileMode = exports.scanPath = void 0;
|
|
4
4
|
var fileScanner_1 = require("./fileScanner");
|
|
5
5
|
Object.defineProperty(exports, "scanPath", { enumerable: true, get: function () { return fileScanner_1.scanPath; } });
|
|
6
|
+
Object.defineProperty(exports, "detectFileMode", { enumerable: true, get: function () { return fileScanner_1.detectFileMode; } });
|
|
6
7
|
var commentExtractor_1 = require("./commentExtractor");
|
|
7
8
|
Object.defineProperty(exports, "extractDocBlocks", { enumerable: true, get: function () { return commentExtractor_1.extractDocBlocks; } });
|
|
8
9
|
var tagParser_1 = require("./tagParser");
|
|
9
10
|
Object.defineProperty(exports, "blocksToDocument", { enumerable: true, get: function () { return tagParser_1.blocksToDocument; } });
|
|
11
|
+
var interfaceParser_1 = require("./interfaceParser");
|
|
12
|
+
Object.defineProperty(exports, "parseInterfacesFromFile", { enumerable: true, get: function () { return interfaceParser_1.parseInterfacesFromFile; } });
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
package/dist/parser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/parser/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAAhD,uGAAA,QAAQ,OAAA;AAAE,6GAAA,cAAc,OAAA;AACjC,uDAAmE;AAA1D,oHAAA,gBAAgB,OAAA;AACzB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Group } from "../models";
|
|
2
|
+
/**
|
|
3
|
+
* Parse TypeScript interfaces and types from a file, using the TS compiler API.
|
|
4
|
+
*
|
|
5
|
+
* Auto mode (default when no @ScrapeJS annotations are present):
|
|
6
|
+
* All interfaces are indexed. Types referenced by other types are treated as
|
|
7
|
+
* helpers; unreferenced interfaces become root value trees automatically.
|
|
8
|
+
* Auto-SkipType: if a root interface wraps a single child with the same name,
|
|
9
|
+
* that child is promoted as the tree root.
|
|
10
|
+
*
|
|
11
|
+
* Legacy mode (activated when any @ScrapeJS annotation is detected):
|
|
12
|
+
* /// @ScrapeJS: DefineValueType -- register interface/type in the type registry
|
|
13
|
+
* /// @ScrapeJS: ValueTree [SkipType] -- root value tree for documentation output
|
|
14
|
+
* /// @DefineValueTypeMapping: Name - baseType -- map a type alias to a display type
|
|
15
|
+
*
|
|
16
|
+
* Both modes support:
|
|
17
|
+
* /// @Group: GroupName -- set the output group
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseInterfacesFromFile(filePath: string): Group[];
|
|
20
|
+
//# sourceMappingURL=interfaceParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaceParser.d.ts","sourceRoot":"","sources":["../../src/parser/interfaceParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,EAAe,MAAM,WAAW,CAAC;AAWtD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAE,CA2GjE"}
|