Anyone using Typescript for SuiteScript these days...
# suitescript
k
Anyone using Typescript for SuiteScript these days? I'm thinking about going back to it and wonder what your development / deployment pipelines might look like
c
Imo, this is the only way to travel. Once you're tools are aligned, the productivity gains are enormous.
k
Sure but what are your tools and how are they aligned?
n
Once your SuiteScript is created and deployed from your build process, how do you ensure future devs that work on the account are able to modify the SuiteScript? Do you include the SDF project including the TS in the filecabinet? Or is it a case of "good luck!" ?
k
When I've done TS in the past my team always kept the TS files in version control so they'd be available if needed for future devs.
unfortunately the TS team I worked on had a proprietary process so I am unable to duplicate it on my own which is why I'm asking what everyone else's development/deployment pipeline looks like so I can develop a new one.
n
If you work for a partner and have to work on a new customer, it's a pain to find the transpiled code which means you inevitably have no access to the .ts, same for contractors I assume.
e
Sounds like whether to use TS isn't really the question here. I know there are a bunch of TS advocates here like @stalbert and @darrenhillconsulting, and several folks working on projects like https://github.com/headintheclouddev/typings-suitescript-2.0
👍 1
c
Use
@hitc/netsuite-types
with the SuiteClould extension for vscode (or the other ide lotsa ppl use that I can't remember). You get all the intellisense and you can upload files with a keystroke. As long as your cutting out most of the point/click busy work with the tooling it's a better life. As far as other devs... well, put your stuff in a repo and gift it to the client. Years later when they wanna change it, they might remember to point the new guy at it.
Here's a ts.config
Copy code
{
  "compilerOptions": {
    "module": "amd",
    "target": "ESNext",
    "moduleResolution": "node",
    "sourceMap": false,
    "newLine": "LF",
    "experimentalDecorators": true,
    "baseUrl": ".",
    "lib": [
      "es5",
      "es2015.promise",
      "dom",
      "es2015"
    ],
    "paths": {
      "N": [
        "node_modules/@hitc/netsuite-types/N"
      ],
      "N/*": [
        "node_modules/@hitc/netsuite-types/N/*"
      ]
    }
  },
  "include": [
    "src",
    "__mocks__",
    "__tests__"
  ],
  "exclude": [
    "node_modules"
  ]
}
The hitc guy has stubs for most of the EntryPoints on his npm page: https://www.npmjs.com/package/@hitc/netsuite-types
d
TS for the win!
k
Thanks for all the replies, lots of good info here! I used to work at HITC so I'm familiar with their NS Types. At least when I was working there the types were partially maintained by NetSuite themselves. The part I'm trying to figure out is the transpiler / upload process. I've never gotten the HITC build tools to work on my own computer.