Giter Club home page Giter Club logo

create-cep-extension's Introduction

Notice: I encourage you to check out parcel-cep-plugin. It's a more maintainable approach to the same problem that has a much smaller codebase than a fork create-react-app ever will. Parcel also has many benefits that should be enticing enough to consider switching.

Create CEP Extension

Create CEP Extensions with no build configuration. Closely matches functionality from Create React App.

Create React App works on macOS, Windows, and Linux.
If something doesn’t work please file an issue.

Quick Overview

npm install -g create-cep-extension

create-cep-extension my-cep-extension
cd my-cep-extension
npm start

Then open http://localhost:3000/ to see your app.
When you’re ready to deploy to production, create a minified bundle with npm run build.

npm start

Get Started Immediately

You don’t need to install or configure tools like Webpack or Babel.
They are preconfigured and hidden so that you can focus on the code.

Just create a project, and you’re good to go.

Getting Started

Installation

Install it once globally:

npm install -g create-cep-extension

You’ll need to have Node >= 4 on your machine.

We strongly recommend to use Node >= 6 and npm >= 3 for faster installation speed and better disk usage. You can use nvm to easily switch Node versions between different projects.

This tool doesn’t assume a Node backend. The Node installation is only required for Create React App itself.

Creating an App

To create a new app, run:

create-cep-extension my-cep-extension
cd my-cep-extension

It will create a directory called my-cep-extension inside the current folder.<cep-extension Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-cep-extension
  README.md
  node_modules/
  package.json
  .gitignore
  .env
  extendscript/
    index.jsx
  public/
    favicon.ico
    index.html
  src/
    App.css
    App.js
    App.test.js
    index.css
    index.js
    logo.svg

No configuration or complicated folder structures, just the files you need to build your app.
Once the installation is done, you can run some commands inside the project folder:

npm start or yarn start

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will see the build errors and lint warnings in the console.

Build errors

npm test or yarn test

Runs the test watcher in an interactive mode.
By default, runs tests related to files changes since the last commit.

Read more about testing.

npm run build or yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

npm run archive or yarn archive

Creates a ZXP archive of the build folder to the archive folder.

You can then send the ZXP archive to your users to install using a ZXP installer. For instance:

Environment Variables

You can customize the name of the extension and multiple other variables by modifying the .env file.

NAME="My Extension"
BUNDLE_ID="com.mycompany.myextension"

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:

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.

Type

Sets the type of window. Options are ModalDialog, Modeless, Panel is default.

UI_TYPE=ModalDialog

Icon

To add a custom panel icon, add all icon files inside the public folder and set their paths inside your .env file:

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 Variables

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

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

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.

import { loadExtendscript } from 'cep-interface';

loadExtendscript('index.jsx');

evalExtendscript(code: string): Promise

Evaluates the specified code. Returns a Promise.

import { evalExtendscript } from 'cep-interface';

evalExtendscript('$.writeln("Hello Foo");'); // writes "Hello Foo" to the info panel

If you return a JSON string using json2 or similar from Extendscript, you can get the parsed result.

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)

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.

Contributing

We'd love to have your helping hand on create-cep-extension! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

Todo

  • Improve target host configuration per #4.
  • Create .jsxbin's automatically and smoothly. Adobe has made this nearly impossible to do on macOS, so not sure if its worth the trouble. Especially since .jsxbin doesn't really deter hackers.
  • Testing.

create-cep-extension's People

Contributors

dependabot[bot] avatar fusepilot avatar jeng-tts avatar jmgirven avatar kennethormandy avatar rcjohns412 avatar timolins avatar zuifengwuchou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-cep-extension's Issues

create-cep-extension: command not found

If you're using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Can you still reproduce it?
Yes

Description

Running the create-cep-extension command in the terminal gives me this error:
-bash: create-cep-extension: command not found

Expected behavior

I expected it to create the file structure I needed to have a basic working extension/app.

Actual behavior

Got an error: -bash: create-cep-extension: command not found

I had to run this command instead to get it to work:
node /usr/local/Cellar/node/6.2.1/lib/node_modules/create-cep-extension/createCEPExtension.js my-extension-name

Environment

  1. npm ls create-cep-extension-scripts (if you haven’t ejected):
    [email protected]

  2. node -v: v10.11.0

  3. npm -v: 6.4.1

  4. Operating system: Mac OS 10.12.6 (16G1114)

  5. Browser and version: Google Chrome Version 69.0.3497.100 (Official Build) (64-bit)

Reproducible Demo

I can't get to the point where it creates an app.

Support for custom icon

It would be awesome to add support for a custom sidebar icon. Adding them to the public folder and link them inside the manifest works just fine.

<Icons>
 <Icon Type="Normal">./images/IconLight.png</Icon>
 <Icon Type="RollOver">./images/IconLight.png</Icon>
 <Icon Type="DarkNormal">./images/IconDark.png</Icon>
 <Icon Type="DarkRollOver">./images/IconDark.png</Icon>
</Icons>

Reference

Failed to minify code on Build

Hi, first off I'm not a developer but an enthusiast. I am using create-cep-extension to build an extension for After effects that will help me speed up some daily routines I do with videos.

I have built the app and it works perfectly with "npm start", I've tested it with After effects 2021 and 2022 and everything is working fine. The problem occurs when I try to build the extension. It gives the below error:


Failed to minify the code from this file:

    ./node_modules/react-router-dom/index.js:74

I am using react-router-dom 6 in this particular case so don't know if that may be the issue. Should I revert back to an earlier version of react-router-dom?

Thank you in advance.

How do you call index.jsx?

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Many errors, especially related to "missing modules", are due to npm bugs.

If you're using Windows, follow these instructions to update npm.

If you're using OS X or Linux, run this to update npm:

npm install -g npm@latest

cd your_project_directory
rm -rf node_modules
npm install

Then try to reproduce the issue again.

Can you still reproduce it?

Description

What are you reporting?

Expected behavior

Tell us what you think should happen.

Actual behavior

Tell us what actually happens.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls create-cep-extension-scripts (if you haven’t ejected):
  2. node -v:
  3. npm -v:

Then, specify:

  1. Operating system:
  2. Browser and version:

Reproducible Demo

Please take the time to create a new app that reproduces the issue.

Alternatively, you could copy your app that experiences the problem and start removing things until you’re left with the minimal reproducible demo.

(Accidentally, you might get to the root of your problem during that process.)

Push to GitHub and paste the link here.

By doing this, you're helping the Create React App contributors a big time!
Demonstrable issues gets fixed faster.

npm run archive: Spaces in company name

I believe if you have spaces in your company name when signing the zxp file, npm run archive will fail because the ZXPSignCmd command interprets the parts as separate command line parameters. E.g:

CERTIFICATE_ORG="My Company"

Results in the command:

ZXPSignCmd -selfSignedCert US CA My Company com.company certificate-password certificate.p12

being run. Which errors with Command failed.

can i write es6 in jsx?

or how do I print out all layer information in chrome console?
and debug extendscript with chrome console?

Changelog for rewrite?

Hey, I’m hoping to make more contributions to this project, but looks like everything is changing. Would you be able to share the reason behind the rewrite, or could we chat sometime about your future plans for this project? It looks like CRA is used directly now rather than this being more of a fork, is that correct?

In the meantime, I’ve tagged my fork v1.0.0 so I can continue to make changes I need as necessary, but I’d rather contribute directly to this project if possible. Some things I have that I’d like to open PRs for:

  • Moving the bundle.js and main CSS file into the root of the build directory, maintains compatibility with CRA and fixes the static media URL paths (this might already be fixed if you’ve made things even more CRA-like)
  • Command line UI for debugging URLs

Thanks!

ERROR : Module parse failed

ERROR : Module parse failed
While loading @azure/msal-react package showing this error.

The error image is attached below.
image

Help me if you have any solution...

npm run build: Setting bundle version

I am trying to build a production build with npm run build. I expected that setting BUNDLE_VERSION in the .env file would change the bundle version from the default "1.0.0". This doesn't seem to have an effect though (looking at the build manifest.xml). I also tried changing "version" in my package.json, but no luck.

Looking through the source code, it seems that version is tied to the VERSION variable in cep.js (here), which loads its value from require('../package.json'), i.e. the create-cep-extension package.json file. Am I wrong? Should this instead refer to the users package.json? Or should the BUNDLE_VERSION be used instead of VERSION in multiple places (e.g. in archive)?

Importing Mantine styling library causes compilation failure

OS: Windows:
BROWSER: CHROME: Version 101.0.4951.67 (Official Build) (64-bit)

How to reproduce the error with npm:

in terminal:

  • create-cep-extension myapp
  • npm install @mantine/core @mantine/hooks (react component library)
  • cd myapp/src
  • [vim|code|(text editor of choice)] App.js
  • add import { Button } from '@mantine/core'

Description

Running this in the browser with:

  • npm start
    produces a very long error that originates in the @radixui library starts with:

./node_modules/@radix-ui/react-scroll-area/dist/index.module.js
Module parse failed: C:\Users\usr\myapp\node_modules@radix-ui\react-scroll-area\dist\index.module.js
Unexpected token (1:810)
You may need an appropriate loader to handle this file type.

Expected behavior

Should work without any problems

Actual behavior

Fails at (1:810) which when closely inspected in the editor, we find an attempt to destructure an object:

const {
        __scopeScrollArea: t,
        type: n = "hover",
        scrollHideDelay: i = 600, // This is exactly where the location (1:810) where the error happens inside index.module.js
        ...a
    } = e, [d, p] = s.useState(null), [h, m] = s.useState(null), .... etc;

It's worth mentioning, that after some digging, I figured that the radixui library uses an old version of react (16.0 or 17.0) which seems incompatible with the default react version in the project, but even after changing the version in package.json in the main project directory, the problem persists.

Can't use extendscript

Description

I can't use extend script inside of App.js

Expected behavior

Write hello world in console

Actual behavior

Unhandled Rejection (TypeError): Cannot read property 'evalScript' of undefined

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls create-cep-extension-scripts (if you haven’t ejected): -- [email protected]
  2. node -v: v12.18.4
  3. npm -v: 7.5.3

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: Google Chrome Version 88.0.4324.150

Reproducible Demo

import React, { Component } from 'react';
import { evalExtendscript } from 'cep-interface';
import logo from './logo.svg';
import './App.css';

class App extends Component {

  test = () => {
    evalExtendscript('$.writeln("Hello Foo");');
  }

  render() {
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to React</h2>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        <button onClick={this.test}>TEST</button>
      </div>
    );
  }
}

export default App;

I got my error : I was trying to use it from react dev server, but I had to use it from PS debug server. It still can't access cep variable for example to read files

I get a failure when trying to archive as a zip

Can you help me figure out what's going on?

> [email protected] archive /Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago
> create-cep-extension-scripts archive

Signing and archiving...

Error: Command failed: "/Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/node_modules/zxp-provider/bin/osx/ZXPSignCmd" -sign /Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/build /Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/archive/My-CEP-Extension-0.1.0.zxp certificate.p12 certificate-password 
Usage:
    ZXPSignCmd -sign <inputDirectory> <outputZxp> <p12> <p12Password> [options]
	options:
		-tsa <timestampURL> - will attempt to timestamp the ZXP using supplied timestamp server. For example, https://timestamp.geotrust.com/tsa

    ZXPSignCmd -sign <inputDirectory> <outputZxp> -s <identity> [options]
	options:
		-keychain <filename> - identity is only looked-for in the specific keychain given

		-tsa <timestampURL> - will attempt to timestamp the ZXP using supplied timestamp server. For example, https://timestamp.geotrust.com/tsa

    ZXPSignCmd -verify <zxp>|<extensionRootDirectory> [options]
	options:
		-certInfo - will print out information about certificates (including timestamp and certificate revocation information)
		-skipOnlineRevocationChecks - will skip online checks for certificate revocation (certificate revocation checks only happen with -certInfo flag set)
		-addCerts <certificate1> <certificate2>... - will verify certificate chain and assess whether or not DER encoded certificates passed in are included

    ZXPSignCmd -selfSignedCert <countryCode> <stateOrProvince> <organization> <commonName> <password> <outputPath.p12> [options]
	options: 
		-locality <locality> -orgUnit <orgUnit> -email <email> -validityDays <validityDays> - are optional attributes for self-signed p12 certificates


    at ChildProcess.exithandler (child_process.js:303:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  killed: false,
  code: 3,
  signal: null,
  cmd: '"/Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/node_modules/zxp-provider/bin/osx/ZXPSignCmd" -sign /Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/build /Users/bnick/Library/Application Support/Adobe/CEP/extensions/react-imago/archive/My-CEP-Extension-0.1.0.zxp certificate.p12 certificate-password '
}

`build/manifest.xml` not editable

Description

build/manifest.xml not editable. I can't change the width and height of the photoshop panel. its hardcoded in:
create-cep-extension/packages/create-cep-extension-scripts/scripts/templates/manifest.js

see here

Expected behavior

It would be nice if you could serve a config file to setup the manifest.xml.

Thanks and regards Sebi

Cannot get npm run to work

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Yes

Description

It sees that there are some unresolved (?) dependencies with the latest version.

`
Oces-MacBook-Pro:burux2 wfps$ create-cep-extension burux2
/usr/local/lib/node_modules/create-cep-extension
Creating a new CEP extension in /Users/wfps/burux/burux2/burux2/burux2.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and create-cep-extension-scripts...

[email protected] install /Users/wfps/burux/burux2/burux2/burux2/node_modules/fsevents
node install

node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI) (falling back to source compile with node-gyp)
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
handler->Call(3, argv);
^
../../nan/nan.h:1618:3: note: 'Call' has been explicitly marked deprecated here
Call(int argc, v8::Localv8::Value argv[]) const {
^
1 warning generated.
SOLINK_MODULE(target) Release/fse.node
COPY /Users/wfps/burux/burux2/burux2/burux2/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node
TOUCH Release/obj.target/action_after_build.stamp

[email protected] postinstall /Users/wfps/burux/burux2/burux2/burux2/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

[email protected] postinstall /Users/wfps/burux/burux2/burux2/burux2/node_modules/zxp-provider
node ./postInstall.js

Updating permissions for /bin/osx...
Permissions for /bin/osx set to 755.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

Success! Created burux2 at /Users/wfps/burux/burux2/burux2/burux2
Inside that directory, you can run several commands:

npm start
Starts the development server.

npm run build
Bundles the app into static files for production.

npm run archive
Creates a ZXP archive of the build to deploy to your extension users.

npm test
Starts the test runner.

npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

cd burux2
npm start

Happy hacking!

`

Although it seems that the creation of the extension worked, running npm start yields:
`
Oces-MacBook-Pro:burux2 wfps$ npm start

[email protected] start /Users/wfps/burux/burux2/burux2
create-cep-extension-scripts start

internal/modules/cjs/loader.js:550
throw err;
^

Error: Cannot find module './templates/.debug'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/Users/wfps/burux/burux2/burux2/node_modules/create-cep-extension-scripts/scripts/cep.js:5:23)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/Users/wfps/burux/burux2/burux2/node_modules/create-cep-extension-scripts/scripts/start.js:43:13)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
start
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: create-cep-extension-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wfps/.npm/_logs/2018-04-19T12_35_36_915Z-debug.log
`

Expected behavior

Created extension and able to start the development server.

Actual behavior

Error on startup

Environment

[email protected] /Users/wfps/burux/burux2/burux2
└── [email protected]
node: v9.11.1
npm: 5.8.0

  1. Operating system: macOS 10.11
  2. Browser and version: n/a

Reproducible Demo

Follow the steps described on the github page.

How in CEP Environment.

how to make "inCEPEnvironment() == true"

this is my File directory:
image

this is my code in manifest.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="my.cep.extension" ExtensionBundleName="My CEP Extension" ExtensionBundleVersion="0.1.0" Version="6.0">
  <ExtensionList>
    <Extension Id="my.cep.extension" Version="0.1.0"/>
  </ExtensionList>
  <ExecutionEnvironment>
    <HostList>
      <Host Name="PHXS" Version="[0.0,99.9]" />
      <Host Name="PHSP" Version="[0.0,99.9]" />
      <Host Name="IDSN" Version="[0.0,99.9]" />
      <Host Name="AICY" Version="[0.0,99.9]" />
      <Host Name="ILST" Version="[0.0,99.9]" />
      <Host Name="PPRO" Version="[0.0,99.9]" />
      <Host Name="AEFT" Version="[0.0,99.9]" />
      <Host Name="PRLD" Version="[0.0,99.9]" />
      <Host Name="FLPR" Version="[0.0,99.9]" />
      <Host Name="DRWV" Version="[0.0,99.9]" />
    </HostList>
    <LocaleList>
      <Locale Code="All"/>
    </LocaleList>
    <RequiredRuntimeList>
      <RequiredRuntime Name="CSXS" Version="6.0"/>
    </RequiredRuntimeList>
  </ExecutionEnvironment>
  <DispatchInfoList>
    <Extension Id="my.cep.extension">
      <DispatchInfo>
        <Resources>
          <MainPath>./public/index.html</MainPath>
           <ScriptPath>./extendscript/index.jsx</ScriptPath>
          <CEFCommandLine>
            <Parameter>--allow-file-access-from-files</Parameter>
            <Parameter>--allow-file-access</Parameter>
            <Parameter>--enable-nodejs</Parameter>
            <Parameter>--mixed-context</Parameter>
          </CEFCommandLine>
        </Resources>
        <Lifecycle>
          <AutoVisible>true</AutoVisible>
        </Lifecycle>
        <UI>
          <Type>Panel</Type>
          <Menu>达文西</Menu>
          <Geometry>
            <Size>
              <Height>600</Height>
              <Width>600</Width>
            </Size>
          </Geometry>
          <Icons>
            <Icon Type="Normal"></Icon>
            <Icon Type="RollOver"></Icon>
            <Icon Type="DarkNormal"></Icon>
            <Icon Type="DarkRollOver"></Icon>
          </Icons>
        </UI>
      </DispatchInfo>
    </Extension>
  </DispatchInfoList>
</ExtensionManifest>

loadExtendScript in cep-interface fails

Description

loadExtendscript('index.jsx'); fails.

Expected behavior

It should load the Extendscript.

Actual behavior

Tell us what actually happens.

When i try to use loadExtendscript('index.jsx'); in cep-interface the command this.getOSInformation() fails.

Error: TypeError: Cannot read property 'getOSInformation' of undefined

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls create-cep-extension-scripts (if you haven’t ejected): [email protected]
  2. node -v: v8.5.0
  3. npm -v: 5.3.0

Then, specify:

  1. Operating system: MacOS
  2. Browser and version: Indesign

Can't start. "EPERM: operation not permitted, symlink"

Description

Can't run npm start.

Actual behavior

create-cep-extension-scripts start

C:\temp\cep-webpack-latest\my-ext\node_modules\create-cep-extension-scripts\scripts\start.js:17
  throw err
  ^

Error: EPERM: operation not permitted, symlink 'C:\temp\cep-webpack-latest\my-ext\extendscript' -> 'C:\temp\cep-webpack-latest\my-ext\build/extendscript'
    at Object.symlinkSync (fs.js:927:3)
    at symlinkExtendscriptFolder (C:\temp\cep-webpack-latest\my-ext\node_modules\create-cep-extension-scripts\scripts\cep.js:77:17)
    at Object.compile (C:\temp\cep-webpack-latest\my-ext\node_modules\create-cep-extension-scripts\scripts\cep.js:198:3)
    at run (C:\temp\cep-webpack-latest\my-ext\node_modules\create-cep-extension-scripts\scripts\start.js:60:7)
    at detect.then.port (C:\temp\cep-webpack-latest\my-ext\node_modules\create-cep-extension-scripts\scripts\start.js:105:5)
    at internalTickCallback (internal/process/next_tick.js:77:7)
    at process._tickCallback (internal/process/next_tick.js:47:5)
    at Function.Module.runMain (internal/modules/cjs/loader.js:777:11)
    at executeUserCode (internal/bootstrap/node.js:342:17)
    at startExecution (internal/bootstrap/node.js:276:5)
    at startup (internal/bootstrap/node.js:227:5)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `create-cep-extension-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2018-12-25T07_18_36_842Z-debug.log

debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\temp\cep-webpack-latest\my-ext\node_modules\.bin;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files\photo_tools;c:\Program Files\dev_tools\openssl\;C:\Program Files\ffmpeg\bin;C:\Program Files\Adobe\Adobe After Effects CC 2017\Support Files;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;c:\Program Files\MySQL\MySQL Server 5.7\bin\;c:\Program Files\dev_tools\grails-3.3.4\\bin;c:\Program Files\ConEmu\;C:\Program Files\dev_tools\gradle-4.9\bin;C:\Program Files\dev_tools\apache-maven-3.3.9\bin;C:\Program Files\PostgreSQL\9.6\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Groovy\groovy-2.4.12\\bin;C:\Program Files\Java\jdk1.8.0_181\bin;c:\Program Files\PostgreSQL\9.6\;C:\Program Files\Git\cmd;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;c:\altera\91sp2\quartus\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files\nodejs\;c:\Program Files (x86)\GnuPG\bin\;c:\Program Files\dev_tools\apache-maven-3.3.9\bin\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\.lein\bin;C:\Users\User\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: C:\temp\cep-webpack-latest\my-ext
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'create-cep-extension-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `create-cep-extension-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:978:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\temp\cep-webpack-latest\my-ext
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v11.5.0
19 verbose npm  v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `create-cep-extension-scripts start`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls create-cep-extension-scripts (if you haven’t ejected): [email protected]
  2. node -v: v11.5.0
  3. npm -v: v11.5.0
    Windows 10

Compilation errors after calling npm run eject

After calling npm run eject (which I need to configure WebPack), several things are missing, so that I can't call npm run start/build/archive anymore.

  • The directories scripts/templates and scripts/utils are missing.
  • Simply copying them manually from node_modules just doesn't do the trick. Recalling npm run build or npm run start gives : Path must be a string. Received undefined.

Can be reproduced with a fresh project with no modification whatsoever on MacOSX Sierra.

NPM is up to date (6.1.0), and Node version is rather recent (8.9.1).

Building and archiving extension

If I create the basic extension:

create-cep-extension my-cep-extension

Start it:

npm start

It works fine, and I can see it as an extension in Adobe. I can see in the built index.html that it is simply a redirect to localhost:3000, where the react app is being hosted. Now I want to build a production version of the extension and share it with my colleagues:

npm run build

Add my certificate details to the .env file and:

npm run archive

I then share the .zxp as a private extension through the Adobe exchange. They install it and open it through Window -> Extensions, only to see a blank extension window. Looking at the logs I see that index.html is loaded, but it cannot find the JS file:

OnResponseStarted: file:///Users/jon/Library/Application%20Support/Adobe/CEP/extensions/my.cep.extension/index.html
OnReadCompleted: "file:///Users/jon/Library/Application%20Support/Adobe/CEP/extensions/my.cep.extension/index.html" bytes_read = 395
OnReadCompleted: "file:///Users/jon/Library/Application%20Support/Adobe/CEP/extensions/my.cep.extension/index.html" bytes_read = 0
ResponseCompleted: file:///Users/jon/Library/Application%20Support/Adobe/CEP/extensions/my.cep.extension/index.html
OnResponseStarted: file:///static/css/main.1f6b6bee.css
ResponseCompleted: file:///static/css/main.1f6b6bee.css
OnResponseStarted: file:///static/js/main.9c1e51de.js
ResponseCompleted: file:///static/js/main.9c1e51de.js

The javascript is being loaded from the root directory, which if it were hosted, would be fine. But in the extension resolves to the root file path.

<script type="text/javascript" src="/static/js/main.9c1e51de.js">

Out of interest, I tried modifying the production build index.html to instead have:

<script type="text/javascript" src="./static/js/main.9c1e51de.js">

I can then see that the JS is loaded correctly, but I experience other issues with the app. As it is a production build, no logs are printed to help me with further issues.

Am I doing something wrong when building or distributing the app? Is Adobe supposed to be serving the build directory rather than opening it as a file?


npm ls create-cep-extension-scripts:
[email protected]

node -v:
v8.2.1

npm -v:
5.3.0

Testing with Adobe Premiere Pro 2017.1.2 v11.0.

Basic create-cep-extension doesn't connect to extendscript

I created my extension using create-cep-extension.

When I launch the extension in either AE or PPRO it displays but the call to extendscript doesn't work.

if (inCEPEnvironment()) {
    // write "Hello World!" to the info panel inside the host application
    evalExtendscript('$.writeln("Hello Worlds!");')
         .then(result => alert(result))
         .catch(error => alert(error))
}

With the above configuration I get an error: undefined

create-cep-extension should bootstrap a working extension with connection to extendscript right? Have I missed something?

Public folder not copied while running build

The content of the public folder is not copied to the build folder when running
npm run build.

Files like for example favicon.ico are not in the build folder.

This was working before in version 1.0.0-beta.10.

I tried out with creating a totally new project and it still occured.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.