@datapos/datapos-development 0.3.62 → 0.3.64
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/README.md +19 -21
- package/dist/datapos-development.es.js +24 -30
- package/dist/types/src/index.d.ts +2 -2
- package/package.json +23 -7
package/README.md
CHANGED
|
@@ -36,13 +36,12 @@ The `src/index.ts' file exposes the following utilities:
|
|
|
36
36
|
| Name | Notes |
|
|
37
37
|
| ------------------------- | ------------------------------------------------------------------------ |
|
|
38
38
|
| buildConfig | Build the config.json file for the repository. |
|
|
39
|
-
| buildConnectorConfig |
|
|
40
|
-
| buildContextConfig |
|
|
41
|
-
| buildInformerConfig |
|
|
42
|
-
| buildPresenterConfig |
|
|
39
|
+
| buildConnectorConfig | Build the connector config.json file for the repository. |
|
|
40
|
+
| buildContextConfig | Build the context config.json file for the repository. |
|
|
41
|
+
| buildInformerConfig | Build the informer config.json file for the repository. |
|
|
42
|
+
| buildPresenterConfig | Build the presenter config.json file for the repository. |
|
|
43
43
|
| buildPublicDirectoryIndex | Build an index for the repositories public directory. |
|
|
44
44
|
| bumpVersion | Bump the repositories version number. |
|
|
45
|
-
| clearDirectory | Clear the specified directory. |
|
|
46
45
|
| sendDeploymentNotice | Send a deployment notice for the repository. |
|
|
47
46
|
| syncWithGitHub | Synchronise the local repository with the main GitHub repository. |
|
|
48
47
|
| uploadDirectoryToR2 | Upload a directory to Cloudflare R2 storage. |
|
|
@@ -54,22 +53,21 @@ The `src/index.ts' file exposes the following utilities:
|
|
|
54
53
|
The table below lists the repository management commands available in this project.
|
|
55
54
|
For detailed implementation, see the `scripts` section in the `package.json` file.
|
|
56
55
|
|
|
57
|
-
| Name
|
|
58
|
-
|
|
|
59
|
-
| audit
|
|
60
|
-
| build
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
| updateDependencies | alt+ctrl+shift+u | ❌ Not implemented. |
|
|
56
|
+
| Name | Key Code | Notes |
|
|
57
|
+
| ------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| audit | alt+ctrl+shift+a | Audit the project's dependencies for known security vulnerabilities. |
|
|
59
|
+
| build | alt+ctrl+shift+b | Build the package using Vite. |
|
|
60
|
+
| bump:version | alt+ctrl+shift+v | Increment patch version number. |
|
|
61
|
+
| check | alt+ctrl+shift+c | List outdated dependencies and run retire scanner. |
|
|
62
|
+
| document | alt+ctrl+shift+d | Identify licenses of the project's production and peer dependencies. See [LICENSES.json](./LICENSES.json). |
|
|
63
|
+
| format | alt+ctrl+shift+f | Enforce formatting style rules. |
|
|
64
|
+
| lint | alt+ctrl+shift+l | Check the code for errors and enforce coding style rules. |
|
|
65
|
+
| publish:toNPM | alt+ctrl+shift+p | Publish the package to npm. |
|
|
66
|
+
| release | alt+ctrl+shift+r | Bump version, synchronise local repository with the main GitHub repository and publish to npm. |
|
|
67
|
+
| send:deployNotice | alt+ctrl+shift+n | ❌ Not implemented. |
|
|
68
|
+
| sync:withGitHub | alt+ctrl+shift+s | Bump version and synchronise local repository with the main GitHub repository. |
|
|
69
|
+
| test | alt+ctrl+shift+t | ❌ Not implemented. |
|
|
70
|
+
| update:dataPosDeps | alt+ctrl+shift+u | Install the latest version of all Data Positioning dependencies. |
|
|
73
71
|
|
|
74
72
|
## Compliance
|
|
75
73
|
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { exec as m } from "child_process";
|
|
2
2
|
import { promises as n } from "fs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let e = "", i = crypto.getRandomValues(new Uint8Array(o |= 0));
|
|
7
|
-
for (; o--; )
|
|
8
|
-
e += y[i[o] & 63];
|
|
9
|
-
return e;
|
|
10
|
-
};
|
|
11
|
-
const h = ["createObject", "dropObject", "removeRecords", "upsertRecords"], v = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], p = w(m);
|
|
3
|
+
import { nanoid as w } from "nanoid";
|
|
4
|
+
import { promisify as y } from "util";
|
|
5
|
+
const b = ["createObject", "dropObject", "removeRecords", "upsertRecords"], v = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], u = y(m);
|
|
12
6
|
async function $() {
|
|
13
7
|
try {
|
|
14
8
|
console.info("🚀 Building configuration...");
|
|
@@ -31,11 +25,11 @@ async function J(o) {
|
|
|
31
25
|
try {
|
|
32
26
|
const d = await n.stat(c);
|
|
33
27
|
if (d.isDirectory()) {
|
|
34
|
-
const
|
|
35
|
-
f.push(g), await i(c,
|
|
28
|
+
const p = await n.readdir(c), g = { childCount: p.length, name: `${a}`, typeId: "folder" };
|
|
29
|
+
f.push(g), await i(c, p);
|
|
36
30
|
} else {
|
|
37
|
-
const
|
|
38
|
-
f.push(
|
|
31
|
+
const p = { id: w(), lastModifiedAt: d.mtimeMs, name: a, size: d.size, typeId: "object" };
|
|
32
|
+
f.push(p);
|
|
39
33
|
}
|
|
40
34
|
} catch (d) {
|
|
41
35
|
throw new Error(`Unable to get information for '${a}' in 'buildPublicDirectoryIndex'. ${String(d)}`);
|
|
@@ -59,7 +53,7 @@ async function j() {
|
|
|
59
53
|
let s = !1, t = !1;
|
|
60
54
|
const r = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, f = [...i.matchAll(r)].filter((a) => !a[1] && a[2] !== "constructor").map((a) => {
|
|
61
55
|
const c = a[2];
|
|
62
|
-
return s = s ||
|
|
56
|
+
return s = s || b.includes(c), t = t || v.includes(c), c;
|
|
63
57
|
});
|
|
64
58
|
f.length > 0 ? console.info(`ℹ️ Implements ${f.length} operations.`) : console.warn("⚠️ Implements no operations.");
|
|
65
59
|
const l = t && s ? "bidirectional" : t ? "source" : s ? "destination" : null;
|
|
@@ -95,7 +89,7 @@ async function C() {
|
|
|
95
89
|
console.error("❌ Error building context configuration.", o);
|
|
96
90
|
}
|
|
97
91
|
}
|
|
98
|
-
async function
|
|
92
|
+
async function k() {
|
|
99
93
|
try {
|
|
100
94
|
console.info("🚀 Bumping version...");
|
|
101
95
|
const o = JSON.parse(await n.readFile("package.json", "utf8"));
|
|
@@ -108,8 +102,8 @@ async function E() {
|
|
|
108
102
|
console.error("❌ Error bumping package version.", o);
|
|
109
103
|
}
|
|
110
104
|
}
|
|
111
|
-
function
|
|
112
|
-
console.error(`❌ ${o}
|
|
105
|
+
function E(o) {
|
|
106
|
+
console.error(`❌ ${o} script not implemented.`);
|
|
113
107
|
}
|
|
114
108
|
async function I() {
|
|
115
109
|
try {
|
|
@@ -129,23 +123,23 @@ async function R() {
|
|
|
129
123
|
try {
|
|
130
124
|
console.info("🚀 Synchronising with GitHub....");
|
|
131
125
|
const o = JSON.parse(await n.readFile("package.json", "utf8"));
|
|
132
|
-
await
|
|
126
|
+
await u("git add ."), await u(`git commit -m "v${o.version}"`), await u("git push origin main:main"), console.info(`✅ Synchronised version ${o.version} with GitHub.`);
|
|
133
127
|
} catch (o) {
|
|
134
128
|
console.error("❌ Error synchronising with GitHub.", o);
|
|
135
129
|
}
|
|
136
130
|
}
|
|
137
|
-
async function
|
|
131
|
+
async function P(o, e) {
|
|
138
132
|
try {
|
|
139
133
|
console.info("🚀 Uploading directory to R2....");
|
|
140
134
|
async function i(t, r, f) {
|
|
141
135
|
for (const l of f) {
|
|
142
136
|
const a = `${t}/${l}`, c = `${r}/${l}`;
|
|
143
137
|
if ((await n.stat(a)).isDirectory()) {
|
|
144
|
-
const
|
|
145
|
-
await i(a, c,
|
|
138
|
+
const p = await n.readdir(a);
|
|
139
|
+
await i(a, c, p);
|
|
146
140
|
} else {
|
|
147
141
|
console.info(`⚙️ Uploading '${t}/${l}'.`);
|
|
148
|
-
const
|
|
142
|
+
const p = `wrangler r2 object put "datapos-sample-data-eu/${r}/${l}" --file="${t}/${l}" --jurisdiction=eu --remote`, g = await u(p);
|
|
149
143
|
if (g.stderr) throw new Error(g.stderr);
|
|
150
144
|
}
|
|
151
145
|
}
|
|
@@ -156,7 +150,7 @@ async function A(o, e) {
|
|
|
156
150
|
console.error("❌ Error uploading directory to R2.", i);
|
|
157
151
|
}
|
|
158
152
|
}
|
|
159
|
-
async function
|
|
153
|
+
async function A() {
|
|
160
154
|
try {
|
|
161
155
|
console.info("🚀 Uploading module configuration....");
|
|
162
156
|
const o = JSON.parse(await n.readFile("config.json", "utf8")), e = o.id, i = {
|
|
@@ -170,10 +164,10 @@ async function P() {
|
|
|
170
164
|
console.error("❌ Error uploading module configuration.", o);
|
|
171
165
|
}
|
|
172
166
|
}
|
|
173
|
-
async function
|
|
167
|
+
async function B(o, e) {
|
|
174
168
|
try {
|
|
175
169
|
console.info("🚀 Uploading module to R2....");
|
|
176
|
-
const i = JSON.parse(await n.readFile("package.json", "utf8")), s = e.replace(/^(.*?\.)/, `$1v${i.version}.`), { stderr: t } = await
|
|
170
|
+
const i = JSON.parse(await n.readFile("package.json", "utf8")), s = e.replace(/^(.*?\.)/, `$1v${i.version}.`), { stderr: t } = await u(`wrangler r2 object put ${s} --file=dist/${o} --content-type application/javascript --jurisdiction=eu --remote`);
|
|
177
171
|
if (t) throw new Error(t);
|
|
178
172
|
console.info("✅ Module uploaded to R2.");
|
|
179
173
|
} catch (i) {
|
|
@@ -187,11 +181,11 @@ export {
|
|
|
187
181
|
F as buildInformerConfig,
|
|
188
182
|
C as buildPresenterConfig,
|
|
189
183
|
J as buildPublicDirectoryIndex,
|
|
190
|
-
|
|
191
|
-
|
|
184
|
+
k as bumpVersion,
|
|
185
|
+
E as echoScriptNotImplemented,
|
|
192
186
|
I as sendDeploymentNotice,
|
|
193
187
|
R as syncWithGitHub,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
188
|
+
P as uploadDirectoryToR2,
|
|
189
|
+
A as uploadModuleConfig,
|
|
190
|
+
B as uploadModuleToR2
|
|
197
191
|
};
|
|
@@ -8,10 +8,10 @@ declare function buildContextConfig(): Promise<void>;
|
|
|
8
8
|
declare function buildInformerConfig(): Promise<void>;
|
|
9
9
|
declare function buildPresenterConfig(): Promise<void>;
|
|
10
10
|
declare function bumpVersion(): Promise<void>;
|
|
11
|
-
declare function
|
|
11
|
+
declare function echoScriptNotImplemented(name: string): void;
|
|
12
12
|
declare function sendDeploymentNotice(): Promise<void>;
|
|
13
13
|
declare function syncWithGitHub(): Promise<void>;
|
|
14
14
|
declare function uploadDirectoryToR2(sourceDirectory: string, uploadDirectory: string): Promise<void>;
|
|
15
15
|
declare function uploadModuleConfig(): Promise<void>;
|
|
16
16
|
declare function uploadModuleToR2(fromPath: string, toPath: string): Promise<void>;
|
|
17
|
-
export { buildConfig, buildConnectorConfig, buildContextConfig, buildInformerConfig, buildPresenterConfig, buildPublicDirectoryIndex, bumpVersion,
|
|
17
|
+
export { buildConfig, buildConnectorConfig, buildContextConfig, buildInformerConfig, buildPresenterConfig, buildPublicDirectoryIndex, bumpVersion, echoScriptNotImplemented, sendDeploymentNotice, syncWithGitHub, uploadDirectoryToR2, uploadModuleConfig, uploadModuleToR2 };
|
package/package.json
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-development",
|
|
3
|
+
"version": "0.3.64",
|
|
4
|
+
"description": "A TypeScript library of utilities for managing the Data Positioning repositories.",
|
|
3
5
|
"license": "MIT",
|
|
6
|
+
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|
|
4
7
|
"private": false,
|
|
5
8
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
9
|
+
"homepage": "https://www.datapos.app",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/data-positioning/datapos-development.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/data-positioning/datapos-development/issues"
|
|
16
|
+
},
|
|
10
17
|
"module": "./dist/datapos-development.es.js",
|
|
18
|
+
"types": "./dist/types/src/index.d.ts",
|
|
11
19
|
"exports": {
|
|
12
20
|
".": {
|
|
13
21
|
"import": "./dist/datapos-development.es.js",
|
|
14
22
|
"types": "./dist/types/src/index.d.ts"
|
|
15
23
|
}
|
|
16
24
|
},
|
|
17
|
-
"
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
18
28
|
"devDependencies": {
|
|
19
29
|
"@datapos/datapos-shared": "^0.3.140",
|
|
20
30
|
"@types/node": "^24.10.0",
|
|
@@ -39,14 +49,20 @@
|
|
|
39
49
|
"build": "vite build",
|
|
40
50
|
"bump:version": "node -e \"import('./dist/datapos-development.es.js').then(m => m.bumpVersion())\"",
|
|
41
51
|
"check": "npm outdated; npm-check-updates -i && retire",
|
|
42
|
-
"document": "
|
|
52
|
+
"document": "npm run _document:licenceReport && npm run _document:licenceCheck",
|
|
43
53
|
"format": "prettier --write src/",
|
|
44
54
|
"lint": "eslint .",
|
|
45
55
|
"publish:toNPM": "npm publish --access public",
|
|
46
56
|
"release": "npm run sync:withGitHub && npm run build && npm run publish:toNPM",
|
|
47
57
|
"sync:withGitHub": "npm run bump:version && node -e \"import('./dist/datapos-development.es.js').then(m => m.syncWithGitHub())\"",
|
|
48
|
-
"test": "
|
|
58
|
+
"test": "node -e \"import('./dist/datapos-development.es.js').then(m => m.echoScriptNotImplemented('Test'))\"",
|
|
49
59
|
"update:dataPosDeps": "npm run _update:developDeps",
|
|
60
|
+
"_document:licenceReport": "license-report --only=prod,peer > LICENSES.json",
|
|
61
|
+
"_document:licenceCheck": "license-report-check --source ./LICENSES.json --allowed 'MIT' --allowed 'n/a' --allowed 'Apache-2.0' --output=table",
|
|
50
62
|
"_update:developDeps": "npm install --save-dev @datapos/datapos-development@latest"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=22.0.0",
|
|
66
|
+
"npm": ">=11.0.0"
|
|
51
67
|
}
|
|
52
68
|
}
|