core icon indicating copy to clipboard operation
core copied to clipboard

Gulp Failing for users on Windows

Open Dwaynekj opened this issue 8 years ago • 5 comments

Dwaynekj avatar Mar 23 '17 14:03 Dwaynekj

See https://github.com/openfin/fin-hypergrid/issues/330#issuecomment-288723925 and https://github.com/openfin/fin-hypergrid/issues/530#issuecomment-287794114

Dwaynekj avatar Mar 23 '17 14:03 Dwaynekj

Simple fix for windows users. The issue has to be with the way css-templates is interpreting the strings on windows. Not sure what the reason is but here is the steps to a workaround:

-usual npm install -gulp build -tests will fail, but you can see the syntax in the css/index.js is the issue

  • fix the css so the strings are on one line:

'.hypergrid-container {', ' position: relative;', ' height: 500px;', '}', '.hypergrid-container > div:first-child {', ' position: absolute;', ' left: 0;', ' top: 0;', ' right: 0;', ' bottom: 0;', '}', '.hypergrid-container > div:first-child > div.info {', ' position: absolute;', ' display: none; /* initially hidden */', ' margin-top: 150px; /* to place below headers */', ' color: #eee;', ' text-shadow: 1px 1px #ccc;', ' font-size: 36pt;', ' font-weight: bold;', ' text-align: center;', ' top: 0; right: 0; bottom: 0; left: 0;', '}', '.hypergrid-textfield {', ' position: absolute;', ' font-size: 12px;', ' color: black;', ' background-color: ivory;', ' box-sizing: border-box;', ' margin: 0;', ' padding: 0 5px;', ' border: 0; /*border: 1px solid #777;*/', ' outline: 0;', '}', '', ''

  • comment out 'css-templates' from the gulpfile.js 'build' task
  • gulp build
  • good to go

jlazar avatar Apr 05 '17 18:04 jlazar

@jlazar Thanks for pointing this out! This will be very helpful

Dwaynekj avatar Apr 05 '17 19:04 Dwaynekj

Seems to be that in downloading it as a ZIP and doing an npm install only, the css-template format is correct on Windows. Cloning with git and doing a npm/gulp build causes the css-template to put commas on a new line with index.js as well as carriage returns, causing for the error to occur.

Editing the template function on gulp file.js doesn’t seem to fix the issue, but the solution above fixes the build. The Hypergrid team will look to incorporate the above fix with the css as a permanent fix for this issue.

pjsenthilkumar avatar Jun 28 '17 20:06 pjsenthilkumar

@pjsenthilkumar Good find. Yea, this file rarely changes, lets make @jlazar comment (making it one line and removing the test) and bundle that into a PR. Also let add a comment at the top of the file linking to this ticket explaining why its one line.

Dwaynekj avatar Jun 29 '17 11:06 Dwaynekj