1

We are trying to use sfdx only to spin up scratch orgs with desired configuration (we have a standalone config file, scratch-org-def.json to feed to force:org:create command).

Our project is in old metadata format, i.e. it is not a DX project at all.

After spinning up scratch org, we are deploying project metadata with the help of force:mdapi:deploy

So basically we've just replaced dev sandboxes with scratch orgs (since it's faster to spin up them), but still continue development as for old style sandbox flow.

Now we'd like to spin up scratch orgs with a namespace of our managed package. We've already linked namespace to our dev hub org. But as I see in order to specify namespace, we need to have truly DX project structure, i.e. with sfdx-project.json file (that's where namespace should be specified).

How could we just spin up scratch org with namespace but without setting up DX project structure? We would deploy our classic metadata to such scratch org with namespace to debug different packaging issues etc.

Any help would be appreciated. Thanks in advance.

  • Deploying from the DX Source structure to metadata doesn't have to be so painful. Consider using the technique I layout in my answer to the following post. You can actually avoid force:mdapi:deploy and the converting commands altogether if you set things up correctly – Brian Miller Apr 13 at 18:49
  • What are your challenges with DX format? It's painless to do conversion via force:mdapi:convert, and you can deploy to non-scratch orgs via force:source:deploy. Unless I'm missing something, or you've left something out, DX format should be the way to go. – sfdcfox Apr 13 at 18:53
  • @sfdcfox Our project is huge with complex build and deployment process - source code manipulation on the fly, dynamic variables injection, static resource generation, even some http calls to get and inject data etc. We don't want to touch this mess now. But what we'd like to do is to use DX and scratch orgs to sort of spin up many packaging orgs with a namespace of our main package, so that developers wouldn't need to share single packaging org anymore. It was advertised that DX is not all or nothing, and we may adopt it gradually, or just use functionality we like, e.g. namespaced scratch org – wesaw Apr 13 at 19:03

Your Answer

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

Browse other questions tagged or ask your own question.