From fbefe01975900207994d6d21d8922799c7a54bd0 Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Wed, 13 Mar 2024 14:54:37 -0500 Subject: [PATCH 1/2] fix: update generate library command --- src/commands/dev/generate/library.ts | 4 ++-- src/generators/library.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/commands/dev/generate/library.ts b/src/commands/dev/generate/library.ts index e3085e79..d5f2304d 100644 --- a/src/commands/dev/generate/library.ts +++ b/src/commands/dev/generate/library.ts @@ -5,16 +5,16 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { Messages } from '@salesforce/core'; import { SfCommand } from '@salesforce/sf-plugins-core'; import { generate } from '../../../util.js'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.library'); export default class GenerateLibrary extends SfCommand { public static enableJsonFlag = false; + public static readonly hidden = true; public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); diff --git a/src/generators/library.ts b/src/generators/library.ts index a0a2fe65..b9fde96b 100644 --- a/src/generators/library.ts +++ b/src/generators/library.ts @@ -71,7 +71,7 @@ export default class Library extends Generator { }; const directory = path.resolve(this.answers.name); - shelljs.exec(`git clone git@github.com:forcedotcom/library-template.git ${directory}`); + shelljs.exec(`git clone -b ew/update-template git@github.com:forcedotcom/library-template.git ${directory}`); fs.rmSync(`${path.resolve(this.answers.name, '.git')}`, { recursive: true }); this.destinationRoot(directory); this.env.cwd = this.destinationPath(); @@ -87,10 +87,18 @@ export default class Library extends Generator { repository: `${this.answers.org}/${this.answers.name}`, homepage: `https://github.com/${this.answers.org}/${this.answers.name}`, description: this.answers.description, + bugs: { url: `https://github.com/${this.answers.org}/${this.answers.name}/issues` }, }; const final = Object.assign({}, pjson, updated); this.fs.writeJSON(this.destinationPath('./package.json'), final); + // Replace the message import + replace.sync({ + files: `${this.env.cwd}/src/hello.ts`, + from: /@salesforce\/library-template/g, + to: `${this.answers.scope}/${this.answers.name}`, + }); + replace.sync({ files: `${this.env.cwd}/**/*`, from: /library-template/g, From 0ccd896fb5bfe0fae73bb16973a8693b0a64021c Mon Sep 17 00:00:00 2001 From: Willhoit Date: Fri, 15 Mar 2024 14:11:53 -0500 Subject: [PATCH 2/2] chore: remove branch ref --- src/generators/library.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generators/library.ts b/src/generators/library.ts index b9fde96b..a3a19392 100644 --- a/src/generators/library.ts +++ b/src/generators/library.ts @@ -71,7 +71,7 @@ export default class Library extends Generator { }; const directory = path.resolve(this.answers.name); - shelljs.exec(`git clone -b ew/update-template git@github.com:forcedotcom/library-template.git ${directory}`); + shelljs.exec(`git clone git@github.com:forcedotcom/library-template.git ${directory}`); fs.rmSync(`${path.resolve(this.answers.name, '.git')}`, { recursive: true }); this.destinationRoot(directory); this.env.cwd = this.destinationPath();