Skip to content

Commit 7b1bb22

Browse files
authored
chore: update dependencies
fix(deps): bump eslint from 9.32.0 to 9.36.0 fix(deps): bump chai from 5.2.1 to 6.2.0 fix(deps): bump @typescript-eslint/eslint-plugin from 8.38.0 to 8.45.0
2 parents 728e8bb + 21a5757 commit 7b1bb22

File tree

7 files changed

+190
-320
lines changed

7 files changed

+190
-320
lines changed

.circleci/config.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
/tmp
99
node_modules
1010
.yarn/install-state
11-
.yarn/**
1211
coverage/**
13-
.yarn/install-state.gz
1412
oclif.manifest.json
1513
*.log
16-
*.tgz
14+
*.tgz
15+
16+
.vscode/

.vscode/launch.json

Lines changed: 0 additions & 71 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
The `lightning-flow-scanner`, was previously unpublished from the npm registry due to as remote code execution (RCE) vulnerability in its core dependency, `lightning-flow-scanner-core`. The vulnerability, caused by unsafe custom rule loading, has been addressed in the [v5 release of the core](https://github.com/Flow-Scanner/lightning-flow-scanner-core/releases/tag/v5.1.0). Prioritizing security, we've removed custom rules for a safer tool.
1+
Since 2021, the _Lightning Flow Scanner_ has grown from its roots in CLI and VS Code tools to empower Salesforce Developers across six free and open-source platforms—from CLI tools to native Salesforce apps—delivering a unified experience for robust static analysis of Flows. Our dedicated community has shared their expertise to deepen understanding of Flow optimization. Your support can amplify our impact. Here’s how you can contribute:
2+
3+
- ⭐ Starring the project to show your support
4+
- 📢 Sharing our work with your network
5+
- 💬 Sharing feedback to help us improve
6+
- 💻 Contributing code to drive innovation
27

38
Want to help improve Lightning Flow Scanner? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core/blob/main/CONTRIBUTING.md).

README.md

Lines changed: 56 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33
<img src="docs/images/banner.png" style="width: 41%;" />
44
</a>
55
</p>
6-
<p align="center">Scans for unsafe contexts, hardcoded IDs, and other issues to optimize your Flows.</p>
6+
<p align="center"><i>Scans for unsafe contexts, hardcoded IDs, and other issues to optimize your Flows.</i></p>
77

88
![FlowScan example](docs/images/sfdxgif.gif)
99

10-
- [Installation](#installation)
11-
- [Usage](#usage)
10+
- **[Installation](#installation)**
11+
- **[Usage](#usage)**
1212
- [Options](#options)
13-
- [Examples](#examples)
14-
- [Configuration](#configuration)
13+
- **[Configuration](#configuration)**
1514
- [Defining the severity per rule](#defining-the-severity-per-rule)
1615
- [Specifying an exception](#specifying-an-exception)
1716
- [Configuring an expression](#configuring-an-expression)
18-
- [Development](#development)
17+
- **[Development](#development)**
1918

2019
## Installation
2120

2221
Install with SFDX:
2322

2423
```sh-session
25-
sfdx plugins:install lightning-flow-scanner
24+
sf plugins install lightning-flow-scanner
2625
```
2726

2827
Install with NPM:
@@ -33,12 +32,12 @@ npm install -g lightning-flow-scanner
3332

3433
## Usage
3534

35+
Lightning Flow Scanner CLI is plug-and-play. Open any project with flows and run `sf flow:scan`; all default rules and thresholds are applied automatically.
36+
3637
```sh-session
37-
sfdx flow:scan [options]
38+
sf flow:scan [options]
3839
```
3940

40-
***To learn more about the default rules and options, see the [core documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/).***
41-
4241
### Options
4342

4443
```sh-session
@@ -57,27 +56,11 @@ sfdx flow:scan [options]
5756
--loglevel=(trace|debug|info|warn|error|fatal) [default: warn] logging level.
5857
```
5958

60-
### Examples
61-
62-
You can test the scanner by simply opening an existing project that contains flows and running the scan without any configurations or parameters. This way all the default rules are autmatically included in the scan.
63-
64-
```sh-sessions
65-
sfdx flow:scan
66-
```
67-
68-
```sh-sessions
69-
sfdx flow:scan --json
70-
```
71-
72-
```sh-sessions
73-
sfdx flow:scan --config path/to/.flow-scanner.json
74-
```
75-
7659
## Configuration
7760

7861
Create a .flow-scanner.json file in order to configure:
7962

80-
- The ruleset to be executed.
63+
- A defined ruleset to be executed.
8164
- The severity of violating any specific rule.
8265
- Custom expressions or rule implementations.
8366
- Any known exceptions that should be ignored during scanning.
@@ -112,78 +95,87 @@ When the severity is not provided it will be `error` by default. Other available
11295
}
11396
```
11497

115-
### Specifying an exception
98+
### Configuring an expression
11699

117-
Specifying exceptions can be done by flow, rule and result(s), as shown in the following example.
100+
Some rules have additional attributes to configure, such as the expression, that will overwrite default values. These can be configured in the same way as severity as shown in the following example. For more information on the available rules and configurations, please review the [flow scanner documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/).
118101

119102
```json
120103
{
121-
"exceptions": {
122-
"AssignTaskOwner": {
123-
"UnusedVariable": [
124-
"somecount"
125-
]
104+
"rules": {
105+
"APIVersion": {
106+
"severity": "error",
107+
"expression": "===58"
126108
},
127-
"GetAccounts":{
128-
"UnusedVariable": [
129-
"incvar"
130-
]
109+
"FlowName": {
110+
"severity": "error",
111+
"expression": "[A-Za-z0-9]"
131112
}
132113
}
133114
}
134115
```
135116

136-
### Configuring an expression
117+
### Specifying an exception
137118

138-
Some rules have additional attributes to configure, such as the expression, that will overwrite default values. These can be configured in the same way as severity as shown in the following example.
119+
Specifying exceptions can be done by flow, rule and result(s), as shown in the following example.
139120

140121
```json
141122
{
142-
"rules": {
143-
"APIVersion":
144-
{
145-
"severity": "error",
146-
"expression": "===58"
123+
"exceptions": {
124+
"AssignTaskOwner": {
125+
"UnusedVariable": ["somecount"]
147126
},
148-
"FlowName":
149-
{
150-
"severity": "error",
151-
"expression": "[A-Za-z0-9]"
127+
"GetAccounts": {
128+
"UnusedVariable": ["incvar"]
152129
}
153130
}
154131
}
155132
```
156133

157134
## Development
158135

159-
### Preparing for Changes
136+
> This project optionally uses [Volta](https://volta.sh) to manage Node.js versions. Install Volta with:
137+
>
138+
> ```sh
139+
> curl https://get.volta.sh | bash
140+
> ```
141+
>
142+
> Volta will automatically use the Node.js version defined in `package.json`.
160143
161-
1. **Clone Project**: Clone the Lightning Flow Scanner Salesforce CLI repository.
162-
2. **Install Dependencies**: Open the directory and run `npm install` in the terminal to install the dependencies.
163-
3. **Optional: Make changes**: For example, if you want to upgrade the core module using npm, you can use the command: `npm update lightning-flow-scanner-core`
164-
4. **Prepack**: Execute `npm run prepack` to build the plugin locally and prepare for packaging.
165-
5. **Link Plugin**: Link the plugin to your Salesforce DX environment using `sfdx plugins link .`.
144+
1. **Clone the repository**
166145
167-
### Debugging the Plugin
146+
```bash
147+
git clone https://github.com/Flow-Scanner/lightning-flow-scanner-vsx.git
148+
```
168149
169-
1. **Linking Core Module**: You may need to clone and link the `lightning-flow-scanner-core` locally to your project. This step is necessary if you're making changes to the core module and want those changes reflected in the plugin. You can link the core module by navigating to its directory and running:
150+
2. **Install Dependencies**
170151

171152
```bash
172-
npm link
153+
npm install
173154
```
174155

175-
Then, navigate to the sfdx plugin directory and run:
156+
3. **Build Executables**
176157

177158
```bash
178-
npm link lightning-flow-scanner-core
159+
npm run build
179160
```
180161

181-
1. **Run Plugin**: In the terminal of your example flow project (or any other project intended for scanning), run the following command to start the plugin with debugging enabled:
162+
4. **Run Tests**
182163

183164
```bash
184-
NODE_OPTIONS=--inspect-brk /path/to/lightning-flow-scanner-cli/bin/run flow:scan
165+
npm run build
185166
```
186167

187-
2. **Attach Debugger**: Open your local Salesforce DX project in Visual Studio Code, set desired breakpoints, and attach the debugger to the remote session. For more detailed information, you can refer to the [wiki](https://github.com/salesforcecli/cli/wiki) of the Salesforce CLI repository.
168+
5. **Linking** **Core Module (Optional)**
169+
170+
If you’re developing or testing updates to the core module, you can link it locally:
171+
172+
- In the core module directory, run:
173+
```bash
174+
npm run link
175+
```
176+
- In this CLI project directory, run:
177+
```bash
178+
npm link lightning-flow-scanner-core
179+
```
188180

189-
Want to help improve Lightning Flow Scanner? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core?tab=contributing-ov-file).
181+
<p><strong>Want to help improve Lightning Flow Scanner? See our <a href="https://github.com/Flow-Scanner/lightning-flow-scanner-core?tab=contributing-ov-file">Contributing Guidelines</a></strong></p>

0 commit comments

Comments
 (0)