stepzen 0.9.36-beta.6 → 0.9.38-beta.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/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.36-beta.6 darwin-x64 node-v14.18.3
32
+ stepzen/0.9.38-beta.1 darwin-x64 node-v14.18.0
33
33
  $ stepzen --help [COMMAND]
34
34
  USAGE
35
35
  $ stepzen COMMAND
@@ -136,7 +136,7 @@ OPTIONS
136
136
 
137
137
  ## `stepzen start`
138
138
 
139
- start stepzen dashboard
139
+ upload and deploy your schema
140
140
 
141
141
  ```
142
142
  USAGE
@@ -24,7 +24,12 @@ class Import extends command_1.Command {
24
24
  workspace = await init_1.default.run([directory]);
25
25
  }
26
26
  // Make sure the user has latest Generator Schema
27
- await deploy_1.default.run([constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA, '--schema', 'stepzen/engines', '--silent']);
27
+ await deploy_1.default.run([
28
+ constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
29
+ '--schema',
30
+ constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
31
+ '--silent',
32
+ ]);
28
33
  // Let's go!
29
34
  const result = await generate_1.default(schemas, workspace.schema);
30
35
  // Validate
@@ -29,8 +29,14 @@ class Init extends command_1.Command {
29
29
  // See if we think there's a StepZen schema already
30
30
  let root;
31
31
  const existing = [
32
- ...glob.sync('*/**/config.yaml', { cwd: directory, ignore: '**/node_modules/**' }),
33
- ...glob.sync('*/**/index.graphql', { cwd: directory, ignore: '**/node_modules/**' }),
32
+ ...glob.sync('*/**/config.yaml', {
33
+ cwd: directory,
34
+ ignore: '**/node_modules/**',
35
+ }),
36
+ ...glob.sync('*/**/index.graphql', {
37
+ cwd: directory,
38
+ ignore: '**/node_modules/**',
39
+ }),
34
40
  ];
35
41
  if (existing.length > 0) {
36
42
  root = existing[0]
@@ -51,19 +51,21 @@ class Start extends command_1.Command {
51
51
  })
52
52
  .on('change', throttle_debounce_1.debounce(500, async (path) => {
53
53
  await utils_1.checkAuth();
54
- start_1.console(workspace, flags);
55
- start_1.deploy(path, workspace, flags);
54
+ utils_1.clearConsole();
55
+ await start_1.deploy(path, workspace, flags);
56
+ await start_1.console(workspace);
56
57
  }));
57
58
  }
58
59
  // Start!
60
+ utils_1.clearConsole();
59
61
  cli_ux_1.default.action.start('Starting...');
60
- if (!flags['no-console']) {
61
- start_1.console(workspace, flags);
62
- }
63
62
  // Unless explicitly disabled, auto-init
64
63
  if (!flags['no-init']) {
65
64
  await start_1.deploy(null, workspace, flags);
66
65
  }
66
+ if (!flags['no-console']) {
67
+ start_1.console(workspace);
68
+ }
67
69
  // Create the dashboard
68
70
  if (!flags['no-dashboard']) {
69
71
  const ui = await dashboard({
@@ -84,14 +86,13 @@ class Start extends command_1.Command {
84
86
  workspace,
85
87
  });
86
88
  await ui.start();
87
- await ui.open();
88
89
  }
89
90
  // Done
90
91
  cli_ux_1.default.action.stop();
91
92
  }
92
93
  }
93
94
  exports.default = Start;
94
- Start.description = 'start stepzen dashboard';
95
+ Start.description = 'upload and deploy your schema';
95
96
  Start.flags = {
96
97
  dir: command_1.flags.string({ description: 'working directory' }),
97
98
  endpoint: command_1.flags.string({ description: 'Override workspace endpoint' }),
@@ -9,9 +9,14 @@ const deploy_1 = require("../commands/deploy");
9
9
  const constants_1 = require("../shared/constants");
10
10
  const { merge } = require('@stepzen/transpiler');
11
11
  exports.createDashboardInterface = (workspace) => ({
12
- endpoint: constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
12
+ endpoint: constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
13
13
  onStart: async () => {
14
- await deploy_1.default.run([constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA, '--schema', 'stepzen/engines', '--silent']);
14
+ await deploy_1.default.run([
15
+ constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
16
+ '--schema',
17
+ constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
18
+ '--silent',
19
+ ]);
15
20
  },
16
21
  onImport: async (id, files) => {
17
22
  const tmp = path.join(os.tmpdir(), `stepzen-generated-schema-${Date.now()}`);
@@ -15,7 +15,7 @@ const { version } = require('../../package.json');
15
15
  exports.createGeneratorFiles = async (id, details) => {
16
16
  const config = configuration_1.readConfiguration();
17
17
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
18
- const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA}/__graphql`;
18
+ const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT}/__graphql`;
19
19
  const response = await node_fetch_1.default(url, {
20
20
  body: JSON.stringify({
21
21
  query: `
@@ -35,7 +35,7 @@ exports.createGeneratorFiles = async (id, details) => {
35
35
  },
36
36
  method: 'POST',
37
37
  });
38
- const { data: { create } } = await response.json();
38
+ const { data: { create }, } = await response.json();
39
39
  const tmp = path.join(os.tmpdir(), `stepzen-generated-schema-${Date.now()}`);
40
40
  fs.ensureDirSync(tmp);
41
41
  for (const file of create) {
@@ -47,7 +47,7 @@ exports.createGeneratorFiles = async (id, details) => {
47
47
  exports.getConfiguration = async (id, details = {}) => {
48
48
  const config = configuration_1.readConfiguration();
49
49
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
50
- const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA}/__graphql`;
50
+ const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT}/__graphql`;
51
51
  const response = await node_fetch_1.default(url, {
52
52
  body: JSON.stringify({
53
53
  query: `
@@ -70,11 +70,13 @@ exports.default = async (schemas, source) => {
70
70
  cli_ux_1.default.action.stop();
71
71
  console.log();
72
72
  // If you've tried to import non-existent templates, complain and exit
73
- const notFound = Object.entries(generators).map(([id, settings]) => {
73
+ const notFound = Object.entries(generators)
74
+ .map(([id, settings]) => {
74
75
  if (!settings)
75
76
  return id;
76
77
  return null;
77
- }).filter(i => i);
78
+ })
79
+ .filter(i => i);
78
80
  if (notFound.length > 0) {
79
81
  fs.removeSync(templates);
80
82
  throw new Error(`Cannot find the schema ${notFound[0]}`);
@@ -0,0 +1,3 @@
1
+ import { Hook } from '@oclif/config';
2
+ declare const hook: Hook<'prerun'>;
3
+ export default hook;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const constants_1 = require("../../shared/constants");
7
+ const constants_2 = require("../../shared/constants");
8
+ const hook = async function () {
9
+ // checking file existence and permissions (https://betterprogramming.pub/dbce0f2b373c)
10
+ const file = path.join(constants_2.STEPZEN_CONFIG_DIRECTORY, constants_1.STEPZEN_CONFIG_FILE);
11
+ try {
12
+ fs.accessSync(file, fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK);
13
+ const mode = fs.statSync(file).mode;
14
+ // https://stackoverflow.com/questions/50839744/how-to-interpret-the-number-returned-from-statsync
15
+ if (mode & (fs.constants.S_IRWXG | fs.constants.S_IRWXG))
16
+ fs.chmodSync(file, fs.constants.S_IRWXU);
17
+ }
18
+ catch (error) { }
19
+ };
20
+ exports.default = hook;
@@ -85,6 +85,6 @@ exports.writeConfigurationToLoginFile = (configuration) => {
85
85
  }
86
86
  // Write the configuration file. Overwrites if it already exists.
87
87
  const file = path.join(constants_1.STEPZEN_CONFIG_DIRECTORY, constants_1.STEPZEN_CONFIG_FILE);
88
- fs.writeFileSync(file, content);
88
+ fs.writeFileSync(file, content, { mode: '600' });
89
89
  return configuration;
90
90
  };
@@ -3,7 +3,8 @@ export declare const STEPZEN_CONFIG_DIRECTORY: string;
3
3
  export declare const STEPZEN_CONFIG_FILE: string;
4
4
  export declare const STEPZEN_DOMAIN: string;
5
5
  export declare const STEPZEN_SERVER_URL: string;
6
- export declare const STEPZEN_GENERATOR_ENGINES_SCHEMA = "stepzen-generator/engines";
6
+ export declare const STEPZEN_GENERATOR_ENGINES_SCHEMA: string;
7
+ export declare const STEPZEN_GENERATOR_ENGINES_ENDPOINT = "stepzen-generator/engines";
7
8
  export declare const STEPZEN_API_TEMPLATES_REPOSITORY = "https://github.com/steprz/stepzen-schemas";
8
9
  export declare const ADMIN_ACCOUNT_URL = "/cli/admin/account";
9
10
  export declare const ADMIN_DEPLOY_URL = "/cli/admin/deploy";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ADMIN_VERIFY_URL = exports.ADMIN_UPLOAD_URL = exports.ADMIN_LIST_URL = exports.ADMIN_DEPLOY_URL = exports.ADMIN_ACCOUNT_URL = exports.STEPZEN_API_TEMPLATES_REPOSITORY = exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = exports.STEPZEN_SERVER_URL = exports.STEPZEN_DOMAIN = exports.STEPZEN_CONFIG_FILE = exports.STEPZEN_CONFIG_DIRECTORY = exports.STEPZEN_CONFIG_CONTENT = void 0;
4
+ exports.ADMIN_VERIFY_URL = exports.ADMIN_UPLOAD_URL = exports.ADMIN_LIST_URL = exports.ADMIN_DEPLOY_URL = exports.ADMIN_ACCOUNT_URL = exports.STEPZEN_API_TEMPLATES_REPOSITORY = exports.STEPZEN_GENERATOR_ENGINES_ENDPOINT = exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = exports.STEPZEN_SERVER_URL = exports.STEPZEN_DOMAIN = exports.STEPZEN_CONFIG_FILE = exports.STEPZEN_CONFIG_DIRECTORY = exports.STEPZEN_CONFIG_CONTENT = void 0;
5
5
  // This file contains constants and all magic strings
6
6
  const dotenv = require("dotenv");
7
7
  const os = require("os");
@@ -9,7 +9,7 @@ const path = require("path");
9
9
  // This allows you to set environment variables in a `.env` file.
10
10
  // This file needs to be in your working directory.
11
11
  dotenv.config();
12
- const { STEPZEN_CONFIG_CONTENT: ENV_VAR_STEPZEN_CONFIG_CONTENT, STEPZEN_CONFIG_FILE: ENV_VAR_STEPZEN_CONFIG_FILE, STEPZEN_DOMAIN: ENV_VAR_STEPZEN_DOMAIN, STEPZEN_SERVER_URL: ENV_VAR_STEPZEN_SERVER_URL, } = process.env;
12
+ const { STEPZEN_CONFIG_CONTENT: ENV_VAR_STEPZEN_CONFIG_CONTENT, STEPZEN_CONFIG_FILE: ENV_VAR_STEPZEN_CONFIG_FILE, STEPZEN_DOMAIN: ENV_VAR_STEPZEN_DOMAIN, STEPZEN_GENERATOR_ENGINES_SCHEMA: ENV_VAR_STEPZEN_GENERATOR_ENGINES_SCHEMA, STEPZEN_SERVER_URL: ENV_VAR_STEPZEN_SERVER_URL, } = process.env;
13
13
  // Where your authentication details are stored locally
14
14
  exports.STEPZEN_CONFIG_CONTENT = ENV_VAR_STEPZEN_CONFIG_CONTENT;
15
15
  exports.STEPZEN_CONFIG_DIRECTORY = path.join(os.homedir(), '.stepzen');
@@ -18,8 +18,11 @@ exports.STEPZEN_CONFIG_FILE = ENV_VAR_STEPZEN_CONFIG_FILE || 'stepzen-config.yam
18
18
  exports.STEPZEN_DOMAIN = ENV_VAR_STEPZEN_DOMAIN || 'stepzen.io';
19
19
  // The zenctl URL. Override with the env var `STEPZEN_SERVER_URL`
20
20
  exports.STEPZEN_SERVER_URL = ENV_VAR_STEPZEN_SERVER_URL || 'https://{account}.stepzen.io';
21
- // Generator Engines schema folder/name
22
- exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = 'stepzen-generator/engines';
21
+ // Generator Engines schema: folder/name
22
+ // Use 'stepzen/engines-dev' to test the dev instance of https://github.com/steprz/generator-engines
23
+ exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = ENV_VAR_STEPZEN_GENERATOR_ENGINES_SCHEMA || 'stepzen/engines';
24
+ // Generator Engines schema: target API endpoint
25
+ exports.STEPZEN_GENERATOR_ENGINES_ENDPOINT = 'stepzen-generator/engines';
23
26
  // API Templates repository
24
27
  exports.STEPZEN_API_TEMPLATES_REPOSITORY = 'https://github.com/steprz/stepzen-schemas';
25
28
  // Paths to the endpoints used
@@ -1,2 +1,2 @@
1
- declare const _default: (workspace: any, flags: any) => Promise<void>;
1
+ declare const _default: (workspace: any) => Promise<void>;
2
2
  export default _default;
@@ -2,22 +2,15 @@
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const chalk = require("chalk");
5
- const cli_ux_1 = require("cli-ux");
6
5
  const fs = require("fs");
7
6
  const os = require("os");
8
7
  const path = require("path");
9
- const utils_1 = require("../shared/utils");
10
- // eslint-disable-next-line max-params
11
- exports.default = async (workspace, flags) => {
12
- utils_1.clearConsole();
8
+ exports.default = async (workspace) => {
13
9
  const cwd = workspace.schema.replace(os.homedir(), '~');
14
10
  const config = path.join(cwd, 'config.yaml');
11
+ console.log();
15
12
  if (fs.existsSync(config)) {
16
- console.log(`Watching ${chalk.blue(config)} for configuration changes`);
17
- }
18
- console.log(`Watching ${chalk.blue(cwd)} for GraphQL changes`);
19
- if (!flags['no-dashboard']) {
20
- console.log();
21
- cli_ux_1.default.url(`Running StepZen at http://localhost:${flags.port}/${workspace.endpoint}`, `http://localhost:${flags.port}/${workspace.endpoint}`);
13
+ console.log(`Watching ${chalk.blue(config)} for configuration changes...`);
22
14
  }
15
+ console.log(`Watching ${chalk.blue(cwd)} for GraphQL changes...`);
23
16
  };
@@ -4,9 +4,9 @@ const tslib_1 = require("tslib");
4
4
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
5
5
  const chalk = require("chalk");
6
6
  const cli_ux_1 = require("cli-ux");
7
- const date_fns_1 = require("date-fns");
8
7
  const fs = require("fs-extra");
9
8
  const path = require("path");
9
+ const prettyMilliseconds = require("pretty-ms");
10
10
  const deploy_1 = require("../commands/deploy");
11
11
  const configuration_1 = require("../shared/configuration");
12
12
  const constants_1 = require("../shared/constants");
@@ -16,7 +16,6 @@ const dotenv = require('dotenv');
16
16
  exports.default = async (file, workspace, flags) => {
17
17
  var e_1, _a;
18
18
  dotenv.config({ path: path.join(workspace.directory, '.env') });
19
- console.log();
20
19
  if (file) {
21
20
  console.log(`File changed: ${chalk.blue(file)}`);
22
21
  }
@@ -33,20 +32,32 @@ exports.default = async (file, workspace, flags) => {
33
32
  return;
34
33
  }
35
34
  }
36
- cli_ux_1.default.action.start('Deploying to StepZen...');
35
+ cli_ux_1.default.action.start(`Deploying ${chalk.yellow(workspace.endpoint)} to StepZen`);
37
36
  const deployArgs = [workspace.endpoint, '--silent'];
38
37
  const uploadCmds = [];
39
38
  const configPath = path.join(workspace.schema, 'config.yaml');
40
39
  if (fs.existsSync(configPath)) {
41
40
  deployArgs.push('--configurationsets', `${workspace.endpoint},stepzen/default`);
42
- uploadCmds.push(['configurationset', workspace.endpoint, '--file', configPath, '--silent']);
41
+ uploadCmds.push([
42
+ 'configurationset',
43
+ workspace.endpoint,
44
+ '--file',
45
+ configPath,
46
+ '--silent',
47
+ ]);
43
48
  }
44
49
  else {
45
50
  deployArgs.push('--configurationsets', 'stepzen/default');
46
51
  }
47
52
  if (fs.existsSync(workspace.schema)) {
48
53
  deployArgs.push('--schema', workspace.endpoint);
49
- uploadCmds.push(['schema', workspace.endpoint, '--dir', workspace.schema, '--silent']);
54
+ uploadCmds.push([
55
+ 'schema',
56
+ workspace.endpoint,
57
+ '--dir',
58
+ workspace.schema,
59
+ '--silent',
60
+ ]);
50
61
  }
51
62
  const logError = (error) => {
52
63
  try {
@@ -60,6 +71,7 @@ exports.default = async (file, workspace, flags) => {
60
71
  console.log(chalk.red(error));
61
72
  }
62
73
  };
74
+ const deployStart = new Date().getTime();
63
75
  try {
64
76
  for (var uploadCmds_1 = tslib_1.__asyncValues(uploadCmds), uploadCmds_1_1; uploadCmds_1_1 = await uploadCmds_1.next(), !uploadCmds_1_1.done;) {
65
77
  const cmd = uploadCmds_1_1.value;
@@ -86,13 +98,20 @@ exports.default = async (file, workspace, flags) => {
86
98
  logError(error);
87
99
  return;
88
100
  }
89
- cli_ux_1.default.action.stop();
90
- const what = chalk.yellow(workspace.endpoint);
91
- const when = chalk.yellow(date_fns_1.format(new Date(), 'h:mm:ss aa'));
92
- console.log();
93
- console.log(chalk.green(`Successfully deployed ${what} at ${when}`));
101
+ const deployEnd = new Date().getTime();
102
+ const deployTime = deployEnd - deployStart;
103
+ cli_ux_1.default.action.stop(`${chalk.grey('done in')} ${prettyMilliseconds(deployTime)} 🚀`);
94
104
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
95
105
  const endpoint = `https://${configuration.account}.${domain}/${workspace.endpoint}/__graphql`;
96
106
  console.log();
97
- console.log(chalk.grey(`Your endpoint is available at ${endpoint}`));
107
+ console.log(chalk.grey(`Your API url is`, chalk.green(` ${endpoint}`)));
108
+ console.log();
109
+ console.log(chalk.grey(`You can test your API with cURL:`));
110
+ console.log();
111
+ console.log(`curl ${endpoint} \\`);
112
+ console.log(` --header "Authorization: Apikey {{insert yours from https://stepzen.com/account}}" \\`);
113
+ console.log(` --header "Content-Type: application/json" \\`);
114
+ console.log(` --data '{"query": "your graphql query"}'`);
115
+ console.log();
116
+ console.log(chalk.grey(`or explore it with GraphiQL at`), chalk.green(` http://localhost:${flags.port}/${workspace.endpoint}`));
98
117
  };
@@ -1,3 +1,3 @@
1
1
  import console from './console';
2
2
  import deploy from './deploy';
3
- export { console, deploy, };
3
+ export { console, deploy };
@@ -1 +1 @@
1
- {"version":"0.9.36-beta.6","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":5001}},"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}]},"whoami":{"id":"whoami","description":"stepzen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false}},"args":[]}}}
1
+ {"version":"0.9.38-beta.1","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":"upload and deploy your schema","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":5001}},"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}]},"whoami":{"id":"whoami","description":"stepzen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stepzen",
3
3
  "description": "The StepZen CLI",
4
- "version": "0.9.36-beta.6",
4
+ "version": "0.9.38-beta.1",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -46,6 +46,7 @@
46
46
  "lodash": "^4.17.21",
47
47
  "node-fetch": "^2.6.6",
48
48
  "prettier": "^2.4.1",
49
+ "pretty-ms": "^7.0.1",
49
50
  "shelljs": "^0.8.5",
50
51
  "throttle-debounce": "^3.0.1",
51
52
  "yaml": "^1.10.0"
@@ -77,10 +78,13 @@
77
78
  "chai": "^4.2.0",
78
79
  "copyfiles": "^2.4.1",
79
80
  "eslint": "7.11.0",
80
- "eslint-config-oclif": "^3.1.0",
81
- "eslint-config-oclif-typescript": "^0.1.0",
82
- "eslint-plugin-react": "^7.21.5",
81
+ "eslint-config-oclif": "3.1.0",
82
+ "eslint-config-oclif-typescript": "0.1.0",
83
+ "eslint-config-prettier": "8.3.0",
84
+ "eslint-plugin-prettier": "3.3.1",
85
+ "husky": "^7.0.4",
83
86
  "license-checker": "^25.0.1",
87
+ "lint-staged": "^12.3.2",
84
88
  "mocha": "^5.2.0",
85
89
  "mock-fs": "^4.13.0",
86
90
  "nock": "^13.0.4",
@@ -99,17 +103,23 @@
99
103
  "prerun": [
100
104
  "./lib/hooks/prerun/check-account",
101
105
  "./lib/hooks/prerun/check-upgrade",
102
- "./lib/hooks/prerun/ensure-api-key"
106
+ "./lib/hooks/prerun/ensure-api-key",
107
+ "./lib/hooks/prerun/ensure-permissions"
103
108
  ]
104
109
  }
105
110
  },
106
111
  "scripts": {
107
- "dev": "nodemon ./bin/run start --dir ~/Desktop/tuesday/debugging -e ts",
112
+ "dev:login": "nodemon -e ts bin/run login",
113
+ "dev:start": "nodemon -e ts bin/run start --dir ~/Downloads/hello-stepzen",
108
114
  "postpack": "rm -f oclif.manifest.json",
109
- "posttest": "eslint . --ext .ts --config .eslintrc",
115
+ "posttest": "eslint . --ignore-path .prettierignore",
110
116
  "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
111
117
  "test": "tsc -b && STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
112
- "version": "oclif-dev readme && git add README.md"
118
+ "version": "oclif-dev readme && git add README.md",
119
+ "prepare": "husky install"
113
120
  },
114
- "types": "lib/index.d.ts"
121
+ "types": "lib/index.d.ts",
122
+ "lint-staged": {
123
+ "*.{ts,js,css,md,yaml,json}": "prettier --write"
124
+ }
115
125
  }