@forge-ts/core 0.2.0 → 0.2.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 +45 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @forge-ts/core
|
|
2
|
+
|
|
3
|
+
Shared types, configuration loader, and AST walker for the [forge-ts](https://github.com/kryptobaseddev/forge-ts) toolchain.
|
|
4
|
+
|
|
5
|
+
## When to use this package
|
|
6
|
+
|
|
7
|
+
**Most users should install `@forge-ts/cli` instead.** This package is for advanced users building custom tooling on top of forge-ts.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @forge-ts/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What's inside
|
|
14
|
+
|
|
15
|
+
- **`ForgeSymbol`** - The central type representing an extracted TypeScript symbol with its TSDoc documentation
|
|
16
|
+
- **`ForgeConfig`** - Configuration contract for all forge-ts operations
|
|
17
|
+
- **`createWalker(config)`** - AST walker using the TypeScript Compiler API + `@microsoft/tsdoc`
|
|
18
|
+
- **`loadConfig(rootDir?)`** - Zero-config loader (reads `forge-ts.config.ts` or `package.json`)
|
|
19
|
+
- **`filterByVisibility(symbols, minVisibility)`** - Filter by `@public`, `@beta`, `@internal` tags
|
|
20
|
+
- **OpenAPI 3.1 types** - `OpenAPIDocument`, `OpenAPISchemaObject`, etc.
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { loadConfig, createWalker, filterByVisibility, Visibility } from "@forge-ts/core";
|
|
26
|
+
|
|
27
|
+
const config = await loadConfig();
|
|
28
|
+
const walker = createWalker(config);
|
|
29
|
+
const symbols = walker.walk();
|
|
30
|
+
|
|
31
|
+
// Only public symbols
|
|
32
|
+
const publicApi = filterByVisibility(symbols, Visibility.Public);
|
|
33
|
+
|
|
34
|
+
for (const symbol of publicApi) {
|
|
35
|
+
console.log(`${symbol.kind} ${symbol.name}: ${symbol.documentation?.summary}`);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Part of forge-ts
|
|
40
|
+
|
|
41
|
+
This is one package in the [forge-ts](https://github.com/kryptobaseddev/forge-ts) monorepo. See the main repo for full documentation.
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge-ts/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared types, interfaces, and core AST walker for forge-ts",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/kryptobaseddev/forge-ts"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"tsup": "^8.3.5",
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
32
|
+
"@forge-ts/enforcer": "0.2.1",
|
|
33
|
+
"@forge-ts/gen": "0.2.1",
|
|
34
|
+
"@forge-ts/api": "0.2.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup",
|