Skip to content

Commit 5bd4313

Browse files
author
naman-contentstack
committed
Merge branch 'v2-beta-dev' into enhancement/DX-4443
2 parents f3fa60f + 7e3be0c commit 5bd4313

67 files changed

Lines changed: 2262 additions & 1412 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release-beta.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,6 @@ jobs:
293293
package: ./packages/contentstack-bootstrap/package.json
294294
tag: beta
295295

296-
# Bulk Publish
297-
- name: Installing dependencies of bulk publish
298-
id: bulk-publish-installation
299-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_bulk-publish == 'true'}}
300-
working-directory: ./packages/contentstack-bulk-publish
301-
run: npm install
302-
- name: Publishing bulk publish (Beta)
303-
uses: JS-DevTools/npm-publish@v3
304-
if: ${{ steps.bulk-publish-installation.conclusion == 'success' }}
305-
with:
306-
token: ${{ secrets.NPM_TOKEN }}
307-
package: ./packages/contentstack-bulk-publish/package.json
308-
tag: beta
309-
310296
# Branches
311297
- name: Installing dependencies of branches
312298
id: branches-installation

.talismanrc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11

22
fileignoreconfig:
3-
- filename: package-lock.json
4-
checksum: fa2c81c72305bc19fa4f64457af1000aa2f0c179ecb7e46a5fc9d8b760c705a7
3+
- filename: packages/contentstack-import/src/import/modules/environments.ts
4+
checksum: f61c635eaec8026e0cfa80a5ab8272f7946531f6d89505dc0d247b4c7ab0eab7
55
- filename: pnpm-lock.yaml
6-
checksum: faaef9e003c5ba45e56ab1ca24a4fc285f53a2b9ecc6d3dbd11e7130a31db4a2
7-
- filename: packages/contentstack-clone/src/core/util/clone-handler.ts
8-
checksum: 0a7ed55e96aa5a94084538b4a480608593b04c316bf02cf54cdd3a647e9b714c
6+
checksum: e96e05b21091fede31e67eea7814321cb9a887dfd2c8f9b81e4bc8a47ebf1624
7+
- filename: package-lock.json
8+
checksum: 270916294e02bdf230fbdd3f6d7c370ff326697ff7a98754c3a9904420b8c7f4
9+
- filename: packages/contentstack-bootstrap/src/bootstrap/utils.ts
10+
checksum: 5ab20e057fa9c4c300f7a882d30e1c68bbc91ed19de520488107e8c37239682a
11+
- filename: packages/contentstack-migration/README.md
12+
checksum: 0deea9c8e43a89a4f20fb25ffe1a38cccd19020fe4fedae80f1ca24d34307f2b
13+
- filename: packages/contentstack-import/src/import/modules/taxonomies.ts
14+
checksum: f4f44b6031d2936ec2da98b39bb5f5c1bd0f3be34dbe498c75e64a35b7d25a33
15+
- filename: packages/contentstack/README.md
16+
checksum: 3a0fab964797476a71d2149ce261d265f410bd756eb9cde9400be9e5250fdc35
917
version: '1.0'

package-lock.json

Lines changed: 811 additions & 621 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ npm install -g @contentstack/cli-audit
1919
$ csdx COMMAND
2020
running command...
2121
$ csdx (--version|-v)
22-
@contentstack/cli-audit/2.0.0-beta.2 darwin-arm64 node-v24.12.0
22+
@contentstack/cli-audit/2.0.0-beta.3 darwin-arm64 node-v24.12.0
2323
$ csdx --help [COMMAND]
2424
USAGE
2525
$ csdx COMMAND

packages/contentstack-audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-audit",
3-
"version": "2.0.0-beta.2",
3+
"version": "2.0.0-beta.3",
44
"description": "Contentstack audit plugin",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/cli",
@@ -25,7 +25,7 @@
2525
"chalk": "^4.1.2",
2626
"fast-csv": "^4.3.6",
2727
"fs-extra": "^11.3.0",
28-
"lodash": "^4.17.21",
28+
"lodash": "^4.17.23",
2929
"uuid": "^9.0.1",
3030
"winston": "^3.17.0"
3131
},

packages/contentstack-audit/src/audit-base-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
237237

238238
// Extract logConfig and showConsoleLogs once before the loop to reuse throughout
239239
const logConfig = configHandler.get('log') || {};
240-
const showConsoleLogs = logConfig.showConsoleLogs ?? true;
240+
const showConsoleLogs = logConfig.showConsoleLogs ?? false;
241241

242242
for (const module of this.sharedConfig.flags.modules || this.sharedConfig.modules) {
243243
// Update audit context with current module

packages/contentstack-bootstrap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ npm install -g @contentstack/cli-cm-bootstrap
1515
$ csdx COMMAND
1616
running command...
1717
$ csdx (--version)
18-
@contentstack/cli-cm-bootstrap/2.0.0-beta.6 darwin-arm64 node-v24.12.0
18+
@contentstack/cli-cm-bootstrap/2.0.0-beta.7 darwin-arm64 node-v24.12.0
1919
$ csdx --help [COMMAND]
2020
USAGE
2121
$ csdx COMMAND

packages/contentstack-bootstrap/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-bootstrap",
33
"description": "Bootstrap contentstack apps",
4-
"version": "2.0.0-beta.6",
4+
"version": "2.0.0-beta.7",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -16,14 +16,14 @@
1616
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
1717
},
1818
"dependencies": {
19-
"@contentstack/cli-cm-seed": "~2.0.0-beta.6",
19+
"@contentstack/cli-cm-seed": "~2.0.0-beta.7",
2020
"@contentstack/cli-command": "~1.7.2",
2121
"@contentstack/cli-utilities": "~1.17.2",
2222
"@oclif/core": "^4.3.0",
23-
"@oclif/plugin-help": "^6.2.28",
23+
"@oclif/plugin-help": "^6.2.37",
2424
"inquirer": "8.2.7",
2525
"mkdirp": "^1.0.4",
26-
"tar": "^7.5.6 "
26+
"tar": "^7.5.7"
2727
},
2828
"devDependencies": {
2929
"@oclif/test": "^4.1.13",
@@ -38,7 +38,7 @@
3838
"mocha": "10.8.2",
3939
"nyc": "^15.1.0",
4040
"oclif": "^4.17.46",
41-
"tmp": "^0.2.3",
41+
"tmp": "^0.2.5",
4242
"ts-node": "^8.10.2",
4343
"typescript": "^4.9.5"
4444
},

packages/contentstack-bootstrap/src/bootstrap/utils.ts

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { cliux, pathValidator, sanitizePath } from '@contentstack/cli-utilities'
44
import { continueBootstrapCommand } from '../bootstrap/interactive';
55
import { AppConfig } from '../config';
66
import messageHandler from '../messages';
7+
import { regions } from '@contentstack/cli-config/lib/utils/region-handler';
78

89
interface EnvironmentVariables {
910
api_key: string;
@@ -187,27 +188,59 @@ const envFileHandler = async (
187188
const cdnHost = region?.cda?.substring('8');
188189
const appHost = region?.uiHost?.substring(8);
189190
const isUSRegion = regionName === 'us' || regionName === 'na';
191+
192+
const isPredefinedRegion = region?.name && Object.keys(regions).some(
193+
key => key.toLowerCase() === region.name.toLowerCase()
194+
);
195+
190196
if (regionName !== 'eu' && !isUSRegion) {
191197
customHost = region?.cma?.substring(8);
192198
}
193-
let graphqlHost = "graphql.contentstack.com";
194-
if(regionName != 'na'){
195-
graphqlHost = `${regionName}-.graphql.contentstack.com`;
196-
}
197-
198199

199-
// Construct image hostname based on the actual host being used
200-
let imageHostname = '*-images.contentstack.com'; // default fallback
201-
if (region?.cda) {
200+
const getGraphqlHost = (): string => {
201+
if (!isPredefinedRegion) {
202+
return cdnHost.replace('-cdn.', '-graphql.');
203+
}
204+
const normalizedRegion = regionName?.toLowerCase();
205+
if (!normalizedRegion || normalizedRegion === 'na' || normalizedRegion === 'aws-na' || normalizedRegion === 'us') {
206+
return cdnHost.replace('cdn.', 'graphql.').replace('.io', '.com');
207+
}
208+
return cdnHost.replace('-cdn.', '-graphql.');
209+
};
210+
const graphqlHost = getGraphqlHost();
211+
212+
let imageHostname: string;
213+
if (isPredefinedRegion && region?.cda) {
202214
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
203215
imageHostname = `images.${baseHost}`;
216+
} else if (region?.cda) {
217+
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
218+
imageHostname = `*-images.${baseHost}`;
219+
} else {
220+
//default
221+
imageHostname = '*-images.contentstack.com';
204222
}
205223
const production = environmentVariables.environment === 'production' ? true : false;
206224
switch (appConfigKey) {
207225
case 'kickstart-next':
208226
case 'kickstart-next-ssr':
209227
case 'kickstart-next-ssg':
210228
case 'kickstart-next-middleware':
229+
fileName = `.env`;
230+
filePath = pathValidator(path.join(sanitizePath(clonedDirectory), sanitizePath(fileName)));
231+
content = `NEXT_PUBLIC_CONTENTSTACK_API_KEY=${environmentVariables.api_key
232+
}\nNEXT_PUBLIC_CONTENTSTACK_DELIVERY_TOKEN=${environmentVariables.deliveryToken
233+
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || ''
234+
}\nNEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment
235+
}\nNEXT_PUBLIC_CONTENTSTACK_REGION=${regionName
236+
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW=${livePreviewEnabled ? 'true' : 'false'
237+
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${cdnHost
238+
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION = ${appHost
239+
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST = ${previewHost
240+
}\nNEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME=${imageHostname}`;
241+
242+
result = await writeEnvFile(content, filePath);
243+
break;
211244
case 'kickstart-next-graphql':
212245
fileName = `.env`;
213246
filePath = pathValidator(path.join(sanitizePath(clonedDirectory), sanitizePath(fileName)));

packages/contentstack-branches/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@contentstack/cli-utilities": "~1.17.2",
1212
"chalk": "^4.1.2",
1313
"just-diff": "^6.0.2",
14-
"lodash": "^4.17.21"
14+
"lodash": "^4.17.23"
1515
},
1616
"devDependencies": {
1717
"@contentstack/cli-dev-dependencies": "~1.3.0",

0 commit comments

Comments
 (0)