CarlosLeyvaAyala / Papyrus-2-Typescript

Transforms *.psc files to *.ts
MIT License
12 stars 2 forks source link

Option to import from 'skyrimPlatform' (without .../) #3

Open mrowrpurr opened 2 years ago

mrowrpurr commented 2 years ago

I found it surprising that this tries to import skyrimPlatform from '../skyrimPlatform'

Could we get a way to configure this to simply be 'skyrimPlatform'? Or could that ideally be the default?

In the real world, skyrimPlatform is imported by name as 'skyrimPlatform' (requiring skyrimPlatform.js under the hood at runtime)

Thoughts? Thanks!

CarlosLeyvaAyala commented 2 years ago

Yeah. This assumes all files generated by it will be put in a subfolder next to skyrimPlatform.ts, that's why imports are from '../skyrimPlatform'.

I can certainly add the option to import from 'skyrimPlatform'.

On other topic, I didn't update JContainers because I needed more info on the Form | null | undefined.

After playing and testing SP, I remembered why added undefined to this program definitions: sometimes SP returns undefined instead of a valid Form descendant.

Anyway, when we reach a consensus on the '../skyrimPlatform' issue, I will update JContainers definitions.

CarlosLeyvaAyala commented 2 years ago

../skyrimPlatform

When I made this program I didn't really know about typescript imports and whatnot, but now I see what you're talking about, so yeah... I will remove those relative imports.