@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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
|
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 ||
|
|
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
|
|
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
|
|
21
|
+
async function N() {
|
|
20
22
|
try {
|
|
21
23
|
console.log("đ Building context configuration...");
|
|
22
|
-
const o = JSON.parse(await
|
|
23
|
-
o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await
|
|
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
|
|
30
|
+
async function y() {
|
|
29
31
|
try {
|
|
30
32
|
console.log("đ Building informer configuration...");
|
|
31
|
-
const o = JSON.parse(await
|
|
32
|
-
o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await
|
|
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
|
|
39
|
+
async function b() {
|
|
38
40
|
try {
|
|
39
41
|
console.log("đ Building presenter configuration...");
|
|
40
|
-
const o = JSON.parse(await
|
|
41
|
-
o.name && (e.id = o.name), e.operations = s, o.version && (e.version = o.version), await
|
|
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
|
|
48
|
+
async function J() {
|
|
47
49
|
try {
|
|
48
50
|
console.log("đ Bumping version...");
|
|
49
|
-
const o = JSON.parse(await
|
|
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
|
|
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
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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.
|
|
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('./
|
|
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
|
+
}
|