# plugin-switch

> Before you generate a new Salesforce plugin, set up these prerequisites.

Latest version **0.0.3** (published 2023-06-30) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install plugin-switch
pnpm add plugin-switch
yarn add plugin-switch
bun add plugin-switch
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-06-30 |
| First published | 2023-06-30 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 5 |
| Unpacked size | 63.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Salesforce |
| Maintainers | nphan.happymoney.com |
| Keywords | force, salesforce, sfdx, salesforcedx, sfdx-plugin, sf-plugin, sf |

## Links

- npm: https://www.npmjs.com/package/plugin-switch
- Repository: https://github.com/nphan-sts/plugin-switch
- Issues: https://github.com/forcedotcom/cli/issues
- npm.io page: https://npm.io/package/plugin-switch

## Dependencies (5)

- [tslib](https://npm.io/package/tslib.md) ^2
- [@oclif/core](https://npm.io/package/@oclif/core.md) ^2.8.2
- [@salesforce/kit](https://npm.io/package/@salesforce/kit.md) ^3.0.2
- [@salesforce/core](https://npm.io/package/@salesforce/core.md) ^4.0.1
- [@salesforce/sf-plugins-core](https://npm.io/package/@salesforce/sf-plugins-core.md) ^3.0.4

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-06-30

## README

## Set Up Your Dev Environment

Before you generate a new Salesforce plugin, set up these prerequisites.

Install or update Node.js.

To build a Salesforce CLI plugin, you need the latest long-term support (LTS) version of Node.js. If you’re new to Node.js development, we suggest that you use nvm (Node Version Manager) to install Node.js. See this installation script to install or update nvm.

To check your Node.js version, run:

```bash
node --version
If your node version is earlier than 8 (or if you don’t have Node.js installed), run this command to install LTS:
```

````bash
sudo npm install -g yarn
Install TypeScript (target es2017.)

```bash
npm install -g typescript
````

Salesforce CLI plugins can use JavaScript instead of TypeScript, but the classes in the Salesforce DX core library are written in TypeScript.

Install or update Salesforce CLI.

If you don’t have Salesforce CLI installed on your computer, see Install the Salesforce CLI in the Salesforce CLI Setup Guide to install both the sfdx and sf executables. After installing, update Salesforce CLI to ensure you’re on the latest version; this command updates both executables.

```bash
sfdx update
We recommend you use Visual Studio Code with Salesforce Extensions as your IDE, because it includes tools for developing on the Salesforce platform.
```

## Install(not ready)

```bash
sf plugins install @salesforce/plugin-switch@x.y.z
```

### Build(use git)

To build the plugin locally, make sure to have yarn installed and run the following commands:


```bash
# Clone the repository
git clone https://github.com/nphan-sts/plugin-switch.git

# Install the dependencies and compile
cd plugin-switch
yarn && yarn build
```

```bash
# Link your plugin to the sf cli
sf plugins link .
# To verify
sf plugins
```

```bash
# Create SFDX project with manifest
cd ../
sfdx force:project:create --projectname "plugin-switch-sfdx" --manifest
cd plugin-switch-sfdx
git init
```
Copy package.xml in LPC-830 to package.xml file



## Commands

SFDX project is required

<!-- commands -->

- [`sf switch retrieve'`]

## `sf switch retrieve'`

```
USAGE
  $ sf switch retrieve -x <value> [--json]

FLAGS
  -x, --package=<value>  (required) Retrieve Flows, Validation Rules, Apex triggers, Process builders defined in package.xml.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION

  Retrieve Flows, Validation Rules, Apex triggers, Process builders defined in package.xml.

EXAMPLES
  '$ sf switch:retrieve --package path/to/package.xml'
```

- [`sf switch switchOff'`]

## `sf switch switchOff'`

USAGE
$ sf switch switchOff -x <value> [--json]

FLAGS
-x, --package=<value> (required) Change Flows,Process builders activeVersionNumber to 0, Validation Rules active to false, Apex triggers status to Inactive. then deploy to the org.

GLOBAL FLAGS
--json Format output as json.

DESCRIPTION

Change Flows,Process builders activeVersionNumber to 0, Validation Rules active to false, Apex triggers status to Inactive. then deploy to the org.

EXAMPLES
$ sf switch switchOff --package path/to/package.xml

- [`sf switch switchOn'`]

## `sf switch switchOn'`

Change Flows, Validation Rules, Apex triggers, Process builders to original version.

USAGE
$ sf switch switchOn -x <value> [--json]

FLAGS
-x, --package=<value> (required) Change Flows, Validation Rules, Apex triggers, Process builders to original version. then deploy to the org.

GLOBAL FLAGS
--json Format output as json.

DESCRIPTION

Change Flows, Validation Rules, Apex triggers, Process builders to original version. then deploy to the org.

EXAMPLES
$ sf switch switchOn --package path/to/package.xml

<!-- commandsstop -->

---
_Source: https://npm.io/package/plugin-switch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
