@thi.ng/dgraph-dot 1.0.7 → 2.0.3

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,7 +3,7 @@
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.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)
6
+ ## [2.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@2.0.2...@thi.ng/dgraph-dot@2.0.3) (2021-10-15)
7
7
 
8
8
  **Note:** Version bump only for package @thi.ng/dgraph-dot
9
9
 
@@ -11,9 +11,57 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # 0.1.0 (2020-04-03)
14
+ ## [2.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@2.0.1...@thi.ng/dgraph-dot@2.0.2) (2021-10-15)
15
15
 
16
+ **Note:** Version bump only for package @thi.ng/dgraph-dot
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph-dot@2.0.0...@thi.ng/dgraph-dot@2.0.1) (2021-10-13)
23
+
24
+ **Note:** Version bump only for package @thi.ng/dgraph-dot
25
+
26
+
27
+
28
+
29
+
30
+ # [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)
31
+
32
+
33
+ ### Build System
34
+
35
+ * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
36
+
37
+
38
+ ### BREAKING CHANGES
39
+
40
+ * discontinue CommonJS & UMD versions
41
+
42
+ - only ESM modules will be published from now on
43
+ - CJS obsolete due to ESM support in recent versions of node:
44
+ - i.e. launch NodeJS via:
45
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
46
+ - in the node REPL use `await import(...)` instead of `require()`
47
+ - UMD obsolete due to widespread browser support for ESM
48
+
49
+ Also:
50
+ - normalize/restructure/reorg all package.json files
51
+ - cleanup all build scripts, remove obsolete
52
+ - switch from mocha to @thi.ng/testament for all tests
53
+
54
+
55
+
56
+
57
+
58
+
59
+ ## [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)
60
+
61
+ **Note:** Version bump only for package @thi.ng/dgraph-dot
62
+
63
+ # 0.1.0 (2020-04-03)
16
64
 
17
- ### Features
65
+ ### Features
18
66
 
19
- * **dgraph-dot:** import as new pkg ([9671ced](https://github.com/thi-ng/umbrella/commit/9671ceda29b0cd0ebbedce449943eec5abeff882))
67
+ - **dgraph-dot:** import as new pkg ([9671ced](https://github.com/thi-ng/umbrella/commit/9671ceda29b0cd0ebbedce449943eec5abeff882))
package/README.md CHANGED
@@ -41,15 +41,24 @@ 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 Node.js REPL:
53
+
54
+ ```text
55
+ # with flag only for < v16
56
+ node --experimental-repl-await
47
57
 
48
- // UMD
49
- <script src="https://unpkg.com/@thi.ng/dgraph-dot/lib/index.umd.js" crossorigin></script>
58
+ > const dgraphDot = await import("@thi.ng/dgraph-dot");
50
59
  ```
51
60
 
52
- Package sizes (gzipped, pre-treeshake): ESM: 241 bytes / CJS: 292 bytes / UMD: 409 bytes
61
+ Package sizes (gzipped, pre-treeshake): ESM: 241 bytes
53
62
 
54
63
  ## Dependencies
55
64
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thi.ng/dgraph-dot",
3
- "version": "1.0.7",
3
+ "version": "2.0.3",
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.34",
43
- "@thi.ng/dot": "^1.2.37"
37
+ "@thi.ng/api": "^8.0.3",
38
+ "@thi.ng/dgraph": "^2.0.3",
39
+ "@thi.ng/dot": "^2.0.3"
40
+ },
41
+ "devDependencies": {
42
+ "@thi.ng/testament": "^0.1.3"
44
43
  },
45
- "files": [
46
- "*.js",
47
- "*.d.ts",
48
- "lib"
49
- ],
50
44
  "keywords": [
51
45
  "2d",
52
46
  "dependency",
@@ -60,10 +54,21 @@
60
54
  "publishConfig": {
61
55
  "access": "public"
62
56
  },
63
- "sideEffects": false,
57
+ "engines": {
58
+ "node": ">=12.7"
59
+ },
60
+ "files": [
61
+ "*.js",
62
+ "*.d.ts"
63
+ ],
64
+ "exports": {
65
+ ".": {
66
+ "import": "./index.js"
67
+ }
68
+ },
64
69
  "thi.ng": {
65
70
  "parent": "@thi.ng/dgraph",
66
71
  "year": 2020
67
72
  },
68
- "gitHead": "8ead409ded4bf8dceb0f24a538ba5ca00d07108d"
73
+ "gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
69
74
  }
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;;;;;;;;;;"}