This is a module template for jsx-scripts that can be executed in Adobe applications (particularly Photoshop). Warning! This is not for CEP Extensions. Template for jsx-scripts can be found here.
All modules should use require
to include other modules, and use module.exports
to export it content.
Main entry point of module is index.js. Additional entry point test.js for test bundles.
Use Browserify as a bundle system.
- combines all required code in one bundle (easy to install/update)
- has watch mode (bundle rebuilds automatically)
- build. This folder will contain test_bundle.jsx and {your_module_name_from_package.json}.jsx
- utils. Contains npm scripts.
- index.js. Module entry point.
- header.jsx. Basically, it is mustache template wich gets data from package.json. This file will be prepended to bundle from index.js entry point
- package.json.
- README.md.
- test.js. Test entry point.
-
Get files
-
Fill in package.json,
name
andversion
is mandatory. -
Fill in header.jsx.
-
npm run watch
Updates files automatically on change. -
Write your module code in index.js and tests in test.js.
-
open test_build.jsx in ESTK (Adobe ExtendScript Toolkit) run in your target Adobe app, then debug.
-
Repeat from 5 to 7 until done.
-
Prepare package for npm publish.
- As a module for scripts that uses this template:
var your_module = require('your_module_name_from_package.json');
- As a module for scripts that uses
#include
:
#include "{path_to_bundle}/{your_module_name_from_package.json}.jsx"
var your_module = require('your_module_name_from_package.json');