callawaycloud / generator-ccc

Yeoman Generator for Callaway Cloud Salesforce Projects
19 stars 8 forks source link

SFDX Errors without a "name" in the package.json / Add "name" to default package.json #8

Closed ralphcallaway closed 4 years ago

ralphcallaway commented 4 years ago

Ran on an org without an existing package.json and all sfdx commands start erroring out

Starting SFDX: Create Apex Class

23:43:06.877 sfdx force:apex:class:create --classname SomeClass --template DefaultApexClass --outputdir src/main/default/classes
ERROR running force:apex:class:create:  A name parameter is required to create a storage
23:43:07.828 sfdx force:apex:class:create --classname SomeClass --template DefaultApexClass --outputdir src/main/default/classes ended with exit code

see https://github.com/forcedotcom/salesforcedx-vscode/issues/253 for a discussion of the underlying issue

would be good to add a default "name" attribute to the package.json. an easy option would be to pull the value of the parent folder, i.e. /users/myname/dev/proj_name would use proj_name for the name attribute

ChuckJonas commented 4 years ago

this will require a bit of work. Right now we are just using extendJson, but for this we will need to first read the package.json (if it exists), then merge it into our defaults, then write it back out to package.json.

Shouldn't be too hard, but a 2hr solution to replace the 2 minute one I started with

ralphcallaway commented 4 years ago

totally, a placeholder could even work short term, that would at least ensure people could use sfdx without any additional steps after running the generator

ralphcallaway commented 4 years ago

well for me it's a 15 min solution :trollface: