ts-graphviz 1.5.4 → 1.5.5-dev.02afc3340

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.js CHANGED
@@ -2,17 +2,34 @@ import { pipe, map } from '../utils/index.js';
2
2
  import { isNodeModel, isForwardRefNode, createModelsContext } from '../common/index.js';
3
3
 
4
4
  /**
5
+ * Builder is an ASTBuilder that provides a method to create an ASTNode.
6
+ *
5
7
  * @group Create AST
6
8
  */
7
9
  class Builder {
8
10
  options;
9
- /** @internal */
11
+ /**
12
+ * Get the current file range or null
13
+ * @internal
14
+ */
10
15
  getLocation() {
11
16
  return this.options?.locationFunction?.() ?? null;
12
17
  }
18
+ /**
19
+ * Constructor of Builder
20
+ * @param options - Options to initialize Builder
21
+ */
13
22
  constructor(options) {
14
23
  this.options = options;
15
24
  }
25
+ /**
26
+ * Create an {@link ASTNode} of the specified type
27
+ *
28
+ * @param type - Type of the {@link ASTNode}
29
+ * @param props - Properties of the {@link ASTNode}
30
+ * @param children - Children of the {@link ASTNode}
31
+ * @returns An {@link ASTNode}
32
+ */
16
33
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
34
  createElement(type, props, children) {
18
35
  return {
@@ -25,7 +42,13 @@ class Builder {
25
42
  }
26
43
 
27
44
  /**
45
+ * Create an {@link ASTNode} of the specified type
46
+ *
47
+ * @param type - Type of the {@link ASTNode}
48
+ * @param props - Properties of the {@link ASTNode}
49
+ * @param children - Children of the {@link ASTNode}
28
50
  * @group Create AST
51
+ * @returns An {@link ASTNode}
29
52
  */
30
53
  const createElement = Builder.prototype.createElement.bind(new Builder());
31
54
 
@@ -259,15 +282,24 @@ const defaultPlugins$2 = [
259
282
  ];
260
283
 
261
284
  /**
285
+ * Printer is a class responsible for converting an AST into a DOT string.
262
286
  * @group Convert AST to DOT
263
287
  */
264
288
  class Printer {
265
289
  options;
266
290
  /** @internal */
267
291
  #plugins = [...defaultPlugins$2];
292
+ /**
293
+ * @param options Options to be used when generating the DOT string.
294
+ */
268
295
  constructor(options = {}) {
269
296
  this.options = options;
270
297
  }
298
+ /**
299
+ * Generates a DOT string from an ASTNode.
300
+ * @param ast The ASTNode to be converted into a DOT string.
301
+ * @returns The DOT string generated from the ASTNode.
302
+ */
271
303
  print(ast) {
272
304
  const plugins = [...this.#plugins];
273
305
  const { indentSize = 2, indentStyle = 'space', endOfLine = 'lf' } = this.options;
@@ -290,10 +322,11 @@ class Printer {
290
322
  }
291
323
 
292
324
  /**
293
- * Stringify Graphviz AST Node.
325
+ * stringify is a function that converts a Graphviz AST Node into a string in DOT language.
294
326
  *
295
- * @param ast Graphviz AST node.
296
- * @returns DOT language string.
327
+ * @param ast Graphviz AST node that is to be converted.
328
+ * @param options PrintOptions object containing formatting options.
329
+ * @returns A string in DOT language.
297
330
  * @group Convert AST to DOT
298
331
  */
299
332
  function stringify(ast, options) {
@@ -5556,6 +5589,8 @@ const SubgraphPlugin$1 = {
5556
5589
  const defaultPlugins$1 = [AttributeListPlugin, EdgePlugin$1, NodePlugin$1, GraphPlugin$1, SubgraphPlugin$1];
5557
5590
 
5558
5591
  /**
5592
+ * FromModelConverter is a class used to convert a {@link DotObjectModel} into an ASTNode.
5593
+ *
5559
5594
  * @group Convert Model to AST
5560
5595
  */
5561
5596
  class FromModelConverter {
@@ -5565,6 +5600,12 @@ class FromModelConverter {
5565
5600
  constructor(options = {}) {
5566
5601
  this.options = options;
5567
5602
  }
5603
+ /**
5604
+ * Converts a DotObjectModel into an AST.
5605
+ *
5606
+ * @param model The {@link DotObjectModel} to be converted.
5607
+ * @returns The AST generated from the model.
5608
+ */
5568
5609
  convert(model) {
5569
5610
  const plugins = [...this.#plugins];
5570
5611
  const { commentKind = 'Slash' } = this.options;
@@ -5584,6 +5625,12 @@ class FromModelConverter {
5584
5625
  }
5585
5626
 
5586
5627
  /**
5628
+ * A function used to convert a DotObjectModel into an AST.
5629
+ *
5630
+ * @param model - The {@link DotObjectModel} to be converted.
5631
+ * @param options - An optional {@link ConvertFromModelOptions} object.
5632
+ * @returns ModelToAST - The AST representation of the {@link DotObjectModel}.
5633
+ *
5587
5634
  * @group Convert Model to AST
5588
5635
  */
5589
5636
  function fromModel(model, options) {
@@ -1434,6 +1434,9 @@ type AttributeKey =
1434
1434
  | SubgraphAttributeKey
1435
1435
  | ClusterSubgraphAttributeKey;
1436
1436
 
1437
+ /**
1438
+ * KeyValueMapping is an interface that defines a set of attributes that can be used to configure a graph.
1439
+ */
1437
1440
  interface KeyValueMapping {
1438
1441
  _background: string;
1439
1442
  area: Double;
@@ -1609,6 +1612,9 @@ interface KeyValueMapping {
1609
1612
  z: Blank | Double;
1610
1613
  }
1611
1614
  /**
1615
+ * This type represents an Attribute, which is a key-value mapping of an {@link AttributeKey} to a value.
1616
+ *
1617
+ * @param T The {@link AttributeKey} to be mapped to a value.
1612
1618
  * @group Attribute
1613
1619
  */
1614
1620
  type Attribute<T extends AttributeKey> = KeyValueMapping[T];
@@ -1636,6 +1642,7 @@ declare const RootModelsContext: ModelsContext;
1636
1642
  declare function createModelsContext(models: Partial<ModelsContext>): ModelsContext;
1637
1643
 
1638
1644
  /**
1645
+ * ASTType is an enumeration of the different types of nodes that can be found in an AST(Abstract Syntax Tree ).
1639
1646
  * @group Models
1640
1647
  */
1641
1648
  type ASTType =
@@ -1725,9 +1732,15 @@ type SubgraphAttributesObject = AttributesObject<ClusterSubgraphAttributeKey | S
1725
1732
  */
1726
1733
  type DotObjectType = 'AttributeList' | 'Node' | 'Edge' | 'Subgraph' | 'Graph';
1727
1734
  /**
1735
+ * DotObjectModel is an interface that defines a generic type for a {@link DotObjectType}.
1736
+ *
1737
+ * @template T The type of the {@link DotObjectType}.
1728
1738
  * @group Models
1729
1739
  */
1730
1740
  interface DotObjectModel<T extends DotObjectType = DotObjectType> {
1741
+ /**
1742
+ * The type of the DotObjectType.
1743
+ */
1731
1744
  $$type: T;
1732
1745
  }
1733
1746
  /**
@@ -335,7 +335,14 @@ Object.assign(index_js.RootModelsContext, {
335
335
  Edge,
336
336
  });
337
337
 
338
- /** @hidden */
338
+ /**
339
+ * ModelFactoryBuilder is a function that takes two parameters, directed and strictMode, and returns a ModelFactory.
340
+ *
341
+ * @param directed A boolean value indicating whether the graph should be directed or not.
342
+ * @param strictMode A boolean value indicating whether the graph should be in strict mode or not.
343
+ * @returns A ModelFactory that takes an array of unknowns as parameters and returns a RootGraphModel.
344
+ * @hidden
345
+ */
339
346
  function ModelFactoryBuilder(directed, strictMode) {
340
347
  return (...args) => {
341
348
  const G = directed ? this.Digraph : this.Graph;
@@ -350,6 +357,13 @@ function ModelFactoryBuilder(directed, strictMode) {
350
357
  return g;
351
358
  };
352
359
  }
360
+ /**
361
+ * createModelFactories is a function that takes a boolean value, strict, and an optional ModelsContext parameter, context, and returns an object containing two ModelFactories.
362
+ *
363
+ * @param strict A boolean value indicating whether the graph should be in strict mode or not.
364
+ * @param context An optional ModelsContext parameter.
365
+ * @returns An object containing two ModelFactories, one for directed graphs and one for undirected graphs.
366
+ */
353
367
  function createModelFactories(strict, context = index_js.RootModelsContext) {
354
368
  return Object.freeze({
355
369
  digraph: ModelFactoryBuilder.call(context, true, strict),
@@ -359,12 +373,12 @@ function createModelFactories(strict, context = index_js.RootModelsContext) {
359
373
 
360
374
  const noStrict = createModelFactories(false);
361
375
  /**
362
- * API for creating directional graph objects.
376
+ * digraph is a factory for creating Digraph objects.
363
377
  * @group Model Factory
364
378
  */
365
379
  const digraph = noStrict.digraph;
366
380
  /**
367
- * API for creating omnidirectional graph objects.
381
+ * graph is a factory for creating Graph objects.
368
382
  * @group Model Factory
369
383
  */
370
384
  const graph = noStrict.graph;
@@ -374,7 +388,11 @@ const graph = noStrict.graph;
374
388
  */
375
389
  const strict = createModelFactories(true);
376
390
  /**
377
- * @group Model Factory
391
+ * withContext creates a {@link ModelFactoriesWithStrict} object with the given context.
392
+ *
393
+ * @param models - An object containing the models to be used in the context.
394
+ *
395
+ * @returns A ModelFactoriesWithStrict object containing the factories. * @group Model Factory
378
396
  */
379
397
  function withContext(models) {
380
398
  const context = index_js.createModelsContext(models);
@@ -390,7 +408,7 @@ function withContext(models) {
390
408
  * @group Convert Model to DOT
391
409
  *
392
410
  * @param model Dot Object Model, like {@link Digraph}, {@link Graph}, {@link Subgraph}, {@link Node}, and {@link Edge}
393
- * @param options
411
+ * @param options Optional options for the conversion.
394
412
  * @returns DOT string
395
413
  */
396
414
  function toDot(model, options) {
@@ -2680,6 +2680,13 @@ declare class Subgraph extends GraphBase<SubgraphAttributeKey | ClusterSubgraphA
2680
2680
  }
2681
2681
 
2682
2682
  /**
2683
+ * ModelFactory is an interface that provides a way to create a {@link RootGraphModel} object.
2684
+ *
2685
+ * @param id - Optional string parameter that specifies the id of the {@link RootGraphModel} object.
2686
+ * @param attributes - Optional GraphAttributesObject parameter that specifies the attributes of the {@link RootGraphModel} object.
2687
+ * @param callback - Optional callback function that takes a {@link RootGraphModel} object as a parameter.
2688
+ *
2689
+ * @returns {@link RootGraphModel} - Returns a {@link RootGraphModel} object.
2683
2690
  * @group Model Factory
2684
2691
  */
2685
2692
  interface ModelFactory {
@@ -2709,12 +2716,12 @@ interface ModelFactoriesWithStrict extends ModelFactories {
2709
2716
  }
2710
2717
 
2711
2718
  /**
2712
- * API for creating directional graph objects.
2719
+ * digraph is a factory for creating Digraph objects.
2713
2720
  * @group Model Factory
2714
2721
  */
2715
2722
  declare const digraph: ModelFactory;
2716
2723
  /**
2717
- * API for creating omnidirectional graph objects.
2724
+ * graph is a factory for creating Graph objects.
2718
2725
  * @group Model Factory
2719
2726
  */
2720
2727
  declare const graph: ModelFactory;
@@ -2724,16 +2731,27 @@ declare const graph: ModelFactory;
2724
2731
  */
2725
2732
  declare const strict: ModelFactories;
2726
2733
  /**
2727
- * @group Model Factory
2734
+ * withContext creates a {@link ModelFactoriesWithStrict} object with the given context.
2735
+ *
2736
+ * @param models - An object containing the models to be used in the context.
2737
+ *
2738
+ * @returns A ModelFactoriesWithStrict object containing the factories. * @group Model Factory
2728
2739
  */
2729
2740
  declare function withContext(models: Partial<ModelsContext>): ModelFactoriesWithStrict;
2730
2741
 
2731
2742
  /**
2743
+ * This interface provides options for converting a model to DOT.
2732
2744
  * @group Convert Model to DOT
2733
2745
  * @alpha
2734
2746
  */
2735
2747
  interface ToDotOptions {
2748
+ /**
2749
+ * Options for converting the model to DOT.
2750
+ */
2736
2751
  convert?: ConvertFromModelOptions;
2752
+ /**
2753
+ * Options for printing DOT.
2754
+ */
2737
2755
  print?: PrintOptions;
2738
2756
  }
2739
2757
  /**
@@ -2742,27 +2760,35 @@ interface ToDotOptions {
2742
2760
  * @group Convert Model to DOT
2743
2761
  *
2744
2762
  * @param model Dot Object Model, like {@link Digraph}, {@link Graph}, {@link Subgraph}, {@link Node}, and {@link Edge}
2745
- * @param options
2763
+ * @param options Optional options for the conversion.
2746
2764
  * @returns DOT string
2747
2765
  */
2748
2766
  declare function toDot(model: DotObjectModel, options?: ToDotOptions): string;
2749
2767
 
2750
2768
  /**
2751
- * @group Convert DOT to DOT
2769
+ * This interface provides options for converting DOT to a model.
2770
+ * @group Convert DOT to Model
2752
2771
  * @alpha
2753
2772
  */
2754
2773
  interface FromDotOptions<T extends 'Dot' | 'Graph' | 'Node' | 'Edge' | 'Subgraph'> {
2774
+ /**
2775
+ * Options for parsing DOT.
2776
+ */
2755
2777
  parse?: ParseOptions<T>;
2778
+ /**
2779
+ * Options for converting the parsed DOT to a model.
2780
+ */
2756
2781
  convert?: ConvertToModelOptions;
2757
2782
  }
2758
2783
  /**
2759
- * Convert DOT string to Model.
2784
+ * fromDot is a function that converts a DOT string to a model.
2760
2785
  *
2761
2786
  * @group Convert DOT to Model
2762
2787
  *
2763
- * @param dot DOT string
2764
- * @param options
2765
- * @returns Dot Object Model, like {@link Digraph}, {@link Graph}, {@link Subgraph}, {@link Node}, and {@link Edge}
2788
+ * @param dot The DOT string to convert.
2789
+ * @param options Options for converting the DOT string to a model.
2790
+ * @returns A model of type {@link RootGraphModel}, {@link NodeModel}, {@link EdgeModel}, or {@link SubgraphModel},
2791
+ * depending on the type specified in the options.
2766
2792
  * @beta
2767
2793
  */
2768
2794
  declare function fromDot(dot: string, options?: FromDotOptions<'Dot' | 'Graph'>): RootGraphModel;
package/lib/core/index.js CHANGED
@@ -338,7 +338,14 @@ Object.assign(RootModelsContext, {
338
338
  Edge,
339
339
  });
340
340
 
341
- /** @hidden */
341
+ /**
342
+ * ModelFactoryBuilder is a function that takes two parameters, directed and strictMode, and returns a ModelFactory.
343
+ *
344
+ * @param directed A boolean value indicating whether the graph should be directed or not.
345
+ * @param strictMode A boolean value indicating whether the graph should be in strict mode or not.
346
+ * @returns A ModelFactory that takes an array of unknowns as parameters and returns a RootGraphModel.
347
+ * @hidden
348
+ */
342
349
  function ModelFactoryBuilder(directed, strictMode) {
343
350
  return (...args) => {
344
351
  const G = directed ? this.Digraph : this.Graph;
@@ -353,6 +360,13 @@ function ModelFactoryBuilder(directed, strictMode) {
353
360
  return g;
354
361
  };
355
362
  }
363
+ /**
364
+ * createModelFactories is a function that takes a boolean value, strict, and an optional ModelsContext parameter, context, and returns an object containing two ModelFactories.
365
+ *
366
+ * @param strict A boolean value indicating whether the graph should be in strict mode or not.
367
+ * @param context An optional ModelsContext parameter.
368
+ * @returns An object containing two ModelFactories, one for directed graphs and one for undirected graphs.
369
+ */
356
370
  function createModelFactories(strict, context = RootModelsContext) {
357
371
  return Object.freeze({
358
372
  digraph: ModelFactoryBuilder.call(context, true, strict),
@@ -362,12 +376,12 @@ function createModelFactories(strict, context = RootModelsContext) {
362
376
 
363
377
  const noStrict = createModelFactories(false);
364
378
  /**
365
- * API for creating directional graph objects.
379
+ * digraph is a factory for creating Digraph objects.
366
380
  * @group Model Factory
367
381
  */
368
382
  const digraph = noStrict.digraph;
369
383
  /**
370
- * API for creating omnidirectional graph objects.
384
+ * graph is a factory for creating Graph objects.
371
385
  * @group Model Factory
372
386
  */
373
387
  const graph = noStrict.graph;
@@ -377,7 +391,11 @@ const graph = noStrict.graph;
377
391
  */
378
392
  const strict = createModelFactories(true);
379
393
  /**
380
- * @group Model Factory
394
+ * withContext creates a {@link ModelFactoriesWithStrict} object with the given context.
395
+ *
396
+ * @param models - An object containing the models to be used in the context.
397
+ *
398
+ * @returns A ModelFactoriesWithStrict object containing the factories. * @group Model Factory
381
399
  */
382
400
  function withContext(models) {
383
401
  const context = createModelsContext(models);
@@ -393,7 +411,7 @@ function withContext(models) {
393
411
  * @group Convert Model to DOT
394
412
  *
395
413
  * @param model Dot Object Model, like {@link Digraph}, {@link Graph}, {@link Subgraph}, {@link Node}, and {@link Edge}
396
- * @param options
414
+ * @param options Optional options for the conversion.
397
415
  * @returns DOT string
398
416
  */
399
417
  function toDot(model, options) {
package/package.json CHANGED
@@ -1,125 +1,125 @@
1
1
  {
2
- "name": "ts-graphviz",
3
- "version": "1.5.4",
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/kamiazya"
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
- }
2
+ "name": "ts-graphviz",
3
+ "version": "1.5.5-dev.02afc3340",
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"
36
11
  },
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
- }
12
+ "keywords": [
13
+ "graphviz",
14
+ "dot"
15
+ ],
16
+ "bugs": {
17
+ "url": "https://github.com/ts-graphviz/ts-graphviz/issues"
46
18
  },
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
- }
19
+ "funding": {
20
+ "type": "github",
21
+ "url": "https://github.com/sponsors/kamiazya"
67
22
  },
68
- "./package.json": "./package.json"
69
- },
70
- "typesVersions": {
71
- "*": {
72
- "ast": [
73
- "lib/ast"
74
- ],
75
- "adapter": [
76
- "lib/adapter/node"
77
- ]
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
+ }
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 && 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"
78
124
  }
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 && 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
- }
125
+ }