Skip to content

Commit 2ddbd67

Browse files
authored
feat: add project configuration defaults
Add default configuration files for * prettier * forceignore * gitignore * github actions including pr-validation and build
1 parent 00b3581 commit 2ddbd67

File tree

57 files changed

+20908
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+20908
-171
lines changed

.forceignore

+113-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,116 @@ package.xml
99
**/.eslintrc.json
1010

1111
# LWC Jest
12-
**/__tests__/**
12+
**/__tests__/**
13+
14+
Admin.profile
15+
**/README.md
16+
**/README
17+
**/aura/createAndRefreshCase
18+
**/aura/forgotPassword
19+
**/aura/loginForm
20+
**/aura/selfRegister
21+
**/aura/setExpId
22+
**/aura/setStartUrl
23+
**/classes/ChangePasswordController.cls
24+
**/classes/ChangePasswordController.cls-meta.xml
25+
**/classes/ChangePasswordControllerTest.cls
26+
**/classes/ChangePasswordControllerTest.cls-meta.xml
27+
**/classes/CommunitiesLandingController.cls
28+
**/classes/CommunitiesLandingController.cls-meta.xml
29+
**/classes/CommunitiesLandingControllerTest.cls
30+
**/classes/CommunitiesLandingControllerTest.cls-meta.xml
31+
**/classes/CommunitiesLoginController.cls
32+
**/classes/CommunitiesLoginController.cls-meta.xml
33+
**/classes/CommunitiesLoginControllerTest.cls
34+
**/classes/CommunitiesLoginControllerTest.cls-meta.xml
35+
**/classes/CommunitiesSelfRegConfirmController.cls
36+
**/classes/CommunitiesSelfRegConfirmController.cls-meta.xml
37+
**/classes/CommunitiesSelfRegConfirmControllerTest.cls
38+
**/classes/CommunitiesSelfRegConfirmControllerTest.cls-meta.xml
39+
**/classes/CommunitiesSelfRegController.cls
40+
**/classes/CommunitiesSelfRegController.cls-meta.xml
41+
**/classes/CommunitiesSelfRegControllerTest.cls
42+
**/classes/CommunitiesSelfRegControllerTest.cls-meta.xml
43+
**/classes/ForgotPasswordController.cls
44+
**/classes/ForgotPasswordController.cls-meta.xml
45+
**/classes/ForgotPasswordControllerTest.cls
46+
**/classes/ForgotPasswordControllerTest.cls-meta.xml
47+
**/classes/LightningForgotPasswordController.cls
48+
**/classes/LightningForgotPasswordController.cls-meta.xml
49+
**/classes/LightningForgotPasswordControllerTest.cls
50+
**/classes/LightningForgotPasswordControllerTest.cls-meta.xml
51+
**/classes/LightningLoginFormController.cls
52+
**/classes/LightningLoginFormController.cls-meta.xml
53+
**/classes/LightningLoginFormControllerTest.cls
54+
**/classes/LightningLoginFormControllerTest.cls-meta.xml
55+
**/classes/LightningSelfRegisterController.cls
56+
**/classes/LightningSelfRegisterController.cls-meta.xml
57+
**/classes/LightningSelfRegisterControllerTest.cls
58+
**/classes/LightningSelfRegisterControllerTest.cls-meta.xml
59+
**/classes/MyProfilePageController.cls
60+
**/classes/MyProfilePageController.cls-meta.xml
61+
**/classes/MyProfilePageControllerTest.cls
62+
**/classes/MyProfilePageControllerTest.cls-meta.xml
63+
**/classes/SiteLoginController.cls
64+
**/classes/SiteLoginController.cls-meta.xml
65+
**/classes/SiteLoginControllerTest.cls
66+
**/classes/SiteLoginControllerTest.cls-meta.xml
67+
**/classes/SiteRegisterController.cls
68+
**/classes/SiteRegisterController.cls-meta.xml
69+
**/classes/SiteRegisterControllerTest.cls
70+
**/classes/SiteRegisterControllerTest.cls-meta.xml
71+
**/components/SiteFooter.component
72+
**/components/SiteFooter.component-meta.xml
73+
**/components/SiteHeader.component
74+
**/components/SiteHeader.component-meta.xml
75+
**/components/SiteLogin.component
76+
**/components/SiteLogin.component-meta.xml
77+
**/components/SitePoweredBy.component
78+
**/components/SitePoweredBy.component-meta.xml
79+
**/pages/AnswersHome.page
80+
**/pages/AnswersHome.page-meta.xml
81+
**/pages/BandwidthExceeded.page
82+
**/pages/BandwidthExceeded.page-meta.xml
83+
**/pages/ChangePassword.page
84+
**/pages/ChangePassword.page-meta.xml
85+
**/pages/CommunitiesLanding.page
86+
**/pages/CommunitiesLanding.page-meta.xml
87+
**/pages/CommunitiesLogin.page
88+
**/pages/CommunitiesLogin.page-meta.xml
89+
**/pages/CommunitiesSelfReg.page
90+
**/pages/CommunitiesSelfReg.page-meta.xml
91+
**/pages/CommunitiesSelfRegConfirm.page
92+
**/pages/CommunitiesSelfRegConfirm.page-meta.xml
93+
**/pages/CommunitiesTemplate.page
94+
**/pages/CommunitiesTemplate.page-meta.xml
95+
**/pages/Exception.page
96+
**/pages/Exception.page-meta.xml
97+
**/pages/FileNotFound.page
98+
**/pages/FileNotFound.page-meta.xml
99+
**/pages/ForgotPassword.page
100+
**/pages/ForgotPassword.page-meta.xml
101+
**/pages/ForgotPasswordConfirm.page
102+
**/pages/ForgotPasswordConfirm.page-meta.xml
103+
**/pages/IdeasHome.page
104+
**/pages/IdeasHome.page-meta.xml
105+
**/pages/InMaintenance.page
106+
**/pages/InMaintenance.page-meta.xml
107+
**/pages/MyProfilePage.page
108+
**/pages/MyProfilePage.page-meta.xml
109+
**/pages/SiteLogin.page
110+
**/pages/SiteLogin.page-meta.xml
111+
**/pages/SiteRegister.page
112+
**/pages/SiteRegister.page-meta.xml
113+
**/pages/SiteRegisterConfirm.page
114+
**/pages/SiteRegisterConfirm.page-meta.xml
115+
**/pages/SiteTemplate.page
116+
**/pages/SiteTemplate.page-meta.xml
117+
**/pages/StdExceptionTemplate.page
118+
**/pages/StdExceptionTemplate.page-meta.xml
119+
**/pages/Unauthorized.page
120+
**/pages/Unauthorized.page-meta.xml
121+
**/pages/UnderConstruction.page
122+
**/pages/UnderConstruction.page-meta.xml
123+
**/staticresources/SiteSamples
124+
**/staticresources/SiteSamples.resource-meta.xml

.github/workflows/build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Unique name for this workflow
2+
name: Package Build
3+
4+
# Definition when the workflow should run
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
# Jobs to be executed
11+
jobs:
12+
build:
13+
name: Build package
14+
runs-on: ubuntu-latest
15+
container: dxatscale/sfpowerscripts
16+
steps:
17+
# Checkout the code
18+
- name: "Checkout source code"
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
# Copy Auth URL to file
24+
- name: "Copy Auth URL to file"
25+
shell: bash
26+
run: |
27+
echo "${{ secrets.DEVHUB_AUTH_URL }}" > ./AUTH_URL
28+
# Authenticate dev hub
29+
- name: "Authenicate Org"
30+
run: "sfdx auth:sfdxurl:store -f ./AUTH_URL -a devhub"
31+
32+
# Create Package
33+
- name: "Create package"
34+
run: "sfdx force:package:version:create -c -d pkg/ -f config/project-scratch-def.json -x -v devhub -w 300"
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unique name for this workflow
2+
name: Validate Source Code
3+
4+
# Definition when the workflow should run
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, synchronize]
9+
10+
# Jobs to be executed
11+
jobs:
12+
validate-source-code-format:
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Checkout the code in the PR
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
22+
# Install Node JS
23+
- name: Install NodeJS
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: "14"
27+
cache: "npm"
28+
29+
- name: Install dependencies
30+
run: npm ci --no-audit --prefer-offline
31+
32+
# Verify Source Format with Prettier
33+
- name: Check format with Prettier
34+
run: |
35+
git diff -z --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha}}...${{ github.event.pull_request.head.sha }} | xargs -0 -I {} npx prettier --ignore-unknown --validate "{}"

.github/workflows/pmd-validation.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PMD Validation
2+
on:
3+
workflow_dispatch: null
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
jobs:
9+
static-code-analysis:
10+
name: Review
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 2
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
- name: PMD
19+
uses: rody/pmd-github-action@main
20+
with:
21+
rulesets: ./pmd-ruleset.xml
22+
reportfile: pmd-report.json
23+
format: json
24+
failOnViolation: "false"
25+
showsuppressed: "true"
26+
- name: Create Review from PMD report
27+
uses: rody/pmd-review-github-action@main
28+
with:
29+
reportfile: pmd-report.json
30+
pr-number: ${{ github.event.number }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unit-test.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Unique name for this workflow
2+
name: Run Unit Tests
3+
4+
# Definition when the workflow should run
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
branches:
10+
- main
11+
12+
# Jobs to be executed
13+
jobs:
14+
unit-tests:
15+
runs-on: ubuntu-latest
16+
container: dxatscale/sfpowerscripts
17+
steps:
18+
# Checkout the code in the pull request
19+
- name: "Checkout source code"
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
24+
# Copy Auth URL to file
25+
- name: "Copy Auth URL to file"
26+
shell: bash
27+
run: |
28+
echo "${{ secrets.DEVHUB_AUTH_URL }}" > ./AUTH_URL
29+
30+
# Authorised Org
31+
- name: "Authenicate Org"
32+
run: "sfdx auth:sfdxurl:store -f ./AUTH_URL -a devhub"
33+
34+
# Create Scratch Org
35+
- name: "Create New Scratch Org"
36+
run: sfdx force:org:create -f config/project-scratch-def.json -a scratch-org -s -d 1 -v devhub
37+
38+
# Push Source Code
39+
- name: "Push Source to Scratch Org"
40+
run: "sfdx force:source:push -u scratch-org"
41+
42+
# Run Unit Tests
43+
- name: "Run Unit Tests"
44+
run: "sfdx force:apex:test:run -c -r human -l RunLocalTests -u scratch-org -w 300"
45+
46+
# Validate Test Coverage
47+
- name: "Validate Test Coverage"
48+
run: "sfdx sfpowerscripts:apextests:validate -t 75 -u scratch-org"
49+
50+
# Delete Scratch Org
51+
- name: "Delete Scratch Org"
52+
run: "sfdx force:org:delete -p -u scratch-org"

.gitignore

+54-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,57 @@ ehthumbs.db
3535
$RECYCLE.BIN/
3636

3737
# Local environment variables
38-
.env
38+
.env
39+
lerna-debug.log*
40+
.pnpm-debug.log*
41+
pids
42+
*.pid
43+
*.seed
44+
*.pid.lock
45+
*.lcov
46+
.npm
47+
.node_repl_history
48+
.yarn-integrity
49+
.env.*
50+
.tern-port
51+
.yarn/cache
52+
.yarn/unplugged
53+
.yarn/build-state.yml
54+
.yarn/install-state.gz
55+
.pnp.*
56+
.AppleDouble
57+
.LSOverride
58+
._*
59+
.DocumentRevisions-V100
60+
.fseventsd
61+
.Spotlight-V100
62+
.TemporaryItems
63+
.Trashes
64+
.VolumeIcon.icns
65+
.com.apple.timemachine.donotpresent
66+
.AppleDB
67+
.AppleDesktop
68+
Network Trash Folder
69+
Temporary Items
70+
.apdisk
71+
Thumbs.db:encryptable
72+
ehthumbs_vista.db
73+
*.stackdump
74+
*.cab
75+
*.msi
76+
*.msix
77+
*.msm
78+
*.msp
79+
*.lnk
80+
.vscode/*
81+
!.vscode/settings.json
82+
!.vscode/tasks.json
83+
!.vscode/launch.json
84+
!.vscode/extensions.json
85+
!.vscode/*.code-snippets
86+
*.code-workspace
87+
.history/
88+
.history
89+
.ionide
90+
*.tmp
91+
*.bak

.prettierignore

+32-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,35 @@
77
.sfdx
88
.vscode
99

10-
coverage/
10+
coverage/
11+
bower_components/
12+
node_modules/
13+
jspm_packages/
14+
dist/
15+
build/
16+
lib-cov
17+
.nyc_output
18+
.gitattributes
19+
.gitignore
20+
.env
21+
.env.build
22+
.env.test
23+
.npm
24+
.npmrc
25+
yarn
26+
.yarn-integrity
27+
.yarnclean
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
yarn.lock
32+
package-lock.json
33+
logs
34+
*.log
35+
*.min.js
36+
*.min.css
37+
.editorconfig
38+
.eslintignore
39+
.markdownlintignore
40+
.prettierignore
41+
.sfdx/

0 commit comments

Comments
 (0)