Skip to content

Commit

Permalink
chore(release): 1.4.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
k-capehart committed May 30, 2024
1 parent 351d7b1 commit 7963de1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 62 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [1.4.0](https://github.com/k-capehart/kc-sf-plugin/compare/1.3.2...1.4.0) (2024-05-30)


### Features

* combine trigger-framework commands, add custom templates ([#23](https://github.com/k-capehart/kc-sf-plugin/issues/23)) ([351d7b1](https://github.com/k-capehart/kc-sf-plugin/commit/351d7b10b10ff5c28200fc99c30453b14df967c1))



## [1.3.2](https://github.com/k-capehart/kc-sf-plugin/compare/1.3.0...1.3.2) (2024-05-28)


Expand Down
86 changes: 25 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ For more template examples: https://github.com/k-capehart/kc-sf-plugin/tree/main
## Commands

<!-- commands -->

- [`sf kc diff`](#sf-kc-diff)
- [`sf kc trigger-framework init`](#sf-kc-trigger-framework-init)
- [`sf kc trigger-framework trigger`](#sf-kc-trigger-framework-trigger)
* [`sf kc diff`](#sf-kc-diff)
* [`sf kc trigger-framework`](#sf-kc-trigger-framework)

## `sf kc diff`

Expand Down Expand Up @@ -118,82 +116,48 @@ FLAG DESCRIPTIONS
Ignore files by placing them in your .forceignore and using this flag.
```

_See code: [src/commands/kc/diff.ts](https://github.com/k-capehart/kc-sf-plugin/blob/1.3.1/src/commands/kc/diff.ts)_

## `sf kc trigger-framework init`

Auto generate an Apex Trigger framework. By default, the template uses this Trigger Handler Apex class: https://github.com/k-capehart/sfdc-trigger-framework

```
USAGE
$ sf kc trigger-framework init [--json] [--flags-dir <value>] [-d <value>]
FLAGS
-d, --target-dir=<value> [default: force-app/main/default] The target directory for your salesforce project. There
should be subdirectories for classes/ and objects/.
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Auto generate an Apex Trigger framework. By default, the template uses this Trigger Handler Apex class:
https://github.com/k-capehart/sfdc-trigger-framework
Using this command will initialize an Apex Trigger framework by creating an extendable Trigger Handler class based off
a template.
Also creates a CustomSetting called BypassAutomation that can be used to optionally skip triggers for specific users.
SObject specific trigger handlers should extend this class and override the methods for beforeInsert(), afterInsert(),
etc.
If a file already exists with the given name then it is not overwritten.
EXAMPLES
Initialize the trigger framework in the directory: force-app/main/default
$ sf kc trigger-framework init --target-dir force-app/main/default
```

_See code: [src/commands/kc/trigger-framework/init.ts](https://github.com/k-capehart/kc-sf-plugin/blob/1.3.1/src/commands/kc/trigger-framework/init.ts)_
_See code: [src/commands/kc/diff.ts](https://github.com/k-capehart/kc-sf-plugin/blob/1.4.0/src/commands/kc/diff.ts)_

## `sf kc trigger-framework trigger`
## `sf kc trigger-framework`

Create a new trigger, handler class, and helper class for a Salesforce object. Recommend using `kc trigger-framework init` first.
Generate apex trigger frameworks based on templates.

```
USAGE
$ sf kc trigger-framework trigger -s <value> [--json] [--flags-dir <value>] [-d <value>]
$ sf kc trigger-framework [--json] [--flags-dir <value>] [-d <value>] [-i] [-s <value>] [-t 1] [--custom-template
<value>]
FLAGS
-d, --target-dir=<value> [default: force-app/main/default] The target directory for your apex classes and triggers.
There should be subdirectories for classes/, triggers/, and objects/.
-s, --sobject=<value>... (required) The name of the SObject that the trigger and classes will be created for.
-d, --target-dir=<value> [default: force-app/main/default] The target directory for your salesforce project.
-i, --init Initialize the trigger framework for the given template.
-s, --sobject=<value>... The name of the SObject that the trigger and classes will be created for.
-t, --template=<option> The template that should be used to generate the trigger framework.
<options: 1>
--custom-template=<value> The directory in which the custom templates are located. View docs for more information
on creating templates: https://github.com/k-capehart/kc-sf-plugin
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Create a new trigger, handler class, and helper class for a Salesforce object. Recommend using `kc trigger-framework
init` first.
Generate apex trigger frameworks based on templates.
Given an SObject, creates a Trigger, a Handler class, a Helper class, a Test class, and a custom field for the
BypassAutomation custom setting.
Given an SObject, creates a Trigger and accompaning handler classes and components.
The Handler class extends `TriggerHandler`.
The custom field is used in the Handler class to check whether implementation should be skipped.
Use the `--init` flag to initialize the framework, then the `--sobject` flag to create triggers based on the
framework.
EXAMPLES
Create a new trigger, handler, and helper for the Account object.
$ sf kc trigger-framework trigger --sobject Account
Initialize a trigger framework using template-1.
$ sf kc trigger-framework --template 1 --init
Create a new trigger and related components for the Account and Contact object using template-1.
$ sf kc trigger-framework --template 1 --sobject Account --sobject Contact
Create a new trigger and related components with a custom template by providing the path to the locally stored templates.
$ sf kc trigger-framework --custom-template templates/ --sobject Account
```

_See code: [src/commands/kc/trigger-framework/trigger.ts](https://github.com/k-capehart/kc-sf-plugin/blob/1.3.1/src/commands/kc/trigger-framework/trigger.ts)_

_See code: [src/commands/kc/trigger-framework.ts](https://github.com/k-capehart/kc-sf-plugin/blob/1.4.0/src/commands/kc/trigger-framework.ts)_
<!-- commandsstop -->

## Build
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kc-sf-plugin",
"description": "Various commands for enabling salesforce development with the sf cli",
"version": "1.3.2",
"version": "1.4.0",
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
Expand Down

0 comments on commit 7963de1

Please sign in to comment.