ts-graphviz 1.6.1-dev.9b20eb739 → 1.6.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/lib/ast/index.cjs +2 -2
- package/lib/ast/index.d.ts +18 -13
- package/lib/ast/index.js +2 -2
- package/lib/common/index.d.ts +1 -1
- package/package.json +120 -120
package/lib/ast/index.cjs
CHANGED
|
@@ -11,11 +11,11 @@ class Builder {
|
|
|
11
11
|
constructor(options) {
|
|
12
12
|
this.options = options;
|
|
13
13
|
}
|
|
14
|
-
createElement(type, props, children) {
|
|
14
|
+
createElement(type, props, children = []) {
|
|
15
15
|
return {
|
|
16
|
+
location: this.getLocation(),
|
|
16
17
|
...props,
|
|
17
18
|
type,
|
|
18
|
-
location: this.getLocation(),
|
|
19
19
|
children,
|
|
20
20
|
};
|
|
21
21
|
}
|
package/lib/ast/index.d.ts
CHANGED
|
@@ -351,7 +351,7 @@ interface CreateElement {
|
|
|
351
351
|
<T extends string>(
|
|
352
352
|
type: 'Literal',
|
|
353
353
|
props: LiteralASTPropaties<T>,
|
|
354
|
-
children
|
|
354
|
+
children?: ASTChildNode<LiteralASTNode>[],
|
|
355
355
|
): LiteralASTNode<T>;
|
|
356
356
|
/**
|
|
357
357
|
* Creates a LiteralASTNode with the given type, properties, and children.
|
|
@@ -361,7 +361,7 @@ interface CreateElement {
|
|
|
361
361
|
* @param children The children of the AST node.
|
|
362
362
|
* @returns A {@link LiteralASTNode} with the given type, properties, and children.
|
|
363
363
|
*/
|
|
364
|
-
(type: 'Literal', props: LiteralASTPropaties, children
|
|
364
|
+
(type: 'Literal', props: LiteralASTPropaties, children?: ASTChildNode<LiteralASTNode>[]): LiteralASTNode;
|
|
365
365
|
/**
|
|
366
366
|
* Creates a {@link DotASTNode} with the given type, properties, and children.
|
|
367
367
|
*
|
|
@@ -370,7 +370,7 @@ interface CreateElement {
|
|
|
370
370
|
* @param children The children of the AST node.
|
|
371
371
|
* @returns A {@link DotASTNode} with the given type, properties, and children.
|
|
372
372
|
*/
|
|
373
|
-
(type: 'Dot', props: DotASTPropaties, children
|
|
373
|
+
(type: 'Dot', props: DotASTPropaties, children?: ASTChildNode<DotASTNode>[]): DotASTNode;
|
|
374
374
|
/**
|
|
375
375
|
* Creates a {@link GraphASTNode} with the given type, properties, and children.
|
|
376
376
|
*
|
|
@@ -379,7 +379,7 @@ interface CreateElement {
|
|
|
379
379
|
* @param children The children of the AST node.
|
|
380
380
|
* @returns A {GraphASTNode} with the given type, properties, and children.
|
|
381
381
|
*/
|
|
382
|
-
(type: 'Graph', props: GraphASTPropaties, children
|
|
382
|
+
(type: 'Graph', props: GraphASTPropaties, children?: ASTChildNode<GraphASTNode>[]): GraphASTNode;
|
|
383
383
|
/**
|
|
384
384
|
* Creates an {@link AttributeASTNode} with the given type, properties, and children.
|
|
385
385
|
*
|
|
@@ -388,7 +388,12 @@ interface CreateElement {
|
|
|
388
388
|
* @param children The children of the AST node.
|
|
389
389
|
* @returns An {@link AttributeASTNode} with the given type, properties, and children.
|
|
390
390
|
*/
|
|
391
|
-
|
|
391
|
+
<T extends AttributeKey>(
|
|
392
|
+
type: 'Attribute',
|
|
393
|
+
props: AttributeASTPropaties<T>,
|
|
394
|
+
children?: ASTChildNode<AttributeASTNode>[],
|
|
395
|
+
): AttributeASTNode<T>;
|
|
396
|
+
(type: 'Attribute', props: AttributeASTPropaties, children?: ASTChildNode<AttributeASTNode>[]): AttributeASTNode;
|
|
392
397
|
/**
|
|
393
398
|
* Creates a {@link CommentASTNode} with the given type, properties, and children.
|
|
394
399
|
*
|
|
@@ -397,7 +402,7 @@ interface CreateElement {
|
|
|
397
402
|
* @param children The children of the AST node.
|
|
398
403
|
* @returns A {@link CommentASTNode} with the given type, properties, and children.
|
|
399
404
|
*/
|
|
400
|
-
(type: 'Comment', props: CommentASTPropaties, children
|
|
405
|
+
(type: 'Comment', props: CommentASTPropaties, children?: ASTChildNode<CommentASTNode>[]): CommentASTNode;
|
|
401
406
|
/**
|
|
402
407
|
* Creates an {@link AttributeListASTNode} with the given type, properties, and children.
|
|
403
408
|
*
|
|
@@ -409,7 +414,7 @@ interface CreateElement {
|
|
|
409
414
|
(
|
|
410
415
|
type: 'AttributeList',
|
|
411
416
|
props: AttributeListASTPropaties,
|
|
412
|
-
children
|
|
417
|
+
children?: ASTChildNode<AttributeListASTNode>[],
|
|
413
418
|
): AttributeListASTNode;
|
|
414
419
|
/**
|
|
415
420
|
* Creates a {@link NodeRefASTNode} with the given type, properties, and children.
|
|
@@ -419,7 +424,7 @@ interface CreateElement {
|
|
|
419
424
|
* @param children The children of the AST node.
|
|
420
425
|
* @returns A {@link NodeRefASTNode} with the given type, properties, and children.
|
|
421
426
|
*/
|
|
422
|
-
(type: 'NodeRef', props: NodeRefASTPropaties, children
|
|
427
|
+
(type: 'NodeRef', props: NodeRefASTPropaties, children?: ASTChildNode<NodeRefASTNode>[]): NodeRefASTNode;
|
|
423
428
|
/**
|
|
424
429
|
* Creates a {@link NodeRefGroupASTNode} with the given type, properties, and children.
|
|
425
430
|
*
|
|
@@ -431,7 +436,7 @@ interface CreateElement {
|
|
|
431
436
|
(
|
|
432
437
|
type: 'NodeRefGroup',
|
|
433
438
|
props: NodeRefGroupASTPropaties,
|
|
434
|
-
children
|
|
439
|
+
children?: ASTChildNode<NodeRefGroupASTNode>[],
|
|
435
440
|
): NodeRefGroupASTNode;
|
|
436
441
|
/**
|
|
437
442
|
* Creates an {@link EdgeASTNode} with the given type, properties, and children.
|
|
@@ -441,7 +446,7 @@ interface CreateElement {
|
|
|
441
446
|
* @param children The children of the AST node.
|
|
442
447
|
* @returns An {@link EdgeASTNode} with the given type, properties, and children.
|
|
443
448
|
*/
|
|
444
|
-
(type: 'Edge', props: EdgeASTPropaties, children
|
|
449
|
+
(type: 'Edge', props: EdgeASTPropaties, children?: ASTChildNode<EdgeASTNode>[]): EdgeASTNode;
|
|
445
450
|
/**
|
|
446
451
|
* Creates a {@link NodeASTNode} with the given type, properties, and children.
|
|
447
452
|
*
|
|
@@ -450,7 +455,7 @@ interface CreateElement {
|
|
|
450
455
|
* @param children The children of the AST node.
|
|
451
456
|
* @returns A {@link NodeASTNode} with the given type, properties, and children.
|
|
452
457
|
*/
|
|
453
|
-
(type: 'Node', props: NodeASTPropaties, children
|
|
458
|
+
(type: 'Node', props: NodeASTPropaties, children?: ASTChildNode<NodeASTNode>[]): NodeASTNode;
|
|
454
459
|
/**
|
|
455
460
|
* Creates a {@link SubgraphASTNode} with the given type, properties, and children.
|
|
456
461
|
*
|
|
@@ -459,7 +464,7 @@ interface CreateElement {
|
|
|
459
464
|
* @param children The children of the AST node.
|
|
460
465
|
* @returns A {@link SubgraphASTNode} with the given type, properties, and children.
|
|
461
466
|
*/
|
|
462
|
-
(type: 'Subgraph', props: SubgraphASTPropaties, children
|
|
467
|
+
(type: 'Subgraph', props: SubgraphASTPropaties, children?: ASTChildNode<SubgraphASTNode>[]): SubgraphASTNode;
|
|
463
468
|
}
|
|
464
469
|
/**
|
|
465
470
|
* This interface provides an ASTBuilder object with a createElement function.
|
|
@@ -495,7 +500,7 @@ declare class Builder implements ASTBuilder {
|
|
|
495
500
|
* @param children - Children of the {@link ASTNode}
|
|
496
501
|
* @returns An {@link ASTNode}
|
|
497
502
|
*/
|
|
498
|
-
createElement<T extends ASTNode>(type: T['type'], props: any, children
|
|
503
|
+
createElement<T extends ASTNode>(type: T['type'], props: any, children?: ASTChildNode<T>[]): T;
|
|
499
504
|
}
|
|
500
505
|
|
|
501
506
|
/**
|
package/lib/ast/index.js
CHANGED
|
@@ -9,11 +9,11 @@ class Builder {
|
|
|
9
9
|
constructor(options) {
|
|
10
10
|
this.options = options;
|
|
11
11
|
}
|
|
12
|
-
createElement(type, props, children) {
|
|
12
|
+
createElement(type, props, children = []) {
|
|
13
13
|
return {
|
|
14
|
+
location: this.getLocation(),
|
|
14
15
|
...props,
|
|
15
16
|
type,
|
|
16
|
-
location: this.getLocation(),
|
|
17
17
|
children,
|
|
18
18
|
};
|
|
19
19
|
}
|
package/lib/common/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ type Shape = string;
|
|
|
68
68
|
* @see {@link https://graphviz.gitlab.io/docs/attr-types/smoothType/ smoothType}
|
|
69
69
|
* @group Attribute Types
|
|
70
70
|
*/
|
|
71
|
-
type SmoothType = SmoothType
|
|
71
|
+
type SmoothType = SmoothType.values;
|
|
72
72
|
/** @hidden */
|
|
73
73
|
declare namespace SmoothType {
|
|
74
74
|
type values = keyof $values;
|
package/package.json
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"name": "ts-graphviz",
|
|
3
|
+
"version": "1.6.1",
|
|
4
|
+
"author": "kamiazya <yuki@kamiazya.tech>",
|
|
5
|
+
"description": "Graphviz library for TypeScript.",
|
|
6
|
+
"homepage": "https://ts-graphviz.github.io/ts-graphviz/",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/ts-graphviz/ts-graphviz.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"graphviz",
|
|
14
|
+
"dot"
|
|
15
|
+
],
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/ts-graphviz/ts-graphviz/issues"
|
|
18
|
+
},
|
|
19
|
+
"funding": {
|
|
20
|
+
"type": "github",
|
|
21
|
+
"url": "https://github.com/sponsors/ts-graphviz"
|
|
22
|
+
},
|
|
23
|
+
"main": "./lib/index.cjs",
|
|
24
|
+
"module": "./lib/index.js",
|
|
25
|
+
"types": "lib/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./lib/index.d.ts",
|
|
30
|
+
"default": "./lib/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./lib/index.d.ts",
|
|
34
|
+
"default": "./lib/index.js"
|
|
35
|
+
}
|
|
11
36
|
},
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
"./ast": {
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./lib/ast/index.d.ts",
|
|
40
|
+
"default": "./lib/ast/index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./lib/ast/index.d.ts",
|
|
44
|
+
"default": "./lib/ast/index.js"
|
|
45
|
+
}
|
|
18
46
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
47
|
+
"./adapter": {
|
|
48
|
+
"browser": {
|
|
49
|
+
"require": "./lib/adapter/browser/index.cjs",
|
|
50
|
+
"import": "./lib/adapter/browser/index.js",
|
|
51
|
+
"types": "./lib/adapter/browser/index.d.ts"
|
|
52
|
+
},
|
|
53
|
+
"deno": {
|
|
54
|
+
"types": "./lib/adapter/deno/mod.d.ts",
|
|
55
|
+
"default": "./lib/adapter/deno/mod.js"
|
|
56
|
+
},
|
|
57
|
+
"node": {
|
|
58
|
+
"require": "./lib/adapter/node/index.cjs",
|
|
59
|
+
"import": "./lib/adapter/node/index.js",
|
|
60
|
+
"types": "./lib/adapter/node/index.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"default": {
|
|
63
|
+
"types": "./lib/adapter/node/index.d.ts",
|
|
64
|
+
"require": "./lib/adapter/node/index.cjs",
|
|
65
|
+
"import": "./lib/adapter/node/index.js"
|
|
66
|
+
}
|
|
22
67
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"types": "./lib/index.d.ts",
|
|
34
|
-
"default": "./lib/index.js"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"./ast": {
|
|
38
|
-
"require": {
|
|
39
|
-
"types": "./lib/ast/index.d.ts",
|
|
40
|
-
"default": "./lib/ast/index.cjs"
|
|
41
|
-
},
|
|
42
|
-
"import": {
|
|
43
|
-
"types": "./lib/ast/index.d.ts",
|
|
44
|
-
"default": "./lib/ast/index.js"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"./adapter": {
|
|
48
|
-
"browser": {
|
|
49
|
-
"require": "./lib/adapter/browser/index.cjs",
|
|
50
|
-
"import": "./lib/adapter/browser/index.js",
|
|
51
|
-
"types": "./lib/adapter/browser/index.d.ts"
|
|
52
|
-
},
|
|
53
|
-
"deno": {
|
|
54
|
-
"types": "./lib/adapter/deno/mod.d.ts",
|
|
55
|
-
"default": "./lib/adapter/deno/mod.js"
|
|
56
|
-
},
|
|
57
|
-
"node": {
|
|
58
|
-
"require": "./lib/adapter/node/index.cjs",
|
|
59
|
-
"import": "./lib/adapter/node/index.js",
|
|
60
|
-
"types": "./lib/adapter/node/index.d.ts"
|
|
61
|
-
},
|
|
62
|
-
"default": {
|
|
63
|
-
"types": "./lib/adapter/node/index.d.ts",
|
|
64
|
-
"require": "./lib/adapter/node/index.cjs",
|
|
65
|
-
"import": "./lib/adapter/node/index.js"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"./package.json": "./package.json"
|
|
69
|
-
},
|
|
70
|
-
"typesVersions": {
|
|
71
|
-
"*": {
|
|
72
|
-
"ast": [
|
|
73
|
-
"lib/ast"
|
|
74
|
-
],
|
|
75
|
-
"adapter": [
|
|
76
|
-
"lib/adapter/node"
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
"license": "MIT",
|
|
81
|
-
"engines": {
|
|
82
|
-
"node": ">=14.16"
|
|
83
|
-
},
|
|
84
|
-
"runkitExampleFilename": "example/runkit.cjs",
|
|
85
|
-
"scripts": {
|
|
86
|
-
"build:peggy": "peggy --plugin ts-pegjs --extra-options-file src/ast/dot-shim/parser/peggy.options.json -o src/ast/dot-shim/parser/_parse.ts src/ast/dot-shim/parser/dot.peggy",
|
|
87
|
-
"prebuild": "yarn build:peggy",
|
|
88
|
-
"build:deno": "mkdir -p lib/adapter/deno && cp -r src/adapter/deno/* lib/adapter/deno && sed -i \"s/index.ts/index.js/g\" lib/adapter/deno/mod.js && sed -i \"s/index.ts/index.d.ts/g\" lib/adapter/deno/mod.d.ts",
|
|
89
|
-
"build:node": "tsc -p tsconfig.build.json --declaration && tsc -p tsconfig.build.json --removeComments && rollup -c",
|
|
90
|
-
"build": "yarn build:node && yarn build:deno",
|
|
91
|
-
"postbuild": "prettier --write ./lib/**/*.{js,cjs,d.ts}",
|
|
92
|
-
"pretest": "yarn build:peggy",
|
|
93
|
-
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
|
|
94
|
-
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'",
|
|
95
|
-
"lint": "eslint --ext ts src",
|
|
96
|
-
"predoc": "yarn build:peggy",
|
|
97
|
-
"doc": "typedoc"
|
|
98
|
-
},
|
|
99
|
-
"devDependencies": {
|
|
100
|
-
"@rollup/plugin-replace": "^5.0.2",
|
|
101
|
-
"@types/jest": "^29.4.0",
|
|
102
|
-
"@types/jest-specific-snapshot": "^0.5.6",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
104
|
-
"@typescript-eslint/parser": "^5.49.0",
|
|
105
|
-
"eslint": "^8.32.0",
|
|
106
|
-
"eslint-config-prettier": "^8.6.0",
|
|
107
|
-
"eslint-plugin-import": "^2.27.5",
|
|
108
|
-
"eslint-plugin-jest": "^27.2.1",
|
|
109
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
110
|
-
"jest": "^29.4.1",
|
|
111
|
-
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
112
|
-
"jest-specific-snapshot": "^7.0.0",
|
|
113
|
-
"peggy": "^2.0.1",
|
|
114
|
-
"prettier": "^2.8.3",
|
|
115
|
-
"prettier-plugin-pegjs": "^0.5.0",
|
|
116
|
-
"rollup": "^3.11.0",
|
|
117
|
-
"rollup-plugin-delete": "^2.0.0",
|
|
118
|
-
"rollup-plugin-dts": "5.1.1",
|
|
119
|
-
"svgo": "^3.0.2",
|
|
120
|
-
"ts-jest": "^29.0.5",
|
|
121
|
-
"ts-pegjs": "^3.0.0",
|
|
122
|
-
"typedoc": "^0.23.15",
|
|
123
|
-
"typescript": "^4.7.4"
|
|
68
|
+
"./package.json": "./package.json"
|
|
69
|
+
},
|
|
70
|
+
"typesVersions": {
|
|
71
|
+
"*": {
|
|
72
|
+
"ast": [
|
|
73
|
+
"lib/ast"
|
|
74
|
+
],
|
|
75
|
+
"adapter": [
|
|
76
|
+
"lib/adapter/node"
|
|
77
|
+
]
|
|
124
78
|
}
|
|
125
|
-
}
|
|
79
|
+
},
|
|
80
|
+
"license": "MIT",
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=14.16"
|
|
83
|
+
},
|
|
84
|
+
"runkitExampleFilename": "example/runkit.cjs",
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build:peggy": "peggy --plugin ts-pegjs --extra-options-file src/ast/dot-shim/parser/peggy.options.json -o src/ast/dot-shim/parser/_parse.ts src/ast/dot-shim/parser/dot.peggy",
|
|
87
|
+
"prebuild": "yarn build:peggy",
|
|
88
|
+
"build:deno": "mkdir -p lib/adapter/deno && cp -r src/adapter/deno/* lib/adapter/deno && sed -i \"s/index.ts/index.js/g\" lib/adapter/deno/mod.js && sed -i \"s/index.ts/index.d.ts/g\" lib/adapter/deno/mod.d.ts",
|
|
89
|
+
"build:node": "tsc -p tsconfig.build.json --declaration && tsc -p tsconfig.build.json --removeComments && rollup -c",
|
|
90
|
+
"build": "yarn build:node && yarn build:deno",
|
|
91
|
+
"postbuild": "prettier --write ./lib/**/*.{js,cjs,d.ts}",
|
|
92
|
+
"pretest": "yarn build:peggy",
|
|
93
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
|
|
94
|
+
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'",
|
|
95
|
+
"lint": "eslint --ext ts src",
|
|
96
|
+
"predoc": "yarn build:peggy",
|
|
97
|
+
"doc": "typedoc"
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
101
|
+
"@types/jest": "^29.4.0",
|
|
102
|
+
"@types/jest-specific-snapshot": "^0.5.6",
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
|
104
|
+
"@typescript-eslint/parser": "^5.49.0",
|
|
105
|
+
"eslint": "^8.32.0",
|
|
106
|
+
"eslint-config-prettier": "^8.6.0",
|
|
107
|
+
"eslint-plugin-import": "^2.27.5",
|
|
108
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
109
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
110
|
+
"jest": "^29.4.1",
|
|
111
|
+
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
112
|
+
"jest-specific-snapshot": "^7.0.0",
|
|
113
|
+
"peggy": "^2.0.1",
|
|
114
|
+
"prettier": "^2.8.3",
|
|
115
|
+
"prettier-plugin-pegjs": "^0.5.0",
|
|
116
|
+
"rollup": "^3.11.0",
|
|
117
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
118
|
+
"rollup-plugin-dts": "5.1.1",
|
|
119
|
+
"svgo": "^3.0.2",
|
|
120
|
+
"ts-jest": "^29.0.5",
|
|
121
|
+
"ts-pegjs": "^3.0.0",
|
|
122
|
+
"typedoc": "^0.23.15",
|
|
123
|
+
"typescript": "^4.7.4"
|
|
124
|
+
}
|
|
125
|
+
}
|