@contentstack/cli-cm-bootstrap 1.9.2 → 1.9.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/index.js +1 -1
- package/lib/bootstrap/utils.js +7 -7
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
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.9.
|
|
18
|
+
@contentstack/cli-cm-bootstrap/1.9.3 linux-x64 node-v18.20.3
|
|
19
19
|
$ csdx --help [COMMAND]
|
|
20
20
|
USAGE
|
|
21
21
|
$ csdx COMMAND
|
package/lib/bootstrap/index.js
CHANGED
|
@@ -26,7 +26,7 @@ class Bootstrap {
|
|
|
26
26
|
if (options.appConfig.branch) {
|
|
27
27
|
this.repo.branch = options.appConfig.branch;
|
|
28
28
|
}
|
|
29
|
-
this.cloneDirectory = path.join(options.cloneDirectory, this.repo.name);
|
|
29
|
+
this.cloneDirectory = path.join((0, cli_utilities_1.sanitizePath)(options.cloneDirectory), (0, cli_utilities_1.sanitizePath)(this.repo.name));
|
|
30
30
|
this.ghClient = new client_1.default(this.repo, options.appConfig.private, options.accessToken);
|
|
31
31
|
this.options = options;
|
|
32
32
|
}
|
package/lib/bootstrap/utils.js
CHANGED
|
@@ -128,7 +128,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
128
128
|
case 'reactjs':
|
|
129
129
|
case 'reactjs-starter':
|
|
130
130
|
fileName = `.env.${environmentVariables.environment}.local`;
|
|
131
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
131
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
132
132
|
content = `REACT_APP_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nREACT_APP_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}${livePreviewEnabled
|
|
133
133
|
? `\nREACT_APP_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nREACT_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost}\nREACT_APP_CONTENTSTACK_APP_HOST=${appHost}\n`
|
|
134
134
|
: '\n'}\nREACT_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\n${customHost ? '\nREACT_APP_CONTENTSTACK_API_HOST=' + customHost : ''}${!isUSRegion && !customHost ? '\nREACT_APP_CONTENTSTACK_REGION=' + region.name : ''}\nSKIP_PREFLIGHT_CHECK=true\nREACT_APP_CONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
|
|
@@ -137,7 +137,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
137
137
|
case 'nextjs':
|
|
138
138
|
case 'nextjs-starter':
|
|
139
139
|
fileName = `.env.${environmentVariables.environment}.local`;
|
|
140
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
140
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
141
141
|
content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
|
|
142
142
|
? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
|
|
143
143
|
: '\n'}CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${customHost ? customHost : managementAPIHost}${!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : ''}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_LIVE_EDIT_TAGS=false`;
|
|
@@ -146,7 +146,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
146
146
|
case 'gatsby':
|
|
147
147
|
case 'gatsby-starter':
|
|
148
148
|
fileName = `.env.${environmentVariables.environment}`;
|
|
149
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
149
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
150
150
|
content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
|
|
151
151
|
? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
|
|
152
152
|
: '\n'}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${managementAPIHost}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
|
|
@@ -157,7 +157,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
157
157
|
? `\n\tpreivew_token:'${environmentVariables.preview_token || `''`}'\n\tpreview_host:'${previewHost}'\n\tapp_host:'${appHost}'\n`
|
|
158
158
|
: '\n'},\n\t\tenvironment: '${environmentVariables.environment}'${!isUSRegion && !customHost ? `,\n\t\tregion: '${region.name}'` : ''} \n\t } \n };`;
|
|
159
159
|
fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`;
|
|
160
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, 'src', 'environments', fileName));
|
|
160
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), 'src', 'environments', (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
161
161
|
result = await writeEnvFile(content, filePath);
|
|
162
162
|
break;
|
|
163
163
|
case 'angular-starter':
|
|
@@ -165,7 +165,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
165
165
|
? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
|
|
166
166
|
: '\n'}CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${customHost ? customHost : managementAPIHost}${!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : ''}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_LIVE_EDIT_TAGS=false`;
|
|
167
167
|
fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`;
|
|
168
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
168
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
169
169
|
result = await writeEnvFile(content, filePath);
|
|
170
170
|
break;
|
|
171
171
|
case 'nuxtjs':
|
|
@@ -173,7 +173,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
173
173
|
case 'nuxt3-starter':
|
|
174
174
|
case 'stencil-starter':
|
|
175
175
|
fileName = production ? '.env.production' : '.env';
|
|
176
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
176
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
177
177
|
// Note: Stencil app needs all the env variables, even if they are not having values otherwise the rollup does not work properly and throws process in undefined error.
|
|
178
178
|
content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
|
|
179
179
|
? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${customHost !== null && customHost !== void 0 ? customHost : previewHost}\nCONTENTSTACK_APP_HOST=${appHost}`
|
|
@@ -182,7 +182,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
|
|
|
182
182
|
break;
|
|
183
183
|
case 'vue-starter':
|
|
184
184
|
fileName = '.env';
|
|
185
|
-
filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
|
|
185
|
+
filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
|
|
186
186
|
content = `VUE_APP_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nVUE_APP_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
|
|
187
187
|
? `\nVUE_APP_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost}\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n`
|
|
188
188
|
: '\n'}\nVUE_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${customHost ? '\nVUE_APP_CONTENTSTACK_API_HOST=' + customHost : ''}${!isUSRegion && !customHost ? '\nVUE_APP_CONTENTSTACK_REGION=' + region.name : ''}\nVUE_APP_CONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
|
package/oclif.manifest.json
CHANGED
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.9.
|
|
4
|
+
"version": "1.9.3",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"scripts": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contentstack/cli-cm-seed": "~1.7.
|
|
20
|
+
"@contentstack/cli-cm-seed": "~1.7.5",
|
|
21
21
|
"@contentstack/cli-command": "~1.2.18",
|
|
22
|
-
"@contentstack/cli-utilities": "~1.6.
|
|
22
|
+
"@contentstack/cli-utilities": "~1.6.2",
|
|
23
23
|
"inquirer": "8.2.4",
|
|
24
24
|
"mkdirp": "^1.0.4",
|
|
25
25
|
"tar": "^6.2.1 "
|