Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/yaml-and-lint-staged…
Browse files Browse the repository at this point in the history
…-2.2.2
  • Loading branch information
jrattanpal authored Aug 17, 2023
2 parents 72e5c3a + 6979e5b commit 5dbf529
Show file tree
Hide file tree
Showing 31 changed files with 781 additions and 770 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
**/aura/**/*.xml
**/aura/**/*.app
.sfdx
.sf
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**

- OS: [e.g. OSX, Windows]
- Browser [e.g. chrome, safari]
- Version [e.g. 4.0.1]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
commit-message:
prefix: 'build'
include: 'scope'
rebase-strategy: 'auto'
schedule:
interval: 'daily'
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
commit-message:
prefix: 'ci'
include: 'scope'
rebase-strategy: 'auto'
schedule:
interval: 'daily'
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Unique name for this workflow
name: On Push

# Definition when the workflow should run
on:
workflow_dispatch:
push:
#paths-ignore:
#- "sfdx-project.json"
#- "README.md"
paths:
- 'force-app/**'
- '.github/workflows/ci.yml'

# Jobs to be executed
jobs:
format-lint:
runs-on: ubuntu-latest
steps:
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v3

# Cache node_modules to speed up the process
- name: 'Restore node_modules cache'
id: cache-npm
uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-${{ env.cache-name }}-
npm-
# Install npm dependencies for Prettier and Jest
- name: 'Install npm dependencies'
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

# Prettier formatting
- name: 'Code formatting verification with Prettier'
run: npm run prettier:verify
40 changes: 40 additions & 0 deletions .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Dependabot Pull Request Approve and Merge
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
# Auto merge Dependabot PRs for:
# - patch updates on prod dependencies
# - minor updates on dev dependencies
dependabot-auto-merge:
# Only run for Dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: 'Fetch Dependabot metadata'
id: dependabot
uses: dependabot/fetch-metadata@v1
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

- name: 'Check auto merge conditions'
id: auto-merge
if: |
(
steps.dependabot.outputs.update-type == 'version-update:semver-patch' &&
contains('direct:production,indirect:production', steps.dependabot.outputs.dependency-type)
) || (
contains('version-update:semver-minor,version-update:semver-patch', steps.dependabot.outputs.update-type) &&
contains('direct:development,indirect:development', steps.dependabot.outputs.dependency-type)
)
run: echo "::notice ::auto-merge conditions satisfied"

- name: 'Approve and merge PR'
if: ${{ steps.auto-merge.conclusion == 'success' }}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
7 changes: 0 additions & 7 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

#npm version pull - will be used for Git commit/PR testing in future
VERSION=$(curl -s https://api.github.com/repos/pmd/pmd/releases/latest | grep '.tag_name' | sed 's:.*/::' | sed 's:",::')
echo $VERSION

printf '%s' "$VERSION" > pmd/pmd-version.txt
git add pmd/pmd-version.txt

npx precommit
7 changes: 5 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
# More information: https://prettier.io/docs/en/ignore.html
#

**/staticresources/**
.localdevserver
.sfdx
.vscode

coverage/

# For now, let's try ignoring the metadata files
*.xml
*.xml
# Ignore javascript not in force-app, and ignore in staticresources
*.js
!force-app/**/*.js
**/staticresources/**
43 changes: 24 additions & 19 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
{
"trailingComma": "none",
"singleQuote": true,
"tabWidth": 2,
"printWidth": 180,
"useTabs": true,
"bracketSpacing": true,
"apexInsertFinalNewline": false,
"bracketSameLine": true,
"singleAttributePerLine": false,
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
"trailingComma": "none",
"singleQuote": true,
"tabWidth": 2,
"printWidth": 180,
"useTabs": true,
"bracketSpacing": true,
"apexInsertFinalNewline": false,
"bracketSameLine": true,
"singleAttributePerLine": false,
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html", "bracketSameLine": false }
},
{
"files": "*.cls",
"options": { "parser": "apex" }
}
],
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"]
}
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/.sfdx": true
"**/.sfdx": true,
"**/.sf": true
},
"apexPMD.enableCache": true,
"apexPMD.rulesets": [
"pmd/ruleset.xml"
],
"editor.formatOnSave": true
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.configPath": ".prettierrc"
}
84 changes: 42 additions & 42 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Table of Contents

- [Direct deployment to an org](#direct-deployment-to-an-org): Quickest option to install this unmanaged code into your org
- [Direct deployment to an org](#direct-deployment-to-an-org): Quickest option to install this unmanaged code into your org

- [Installing the app using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
- [Installing the app using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.

- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.
- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.

## Direct deployment to an org

Expand All @@ -19,46 +19,46 @@

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
- Enable Dev Hub in your Trailhead Playground
- Install Salesforce CLI
- Install Visual Studio Code

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

```
sfdx force:auth:web:login -d -a myhuborg
```
```
sf org login web --set-default-dev-hub --alias myhuborg
```

3. Clone the Survey Force repository:

```
git clone https://github.com/salesforcelabs/survey-force
cd survey-force
```
```
git clone https://github.com/salesforcelabs/survey-force
cd survey-force
```

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

```
sfdx force:org:create -s -f config/project-scratch-def.json -a surveyforce
```
```
sf org create scratch --set-default --definition-file config/project-scratch-def.json --alias surveyforce
```

5. Push the app to your scratch org:

```
sfdx force:source:push
```
```
sf project deploy start
```

6. Assign the `Survey_Force_SuperAdmin` permission set to the admin user.

```
sfdx force:user:permset:assign -n Survey_Force_SuperAdmin
```
```
sf org assign permset --name Survey_Force_SuperAdmin
```

7. Open the scratch org:

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

8. In App Launcher, click **View All** then select the **Survey Force** app.

Expand All @@ -71,35 +71,35 @@ Make sure to start from a brand-new environment to avoid conflicts with previous

1. Authorize your Sandbox, Trailhead Playground, or Developer org and provide it with an alias (**mysurveyorg** in the command below):

```
sfdx force:auth:web:login -d -a mysurveyorg
```
```
sf org login web --set-default-dev-hub --alias mysurveyorg
```

1. Clone this repository:

```
git clone https://github.com/salesforcelabs/survey-force
cd survey-force
```
```
git clone https://github.com/salesforcelabs/survey-force
cd survey-force
```

1. If you are setting up a Developer Edition: go to **Setup**, under **My Domain**, [register a My Domain](https://help.salesforce.com/articleView?id=domain_name_setup.htm&type=5).

1. Run this command in a terminal to deploy the app.

```
sfdx force:source:deploy -p force-app
```
```
sf project deploy start --target-org mysurveyorg --source-dir force-app
```

1. If your org isn't already open, open it now:

```
sfdx force:org:open -u mysurveyorg
```
```
sf org open --target-org mysurveyorg
```

1. Assign the `Survey_Force_SuperAdmin` permission set to the admin user.

```
sfdx force:user:permset:assign -n Survey_Force_SuperAdmin
```
```
sf org assign permset --name Survey_Force_SuperAdmin
```

1. In App Launcher, select the **Survey Force** app.
1. In App Launcher, select the **Survey Force** app.
Loading

0 comments on commit 5dbf529

Please sign in to comment.