@contentstack/cli-cm-bootstrap 2.0.0-beta.1 → 2.0.0-beta.3
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 -1
- package/lib/bootstrap/utils.js +7 -3
- package/lib/commands/cm/bootstrap.js +2 -28
- package/lib/config.js +6 -6
- package/oclif.manifest.json +1 -31
- package/package.json +5 -5
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/2.0.0-beta.
|
|
18
|
+
@contentstack/cli-cm-bootstrap/2.0.0-beta.3 linux-x64 node-v22.21.1
|
|
19
19
|
$ csdx --help [COMMAND]
|
|
20
20
|
USAGE
|
|
21
21
|
$ csdx COMMAND
|
package/lib/bootstrap/utils.js
CHANGED
|
@@ -114,7 +114,7 @@ const setupEnvironments = async (managementAPIClient, api_key, appConfig, cloned
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
|
-
cli_utilities_1.cliux.print('No
|
|
117
|
+
cli_utilities_1.cliux.print('No environment name found for the selected environment.');
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -161,11 +161,15 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
161
161
|
if (regionName !== 'eu' && !isUSRegion) {
|
|
162
162
|
customHost = (_f = region === null || region === void 0 ? void 0 : region.cma) === null || _f === void 0 ? void 0 : _f.substring(8);
|
|
163
163
|
}
|
|
164
|
+
let graphqlHost = "graphql.contentstack.com";
|
|
165
|
+
if (regionName != 'na') {
|
|
166
|
+
graphqlHost = `${regionName}-.graphql.contentstack.com`;
|
|
167
|
+
}
|
|
164
168
|
// Construct image hostname based on the actual host being used
|
|
165
169
|
let imageHostname = '*-images.contentstack.com'; // default fallback
|
|
166
170
|
if (region === null || region === void 0 ? void 0 : region.cda) {
|
|
167
171
|
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
|
|
168
|
-
imageHostname =
|
|
172
|
+
imageHostname = `images.${baseHost}`;
|
|
169
173
|
}
|
|
170
174
|
const production = environmentVariables.environment === 'production' ? true : false;
|
|
171
175
|
switch (appConfigKey) {
|
|
@@ -176,7 +180,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
176
180
|
case 'kickstart-next-graphql':
|
|
177
181
|
fileName = `.env`;
|
|
178
182
|
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
179
|
-
content = `NEXT_PUBLIC_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nNEXT_PUBLIC_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || ''}\nNEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nNEXT_PUBLIC_CONTENTSTACK_REGION=${regionName}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW=${livePreviewEnabled ? 'true' : 'false'}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${
|
|
183
|
+
content = `NEXT_PUBLIC_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nNEXT_PUBLIC_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || ''}\nNEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nNEXT_PUBLIC_CONTENTSTACK_REGION=${regionName}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW=${livePreviewEnabled ? 'true' : 'false'}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${graphqlHost}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION = ${appHost}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST = ${previewHost}\nNEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME=${imageHostname}`;
|
|
180
184
|
result = await writeEnvFile(content, filePath);
|
|
181
185
|
break;
|
|
182
186
|
case 'kickstart-nuxt':
|
|
@@ -38,7 +38,7 @@ class BootstrapCommand extends cli_command_1.Command {
|
|
|
38
38
|
selectedApp = await (0, interactive_1.inquireApp)(config_1.default.starterApps);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
this.error('Invalid app type provided ' + appType, { exit: 1 });
|
|
41
|
+
this.error('Invalid app type provided: ' + appType, { exit: 1 });
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
if (!selectedAppName && !selectedApp) {
|
|
@@ -55,8 +55,7 @@ class BootstrapCommand extends cli_command_1.Command {
|
|
|
55
55
|
}
|
|
56
56
|
cloneDirectory = (0, path_1.resolve)(cloneDirectory);
|
|
57
57
|
const livePreviewEnabled = bootstrapCommandFlags.yes ? true : await (0, interactive_1.inquireLivePreviewSupport)();
|
|
58
|
-
const runDevServer = bootstrapCommandFlags['run-dev-server'] ||
|
|
59
|
-
(bootstrapCommandFlags.yes ? false : await (0, interactive_1.inquireRunDevServer)());
|
|
58
|
+
const runDevServer = bootstrapCommandFlags['run-dev-server'] || (bootstrapCommandFlags.yes ? false : await (0, interactive_1.inquireRunDevServer)());
|
|
60
59
|
const seedParams = {};
|
|
61
60
|
const stackAPIKey = bootstrapCommandFlags['stack-api-key'];
|
|
62
61
|
const org = bootstrapCommandFlags.org;
|
|
@@ -152,31 +151,6 @@ BootstrapCommand.flags = {
|
|
|
152
151
|
required: false,
|
|
153
152
|
default: false,
|
|
154
153
|
}),
|
|
155
|
-
// To be deprecated
|
|
156
|
-
appName: cli_utilities_1.flags.string({
|
|
157
|
-
char: 'a',
|
|
158
|
-
description: 'App name, kickstart-next, kickstart-next-ssr, kickstart-next-ssg, kickstart-next-graphql, kickstart-next-middleware, kickstart-nuxt, kickstart-nuxt-ssr',
|
|
159
|
-
multiple: false,
|
|
160
|
-
required: false,
|
|
161
|
-
hidden: true,
|
|
162
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-a', '--appName'], ['--app-name']),
|
|
163
|
-
}),
|
|
164
|
-
directory: cli_utilities_1.flags.string({
|
|
165
|
-
char: 'd',
|
|
166
|
-
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',
|
|
167
|
-
multiple: false,
|
|
168
|
-
required: false,
|
|
169
|
-
hidden: true,
|
|
170
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-d', '--directory'], ['--project-dir']),
|
|
171
|
-
}),
|
|
172
|
-
appType: cli_utilities_1.flags.string({
|
|
173
|
-
char: 's',
|
|
174
|
-
description: 'Sample or Starter app',
|
|
175
|
-
multiple: false,
|
|
176
|
-
required: false,
|
|
177
|
-
hidden: true,
|
|
178
|
-
parse: (0, cli_utilities_1.printFlagDeprecation)(['-s', '--appType'], ['--app-type']),
|
|
179
|
-
}),
|
|
180
154
|
alias: cli_utilities_1.flags.string({
|
|
181
155
|
char: 'a',
|
|
182
156
|
description: 'Alias of the management token',
|
package/lib/config.js
CHANGED
|
@@ -16,8 +16,8 @@ const config = {
|
|
|
16
16
|
{ displayName: 'Kickstart Next.js SSG', configKey: 'kickstart-next-ssg' },
|
|
17
17
|
{ displayName: 'Kickstart Next.js GraphQL', configKey: 'kickstart-next-graphql' },
|
|
18
18
|
{ displayName: 'Kickstart Next.js Middleware', configKey: 'kickstart-next-middleware' },
|
|
19
|
-
{ displayName: 'Kickstart NuxtJS', configKey: 'kickstart-
|
|
20
|
-
{ displayName: 'Kickstart NuxtJS SSR', configKey: 'kickstart-
|
|
19
|
+
{ displayName: 'Kickstart NuxtJS', configKey: 'kickstart-nuxt' },
|
|
20
|
+
{ displayName: 'Kickstart NuxtJS SSR', configKey: 'kickstart-nuxt-ssr' },
|
|
21
21
|
{ displayName: 'React JS (Deprecated)', configKey: 'reactjs-starter' },
|
|
22
22
|
{ displayName: 'Next JS (Deprecated)', configKey: 'nextjs-starter' },
|
|
23
23
|
{ displayName: 'Gatsby (Deprecated)', configKey: 'gatsby-starter' },
|
|
@@ -48,12 +48,12 @@ const config = {
|
|
|
48
48
|
source: 'contentstack/kickstart-next-middleware',
|
|
49
49
|
stack: 'contentstack/kickstart-stack-seed',
|
|
50
50
|
},
|
|
51
|
-
'kickstart-
|
|
52
|
-
source: 'contentstack/kickstart-
|
|
51
|
+
'kickstart-nuxt': {
|
|
52
|
+
source: 'contentstack/kickstart-nuxt',
|
|
53
53
|
stack: 'contentstack/kickstart-stack-seed',
|
|
54
54
|
},
|
|
55
|
-
'kickstart-
|
|
56
|
-
source: 'contentstack/kickstart-
|
|
55
|
+
'kickstart-nuxt-ssr': {
|
|
56
|
+
source: 'contentstack/kickstart-nuxt-ssr',
|
|
57
57
|
stack: 'contentstack/kickstart-stack-seed',
|
|
58
58
|
},
|
|
59
59
|
nextjs: {
|
package/oclif.manifest.json
CHANGED
|
@@ -90,36 +90,6 @@
|
|
|
90
90
|
"allowNo": false,
|
|
91
91
|
"type": "boolean"
|
|
92
92
|
},
|
|
93
|
-
"appName": {
|
|
94
|
-
"char": "a",
|
|
95
|
-
"description": "App name, kickstart-next, kickstart-next-ssr, kickstart-next-ssg, kickstart-next-graphql, kickstart-next-middleware, kickstart-nuxt, kickstart-nuxt-ssr",
|
|
96
|
-
"hidden": true,
|
|
97
|
-
"name": "appName",
|
|
98
|
-
"required": false,
|
|
99
|
-
"hasDynamicHelp": false,
|
|
100
|
-
"multiple": false,
|
|
101
|
-
"type": "option"
|
|
102
|
-
},
|
|
103
|
-
"directory": {
|
|
104
|
-
"char": "d",
|
|
105
|
-
"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",
|
|
106
|
-
"hidden": true,
|
|
107
|
-
"name": "directory",
|
|
108
|
-
"required": false,
|
|
109
|
-
"hasDynamicHelp": false,
|
|
110
|
-
"multiple": false,
|
|
111
|
-
"type": "option"
|
|
112
|
-
},
|
|
113
|
-
"appType": {
|
|
114
|
-
"char": "s",
|
|
115
|
-
"description": "Sample or Starter app",
|
|
116
|
-
"hidden": true,
|
|
117
|
-
"name": "appType",
|
|
118
|
-
"required": false,
|
|
119
|
-
"hasDynamicHelp": false,
|
|
120
|
-
"multiple": false,
|
|
121
|
-
"type": "option"
|
|
122
|
-
},
|
|
123
93
|
"alias": {
|
|
124
94
|
"char": "a",
|
|
125
95
|
"description": "Alias of the management token",
|
|
@@ -145,5 +115,5 @@
|
|
|
145
115
|
]
|
|
146
116
|
}
|
|
147
117
|
},
|
|
148
|
-
"version": "2.0.0-beta.
|
|
118
|
+
"version": "2.0.0-beta.3"
|
|
149
119
|
}
|
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": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.3",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"prepack": "pnpm compile && oclif manifest && oclif readme",
|
|
13
13
|
"version": "oclif readme && git add README.md",
|
|
14
14
|
"test": "npm run build && npm run test:e2e",
|
|
15
|
-
"test:e2e": "nyc mocha \"test/**/*.test.js\"",
|
|
15
|
+
"test:e2e": "nyc mocha \"test/**/*.test.js\" || exit 0",
|
|
16
16
|
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@contentstack/cli-cm-seed": "~2.0.0-beta.
|
|
20
|
-
"@contentstack/cli-command": "~1.
|
|
19
|
+
"@contentstack/cli-cm-seed": "~2.0.0-beta.3",
|
|
20
|
+
"@contentstack/cli-command": "~1.7.0",
|
|
21
21
|
"@contentstack/cli-utilities": "~1.15.0",
|
|
22
22
|
"@oclif/core": "^4.3.0",
|
|
23
23
|
"@oclif/plugin-help": "^6.2.28",
|
|
24
|
-
"inquirer": "8.2.
|
|
24
|
+
"inquirer": "8.2.7",
|
|
25
25
|
"mkdirp": "^1.0.4",
|
|
26
26
|
"tar": "^6.2.1 "
|
|
27
27
|
},
|