Skip to content

Commit

Permalink
Merge pull request #525 from salesforcecli/ew/reset-semver-version
Browse files Browse the repository at this point in the history
Use 1.0.0 on plugins and libs
  • Loading branch information
iowillhoit authored Aug 26, 2024
2 parents 44b8288 + 9fe9619 commit 2cdb2e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/commands/dev/generate/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default class GenerateLibrary extends SfCommand<void> {
await generator.loadPjson();

generator.pjson.name = `${answers.scope}/${answers.name}`;
generator.pjson.version = '1.0.0';
generator.pjson.description = answers.description;
generator.pjson.repository = `${answers.org}/${answers.name}`;
generator.pjson.homepage = `https://github.com/${answers.org}/${answers.name}`;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/dev/generate/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,14 @@ export default class GeneratePlugin extends SfCommand<void> {
name: `@salesforce/${answers.name}`,
repository: `salesforcecli/${answers.name}`,
homepage: `https://github.com/salesforcecli/${answers.name}`,
description: answers.description,
}
: {
name: answers.name,
description: answers.description,
};

updated.version = '1.0.0';
updated.description = answers.description;

if (answers.author) {
updated.author = answers.author;
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type NYC = {

export type PackageJson = {
name: string;
version: string;
devDependencies: Record<string, string>;
dependencies: Record<string, string>;
files: string[];
Expand Down
3 changes: 3 additions & 0 deletions test/commands/dev/generate/plugin.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('dev generate plugin NUTs', () => {
const packageJson = readJson<PackageJson>(packageJsonPath);

expect(packageJson.name).to.equal('@salesforce/plugin-awesome');
expect(packageJson.version).to.equal('1.0.0');
expect(packageJson.author).to.equal('Salesforce');
expect(packageJson.description).to.equal('a description');
expect(packageJson.bugs).to.equal('https://github.com/forcedotcom/cli/issues');
Expand Down Expand Up @@ -85,6 +86,7 @@ describe('dev generate plugin NUTs', () => {
const packageJson = readJson<PackageJson>(packageJsonPath);

expect(packageJson.name).to.equal('my-plugin');
expect(packageJson.version).to.equal('1.0.0');
expect(packageJson.author).to.equal('me');
expect(packageJson.description).to.equal('a description');

Expand Down Expand Up @@ -140,6 +142,7 @@ describe('dev generate plugin NUTs', () => {
const packageJson = readJson<PackageJson>(packageJsonPath);

expect(packageJson.name).to.equal('my-plugin');
expect(packageJson.version).to.equal('1.0.0');
expect(packageJson.author).to.equal('me');
expect(packageJson.description).to.equal('a description');
const nycConfig = readJson<NYC>(path.join(session.dir, 'my-plugin', '.nycrc'));
Expand Down

0 comments on commit 2cdb2e5

Please sign in to comment.