@contentstack/cli-cm-bootstrap 1.9.2 → 1.9.4

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.9.2 linux-x64 node-v18.20.2
18
+ @contentstack/cli-cm-bootstrap/1.9.4 linux-x64 node-v18.20.4
19
19
  $ csdx --help [COMMAND]
20
20
  USAGE
21
21
  $ csdx COMMAND
@@ -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
  }
@@ -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,15 @@ 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
+ content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
142
+ ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
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`;
144
+ result = await writeEnvFile(content, filePath);
145
+ break;
146
+ case 'compass-app':
147
+ fileName = '.env';
148
+ filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
141
149
  content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
142
150
  ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
143
151
  : '\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 +154,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
146
154
  case 'gatsby':
147
155
  case 'gatsby-starter':
148
156
  fileName = `.env.${environmentVariables.environment}`;
149
- filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
157
+ filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
150
158
  content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
151
159
  ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
152
160
  : '\n'}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${managementAPIHost}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`;
@@ -157,7 +165,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
157
165
  ? `\n\tpreivew_token:'${environmentVariables.preview_token || `''`}'\n\tpreview_host:'${previewHost}'\n\tapp_host:'${appHost}'\n`
158
166
  : '\n'},\n\t\tenvironment: '${environmentVariables.environment}'${!isUSRegion && !customHost ? `,\n\t\tregion: '${region.name}'` : ''} \n\t } \n };`;
159
167
  fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`;
160
- filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, 'src', 'environments', fileName));
168
+ filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), 'src', 'environments', (0, cli_utilities_1.sanitizePath)(fileName)));
161
169
  result = await writeEnvFile(content, filePath);
162
170
  break;
163
171
  case 'angular-starter':
@@ -165,7 +173,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
165
173
  ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`
166
174
  : '\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
175
  fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`;
168
- 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)));
169
177
  result = await writeEnvFile(content, filePath);
170
178
  break;
171
179
  case 'nuxtjs':
@@ -173,7 +181,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
173
181
  case 'nuxt3-starter':
174
182
  case 'stencil-starter':
175
183
  fileName = production ? '.env.production' : '.env';
176
- filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
184
+ filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
177
185
  // 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
186
  content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
179
187
  ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${customHost !== null && customHost !== void 0 ? customHost : previewHost}\nCONTENTSTACK_APP_HOST=${appHost}`
@@ -182,7 +190,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
182
190
  break;
183
191
  case 'vue-starter':
184
192
  fileName = '.env';
185
- filePath = (0, cli_utilities_1.pathValidator)(path.join(clonedDirectory, fileName));
193
+ filePath = (0, cli_utilities_1.pathValidator)(path.join((0, cli_utilities_1.sanitizePath)(clonedDirectory), (0, cli_utilities_1.sanitizePath)(fileName)));
186
194
  content = `VUE_APP_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nVUE_APP_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\n${livePreviewEnabled
187
195
  ? `\nVUE_APP_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost}\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n`
188
196
  : '\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/lib/config.js CHANGED
@@ -18,6 +18,7 @@ const config = {
18
18
  { displayName: 'Vue JS', configKey: 'vue-starter' },
19
19
  { displayName: 'Stencil', configKey: 'stencil-starter' },
20
20
  { displayName: 'Nuxt3', configKey: 'nuxt3-starter' },
21
+ // { displayName: 'Compass App', configKey: 'compass-app' }
21
22
  ],
22
23
  appLevelConfig: {
23
24
  nextjs: {
@@ -36,6 +37,10 @@ const config = {
36
37
  source: 'contentstack/contentstack-angular-modularblock-example',
37
38
  stack: 'contentstack/stack-contentstack-angular-modularblock-example',
38
39
  },
40
+ 'compass-app': {
41
+ source: 'SunilLsagar/universal-demo',
42
+ stack: 'SunilLsagar/stack-universal-demo',
43
+ },
39
44
  'nuxtjs-disabled': {
40
45
  source: 'contentstack/contentstack-nuxtjs-vue-universal-demo',
41
46
  stack: 'shafeeqd959/stack-contentstack-nuxtjs-vue-universal-demo',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.2",
2
+ "version": "1.9.4",
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.9.2",
4
+ "version": "1.9.4",
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.4",
21
- "@contentstack/cli-command": "~1.2.18",
22
- "@contentstack/cli-utilities": "~1.6.1",
20
+ "@contentstack/cli-cm-seed": "~1.7.6",
21
+ "@contentstack/cli-command": "~1.2.19",
22
+ "@contentstack/cli-utilities": "~1.7.0",
23
23
  "inquirer": "8.2.4",
24
24
  "mkdirp": "^1.0.4",
25
25
  "tar": "^6.2.1 "