npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@samuel-charpentier/cep-bundler-core

v0.0.2

Published

Core functionality for making bundler extensions to compile CEP

Downloads

1

Readme

cep-bundler-core

Core functionality for making bundler extensions to compile CEP. All the functionality is exposed through one simple function:

const core = require('@samuel-charpentier/cep-bundler-core')

core.compile({
  out: '/path/to/dist', // REQUIRED type: string
  isDev: false, // OPTIONAL type: boolean, default: false
  env: 'production', // OPTIONAL type: string, default: process.env.NODE_ENV
  root: '/path/to/project/root', // OPTIONAL type: string, default: process.cwd()
  htmlFilename: './index.html', // OPTIONAL type: string, default: 'index.html'
  pkg: require('./package.json'), // OPTIONAL type: object, default: require(opts.root + '/package.json')
})

Know that running this function on Windows, it will try to create a symbolic link in the CEP directory pointing to your 'root/out' folder. Creating a symbolic link on Windows requires administrator priviledge. You will be prompted to allow administrator priviledges. This will only happen if there is no symbolic link in the CEP directory named after your CEP ID and pointing to your 'root/out' folder.

out

The out option specifies where the manifest.xml, dev.html, node_modules folder and (optionally) .debug file are saved to, this is usually the folder where your compiled javascript ends up.

isDev

When isDev is true, the bundler will create a dev.html file that contains a redirect to http://${devHost}:${devPort}, when isDev is false, it will not create a dev.html file but will set the MainPath in the manifest.xml to the value set through the htmlFilename option.

env

The env option is used when you want different configurations for other environments, you might for example have development, staging, ci and production environments that you want to configure differently. This option is only used when configure the bundler through your package.json, here is an example of using different extension names for different environments.

"cep": {
    "development": {
        "name": "My Extension DEVELOPMENT",
        "id": "com.mycompany.myextension.development",
    },
    "beta": {
        "name": "My Extension BETA",
        "id": "com.mycompany.myextension.beta",
    },
    "production": {
        "name": "My Extension",
        "id": "com.mycompany.myextension",
    }
}

root

The root option determines where the bundler should look for the package.json and node_modules folder, when you leave this off the current working directory will be used.

htmlFilename

The htmlFilename is the name of your html file, this option is only used when isDev is false. This path is relative from the out folder.

pkg

Optionally pass in the package.json object yourself, it will load the json from the package.json in the root folder by default.

CEP Configuration

You can configure CEP a either through environment variables or by a config object under the cep key in the package.json of your project.

package.json

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

Environment Variables

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

CEP_NAME="My Extension"
CEP_ID="com.mycompany.myextension"
CEP_HOSTS="*"

Options

Id

This is the unique id of the extension.

"id": "com.mycompany.myextension"

Environment variable: CEP_ID

Version

This sets the version of the bundle.

"version": "1.2.0"

Environment variable: CEP_VERSION

Name

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

"name: "My Extension"

Environment variable: CEP_NAME

Hosts

By default, the extension will target all known Adobe hosts. To target specific hosts, modify the list of the hosts you want to target. For example, to target just Illustrator and After Effects:

"hosts": "ILST, AEFT"

And to target specific versions:

"hosts": "ILST, IDSN@*, [email protected], 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.

Environment variable: CEP_HOSTS

Icon

To add a custom panel icon, add all icon files and set their paths in your config:

"iconNormal": "./assets/icon-normal.png",
"iconRollover": "./assets/icon-rollover.png",
"iconDarkNormal": "./assets/icon-dark.png",
"iconDarkRollover": "./assets/icon-dark-rollover.png"

Environment variables:

CEP_ICON_NORMAL="./assets/icon-normal.png",
CEP_ICON_ROLLOVER="./assets/icon-rollover.png",
CEP_ICON_DARK_NORMAL="./assets/icon-dark.png",
CEP_ICON_DARK_ROLLOVER="./assets/icon-dark-rollover.png"

Panel Size

"panelWidth": 500,
"panelHeight": 500,

Environment variables:

CEP_PANEL_WIDTH=500
CEP_PANEL_HEIGHT=500

Panel Minimum Size

"panelMinWidth": 500,
"panelMinHeight": 500,

Environment variables:

CEP_PANEL_MIN_WIDTH=500
CEP_PANEL_MIN_HEIGHT=500

Panel Maximum Size

"panelMaxWidth": 500,
"panelMaxHeight": 500,

Environment variables:

CEP_PANEL_MAX_WIDTH=500
CEP_PANEL_MAX_HEIGHT=500

Debug ports

"debugPorts": {
    "PHXS": 3001,
    "IDSN": 3002,
    "AICY": 3003,
    "ILST": 3004,
    "PPRO": 3005,
    "PRLD": 3006,
    "AEFT": 3007,
    "FLPR": 3008,
    "AUDT": 3009,
    "DRWV": 3010,
    "MUST": 3011,
    "KBRG": 3012,
},

Environment variables:

CEP_DEBUG_PORT_PHXS="3001"
CEP_DEBUG_PORT_IDSN="3002"
CEP_DEBUG_PORT_AICY="3003"
CEP_DEBUG_PORT_ILST="3004"
CEP_DEBUG_PORT_PPRO="3005"
CEP_DEBUG_PORT_PRLD="3006"
CEP_DEBUG_PORT_AEFT="3007"
CEP_DEBUG_PORT_FLPR="3008"
CEP_DEBUG_PORT_AUDT="3009"
CEP_DEBUG_PORT_DRWV="3010"
CEP_DEBUG_PORT_MUST="3011"
CEP_DEBUG_PORT_KBRG="3012"

Debug in production

Enabling this will create the .debug file, even when building for production.

"debugInProduction": true

Environment variable:

CEP_DEBUG_IN_PRODUCTION="1"

CEF Params

"cefParams": [
    "--allow-file-access-from-files",
    "--allow-file-access",
    "--enable-nodejs"
]

Environment variable:

CEP_CEF_PARAMS="--allow-file-access-from-files,--allow-file-access,--enable-nodejs,--mixed-context"

Dev host & port

"devHost": "localhost",
"devPort": 8080,

Environment variable:

CEP_DEV_HOST="localhost"
CEP_DEV_PORT="8080"

Credits

This code is mostly taken from (an old version of) cep-bundler-core by @fusepilot.