Using Typescript with SDF Deploy
Hi,
Could someone please suggest how to use typescript for creating Suitescripts and deploy using SDF? Any references will be helpful.
I think you’ll have to create some sort of custom build/deploy process that compiles the TS and then deploys the compiled file.
A lot will depend on the IDE you’re using. For example, I’m currently exploring using WebStorm’s File Watchers to continually output transpiled JavaScript (ES.NEXT to ES5.1) and then use that when deploying via SDF.
Thanks @abbott, we are also using WebStorm. So if i understand correctly, we need to have seperate folder to hold .ts file and editor or some build process to transpile them to js which will be saved to cabinet path. is that correct? I just tried tsc -w with this approach, but when ts is compiled we are missing jsdoc comments (apiversion and script type) and also SDF deployment getting failed. Any inputs or sample here please?
How is the folder structure you are maintaining and tsconfig values configured like that.
With SS 2.1 you can transpile up to ES2018 now!
It looks like there might be a different process for TypeScript in WebStorm:
https://blog.jetbrains.com/webstorm/2016/03/how-to-compile-typescript-in-webstorm/
I’m not yet planning to use TS but am experimenting with the latest versions of JavaScript.
I’ve not got as far as a fully working solution once the compiled code is generated but am working on a couple of possibilities:
- Having a separate folder tree for source code (not included in deploy.xml) that is then transpiled into the deployable section.
- Having the transpiled files alongside the source files but excluding the source file types from deploy.xml.
In either case, I’m not yet certain what deploy.xml offers in terms of filtering, selection, exclusion, etc.
Thanks,
Chris



