@lionweb/cli 0.1.0-beta.0 → 0.5.0-beta.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 ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 0.5.0
4
+
5
+ * Configure single CLI entrypoint.
6
+
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # The `cli` package
2
+
3
+ An NPM package that can be added to a Node.js/NPM codebase as follows:
4
+
5
+ ```shell
6
+ $ npm add @lionweb/cli
7
+ ```
8
+ It exposes an executable for use with a CLI.
9
+ It works as follows:
10
+
11
+ ```shell
12
+ $ node dist/lionweb-cli.js <command> <arguments>
13
+ ```
14
+
15
+ (Turning this into a proper NPM CLI command is a TODO.)
16
+
17
+ Just running
18
+
19
+ ```shell
20
+ $ node dist/lionweb-cli.js
21
+ ```
22
+
23
+ produces information about which commands are available.
24
+
25
+ Build the executable from source as follows:
26
+
27
+ ```shell
28
+ $ ./build.sh
29
+ ```
30
+
31
+
32
+ ## Extracting essential information from a serialization chunk
33
+
34
+ Run the following command to make "extractions" from a serialization chunk (e.g.):
35
+
36
+ ```shell
37
+ node dist/lionweb-cli.js extract ../artifacts/chunks/languages/lioncore.json
38
+ ```
39
+
40
+ This is meant as a way to inspect, reason about, and compare serialization because the format is rather verbose.
41
+ These extractions are:
42
+
43
+ * A "sorted" JSON with:
44
+ * all nodes sorted by ID,
45
+ * for all nodes, their properties, containments, and references sorted by key (from the meta-pointer),
46
+ * and all containments and references sorted by ID.
47
+ * A "shortened" JSON where keys are used as key names.
48
+ * If the serialization represents a language - i.e.: a LionCore model - then a textual version is generated as well.
49
+
50
+ This CLI utility does not perform any explicit validation apart from the file at the given path existing and being valid JSON.
51
+ It does some implicit validation as it can error out on incorrect serializations.
52
+
package/build.sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env sh
2
+
3
+ rm -rf dist/ node_modules/ lionweb-cli-*.tgz
4
+ npm i
5
+ npm run build
6
+
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lionweb-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lionweb-cli.d.ts","sourceRoot":"","sources":["../src/lionweb-cli.ts"],"names":[],"mappings":""}
@@ -3,12 +3,13 @@ import { extractFromSerialization } from "./serialization-extractor.js";
3
3
  import { diagramFromSerialization } from "./m3/diagram-generator.js";
4
4
  const main = (args) => {
5
5
  if (args.length <= 2) {
6
- console.log(`lioncore-cli is a LionWeb utility around LionCore-TypeScript
6
+ console.log(`lionweb-cli is a LionWeb utility around LionWeb-TypeScript
7
7
 
8
- Usage: $ lioncore-cli <command> <arguments>
8
+ Usage: $ lionweb-cli <command> <arguments>
9
9
 
10
10
  Available commands are:
11
11
 
12
+ diagram
12
13
  extract
13
14
  `);
14
15
  return;
@@ -35,11 +36,11 @@ If the chunk is the serialization of a LionCore Language/M2, then a textual rend
35
36
  }
36
37
  return;
37
38
  }
38
- // TODO schema, Ecore import
39
+ // TODO generate schema, import Ecore
39
40
  default: {
40
41
  console.error(`command "${command}" is not recognized`);
41
42
  }
42
43
  }
43
44
  };
44
45
  main(argv);
45
- //# sourceMappingURL=lioncore-cli.js.map
46
+ //# sourceMappingURL=lionweb-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lionweb-cli.js","sourceRoot":"","sources":["../src/lionweb-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAA;AAGlE,MAAM,IAAI,GAAG,CAAC,IAAc,EAAC,EAAE;IAC3B,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QAClB,OAAO,CAAC,GAAG,CACnB;;;;;;;;CAQC,CACQ,CAAA;QACD,OAAM;KACT;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACvB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACjC,QAAQ,OAAO,EAAE;QAEb,KAAK,SAAS,CAAC,CAAC;YACZ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,OAAO,CAAC,GAAG,CACP,8GAA8G,CACjH,CAAA;aACJ;iBAAM;gBACH,WAAW,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;aAChD;YACD,OAAM;SACT;QAED,KAAK,SAAS,CAAC,CAAC;YACZ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAC3B;yGACyG,CACxF,CAAA;aACJ;iBAAM;gBACH,WAAW,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;aAChD;YACD,OAAM;SACT;QAED,sCAAsC;QAEtC,OAAO,CAAC,CAAC;YACL,OAAO,CAAC,KAAK,CAAC,YAAY,OAAO,qBAAqB,CAAC,CAAA;SAC1D;KACJ;AAEL,CAAC,CAAA;AAED,IAAI,CAAC,IAAI,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,24 +1,25 @@
1
1
  {
2
2
  "name": "@lionweb/cli",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.5.0-beta.3",
4
4
  "description": "LionWeb CLI for {Java|Type}Script",
5
+ "bin": "./dist/lionweb-cli.js",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
7
8
  "typings": "dist/index.d.ts",
8
9
  "type": "module",
9
- "license": "MIT",
10
+ "license": "Apache-2.0",
10
11
  "repository": {
11
12
  "type": "git",
12
- "url": "https://github.com/LionWeb-org/lioncore-typescript.git"
13
+ "url": "https://github.com/LionWeb-io/lionweb-typescript.git"
13
14
  },
14
15
  "bugs": {
15
- "url": "https://github.com/LionWeb-org/lioncore-typescript/issues"
16
+ "url": "https://github.com/LionWeb-io/lionweb-typescript/issues"
16
17
  },
17
18
  "devDependencies": {
18
- "@lionweb/core": "0.5.0-beta.0",
19
- "@lionweb/utilities": "0.1.0-beta.0",
20
- "@types/node": "^20.6.3",
21
- "typescript": "^5.2.2"
19
+ "@lionweb/core": "0.5.0-beta.3",
20
+ "@lionweb/utilities": "0.5.0-beta.3",
21
+ "@types/node": "20.6.3",
22
+ "typescript": "5.2.2"
22
23
  },
23
24
  "scripts": {
24
25
  "build": "tsc"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=lioncore-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lioncore-cli.d.ts","sourceRoot":"","sources":["../src/lioncore-cli.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lioncore-cli.js","sourceRoot":"","sources":["../src/lioncore-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,EAAC,wBAAwB,EAAC,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAA;AAGlE,MAAM,IAAI,GAAG,CAAC,IAAc,EAAC,EAAE;IAC3B,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QAClB,OAAO,CAAC,GAAG,CACnB;;;;;;;CAOC,CACQ,CAAA;QACD,OAAM;KACT;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACvB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACjC,QAAQ,OAAO,EAAE;QAEb,KAAK,SAAS,CAAC,CAAC;YACZ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,OAAO,CAAC,GAAG,CACP,8GAA8G,CACjH,CAAA;aACJ;iBAAM;gBACH,WAAW,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;aAChD;YACD,OAAM;SACT;QAED,KAAK,SAAS,CAAC,CAAC;YACZ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAC3B;yGACyG,CACxF,CAAA;aACJ;iBAAM;gBACH,WAAW,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;aAChD;YACD,OAAM;SACT;QAED,6BAA6B;QAE7B,OAAO,CAAC,CAAC;YACL,OAAO,CAAC,KAAK,CAAC,YAAY,OAAO,qBAAqB,CAAC,CAAA;SAC1D;KACJ;AAEL,CAAC,CAAA;AAED,IAAI,CAAC,IAAI,CAAC,CAAA"}