# parcel-plugin-cep

> Zero configuration CEP extension builder for [Parcel](https://github.com/parcel-bundler/parcel).

Latest version **1.3.3** (published 2021-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install parcel-plugin-cep
pnpm add parcel-plugin-cep
yarn add parcel-plugin-cep
bun add parcel-plugin-cep
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.3 |
| Published | 2021-02-23 |
| First published | 2018-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | fusepilot |
| Keywords | parcel, manifest |

## Links

- npm: https://www.npmjs.com/package/parcel-plugin-cep
- npm.io page: https://npm.io/package/parcel-plugin-cep

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [chokidar](https://npm.io/package/chokidar.md) ^3.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0

## 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

- 1.3.3 (latest) — 2021-02-23
- 1.3.2 — 2019-10-24
- 1.3.1 — 2019-08-13
- 1.3.0 — 2019-04-12
- 1.2.0 — 2018-11-05
- 1.1.0 — 2018-09-11
- 1.0.0 — 2018-06-18
- 0.0.6 — 2018-06-12
- 0.0.5 — 2018-05-25
- 0.0.4 — 2018-05-25
- 0.1.0 — 2018-04-19
- 0.0.3 — 2018-04-06
- 0.0.2 — 2018-03-16
- 0.0.1 — 2018-03-15

## README

# Parcel CEP Plugin

Zero configuration CEP extension builder for [Parcel](https://github.com/parcel-bundler/parcel).

## Quick Start

```sh
git clone https://github.com/fusepilot/parcel-plugin-cep-starter.git
cd parcel-plugin-cep-starter
npm
npm run start
```

Open your CC app of choice, find your extension under `Window` > `Extensions`, and start developing.

### Building

To create a production build:

```sh
npm run build
```

### Packaging

To create a .zxp for deployment:

```sh
npm run zxp
```

A versioned .zxp file will be placed inside `archive`.

## CEP Configuration

You can configure CEP a either through environment variables or the `package.json` of your project.

### package.json

```json
"cep": {
    "name": "My Extension",
    "id": "com.mycompany.myextension",
    "hosts": "*"
}
```

### Environment Variables

Either `set` thorugh your terminal or add to the `.env` file.

```bash
NAME="My Extension"
BUNDLE_ID="com.mycompany.myextension"
HOSTS="*"
```

### Options

#### Id

This is the unique id of the extension.

#### Version

This sets the version of the bundle.

#### Name

This sets the name of extension as it will show in the application.

#### Hosts

By default, the extension will target all known Adobe hosts. To target specific hosts, uncomment the `HOSTS` variable to `.env` and modify the list of the hosts you want to target.

For example, to target just Illustrator and After Effects, you would add this to your `.env` file:

```bash
HOSTS="ILST, AEFT"
```

And to target specific versions:

```bash
HOSTS="ILST, IDSN@*, PHXS@6.0, AEFT@[5.0,10.0]"
```

This will target all versions of Illustrator and In Design, Photoshop 6.0, and After Effects 5.0 - 10.0.

#### Icon

To add a custom panel icon, add all [icon files](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_8.x/Documentation/CEP%208.0%20HTML%20Extension%20Cookbook.md#high-dpi-panel-icons) inside the `public` folder and set their paths inside your `.env` file:

```bash
ICON_NORMAL="./assets/icon-normal.png"
ICON_ROLLOVER="./assets/icon-rollover.png"
ICON_DARK_NORMAL="./assets/icon-dark.png"
ICON_DARK_ROLLOVER="./assets/icon-dark-rollover.png"
```

#### Cerificate Signing

In order to create a valid ZXP, you will need to provide the following variables replaced with the correct information inside your `.env`.

```bash
CERTIFICATE_COUNTRY="US"
CERTIFICATE_PROVINCE="CA"
CERTIFICATE_ORG="MyCompany"
CERTIFICATE_NAME="com.mycompany"
CERTIFICATE_PASSWORD="mypassword"
```

#### Panel Size

```bash
PANEL_WIDTH=500
PANEL_HEIGHT=500
```

## Communicating with Extendscript

There are few functions that you can import from the `cep-interface` package to ease Extendscript communication from CEP.

#### `loadExtendscript(extendScriptFileName: string): Promise`

Loads and evaluates the specified file in the src/extendscript directory. Returns a promise with the result.

```javascript
import { loadExtendscript } from 'cep-interface'

loadExtendscript('index.jsx')
```

#### `evalExtendscript(code: string): Promise`

Evaluates the specified code. Returns a Promise.

```javascript
import { evalExtendscript } from 'cep-interface'

evalExtendscript('alert("Hello!");') // alerts "Hello!" inside the app
```

If you return a JSON string using [json2](https://github.com/douglascrockford/JSON-js) or similar from Extendscript, you can get the parsed result.

```javascript
import { evalExtendscript } from 'cep-interface'

evalExtendscript('JSON.stringifiy({foo: "bar"});')
  .then(result => console.log(result)) // prints {foo: "bar"}
  .catch(error => console.warn(error))
```

## Other functions

There are a few other functions available in addition.

#### `openURLInDefaultBrowser(url: string)`

```javascript
import { openURLInDefaultBrowser } from 'cep-interface'

openURLInDefaultBrowser('www.google.com')
```

Opens the url in the default browser. Will also work when viewing outside the target application in a browser.

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