Hello team, I have a question about the NetSuite p...
# suitescript
a
Hello team, I have a question about the NetSuite plugin for Webstorm related to typescript. When using typescript in Webstorm, is there a way to configure it so that it uploads both the .ts and .js file to NetSuite when clicking the menu entry “NetSuite” -> “Upload file to account” ? The context menu is only available for the .ts file, but not for the .js. It would be nice to upload both when uploading the .ts file. Thanks.
e
Not a TS user here, but why does the TS file go into the File Cabinet?
a
well, the ts is not needed, but the NetSuite plugin allows it to be uploaded, but not the .js file, which is needed
e
Strange. I don't use the plugin so I don't know its rules for what it considers uploadable. Is the JS getting built outside the SDF project structure?
👀 1
e.g. if you have all your TS under
src/
and your JS under
dist/
, and the SDF project root is
src/
, that might explain it
a
the .js is built right on the same folder, at the same level
so you have both the .ts and .js
t
Hi @Antonio Garcia maybe you can try redirecting your question under #C42JX79UZ
a
Thanks @Tyn Guardian I will
d
@erictgrubaugh has the right idea. Have your TS outside the SDF folder structure, and set your tsconfig to output the JS into the SDF folder structure.
high five 1
a
but how is this helping uploading the .js and .ts files when using the context menu “NetSuite -> Upload file to account”?
d
You're struggling because you haven't setup your environment correctly. FYI, you don't want/need .ts files going to NetSuite ... just the generated .js files.
a
yes, correct, don’t need the .ts files in NetSuite
please send me any info/link with the setup you suggest
m
It sounds like @Antonio Garcia want to work on the
.ts
file, and then use the Upload File command to upload the generated
.js
. @Antonio Garcia I wonder if this is possible using the Node CLI and a custom command in
suitecloud.config.js
to remap the path. If that works you can create a custom action in Webstorm to invoke the CLI
a
thanks @michoel I will try that approach
m
Let me know how you go
s
FWIW, We always upload both the
.ts
file and the
.js
so that the original sources are always available even for those without access to the git repository.
m
@Shawn Talbert in your dev workflow, when you edit the
.ts
file, what do you do to upload the
.js
file?
s
we include both the .ts and .js in
deploy.xml
and typically use the cli to deploy
d
@Shawn Talbert, I find that interesting. (I mean, pushing the TS to NeSuite). Do you then push everything? your package.json, your tsconfig, estlint, etc?
a
but my original question was: how do we upload the .js file from the NetSuite plugin?
we upload both too, .js and .ts
👍 1
but from the plugin, you can only upload the .ts, not the .js
s
really? I figured the plugin would upload JS not TS (the other way around from what you're saying). I guess there's another reason to not use the UI plugin 🙂
@darrenhillconsulting no, we only upload TS and JS at this time, leaving all the other config in version control only.
@Antonio Garcia if you have both the .TS and .JS referenced in your
deploy.xml
then 'uploading' can be done with a
deploy
action. It may take a couple seconds longer than the individual file upload, but it's faster than uploading multiple files even if you could do it directly.
Our scripts often include more than one file, so having the full set of files involved explicitly called out in
deploy.xml
ensures none of them are out of date.
a
but you mean with SDF
I am asking via the plugin: Right click on a file, NetSuite ->Upload File to Account
s
As far as I know, that right click action is also "SDF" technically, I don't recommend that as a best practice, but I think there's a feature request to make that upload action available for both .JS and .TS files
👍 1
I know some here have fully automated generation of
deploy.xml
but even just manually using
deploy.xml
is an advantage over willy nilly uploading individual script files. One reason is you can work on a single logical customization and have a
deploy.xml
that describes it exactly, and if you always use
deploy.xml
and the
deploy
operation, it ensures everything stays in sync. Additionally, it documents exactly what should be deployed for the given customization and even keeps that under version control. A common practice we use is to then TAG the repo upon release, so that tag indicates the state of the script code at the time of release AND what should have been deployed (via the state of
deploy.xml
as of that tag).
👍 2
If you still want to rightclick->upload from inside the IDE, look for a ticket that matches your request on the repo I linked above, or create a new ticket asking for exactly what you want.
e
Does the IDE not respect the
deploy.xml
of the project? The answer to your question if deploying from the CLI is to add both your JS and TS files to
deploy.xml
. If the IDE doesn't respect that file, you have to either find what it is using to deploy, or switch to CLI deployments
plusone 1