Skip to content

Commit

Permalink
Aligning project configs with Salesforce CLI (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
muenzpraeger committed Mar 1, 2019
1 parent c7a6f90 commit 341754d
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 440 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

5 changes: 4 additions & 1 deletion .forceignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ package.xml
**profiles
**settings

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json
**/__test__/**

# LWC Jest
**/__tests__/**

44 changes: 31 additions & 13 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

# 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/
node_modules

# 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
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,60 @@ DreamHouse is a sample application that demonstrates the unique value propositio

There are two ways to install Dreamhouse:

- [Using Salesforce DX](#installing-dreamhouse-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-dreamhouse-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.
- [Using Salesforce DX](#installing-dreamhouse-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-dreamhouse-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.

## Installing Dreamhouse 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 this repository:

```
git clone https://github.com/dreamhouseapp/dreamhouse-lwc
cd dreamhouse-lwc
```
```
git clone https://github.com/dreamhouseapp/dreamhouse-lwc
cd dreamhouse-lwc
```

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

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

5. Push the app to your scratch org:

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

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

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

7. Import sample data:

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

8. Open the scratch org:

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

9. Select **DreamHouse** in the App Launcher

Expand All @@ -89,7 +89,7 @@ This repository contains several files that are relevant if you want to integrat

### Code formatting

[Prettier](https://prettier.io (https://prettier.io/)) is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) from the Visual Studio Code Marketplace. The [.prettierignore](/.prettierignore) and [.prettierrc](/.prettierrc) files are provided as part of this repository to control the behavior of the Prettier formatter.
[Prettier](https://prettier.io 'https://prettier.io/') is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) from the Visual Studio Code Marketplace. The [.prettierignore](/.prettierignore) and [.prettierrc](/.prettierrc) files are provided as part of this repository to control the behavior of the Prettier formatter.

### Code linting

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);
}
12 changes: 6 additions & 6 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"orgName": "Dreamhouse",
"edition": "Developer",
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true,
"s1EncryptedStoragePref2": false
}
}
"orgPreferenceSettings": {
"s1DesktopEnabled": true,
"selfSetPasswordInApi": true,
"s1EncryptedStoragePref2": false
}
}
}

0 comments on commit 341754d

Please sign in to comment.