Skip to content

Commit 295c1ce

Browse files
committed
tmp
Signed-off-by: flakey5 <[email protected]>
1 parent f51c583 commit 295c1ce

File tree

11 files changed

+1178
-8
lines changed

11 files changed

+1178
-8
lines changed

package-lock.json

Lines changed: 117 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@
3333
"prettier": "3.5.2"
3434
},
3535
"dependencies": {
36-
"acorn": "^8.14.0",
3736
"@actions/core": "^1.11.1",
37+
"acorn": "^8.14.0",
3838
"commander": "^13.1.0",
39-
"estree-util-visit": "^2.0.0",
4039
"dedent": "^1.5.3",
40+
"estree-util-visit": "^2.0.0",
4141
"github-slugger": "^2.0.0",
4242
"glob": "^11.0.1",
4343
"hast-util-to-string": "^3.0.1",
4444
"hastscript": "^9.0.1",
4545
"html-minifier-terser": "^7.2.0",
46+
"json-schema-to-typescript": "^15.0.4",
47+
"jsonc-parser": "^3.3.1",
4648
"rehype-stringify": "^10.0.1",
4749
"remark-gfm": "^4.0.1",
4850
"remark-parse": "^11.0.0",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "./schema.jsonc",
3+
"modules": [
4+
{
5+
"type": "module",
6+
"source": "doc/api/buffer.md",
7+
"@name": "Buffer",
8+
"@module": "node:buffer",
9+
"classes": [],
10+
"methods": [],
11+
"properties": [],
12+
"globals": []
13+
}
14+
]
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
4+
"title": "Node.js API Documentation Schema (All)",
5+
"readOnly": true,
6+
7+
"properties": {
8+
"modules": {
9+
"type": "array",
10+
// TODO figure out how to reference the other file here
11+
// "items": { "$ref": "http://json-schema.org/draft-07/schema#" }
12+
"items": { "$ref": "../json/parsed-schema.json" }
13+
}
14+
}
15+
}

src/generators/json/addons.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./parsed-schema.json",
3+
"source": "doc/api/addons.md"
4+
}

src/generators/json/buffer.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"$schema": "./parsed-schema.json",
3+
"source": "doc/api/buffer.md",
4+
"type": "module",
5+
"@name": "Buffer",
6+
"description": "`Buffer` objects are used to represent a fixed-length sequence of bytes. Many Node.js APIs support `Buffer`s.\nThe `Buffer` class is a subclass of JavaScript's {Uint8Array} class and extends it with methods that cover additional use cases. Node.js APIs accept plain {Uint8Array}s wherever `Buffer`s are supported as well.\n\nWhile the `Buffer` class is available within the global scope, it is still\nrecommended to explicitly reference it via an import or require statement.",
7+
"@see": "https://nodejs.org/api/buffer.html",
8+
"@module": "node:buffer",
9+
"@since": ["v24.0.0"],
10+
"classes": [
11+
{
12+
"type": "class",
13+
"@name": "SlowBuffer",
14+
"description": "bla bla bla"
15+
}
16+
],
17+
"methods": [
18+
{
19+
"type": "method",
20+
"@name": "isAscii",
21+
"signatures": [
22+
{
23+
"parameters": [],
24+
"@returns": "boolean"
25+
}
26+
]
27+
}
28+
],
29+
"properties": [
30+
{
31+
"type": "property",
32+
"@type": "number",
33+
"@name": "INSPECT_MAX_BYTES",
34+
"mutable": true
35+
}
36+
],
37+
"globals": [
38+
{
39+
"type": "class",
40+
"@name": "Buffer",
41+
"description": "The `Buffer` class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.",
42+
"staticMethods": [
43+
{
44+
"type": "method",
45+
"@name": "alloc",
46+
"description": "Allocates a new Buffer of size bytes. If fill is undefined, the Buffer will be zero-filled.\nIf `size` is larger than `buffer.constats.MAX_LENGTH` OR SMALLER THAN 0, `ERR_OUT_OF_RANGE` is thrown.\nIf `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.\nIf both fill and encoding are specified, the allocated Buffer will be initialized by calling buf.fill(fill, encoding).\nCalling Buffer.alloc() can be measurably slower than the alternative Buffer.allocUnsafe() but ensures that the newly created Buffer instance contents will never contain sensitive data from previous allocations, including data that might not have been allocated for Buffers.\nA TypeError will be thrown if size is not a number.",
47+
"@example": [
48+
"import { Buffer } from 'node:buffer'\n\nconst buf = Buffer.alloc(5);\n\nconsole.log(buf);\n// Prints: <Buffer 00 00 00 00 00>",
49+
"import { Buffer } from 'node:buffer;\n\nconst buf = Buffer.alloc(5, 'a');\n\nconsole.log(buf);\n// Prints: <Buffer 61 61 61 61 61>"
50+
],
51+
"changes": [
52+
{
53+
"version": ["v20.0.0"],
54+
"description": "blablabla",
55+
"prUrl": "asdf1234"
56+
},
57+
{
58+
"version": ["v15.0.0"],
59+
"description": "blablabla",
60+
"prUrl": "asdf1234"
61+
}
62+
],
63+
"signatures": [
64+
{
65+
"parameters": [
66+
{
67+
"@name": "size",
68+
"@type": "number"
69+
},
70+
{
71+
"@name": "fill",
72+
"@type": ["string", "Buffer", "Uint8Array", "number"],
73+
"@default": "0"
74+
},
75+
{
76+
"@name": "encoding",
77+
"@type": "string",
78+
"@default": "utf8"
79+
}
80+
],
81+
"@returns": "Buffer"
82+
}
83+
]
84+
}
85+
]
86+
},
87+
{
88+
"type": "method",
89+
"@name": "atob",
90+
"@example": "import { atob } from 'node:buffer';\n\natob('asdf');",
91+
"@since": ["v15.13.0", "v14.17.0"],
92+
"@deprecated": ["v24.0.0"],
93+
"description": "Global alias for {@link Buffer.atob}.",
94+
"stability": {
95+
"value": 3,
96+
"text": "Legacy. Use `Buffer.from(data, 'base64')` instead."
97+
},
98+
"signatures": [
99+
{
100+
"parameters": [
101+
{
102+
"@name": "data",
103+
"@type": "any",
104+
"description": "An ASCII (Latin1) string."
105+
}
106+
],
107+
"@returns": "string"
108+
}
109+
]
110+
}
111+
]
112+
}

0 commit comments

Comments
 (0)