I would like to break my project into multiple submodules:

- config
- module-1
-- main
--- default
---- classes
- module-2
-- main
--- default
---- classes    
- etc

Is there a Visual Studio Code command-palette command or Salesforce DX CLI command to create submodules with the correct scaffolding?


Salesforce's Tech Evangelists have created some tools and patterns you may be interested in:

Based on the issues and pull requests, it looks like the number of users is small though.

I've set one project up using multiple "module" folders i.e. applied some of these patterns but chose to stick to the core SFDX commands to do that. It was of some help in organizing the code, as that project had some distinct pieces.

But when modules are pushed into an org, you are back to having a single namespace and a couple of times we had components of the same name in more than one module with confusing results. The other gotcha I experienced was this How to use "sfdx force:source:pull" with folders other than "main/default" where components are added in the scratch org?.

My opinion after that project is that you are on much safer and better understood territory sticking to just the one default "module" pattern for now unless your project is very large. Also, perhaps Second-Generation Packaging will offer more.

| improve this answer | |
  • Thanks Keith. I was actually going to have Go lang code in the other module, is that going to cause problems with Salesforce DX? – Robs Sep 9 '18 at 12:51
  • @robs I don't think so; just nominate the SF folder in your sfdx-project.json. – Keith C Sep 9 '18 at 13:12
  • What do you mean by nominate the SF folder in your sfdx-project.json ? – Robs Sep 9 '18 at 15:37
  • 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.