Skip to content

Commit

Permalink
Squashed 'framework/fflib/' content from commit baaf94d
Browse files Browse the repository at this point in the history
git-subtree-dir: framework/fflib
git-subtree-split: baaf94d
  • Loading branch information
rob-baillie-ortoo committed May 4, 2022
0 parents commit 0598dee
Show file tree
Hide file tree
Showing 639 changed files with 88,896 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

# Exists only to define tab spacing in github pull request rendering
[*]
indent_style = tab
indent_size = 4
16 changes: 16 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
**/lwc/**/*.css
**/lwc/**/*.html
**/lwc/**/*.json
**/lwc/**/*.svg
**/lwc/**/*.xml
**/aura/**/*.auradoc
**/aura/**/*.cmp
**/aura/**/*.css
**/aura/**/*.design
**/aura/**/*.evt
**/aura/**/*.json
**/aura/**/*.svg
**/aura/**/*.tokens
**/aura/**/*.xml
**/aura/**/*.app
.sfdx
12 changes: 12 additions & 0 deletions .forceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
#

package.xml

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

# LWC Jest
**/__tests__/**
87 changes: 87 additions & 0 deletions .github/workflows/create-org-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Deploy and Run all Unit Tests
on:
push:
branches:
- '**/*'
- main
pull_request:
types: [ opened ]
branches:
- '**/*'
- main
jobs:
create-org-and-deploy:
runs-on: ubuntu-latest
env:
DEVHUB_ORG_ALIAS: OrtooISV
ORG_ALIAS_PREFIX: 'FTST'
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Salesforce SFDX CLI Action
uses: sfdx-actions/setup-sfdx@v1

# Update ./config/project-scratch-def.json

- name: Update project-scratch-def.json orgName
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12
with:
file: ./config/project-scratch-def.json
field: orgName
value: "${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}"

- name: Update project-scratch-def.json description
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12
with:
file: ./config/project-scratch-def.json
field: description
value: "${{ github.repository }} , Org Alias ${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}. Created by ${{ github.actor }}"

- name: Show project-scratch-def.json
run: 'cat ./config/project-scratch-def.json'

# sfdx-project.json file should be ok as is

- name: Show sfdx-project.json
run: 'cat ./sfdx-project.json'

# Dev Hub needed to create scratch org

- name: Create DevHub Auth File
run: echo "${{ secrets.AUTH_SECRET_ISV }}" > devhub_auth_file.txt

- name: Authorise Dev Hub Org
run: sfdx auth:sfdxurl:store -f devhub_auth_file.txt -d -a ${{ env.DEVHUB_ORG_ALIAS }}

# Create Scratch Org

- name: Run script CreateScratchOrgWithNamespaceOnlyHeadless.sh
run: ./scripts/std_batch/CreateScratchOrgWithNamespaceOnlyHeadless.sh "${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}"
shell: sh

# Push code to org

- name: Deploy framework to Org
run: sfdx force:source:deploy -p framework --targetusername "${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}"

# Run Apex Unit Tests

- name: Run Apex Unit Tests
run: sfdx force:apex:test:run -r human -u "${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}" --wait 20 | grep -v ' Pass '; test ${PIPESTATUS[0]} -eq 0

# Prepare Jest Modules

- name: Prepare Jest Modules
run: npm install

# Run Jest Unit Tests

- name: Run Jest Unit Tests
run: npm test

# Delete Scratch Org

- name: Delete Scratch Org
if: ${{ always() }}
run: sfdx force:org:delete --noprompt --targetusername "${{env.ORG_ALIAS_PREFIX}}${{github.run_number}}"
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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
.sf/
.sfdx/
.localdevserver/
deploy-options.json

# LWC VSCode autocomplete
**/lwc/jsconfig.json

# LWC Jest coverage reports
coverage/

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

# Dependency directories
node_modules/

# NPM package lock
package-lock.json

# Eslint cache
.eslintcache

# MacOS system files
.DS_Store

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

# Local environment variables
.env
.pmdCache
test-results
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# List files or directories below to ignore them when running prettier
# More information: https://prettier.io/docs/en/ignore.html
#

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

coverage/
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"trailingComma": "none",
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
}
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"salesforce.salesforcedx-vscode",
"redhat.vscode-xml",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"financialforce.lana"
]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Apex Replay Debugger",
"type": "apex-replay",
"request": "launch",
"logFile": "${command:AskForLogFileName}",
"stopOnEntry": true,
"trace": true
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/.sfdx": true
}
}
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Salesforce DX Project: Next Steps

Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started.

## How Do You Plan to Deploy Your Changes?

Do you want to deploy a set of changes, or create a self-contained application? Choose a [development model](https://developer.salesforce.com/tools/vscode/en/user-guide/development-models).

## Configure Your Salesforce DX Project

The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file.

## Read All About It

- [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/)
- [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm)
- [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm)
- [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm)
105 changes: 105 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Framework Catch-up
* Start-up performance might need looking at - looks like it has a linear startup time based on the number of services / domains / etc configured.

Licenses that are needed with the source code and binary:
* fflib - https://github.com/apex-enterprise-patterns/fflib-apex-common/blob/master/LICENSE
* fflib apex extensions - https://github.com/wimvelzeboer/fflib-apex-extensions/blob/main/LICENSE
* Amoss - https://github.com/bobalicious/amoss/blob/main/LICENSE
* SObject Fabricator - https://github.com/bobalicious/SObjectFabricator/blob/master/LICENSE

* Move all the Jest LWc tests over to create the component in the before


Documentation - using lazy loader for service instantiation



Look at the use of 'MockDatabase' in fflib
Look at:
SobjectUtils.getSobjectName


* LWCs
* Standards for:
* Filter and Results Page
* Apex format
* Inner Class for the search parameters
* Offset
* Order By - single column
* Order By Direction

* Edit Forms / Validation
* Edit Forms with Child Records

Add to documentation
* Query builder - add it to the architectural diagram - after more investigation

DmlServices documentation:
* Show how to tie the validator into an action
* Note that the actions should
* Actions can reference Validators
* Cannot reference SOQL - they are excuted in a loop
* Do not do domain logic in them

* Using the Mock Registarar

From Utilities, things that may be useful:
* getReferenceObjectAPIName
* getObjName - get the object name from an Id
* getLabel / getObjectLabel - get the label for an sobject
* getFieldLabel
* delimitedStringToSet and reverse
* escaping single quotes - in both directions?
* unitsBetweenDateTime
* emailAddressIsValid / emailAddressListIsValid
* sObjectIsCustom / sObjectIsCustomfromAPIName
* IsfieldFilterable
* isFieldCustom
* idIsValid
* getCrossObjectAPIName
* objectFieldExist
* sortSelectOptions - complete re-write

Write tests for the SOQL generation in the criteria library

Amoss_Asserts.assertContains improvement into the OS lib
New Amoss_Asserts into the OS Lib

Bring in Stack from Q-assign?
Review Utilities in q-assign - is anything else useful?



* Document a few of the oddities on the Assignment Group and Action that need to be resolved.


Bad Smells - strung out calls to describe methods - put them into SobjectUtils


* Build some example unit tests...
* Criteria extension
* Build a simple SearchFilter SOQL generator / Selector

* Question: How do we generically tie in the QueryHandler? Should we? How often is this currently used?
* Question: Standard - never instantiate a Domain within a loop

* Question: How do we handle Constants - where are they defined?
* Question: How do we handle Exceptions:
* Do we handle individual types of exception in the Service?
* Do we pass any of the domain exceptions back

* Question: Multiple Apps... maybe

* Question: Can we generate a class diagram from a body of code
* Question: All or nothing on fflib

* Question: Do you need Heap size management rules -

* Produce test-case for lack of clickthrough and raise bug on VSCode

* How do we handle constants?

* Dynamic building of the Unit Of Work for processing data

Notes:
* Services should always be designed by seniors - at least which services exist
13 changes: 13 additions & 0 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"orgName": "robertbaillie company",
"edition": "Developer",
"features": ["EnableSetPasswordInApi"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
}
}
}
8 changes: 8 additions & 0 deletions force-app/main/default/aura/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": ["@salesforce/eslint-plugin-aura"],
"extends": ["plugin:@salesforce/eslint-plugin-aura/recommended"],
"rules": {
"vars-on-top": "off",
"no-unused-expressions": "off"
}
}
11 changes: 11 additions & 0 deletions force-app/main/default/lwc/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": ["@salesforce/eslint-config-lwc/recommended"],
"overrides": [
{
"files": ["*.test.js"],
"rules": {
"@lwc/lwc/no-unexpected-wire-adapter-usages": "off"
}
}
]
}
Loading

0 comments on commit 0598dee

Please sign in to comment.