Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 20001b2b16e2ab8cc8a3ccc30cebb5093c5c63f58e5b5fe64889d260a8d4cc56
checksum: 09bde87514151440d68bc6154984a984c536728e37d18173bab4fdb53827dadd
- filename: pnpm-lock.yaml
checksum: c2982bbd478bd9aabcc12bc162d2a76e2635d70023674a677dea996a8671e9ab
checksum: e81b8b629ff23df0cd27af8c055c9bb3718b68e388fd9ff5e3485ef37bfe794b
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
checksum: 6e6fb00bb11b03141e5ad27eeaa4af9718dc30520c3e73970bc208cc0ba2a7d2
version: '1.0'
798 changes: 371 additions & 427 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"chalk": "^4.1.2",
"fast-csv": "^4.3.6",
"fs-extra": "^11.3.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"uuid": "^9.0.1",
"winston": "^3.17.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.18.2",
"version": "1.18.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down
49 changes: 41 additions & 8 deletions packages/contentstack-bootstrap/src/bootstrap/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { cliux, pathValidator, sanitizePath } from '@contentstack/cli-utilities'
import { continueBootstrapCommand } from '../bootstrap/interactive';
import { AppConfig } from '../config';
import messageHandler from '../messages';
import { regions } from '@contentstack/cli-config/lib/utils/region-handler';

interface EnvironmentVariables {
api_key: string;
Expand Down Expand Up @@ -187,27 +188,59 @@ const envFileHandler = async (
const cdnHost = region?.cda?.substring('8');
const appHost = region?.uiHost?.substring(8);
const isUSRegion = regionName === 'us' || regionName === 'na';

const isPredefinedRegion = region?.name && Object.keys(regions).some(
key => key.toLowerCase() === region.name.toLowerCase()
);

if (regionName !== 'eu' && !isUSRegion) {
customHost = region?.cma?.substring(8);
}
let graphqlHost = "graphql.contentstack.com";
if(regionName != 'na'){
graphqlHost = `${regionName}-.graphql.contentstack.com`;
}


// Construct image hostname based on the actual host being used
let imageHostname = '*-images.contentstack.com'; // default fallback
if (region?.cda) {
const getGraphqlHost = (): string => {
if (!isPredefinedRegion) {
return cdnHost.replace('-cdn.', '-graphql.');
}
const normalizedRegion = regionName?.toLowerCase();
if (!normalizedRegion || normalizedRegion === 'na' || normalizedRegion === 'aws-na' || normalizedRegion === 'us') {
return cdnHost.replace('cdn.', 'graphql.').replace('.io', '.com');
}
return cdnHost.replace('-cdn.', '-graphql.');
};
const graphqlHost = getGraphqlHost();

let imageHostname: string;
if (isPredefinedRegion && region?.cda) {
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
imageHostname = `images.${baseHost}`;
} else if (region?.cda) {
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
imageHostname = `*-images.${baseHost}`;
} else {
//default
imageHostname = '*-images.contentstack.com';
}
const production = environmentVariables.environment === 'production' ? true : false;
switch (appConfigKey) {
case 'kickstart-next':
case 'kickstart-next-ssr':
case 'kickstart-next-ssg':
case 'kickstart-next-middleware':
fileName = `.env`;
filePath = pathValidator(path.join(sanitizePath(clonedDirectory), sanitizePath(fileName)));
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 = ${cdnHost
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION = ${appHost
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST = ${previewHost
}\nNEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME=${imageHostname}`;

result = await writeEnvFile(content, filePath);
break;
case 'kickstart-next-graphql':
fileName = `.env`;
filePath = pathValidator(path.join(sanitizePath(clonedDirectory), sanitizePath(fileName)));
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@contentstack/cli-utilities": "~1.17.1",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.21"
"lodash": "^4.17.23"
},
"devDependencies": {
"@contentstack/cli-dev-dependencies": "~1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"chalk": "^4.1.2",
"dotenv": "^16.5.0",
"inquirer": "8.2.7",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"winston": "^3.17.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
"inquirer": "8.2.7",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"merge": "^2.1.1",
"ora": "^5.4.1",
"prompt": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@contentstack/cli-utilities": "~1.17.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.21"
"lodash": "^4.17.23"
},
"devDependencies": {
"@oclif/test": "^4.1.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-dev-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"license": "MIT",
"dependencies": {
"@oclif/core": "^4.3.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"fancy-test": "^2.0.42",
"@oclif/test": "^4.1.13"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
"chalk": "^4.1.2",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"merge": "^2.1.1",
"mkdirp": "^1.0.4",
"progress-stream": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"big-json": "^3.2.0",
"chalk": "^4.1.2",
"fs-extra": "^11.3.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"merge": "^2.1.1",
"mkdirp": "^1.0.4",
"winston": "^3.17.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"chalk": "^4.1.2",
"debug": "^4.4.1",
"fs-extra": "^11.3.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"marked": "^4.3.0",
"merge": "^2.1.1",
"mkdirp": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migrate-rte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"chalk": "^4.1.2",
"jsdom": "^20.0.3",
"jsonschema": "^1.5.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"nock": "^13.5.6",
"omit-deep-lodash": "^1.1.7",
"sinon": "^21.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"inquirer-search-list": "^1.2.6",
"js-yaml": "^4.1.1",
"klona": "^2.0.6",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"mkdirp": "^1.0.4",
"open": "^8.4.2",
"ora": "^5.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-variants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@contentstack/cli-utilities": "~1.17.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"mkdirp": "^1.0.4",
"winston": "^3.17.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.57.0",
"version": "1.57.1",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run.js"
Expand All @@ -26,7 +26,7 @@
"@contentstack/cli-cm-export": "~1.23.1",
"@contentstack/cli-cm-import": "~1.31.2",
"@contentstack/cli-auth": "~1.7.3",
"@contentstack/cli-cm-bootstrap": "~1.18.2",
"@contentstack/cli-cm-bootstrap": "~1.18.3",
"@contentstack/cli-cm-branches": "~1.6.3",
"@contentstack/cli-cm-bulk-publish": "~1.10.6",
"@contentstack/cli-cm-clone": "~1.20.1",
Expand Down
34 changes: 17 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading