Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
fix: update deps and point to new command dir
Browse files Browse the repository at this point in the history
  • Loading branch information
amphro committed Mar 26, 2019
1 parent 67a3ab2 commit 0992fd5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"description": "add/remove/create CLI plug-ins"
}
},
"commands": "./lib/commands",
"commands": "./lib/sfdxcommands",
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-warn-if-update-available",
Expand Down
18 changes: 7 additions & 11 deletions src/generators/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ class App extends Generator {
this.pjson.files.push('/npm-shrinkwrap.json')
if (this.type === 'sfdx-plugin') {
this.pjson.files.push('/messages')
this.pjson.scripts.prepare = this.pjson.scripts.prepack
delete this.pjson.scripts.prepack
}
}
if (this.type === 'plugin' && hasYarn) {
Expand Down Expand Up @@ -464,18 +462,17 @@ class App extends Generator {
break
case 'sfdx-plugin':
dependencies.push(
'@oclif/command@1',
'@oclif/config@1',
'@oclif/errors@1',
'@salesforce/command@^1.0.1',
'@salesforce/core@^1.0.1'
'@oclif/command@^1',
'@oclif/config@^1',
'@oclif/errors@^1',
'@salesforce/command@^1.4.1',
'@salesforce/core@^1.3.2'
)
devDependencies.push(
'@oclif/dev-cli@^1',
'@oclif/plugin-help@^2',
'globby@^8',
'@salesforce/dev-config@^1.1.4',
'sinon@5',
'@salesforce/[email protected]'
)
break
case 'multi':
Expand All @@ -501,7 +498,7 @@ class App extends Generator {
}
if (this.ts) {
dependencies.push(
'tslib@1',
'tslib@^1',
)
devDependencies.push(
'@types/node@^10',
Expand All @@ -516,7 +513,6 @@ class App extends Generator {
}
if (this.tslint) {
devDependencies.push(
'@oclif/tslint@^3',
'tslint@^5',
)
}
Expand Down
File renamed without changes.
11 changes: 6 additions & 5 deletions templates/src/sfdxCommand.ts.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {core, flags, SfdxCommand} from '@salesforce/command';
import {AnyJson} from '@salesforce/ts-types';
import { flags, SfdxCommand } from '@salesforce/command';
import { Messages, SfdxError } from '@salesforce/core';
import { AnyJson } from '@salesforce/ts-types';
<%_ const klass = _.upperFirst(_.camelCase(commandName)) _%>

// Initialize Messages with the current plugin directory
core.Messages.importMessagesDirectory(__dirname);
Messages.importMessagesDirectory(__dirname);

// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
// or any library that is using the messages framework can also be loaded this way.
const messages = core.Messages.loadMessages('<%- pluginName %>', '<%- commandName %>');
const messages = Messages.loadMessages('<%- pluginName %>', '<%- commandName %>');

export default class <%- klass %> extends SfdxCommand {

Expand Down Expand Up @@ -59,7 +60,7 @@ export default class <%- klass %> extends SfdxCommand {
// Organization will always return one result, but this is an example of throwing an error
// The output and --json will automatically be handled for you.
if (!result.records || result.records.length <= 0) {
throw new core.SfdxError(messages.getMessage('errorNoOrgResults', [this.org.getOrgId()]));
throw new SfdxError(messages.getMessage('errorNoOrgResults', [this.org.getOrgId()]));
}

// Organization always only returns one result
Expand Down

0 comments on commit 0992fd5

Please sign in to comment.