clasp
clasp copied to clipboard
File execution order is not working on a TypeScript project
(Note: Non-breaking issues are likely not to be prioritized. Please consider a PR in addition to your issue)
Expected Behavior
Files in filePushOrder are executed first. Even for compiled typescript code.
Actual Behavior
I don't think that filePushOrder is working in a typescript project. I am trying two ways:
-
Path of file after clasp push "filePushOrder":["ts/helpers/LibraryExternalProperty.gs"],
-
Path of file befose clasp push "filePushOrder":["src/ts/helpers/LibraryExternalProperty.ts"],
neither way the file LibraryExternalProperty.ts is executing first. I put a Logger.log("hi") there and its not logging An error come up first because dont recognize LibraryExternalProperty class.
Can you help me please?
Thanks
Specifications
- Node version (
node -v
): 10.15.1 - Version (
clasp -v
): 2.0.1 - OS (Mac/Linux/Windows): Windows
I'm using clasp 2.3.0 and I don't think that this issue has been fixed already. I've made an example on StackOverflow. I've listed here all opened issues concerned this problem on Git google/clasp:
@fedeserbin @kornthing Using the latest npm version of @google/clasp
I do not experience any issue related to the filePushOrder
in .clasp.json
If you still are, please share a github repository with some sample code and .clasp.json
(no need to give access to your Google Apps Script project) so that I may investigate further.
Here is a sample repository I used to check proper usage of filePushOrder
.
A better description in the doc may be useful though and a PR would be appreciated.
@kornthing can you please give a status about this issue?
If anyone is coming in here still with filePushOrder
still not working, have a look at the rootDir
property inside .clasp.json
. On windows, when you clone a project, the rootDir
stores the full path of the folder. I changed it to a relative path and filePushOrder
started to work.
Clasp version 9.4.1
Before
{
"scriptId": "XXXXXXXXXXXXXXXXXXXXX",
"rootDir": "C:\\devfolder\\project1",
"filePushOrder": [
"subfolder1/campaigns.js",
"subfolder1/dispositions.js",
"subfolder1/globalSettings.js",
]
}
After
{
"scriptId": "XXXXXXXXXXXXXXXXXXXXX",
"rootDir": ".",
"filePushOrder": [
"subfolder1/campaigns.js",
"subfolder1/dispositions.js",
"subfolder1/globalSettings.js",
]
}