From 7663d0a2e202bbd54039bf5e622c86422002144b Mon Sep 17 00:00:00 2001 From: Revanth Date: Fri, 6 Oct 2023 12:35:32 -0500 Subject: [PATCH 1/2] Changed npmrc template name and updated gitignore content --- src/commands/api-mesh/init.js | 16 +++++++++++----- src/templates/{.npmrc => npmrc} | 0 2 files changed, 11 insertions(+), 5 deletions(-) rename src/templates/{.npmrc => npmrc} (100%) diff --git a/src/commands/api-mesh/init.js b/src/commands/api-mesh/init.js index d21e6c1f..2d815fe8 100644 --- a/src/commands/api-mesh/init.js +++ b/src/commands/api-mesh/init.js @@ -72,9 +72,16 @@ class InitCommand extends Command { async createDotNpmrcFile(templatePath, filePath) { const dotNpmrcFile = await fs.readFile(templatePath, 'utf8'); + await fs.writeFile(filePath, dotNpmrcFile, 'utf8', { mode: 'w' }); } + async createGitIgnoreFile(templatePath, filePath) { + const gitIgnoreFile = await fs.readFile(templatePath, 'utf8'); + + await fs.writeFile(filePath, gitIgnoreFile, 'utf8', { mode: 'w' }); + } + async run() { const { args, flags } = await this.parse(InitCommand); const gitFlagOptions = { @@ -86,7 +93,7 @@ class InitCommand extends Command { let shouldCreateGit = gitFlagOptions[flags.git]; let packageManagerChoice = flags.packageManager; const packageJsonTemplate = `${getAppRootDir()}/src/templates/package.json`; - const dotNpmrcPath = `${getAppRootDir()}/src/templates/.npmrc`; + const dotNpmrcPath = `${getAppRootDir()}/src/templates/npmrc`; const shouldCreateWorkspace = await promptConfirm( `Do you want to create the workspace in ${absolutePath}`, ); @@ -130,11 +137,10 @@ class InitCommand extends Command { try { await runCliCommand('git init', absolutePath); - const gitIgnoreTemplate = `${getAppRootDir()}/src/templates/gitignore`; + const gitIgnoreTemplatePath = `${getAppRootDir()}/src/templates/gitignore`; + const gitIgnoreFilePath = `${absolutePath}/.gitignore`; - await fs.writeFile(`${absolutePath}/.gitignore`, gitIgnoreTemplate, 'utf8', { - mode: 'w', - }); + await this.createGitIgnoreFile(gitIgnoreTemplatePath, gitIgnoreFilePath); } catch (error) { this.error(error); } diff --git a/src/templates/.npmrc b/src/templates/npmrc similarity index 100% rename from src/templates/.npmrc rename to src/templates/npmrc From d5eb3e5f75c971a9b2bc223b493c81b0d6267fb7 Mon Sep 17 00:00:00 2001 From: Revanth Date: Fri, 6 Oct 2023 12:36:04 -0500 Subject: [PATCH 2/2] v3.1.0-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 91bf5efe..0f04ede7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adobe/aio-cli-plugin-api-mesh", - "version": "3.1.0-beta.1", + "version": "3.1.0-beta.2", "publishConfig": { "access": "public" },