Newer Version Available
Use a Sample Repo to Get Started
The quickest way to get going with Salesforce DX tooling is to clone the dreamhouse-lwc GitHub repo. Use its configuration files and
Salesforce application to try some commonly used Salesforce CLI commands. In addition to
source code for the application, the repo includes sample data and Apex tests.
-
Open a terminal or command prompt window, and clone the dreamhouse-lwc GitHub
sample repo using HTTPS or SSH.
HTTPS:
SSH:
-
Change to the dreamhouse-lwc project
directory.
-
Authorize your
Dev
Hub org by logging into it, set it as your default, and
assign it an alias.
Enter your Dev Hub org credentials in the browser that opens. After you log in successfully, you can close the browser.
-
Create a scratch org using the config/project-scratch-def.json file, set the org as your
default, and assign it an alias.
The command uses the default Dev Hub you set with the sf org login web command in a previous step.
-
View the orgs that you've either created or logged into.
The first table displays the Dev Hub you logged into and the second table displays the scratch org you created. The right-most column in both tables indicates the default scratch org and Dev Hub org with (U) and (D), respectively. The ALIAS column displays the aliases you assigned each org. Here’s some sample output.
-
Deploy the Dreamforce app, whose source is in the force-app directory, to the scratch org.
-
Assign the dreamhouse permission set to
the default scratch org user (test-ibnpzayw@example.com).
-
Import sample data from three objects (Contact, Property, and Broker) into the
scratch org using the specified plan definition file.
-
Run Apex tests.
Apex tests run asynchronously by default. If the tests finish before the --wait value, the results are displayed. Otherwise, use the displayed command to get the results using a job ID.
-
Open the scratch org and view the deployed metadata under Most Recently
Used.
- In App Launcher, find and open the Dreamhouse application.
Congrats! You just deployed an application to a new scratch org.