From b83c8cd2d1cd4ed1c42908a88f4a36fd496b968f Mon Sep 17 00:00:00 2001 From: shafeeqd959 Date: Wed, 29 Nov 2023 15:47:41 +0530 Subject: [PATCH 1/2] updated bootstrap nextjs starter app --- packages/contentstack-bootstrap/src/bootstrap/index.ts | 10 ++++++++++ packages/contentstack-bootstrap/src/bootstrap/utils.ts | 6 +++--- packages/contentstack-bootstrap/src/config.ts | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/contentstack-bootstrap/src/bootstrap/index.ts b/packages/contentstack-bootstrap/src/bootstrap/index.ts index ba33cb3dbc..e0162e92f3 100644 --- a/packages/contentstack-bootstrap/src/bootstrap/index.ts +++ b/packages/contentstack-bootstrap/src/bootstrap/index.ts @@ -112,6 +112,16 @@ export default class Bootstrap { } else { throw new Error(messageHandler.parse('CLI_BOOTSTRAP_NO_API_KEY_FOUND')); } + + if (this.options.livePreviewEnabled) { + cliux.print( + 'Important: set management token and app host in the environment file before running the application', + { + color: 'yellow', + }, + ); + } + cliux.print(messageHandler.parse('CLI_BOOTSTRAP_SUCCESS')); } catch (error) { cliux.error(messageHandler.parse('CLI_BOOTSTRAP_STACK_CREATION_FAILED', this.appConfig.stack)); diff --git a/packages/contentstack-bootstrap/src/bootstrap/utils.ts b/packages/contentstack-bootstrap/src/bootstrap/utils.ts index 351b1aa638..4ee10a9588 100644 --- a/packages/contentstack-bootstrap/src/bootstrap/utils.ts +++ b/packages/contentstack-bootstrap/src/bootstrap/utils.ts @@ -152,11 +152,11 @@ const envFileHandler = async ( filePath = path.join(clonedDirectory, fileName); content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${ environmentVariables.deliveryToken - }\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${ - customHost ? '\nCONTENTSTACK_API_HOST=' + customHost : '' + }\nCONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${ + customHost ? customHost : managementAPIHost }${ !isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '' - }\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`; + }\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_MANAGEMENT_TOKEN=''\nCONTENTSTACK_APP_HOST=''\nCONTENTSTACK_LIVE_EDIT_TAGS=false`; result = await writeEnvFile(content, filePath); break; case 'gatsby': diff --git a/packages/contentstack-bootstrap/src/config.ts b/packages/contentstack-bootstrap/src/config.ts index 307fc8c744..75bba63dc1 100644 --- a/packages/contentstack-bootstrap/src/config.ts +++ b/packages/contentstack-bootstrap/src/config.ts @@ -61,6 +61,7 @@ const config: Configuration = { 'nextjs-starter': { source: 'contentstack/contentstack-nextjs-starter-app', stack: 'contentstack/stack-starter-app', + branch: 'master', }, 'gatsby-starter': { source: 'contentstack/contentstack-gatsby-starter-app', From 13713138c87ef17b532b450000eca61bad540cd9 Mon Sep 17 00:00:00 2001 From: shafeeqd959 Date: Wed, 29 Nov 2023 15:48:08 +0530 Subject: [PATCH 2/2] removed explicit repo branch --- packages/contentstack-bootstrap/src/config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/contentstack-bootstrap/src/config.ts b/packages/contentstack-bootstrap/src/config.ts index 75bba63dc1..307fc8c744 100644 --- a/packages/contentstack-bootstrap/src/config.ts +++ b/packages/contentstack-bootstrap/src/config.ts @@ -61,7 +61,6 @@ const config: Configuration = { 'nextjs-starter': { source: 'contentstack/contentstack-nextjs-starter-app', stack: 'contentstack/stack-starter-app', - branch: 'master', }, 'gatsby-starter': { source: 'contentstack/contentstack-gatsby-starter-app',