stepzen 0.9.33-beta.2 → 0.9.33-beta.7
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 +1 -15
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
- package/lib/commands/install.d.ts +0 -11
- package/lib/commands/install.js +0 -109
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ $ npm install -g stepzen
|
|
|
29
29
|
$ stepzen COMMAND
|
|
30
30
|
running command...
|
|
31
31
|
$ stepzen (-v|--version|version)
|
|
32
|
-
stepzen/0.9.33-beta.
|
|
32
|
+
stepzen/0.9.33-beta.7 darwin-x64 node-v14.17.1
|
|
33
33
|
$ stepzen --help [COMMAND]
|
|
34
34
|
USAGE
|
|
35
35
|
$ stepzen COMMAND
|
|
@@ -41,7 +41,6 @@ USAGE
|
|
|
41
41
|
* [`stepzen deploy DESTINATION`](#stepzen-deploy-destination)
|
|
42
42
|
* [`stepzen help [COMMAND]`](#stepzen-help-command)
|
|
43
43
|
* [`stepzen import SCHEMAS`](#stepzen-import-schemas)
|
|
44
|
-
* [`stepzen install`](#stepzen-install)
|
|
45
44
|
* [`stepzen list TYPE`](#stepzen-list-type)
|
|
46
45
|
* [`stepzen login`](#stepzen-login)
|
|
47
46
|
* [`stepzen logout`](#stepzen-logout)
|
|
@@ -96,19 +95,6 @@ OPTIONS
|
|
|
96
95
|
--dir=dir working directory
|
|
97
96
|
```
|
|
98
97
|
|
|
99
|
-
## `stepzen install`
|
|
100
|
-
|
|
101
|
-
install templates from stepzen
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
USAGE
|
|
105
|
-
$ stepzen install
|
|
106
|
-
|
|
107
|
-
OPTIONS
|
|
108
|
-
-h, --help show CLI help
|
|
109
|
-
--dir=dir working directory
|
|
110
|
-
```
|
|
111
|
-
|
|
112
98
|
## `stepzen list TYPE`
|
|
113
99
|
|
|
114
100
|
list your items
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.9.33-beta.
|
|
1
|
+
{"version":"0.9.33-beta.7","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"configurationsets":{"name":"configurationsets","type":"option","description":"Configurationsets to use","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"schema":{"name":"schema","type":"option","description":"Schema to use","required":true},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"destination","description":"destination","required":true}]},"import":{"id":"import","description":"import schemas from stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"working directory"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"schemas","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"endpoint":{"name":"endpoint","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"yes":{"name":"yes","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"directory","hidden":true}]},"lint":{"id":"lint","description":"stepzen lint","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"dir":{"name":"dir","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"list":{"id":"list","description":"list your items","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationsets","schemas"]}]},"login":{"id":"login","description":"log in to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"account":{"name":"account","type":"option","char":"a","hidden":true},"adminkey":{"name":"adminkey","type":"option","char":"k","hidden":true},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"logout":{"id":"logout","description":"log out of stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start":{"id":"start","description":"start stepzen dashboard","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"working directory"},"endpoint":{"name":"endpoint","type":"option","description":"Override workspace endpoint"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"no-console":{"name":"no-console","type":"boolean","hidden":true,"allowNo":false},"no-dashboard":{"name":"no-dashboard","type":"boolean","hidden":true,"allowNo":false},"no-init":{"name":"no-init","type":"boolean","hidden":true,"allowNo":false},"no-server":{"name":"no-server","type":"boolean","hidden":true,"allowNo":false},"no-validate":{"name":"no-validate","type":"boolean","hidden":true,"allowNo":false},"no-watcher":{"name":"no-watcher","type":"boolean","hidden":true,"allowNo":false},"port":{"name":"port","type":"option","default":5000}},"args":[]},"transpile":{"id":"transpile","description":"transpile a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"hide-output":{"name":"hide-output","type":"boolean","hidden":true,"allowNo":false},"inspect":{"name":"inspect","type":"boolean","char":"i","hidden":true,"allowNo":false},"inspect-after":{"name":"inspect-after","type":"boolean","hidden":true,"allowNo":false},"output-configuration":{"name":"output-configuration","type":"boolean","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"folder","required":true}]},"upload":{"id":"upload","description":"upload to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"dir":{"name":"dir","type":"option","description":"A directory to upload"},"file":{"name":"file","type":"option","description":"A file to upload"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationset","schema"]},{"name":"destination","description":"destination","required":true}]},"validate":{"id":"validate","description":"validate a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"folder","required":true}]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stepzen",
|
|
3
3
|
"description": "The StepZen CLI",
|
|
4
|
-
"version": "0.9.33-beta.
|
|
4
|
+
"version": "0.9.33-beta.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@oclif/command": "^1.8.0",
|
|
34
34
|
"@oclif/config": "^1.17.0",
|
|
35
35
|
"@oclif/plugin-help": "^3.2.0",
|
|
36
|
-
"@stepzen/dashboard": "0.1.
|
|
36
|
+
"@stepzen/dashboard": "0.1.29",
|
|
37
37
|
"@stepzen/sdk": "0.9.38",
|
|
38
|
-
"@stepzen/transpiler": "0.0.
|
|
38
|
+
"@stepzen/transpiler": "0.0.27",
|
|
39
39
|
"@types/archiver": "^3.1.1",
|
|
40
40
|
"@types/debug": "^4.1.6",
|
|
41
41
|
"@types/node-fetch": "^2.5.7",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"form-data": "^3.0.0",
|
|
55
55
|
"fs-extra": "^9.1.0",
|
|
56
56
|
"glob": "^7.1.7",
|
|
57
|
-
"graphql": "^15.
|
|
57
|
+
"graphql": "^15.7.2",
|
|
58
58
|
"inquirer": "^7.3.3",
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
|
-
"node-fetch": "^2.6.
|
|
60
|
+
"node-fetch": "^2.6.6",
|
|
61
61
|
"open": "^7.3.0",
|
|
62
|
-
"prettier": "^2.
|
|
62
|
+
"prettier": "^2.4.1",
|
|
63
63
|
"shelljs": "^0.8.4",
|
|
64
64
|
"throttle-debounce": "^3.0.1",
|
|
65
65
|
"tslib": "^1.14.1",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Command, flags } from '@oclif/command';
|
|
2
|
-
export default class Install extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
dir: flags.IOptionFlag<string | undefined>;
|
|
6
|
-
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
7
|
-
silent: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
8
|
-
};
|
|
9
|
-
static strict: boolean;
|
|
10
|
-
run(): Promise<void>;
|
|
11
|
-
}
|
package/lib/commands/install.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) 2020,2021, StepZen, Inc.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const chalk = require("chalk");
|
|
6
|
-
const cli_ux_1 = require("cli-ux");
|
|
7
|
-
const node_fetch_1 = require("node-fetch");
|
|
8
|
-
const fs = require("fs-extra");
|
|
9
|
-
const inquirer = require("inquirer");
|
|
10
|
-
const os = require("os");
|
|
11
|
-
const unzipper = require("unzipper");
|
|
12
|
-
const command_1 = require("@oclif/command");
|
|
13
|
-
const fs_1 = require("fs");
|
|
14
|
-
const util_1 = require("util");
|
|
15
|
-
const utils_1 = require("../shared/utils");
|
|
16
|
-
const { merge } = require('@stepzen/transpiler');
|
|
17
|
-
class Install extends command_1.Command {
|
|
18
|
-
async run() {
|
|
19
|
-
var e_1, _a;
|
|
20
|
-
const { argv, flags } = this.parse(Install);
|
|
21
|
-
const directory = utils_1.getDirectory(flags.dir);
|
|
22
|
-
let templates = '';
|
|
23
|
-
if (argv.length === 0) {
|
|
24
|
-
const response = await node_fetch_1.default('https://graphql-backend-dev-reeu4v5qla-uc.a.run.app/templates');
|
|
25
|
-
const list = await response.json();
|
|
26
|
-
const answers = await inquirer.prompt([
|
|
27
|
-
{
|
|
28
|
-
type: 'checkbox',
|
|
29
|
-
message: 'Please select which templates you would like to install',
|
|
30
|
-
name: 'templates',
|
|
31
|
-
choices: list.map((item) => ({
|
|
32
|
-
name: item.metadata.name,
|
|
33
|
-
value: item.name,
|
|
34
|
-
short: item.metadata.name,
|
|
35
|
-
})),
|
|
36
|
-
},
|
|
37
|
-
]);
|
|
38
|
-
templates = answers.templates.join(',');
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
templates = argv.join(',');
|
|
42
|
-
}
|
|
43
|
-
const writeFilePromise = util_1.promisify(fs_1.writeFile);
|
|
44
|
-
const downloadFile = (url, outputPath) => {
|
|
45
|
-
return node_fetch_1.default(url)
|
|
46
|
-
.then(x => x.arrayBuffer())
|
|
47
|
-
.then(x => writeFilePromise(outputPath, Buffer.from(x)));
|
|
48
|
-
};
|
|
49
|
-
const unzip = (from, to) => {
|
|
50
|
-
// eslint-disable-next-line new-cap
|
|
51
|
-
const stream = fs.createReadStream(from).pipe(unzipper.Parse());
|
|
52
|
-
return new Promise((resolve, reject) => {
|
|
53
|
-
stream.on('entry', (entry) => {
|
|
54
|
-
if (entry.type === 'Directory') {
|
|
55
|
-
fs.ensureDirSync(`${to}/${entry.path}`);
|
|
56
|
-
}
|
|
57
|
-
if (entry.path === 'index.graphql') {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const writeStream = fs.createWriteStream(`${to}/${entry.path}`);
|
|
61
|
-
return entry.pipe(writeStream);
|
|
62
|
-
});
|
|
63
|
-
stream.on('finish', () => resolve(null));
|
|
64
|
-
stream.on('error', (error) => reject(error));
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
cli_ux_1.default.action.start('downloading your schemas');
|
|
68
|
-
const tmp = `${os.tmpdir()}/stepzen-download-templates-${Date.now()}`;
|
|
69
|
-
await fs.ensureDir(tmp);
|
|
70
|
-
await fs.copy(directory, tmp);
|
|
71
|
-
await downloadFile(`https://graphql-backend-dev-reeu4v5qla-uc.a.run.app/download?templates=${templates}`, `${tmp}/download.zip`);
|
|
72
|
-
await unzip(`${tmp}/download.zip`, tmp);
|
|
73
|
-
await fs.remove(`${tmp}/download.zip`);
|
|
74
|
-
const output = `${os.tmpdir()}/stepzen-merged-output-${Date.now()}`;
|
|
75
|
-
try {
|
|
76
|
-
for (var _b = tslib_1.__asyncValues(templates.split(',')), _c; _c = await _b.next(), !_c.done;) {
|
|
77
|
-
const template = _c.value;
|
|
78
|
-
await merge(directory, {
|
|
79
|
-
name: template,
|
|
80
|
-
source: `${tmp}/${template}`,
|
|
81
|
-
}, {
|
|
82
|
-
output: output,
|
|
83
|
-
silent: true,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
88
|
-
finally {
|
|
89
|
-
try {
|
|
90
|
-
if (_c && !_c.done && (_a = _b.return)) await _a.call(_b);
|
|
91
|
-
}
|
|
92
|
-
finally { if (e_1) throw e_1.error; }
|
|
93
|
-
}
|
|
94
|
-
await fs.copy(output, directory);
|
|
95
|
-
await fs.remove(output);
|
|
96
|
-
await fs.remove(tmp);
|
|
97
|
-
cli_ux_1.default.action.stop();
|
|
98
|
-
console.log();
|
|
99
|
-
console.log(chalk.green(`Successfully installed ${templates.split(',').length} schemas`));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.default = Install;
|
|
103
|
-
Install.description = 'install templates from stepzen';
|
|
104
|
-
Install.flags = {
|
|
105
|
-
dir: command_1.flags.string({ description: 'working directory' }),
|
|
106
|
-
help: command_1.flags.help({ char: 'h' }),
|
|
107
|
-
silent: command_1.flags.boolean({ hidden: true }),
|
|
108
|
-
};
|
|
109
|
-
Install.strict = false;
|