@decohere/scaffold 0.0.1-dev.110 → 0.0.1-dev.111
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/commonjs/src/cli.js +2 -1
- package/commonjs/src/program.js +4 -4
- package/commonjs/src/webapi/postman/openapi-to-postman.js +44 -6
- package/es6/src/cli.js +2 -1
- package/es6/src/program.js +9 -5
- package/es6/src/webapi/postman/openapi-to-postman.js +4 -2
- package/package.json +3 -3
- package/types/src/program.d.ts +6 -1
package/commonjs/src/cli.js
CHANGED
package/commonjs/src/program.js
CHANGED
|
@@ -51,14 +51,14 @@ async function runCli(argv = process.argv) {
|
|
|
51
51
|
await createProgram().parseAsync(argv);
|
|
52
52
|
} catch (err) {
|
|
53
53
|
if (err instanceof _commander.CommanderError) {
|
|
54
|
-
|
|
54
|
+
return err.exitCode;
|
|
55
55
|
}
|
|
56
56
|
if (err instanceof _apiname.CreateCliError) {
|
|
57
57
|
console.error(`\n ${err.message}\n`);
|
|
58
|
-
|
|
58
|
+
return 1;
|
|
59
59
|
}
|
|
60
60
|
console.error(err);
|
|
61
|
-
|
|
61
|
+
return 1;
|
|
62
62
|
}
|
|
63
|
-
process.
|
|
63
|
+
return typeof process.exitCode === "number" ? process.exitCode : 0;
|
|
64
64
|
}
|
|
@@ -19,15 +19,53 @@ _export(exports, {
|
|
|
19
19
|
return openApiToPostmanCollection;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
23
|
+
if (typeof WeakMap !== "function") return null;
|
|
24
|
+
var cacheBabelInterop = new WeakMap();
|
|
25
|
+
var cacheNodeInterop = new WeakMap();
|
|
26
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
27
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
28
|
+
})(nodeInterop);
|
|
29
|
+
}
|
|
30
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
31
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
35
|
+
return {
|
|
36
|
+
default: obj
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
40
|
+
if (cache && cache.has(obj)) {
|
|
41
|
+
return cache.get(obj);
|
|
42
|
+
}
|
|
43
|
+
var newObj = {
|
|
44
|
+
__proto__: null
|
|
26
45
|
};
|
|
46
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
+
for(var key in obj){
|
|
48
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
49
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
50
|
+
if (desc && (desc.get || desc.set)) {
|
|
51
|
+
Object.defineProperty(newObj, key, desc);
|
|
52
|
+
} else {
|
|
53
|
+
newObj[key] = obj[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
newObj.default = obj;
|
|
58
|
+
if (cache) {
|
|
59
|
+
cache.set(obj, newObj);
|
|
60
|
+
}
|
|
61
|
+
return newObj;
|
|
27
62
|
}
|
|
28
|
-
function convertAsync(data, options) {
|
|
63
|
+
async function convertAsync(data, options) {
|
|
64
|
+
// Loaded here, not at the top: the converter pulls in about 700 modules (lodash, faker, ajv,
|
|
65
|
+
// …), which every scaffolder run paid for even with `--postman none`.
|
|
66
|
+
const { default: converter } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("openapi-to-postmanv2")));
|
|
29
67
|
return new Promise((resolve, reject)=>{
|
|
30
|
-
|
|
68
|
+
converter.convert({
|
|
31
69
|
type: "json",
|
|
32
70
|
data
|
|
33
71
|
}, options, (err, result)=>{
|
package/es6/src/cli.js
CHANGED
package/es6/src/program.js
CHANGED
|
@@ -28,19 +28,23 @@ export function createProgram() {
|
|
|
28
28
|
});
|
|
29
29
|
return program;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Runs the CLI and returns its exit code; the bin (`cli.ts`) exits with it. Returning instead
|
|
33
|
+
* of calling `process.exit` here lets tests run it in process: a run that finished after its
|
|
34
|
+
* test had timed out used to call `process.exit` in whichever test came next (#662).
|
|
35
|
+
*/ export async function runCli(argv = process.argv) {
|
|
32
36
|
try {
|
|
33
37
|
await createProgram().parseAsync(argv);
|
|
34
38
|
} catch (err) {
|
|
35
39
|
if (err instanceof CommanderError) {
|
|
36
|
-
|
|
40
|
+
return err.exitCode;
|
|
37
41
|
}
|
|
38
42
|
if (err instanceof CreateCliError) {
|
|
39
43
|
console.error(`\n ${err.message}\n`);
|
|
40
|
-
|
|
44
|
+
return 1;
|
|
41
45
|
}
|
|
42
46
|
console.error(err);
|
|
43
|
-
|
|
47
|
+
return 1;
|
|
44
48
|
}
|
|
45
|
-
process.
|
|
49
|
+
return typeof process.exitCode === "number" ? process.exitCode : 0;
|
|
46
50
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
async function convertAsync(data, options) {
|
|
2
|
+
// Loaded here, not at the top: the converter pulls in about 700 modules (lodash, faker, ajv,
|
|
3
|
+
// …), which every scaffolder run paid for even with `--postman none`.
|
|
4
|
+
const { default: converter } = await import("openapi-to-postmanv2");
|
|
3
5
|
return new Promise((resolve, reject)=>{
|
|
4
6
|
converter.convert({
|
|
5
7
|
type: "json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/scaffold",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.111",
|
|
4
4
|
"description": "Decohere project scaffolder (runs inside ghcr.io/typesmiths/decohere/create)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decohere",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@decohere/crucible": "0.0.1-dev.
|
|
26
|
-
"@decohere/nexus": "0.0.1-dev.
|
|
25
|
+
"@decohere/crucible": "0.0.1-dev.111",
|
|
26
|
+
"@decohere/nexus": "0.0.1-dev.111",
|
|
27
27
|
"commander": "^13.1.0",
|
|
28
28
|
"openapi-to-postmanv2": "^5.0.0",
|
|
29
29
|
"yaml": "^2.9.1"
|
package/types/src/program.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
export declare function createProgram(): Command;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Runs the CLI and returns its exit code; the bin (`cli.ts`) exits with it. Returning instead
|
|
5
|
+
* of calling `process.exit` here lets tests run it in process: a run that finished after its
|
|
6
|
+
* test had timed out used to call `process.exit` in whichever test came next (#662).
|
|
7
|
+
*/
|
|
8
|
+
export declare function runCli(argv?: string[]): Promise<number>;
|