dataiku-sdk 3.6.0 → 3.6.1
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/bin/dss.js +24 -9
- package/dist/build-metadata.json +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
package/bin/dss.js
CHANGED
|
@@ -25,18 +25,35 @@ const MINIMUM_BUN = JSON.parse(
|
|
|
25
25
|
readFileSync(fileURLToPath(new URL("../package.json", import.meta.url,),), "utf-8",),
|
|
26
26
|
).engines.bun.replace(/^>=/, "",);
|
|
27
27
|
|
|
28
|
+
/** Whether dotted version `actual` is >= `minimum` (numeric per part). */
|
|
29
|
+
function versionAtLeast(actual, minimum,) {
|
|
30
|
+
// Compare the release part only: canary builds print e.g. 1.4.3-canary.12+abc.
|
|
31
|
+
const a = actual.split(/[-+]/,)[0].split(".",).map(Number,);
|
|
32
|
+
const m = minimum.split(".",).map(Number,);
|
|
33
|
+
for (let i = 0; i < m.length; i++) {
|
|
34
|
+
if ((a[i] ?? 0) !== m[i]) return (a[i] ?? 0) > m[i];
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
if (!runningUnderBun) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
40
|
+
// Check before spawning: an old Bun may reject --no-env-file during argument
|
|
41
|
+
// parsing, before any launcher code could report a JSON error.
|
|
42
|
+
const probe = spawnSync("bun", ["--version",], { encoding: "utf-8", },);
|
|
43
|
+
const found = probe.error ? undefined : probe.stdout.trim();
|
|
44
|
+
const result = found !== undefined && versionAtLeast(found, MINIMUM_BUN,)
|
|
45
|
+
? spawnSync(
|
|
46
|
+
"bun",
|
|
47
|
+
["--no-env-file", fileURLToPath(import.meta.url,), ...process.argv.slice(2,),],
|
|
48
|
+
{ stdio: "inherit", env: process.env, },
|
|
49
|
+
)
|
|
50
|
+
: { error: new Error(found ? `Bun ${found} is older than ${MINIMUM_BUN}.` : "bun not found",), };
|
|
34
51
|
if (result.error) {
|
|
35
52
|
process.stdout.write(`${
|
|
36
53
|
JSON.stringify({
|
|
37
54
|
type: "error",
|
|
38
55
|
ok: false,
|
|
39
|
-
error:
|
|
56
|
+
error: `Unable to start the required Bun runtime: ${result.error.message}`,
|
|
40
57
|
code: "internal_error",
|
|
41
58
|
category: "internal",
|
|
42
59
|
exitCode: 2,
|
|
@@ -91,7 +108,6 @@ if (!runningUnderBun) {
|
|
|
91
108
|
// build revision; only a full lowercase hexadecimal revision is accepted, so an
|
|
92
109
|
// inherited or corrupt variable never stands in for packaged metadata.
|
|
93
110
|
if (usesDistCli) {
|
|
94
|
-
process.env.DSS_LOAD_SOURCE = "dist";
|
|
95
111
|
delete process.env.DSS_BUILD_REVISION;
|
|
96
112
|
try {
|
|
97
113
|
const metadata = await Bun.file(path.resolve(here, "../dist/build-metadata.json",),).json();
|
|
@@ -103,8 +119,7 @@ if (!runningUnderBun) {
|
|
|
103
119
|
// Dist without build metadata: provenance still reports dist source.
|
|
104
120
|
}
|
|
105
121
|
} else {
|
|
106
|
-
//
|
|
107
|
-
delete process.env.DSS_LOAD_SOURCE;
|
|
122
|
+
// Only a dist run may carry a build revision; never trust an inherited one.
|
|
108
123
|
delete process.env.DSS_BUILD_REVISION;
|
|
109
124
|
}
|
|
110
125
|
|
package/dist/build-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":1,"buildRevision":"
|
|
1
|
+
{"format":1,"buildRevision":"dae7b426ec392ff4a62bcf07fab199e02080a0f6"}
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "dataiku-sdk",
|
|
4
|
-
"version": "3.6.
|
|
4
|
+
"version": "3.6.1",
|
|
5
5
|
"description": "Dataiku DSS SDK and agent-oriented CLI for programmatic access to DSS REST APIs.",
|
|
6
6
|
"homepage": "https://github.com/clssck/dataiku-sdk",
|
|
7
7
|
"repository": "https://github.com/clssck/dataiku-sdk",
|