Closed SturmB closed 6 years ago
Sorry for the late reply. I have been using this in production for the past several years, let me see if i made some modifications that havent been pushed
Not a big deal. I was able to get the AES (Adobe ExtendScript) side of my Adobe CEP project to work with modules by leveraging TypeScript's namespacing capability. Although it would probably be nicer to have proper require()
functionality instead.
Yeah, I'm trying to create an extension to Adobe Illustrator with Adobe CEP and, to complicate matters, I am attempting to do so with TypeScript so I can leverage its advantages over plain JS. Feel free to have a look at the project, if you wish. I'm using SystemJS on the HTML Panel side, but that clearly doesn't work on the AES side.
Ok i pushed the version i've been using. There were a couple small changes in there that might do the trick. Let me know if it still doesn't work.
I pulled the repo to get the latest, un-commented the // Tests
function at the end of require.jsx
and ran it in the ESTK for Photoshop CC 2018.
Same errors.
That makes no sense that it's working well for you, but not for me, unless there's something that needs to be changed about how it's calling those "name"s or perhaps even in the tests themselves.
I havent run those tests in quite some time, but require.jsx works as expected. I've added #2 to get those working.
Can you try running main.jsx in the following?
main.jsx
#include require.jsx
(function() {
var m = require("mod");
m.doit();
})()
mod.jsx
(function() {
exports = module.exports = {
doit: function() {
alert("Works");
}
};
})()
Success. That test with main.jsx
and mod.jsx
does, indeed, throw the alert window. Now I'll have to see whether or not I can implement this into my TypeScript/Adobe CEP projects. 😣
You might have to make a d.ts file for the api and make sure your tsconfig is targeting like es3 or something
Sounds good. It'll be quite some time before I can properly give this a try (just got a bunch of work dropped into my lap), but I'll see if I can report back when I do. Thanks again!
Thank you for creating this library to add
require()
functionality to Adobe ExtendScript.Unfortunately, I tried cloning this repo and following your instructions in the README, plus un-commenting the final section of
require.jsx
to actually run the tests. Sadly, I did not get a successful execution. The ESTK console returns:Any idea on what could be happening here and how to remedy it?