@datapos/datapos-development 0.3.220 â 0.3.222
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.
|
@@ -7650,7 +7650,7 @@ async function Nh() {
|
|
|
7650
7650
|
function Ne(e) {
|
|
7651
7651
|
const t = "\x1B[36m", i = "\x1B[0m", s = "â".repeat(e.length + 10);
|
|
7652
7652
|
console.info(`
|
|
7653
|
-
${t}${s}`), console.info(
|
|
7653
|
+
${t}${s}`), console.info(`âļī¸ ${e}`), console.info(`${s}${i}`);
|
|
7654
7654
|
}
|
|
7655
7655
|
function Ve(e) {
|
|
7656
7656
|
console.info(`
|
|
@@ -7659,7 +7659,7 @@ function Ve(e) {
|
|
|
7659
7659
|
}
|
|
7660
7660
|
function We(e) {
|
|
7661
7661
|
console.info(`
|
|
7662
|
-
|
|
7662
|
+
${e}`);
|
|
7663
7663
|
}
|
|
7664
7664
|
async function St(e) {
|
|
7665
7665
|
return JSON.parse(await $.readFile(e, "utf8"));
|
|
@@ -7667,10 +7667,10 @@ async function St(e) {
|
|
|
7667
7667
|
async function li(e) {
|
|
7668
7668
|
return await $.readFile(e, "utf8");
|
|
7669
7669
|
}
|
|
7670
|
-
async function Ae(e, t = [],
|
|
7671
|
-
return We(
|
|
7672
|
-
Nr(
|
|
7673
|
-
|
|
7670
|
+
async function Ae(e, t, i = [], s = !1) {
|
|
7671
|
+
return We(`${e}. Spawn command: ${t} ${i.join(" ")}`), new Promise((a, o) => {
|
|
7672
|
+
Nr(t, i, { stdio: "inherit" }).on("close", (d) => {
|
|
7673
|
+
d === 0 || s ? a() : o(new Error(`${t} exited with code ${d}`));
|
|
7674
7674
|
});
|
|
7675
7675
|
});
|
|
7676
7676
|
}
|
|
@@ -7695,62 +7695,62 @@ async function Tr(e, t) {
|
|
|
7695
7695
|
}
|
|
7696
7696
|
async function $h() {
|
|
7697
7697
|
try {
|
|
7698
|
-
Ne("Build
|
|
7698
|
+
Ne("Build Project"), await Ae("", "vite", ["build"]), Ve("Project built.");
|
|
7699
7699
|
} catch (e) {
|
|
7700
|
-
console.error("â Error building
|
|
7700
|
+
console.error("â Error building project.", e), process.exit(1);
|
|
7701
7701
|
}
|
|
7702
7702
|
}
|
|
7703
7703
|
async function Uh(e = !1) {
|
|
7704
7704
|
try {
|
|
7705
|
-
Ne("Release
|
|
7705
|
+
Ne("Release Project");
|
|
7706
7706
|
const t = await St("package.json");
|
|
7707
|
-
await _r(t), await Lh(t), await Ae("vite", ["build"]), await _e("git", ["add", "."]), await _e("git", ["commit", "-m", `"v${t.version}"`]), await _e("git", ["push", "origin", "main:main"]), await Ae("npm", ["publish", "--access", "public"]), Ve(`
|
|
7707
|
+
await _r(t), await Lh(t), await Ae("1ī¸âŖ Bundle project.", "vite", ["build"]), await _e("git", ["add", "."]), await _e("git", ["commit", "-m", `"v${t.version}"`]), await _e("git", ["push", "origin", "main:main"]), await Ae("", "npm", ["publish", "--access", "public"]), Ve(`Project version ${t.version} released.`);
|
|
7708
7708
|
} catch (t) {
|
|
7709
|
-
console.error("â Error releasing
|
|
7709
|
+
console.error("â Error releasing project.", t), process.exit(1);
|
|
7710
7710
|
}
|
|
7711
7711
|
}
|
|
7712
7712
|
async function Zh() {
|
|
7713
7713
|
try {
|
|
7714
|
-
Ne("Synchronise
|
|
7714
|
+
Ne("Synchronise Project with GitHub");
|
|
7715
7715
|
const e = await St("package.json");
|
|
7716
|
-
We("Bump
|
|
7716
|
+
We("Bump project version"), await _r(e), await _e("git", ["add", "."]), await _e("git", ["commit", "-m", `"v${e.version}"`]), await _e("git", ["push", "origin", "main:main"]), Ve(`Project version ${e.version} synchronised with GitHub.`);
|
|
7717
7717
|
} catch (e) {
|
|
7718
|
-
console.error("â Error synchronising
|
|
7718
|
+
console.error("â Error synchronising project with GitHub.", e), process.exit(1);
|
|
7719
7719
|
}
|
|
7720
7720
|
}
|
|
7721
7721
|
function qh() {
|
|
7722
7722
|
try {
|
|
7723
|
-
Ne("Test
|
|
7724
|
-
â Test
|
|
7723
|
+
Ne("Test Project"), console.log(`
|
|
7724
|
+
â Test project is not implemented. No 'vitest' command.
|
|
7725
7725
|
`);
|
|
7726
7726
|
} catch (e) {
|
|
7727
|
-
console.error("â Error testing
|
|
7727
|
+
console.error("â Error testing project.", e), process.exit(1);
|
|
7728
7728
|
}
|
|
7729
7729
|
}
|
|
7730
7730
|
async function Lh(e) {
|
|
7731
|
-
We("Build
|
|
7731
|
+
We("Build project configuration");
|
|
7732
7732
|
const t = await St("config.json");
|
|
7733
7733
|
e.name != null && (t.id = e.name.replace("@datapos/", "").replace("@data-positioning/", "")), e.version != null && (t.version = e.version), await di("config.json", t), console.info("â
Configuration built.");
|
|
7734
7734
|
}
|
|
7735
7735
|
async function _r(e, t = "./") {
|
|
7736
|
-
if (We("Bump
|
|
7737
|
-
e.version = "0.0.001", console.warn(`â ī¸
|
|
7736
|
+
if (We("Bump project version"), e.version == null)
|
|
7737
|
+
e.version = "0.0.001", console.warn(`â ī¸ Project version initialised to ${e.version}.`), await di(`${t}package.json`, e);
|
|
7738
7738
|
else {
|
|
7739
7739
|
const i = e.version, s = e.version.split(".");
|
|
7740
|
-
e.version = `${s[0]}.${s[1]}.${Number(s[2]) + 1}`, console.info(`âšī¸
|
|
7740
|
+
e.version = `${s[0]}.${s[1]}.${Number(s[2]) + 1}`, console.info(`âšī¸ Project version bumped from ${i} to ${e.version}.`), await di(`${t}package.json`, e);
|
|
7741
7741
|
}
|
|
7742
7742
|
}
|
|
7743
7743
|
const Oh = ["critical", "high", "moderate", "low", "unknown"];
|
|
7744
7744
|
async function Hh() {
|
|
7745
7745
|
try {
|
|
7746
|
-
Ne("Audit Dependencies"), await Nh(), await Ae("owasp-dependency-check", [
|
|
7746
|
+
Ne("Audit Dependencies"), await Nh(), await Ae("", "owasp-dependency-check", [
|
|
7747
7747
|
"--project",
|
|
7748
7748
|
"@datapos/datapos-development",
|
|
7749
7749
|
"--enableRetired",
|
|
7750
7750
|
"--nodePackageSkipDevDependencies",
|
|
7751
7751
|
"--nvdApiKey",
|
|
7752
7752
|
process.env.NVD_API_KEY ?? ""
|
|
7753
|
-
]), We("Insert OWASP Badge(s) into 'README.md'"), await Mh(), await Ae("npm", ["audit"]), Ve("Dependency auditing complete.");
|
|
7753
|
+
]), We("Insert OWASP Badge(s) into 'README.md'"), await Mh(), await Ae("", "npm", ["audit"]), Ve("Dependency auditing complete.");
|
|
7754
7754
|
} catch (e) {
|
|
7755
7755
|
console.error("â Error auditing dependencies.", e), process.exit(1);
|
|
7756
7756
|
}
|
|
@@ -7801,7 +7801,7 @@ async function Rh(e) {
|
|
|
7801
7801
|
}
|
|
7802
7802
|
async function Wh() {
|
|
7803
7803
|
try {
|
|
7804
|
-
Ne("Check Dependencies"), await Ae("npm", ["outdated"], !0), await Ae("npm-check-updates", ["-i"]), Ve("Dependency checking complete.");
|
|
7804
|
+
Ne("Check Dependencies"), await Ae("", "npm", ["outdated"], !0), await Ae("", "npm-check-updates", ["-i"]), Ve("Dependency checking complete.");
|
|
7805
7805
|
} catch (e) {
|
|
7806
7806
|
console.error("â Error checking dependencies.", e), process.exit(1);
|
|
7807
7807
|
}
|
|
@@ -7841,14 +7841,14 @@ async function Dh() {
|
|
|
7841
7841
|
}
|
|
7842
7842
|
async function Gh() {
|
|
7843
7843
|
try {
|
|
7844
|
-
Ne("Format Code"), await Ae("prettier", ["--write", "src/"]), Ve("Code formatting complete.");
|
|
7844
|
+
Ne("Format Code"), await Ae("", "prettier", ["--write", "src/"]), Ve("Code formatting complete.");
|
|
7845
7845
|
} catch (e) {
|
|
7846
7846
|
console.error("â Error formatting code.", e), process.exit(1);
|
|
7847
7847
|
}
|
|
7848
7848
|
}
|
|
7849
7849
|
async function Jh() {
|
|
7850
7850
|
try {
|
|
7851
|
-
Ne("Lint Code"), await Ae("eslint", ["."]), Ve("Code linting complete.");
|
|
7851
|
+
Ne("Lint Code"), await Ae("", "eslint", ["."]), Ve("Code linting complete.");
|
|
7852
7852
|
} catch (e) {
|
|
7853
7853
|
console.error("â Error linting code.", e), process.exit(1);
|
|
7854
7854
|
}
|
|
@@ -7857,7 +7857,7 @@ async function Xh(e) {
|
|
|
7857
7857
|
try {
|
|
7858
7858
|
Ne("Update datapos Dependencies");
|
|
7859
7859
|
for (const t of e)
|
|
7860
|
-
await Ae("npm", ["install", `@datapos/datapos-${t}@latest`]);
|
|
7860
|
+
await Ae("", "npm", ["install", `@datapos/datapos-${t}@latest`]);
|
|
7861
7861
|
Ve("Updating datapos dependencies complete.");
|
|
7862
7862
|
} catch (t) {
|
|
7863
7863
|
console.error("â Error updating datapos dependencies.", t), process.exit(1);
|
|
@@ -8039,20 +8039,20 @@ async function np(e) {
|
|
|
8039
8039
|
}
|
|
8040
8040
|
export {
|
|
8041
8041
|
Hh as auditDependencies,
|
|
8042
|
-
$h as buildArtifact,
|
|
8043
8042
|
Qh as buildConfig,
|
|
8044
8043
|
Yh as buildConnectorConfig,
|
|
8045
8044
|
ep as buildContextConfig,
|
|
8046
8045
|
tp as buildPresenterConfig,
|
|
8046
|
+
$h as buildProject,
|
|
8047
8047
|
ip as buildPublicDirectoryIndex,
|
|
8048
8048
|
Wh as checkDependencies,
|
|
8049
8049
|
Kh as documentDependencies,
|
|
8050
8050
|
Gh as formatCode,
|
|
8051
8051
|
Jh as lintCode,
|
|
8052
|
-
Uh as
|
|
8052
|
+
Uh as releaseProject,
|
|
8053
8053
|
sp as sendDeploymentNotice,
|
|
8054
|
-
Zh as
|
|
8055
|
-
qh as
|
|
8054
|
+
Zh as syncProjectWithGitHub,
|
|
8055
|
+
qh as testProject,
|
|
8056
8056
|
Xh as updateDataPosDependencies,
|
|
8057
8057
|
rp as uploadDirectoryToR2,
|
|
8058
8058
|
ap as uploadModuleConfigToDO,
|
|
@@ -11,7 +11,7 @@ declare function uploadDirectoryToR2(sourceDirectory: string, uploadDirectory: s
|
|
|
11
11
|
declare function uploadModuleConfigToDO(): Promise<void>;
|
|
12
12
|
declare function uploadModuleToR2(uploadDirectoryPath: string): Promise<void>;
|
|
13
13
|
export { buildConfig, buildConnectorConfig, buildContextConfig, buildPresenterConfig, buildPublicDirectoryIndex, sendDeploymentNotice, uploadDirectoryToR2, uploadModuleConfigToDO, uploadModuleToR2 };
|
|
14
|
-
export {
|
|
14
|
+
export { buildProject, releaseProject, syncProjectWithGitHub, testProject } from './operations/manageArtifact';
|
|
15
15
|
export { auditDependencies } from './operations/auditDependencies';
|
|
16
16
|
export { checkDependencies } from './operations/checkDependencies';
|
|
17
17
|
export { documentDependencies } from './operations/documentDependencies';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Manage
|
|
2
|
+
* Manage project operation.
|
|
3
3
|
*/
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
export {
|
|
4
|
+
declare function buildProject(): Promise<void>;
|
|
5
|
+
declare function releaseProject(sendDeployNotice?: boolean): Promise<void>;
|
|
6
|
+
declare function syncProjectWithGitHub(): Promise<void>;
|
|
7
|
+
declare function testProject(): void;
|
|
8
|
+
export { buildProject, releaseProject, syncProjectWithGitHub, testProject };
|
|
@@ -8,7 +8,7 @@ declare function logOperationSuccess(message: string): void;
|
|
|
8
8
|
declare function logStepHeader(text: string): void;
|
|
9
9
|
declare function readJSONFile<T>(path: string): Promise<T>;
|
|
10
10
|
declare function readTextFile(path: string): Promise<string>;
|
|
11
|
-
declare function spawnCommand(command: string, arguments_?: string[], ignoreErrors?: boolean): Promise<void>;
|
|
11
|
+
declare function spawnCommand(label: string, command: string, arguments_?: string[], ignoreErrors?: boolean): Promise<void>;
|
|
12
12
|
declare function writeJSONFile(path: string, data: object): Promise<void>;
|
|
13
13
|
declare function writeTextFile(path: string, data: string): Promise<void>;
|
|
14
14
|
export { determineConnectorUsageId, execCommand, extractOperationsFromSource, loadEnvironmentVariables, logOperationHeader, logOperationSuccess, logStepHeader, readJSONFile, readTextFile, spawnCommand, writeJSONFile, writeTextFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-development",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.222",
|
|
4
4
|
"description": "A library of utilities for managing the Data Positioning repositories.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"audit": "node -e \"import('./dist/datapos-development.es.js').then(m => m.auditDependencies())\"",
|
|
63
|
-
"build": "node -e \"import('./dist/datapos-development.es.js').then(m => m.
|
|
63
|
+
"build": "node -e \"import('./dist/datapos-development.es.js').then(m => m.buildProject())\"",
|
|
64
64
|
"check": "node -e \"import('./dist/datapos-development.es.js').then(m => m.checkDependencies())\"",
|
|
65
65
|
"document": "node -e \"import('./dist/datapos-development.es.js').then(m => m.documentDependencies(['BSD-2-Clause','MIT']))\"",
|
|
66
66
|
"format": "node -e \"import('./dist/datapos-development.es.js').then(m => m.formatCode())\"",
|
|
67
67
|
"lint": "node -e \"import('./dist/datapos-development.es.js').then(m => m.lintCode())\"",
|
|
68
|
-
"release": "node -e \"import('./dist/datapos-development.es.js').then(m => m.
|
|
69
|
-
"sync": "node -e \"import('./dist/datapos-development.es.js').then(m => m.
|
|
70
|
-
"test": "node -e \"import('./dist/datapos-development.es.js').then(m => m.
|
|
68
|
+
"release": "node -e \"import('./dist/datapos-development.es.js').then(m => m.releaseProject())\"",
|
|
69
|
+
"sync": "node -e \"import('./dist/datapos-development.es.js').then(m => m.syncProjectWithGitHub())\"",
|
|
70
|
+
"test": "node -e \"import('./dist/datapos-development.es.js').then(m => m.testProject())\"",
|
|
71
71
|
"update:dataPosDeps": "node -e \"import('./dist/datapos-development.es.js').then(m => m.updateDataPosDependencies(['shared']))\""
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|