docsforadobe / Types-for-Adobe

TypeScript types for Adobe: AfterEffects, Animate, Audition, Illustrator, InDesign, Photoshop, Premiere, ScriptUI.
517 stars 124 forks source link

Add package.json's for yarn > v1 support #80

Open vespakoen opened 3 years ago

vespakoen commented 3 years ago

Basically, references don't seem to work when using yarn berry (might also not work with other PnP implementations)

But using the "types" field in the package.json makes things work, so this PR includes a package.json in all folder so they can be included without references (see the tsconfig.json in the example below)

# create new folder
mkdir my-script
cd my-script

# install types-for-adobe
npm install -g yarn
yarn init -y
yarn set version berry
yarn add -D typescript types-for-adobe@https://github.com/vespakoen/Types-For-Adobe

# create tsconfig.json
printf '{"compilerOptions":{"module":"none","noLib":true, "types": ["types-for-adobe/shared", "types-for-adobe/AfterEffects/18.0"]}}' > tsconfig.json

# create index.ts and change reference types to Adobe product you're targeting
printf 'alert(String(app));\n' > index.ts

# compile typescript files
yarn tsc
zlovatt commented 9 months ago

@vespakoen Is this still needed / a useful change?

vespakoen commented 9 months ago

I am not doing CEP development anymore since a year or 2, but I remember this being useful for me, so I'd say that yes, this was & probably is still a welcome change. All the best!