Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3d1509f
Showing
140 changed files
with
7,718 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
version: 2 | ||
|
||
# Defining default values for all jobs | ||
defaults: &defaults | ||
docker: | ||
- image: circleci/node:8.9.4-browsers | ||
|
||
jobs: | ||
setup_dx: | ||
# This command runs the preparation steps needed for the CI workflow: | ||
# | ||
# - Installation of the Salesforce CLI using npm | ||
# - Install npm dependencies for LWC testing | ||
# - Authentication of the DevHub | ||
# - Creation of a scratch org | ||
# | ||
# While a scratch org isn't needed in all steps it's still part of the process. The reason for this is | ||
# that we need to store the sfdx configuration files for it in the workspace, so that data can be shared | ||
# across different workflow steps. | ||
# | ||
# Keep it simple! | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install Salesforce DX and package dependencies | ||
command: | | ||
openssl enc -nosalt -aes-256-cbc -d -in .circleci/server.key.enc -out .circleci/server.key -base64 -K $DECRYPTION_KEY -iv $DECRYPTION_IV | ||
export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true | ||
export SFDX_DOMAIN_RETRY=300 | ||
npm install | ||
npm install sfdx-cli | ||
node_modules/sfdx-cli/bin/run --version | ||
node_modules/sfdx-cli/bin/run plugins --core | ||
- run: | ||
name: Authenticate DevHub | ||
command: | | ||
# if [[ $CIRCLE_BRANCH == prerelease* ]]; then | ||
# Temporary using pre-release till R2b (Spring '19 GA Launch') | ||
node_modules/sfdx-cli/bin/run force:auth:jwt:grant --clientid $CONSUMERKEY_PRERELEASE --jwtkeyfile .circleci/server.key --username $USERNAME_PRERELEASE --setdefaultdevhubusername -a HubOrg | ||
# else | ||
# node_modules/sfdx-cli/bin/run force:auth:jwt:grant --clientid $CONSUMERKEY --jwtkeyfile .circleci/server.key --username $USERNAME --setdefaultdevhubusername -a HubOrg | ||
# fi | ||
- run: | ||
name: Define CI Org | ||
# We define the to be used CI org. Based on the branch we either create a new scratch org | ||
# or we use a project variable to authenticate a UAT or full-copy sandbox as target org. | ||
# | ||
# You can get the sfdxurl via sfdx force:org:display -u yourOrg --json --verbose from your local machine. | ||
command: | | ||
echo $SFDX_AUTH_PACKAGING > ~/auth.url | ||
node_modules/sfdx-cli/bin/run force:auth:sfdxurl:store -s -a packagingorg -f ~/auth.url | ||
node_modules/sfdx-cli/bin/run force:org:create -v HubOrg -s -f config/project-scratch-def.json -a ciorg -d 1 | ||
- persist_to_workspace: | ||
# This is an important step. If we don't store the project data (cloned GitHub source and node_modules from the CLI installation) | ||
# we'd have to re-run installation for every workflow step. | ||
# | ||
# Also this step is crucial as we use it to share sfdx config parameters between steps. | ||
root: ~/ | ||
paths: | ||
- .sfdx/* | ||
- project/* | ||
lint_lwc: | ||
# This lints Lightning Web Components. | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Lint Lightning Web Components | ||
command: | | ||
npm run lint:lwc | ||
# unit_test_lwc: | ||
# This runs Jest unit tests for Lightning Web Components. | ||
# <<: *defaults | ||
# steps: | ||
# - attach_workspace: | ||
# at: ~/ | ||
# - run: | ||
# name: Unit Test Lightning Web Components | ||
# command: | | ||
# npm run test:unit | ||
deploy_source: | ||
# This deploys the source to the ci scratch org. | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Push Source | ||
command: | | ||
node_modules/sfdx-cli/bin/run plugins:install salesforcedx@pre-release # Temporary using the pre-release plugin | ||
node_modules/sfdx-cli/bin/run force:source:push -u ciorg | ||
create_and_test_package: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Create and install package | ||
command: | | ||
if [[ $SFDX_TEST_PACKAGING == "true" ]]; then | ||
scripts/packagingDeployment.sh | ||
fi | ||
no_output_timeout: 15m | ||
|
||
run_apex_tests: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Run Apex Tests | ||
command: | | ||
node_modules/sfdx-cli/bin/run force:apex:test:run -u ciorg -c -r human | ||
cleanup_scratch_org: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Clean Up | ||
command: | | ||
node_modules/sfdx-cli/bin/run force:org:delete -u ciorg -p | ||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- setup_dx | ||
- lint_lwc: | ||
requires: | ||
- setup_dx | ||
filters: | ||
branches: | ||
ignore: master | ||
# - unit_test_lwc: | ||
# requires: | ||
# - lint_lwc | ||
# filters: | ||
# branches: | ||
# ignore: master | ||
- deploy_source: | ||
requires: | ||
- lint_lwc | ||
filters: | ||
branches: | ||
ignore: master | ||
- create_and_test_package: | ||
requires: | ||
- setup_dx | ||
filters: | ||
branches: | ||
only: master | ||
- run_apex_tests: | ||
requires: | ||
- deploy_source | ||
filters: | ||
branches: | ||
ignore: master | ||
- cleanup_scratch_org: | ||
requires: | ||
- setup_dx | ||
- deploy_source | ||
- create_and_test_package | ||
- run_apex_tests | ||
- lint_lwc | ||
# - unit_test_lwc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
bwUgu/JQxD5XDuEVP+5jEf+MVgoqNBpBVHBTMSW7jIHcdziW9m2JR5W37UapalJO | ||
/PmhErFKILGJ2hXqqGt7bL+d/ssqHwVavOieBGTmRqOZJ8hAwpppLdm5y148CWj1 | ||
8X5pRrEdb2sHfvMj+rxbyq87s3airgSLCJ1ph7OrNxPHu2fL+zy3k4qLtONb7VBu | ||
qy5czgBDSva1aEXZeiizgWwfYrUaxECX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GG/QdQQh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{json,yml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/lwc/**/*.css | ||
**/lwc/**/*.html | ||
**/lwc/**/*.json | ||
**/lwc/**/*.svg | ||
**/lwc/**/*.xml | ||
.sfdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status | ||
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm | ||
# | ||
|
||
# Standard metadata | ||
package.xml | ||
**appMenu | ||
**appSwitcher | ||
**objectTranslations | ||
**profiles | ||
**settings | ||
|
||
**/jsconfig.json | ||
**/.eslintrc.json | ||
**/__test__/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Details | ||
|
||
|
||
## Does this PR introduce a new sample? | ||
Does this PR introduce a new Lightning web component sample? | ||
* [ ] Yes | ||
* [ ] No | ||
|
||
If yes, please ensure that new samples adhere to 'Documentation Guidelines' in CONTRIBUTING.md | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.classpath | ||
.DS_Store | ||
.idea | ||
.project | ||
.salesforce | ||
.settings | ||
.sfdx/ | ||
.tern-project | ||
.vscode/ | ||
!.vscode/extensions.json | ||
!.vscode/settings.json | ||
assets/ | ||
!assets/server.key.enc | ||
node_modules/ | ||
selenium-client-jars/ | ||
test/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**/lwc/**/*.css | ||
**/lwc/**/*.html | ||
**/lwc/**/*.svg | ||
**/lwc/**/*.xml | ||
.sfdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"tabWidth": 4, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
## Documentation Guidelines for Samples | ||
|
||
These samples are used for on-boarding to Lightning Web Components. Each sample must have a clear learning objective. | ||
|
||
* Use JSDoc format for classes, public properties and methods, and functions. | ||
* Document the learning objective on the JavaScript class. | ||
* Spell check your comments and code. | ||
* Err on the side of being verbose. | ||
|
||
It's strongly recommended to configure your editor as described below. It will assist with these requirements. | ||
|
||
## Prerequisites | ||
|
||
Configure the project using the steps in the root [README](README.md). You must authenticate to your org and create a scratch org to run the visual regression tests. | ||
|
||
## System Requirements | ||
|
||
* [Node 8.x](https://nodejs.org/en/) | ||
* NPM 5.x | ||
|
||
## Editor Configurations | ||
|
||
Configuring your editor to use our lint and code style rules to simplify your development experience and expedite the pull request review. | ||
|
||
### editorconfig | ||
|
||
[Configure your editor](http://editorconfig.org/#download) to use our editor configurations. | ||
|
||
### Spell Checker | ||
|
||
Configure your editor to use your favorite spell checker. | ||
|
||
## Useful Development Workflow Commands | ||
|
||
### Install Dependencies | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
#### Lint Your Changes | ||
|
||
```bash | ||
npm run lint | ||
``` | ||
|
||
#### Test Your Changes | ||
|
||
Changes must pass functional unit tests and visual regression tests. Visual regression tests require a scratch org. | ||
|
||
```bash | ||
npm run test | ||
``` | ||
|
||
## Git Workflow | ||
|
||
The process of submitting a pull request is straightforward, and | ||
follows the same pattern each time: | ||
|
||
1. [Clone the repository](#clone-the-repository) | ||
2. [Create a feature branch](#create-a-feature-branch) | ||
3. [Make your changes](#make-your-changes) | ||
4. [Merge](#merge) | ||
5. [Create a pull request](#create-a-pull-request) | ||
|
||
### Clone the Repository | ||
|
||
```bash | ||
git clone git@github.com:forcedotcom/dreamhouse-lwc.git | ||
``` | ||
|
||
### Create a Feature Branch | ||
|
||
```bash | ||
git checkout master | ||
git pull origin master | ||
git checkout -b <name-of-the-feature> | ||
``` | ||
|
||
### Make Your Changes | ||
|
||
Modify the files, lint, build, push, test, and eventually commit your code using the following command: | ||
|
||
```bash | ||
git add <path/to/file/to/commit> | ||
git commit | ||
git push origin HEAD | ||
``` | ||
|
||
Commit your changes using a descriptive commit message. The above commands | ||
commit the files into your feature branch. Keep pushing new changes into the | ||
same branch until you're ready to create a pull request. | ||
|
||
### Merge | ||
|
||
Sometimes your feature branch gets stale with respect to the master branch, | ||
and requires newer commits on master to be merged into your branch. The | ||
following steps can help: | ||
|
||
```bash | ||
git checkout master | ||
git pull | ||
git checkout <feature-branch> | ||
git merge master | ||
``` | ||
|
||
Don't worry about creating extra merge commits in your pull request. When your | ||
pull request is merged, all commits on the branch are consolidated down to a | ||
single commit. | ||
|
||
### Create a Pull Request | ||
|
||
If you've never created a pull request before, follow [these | ||
instructions](https://help.github.com/articles/creating-a-pull-request/). | ||
Pull request examples can be found [here](https://github.com/forcedotcom/dreamhouse-lwc/pulls). |
Oops, something went wrong.