ts-graphviz 1.2.3 → 1.2.4-dev.0c498aa20
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 +70 -6
- package/lib/adapter/deno/mod.d.ts +17 -0
- package/lib/adapter/deno/mod.js +33 -0
- package/lib/adapter/index.cjs +47 -0
- package/lib/adapter/index.d.ts +17 -0
- package/lib/adapter/index.js +42 -0
- package/media/adapter-state-machine.svg +1 -0
- package/package.json +111 -84
- package/README.ja.md +0 -498
- package/test/__snapshots__/class-base.test.ts.snap +0 -18
- package/test/__snapshots__/create-root-graph.spec.ts.snap +0 -200
- package/test/__snapshots__/to-dot.test.ts.snap +0 -229
- package/test/class-base.test.ts +0 -131
- package/test/create-root-graph.spec.ts +0 -292
- package/test/edge-group.test.ts +0 -96
- package/test/from-dot.test.ts +0 -58
- package/test/to-dot.test.ts +0 -112
- package/test/utils/index.ts +0 -1
- package/test/utils/to-dot.ts +0 -5
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
[](https://github.com/facebook/jest)
|
|
7
7
|
[](https://github.com/facebook/jest)
|
|
8
8
|

|
|
9
|
+
[](https://github.com/denoland/deno)
|
|
9
10
|

|
|
10
11
|
[](#contributors)
|
|
11
12
|
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
[](https://ts-graphviz.github.io/ts-graphviz/)
|
|
20
21
|
[](https://github.com/sponsors/kamiazya)
|
|
21
22
|
|
|
22
|
-
> [English](https://github.com/ts-graphviz/ts-graphviz/blob/main/README.md) | [日本語](https://github.com/ts-graphviz/ts-graphviz/blob/main/
|
|
23
|
+
> [English](https://github.com/ts-graphviz/ts-graphviz/blob/main/README.md) | [日本語](https://github.com/ts-graphviz/ts-graphviz/blob/main/README_ja.md)
|
|
23
24
|
|
|
24
25
|
## Key Features ✨
|
|
25
26
|
|
|
@@ -34,6 +35,8 @@
|
|
|
34
35
|
|
|
35
36
|
## Installation 💽
|
|
36
37
|
|
|
38
|
+
### Node.js
|
|
39
|
+
|
|
37
40
|
This package can then be installed using a package manager.
|
|
38
41
|
|
|
39
42
|
```bash
|
|
@@ -45,6 +48,16 @@ $ yarn add ts-graphviz
|
|
|
45
48
|
$ pnpm add ts-graphviz
|
|
46
49
|
```
|
|
47
50
|
|
|
51
|
+
### Deno 🦕
|
|
52
|
+
|
|
53
|
+
[Deno v1.28 and above supports npm](https://deno.land/manual/node/npm_specifiers).
|
|
54
|
+
|
|
55
|
+
You can install and use the package by specifying the following:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { toDot } from 'npm:ts-graphviz';
|
|
59
|
+
```
|
|
60
|
+
|
|
48
61
|
## Usage 📑
|
|
49
62
|
|
|
50
63
|
This section provides an overview of the package.
|
|
@@ -322,6 +335,56 @@ const dot = toDot(g);
|
|
|
322
335
|
|
|
323
336
|
</details>
|
|
324
337
|
|
|
338
|
+
### `ts-graphviz/adapter` Module 🔌
|
|
339
|
+
|
|
340
|
+
> This module status is .
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
Provides an interface to run Graphviz dot commands.
|
|
344
|
+
|
|
345
|
+
[Graphviz](https://graphviz.gitlab.io/) must be installed so that the dot command can be executed.
|
|
346
|
+
|
|
347
|
+
Execute the dot command to output a DOT language string to a stream or file.
|
|
348
|
+
|
|
349
|
+

|
|
350
|
+
|
|
351
|
+
This module provides the following functions.
|
|
352
|
+
|
|
353
|
+
- The `toStream` function converts **DOT** to **Stream**.
|
|
354
|
+
```ts
|
|
355
|
+
import { toStream } from 'ts-graphviz/adapter';
|
|
356
|
+
|
|
357
|
+
const dot = `
|
|
358
|
+
digraph example {
|
|
359
|
+
node1 [
|
|
360
|
+
label = "My Node",
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
`;
|
|
364
|
+
|
|
365
|
+
const stream = await toStream(dot, { format: 'svg' });
|
|
366
|
+
// Node.js
|
|
367
|
+
stream.pipe(process.stdout);
|
|
368
|
+
// Deno
|
|
369
|
+
await stream.pipeTo(Deno.stdout.writable);
|
|
370
|
+
```
|
|
371
|
+
- Writes **DOT** to a file at the specified path `toFile` function
|
|
372
|
+
```ts
|
|
373
|
+
import { toFile } from 'ts-graphviz/adapter';
|
|
374
|
+
|
|
375
|
+
const dot = `
|
|
376
|
+
digraph example {
|
|
377
|
+
node1 [
|
|
378
|
+
label = "My Node",
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
`;
|
|
382
|
+
|
|
383
|
+
await toFile(dot, './result.svg', { format: 'svg' });
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
> **Note** Designed to work with Node.js and Deno, Stream is runtime native.
|
|
387
|
+
|
|
325
388
|
### `ts-graphviz/ast` Module 🔢
|
|
326
389
|
|
|
327
390
|
> This module status is .
|
|
@@ -454,12 +517,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
454
517
|
<table>
|
|
455
518
|
<tbody>
|
|
456
519
|
<tr>
|
|
457
|
-
<td align="center"><a href="http://blog.kamiazya.tech/"><img src="https://avatars0.githubusercontent.com/u/35218186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yuki Yamazaki</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Code">💻</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Tests">⚠️</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Documentation">📖</a> <a href="#ideas-kamiazya" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
458
|
-
<td align="center"><a href="https://laysent.com"><img src="https://avatars2.githubusercontent.com/u/1191606?v=4?s=100" width="100px;" alt=""/><br /><sub><b>LaySent</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Alaysent" title="Bug reports">🐛</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=laysent" title="Tests">⚠️</a></td>
|
|
459
|
-
<td align="center"><a href="https://github.com/elasticdotventures"><img src="https://avatars0.githubusercontent.com/u/35611074?v=4?s=100" width="100px;" alt=""/><br /><sub><b>elasticdotventures</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=elasticdotventures" title="Documentation">📖</a></td>
|
|
460
|
-
<td align="center"><a href="https://github.com/ChristianMurphy"><img src="https://avatars.githubusercontent.com/u/3107513?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Christian Murphy</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Code">💻</a> <a href="#ideas-ChristianMurphy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Documentation">📖</a></td>
|
|
520
|
+
<td align="center" valign="top" width="14.28%"><a href="http://blog.kamiazya.tech/"><img src="https://avatars0.githubusercontent.com/u/35218186?v=4?s=100" width="100px;" alt="Yuki Yamazaki"/><br /><sub><b>Yuki Yamazaki</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Code">💻</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Tests">⚠️</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=kamiazya" title="Documentation">📖</a> <a href="#ideas-kamiazya" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
521
|
+
<td align="center" valign="top" width="14.28%"><a href="https://laysent.com"><img src="https://avatars2.githubusercontent.com/u/1191606?v=4?s=100" width="100px;" alt="LaySent"/><br /><sub><b>LaySent</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Alaysent" title="Bug reports">🐛</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=laysent" title="Tests">⚠️</a></td>
|
|
522
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/elasticdotventures"><img src="https://avatars0.githubusercontent.com/u/35611074?v=4?s=100" width="100px;" alt="elasticdotventures"/><br /><sub><b>elasticdotventures</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=elasticdotventures" title="Documentation">📖</a></td>
|
|
523
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ChristianMurphy"><img src="https://avatars.githubusercontent.com/u/3107513?v=4?s=100" width="100px;" alt="Christian Murphy"/><br /><sub><b>Christian Murphy</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Code">💻</a> <a href="#ideas-ChristianMurphy" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ts-graphviz/ts-graphviz/commits?author=ChristianMurphy" title="Documentation">📖</a></td>
|
|
524
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ArtemAdamenko"><img src="https://avatars.githubusercontent.com/u/2178516?v=4?s=100" width="100px;" alt="Artem"/><br /><sub><b>Artem</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3AArtemAdamenko" title="Bug reports">🐛</a></td>
|
|
461
525
|
</tr>
|
|
462
|
-
</
|
|
526
|
+
</tbody>
|
|
463
527
|
</table>
|
|
464
528
|
|
|
465
529
|
<!-- markdownlint-restore -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type Format = 'png' | 'svg' | 'json' | 'jpg' | 'pdf' | 'xdot' | 'plain' | 'dot_json';
|
|
2
|
+
|
|
3
|
+
export interface Options {
|
|
4
|
+
format?: Format;
|
|
5
|
+
suppressWarnings?: boolean;
|
|
6
|
+
dotCommand?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Execute the Graphviz dot command and make a Stream of the results.
|
|
11
|
+
*/
|
|
12
|
+
export function toStream(dot: string, options?: Options): Promise<ReadableStream>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Execute the Graphviz dot command and output the results to a file.
|
|
16
|
+
*/
|
|
17
|
+
export function toFile(dot: string, path: string, options?: Options): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function commandBuilder({ dotCommand = 'dot', suppressWarnings = true, format = 'svg' } = {}) {
|
|
2
|
+
const args = [
|
|
3
|
+
...(function* () {
|
|
4
|
+
if (suppressWarnings) yield '-q';
|
|
5
|
+
yield `-T${format}`;
|
|
6
|
+
})(),
|
|
7
|
+
];
|
|
8
|
+
return [dotCommand, args];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Execute the Graphviz dot command and make a Stream of the results.
|
|
13
|
+
*/
|
|
14
|
+
export async function toStream(dot, options) {
|
|
15
|
+
const [command, args] = commandBuilder(options);
|
|
16
|
+
const cp = new Deno.Command(command, {
|
|
17
|
+
args: args,
|
|
18
|
+
stdin: 'piped',
|
|
19
|
+
}).spawn();
|
|
20
|
+
const stdin = cp.stdin.getWriter();
|
|
21
|
+
await stdin.write(new TextEncoder().encode(dot));
|
|
22
|
+
await stdin.close();
|
|
23
|
+
return cp.stdout;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Execute the Graphviz dot command and output the results to a file.
|
|
28
|
+
*/
|
|
29
|
+
export async function toFile(dot, path, options) {
|
|
30
|
+
const output = await Deno.open(path, { write: true });
|
|
31
|
+
const stream = await toStream(dot, options);
|
|
32
|
+
await stream.pipeTo(output.writable);
|
|
33
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var node_fs = require('node:fs');
|
|
6
|
+
var node_stream = require('node:stream');
|
|
7
|
+
var node_util = require('node:util');
|
|
8
|
+
var node_child_process = require('node:child_process');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @module ts-graphviz/adapter
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
function commandBuilder({ dotCommand = 'dot', suppressWarnings = true, format = 'svg' } = {}) {
|
|
15
|
+
const args = [
|
|
16
|
+
...(function* () {
|
|
17
|
+
if (suppressWarnings) yield '-q';
|
|
18
|
+
yield `-T${format}`;
|
|
19
|
+
})(),
|
|
20
|
+
];
|
|
21
|
+
return [dotCommand, args];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* NOTE:
|
|
25
|
+
* The node:stream/promises standard module is not provided in Node 14.
|
|
26
|
+
* Fix Node 14 to use node:stream/promises after LTS ends.
|
|
27
|
+
*/
|
|
28
|
+
const pipeline = node_util.promisify(node_stream.pipeline);
|
|
29
|
+
/**
|
|
30
|
+
* Execute the Graphviz dot command and make a Stream of the results.
|
|
31
|
+
*/
|
|
32
|
+
async function toStream(dot, options) {
|
|
33
|
+
const [command, args] = commandBuilder(options);
|
|
34
|
+
const p = node_child_process.spawn(command, args, { stdio: 'pipe' });
|
|
35
|
+
await pipeline(node_stream.Readable.from([dot]), p.stdin);
|
|
36
|
+
return p.stdout;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execute the Graphviz dot command and output the results to a file.
|
|
40
|
+
*/
|
|
41
|
+
async function toFile(dot, path, options) {
|
|
42
|
+
const stream = await toStream(dot, options);
|
|
43
|
+
await pipeline(stream, node_fs.createWriteStream(path));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.toFile = toFile;
|
|
47
|
+
exports.toStream = toStream;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
declare type Format = 'png' | 'svg' | 'json' | 'jpg' | 'pdf' | 'xdot' | 'plain' | 'dot_json';
|
|
3
|
+
interface Options {
|
|
4
|
+
format?: Format;
|
|
5
|
+
suppressWarnings?: boolean;
|
|
6
|
+
dotCommand?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Execute the Graphviz dot command and make a Stream of the results.
|
|
10
|
+
*/
|
|
11
|
+
declare function toStream(dot: string, options?: Options): Promise<NodeJS.ReadableStream>;
|
|
12
|
+
/**
|
|
13
|
+
* Execute the Graphviz dot command and output the results to a file.
|
|
14
|
+
*/
|
|
15
|
+
declare function toFile(dot: string, path: string, options?: Options): Promise<void>;
|
|
16
|
+
|
|
17
|
+
export { Format, Options, toFile, toStream };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createWriteStream } from 'node:fs';
|
|
2
|
+
import { pipeline as pipeline$1, Readable } from 'node:stream';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
import { spawn } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module ts-graphviz/adapter
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
function commandBuilder({ dotCommand = 'dot', suppressWarnings = true, format = 'svg' } = {}) {
|
|
11
|
+
const args = [
|
|
12
|
+
...(function* () {
|
|
13
|
+
if (suppressWarnings) yield '-q';
|
|
14
|
+
yield `-T${format}`;
|
|
15
|
+
})(),
|
|
16
|
+
];
|
|
17
|
+
return [dotCommand, args];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* NOTE:
|
|
21
|
+
* The node:stream/promises standard module is not provided in Node 14.
|
|
22
|
+
* Fix Node 14 to use node:stream/promises after LTS ends.
|
|
23
|
+
*/
|
|
24
|
+
const pipeline = promisify(pipeline$1);
|
|
25
|
+
/**
|
|
26
|
+
* Execute the Graphviz dot command and make a Stream of the results.
|
|
27
|
+
*/
|
|
28
|
+
async function toStream(dot, options) {
|
|
29
|
+
const [command, args] = commandBuilder(options);
|
|
30
|
+
const p = spawn(command, args, { stdio: 'pipe' });
|
|
31
|
+
await pipeline(Readable.from([dot]), p.stdin);
|
|
32
|
+
return p.stdout;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Execute the Graphviz dot command and output the results to a file.
|
|
36
|
+
*/
|
|
37
|
+
async function toFile(dot, path, options) {
|
|
38
|
+
const stream = await toStream(dot, options);
|
|
39
|
+
await pipeline(stream, createWriteStream(path));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { toFile, toStream };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="172pt" height="211pt" viewBox="0 0 172.44 211.09" xmlns="http://www.w3.org/2000/svg"><g class="graph" transform="translate(4 207.09)"><path fill="#fff" stroke="transparent" d="M-4 4v-211.09h172.44V4H-4z"/><g class="node"><circle fill="none" stroke="#000" cx="89.85" cy="-171.89" r="31.4"/><text text-anchor="middle" x="89.85" y="-168.19" font-family="Times,serif" font-size="14">DOT</text></g><g class="node"><circle fill="none" stroke="#000" cx="44.85" cy="-44.85" r="44.69"/><text text-anchor="middle" x="44.85" y="-41.15" font-family="Times,serif" font-size="14">Stream</text></g><g class="edge"><path fill="none" stroke="#000" d="M66.46-151.09c-7.72 7.95-15.4 17.76-19.61 28.4-2.87 7.24-4.54 15.17-5.4 23.11"/><path stroke="#000" d="m44.94-99.32-4.18 9.73-2.8-10.21 6.98.48z"/><text text-anchor="middle" x="80.35" y="-111.49" font-family="Times,serif" font-size="14">toStream</text></g><g class="node"><circle fill="none" stroke="#000" cx="135.85" cy="-44.85" r="28.7"/><text text-anchor="middle" x="135.85" y="-41.15" font-family="Times,serif" font-size="14">File</text></g><g class="edge"><path fill="none" stroke="#000" d="M104.32-144.01c3.38 6.84 6.79 14.26 9.53 21.32 4.95 12.76 9.35 27.09 12.89 39.89"/><path stroke="#000" d="m130.18-83.48-.79 10.56-5.97-8.75 6.76-1.81z"/><text text-anchor="middle" x="139.85" y="-111.49" font-family="Times,serif" font-size="14">toFile</text></g></g></svg>
|
package/package.json
CHANGED
|
@@ -1,87 +1,114 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
"import": "./lib/index.js",
|
|
29
|
-
"require": "./lib/index.cjs",
|
|
30
|
-
"types": "./lib/index.d.ts"
|
|
2
|
+
"name": "ts-graphviz",
|
|
3
|
+
"version": "1.2.4-dev.0c498aa20",
|
|
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"
|
|
31
11
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
"default": "./lib/index.cjs",
|
|
30
|
+
"types": "./lib/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"import": {
|
|
33
|
+
"default": "./lib/index.js",
|
|
34
|
+
"types": "./lib/index.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./ast": {
|
|
38
|
+
"require": {
|
|
39
|
+
"default": "./lib/ast/index.cjs",
|
|
40
|
+
"types": "./lib/ast/index.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"import": {
|
|
43
|
+
"default": "./lib/ast/index.js",
|
|
44
|
+
"types": "./lib/ast/index.d.ts"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"./adapter": {
|
|
48
|
+
"deno": {
|
|
49
|
+
"default": "./lib/adapter/deno/mod.js",
|
|
50
|
+
"types": "./lib/adapter/deno/mod.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"node": {
|
|
53
|
+
"require": "./lib/adapter/index.cjs",
|
|
54
|
+
"import": "./lib/adapter/index.js",
|
|
55
|
+
"types": "./lib/adapter/index.d.ts"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"./package.json": "./package.json"
|
|
59
|
+
},
|
|
60
|
+
"typesVersions": {
|
|
61
|
+
"*": {
|
|
62
|
+
"ast": [
|
|
63
|
+
"lib/ast"
|
|
64
|
+
],
|
|
65
|
+
"adapter": [
|
|
66
|
+
"lib/adapter"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=14.16"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"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",
|
|
76
|
+
"prebuild": "yarn build:peggy",
|
|
77
|
+
"build:deno": "cp -r src/adapter/deno lib/adapter/deno",
|
|
78
|
+
"build:node": "tsc -p tsconfig.build.json && rollup -c",
|
|
79
|
+
"build": "yarn build:node && yarn build:deno",
|
|
80
|
+
"postbuild": "prettier --write ./lib/**/index.{js,cjs,d.ts}",
|
|
81
|
+
"pretest": "yarn build:peggy",
|
|
82
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
|
|
83
|
+
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'",
|
|
84
|
+
"lint": "eslint --ext ts src",
|
|
85
|
+
"predoc": "yarn build:peggy",
|
|
86
|
+
"doc": "typedoc"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@rollup/plugin-replace": "^4.0.0",
|
|
90
|
+
"@types/jest": "^28.1.6",
|
|
91
|
+
"@types/jest-specific-snapshot": "^0.5.6",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
93
|
+
"@typescript-eslint/parser": "^5.33.0",
|
|
94
|
+
"eslint": "^8.22.0",
|
|
95
|
+
"eslint-config-prettier": "^8.5.0",
|
|
96
|
+
"eslint-plugin-import": "^2.26.0",
|
|
97
|
+
"eslint-plugin-jest": "^26.8.2",
|
|
98
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
99
|
+
"jest": "^28.1.3",
|
|
100
|
+
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
101
|
+
"jest-specific-snapshot": "^5.0.0",
|
|
102
|
+
"peggy": "^2.0.1",
|
|
103
|
+
"prettier": "^2.7.1",
|
|
104
|
+
"prettier-plugin-pegjs": "^0.5.0",
|
|
105
|
+
"rollup": "^2.77.3",
|
|
106
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
107
|
+
"rollup-plugin-dts": "^4.2.2",
|
|
108
|
+
"svgo": "^2.8.0",
|
|
109
|
+
"ts-jest": "^28.0.7",
|
|
110
|
+
"ts-pegjs": "^2.1.0",
|
|
111
|
+
"typedoc": "^0.23.15",
|
|
112
|
+
"typescript": "^4.7.4"
|
|
43
113
|
}
|
|
44
|
-
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"engines": {
|
|
47
|
-
"node": ">=14.16"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"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",
|
|
51
|
-
"prebuild": "yarn build:peggy",
|
|
52
|
-
"build": "tsc -p tsconfig.build.json && rollup -c",
|
|
53
|
-
"postbuild": "prettier --write ./lib/**/index.{js,cjs,d.ts}",
|
|
54
|
-
"pretest": "yarn build:peggy",
|
|
55
|
-
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
|
|
56
|
-
"format": "eslint --ext ts src --fix && prettier --write './**/*.{ts,js,json,yaml}' '!lib'",
|
|
57
|
-
"lint": "eslint --ext ts src",
|
|
58
|
-
"predoc": "yarn build:peggy",
|
|
59
|
-
"doc": "typedoc"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@rollup/plugin-replace": "^4.0.0",
|
|
63
|
-
"@types/jest": "^28.1.6",
|
|
64
|
-
"@types/jest-specific-snapshot": "^0.5.6",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
66
|
-
"@typescript-eslint/parser": "^5.33.0",
|
|
67
|
-
"eslint": "^8.22.0",
|
|
68
|
-
"eslint-config-prettier": "^8.5.0",
|
|
69
|
-
"eslint-plugin-import": "^2.26.0",
|
|
70
|
-
"eslint-plugin-jest": "^26.8.2",
|
|
71
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
72
|
-
"jest": "^28.1.3",
|
|
73
|
-
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
74
|
-
"jest-specific-snapshot": "^5.0.0",
|
|
75
|
-
"peggy": "^2.0.1",
|
|
76
|
-
"prettier": "^2.7.1",
|
|
77
|
-
"prettier-plugin-pegjs": "^0.5.0",
|
|
78
|
-
"rollup": "^2.77.3",
|
|
79
|
-
"rollup-plugin-delete": "^2.0.0",
|
|
80
|
-
"rollup-plugin-dts": "^4.2.2",
|
|
81
|
-
"svgo": "^2.8.0",
|
|
82
|
-
"ts-jest": "^28.0.7",
|
|
83
|
-
"ts-pegjs": "^2.1.0",
|
|
84
|
-
"typedoc": "^0.23.15",
|
|
85
|
-
"typescript": "^4.7.4"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
114
|
+
}
|