项目作者: sammarks

项目描述 :
A Neutrino preset for developing plugins on Adobe's CEP (Common Extensibility Platform)
高级语言: JavaScript
项目地址: git://github.com/sammarks/neutrino-preset-cep.git
创建时间: 2018-07-21T21:09:25Z
项目社区:https://github.com/sammarks/neutrino-preset-cep

开源协议:MIT License

下载


CircleCI
NPM version
NPM downloads
License
Issues

neutrino-preset-cep is a Neutrino preset that supports creating plugins for Adobe’s CEP (Common Extensibility Platform).

Get Started

  1. npm install --save-dev neutrino-preset-cep
  1. module.exports = {
  2. use: ['neutrino-preset-cep']
  3. }

Additionally, you’ll need to provide some configuration options in your package.json (or in the .neutrinorc.js file).
See the Configuration section below for more details.

Project Layout

neutrino-preset-cep follows the standard project layout specified by
Neutrino. This means that by default all project source code should live in a directory named src in the root
of the project. Any ExtendScript source code should live in a directory named extendscript in the root of the
project, since it is compiled differently. Any static assets found in static in the root of the project will
be copied directly to the build directory. For example, static/test.png will be copied to build/test.png
and static/foo/test.png will be copied to build/foo/test.png.

Configuration

Here is the minimal configuration you’ll need in package.json in order for this preset to function properly:

  1. {
  2. "name": "test-plugin",
  3. "version": "0.0.1",
  4. "manifest": {
  5. "extensions": {
  6. "panel": {
  7. "type": "panel",
  8. "title": "Adobe CEP Plugin"
  9. }
  10. }
  11. }
  12. }

In this example, you’ll be creating a plugin called “Adobe CEP Plugin” (with the identifier test-plugin), with
the following notes:

  • Frontend Source Code located at src/panel.jsx
  • ExtendScript Code located at extendscript/panel.js

More Complete Configuration

Here is an example of more complete configuration located in package.json:

  1. {
  2. "name": "adobe-plugin",
  3. "version": "0.0.1",
  4. "manifest": {
  5. "bundleName": "Adobe Plugin",
  6. "bundleId": "com.my-company.adobe-plugin",
  7. "hosts": {
  8. "AEFT": "13.0"
  9. },
  10. "requiredRuntimes": {
  11. "CSXS": "6.0"
  12. },
  13. "extensions": {
  14. "panel": {
  15. "type": "panel",
  16. "title": "Adobe Plugin",
  17. "size": [300, 300],
  18. "minSize": [200, 200],
  19. "maxSize": [400, 400]
  20. },
  21. "tutorial": {
  22. "type": "dialog",
  23. "title": "Adobe Plugin Tutorial",
  24. "size": [800, 600],
  25. "minSize": [800, 600],
  26. "maxSize": [800, 600]
  27. }
  28. }
  29. }
  30. }

If you don’t want to put your configuration in the package.json file, you can specify configuration inside
the options like so:

  1. module.exports = {
  2. use: ['neutrino-preset-cep', {
  3. packageJson: {
  4. name: 'adobe-plugin',
  5. version: '0.0.1',
  6. manifest: {
  7. foo: 'bar'
  8. }
  9. }
  10. }]
  11. }

Customizing

neutrino-preset-cep has the following options for itself:

  • options.packageJson - Supply an object for this field similar to the structure of the package.json file. A detailed
    explanation on how to use this feature is above.
  • options.externals - Any additional externals defined here are sent straight into Webpack. Use this if you are using
    a module that requires internal Node APIs (like fs or child_process). A few externals are already defined by
    default. These are mocked in the development environment to allow developers to debug in the browser.

This preset makes use of the following presets and middleware, with their configuration paths specified.

So this means you could have configuration like so:

  1. module.exports = {
  2. use: ['neutrino-preset-cep', {
  3. react: {},
  4. compileLoader: {},
  5. wrapper: {},
  6. xml: {},
  7. jsxbin: {}
  8. }]
  9. }

Features

  • Supports React for the extension frontends.
  • Transpiles ExtendScript support back to ES5 and compiles using JSXBin.
  • Generates a manifest.xml file in the proper CSXS folder using properties defined in package.json