From d4ade05a747474f9891ed3796386d2c5a11f3848 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Thu, 15 Feb 2024 15:56:29 +0530 Subject: [PATCH] nuxt3 added, deperaction warning for nuxt, env file creation for angular app and version bump --- package-lock.json | 4 +-- packages/contentstack-bootstrap/package.json | 2 +- .../src/bootstrap/utils.ts | 34 +++++++++++-------- packages/contentstack-bootstrap/src/config.ts | 7 +++- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 2 +- 6 files changed, 30 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf5efad16a..43c7c35d96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23545,7 +23545,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-auth": "~1.3.17", - "@contentstack/cli-cm-bootstrap": "~1.8.0", + "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-clone": "~1.10.0", @@ -23917,7 +23917,7 @@ }, "packages/contentstack-bootstrap": { "name": "@contentstack/cli-cm-bootstrap", - "version": "1.8.0", + "version": "1.9.0", "license": "MIT", "dependencies": { "@contentstack/cli-cm-seed": "~1.7.0", diff --git a/packages/contentstack-bootstrap/package.json b/packages/contentstack-bootstrap/package.json index a7c52f1f5a..6ab12662ce 100644 --- a/packages/contentstack-bootstrap/package.json +++ b/packages/contentstack-bootstrap/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/cli-cm-bootstrap", "description": "Bootstrap contentstack apps", - "version": "1.8.0", + "version": "1.9.0", "author": "Contentstack", "bugs": "https://github.com/contentstack/cli/issues", "scripts": { diff --git a/packages/contentstack-bootstrap/src/bootstrap/utils.ts b/packages/contentstack-bootstrap/src/bootstrap/utils.ts index daa053e1ae..255c8fbd28 100644 --- a/packages/contentstack-bootstrap/src/bootstrap/utils.ts +++ b/packages/contentstack-bootstrap/src/bootstrap/utils.ts @@ -197,7 +197,10 @@ const envFileHandler = async ( environmentVariables.deliveryToken }\n${ livePreviewEnabled - ? `\nCONTENTSTACK_PREVIEW_TOKEN=${environmentVariables.preview_token || `''`}\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n`: '\n' + ? `\nCONTENTSTACK_PREVIEW_TOKEN=${ + environmentVariables.preview_token || `''` + }\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n` + : '\n' }\nCONTENTSTACK_ENVIRONMENT=${ environmentVariables.environment }\nCONTENTSTACK_API_HOST=${managementAPIHost}\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}`; @@ -217,29 +220,31 @@ const envFileHandler = async ( },\n\t\tenvironment: '${environmentVariables.environment}'${ !isUSRegion && !customHost ? `,\n\t\tregion: '${region.name}'` : '' } \n\t } \n };`; - fileName = `environment${environmentVariables.environment === 'production' ? '.prod.' : '.'}ts`; + fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`; filePath = path.join(clonedDirectory, 'src', 'environments', fileName); result = await writeEnvFile(content, filePath); break; case 'angular-starter': - content = `export const environment = { \n\tproduction: true \n}; \nexport const Config = { \n\tapi_key: '${ - environmentVariables.api_key - }', \n\tdelivery_token: '${environmentVariables.deliveryToken}',\n\t${ + content = `CONTENTSTACK_API_KEY=${environmentVariables.api_key}\nCONTENTSTACK_DELIVERY_TOKEN=${ + environmentVariables.deliveryToken + }\n${ livePreviewEnabled - ? `\npreview_token:'${environmentVariables.preview_token || ''}',\npreview_host:'${previewHost - }',\napp_host:'${appHost}'` + ? `\nCONTENTSTACK_PREVIEW_TOKEN=${ + environmentVariables.preview_token || `''` + }\nCONTENTSTACK_PREVIEW_HOST=${previewHost}\nCONTENTSTACK_APP_HOST=${appHost}\n` : '\n' - },\n\tenvironment: '${environmentVariables.environment}'${ - !isUSRegion && !customHost ? `,\n\tregion: '${region.name}'` : '' - },\n\tapi_host: '${ + }CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}\nCONTENTSTACK_API_HOST=${ customHost ? customHost : managementAPIHost - }',\n\tlive_preview: ${livePreviewEnabled}\n};`; - fileName = `environment${environmentVariables.environment === 'production' ? '.prod.' : '.'}ts`; - filePath = path.join(clonedDirectory, 'src', 'environments', fileName); + }${ + !isUSRegion && !customHost ? '\nCONTENTSTACK_REGION=' + region.name : '' + }\nCONTENTSTACK_LIVE_PREVIEW=${livePreviewEnabled}\nCONTENTSTACK_LIVE_EDIT_TAGS=false`; + fileName = `.env${environmentVariables.environment === 'production' ? '.prod' : ''}`; + filePath = path.join(clonedDirectory, fileName); result = await writeEnvFile(content, filePath); break; case 'nuxtjs': case 'nuxt-starter': + case 'nuxt3-starter': case 'stencil-starter': fileName = production ? '.env.production' : '.env'; filePath = path.join(clonedDirectory, fileName); @@ -268,8 +273,7 @@ const envFileHandler = async ( livePreviewEnabled ? `\nVUE_APP_CONTENTSTACK_PREVIEW_TOKEN=${ environmentVariables.preview_token || `''` - }\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost - }\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n` + }\nVUE_APP_CONTENTSTACK_PREVIEW_HOST=${previewHost}\nVUE_APP_CONTENTSTACK_APP_HOST=${appHost}\n` : '\n' }\nVUE_APP_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment}${ customHost ? '\nVUE_APP_CONTENTSTACK_API_HOST=' + customHost : '' diff --git a/packages/contentstack-bootstrap/src/config.ts b/packages/contentstack-bootstrap/src/config.ts index 307fc8c744..99f85fd26d 100644 --- a/packages/contentstack-bootstrap/src/config.ts +++ b/packages/contentstack-bootstrap/src/config.ts @@ -25,9 +25,10 @@ const config: Configuration = { { displayName: 'Next JS', configKey: 'nextjs-starter' }, { displayName: 'Gatsby', configKey: 'gatsby-starter' }, { displayName: 'Angular', configKey: 'angular-starter' }, - { displayName: 'Nuxt JS', configKey: 'nuxt-starter' }, + { displayName: 'Nuxt JS (To be Deprecated)', configKey: 'nuxt-starter' }, { displayName: 'Vue JS', configKey: 'vue-starter' }, { displayName: 'Stencil', configKey: 'stencil-starter' }, + { displayName: 'Nuxt3', configKey: 'nuxt3-starter' }, ], appLevelConfig: { nextjs: { @@ -78,6 +79,10 @@ const config: Configuration = { source: 'contentstack/contentstack-stencil-starter-app', stack: 'contentstack/stack-starter-app', }, + 'nuxt3-starter': { + source: 'contentstack/contentstack-nuxt3-starter-app', + stack: 'contentstack/stack-starter-app', + }, }, }; export default config; diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index 62b7ba57d8..f48d578c82 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -24,7 +24,7 @@ "dependencies": { "@contentstack/cli-audit": "~1.4.0", "@contentstack/cli-auth": "~1.3.17", - "@contentstack/cli-cm-bootstrap": "~1.8.0", + "@contentstack/cli-cm-bootstrap": "~1.9.0", "@contentstack/cli-cm-branches": "~1.0.22", "@contentstack/cli-cm-bulk-publish": "~1.4.0", "@contentstack/cli-cm-export": "~1.10.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2be68a439..622cf7a2bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,7 +12,7 @@ importers: specifiers: '@contentstack/cli-audit': ~1.4.0 '@contentstack/cli-auth': ~1.3.17 - '@contentstack/cli-cm-bootstrap': ~1.8.0 + '@contentstack/cli-cm-bootstrap': ~1.9.0 '@contentstack/cli-cm-branches': ~1.0.22 '@contentstack/cli-cm-bulk-publish': ~1.4.0 '@contentstack/cli-cm-clone': ~1.10.0