google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.53k stars 423 forks source link

File push order seems to be broken #624

Open DimuDesigns opened 5 years ago

DimuDesigns commented 5 years ago

Expected Behavior

clasp push adheres to file push order defined in .clasp.json.

Actual Behavior

clasp push results in project files listed in lexicographic order.

Steps to Reproduce the Problem

  1. Pull contents of a GAS project via clasp pull
  2. Edit the generated .clasp.json file with the desired push order.
  3. Create a new GAS project for testing (to protect the original GAS project from order wrangling).
  4. Update .clasp.json with script id from new project.
  5. Push project via clasp push.
  6. Open/refresh dupe(formerly blank) GAS project.

Specifications

Added Context

This is what my project looks like pre-push:

projectFileOrder

Here's a snippet of the filePushOrder taken from my .clasp.json file:

filePushOrderFromClaspJSON

BUT... here's what my project looks like post clasp push:

projectPostClaspPush

DimuDesigns commented 5 years ago

Decided to try clasp again in order to test out the filePushOrder feature. Doesn't seem to work as advertised.

PopGoesTheWza commented 5 years ago

@DimuDesigns are you using the latest npm release or building directly from this repository?

DimuDesigns commented 5 years ago

@PopGoesTheWza Latest NPM release.

PopGoesTheWza commented 5 years ago

A PR fixing this has been merged, so you can either wait until next release or build your own from this repository

clone this repository locally and run npm uninstall -g @google/clasp && npm run build-fresh

PopGoesTheWza commented 5 years ago

@DimuDesigns can you try with clasp 2.2.0 if the issue still occurs?

kornthing commented 4 years ago

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:

PopGoesTheWza commented 4 years ago

@DimuDesigns @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.

PopGoesTheWza commented 4 years ago

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.

PopGoesTheWza commented 4 years ago

@kornthing can you please give a status about this issue?

Spencer-Easton commented 3 years ago

If anyone is still having issues with this you need to remember to add the path to the file including the rootDir. For example a build folder such as: build-
server-

Would need to add 'build/server/' to the file name. { "scriptId":"123456789", "rootDir":"build", "filePushOrder": ["build/server/file2.js", "build/server/file1.js"] }

jpgklassen commented 2 years ago

Strangely enough, removing the rootDir value from .clasp.json solved this for me.

felimartina commented 3 months ago

Wow, removing rootDir fixed the issue. Thanks @jpgklassen