@contentstack/cli-cm-bootstrap 1.4.0 → 1.4.2

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
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
15
15
  $ csdx COMMAND
16
16
  running command...
17
17
  $ csdx (--version)
18
- @contentstack/cli-cm-bootstrap/1.4.0 linux-x64 node-v16.20.0
18
+ @contentstack/cli-cm-bootstrap/1.4.2 linux-x64 node-v16.20.0
19
19
  $ csdx --help [COMMAND]
20
20
  USAGE
21
21
  $ csdx COMMAND
@@ -8,22 +8,18 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
8
8
  const config_1 = require("../../config");
9
9
  const messages_1 = require("../../messages");
10
10
  class BootstrapCommand extends cli_command_1.Command {
11
- get managementAPIClient() {
12
- return (async () => {
13
- const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: this.cmaHost });
14
- this.bootstrapManagementAPIClient = managementAPIClient;
15
- return this.bootstrapManagementAPIClient;
16
- })();
17
- }
18
11
  async run() {
19
12
  const { flags: bootstrapCommandFlags } = await this.parse(BootstrapCommand);
20
13
  try {
21
- if (!this.authToken) {
14
+ if (!(0, cli_utilities_1.isAuthenticated)()) {
22
15
  this.error(messages_1.default.parse('CLI_BOOTSTRAP_LOGIN_FAILED'), {
23
16
  exit: 2,
24
17
  suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/'],
25
18
  });
26
19
  }
20
+ this.bootstrapManagementAPIClient = await (0, cli_utilities_1.managementSDKClient)({
21
+ host: this.cmaHost,
22
+ });
27
23
  // inquire user inputs
28
24
  let appType = bootstrapCommandFlags.appType || bootstrapCommandFlags['app-type'] || 'starterapp';
29
25
  if (!appType) {
@@ -54,7 +50,7 @@ class BootstrapCommand extends cli_command_1.Command {
54
50
  cloneDirectory = await (0, interactive_1.inquireCloneDirectory)();
55
51
  }
56
52
  cloneDirectory = (0, path_1.resolve)(cloneDirectory);
57
- const livePreviewEnabled = (bootstrapCommandFlags.yes) ? true : await (0, interactive_1.inquireLivePreviewSupport)();
53
+ const livePreviewEnabled = bootstrapCommandFlags.yes ? true : await (0, interactive_1.inquireLivePreviewSupport)();
58
54
  const seedParams = {};
59
55
  const stackAPIKey = bootstrapCommandFlags['stack-api-key'];
60
56
  const org = bootstrapCommandFlags['org'];
@@ -72,7 +68,7 @@ class BootstrapCommand extends cli_command_1.Command {
72
68
  appConfig,
73
69
  seedParams,
74
70
  cloneDirectory,
75
- managementAPIClient: await this.managementAPIClient,
71
+ managementAPIClient: this.bootstrapManagementAPIClient,
76
72
  region: this.region,
77
73
  appType,
78
74
  livePreviewEnabled,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.0",
2
+ "version": "1.4.2",
3
3
  "commands": {
4
4
  "cm:bootstrap": {
5
5
  "id": "cm:bootstrap",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-bootstrap",
3
3
  "description": "Bootstrap contentstack apps",
4
- "version": "1.4.0",
4
+ "version": "1.4.2",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "scripts": {
@@ -17,10 +17,9 @@
17
17
  "test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
18
18
  },
19
19
  "dependencies": {
20
- "@contentstack/cli-cm-seed": "^1.3.1",
21
- "@contentstack/cli-command": "^1.2.1",
22
- "@contentstack/cli-utilities": "^1.2.1",
23
- "@contentstack/management": "^1.6.1",
20
+ "@contentstack/cli-cm-seed": "^1.4.2",
21
+ "@contentstack/cli-command": "^1.2.3",
22
+ "@contentstack/cli-utilities": "^1.4.0",
24
23
  "inquirer": "8.2.4",
25
24
  "mkdirp": "^1.0.4",
26
25
  "tar": "^6.1.13"
@@ -38,7 +37,7 @@
38
37
  "globby": "^10.0.2",
39
38
  "mocha": "^10.0.0",
40
39
  "nyc": "^15.1.0",
41
- "oclif": "^3.1.2",
40
+ "oclif": "^3.8.1",
42
41
  "rimraf": "^2.7.1",
43
42
  "tmp": "^0.2.1",
44
43
  "ts-node": "^8.10.2",