clasp icon indicating copy to clipboard operation
clasp copied to clipboard

File push order seems to be broken

Open DimuDesigns opened this issue 5 years ago • 12 comments

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

  • Node version 10.15.0:
  • Version 2.1.0:
  • OS (Mac/Linux/Windows):

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 avatar May 21 '19 22:05 DimuDesigns

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

DimuDesigns avatar May 21 '19 22:05 DimuDesigns

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

PopGoesTheWza avatar May 21 '19 23:05 PopGoesTheWza

@PopGoesTheWza Latest NPM release.

DimuDesigns avatar May 22 '19 00:05 DimuDesigns

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 avatar May 22 '19 06:05 PopGoesTheWza

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

PopGoesTheWza avatar Jul 03 '19 20:07 PopGoesTheWza

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:

kornthing avatar Jan 18 '20 17:01 kornthing

@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 avatar Jan 20 '20 17:01 PopGoesTheWza

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 avatar Jan 20 '20 19:01 PopGoesTheWza

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

PopGoesTheWza avatar Feb 22 '20 01:02 PopGoesTheWza

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-
- file1.js -file2.js

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

Spencer-Easton avatar Apr 14 '21 18:04 Spencer-Easton

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

jpgklassen avatar Jul 30 '22 17:07 jpgklassen