From cb0ab4aacfc5298b92d2fac5235faf7b673048f3 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Wed, 17 Jul 2024 19:41:44 +0530 Subject: [PATCH 01/16] feat: added more boilerplate template apps --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/app/create.ts | 38 ++++++++++++++++++++++++++++++++------ src/config/index.ts | 3 ++- src/util/common-utils.ts | 12 ++++++++++++ src/util/inquirer.ts | 20 +++++++++++++++++++- 6 files changed, 68 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index e508ad7..373a9f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/apps-cli", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@contentstack/apps-cli", - "version": "1.2.1", + "version": "1.2.2", "license": "MIT", "dependencies": { "@contentstack/cli-command": "^1.2.18", diff --git a/package.json b/package.json index 72b113b..d81dc3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/apps-cli", - "version": "1.2.1", + "version": "1.2.2", "description": "App ClI", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/contentstack-apps-cli", diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index c1b8102..012507d 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -32,7 +32,8 @@ import { getAppName, getDirName, getOrgAppUiLocation, - sanitizePath + sanitizePath, + selectedBoilerplate, } from "../../util"; export default class Create extends BaseCommand { @@ -96,7 +97,15 @@ export default class Create extends BaseCommand { message: this.messages.CONFIRM_CLONE_BOILERPLATE, })) ) { - await this.boilerplateFlow(); + const boilerplate = await selectedBoilerplate(); + if (boilerplate) { + this.sharedConfig.boilerplateName = boilerplate.name + .toLowerCase() + .replace(/ /g, "-"); + this.sharedConfig.appBoilerplateGithubUrl = boilerplate.link; + this.sharedConfig.appName = this.sharedConfig.boilerplateName; + await this.boilerplateFlow(); + } } else { this.manageManifestToggeling(); await this.registerTheAppOnDeveloperHub(false); @@ -120,6 +129,12 @@ export default class Create extends BaseCommand { await this.unZipBoilerplate(await this.cloneBoilerplate()); tmp.setGracefulCleanup(); // NOTE If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit + // Update the sharedConfig.appName with the actual folder name + this.sharedConfig.appName = + this.sharedConfig.folderPath.split("/").pop() || + this.sharedConfig.appName; + this.tempAppData.name = this.sharedConfig.appName; + this.manageManifestToggeling(); // NOTE Step 2: Registering the app @@ -198,7 +213,11 @@ export default class Create extends BaseCommand { const zip = new AdmZip(filepath); const dataDir = this.flags["data-dir"] ?? process.cwd(); let targetPath = resolve(dataDir, this.sharedConfig.appName); - const sourcePath = resolve(dataDir, this.sharedConfig.boilerplateName); + + // Get the directory inside the zip file + const zipEntries = zip.getEntries(); + const firstEntry = zipEntries[0]; + const sourcePath = resolve(dataDir, firstEntry.entryName.split("/")[0]); if (this.flags["data-dir"] && !existsSync(this.flags["data-dir"])) { mkdirSync(this.flags["data-dir"], { recursive: true }); @@ -225,6 +244,10 @@ export default class Create extends BaseCommand { reject(error); }); }); + // Update the app name and folder path + this.sharedConfig.appName = + this.sharedConfig.folderPath.split("/").pop() || + this.sharedConfig.appName; } /** @@ -236,8 +259,8 @@ export default class Create extends BaseCommand { manageManifestToggeling() { // NOTE Use boilerplate manifest if exist const manifestPath = resolve( - this.sharedConfig.folderPath || "", - "manifest.json" + this.sharedConfig.folderPath, + `${this.sharedConfig.folderPath}/manifest.json` ); if (existsSync(manifestPath)) { @@ -301,7 +324,10 @@ export default class Create extends BaseCommand { this.appData = merge(this.appData, pick(response, validKeys)); if (saveManifest) { writeFileSync( - resolve(this.sharedConfig.folderPath, "manifest.json"), + resolve( + this.sharedConfig.folderPath, + `${this.sharedConfig.folderPath}/manifest.json` + ), JSON.stringify(this.appData), { encoding: "utf8", diff --git a/src/config/index.ts b/src/config/index.ts index b0ba642..b043608 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -2,12 +2,13 @@ import { resolve } from "path"; const config = { defaultAppName: "app-boilerplate", - manifestPath: resolve(__dirname, "manifest.json"), + manifestPath: resolve(__dirname, ""), boilerplateName: "marketplace-app-boilerplate-main", developerHubBaseUrl: "", appBoilerplateGithubUrl: "https://codeload.github.com/contentstack/marketplace-app-boilerplate/zip/refs/heads/main", defaultAppFileName: "manifest", + boilerplatesUrl: 'https://marketplace-artifacts.contentstack.com/cli/starter-template.json' }; export default config; diff --git a/src/util/common-utils.ts b/src/util/common-utils.ts index 4a19316..9728c9c 100644 --- a/src/util/common-utils.ts +++ b/src/util/common-utils.ts @@ -19,6 +19,8 @@ import { } from "../types"; import { askProjectName } from "./inquirer"; import { deployAppMsg } from "../messages"; +import config from "../config"; +import axios from "axios"; export type CommonOptions = { log: LogFn; @@ -396,6 +398,15 @@ const handleProjectNameConflict = async ( } return projectName; }; +async function fetchBoilerplateDetails(): Promise[]> { + try { + const url = config.boilerplatesUrl; + const content = await axios.get(url); + return content.data.templates + } catch (error) { + throw error; + } +} export { getOrganizations, @@ -418,4 +429,5 @@ export { disconnectApp, formatUrl, handleProjectNameConflict, + fetchBoilerplateDetails }; diff --git a/src/util/inquirer.ts b/src/util/inquirer.ts index 455b33c..1a688aa 100644 --- a/src/util/inquirer.ts +++ b/src/util/inquirer.ts @@ -27,6 +27,7 @@ import { fetchApps, sanitizePath, MarketPlaceOptions, + fetchBoilerplateDetails, } from "./common-utils"; import { LaunchProjectRes } from "../types"; @@ -385,6 +386,22 @@ function inquireRequireValidation(input: any): string | boolean { return true; } +const selectedBoilerplate = async (): Promise => { + const boilerplates = await fetchBoilerplateDetails(); + + const response = await cliux + .inquire({ + type: "search-list", + name: "App", + choices: boilerplates.map((bp) => bp.name), + message: "Select a boilerplate from search list", + }) + .then((name) => { + return find(boilerplates, (boilerplate) => boilerplate.name === name); + }); + return response; +}; + export { getOrg, getAppName, @@ -399,5 +416,6 @@ export { askProjectType, askConfirmation, selectProject, - askProjectName + askProjectName, + selectedBoilerplate, }; From 6a1d7c9e4853da599cee8ad1aa022c9e096f518d Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Wed, 17 Jul 2024 19:46:07 +0530 Subject: [PATCH 02/16] dx | 547 | removed manifest.json --- src/config/manifest.json | 105 --------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 src/config/manifest.json diff --git a/src/config/manifest.json b/src/config/manifest.json deleted file mode 100644 index 30f03ec..0000000 --- a/src/config/manifest.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "description": "", - "icon": "", - "name": "", - "organization_uid": "", - "target_type": "stack", - "visibility": "private", - "uid": "", - "ui_location": { - "signed": false, - "base_url": "http://localhost:3000", - "locations": [ - { - "type": "cs.cm.stack.custom_field", - "meta": [ - { - "multiple": false, - "path": "/#/custom-field", - "signed": false, - "enabled": true, - "data_type": "json" - } - ] - }, - { - "type": "cs.cm.stack.dashboard", - "meta": [ - { - "path": "/#/stack-dashboard", - "signed": false, - "enabled": true, - "default_width": "half" - } - ] - }, - { - "type": "cs.cm.stack.asset_sidebar", - "meta": [ - { - "blur": false, - "path": "/#/asset-sidebar", - "signed": false, - "enabled": true, - "width": 500 - } - ] - }, - { - "type": "cs.cm.stack.sidebar", - "meta": [ - { - "path": "/#/entry-sidebar", - "signed": false, - "enabled": true - } - ] - }, - { - "type": "cs.cm.stack.full_page", - "meta": [ - { - "path": "/#/full-page", - "signed": false, - "enabled": true - } - ] - }, - { - "type": "cs.cm.stack.field_modifier", - "meta": [ - { - "path": "/#/field-modifier", - "signed": false, - "enabled": true, - "allowed_types": ["$all"] - } - ] - }, - { - "type": "cs.cm.stack.config", - "meta": [ - { - "path": "/#/app-configuration", - "signed": false, - "enabled": true - } - ] - }, - { - "type": "cs.cm.stack.rte", - "meta": [ - { - "path": "/json-rte.js", - "signed": false, - "enabled": true - } - ] - } - ] - }, - "hosting": { - "provider": "external", - "deployment_url": "http://localhost:3000" - } -} From 422894aa83dc520be1f87a8f0d8b45ad6a73c5fa Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Fri, 19 Jul 2024 15:29:12 +0530 Subject: [PATCH 03/16] fix: added manifest.json, used httpClient instead of axios --- src/commands/app/create.ts | 19 ++++--- src/config/index.ts | 2 +- src/config/manifest.json | 105 +++++++++++++++++++++++++++++++++++++ src/util/common-utils.ts | 7 +-- src/util/inquirer.ts | 3 +- 5 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 src/config/manifest.json diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index 012507d..f4b0258 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -98,12 +98,22 @@ export default class Create extends BaseCommand { })) ) { const boilerplate = await selectedBoilerplate(); - if (boilerplate) { + + if (boilerplate && boilerplate.name && boilerplate.link) { this.sharedConfig.boilerplateName = boilerplate.name .toLowerCase() .replace(/ /g, "-"); this.sharedConfig.appBoilerplateGithubUrl = boilerplate.link; - this.sharedConfig.appName = this.sharedConfig.boilerplateName; + this.sharedConfig.appName = await getAppName( + this.sharedConfig.boilerplateName + ); + + // Handle case where user does not provide a new name + if (!this.sharedConfig.appName) { + console.error("App name is required."); + process.exit(1); + } + await this.boilerplateFlow(); } } else { @@ -258,10 +268,7 @@ export default class Create extends BaseCommand { */ manageManifestToggeling() { // NOTE Use boilerplate manifest if exist - const manifestPath = resolve( - this.sharedConfig.folderPath, - `${this.sharedConfig.folderPath}/manifest.json` - ); + const manifestPath = resolve(this.sharedConfig.folderPath, "manifest.json"); if (existsSync(manifestPath)) { this.sharedConfig.manifestPath = manifestPath; diff --git a/src/config/index.ts b/src/config/index.ts index b043608..a85b1da 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -2,7 +2,7 @@ import { resolve } from "path"; const config = { defaultAppName: "app-boilerplate", - manifestPath: resolve(__dirname, ""), + manifestPath: resolve(__dirname, "manifest.json"), boilerplateName: "marketplace-app-boilerplate-main", developerHubBaseUrl: "", appBoilerplateGithubUrl: diff --git a/src/config/manifest.json b/src/config/manifest.json new file mode 100644 index 0000000..30f03ec --- /dev/null +++ b/src/config/manifest.json @@ -0,0 +1,105 @@ +{ + "description": "", + "icon": "", + "name": "", + "organization_uid": "", + "target_type": "stack", + "visibility": "private", + "uid": "", + "ui_location": { + "signed": false, + "base_url": "http://localhost:3000", + "locations": [ + { + "type": "cs.cm.stack.custom_field", + "meta": [ + { + "multiple": false, + "path": "/#/custom-field", + "signed": false, + "enabled": true, + "data_type": "json" + } + ] + }, + { + "type": "cs.cm.stack.dashboard", + "meta": [ + { + "path": "/#/stack-dashboard", + "signed": false, + "enabled": true, + "default_width": "half" + } + ] + }, + { + "type": "cs.cm.stack.asset_sidebar", + "meta": [ + { + "blur": false, + "path": "/#/asset-sidebar", + "signed": false, + "enabled": true, + "width": 500 + } + ] + }, + { + "type": "cs.cm.stack.sidebar", + "meta": [ + { + "path": "/#/entry-sidebar", + "signed": false, + "enabled": true + } + ] + }, + { + "type": "cs.cm.stack.full_page", + "meta": [ + { + "path": "/#/full-page", + "signed": false, + "enabled": true + } + ] + }, + { + "type": "cs.cm.stack.field_modifier", + "meta": [ + { + "path": "/#/field-modifier", + "signed": false, + "enabled": true, + "allowed_types": ["$all"] + } + ] + }, + { + "type": "cs.cm.stack.config", + "meta": [ + { + "path": "/#/app-configuration", + "signed": false, + "enabled": true + } + ] + }, + { + "type": "cs.cm.stack.rte", + "meta": [ + { + "path": "/json-rte.js", + "signed": false, + "enabled": true + } + ] + } + ] + }, + "hosting": { + "provider": "external", + "deployment_url": "http://localhost:3000" + } +} diff --git a/src/util/common-utils.ts b/src/util/common-utils.ts index 9728c9c..10ca52c 100644 --- a/src/util/common-utils.ts +++ b/src/util/common-utils.ts @@ -7,6 +7,7 @@ import { cliux, Stack, FsUtility, + HttpClient, } from "@contentstack/cli-utilities"; import { projectsQuery } from "../graphql/queries"; import { apiRequestHandler } from "./api-request-handler"; @@ -20,7 +21,6 @@ import { import { askProjectName } from "./inquirer"; import { deployAppMsg } from "../messages"; import config from "../config"; -import axios from "axios"; export type CommonOptions = { log: LogFn; @@ -401,8 +401,9 @@ const handleProjectNameConflict = async ( async function fetchBoilerplateDetails(): Promise[]> { try { const url = config.boilerplatesUrl; - const content = await axios.get(url); - return content.data.templates + const client = new HttpClient(); + const content = await client.get(url); + return content?.data?.templates ?? []; } catch (error) { throw error; } diff --git a/src/util/inquirer.ts b/src/util/inquirer.ts index 1a688aa..c174821 100644 --- a/src/util/inquirer.ts +++ b/src/util/inquirer.ts @@ -389,7 +389,7 @@ function inquireRequireValidation(input: any): string | boolean { const selectedBoilerplate = async (): Promise => { const boilerplates = await fetchBoilerplateDetails(); - const response = await cliux + return await cliux .inquire({ type: "search-list", name: "App", @@ -399,7 +399,6 @@ const selectedBoilerplate = async (): Promise => { .then((name) => { return find(boilerplates, (boilerplate) => boilerplate.name === name); }); - return response; }; export { From b32de1433d710023a6e3f94ee65bbfab18658169 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Fri, 19 Jul 2024 16:17:18 +0530 Subject: [PATCH 04/16] fix: removed a condition in if for getting app name --- src/commands/app/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index f4b0258..582b90d 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -99,7 +99,7 @@ export default class Create extends BaseCommand { ) { const boilerplate = await selectedBoilerplate(); - if (boilerplate && boilerplate.name && boilerplate.link) { + if (boilerplate && boilerplate?.link) { this.sharedConfig.boilerplateName = boilerplate.name .toLowerCase() .replace(/ /g, "-"); From 6e1b0ad133d8db4a0fba060fd9f49bf7b17be701 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Fri, 19 Jul 2024 17:41:29 +0530 Subject: [PATCH 05/16] fix: added type def for boilerplates and updated a comment --- src/commands/app/create.ts | 27 +++++++++------------------ src/types/app.ts | 9 +++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index 582b90d..bad60ec 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -25,7 +25,7 @@ import { } from "@contentstack/cli-utilities"; import { BaseCommand } from "../../base-command"; -import { AppManifest, AppType } from "../../types"; +import { AppManifest, AppType, BoilerplateAppType } from "../../types"; import { appCreate, commonMsg } from "../../messages"; import { getOrg, @@ -97,23 +97,18 @@ export default class Create extends BaseCommand { message: this.messages.CONFIRM_CLONE_BOILERPLATE, })) ) { - const boilerplate = await selectedBoilerplate(); + const boilerplate: BoilerplateAppType = await selectedBoilerplate(); - if (boilerplate && boilerplate?.link) { - this.sharedConfig.boilerplateName = boilerplate.name - .toLowerCase() - .replace(/ /g, "-"); + if (boilerplate) { + if (boilerplate.name) { + this.sharedConfig.boilerplateName = boilerplate.name + .toLowerCase() + .replace(/ /g, "-"); + } this.sharedConfig.appBoilerplateGithubUrl = boilerplate.link; this.sharedConfig.appName = await getAppName( this.sharedConfig.boilerplateName ); - - // Handle case where user does not provide a new name - if (!this.sharedConfig.appName) { - console.error("App name is required."); - process.exit(1); - } - await this.boilerplateFlow(); } } else { @@ -139,7 +134,7 @@ export default class Create extends BaseCommand { await this.unZipBoilerplate(await this.cloneBoilerplate()); tmp.setGracefulCleanup(); // NOTE If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit - // Update the sharedConfig.appName with the actual folder name + // To remove the default app name from flag and replace it with the actual folder name this.sharedConfig.appName = this.sharedConfig.folderPath.split("/").pop() || this.sharedConfig.appName; @@ -254,10 +249,6 @@ export default class Create extends BaseCommand { reject(error); }); }); - // Update the app name and folder path - this.sharedConfig.appName = - this.sharedConfig.folderPath.split("/").pop() || - this.sharedConfig.appName; } /** diff --git a/src/types/app.ts b/src/types/app.ts index 0aa3f8f..d1066a1 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -140,3 +140,12 @@ export interface LaunchProjectRes { environmentUid: any; developerHubAppUid: any; } + +export interface BoilerplateAppType { + name?: string; + description?: string; + link: string; + tags?: string[]; + created_at?: string; + updated_at?: string; +} From 72e40add332baf73e7259e8c702836b49378a6d7 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Fri, 19 Jul 2024 17:47:18 +0530 Subject: [PATCH 06/16] fix: updated the call in fetchBoilerplateDetails --- src/util/common-utils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/common-utils.ts b/src/util/common-utils.ts index 10ca52c..551a757 100644 --- a/src/util/common-utils.ts +++ b/src/util/common-utils.ts @@ -400,9 +400,7 @@ const handleProjectNameConflict = async ( }; async function fetchBoilerplateDetails(): Promise[]> { try { - const url = config.boilerplatesUrl; - const client = new HttpClient(); - const content = await client.get(url); + const content = await new HttpClient().get(config.boilerplatesUrl); return content?.data?.templates ?? []; } catch (error) { throw error; From 0e7b44997bae3f530dddfeaee2e2de4c652c4126 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Fri, 19 Jul 2024 17:53:46 +0530 Subject: [PATCH 07/16] name is required not optional BoilerplateAppType --- src/commands/app/create.ts | 10 ++++------ src/types/app.ts | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index bad60ec..ee1020d 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -21,7 +21,7 @@ import { flags, HttpClient, configHandler, - FlagInput + FlagInput, } from "@contentstack/cli-utilities"; import { BaseCommand } from "../../base-command"; @@ -100,11 +100,9 @@ export default class Create extends BaseCommand { const boilerplate: BoilerplateAppType = await selectedBoilerplate(); if (boilerplate) { - if (boilerplate.name) { - this.sharedConfig.boilerplateName = boilerplate.name - .toLowerCase() - .replace(/ /g, "-"); - } + this.sharedConfig.boilerplateName = boilerplate.name + .toLowerCase() + .replace(/ /g, "-"); this.sharedConfig.appBoilerplateGithubUrl = boilerplate.link; this.sharedConfig.appName = await getAppName( this.sharedConfig.boilerplateName diff --git a/src/types/app.ts b/src/types/app.ts index d1066a1..d84c827 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -142,7 +142,7 @@ export interface LaunchProjectRes { } export interface BoilerplateAppType { - name?: string; + name: string; description?: string; link: string; tags?: string[]; From 96b38b201a98841ff5f79c1f5698afcb9daba2ba Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 22 Jul 2024 13:07:51 +0530 Subject: [PATCH 08/16] version bump to 1.3.0 --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/app/create.ts | 8 +------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 373a9f8..c137b94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/apps-cli", - "version": "1.2.2", + "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@contentstack/apps-cli", - "version": "1.2.2", + "version": "1.3.0", "license": "MIT", "dependencies": { "@contentstack/cli-command": "^1.2.18", diff --git a/package.json b/package.json index d81dc3b..d4c5240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/apps-cli", - "version": "1.2.2", + "version": "1.3.0", "description": "App ClI", "author": "Contentstack CLI", "homepage": "https://github.com/contentstack/contentstack-apps-cli", diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index ee1020d..3c9cb88 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -132,12 +132,6 @@ export default class Create extends BaseCommand { await this.unZipBoilerplate(await this.cloneBoilerplate()); tmp.setGracefulCleanup(); // NOTE If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit - // To remove the default app name from flag and replace it with the actual folder name - this.sharedConfig.appName = - this.sharedConfig.folderPath.split("/").pop() || - this.sharedConfig.appName; - this.tempAppData.name = this.sharedConfig.appName; - this.manageManifestToggeling(); // NOTE Step 2: Registering the app @@ -322,7 +316,7 @@ export default class Create extends BaseCommand { writeFileSync( resolve( this.sharedConfig.folderPath, - `${this.sharedConfig.folderPath}/manifest.json` + "manifest.json" ), JSON.stringify(this.appData), { From f5bf3eb8ca0bf544f08a690e8cf25484c9c3c452 Mon Sep 17 00:00:00 2001 From: harshithad0703 Date: Mon, 22 Jul 2024 15:11:29 +0530 Subject: [PATCH 09/16] updated with a flag and added example --- README.md | 26 +++++++++++++++----------- src/commands/app/create.ts | 14 +++++++++++++- src/messages/index.ts | 1 + src/util/inquirer.ts | 3 ++- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4b53148..8a54c74 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/apps-cli/1.2.1 darwin-arm64 node-v18.20.2 +@contentstack/apps-cli/1.3.0 darwin-arm64 node-v18.16.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -67,7 +67,7 @@ EXAMPLES $ csdx app:reinstall ``` -_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.2.1/src/commands/app/index.ts)_ +_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.3.0/src/commands/app/index.ts)_ ## `csdx app:create` @@ -75,7 +75,8 @@ Create a new app in Developer Hub and optionally clone a boilerplate locally. ``` USAGE - $ csdx app:create [-n ] [--app-type stack|organization] [-c ] [-d ] + $ csdx app:create [-n ] [--app-type stack|organization] [-c ] [-d ] [--boilerplates + ] FLAGS -c, --config= Path of the external config @@ -83,6 +84,7 @@ FLAGS -n, --name= [default: app-boilerplate] Name of the app to be created --app-type=