@stdy/cli 0.13.0 → 0.14.0
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 +2 -2
- package/package.json +6 -6
- package/steady.js +16 -8
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Steady
|
|
2
2
|
|
|
3
|
-
OpenAPI 3.0/3.1 mock server built to fast and reliable. Validates requests
|
|
4
|
-
and generates responses from schemas or examples.
|
|
3
|
+
OpenAPI 3.0/3.1 mock server built to fast and reliable. Validates requests
|
|
4
|
+
against specs and generates responses from schemas or examples.
|
|
5
5
|
|
|
6
6
|
Note: this project is still experiemental and not ready for production use.
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdy/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "OpenAPI 3 mock server. Validates SDKs against OpenAPI specs with clear error attribution.",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"node": ">=14.0.0"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@stdy/cli-linux-x64": "0.
|
|
33
|
-
"@stdy/cli-linux-arm64": "0.
|
|
34
|
-
"@stdy/cli-darwin-x64": "0.
|
|
35
|
-
"@stdy/cli-darwin-arm64": "0.
|
|
36
|
-
"@stdy/cli-win32-x64": "0.
|
|
32
|
+
"@stdy/cli-linux-x64": "0.14.0",
|
|
33
|
+
"@stdy/cli-linux-arm64": "0.14.0",
|
|
34
|
+
"@stdy/cli-darwin-x64": "0.14.0",
|
|
35
|
+
"@stdy/cli-darwin-arm64": "0.14.0",
|
|
36
|
+
"@stdy/cli-win32-x64": "0.14.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/steady.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const {
|
|
2
|
+
const { spawn } = require("child_process");
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const fs = require("fs");
|
|
5
|
+
const os = require("os");
|
|
5
6
|
|
|
6
7
|
const platform = process.platform;
|
|
7
8
|
const arch = process.arch;
|
|
@@ -56,11 +57,18 @@ if (!binPath) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
61
|
+
|
|
62
|
+
child.on("error", (err) => {
|
|
63
|
+
console.error(`Failed to start steady: ${err.message}`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
for (const sig of Object.keys(os.constants.signals)) {
|
|
68
|
+
try { process.on(sig, () => child.kill(sig)); } catch {}
|
|
66
69
|
}
|
|
70
|
+
|
|
71
|
+
child.on("exit", (code, signal) => {
|
|
72
|
+
if (signal) process.kill(process.pid, signal);
|
|
73
|
+
else process.exit(code ?? 0);
|
|
74
|
+
});
|