@datapos/datapos-development 0.3.40 → 0.3.42

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.
@@ -1,65 +1,77 @@
1
- import { promises as n } from "fs";
2
- const f = ["createObject", "dropObject", "removeRecords", "upsertRecords"], u = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"];
3
- async function p() {
1
+ import { exec as u } from "child_process";
2
+ import { promises as i } from "fs";
3
+ import { promisify as d } from "util";
4
+ const p = ["createObject", "dropObject", "removeRecords", "upsertRecords"], m = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], f = d(u);
5
+ async function S() {
4
6
  try {
5
7
  console.log("🚀 Building connector configuration...");
6
- const o = JSON.parse(await n.readFile("package.json", "utf8")), e = JSON.parse(await n.readFile("config.json", "utf8")), t = await n.readFile("src/index.ts", "utf8");
8
+ const o = JSON.parse(await i.readFile("package.json", "utf8")), e = JSON.parse(await i.readFile("config.json", "utf8")), t = await i.readFile("src/index.ts", "utf8");
7
9
  let r = !1, s = !1;
8
- const i = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, c = [...t.matchAll(i)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => {
10
+ const n = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, c = [...t.matchAll(n)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => {
9
11
  const g = a[2];
10
- return r = r || f.includes(g), s = s || u.includes(g), g;
12
+ return r = r || p.includes(g), s = s || m.includes(g), g;
11
13
  });
12
14
  c.length > 0 ? console.log(`â„šī¸ Implements ${c.length} operations.`) : console.log("âš ī¸ Implements no operations.");
13
15
  const l = s && r ? "bidirectional" : s ? "source" : r ? "destination" : null;
14
- console.log(l ? `â„šī¸ Supports ${l} usage.` : "âš ī¸ No usage identified."), o.name && (e.id = o.name), e.operations = c, e.usageId = l, o.version && (e.version = o.version), await n.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8"), console.log("✅ Connector configuration built.");
16
+ console.log(l ? `â„šī¸ Supports ${l} usage.` : "âš ī¸ No usage identified."), o.name && (e.id = o.name), e.operations = c, e.usageId = l, o.version && (e.version = o.version), await i.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8"), console.log("✅ Connector configuration built.");
15
17
  } catch (o) {
16
18
  console.warn("❌ Error building connector configuration.", o);
17
19
  }
18
20
  }
19
- async function v() {
21
+ async function N() {
20
22
  try {
21
23
  console.log("🚀 Building context configuration...");
22
- const o = JSON.parse(await n.readFile("package.json", "utf8")), e = JSON.parse(await n.readFile("config.json", "utf8")), t = await n.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((i) => !i[1] && i[2] !== "constructor").map((i) => i[2]);
23
- o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await n.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
24
+ const o = JSON.parse(await i.readFile("package.json", "utf8")), e = JSON.parse(await i.readFile("config.json", "utf8")), t = await i.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
25
+ o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await i.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
24
26
  } catch (o) {
25
27
  console.warn("❌ Error building context configuration.", o);
26
28
  }
27
29
  }
28
- async function w() {
30
+ async function y() {
29
31
  try {
30
32
  console.log("🚀 Building informer configuration...");
31
- const o = JSON.parse(await n.readFile("package.json", "utf8")), e = JSON.parse(await n.readFile("config.json", "utf8")), t = await n.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((i) => !i[1] && i[2] !== "constructor").map((i) => i[2]);
32
- o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await n.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
33
+ const o = JSON.parse(await i.readFile("package.json", "utf8")), e = JSON.parse(await i.readFile("config.json", "utf8")), t = await i.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
34
+ o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await i.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
33
35
  } catch (o) {
34
36
  console.warn("❌ Error building informer configuration.", o);
35
37
  }
36
38
  }
37
- async function m() {
39
+ async function b() {
38
40
  try {
39
41
  console.log("🚀 Building presenter configuration...");
40
- const o = JSON.parse(await n.readFile("package.json", "utf8")), e = JSON.parse(await n.readFile("config.json", "utf8")), t = await n.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((i) => !i[1] && i[2] !== "constructor").map((i) => i[2]);
41
- o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await n.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
42
+ const o = JSON.parse(await i.readFile("package.json", "utf8")), e = JSON.parse(await i.readFile("config.json", "utf8")), t = await i.readFile("src/index.ts", "utf8"), r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, s = [...t.matchAll(r)].filter((n) => !n[1] && n[2] !== "constructor").map((n) => n[2]);
43
+ o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await i.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8");
42
44
  } catch (o) {
43
45
  console.warn("❌ Error building context configuration.", o);
44
46
  }
45
47
  }
46
- async function O() {
48
+ async function J() {
47
49
  try {
48
50
  console.log("🚀 Bumping version...");
49
- const o = JSON.parse(await n.readFile("package.json", "utf8"));
51
+ const o = JSON.parse(await i.readFile("package.json", "utf8"));
50
52
  if (o.version) {
51
53
  const e = o.version, t = o.version.split(".");
52
- o.version = `${t[0]}.${t[1]}.${Number(t[2]) + 1}`, await n.writeFile("package.json", JSON.stringify(o, void 0, 4), "utf8"), console.log(`✅ Version bumped from ${e} to ${o.version}.`);
54
+ o.version = `${t[0]}.${t[1]}.${Number(t[2]) + 1}`, await i.writeFile("package.json", JSON.stringify(o, void 0, 4), "utf8"), console.log(`✅ Version bumped from ${e} to ${o.version}.`);
53
55
  } else
54
- o.version = "0.0.001", await n.writeFile("package.json", JSON.stringify(o, void 0, 4), "utf8"), console.log(`âš ī¸ Version initialised to ${o.version}.`);
56
+ o.version = "0.0.001", await i.writeFile("package.json", JSON.stringify(o, void 0, 4), "utf8"), console.log(`âš ī¸ Version initialised to ${o.version}.`);
55
57
  } catch (o) {
56
58
  console.warn("❌ Error bumping package version.", o);
57
59
  }
58
60
  }
61
+ async function h() {
62
+ try {
63
+ console.log("🚀 Synchronising with GitHub....");
64
+ const o = JSON.parse(await i.readFile("package.json", "utf8"));
65
+ await f("git add ."), await f(`git commit -m "v${o.version}"`), await f("git push origin main:main"), console.log(`✅ Synchronised version ${o.version} with GitHub.`);
66
+ } catch (o) {
67
+ console.warn("❌ Error synchronising with GitHub.", o);
68
+ }
69
+ }
59
70
  export {
60
- p as buildConnectorConfig,
61
- v as buildContextConfig,
62
- w as buildInformerConfig,
63
- m as buildPresenterConfig,
64
- O as bumpVersion
71
+ S as buildConnectorConfig,
72
+ N as buildContextConfig,
73
+ y as buildInformerConfig,
74
+ b as buildPresenterConfig,
75
+ J as bumpVersion,
76
+ h as syncWithGitHub
65
77
  };
@@ -6,3 +6,4 @@ export declare function buildContextConfig(): Promise<void>;
6
6
  export declare function buildInformerConfig(): Promise<void>;
7
7
  export declare function buildPresenterConfig(): Promise<void>;
8
8
  export declare function bumpVersion(): Promise<void>;
9
+ export declare function syncWithGitHub(): Promise<void>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "license": "MIT",
4
4
  "private": false,
5
5
  "type": "module",
6
- "version": "0.3.40",
6
+ "version": "0.3.42",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -38,7 +38,7 @@
38
38
  "scripts": {
39
39
  "audit": "npm audit",
40
40
  "build": "vite build",
41
- "bumpVersion": "node -e \"import('./index.js').then(m => m.bumpVersion())\"",
41
+ "bumpVersion": "node -e \"import('./dist/datapos-development.es.js').then(m => m.bumpVersion())\"",
42
42
  "check": "npm outdated; npm-check-updates -i && retire",
43
43
  "document": "license-report --only=prod,peer > LICENSES.json && license-report-check --source ./LICENSES.json --allowed 'MIT' --allowed 'n/a' --allowed 'Apache-2.0' --output=table",
44
44
  "format": "prettier --write *.ts",
@@ -49,4 +49,4 @@
49
49
  "test": "echo \"***** TEST SCRIPT NOT IMPLEMENTED. *****\"",
50
50
  "updateDependencies": "echo \"***** UPDATE DEPENDENCIES SCRIPT NOT IMPLEMENTED. *****\""
51
51
  }
52
- }
52
+ }