Skip to content

Commit

Permalink
Aligning project configs with Salesforce CLI (trailheadapps#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
muenzpraeger authored Mar 1, 2019
1 parent b2cbf8f commit db67975
Show file tree
Hide file tree
Showing 15 changed files with 1,547 additions and 1,514 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

7 changes: 4 additions & 3 deletions .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ package.xml
**profiles
**settings


**/__tests__/**
**/test/jest-mocks/**
# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**
46 changes: 32 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
.classpath
.DS_Store
.idea
.project
.salesforce
.settings
# This file is used for Git repositories to specify intentionally untracked files that Git should ignore.
# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore
# For useful gitignore templates see: https://github.com/github/gitignore

# Salesforce cache
.sfdx/
.tern-project
.vscode/
!.vscode/extensions.json
!.vscode/settings.json
**/jsconfig.json

# LWC VSCode autocomplete
jsconfig.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Dependency directories
node_modules/
selenium-client-jars/
test/artifacts/
yarn.lock

# Eslint cache
.eslintcache

# MacOS system files
.DS_Store

# Windows system files
Thumbs.db
ehthumbs.db
[Dd]esktop.ini
$RECYCLE.BIN/

# VS Code project settings
.vscode/
7 changes: 1 addition & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
# More information: https://prettier.io/docs/en/ignore.html
#

**/aura/**/*.design
**/aura/**/*.evt
**/aura/**/*.svg
**/aura/**/*.xml
**/lwc/**/*.svg
**/lwc/**/*.xml
**/staticresources/**
.sfdx
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"options": { "parser": "lwc" }
},
{
"files": "*.cmp",
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
Expand Down
104 changes: 52 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,73 @@ E-Bikes is a sample application that demonstrates how to build applications with

## Table of contents

- Installation Instructions
- Installation Instructions

- [Installing E-Bikes using Salesforce DX](#installing-e-bikes-using-salesforce-dx)
- [Installing E-Bikes using an unlocked package](#installing-e-bikes-using-an-unlocked-package)
- [Installing E-Bikes using Salesforce DX](#installing-e-bikes-using-salesforce-dx)
- [Installing E-Bikes using an unlocked package](#installing-e-bikes-using-an-unlocked-package)

- [Optional installation instructions](#optional-installation-instructions)
- [Optional installation instructions](#optional-installation-instructions)

- [Application Walkthrough](#application-walkthrough)
- [Application Walkthrough](#application-walkthrough)

## Installation Instructions

There are two ways to install E-Bikes:

- [Using Salesforce DX](#installing-e-bikes-using-salesforce-dx): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
- [Using an Unlocked Package](#installing-e-bikes-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.
- [Using Salesforce DX](#installing-e-bikes-using-salesforce-dx): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
- [Using an Unlocked Package](#installing-e-bikes-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.

## Installing E-Bikes using Salesforce DX

1. Set up your environment. Follow the steps in the [Quick Start: Lightning Web Components](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/) Trailhead project. The steps include:

- Enable Dev Hub in your Trailhead Playground
- Install Salesforce CLI
- Install Visual Studio Code
- Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension
- Enable Dev Hub in your Trailhead Playground
- Install Salesforce CLI
- Install Visual Studio Code
- Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension

2. If you haven't already done so, authenticate with your hub org and provide it with an alias (**myhuborg** in the command below):

```
sfdx force:auth:web:login -d -a myhuborg
```
```
sfdx force:auth:web:login -d -a myhuborg
```

3. Clone the repository:

```
git clone https://github.com/trailheadapps/ebikes-lwc
cd ebikes-lwc
```
```
git clone https://github.com/trailheadapps/ebikes-lwc
cd ebikes-lwc
```

4. Create a scratch org and provide it with an alias (**ebikes** in the command below):

```
sfdx force:org:create -s -f config/project-scratch-def.json -a ebikes
```
```
sfdx force:org:create -s -f config/project-scratch-def.json -a ebikes
```

5. Push the app to your scratch org:

```
sfdx force:source:push
```
```
sfdx force:source:push
```

6. Assign the **ebikes** permission set to the default user:

```
sfdx force:user:permset:assign -n ebikes
```
```
sfdx force:user:permset:assign -n ebikes
```

7. Load sample data:

```
sfdx force:data:tree:import --plan ./data/sample-data-plan.json
```
```
sfdx force:data:tree:import --plan ./data/sample-data-plan.json
```

8. Open the scratch org:

```
sfdx force:org:open
```
```
sfdx force:org:open
```

9. In **Setup**, under **Themes and Branding**, activate the **Lightning Lite** theme.

Expand All @@ -94,31 +94,31 @@ There are two ways to install E-Bikes:

6. Import Account data:

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/accounts.csv) to acccess the **accounts.csv** file. Right click in the browser window and save the file as **accounts.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Standard objects** tab, click **Accounts and Contacts**, and click **Add new records**.
- Drag the **accounts.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.
- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/accounts.csv) to acccess the **accounts.csv** file. Right click in the browser window and save the file as **accounts.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Standard objects** tab, click **Accounts and Contacts**, and click **Add new records**.
- Drag the **accounts.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.

7. Import Product Family data:

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/product_families.csv) to acccess the **product_families.csv** file. Right click in the browser window and save the file as **product_families.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Product Families**, and click **Add new records**.
- Drag the **product_families.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.
- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/product_families.csv) to acccess the **product_families.csv** file. Right click in the browser window and save the file as **product_families.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Product Families**, and click **Add new records**.
- Drag the **product_families.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.

8. Import Product data:

- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/products.csv) to acccess the **products.csv** file. Right click in the browser window and save the file as **products.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Products**, and click **Add new records**.
- In the **Add new records** menu, under _Which Product Family field in your file do you want to match against to set the Product Family lookup field?_ select **Product Family Name** in the dropdown menu.
- Drag the **products.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.
- Click [here](https://raw.githubusercontent.com/trailheadapps/ebikes-lwc/master/data/products.csv) to acccess the **products.csv** file. Right click in the browser window and save the file as **products.csv**.
- In **Setup**, type **Data Import** in the Quick Find box and click **Data Import Wizard**.
- Click **Launch Wizard**.
- Click the **Custom objects** tab, click **Products**, and click **Add new records**.
- In the **Add new records** menu, under _Which Product Family field in your file do you want to match against to set the Product Family lookup field?_ select **Product Family Name** in the dropdown menu.
- Drag the **products.csv** file you just saved and drop it in the upload area.
- Click **Next**, **Next**, and **Start Import**.

9. In App Launcher, select the **E-Bikes** app.

Expand Down
6 changes: 5 additions & 1 deletion bin/check-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const pjson = require('../package.json');

const version = pjson.engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(`\n\nRequired node version ${version} not satisfied with current version ${process.version}.\n\n`);
console.log(
`\n\nRequired node version ${version} not satisfied with current version ${
process.version
}.\n\n`
);
process.exit(1);
}
20 changes: 10 additions & 10 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"orgName": "Ebikes",
"edition": "Developer",
"hasSampleData": "false",
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true,
"s1EncryptedStoragePref2": false
}
}
"orgName": "Ebikes",
"edition": "Developer",
"hasSampleData": "false",
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true,
"s1EncryptedStoragePref2": false
}
}
}
2 changes: 1 addition & 1 deletion data/Accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"BillingCountry": "USA"
}
]
}
}
78 changes: 39 additions & 39 deletions data/Product_Family__cs.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"records": [
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "DynamoRef"
},
"Name": "Dynamo",
"Description__c": "Performance and reliability. The best choice for hobbyists and enthusiasts.",
"Category__c": "Mountain"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "FuseRef"
},
"Name": "Fuse",
"Description__c": "Commute and off-road? The Fuse bikes do it all!",
"Category__c": "Hybrid"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "ElectraRef"
},
"Name": "Electra",
"Description__c": "Top of the line commuter bikes that can handle long and challenging commutes.",
"Category__c": "Commuter"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "VoltRef"
},
"Name": "Volt",
"Description__c": "Fun and Foldable electric bicycles.",
"Category__c": "Commuter"
}
]
}
"records": [
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "DynamoRef"
},
"Name": "Dynamo",
"Description__c": "Performance and reliability. The best choice for hobbyists and enthusiasts.",
"Category__c": "Mountain"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "FuseRef"
},
"Name": "Fuse",
"Description__c": "Commute and off-road? The Fuse bikes do it all!",
"Category__c": "Hybrid"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "ElectraRef"
},
"Name": "Electra",
"Description__c": "Top of the line commuter bikes that can handle long and challenging commutes.",
"Category__c": "Commuter"
},
{
"attributes": {
"type": "Product_Family__c",
"referenceId": "VoltRef"
},
"Name": "Volt",
"Description__c": "Fun and Foldable electric bicycles.",
"Category__c": "Commuter"
}
]
}
Loading

0 comments on commit db67975

Please sign in to comment.