@contentstack/cli-cm-bootstrap 1.0.5 → 1.0.6

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
@@ -13,7 +13,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
13
13
  $ csdx COMMAND
14
14
  running command...
15
15
  $ csdx (-v|--version|version)
16
- @contentstack/cli-cm-bootstrap/1.0.5 linux-x64 node-v12.22.7
16
+ @contentstack/cli-cm-bootstrap/1.0.6 linux-x64 node-v16.14.2
17
17
  $ csdx --help [COMMAND]
18
18
  USAGE
19
19
  $ csdx COMMAND
@@ -57,5 +57,5 @@ EXAMPLES
57
57
  $ csdx cm:bootstrap -t <github access token>
58
58
  ```
59
59
 
60
- _See code: [src/commands/cm/bootstrap.ts](https://github.com/contentstack/cli/blob/v1.0.5/src/commands/cm/bootstrap.ts)_
60
+ _See code: [src/commands/cm/bootstrap.ts](https://github.com/contentstack/cli/blob/v1.0.6/src/commands/cm/bootstrap.ts)_
61
61
  <!-- commandsstop -->
@@ -93,7 +93,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
93
93
  const regionName = region && region.name && region.name.toLowerCase();
94
94
  const isUSRegion = (regionName === 'us' || regionName === 'na');
95
95
  if (regionName !== 'eu' && !isUSRegion) {
96
- customHost = region.cda && region.cda.substring('8');
96
+ customHost = region.cma && region.cma.substring('8');
97
97
  }
98
98
  const production = (environmentVariables.environment === 'production' ? true : false);
99
99
  switch (appConfigKey) {
@@ -101,21 +101,21 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
101
101
  case 'reactjs-starter':
102
102
  fileName = `.env.${environmentVariables.environment}.local`;
103
103
  filePath = path.join(clonedDirectory, fileName);
104
- content = `REACT_APP_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nREACT_APP_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nREACT_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nREACT_APP_CONTENTSTACK_CUSTOM_HOST=' + customHost : '')}${(!isUSRegion && !customHost) ? '\nREACT_APP_CONTENTSTACK_REGION=' + region.name : ''}`;
104
+ content = `REACT_APP_CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nREACT_APP_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nREACT_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nREACT_APP_CONTENTSTACK_API_HOST=' + customHost : '')}${(!isUSRegion && !customHost) ? '\nREACT_APP_CONTENTSTACK_REGION=' + region.name : ''}\nSKIP_PREFLIGHT_CHECK=true`;
105
105
  result = await writeEnvFile(content, filePath);
106
106
  break;
107
107
  case 'nextjs':
108
108
  case 'nextjs-starter':
109
109
  fileName = `.env.${environmentVariables.environment}.local`;
110
110
  filePath = path.join(clonedDirectory, fileName);
111
- content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nCONTENTSTACK_CUSTOM_HOST=' + customHost : '')}${(!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '')}`;
111
+ content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nCONTENTSTACK_API_HOST=' + customHost : '')}${(!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '')}`;
112
112
  result = await writeEnvFile(content, filePath);
113
113
  break;
114
114
  case 'gatsby':
115
115
  case 'gatsby-starter':
116
116
  fileName = `.env.${environmentVariables.environment}`;
117
117
  filePath = path.join(clonedDirectory, fileName);
118
- content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_CDN=${region.cda}/v3`;
118
+ content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nCONTENTSTACK_API_HOST=' + customHost : '')}${(!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '')}`;
119
119
  result = await writeEnvFile(content, filePath);
120
120
  break;
121
121
  case 'angular':
@@ -125,7 +125,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
125
125
  result = await writeEnvFile(content, filePath);
126
126
  break;
127
127
  case 'angular-starter':
128
- content = `export const environment = { \n\tproduction: true \n}; \nexport const Config = { \n\tapi_key: '${environmentVariables.api_key}', \n\tdelivery_token: '${environmentVariables.deliveryToken}', \n\tenvironment: '${environmentVariables.environment}'${(!isUSRegion && !customHost ? `,\n\tregion: '${region.name}'` : '')} \n};`;
128
+ content = `export const environment = { \n\tproduction: true \n}; \nexport const Config = { \n\tapi_key: '${environmentVariables.api_key}', \n\tdelivery_token: '${environmentVariables.deliveryToken}', \n\tenvironment: '${environmentVariables.environment}'${(!isUSRegion && !customHost ? `,\n\tregion: '${region.name}'` : '')},\n\tapi_host: '${customHost ? customHost : ''}',\n\tapp_host: '',\n\tmanagement_token: '',\n\tlive_preview: ''\n};`;
129
129
  fileName = `environment${(environmentVariables.environment === 'production' ? '.prod.' : ".")}ts`;
130
130
  filePath = path.join(clonedDirectory, 'src', 'environments', fileName);
131
131
  result = await writeEnvFile(content, filePath);
@@ -134,7 +134,7 @@ const envFileHandler = async (appConfigKey, environmentVariables, clonedDirector
134
134
  case 'nuxt-starter':
135
135
  fileName = (production ? '.env.production' : '.env');
136
136
  filePath = path.join(clonedDirectory, fileName);
137
- content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '')}`;
137
+ content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken}\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${(customHost ? '\nCONTENTSTACK_API_HOST=' + customHost : '')}${(!isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '')}`;
138
138
  result = await writeEnvFile(content, filePath);
139
139
  break;
140
140
  default:
@@ -1 +1 @@
1
- {"version":"1.0.5","commands":{"cm:bootstrap":{"id":"cm:bootstrap","description":"Bootstrap contentstack apps","pluginName":"@contentstack/cli-cm-bootstrap","pluginType":"core","aliases":[],"examples":["$ csdx cm:bootstrap","$ csdx cm:bootstrap -d <path/to/setup/the/app>","$ csdx cm:bootstrap -t <github access token>"],"flags":{"appName":{"name":"appName","type":"option","char":"a","description":"App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter","required":false},"directory":{"name":"directory","type":"option","char":"d","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","required":false},"accessToken":{"name":"accessToken","type":"option","char":"t","description":"Access token for private github repo","required":false},"appType":{"name":"appType","type":"option","char":"s","description":"Sample or Starter app","hidden":true,"required":false}},"args":[]}}}
1
+ {"version":"1.0.6","commands":{"cm:bootstrap":{"id":"cm:bootstrap","description":"Bootstrap contentstack apps","pluginName":"@contentstack/cli-cm-bootstrap","pluginType":"core","aliases":[],"examples":["$ csdx cm:bootstrap","$ csdx cm:bootstrap -d <path/to/setup/the/app>","$ csdx cm:bootstrap -t <github access token>"],"flags":{"appName":{"name":"appName","type":"option","char":"a","description":"App name, reactjs-starter, nextjs-starter, gatsby-starter, angular-starter, nuxt-starter","required":false},"directory":{"name":"directory","type":"option","char":"d","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","required":false},"accessToken":{"name":"accessToken","type":"option","char":"t","description":"Access token for private github repo","required":false},"appType":{"name":"appType","type":"option","char":"s","description":"Sample or Starter app","hidden":true,"required":false}},"args":[]}}}
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.0.5",
4
+ "version": "1.0.6",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "scripts": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@contentstack/cli-command": "^0.1.1-beta.6",
21
- "@contentstack/cli-cm-seed": "^1.0.10",
21
+ "@contentstack/cli-cm-seed": "^1.0.11",
22
22
  "@contentstack/management": "^1.3.0",
23
23
  "@oclif/command": "^1.8.0",
24
24
  "@oclif/config": "^1.17.0",