@tahminator/pipeline 1.0.19 → 1.0.20
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/sonar/client.d.ts +9 -0
- package/dist/sonar/client.js +30 -0
- package/dist/sonar/index.d.ts +1 -9
- package/dist/sonar/index.js +1 -30
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { $ } from "bun";
|
|
2
|
+
import { isCmdAvailable } from "../utils/cmd";
|
|
3
|
+
/**
|
|
4
|
+
* @beta WIP
|
|
5
|
+
*/
|
|
6
|
+
export class SonarScannerClient {
|
|
7
|
+
opts;
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
this.opts = opts;
|
|
10
|
+
}
|
|
11
|
+
async runTests() {
|
|
12
|
+
await this.opts.run.runTestsCmd;
|
|
13
|
+
}
|
|
14
|
+
async uploadTests() {
|
|
15
|
+
if (!(await isCmdAvailable("sonar"))) {
|
|
16
|
+
console.log("Sonar is missing, installing globally via NPM...");
|
|
17
|
+
await $ `npm i -g @sonar/scan`;
|
|
18
|
+
}
|
|
19
|
+
const { auth, scan } = this.opts;
|
|
20
|
+
const args = [
|
|
21
|
+
`-Dsonar.host.url=${scan.hostUrl ?? "https://sonarcloud.io"}`,
|
|
22
|
+
`-Dsonar.token=${auth.token}`,
|
|
23
|
+
`-Dsonar.projectKey=${scan.projectKey}`,
|
|
24
|
+
`-Dsonar.organization=${scan.organization}`,
|
|
25
|
+
`-Dsonar.sources=${scan.sourceCodeDir}`,
|
|
26
|
+
...Object.entries(scan.additionalArgs ?? {}).map(([k, v]) => `-Dsonar.${k}=${v}`),
|
|
27
|
+
];
|
|
28
|
+
await $ `sonar ${args}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/sonar/index.d.ts
CHANGED
package/dist/sonar/index.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { isCmdAvailable } from "../utils/cmd";
|
|
3
|
-
/**
|
|
4
|
-
* @beta WIP
|
|
5
|
-
*/
|
|
6
|
-
export class SonarScannerClient {
|
|
7
|
-
opts;
|
|
8
|
-
constructor(opts) {
|
|
9
|
-
this.opts = opts;
|
|
10
|
-
}
|
|
11
|
-
async runTests() {
|
|
12
|
-
await this.opts.run.runTestsCmd;
|
|
13
|
-
}
|
|
14
|
-
async uploadTests() {
|
|
15
|
-
if (!(await isCmdAvailable("sonar"))) {
|
|
16
|
-
console.log("Sonar is missing, installing globally via NPM...");
|
|
17
|
-
await $ `npm i -g @sonar/scan`;
|
|
18
|
-
}
|
|
19
|
-
const { auth, scan } = this.opts;
|
|
20
|
-
const args = [
|
|
21
|
-
`-Dsonar.host.url=${scan.hostUrl ?? "https://sonarcloud.io"}`,
|
|
22
|
-
`-Dsonar.token=${auth.token}`,
|
|
23
|
-
`-Dsonar.projectKey=${scan.projectKey}`,
|
|
24
|
-
`-Dsonar.organization=${scan.organization}`,
|
|
25
|
-
`-Dsonar.sources=${scan.sourceCodeDir}`,
|
|
26
|
-
...Object.entries(scan.additionalArgs ?? {}).map(([k, v]) => `-Dsonar.${k}=${v}`),
|
|
27
|
-
];
|
|
28
|
-
await $ `sonar ${args}`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
export * from "./client";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Tahmid Ahmed",
|
|
5
5
|
"description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.20",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+https://github.com/tahminator/pipeline.git"
|
|
9
9
|
},
|