JSX(Adobe ExtendScript) pre-processor
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
test
.gitignore
README.md
index.js
jsx_manifest.js
package.json
usage.txt

README.md

JSX(Adobe ExtendScript) Manifest

JSX(Adobe ExtendScript) pre-processor

Install

$ git clone https://github.com/nbqx/jsx-manifest.git
$ cd jsx-manifest
$ npm install -g .

Usage

show help and examples

$ jsx_manifest -h 

or

$ git clone https://github.com/nbqx/jsx-manifest.git
$ cd jsx-manifest
$ npm install .
var jsx_manifest = require('jsx-manifest');
// `locals` is json object
jsx_manifest('/path/to/manifest.js', locals).on('build',function(data){
  // something to do
  // data is combined extendscript string data
});

Manifest.js Sample

{
  header: [
    "#target InDesign-7.0",
    "#targetengine session"
  ],
  src: [
    "a/a.jsx",
    "b/b.jsx",
    "c.jsx",
    "d/e/e.jsx"
  ],
  preProcess: {
    "b/b.jsx": function(body,opt){
      var content = opt['b'];
      body = body.replace(/(\/\* @options\{\{ \*\/)(.|\n|\r|\u2028|\u2029)+(\/\* \}\}@options \*\/)/g, content);
      return body
    },
    "c.jsx": function(body,opt){
      var content = "var DefaultPaths = "+JSON.stringify(opt['c'])+";";
      body = body.replace(/(\/\* @options\{\{ \*\/)(.|\n|\r|\u2028|\u2029)+(\/\* \}\}@options \*\/)/g, content);
      return body
    }
  }
}

Example

$ jsx_manifest examples/manifest.js -b examples/data.json # => output to console
$ jsx_manifest examples/manifest2.js -b examples/data.json # => output to console

or

$ jsx_manifest examples/manifest.js -b examples/data.json -o build.jsx
$ jsx_manifest examples/manifest2.js -b examples/data.json -o build.jsx