@thi.ng/dgraph-dot 1.0.5 → 2.0.0

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/CHANGELOG.md CHANGED
@@ -3,89 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.4...@thi.ng/dgraph-dot@1.0.5) (2021-08-19)
6
+ # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.8...@thi.ng/dgraph-dot@2.0.0) (2021-10-12)
7
7
 
8
- **Note:** Version bump only for package @thi.ng/dgraph-dot
9
8
 
9
+ ### Build System
10
10
 
11
+ * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
11
12
 
12
13
 
14
+ ### BREAKING CHANGES
13
15
 
14
- ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.3...@thi.ng/dgraph-dot@1.0.4) (2021-08-17)
16
+ * discontinue CommonJS & UMD versions
15
17
 
16
- **Note:** Version bump only for package @thi.ng/dgraph-dot
18
+ - only ESM modules will be published from now on
19
+ - CJS obsolete due to ESM support in recent versions of node:
20
+ - i.e. launch NodeJS via:
21
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
22
+ - in the node REPL use `await import(...)` instead of `require()`
23
+ - UMD obsolete due to widespread browser support for ESM
17
24
 
25
+ Also:
26
+ - normalize/restructure/reorg all package.json files
27
+ - cleanup all build scripts, remove obsolete
28
+ - switch from mocha to @thi.ng/testament for all tests
18
29
 
19
30
 
20
31
 
21
32
 
22
- ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.2...@thi.ng/dgraph-dot@1.0.3) (2021-08-08)
23
33
 
24
- **Note:** Version bump only for package @thi.ng/dgraph-dot
25
34
 
35
+ ## [1.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.6...@thi.ng/dgraph-dot@1.0.7) (2021-08-22)
26
36
 
37
+ **Note:** Version bump only for package @thi.ng/dgraph-dot
27
38
 
39
+ # 0.1.0 (2020-04-03)
28
40
 
41
+ ### Features
29
42
 
30
- ## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@1.0.1...@thi.ng/dgraph-dot@1.0.2) (2021-08-08)
31
-
32
- **Note:** Version bump only for package @thi.ng/dgraph-dot
33
-
34
-
35
-
36
-
37
-
38
- ## [1.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.57...@thi.ng/dgraph-dot@1.0.1) (2021-08-08)
39
-
40
- **Note:** Version bump only for package @thi.ng/dgraph-dot
41
-
42
-
43
-
44
-
45
-
46
- ## [0.1.57](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.56...@thi.ng/dgraph-dot@0.1.57) (2021-08-04)
47
-
48
- **Note:** Version bump only for package @thi.ng/dgraph-dot
49
-
50
-
51
-
52
-
53
-
54
- ## [0.1.56](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.55...@thi.ng/dgraph-dot@0.1.56) (2021-08-04)
55
-
56
- **Note:** Version bump only for package @thi.ng/dgraph-dot
57
-
58
-
59
-
60
-
61
-
62
- ## [0.1.55](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.54...@thi.ng/dgraph-dot@0.1.55) (2021-07-27)
63
-
64
- **Note:** Version bump only for package @thi.ng/dgraph-dot
65
-
66
-
67
-
68
-
69
-
70
- ## [0.1.54](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.53...@thi.ng/dgraph-dot@0.1.54) (2021-07-01)
71
-
72
- **Note:** Version bump only for package @thi.ng/dgraph-dot
73
-
74
-
75
-
76
-
77
-
78
- ## [0.1.53](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@0.1.52...@thi.ng/dgraph-dot@0.1.53) (2021-06-08)
79
-
80
- **Note:** Version bump only for package @thi.ng/dgraph-dot
81
-
82
-
83
-
84
-
85
-
86
- # 0.1.0 (2020-04-03)
87
-
88
-
89
- ### Features
90
-
91
- * **dgraph-dot:** import as new pkg ([9671ced](https://github.com/thi-ng/umbrella/commit/9671ceda29b0cd0ebbedce449943eec5abeff882))
43
+ - **dgraph-dot:** import as new pkg ([9671ced](https://github.com/thi-ng/umbrella/commit/9671ceda29b0cd0ebbedce449943eec5abeff882))
package/README.md CHANGED
@@ -41,15 +41,23 @@ readme & source code for visualization options.
41
41
  yarn add @thi.ng/dgraph-dot
42
42
  ```
43
43
 
44
+ ES module import:
45
+
44
46
  ```html
45
- // ES module
46
- <script type="module" src="https://unpkg.com/@thi.ng/dgraph-dot?module" crossorigin></script>
47
+ <script type="module" src="https://cdn.skypack.dev/@thi.ng/dgraph-dot"></script>
48
+ ```
49
+
50
+ [Skypack documentation](https://docs.skypack.dev/)
51
+
52
+ For NodeJS (v14.6+):
53
+
54
+ ```text
55
+ node --experimental-specifier-resolution=node --experimental-repl-await
47
56
 
48
- // UMD
49
- <script src="https://unpkg.com/@thi.ng/dgraph-dot/lib/index.umd.js" crossorigin></script>
57
+ > const dgraphDot = await import("@thi.ng/dgraph-dot");
50
58
  ```
51
59
 
52
- Package sizes (gzipped, pre-treeshake): ESM: 241 bytes / CJS: 292 bytes / UMD: 409 bytes
60
+ Package sizes (gzipped, pre-treeshake): ESM: 241 bytes
53
61
 
54
62
  ## Dependencies
55
63
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thi.ng/dgraph-dot",
3
- "version": "1.0.5",
3
+ "version": "2.0.0",
4
4
  "description": "Customizable Graphviz DOT serialization for @thi.ng/dgraph",
5
+ "type": "module",
5
6
  "module": "./index.js",
6
- "main": "./lib/index.js",
7
- "umd:main": "./lib/index.umd.js",
8
7
  "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
@@ -24,29 +24,23 @@
24
24
  "author": "Karsten Schmidt <k+npm@thi.ng>",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
- "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
28
- "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
29
- "build:es6": "tsc --declaration",
30
- "build:test": "rimraf build && tsc -p test/tsconfig.json",
31
- "build:check": "tsc --isolatedModules --noEmit",
32
- "test": "mocha test",
33
- "cover": "nyc mocha test && nyc report --reporter=lcov",
34
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib",
35
- "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf *.js *.d.ts *.map doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
36
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
37
- "doc": "typedoc --excludePrivate --out doc --theme ../../tools/doc/typedoc-theme src/index.ts",
38
- "pub": "yarn build:release && yarn publish --access public"
31
+ "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
+ "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
+ "pub": "yarn build && yarn publish --access public",
34
+ "test": "testament test"
39
35
  },
40
36
  "dependencies": {
41
- "@thi.ng/api": "^7.1.9",
42
- "@thi.ng/dgraph": "^1.3.32",
43
- "@thi.ng/dot": "^1.2.37"
37
+ "@thi.ng/api": "^8.0.0",
38
+ "@thi.ng/dgraph": "^2.0.0",
39
+ "@thi.ng/dot": "^2.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@thi.ng/testament": "^0.1.0"
44
43
  },
45
- "files": [
46
- "*.js",
47
- "*.d.ts",
48
- "lib"
49
- ],
50
44
  "keywords": [
51
45
  "2d",
52
46
  "dependency",
@@ -60,10 +54,18 @@
60
54
  "publishConfig": {
61
55
  "access": "public"
62
56
  },
63
- "sideEffects": false,
57
+ "files": [
58
+ "*.js",
59
+ "*.d.ts"
60
+ ],
61
+ "exports": {
62
+ ".": {
63
+ "import": "./index.js"
64
+ }
65
+ },
64
66
  "thi.ng": {
65
67
  "parent": "@thi.ng/dgraph",
66
68
  "year": 2020
67
69
  },
68
- "gitHead": "2c2f921759dc30055f86795231fa1289ddb14a6e"
70
+ "gitHead": "9ac1344b38b565eb894306fbf72233b6c0b2d115"
69
71
  }
package/lib/index.js DELETED
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dot = require('@thi.ng/dot');
6
-
7
- const toDot = (src, opts) => {
8
- const nodes = {};
9
- const edges = [];
10
- const label = opts.label || opts.id;
11
- const spec = opts.spec;
12
- for (let n of src.nodes()) {
13
- const id = opts.id(n);
14
- nodes[id] = spec ? spec(n) : { label: label(n) };
15
- for (let d of src.immediateDependencies(n)) {
16
- edges.push({ src: id, dest: opts.id(d) });
17
- }
18
- }
19
- const graph = {
20
- attribs: opts.attribs,
21
- directed: true,
22
- edges,
23
- nodes,
24
- };
25
- return dot.serializeGraph(graph);
26
- };
27
-
28
- exports.toDot = toDot;
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../index.js"],"sourcesContent":null,"names":["serializeGraph"],"mappings":";;;;;;AASY,MAAC,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AACpC,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;AACrB,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;AACrB,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;AACxC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AAC3B,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE;AAC/B,QAAQ,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9B,QAAQ,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACzD,QAAQ,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE;AACpD,YAAY,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD,SAAS;AACT,KAAK;AACL,IAAI,MAAM,KAAK,GAAG;AAClB,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO;AAC7B,QAAQ,QAAQ,EAAE,IAAI;AACtB,QAAQ,KAAK;AACb,QAAQ,KAAK;AACb,KAAK,CAAC;AACN,IAAI,OAAOA,kBAAc,CAAC,KAAK,CAAC,CAAC;AACjC;;;;"}
package/lib/index.umd.js DELETED
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@thi.ng/dot")):"function"==typeof define&&define.amd?define(["exports","@thi.ng/dot"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).thi=e.thi||{},e.thi.ng=e.thi.ng||{},e.thi.ng.dgraphDot={}),e.thi.ng.dot)}(this,(function(e,t){"use strict";e.toDot=(e,i)=>{const o={},n=[],d=i.label||i.id,s=i.spec;for(let t of e.nodes()){const r=i.id(t);o[r]=s?s(t):{label:d(t)};for(let o of e.immediateDependencies(t))n.push({src:r,dest:i.id(o)})}const r={attribs:i.attribs,directed:!0,edges:n,nodes:o};return t.serializeGraph(r)},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../index.js"],"sourcesContent":null,"names":["serializeGraph"],"mappings":";;;;;;AASY,UAAC,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;IACpC,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;IACrB,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;IACrB,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC;IACxC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,IAAI,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,EAAE;IAC/B,QAAQ,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9B,QAAQ,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,QAAQ,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE;IACpD,YAAY,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtD,SAAS;IACT,KAAK;IACL,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,EAAE,IAAI,CAAC,OAAO;IAC7B,QAAQ,QAAQ,EAAE,IAAI;IACtB,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,KAAK,CAAC;IACN,IAAI,OAAOA,kBAAc,CAAC,KAAK,CAAC,CAAC;IACjC;;;;;;;;;;"}