forcedotcom / sfdx-plugin-generate Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Errors thrown via SfdxError from the plugin are not appearing when the plugin is invoked via
$sfdx xyz:myplugin:set -u myalias -p=xyz
but when invoked through ./bin/run, it would display the error messages.
When run from sfdx, plugin does not display exception message. It simply return without displaying the exception message.
$ sfdx xyz:myplugin:set -u venkattemp -o=campaign -profiles="*"
Validating flags...
$
Where as when I run it from the ./bin in the plugin directory using run, it would work as expected.
$ ./bin/run xyz:myplugin:set -u venkattemp -o=campaign -profiles="*"
Validating flags... done
ERROR running set: --profiles and --filter must be specified when --sobjects is used
$
Please mention your Salesforce CLI and OS version.
OS: Windows 7
$ sfdx --version
sfdx-cli/6.34.0-6fec0d751a (windows-x64) node-v8.9.4
Is there something that I am missing here, a setting or something?
Bug
cd
.sfdx plugins:generate
and hit enter to run with the default settings.more ./node_modules/@types/jsforce/describe-result.d.ts
export interface DescribeSObjectResult {
label: string;
fields: object[];
}
export interface DescribeGlobalResult {
activateable: boolean;
createable: boolean;
custom: boolean;
customSetting: boolean;
deletable: boolean;
deprecatedAndHidden: boolean;
feedEnabled: boolean;
hasSubtypes: boolean;
isSubtype: boolean;
keyPrefix: string;
label: string;
labelPlural: string;
layoutable: boolean;
mergeable: boolean;
mruEnabled: boolean;
name: string;
queryable: boolean;
replicateable: boolean;
retrieveable: boolean;
searchable: boolean;
triggerable: boolean;
undeletable: boolean;
updateable: boolean;
}
The content should be that of this file from the TS type definitions for JSForce in DefinitelyTyped.
SFDX version: sfdx-cli/6.43.1-6021deb31d (darwin-x64) node-v8.9.4
OS version: macOS 10.14.2
sfdx plugins --core
@salesforce/plugin-generator 1.0.1 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 44.10.0 (core)
I'm seeing errors when running npm publish
on a freshly scaffolded plug-in. All I've done is create the plug-in and check that hello:org
runs as expected, but I think the prepack
script is erroring when the typescript is compiled.
bin/run hello:org <username>
npm publish
to compile and publish the plug-inPlug-in should publish without errors
> [email protected] prepack .
> rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme
node_modules/@oclif/parser/lib/index.d.ts:16:60 - error TS2344: Type 'TArgs' does not satisfy the constraint 'any[]'.
Type '{ [name: string]: string; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 29 more.
16 }>(argv: string[], options: Input<TFlags>): Output<TFlags, TArgs>;
~~~~~
node_modules/@oclif/command/lib/command.d.ts:69:70 - error TS2344: Type 'A' does not satisfy the constraint 'any[]'.
Type '{ [name: string]: any; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 29 more.
69 }>(options?: Parser.Input<F>, argv?: string[]): Parser.Output<F, A>;
~
src/commands/hello/org.ts:86:39 - error TS2339: Property 'file' does not exist on type 'any[]'.
86 if (this.flags.force && this.args.file) {
~~~~
src/commands/hello/org.ts:87:62 - error TS2339: Property 'file' does not exist on type 'any[]'.
87 this.ux.log(`You input --force and a file: ${this.args.file as string}`);
~~~~
Found 4 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepack: `rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Feel free to attach a screenshot.
SFDX CLI Version: sfdx-cli/7.126.0 darwin-x64 node-v16.13.0
OS and version: MacOS Monterey 12.0.1
Error "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session" thrown when running tests of a command which includes a method call "conn.metadata.describe".
I'm trying to test a command which includes the following code:
const conn = this.org.getConnection();
const result = await conn.metadata.describe(await this.org.retrieveMaxApiVersion());
this.ux.log(result);
with the following test:
describe('hello:metadata', () => {
test
.withOrg({ username: '[email protected]' }, true)
.withConnectionRequest(request => Promise.resolve({ metadataObjects: [ { directoryName: 'objects', inFolder: false, metaFile: false, suffix: 'object', xmlName: 'CustomObject' }] }))
.stdout()
.command(['hello:metadata', '--targetusername', '[email protected]'])
.it('runs hello:metadata --targetusername [email protected]', ctx => {
expect(ctx.stdout).to.contain('objects');
});
});
But I'm always receiving the following error: "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"
$ sfdx --version
sfdx-cli/6.35.1-8b7320f7c2 (darwin-x64) node-v8.9.4
Followed the step by step from here and it failed while trying to run bin\run.cmd hello:org -h
or bin\run hello:org -h
Bellow are pictures trying to execute the command.
Also, after run the command sfdx plugins:link
I got the same message about missing Globby and the namespace was added to my sfdx but has no commands. This is another bug probably.
On Windows follow this guide
The command should work as described in the step by step
It will fail while running bin\run.cmd hello:org -h
or bin\run hello:org -h
Yarn install says that my project is setup properly
OS and version:
Windows 10
On a newly generated plugin template, running tests via npm run test
gives weird output (as if no tests ran).
sfdx plugins:generate
. Smash enter/default options.npm install
npm run test
See test names, and actual code coverage info.
SFDX CLI Version:
sfdx-cli/7.63.0 win32-x64 node-v12.18.1
OS and version:
Windows 10 Pro 2004
vscode launch.json is outdated and broken.
vscode would start a debugger and break on entry
Error in the debug console:
Error processing "attach": Error: Both localRoot and remoteRoot must be specified.
at RemotePathTransformer.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.node-debug2/node_modules/vscode-chrome-debug-core/out/src/transformers/remotePathTransformer.js:43:23)
Feel free to attach a screenshot.
SFDX CLI Version:
sfdx-cli/7.54.4-8ff9ba9cc5 darwin-x64 node-v10.15.3
OS and version:
OSX 10.14.5
A bug
Running sfdx plugins:generate
issues the following warning after running yard add v1.0.1
:
(node:12066) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Expected behavior: No warning
sfdx-cli: 6.34.0-6fec0d751a (darwin-x64) node-v8.9.4
OS version: macOS 10.14 Mojave
I've been using the plugin generator without any issues up until now, but today I received the following error when creating the plugin (and also if I executed "yarn run prepare") :
--- snip ---
$ rm -rf lib && tsc && oclif-dev manifest && oclif-dev readme
src/commands/hello/org.ts(11,22): error TS2417: Class static side 'typeof Org' incorrectly extends base class static side 'typeof SfdxCommand'.
Types of property 'flagsConfig' are incompatible.
Type '{ name: IOptionFlag; force: IBooleanFlag; }' is not assignable to type 'SfdxFlagsConfig'.
Property 'name' is incompatible with index signature.
Type 'IOptionFlag' is not assignable to type 'string | boolean | IBooleanFlag | JsonMap | IOptionFlag'.
Type 'IOptionFlag' is not assignable to type 'IOptionFlag'.
Type 'IOptionFlag' is not assignable to type '{ completion?: ICompletion; }'.
Types of property 'completion' are incompatible.
Type 'ICompletion' is not assignable to type 'ICompletion'. Two different types with this name exist, but they are unrelated.
Types of property 'cacheKey' are incompatible.
Type '(ctx: ICompletionContext) => Promise' is not assignable to type '(ctx: ICompletionContext) => Promise'. Two different types with this name exist, but they are unrelated.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type 'ICompletionContext' is not assignable to type 'ICompletionContext'. Two different types with this name exist, but they are unrelated.
Types of property 'config' are incompatible.
Type 'IConfig' is not assignable to type 'IConfig'. Two different types with this name exist, but they are unrelated.
Property 'channel' is missing in type 'IConfig'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
--- snip ---
I've added the full output in the attachment -
plugin_generate_output.txt
System info:
ProductName: Mac OS X
ProductVersion: 10.13.4
BuildVersion: 17E202
sfdx version:
sfdx-cli/6.17.0-b1f53723b9 (darwin-x64) node-v8.9.4
In case it was anything specific to my name/description etc, I've also tried creating one where I accept the defaults for everything other than the name, but got the same result.
I thought I'd try my hand at writing a plugin for the sfdx cli, which I succeeded at. I was able to publish it publically to npm as my user (https://www.npmjs.com/package/dsy-sfdx-plugins), and install it in the cli using
sfdx plugins:install dsy-sfdx-plugins
However I then realised I would prefer it to be listed under my Company's Organization, so I created one, changed the scope of the package to my new Organization, and published it like so (forcing it to be public):
npm publish --access public
This appeared on npm correctly: https://www.npmjs.com/package/@desynit/dsy-sfdx-plugins and marked as public. Hooray!
BUT THEN
When I tried to install it I saw the following error:
$ sfdx plugins:install @desynit/dsy-sfdx-plugins Installing plugin @desynit/dsy-sfdx-plugins... Installing plugin @desynit/dsy-sfdx-plugins... Checking for digital signature. ! pluginName cannot be nll
I assume this is an issue with the sfdx plugin machinery somewhere, and I think this is the best place to enquire about it / report the issue?
bug
Returns an error message when trying to link a generated plugin
mkdir plug1
cd .\plug1
sfdx plugins:generate plug1
It generates the expected scaffolding files.
When attempting to install dependencies, it gets to
sam
[3/5] Fetching packages...
[.......................................................................................] 0/202The system cannot find the path specified
I then run:
sfdx plugins:link
and get this output:
Installing dependencies for C:\Users\myusername\Desktop\plug1
| yarn --non-interactive
| --mutex=file:C:\Users\myusername\AppData\Local\sfdx\yarn
| --cache-folder=C:\Users\myusernae\AppData\Local\sfdx\yarn exited
| with code 1
| error Command failed with exit code 1
|
Then try:
sfdx hello:org -u myPreviouslySetAlias
I receive:
| hello:org is not a sfdx command
| Perhaps you meant force:org
| Run sfdx help for a list of available topics
It should print out the org command from the generated example
OS: 10.0.16299 N/A Build 16299
SFDX CLI Version: sfdx-cli/6.44.0-dead729fb5 (windows-x64) node-v8.9.4
Node: 8.9.4
NPM: 6.4.1
While running sfdx plugins:generate, everything works fine until the tsc command is called and fails with the following error:
$ rm -rf lib && tsc && oclif-dev manifest && oclif-dev readme
src/commands/hello/org.ts(11,22): error TS2417: Class static side 'typeof Org' incorrectly extends base class static side 'typeof SfdxCommand'.
Types of property 'flagsConfig' are incompatible.
Type '{ name: IOptionFlag<string>; force: IBooleanFlag<boolean>; }' is not assignable to type 'SfdxFlagsConfig'.
Property 'name' is incompatible with index signature.
Type 'IOptionFlag<string>' is not assignable to type 'string | boolean | IBooleanFlag<any> | JsonMap | IOptionFlag<any>'.
Type 'IOptionFlag<string>' is not assignable to type 'IOptionFlag<any>'.
Type 'IOptionFlag<string>' is not assignable to type '{ completion?: ICompletion; }'.
Types of property 'completion' are incompatible.
Type 'ICompletion' is not assignable to type 'ICompletion'. Two different types with this name exist, but they are unrelated.
Types of property 'cacheKey' are incompatible.
Type '(ctx: ICompletionContext) => Promise<string>' is not assignable to type '(ctx: ICompletionContext) => Promise<string>'. Two different types with this name exist, but they are unrelated.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type 'ICompletionContext' is not assignable to type 'ICompletionContext'. Two different types with this name exist, but they are unrelated.
Types of property 'config' are incompatible.
Type 'IConfig' is not assignable to type 'IConfig'. Two different types with this name exist, but they are unrelated.
Property 'channel' is missing in type 'IConfig'.
I'm on windows, don't know if this changes something.
Everything is working fine when I use sfdx plugins:generate but I'm getting several warnings:
(node:4780) Warning: Mismatched version in @oclif/plugin-warn-if-update-available plugin manifest. Expected: 1.5.4 Received: 1.5.1
This usually means you have an oclif.manifest.json file that should be deleted in development. This file should be automatically generated when publishing.
(node:4780) Warning: Mismatched version in @oclif/plugin-not-found plugin manifest. Expected: 1.2.1 Received: 1.2.0
This usually means you have an oclif.manifest.json file that should be deleted in development. This file should be automatically generated when publishing.
(node:4780) Warning: Mismatched version in @oclif/plugin-warn-if-update-available plugin manifest. Expected: 1.5.4 Received: 1.5.1
This usually means you have an oclif.manifest.json file that should be deleted in development. This file should be automatically generated when publishing.
(node:4780) Warning: Mismatched version in @oclif/plugin-not-found plugin manifest. Expected: 1.2.1 Received: 1.2.0
This usually means you have an oclif.manifest.json file that should be deleted in development. This file should be automatically generated when publishing.
No warning should appear.
sfdx --version
sfdx-cli/6.38.0-0d66175ccf (windows-x64) node-v8.9.4
sfdx plugins --core
@salesforce/plugin-generator 0.0.13
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 44.5.0
sfdx-djc-plugin 0.0.2 (link)
texei-sfdx-plugin 0.0.3
Bug
Throws the following error:
[3/5] 🚚 Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=8.9.4".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
(node:96523) [MODULE_NOT_FOUND] Error Plugin: mentz: Cannot find module '@salesforce/command'
This resulted in the dependencies stanza of package.json being left empty and the plugin failing to run as it couldn't find the @salesforce/command module.
Using node version 8.9.4, everything worked as expected.
The version of node detailed in the docs should allow the plugin generator to successfully scaffold the plugin.
Please mention your Salesforce CLI and OS version.
CLi sfdx-cli/6.44.0-dead729fb5 (darwin-x64) node-v8.9.4
OS: Mac OS X 10.14.2 18C54
I tried to look at the tests generated by the plugin, and write my own.
However, I couldn't find any documentation for this (like what is "withOrg" ?).
Could we have some documentation on what's available ?
Bug
Execute:
sfdx plugins:generate kbtest2, accept all the defaults
cd kbtest2
sfdx plugins:link
Output:
Installing dependencies for /Users/kbowden/kbtest2... done
Running prepare script for /Users/kbowden/kbtest2... done
Execute:
sfdx plugins
Output:
Running prepare script for /Users/kbowden/kbtest2... done
▸ Error parsing plugin /Users/kbowden/kbtest2
▸ 'MODULE_NOT_FOUND': Cannot find module '/Users/kbowden/kbtest2'
▸ Error parsing plugin /Users/kbowden/kbtest2
▸ 'MODULE_NOT_FOUND': Cannot find module '/Users/kbowden/kbtest2'
This output is produced for every sfdx command thereafter.
Executing sfdx plugins:unlink kbtest2 says that it isn't installed, but the behaviour continues. I have to uninstall sfdx and re-install it to fix.
When executed via bin/run, the plugin behaves as expected, so it seems to be how the plugin is associated with sfdx rather than errors in the plugin itself,
Linking the example plugin should not cause sfdx to throw errors.
Please mention your Salesforce CLI and OS version.
MacOS version 10.13.5 (17F77
sfdx-cli/6.21.0-9db990b3c9 (darwin-x64) node-v8.9.4
Error: command hello:org not found
is displayed when starting the bin/run hello:org -h
command after the plug-in generation on sfdx-cli/7.65.2-0f0403b8cc only!
sfdx plugins:generate
to generate the pluginbin/run hello:org -h
Hello Org command help should be displayed
Error: command hello:org not found is displayed
This is coming from the tsconfig.json that doesn't have the rootDir compiler options attribute, it's working when adding it.
SFDX CLI Version: sfdx-cli/7.65.2-0f0403b8cc
OS and version: macOS Catalina 10.15.3
When I try to run sfdx plugins:link
it tells me I'm "Missing bundle for locale en_US."
It should link
(node:95931) MissingBundleError Plugin: sfdx-git-packager: Missing bundle sfdx-git-diff-to-pkg:package for locale en_US.
module: @oclif/[email protected]
task: toCached
plugin: sfdx-git-packager
root: /Users/charlesjonas/Documents/code/sfdx-git-diff-to-pkg
See more details with DEBUG=*
(node:95931) MissingBundleError Plugin: sfdx-git-packager: Missing bundle sfdx-git-diff-to-pkg:package f
or locale en_US.
module: @oclif/[email protected]
task: toCached
plugin: sfdx-git-packager
root: /Users/charlesjonas/Documents/code/sfdx-git-diff-to-pkg
See more details with DEBUG=*
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It
is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning " > [email protected]" has unmet peer dependency "typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-d
ev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev".
warning " > [email protected]" has unmet peer dependency "typescript@>=2.0".
sfdx-cli: linking plugin sfdx-git-packager... done
(node:95931) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
Feel free to attach a screenshot.
SFDX CLI Version:
7.23.1-ced0ec4940
OS and version:
osx 10.14.5
Request a feature
Is it likely that we'll be able to execute commands from other namespaces as part of our plugins? For example, I'd like to be have a command that carries out some processing (e.g. to generate a package.xml) and then execute force:mdapi:retrieve. At the moment I'm using node scripts that carry out the processing and then executes sfdx, but that means the two items are a bit more independent of each other than I'd like.
This wouldn't be something that I'd want to do for every deployment, so I'm assuming that hooks wouldn't be the right solution, but don't really know anything about hooks so could easily be wrong!
yarn run prepack
throws error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'
$ sfdx plugins:generate foo # accept all defaults
$ cd foo
$ yarn run prepack
yarn run prepack should succeed
yarn run v1.19.1
$ rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme
node_modules/@salesforce/core/lib/config/configStore.d.ts:4:10 - error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'.
4 import { ConfigContents } from './configStore';
~~~~~~~~~~~~~~
Found 1 error.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It seems that this started to fail since typescript
was being resolved to v3.7.2
on generating the plugin.
SFDX CLI Version: sfdx-cli/7.33.2 darwin-x64 node-v12.12.0
$ sfdx plugins --core
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.2.2 (core)
generator 1.1.2 (core)
salesforcedx 47.6.2 (core)
├─ salesforce-alm 47.9.0 (core)
└─ salesforcedx-templates 47.6.2 (core)
sfdx-cli 7.33.2 (core)
OS and version: MacOS Catalina (10.15.1)
plugin help shows <%= command.id %> instead of hello:org
$ sfdx hello:org [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal]
$ sfdx <%= command.id %> [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal]
This is related to the changes in "@salesforce/[email protected]" (/forcedotcom/cli-packages#42)
Report a bug.
sfdx plugins:generate --defaults
sfdx
: sfdx plugins:link .
sfdx hello:org -u [aliasName]
The result is:
ERROR running Org: Invalid URI "/services/data/v39.0/query?q=Select%20Name%2C%20TrialExpirationDate%20from%20Organization"
The expected result would be something along the lines of this string:
let outputString = `Hello ${name}! This is org: ${orgName}`;
Please mention your Salesforce CLI and OS version.
Running on macOS 10.14.2.
sfdx --version
sfdx-cli/6.43.1-6021deb31d (darwin-x64) node-v8.9.4
sfdx plugins --core
@salesforce/plugin-generator 1.0.1 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 44.10.0 (core)
test 0.0.0 (link)
The Salesforce CLI Plug-In Developer Guide (v48.0) still mentions to run "yarn prepare" instead of "yarn prepack" at https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_style_descriptions.htm (last line on page)
sfdx plugins:generate myplugin
yarn prepare
as specified in the docsDocumentation should specify yarn prepack
not yarn prepare
$ yarn prepare
yarn run v1.21.1
error Command "prepare" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
SFDX CLI Version:
$ sfdx --version
sfdx-cli/7.42.1-e41dbeb8d9 darwin-x64 node-v10.15.3
$ sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.5 (core)
analytics 1.2.1 (core)
generator 1.1.1 (core)
salesforcedx 47.15.0 (core)
├─ salesforcedx-templates 47.16.0 (core)
└─ salesforce-alm 47.14.0 (core)
sfdx-cli 7.42.1 (core)
sfdx-waw-plugin 1.5.0
shane-sfdx-plugins 4.14.5
OS and version:
MacOS 10.14.6
Hi ,
It seems automatic scripts to load dependencies of SFDX plugins contains hardcoded Linux instructions.
Would it be possible to check the current system, or use cross-platform languages to perform file operations ?
To reproduce:
Install plugin sfdx_metadatas_filtering
sfdx plugins:install sfdx_metadatas_filtering
Launch a standard command like sfdx force:org:open
-> the plugin dependencies retrieval will be initiated, then it will crash when "rm" command is triggered
Many thanks & best regards
When using sfdx plugins:generate, the package.json file has an NPM script as follows
"commands": "./lib/commands"
but in the custom plugin directory structure, commands folder is under src folder.
This causes any plug-in commands to fail unless you change the NPM script to point to the correct filder.
Result: hello:org is not a command
Result: it works now
The package.json NPM script should accurately reflect the directly structured provided.
There's a mismatch between the NPM script and the directory structure.
Feel free to attach a screenshot.
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.78.1-5a65d9dd2f darwin-x64 node-v12.18.3
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.1 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-diff 0.0.6
@salesforce/sfdx-scanner 2.4.0
@salesforce/sfdx-trust 3.4.3 (core)
alias 1.1.2 (core)
analytics 1.12.1 (core)
auth 1.3.0 (core)
config 1.1.10 (core)
documentor 0.0.0 (link) /Users/pgonzalez/Documents/trailheadOrgs/org1/documentor
generator 1.1.3 (core)
salesforcedx 50.3.1 (core)
├─ templates 50.1.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ salesforce-alm 50.3.1 (core)
├─ custom-metadata 1.0.10 (core)
└─ apex 0.1.2 (core)
sfdx-cli 7.78.1 (core)
OS and version:
MacOS Catalina version 10.15.7
I've executed the following without making any changes to the generated code:
mkdir sfdx-ntx-plugin-test
cd sfdx-ntx-plugin-test
sfdx plugins:generate // and stepped through questions
yarn run prepare
yarn publish // publishes fine
sfdx plugins:install sfdx-ntx-plugin-test // installs fine
sfdx hello:org // error
! 'MODULE_NOT_FOUND': Cannot find module 'C:\Users\VidalB\AppData\Local\sfdx\plugins\node_modules\sfdx-ntx-plugin-test\lib\commands\hello\org'
sfdx-cli/6.31.0-32aa4b4408 (windows-x64) node-v8.9.4
Microsoft Windows 10 Enterprise - 10.0.17134 Build 17134
$ rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme
Error: node_modules/@types/jsforce/query.d.ts(71,13): error TS2368: Type parameter name cannot be 'never'.
Any idea to bypass this error ?
Same problem has been described by another user here -> https://developer.salesforce.com/forums/?id=9062I000000DKahQAG
From my desktop on a personal machine:
sfdx plugins:generate testplug --defaults
cd .\testplug\
.\bin\run sfdx hello:org -h
Result:
Error: command sfdx not found
Command to compile and write to the console the behavior from the example
All below are in system environment variable PATH and user environment variable PATH:
C:\Users\myusername\AppData\Roaming\nvm
C:\Program Files\nodejs
C:\Users\myusername\AppData\Roaming\npm
C:\Program Files\Salesforce CLI\bin
C:\Users\myusername\AppData\Local\sfdx\client\bin
Config:
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.17134 N/A Build 17134
Node: v8.11.4
NPM: 5.6.0
SFDX: sfdx-cli/6.44.0-dead729fb5 (windows-x64) node-v8.9.4
Attempting to follow example posted @ https://developer.salesforce.com/docs/atlas.en-us.216.0.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate_scaffold.htm
Please let me know any additional steps if needed.
I am getting an error while trying to run my plugin with --dev-suspend flag.
$ sfdx test:myplugin:set -u xxx -d ./fields.csv --dev-suspend
ERROR running set: Unexpected argument: --dev-suspend
See more help with --help
OS:Windows 7, using bash shell
$ sfdx --version
sfdx-cli/6.34.0-6fec0d751a (windows-x64) node-v8.9.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.