@contentstack/cli-cm-bootstrap 1.13.3 → 1.14.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 +4 -4
- package/lib/bootstrap/utils.js +21 -24
- package/lib/commands/cm/bootstrap.js +1 -1
- package/oclif.manifest.json +68 -49
- package/package.json +9 -9
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.
|
|
18
|
+
@contentstack/cli-cm-bootstrap/1.14.1 linux-x64 node-v22.15.0
|
|
19
19
|
$ csdx --help [COMMAND]
|
|
20
20
|
USAGE
|
|
21
21
|
$ csdx COMMAND
|
|
@@ -52,10 +52,10 @@ FLAGS
|
|
|
52
52
|
-k, --stack-api-key=<value> Provide stack API key to seed content
|
|
53
53
|
-n, --stack-name=<value> Name of the new stack that will be created.
|
|
54
54
|
-y, --yes=<value> [Optional] Skip stack confirmation
|
|
55
|
-
|
|
55
|
+
--app-name=<value> App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter,
|
|
56
56
|
vue-starter, stencil-starter
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
--org=<value> Provide organization UID to create a new stack
|
|
58
|
+
--project-dir=<value> Directory to setup the project. If directory name has a space then provide the path as a
|
|
59
59
|
string or escap the space using back slash eg: "../../test space" or ../../test\ space
|
|
60
60
|
|
|
61
61
|
DESCRIPTION
|
package/lib/bootstrap/utils.js
CHANGED
|
@@ -23,30 +23,28 @@ const setupEnvironments = async (managementAPIClient, api_key, appConfig, cloned
|
|
|
23
23
|
//create management token if not present
|
|
24
24
|
if (!managementToken) {
|
|
25
25
|
const managementBody = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
token: {
|
|
27
|
+
name: 'sample app',
|
|
28
|
+
description: 'This is a sample management token.',
|
|
29
|
+
scope: [
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
31
|
+
module: 'content_type',
|
|
32
|
+
acl: {
|
|
33
|
+
read: true,
|
|
34
|
+
write: true,
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}
|
|
38
|
+
module: 'branch',
|
|
39
|
+
branches: ['main'],
|
|
40
|
+
acl: {
|
|
41
|
+
read: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
46
44
|
],
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
45
|
+
expires_on: '3000-01-01',
|
|
46
|
+
is_email_notification_enabled: false,
|
|
47
|
+
},
|
|
50
48
|
};
|
|
51
49
|
managementTokenResult = await managementAPIClient
|
|
52
50
|
.stack({ api_key: api_key })
|
|
@@ -155,13 +153,11 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
155
153
|
let filePath;
|
|
156
154
|
let fileName;
|
|
157
155
|
let customHost;
|
|
158
|
-
let previewHost;
|
|
159
|
-
let appHost;
|
|
160
156
|
const managementAPIHost = (_a = region === null || region === void 0 ? void 0 : region.cma) === null || _a === void 0 ? void 0 : _a.substring('8');
|
|
161
157
|
const regionName = region && region.name && region.name.toLowerCase();
|
|
162
|
-
previewHost = (_c = (_b = region === null || region === void 0 ? void 0 : region.uiHost) === null || _b === void 0 ? void 0 : _b.substring(8)) === null || _c === void 0 ? void 0 : _c.replace('app', 'rest-preview');
|
|
158
|
+
const previewHost = (_c = (_b = region === null || region === void 0 ? void 0 : region.uiHost) === null || _b === void 0 ? void 0 : _b.substring(8)) === null || _c === void 0 ? void 0 : _c.replace('app', 'rest-preview');
|
|
163
159
|
const cdnHost = (_d = region === null || region === void 0 ? void 0 : region.cda) === null || _d === void 0 ? void 0 : _d.substring('8');
|
|
164
|
-
appHost = (_e = region === null || region === void 0 ? void 0 : region.uiHost) === null || _e === void 0 ? void 0 : _e.substring(8);
|
|
160
|
+
const appHost = (_e = region === null || region === void 0 ? void 0 : region.uiHost) === null || _e === void 0 ? void 0 : _e.substring(8);
|
|
165
161
|
const isUSRegion = regionName === 'us' || regionName === 'na';
|
|
166
162
|
if (regionName !== 'eu' && !isUSRegion) {
|
|
167
163
|
customHost = (_f = region === null || region === void 0 ? void 0 : region.cma) === null || _f === void 0 ? void 0 : _f.substring(8);
|
|
@@ -193,6 +189,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
193
189
|
? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\n`
|
|
194
190
|
: '\n'}CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : ''}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_LIVE_EDIT_TAGS=false\nCONTENTSTACK_API_HOST=${customHost ? customHost : managementAPIHost}${!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : ''}\nCONTENTSTACK_APP_HOST=${appHost}\nCONTENTSTACK_MANAGEMENT_TOKEN=${managementTokenResult.uid}\nCONTENTSTACK_HOST=${cdnHost}`;
|
|
195
191
|
result = await writeEnvFile(content, filePath);
|
|
192
|
+
break;
|
|
196
193
|
case 'gatsby':
|
|
197
194
|
case 'gatsby-starter':
|
|
198
195
|
fileName = `.env.${environmentVariables.environment}`;
|
|
@@ -48,7 +48,7 @@ class BootstrapCommand extends cli_command_1.Command {
|
|
|
48
48
|
}
|
|
49
49
|
const yes = bootstrapCommandFlags.yes;
|
|
50
50
|
const appConfig = (0, config_1.getAppLevelConfigByName)(selectedAppName || selectedApp.configKey);
|
|
51
|
-
|
|
51
|
+
const master_locale = appConfig.master_locale || exports.DEFAULT_MASTER_LOCALE;
|
|
52
52
|
let cloneDirectory = bootstrapCommandFlags.directory || bootstrapCommandFlags['project-dir'];
|
|
53
53
|
if (!cloneDirectory) {
|
|
54
54
|
cloneDirectory = await (0, interactive_1.inquireCloneDirectory)();
|
package/oclif.manifest.json
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.13.3",
|
|
3
2
|
"commands": {
|
|
4
3
|
"cm:bootstrap": {
|
|
5
|
-
"id": "cm:bootstrap",
|
|
6
|
-
"description": "Bootstrap contentstack apps",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"pluginName": "@contentstack/cli-cm-bootstrap",
|
|
9
|
-
"pluginAlias": "@contentstack/cli-cm-bootstrap",
|
|
10
|
-
"pluginType": "core",
|
|
11
4
|
"aliases": [],
|
|
12
|
-
"
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Bootstrap contentstack apps",
|
|
13
7
|
"examples": [
|
|
14
8
|
"$ csdx cm:bootstrap",
|
|
15
9
|
"$ csdx cm:bootstrap --project-dir <path/to/setup/the/app>",
|
|
@@ -19,104 +13,129 @@
|
|
|
19
13
|
],
|
|
20
14
|
"flags": {
|
|
21
15
|
"app-name": {
|
|
22
|
-
"name": "app-name",
|
|
23
|
-
"type": "option",
|
|
24
16
|
"description": "App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter, vue-starter, stencil-starter",
|
|
17
|
+
"name": "app-name",
|
|
25
18
|
"required": false,
|
|
26
|
-
"
|
|
19
|
+
"hasDynamicHelp": false,
|
|
20
|
+
"multiple": false,
|
|
21
|
+
"type": "option"
|
|
27
22
|
},
|
|
28
23
|
"project-dir": {
|
|
29
|
-
"name": "project-dir",
|
|
30
|
-
"type": "option",
|
|
31
24
|
"description": "Directory to setup the project. If directory name has a space then provide the path as a string or escap the space using back slash eg: \"../../test space\" or ../../test\\ space",
|
|
25
|
+
"name": "project-dir",
|
|
32
26
|
"required": false,
|
|
33
|
-
"
|
|
27
|
+
"hasDynamicHelp": false,
|
|
28
|
+
"multiple": false,
|
|
29
|
+
"type": "option"
|
|
34
30
|
},
|
|
35
31
|
"app-type": {
|
|
36
|
-
"name": "app-type",
|
|
37
|
-
"type": "option",
|
|
38
32
|
"description": "Sample or Starter app",
|
|
39
33
|
"hidden": true,
|
|
34
|
+
"name": "app-type",
|
|
40
35
|
"required": false,
|
|
41
|
-
"
|
|
36
|
+
"hasDynamicHelp": false,
|
|
37
|
+
"multiple": false,
|
|
38
|
+
"type": "option"
|
|
42
39
|
},
|
|
43
40
|
"stack-api-key": {
|
|
44
|
-
"name": "stack-api-key",
|
|
45
|
-
"type": "option",
|
|
46
41
|
"char": "k",
|
|
47
42
|
"description": "Provide stack API key to seed content",
|
|
48
|
-
"required": false,
|
|
49
|
-
"multiple": false,
|
|
50
43
|
"exclusive": [
|
|
51
44
|
"org",
|
|
52
45
|
"stack-name"
|
|
53
|
-
]
|
|
46
|
+
],
|
|
47
|
+
"name": "stack-api-key",
|
|
48
|
+
"required": false,
|
|
49
|
+
"hasDynamicHelp": false,
|
|
50
|
+
"multiple": false,
|
|
51
|
+
"type": "option"
|
|
54
52
|
},
|
|
55
53
|
"org": {
|
|
56
|
-
"name": "org",
|
|
57
|
-
"type": "option",
|
|
58
54
|
"description": "Provide organization UID to create a new stack",
|
|
59
|
-
"required": false,
|
|
60
|
-
"multiple": false,
|
|
61
55
|
"exclusive": [
|
|
62
56
|
"stack-api-key"
|
|
63
|
-
]
|
|
57
|
+
],
|
|
58
|
+
"name": "org",
|
|
59
|
+
"required": false,
|
|
60
|
+
"hasDynamicHelp": false,
|
|
61
|
+
"multiple": false,
|
|
62
|
+
"type": "option"
|
|
64
63
|
},
|
|
65
64
|
"stack-name": {
|
|
66
|
-
"name": "stack-name",
|
|
67
|
-
"type": "option",
|
|
68
65
|
"char": "n",
|
|
69
66
|
"description": "Name of the new stack that will be created.",
|
|
70
|
-
"required": false,
|
|
71
|
-
"multiple": false,
|
|
72
67
|
"exclusive": [
|
|
73
68
|
"stack-api-key"
|
|
74
|
-
]
|
|
69
|
+
],
|
|
70
|
+
"name": "stack-name",
|
|
71
|
+
"required": false,
|
|
72
|
+
"hasDynamicHelp": false,
|
|
73
|
+
"multiple": false,
|
|
74
|
+
"type": "option"
|
|
75
75
|
},
|
|
76
76
|
"yes": {
|
|
77
|
-
"name": "yes",
|
|
78
|
-
"type": "option",
|
|
79
77
|
"char": "y",
|
|
80
78
|
"description": "[Optional] Skip stack confirmation",
|
|
79
|
+
"name": "yes",
|
|
81
80
|
"required": false,
|
|
82
|
-
"
|
|
81
|
+
"hasDynamicHelp": false,
|
|
82
|
+
"multiple": false,
|
|
83
|
+
"type": "option"
|
|
83
84
|
},
|
|
84
85
|
"appName": {
|
|
85
|
-
"name": "appName",
|
|
86
|
-
"type": "option",
|
|
87
86
|
"char": "a",
|
|
88
87
|
"description": "App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter",
|
|
89
88
|
"hidden": true,
|
|
89
|
+
"name": "appName",
|
|
90
90
|
"required": false,
|
|
91
|
-
"
|
|
91
|
+
"hasDynamicHelp": false,
|
|
92
|
+
"multiple": false,
|
|
93
|
+
"type": "option"
|
|
92
94
|
},
|
|
93
95
|
"directory": {
|
|
94
|
-
"name": "directory",
|
|
95
|
-
"type": "option",
|
|
96
96
|
"char": "d",
|
|
97
97
|
"description": "Directory to set up the project. If directory name has a space then provide the path as a string or escape the space using backslash eg: \"../../test space\" or ../../test\\ space",
|
|
98
98
|
"hidden": true,
|
|
99
|
+
"name": "directory",
|
|
99
100
|
"required": false,
|
|
100
|
-
"
|
|
101
|
+
"hasDynamicHelp": false,
|
|
102
|
+
"multiple": false,
|
|
103
|
+
"type": "option"
|
|
101
104
|
},
|
|
102
105
|
"appType": {
|
|
103
|
-
"name": "appType",
|
|
104
|
-
"type": "option",
|
|
105
106
|
"char": "s",
|
|
106
107
|
"description": "Sample or Starter app",
|
|
107
108
|
"hidden": true,
|
|
109
|
+
"name": "appType",
|
|
108
110
|
"required": false,
|
|
109
|
-
"
|
|
111
|
+
"hasDynamicHelp": false,
|
|
112
|
+
"multiple": false,
|
|
113
|
+
"type": "option"
|
|
110
114
|
},
|
|
111
115
|
"alias": {
|
|
112
|
-
"name": "alias",
|
|
113
|
-
"type": "option",
|
|
114
116
|
"char": "a",
|
|
115
117
|
"description": "Alias of the management token",
|
|
116
|
-
"
|
|
118
|
+
"name": "alias",
|
|
119
|
+
"hasDynamicHelp": false,
|
|
120
|
+
"multiple": false,
|
|
121
|
+
"type": "option"
|
|
117
122
|
}
|
|
118
123
|
},
|
|
119
|
-
"
|
|
124
|
+
"hasDynamicHelp": false,
|
|
125
|
+
"hiddenAliases": [],
|
|
126
|
+
"id": "cm:bootstrap",
|
|
127
|
+
"pluginAlias": "@contentstack/cli-cm-bootstrap",
|
|
128
|
+
"pluginName": "@contentstack/cli-cm-bootstrap",
|
|
129
|
+
"pluginType": "core",
|
|
130
|
+
"strict": true,
|
|
131
|
+
"isESM": false,
|
|
132
|
+
"relativePath": [
|
|
133
|
+
"lib",
|
|
134
|
+
"commands",
|
|
135
|
+
"cm",
|
|
136
|
+
"bootstrap.js"
|
|
137
|
+
]
|
|
120
138
|
}
|
|
121
|
-
}
|
|
139
|
+
},
|
|
140
|
+
"version": "1.14.1"
|
|
122
141
|
}
|
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
|
+
"version": "1.14.1",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -17,26 +17,26 @@
|
|
|
17
17
|
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contentstack/cli-cm-seed": "~1.
|
|
21
|
-
"@contentstack/cli-command": "~1.
|
|
22
|
-
"@contentstack/cli-utilities": "~1.
|
|
20
|
+
"@contentstack/cli-cm-seed": "~1.11.1",
|
|
21
|
+
"@contentstack/cli-command": "~1.5.0",
|
|
22
|
+
"@contentstack/cli-utilities": "~1.12.0",
|
|
23
23
|
"inquirer": "8.2.6",
|
|
24
24
|
"mkdirp": "^1.0.4",
|
|
25
25
|
"tar": "^6.2.1 "
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@oclif/test": "^4.1.
|
|
29
|
-
"@types/inquirer": "^9.0.
|
|
28
|
+
"@oclif/test": "^4.1.13",
|
|
29
|
+
"@types/inquirer": "^9.0.8",
|
|
30
30
|
"@types/mkdirp": "^1.0.2",
|
|
31
31
|
"@types/node": "^14.18.63",
|
|
32
32
|
"@types/tar": "^6.1.13",
|
|
33
33
|
"chai": "^4.5.0",
|
|
34
34
|
"eslint": "^8.57.1",
|
|
35
|
-
"eslint-config-oclif": "^
|
|
36
|
-
"eslint-config-oclif-typescript": "^3.1.
|
|
35
|
+
"eslint-config-oclif": "^6.0.62",
|
|
36
|
+
"eslint-config-oclif-typescript": "^3.1.14",
|
|
37
37
|
"mocha": "10.8.2",
|
|
38
38
|
"nyc": "^15.1.0",
|
|
39
|
-
"oclif": "^
|
|
39
|
+
"oclif": "^4.17.46",
|
|
40
40
|
"tmp": "^0.2.3",
|
|
41
41
|
"ts-node": "^8.10.2",
|
|
42
42
|
"typescript": "^4.9.5"
|