Less compiling results differ linux vs windows? - css

I have been contributing to a small open source project and found that when I used lessc (compiler) and prettier on windows 10 build 19043,
I got a significantly different result (final css file) than on ubuntu 20.04.
This google slides ([link][1]) documents the 2 intentional changes to the lessc file, then the 91 unintentional changes after running the compiler (resulting from lessc and prettier)
after running the exact same compile process on ubuntu, I got only the 2 intentional changes and nothing extra. My intentional changes are documented in a pull request here: [link][2]
These are the project dependencies from the .json file.
"devDependencies": {
"axios": ">=0.21.1",
"clean-css-cli": "^4.3.0",
"concurrently": "^5.3.0",
"less": "^3.13.1",
"less-watch-compiler": "^1.15.1",
"lessc": "^1.0.2",
"lite-server": "^2.6.1",
"minimist": "^1.2.3",
"node-less": "^1.0.0",
"object-path": ">=0.11.5",
"onchange": "^7.1.0",
"prettier": "^2.3.0"
Any idea why lessc or prettier would compile differently on linux vs windows? I am new to all this so forgive me if I've missed something obvious, thanks!
edit: I added 2 links, 1 for the windows errors and the 2nd with the correct linux output.
Thanks for the help!
[1]: https://docs.google.com/presentation/d/1dGjp5UEpkk4apojAtlNQg5hb2wktTKOgROU08sUN1OM/edit?usp=sharing
[2]: https://github.com/sButtons/sbuttons/pull/1397/commits/b1b1d6ddb3c15780e1fb3309fd637f3eec426106

Related

Error: Cannot find module “mongodb” after meteor upgrade to 1.6.1.1

edit - There is something strange: mongo appears in both package.json and in .meteor/packages files (should it appear in package.json at all?? it wasn't there before the update) but in different versions. here is my package.json:
{
"name": "something",
"version": "1.1.1",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"#babel/runtime": "^7.0.0-beta.49",
"babel-runtime": "^6.26.0",
"bootstrap": "^3.3.7",
"google-protobuf": "^3.5.0",
"grpc": "^1.12.2",
"grpc-tools": "^1.6.6",
"meteor-node-stubs": "^0.3.3",
**"mongodb": "^3.1.0-beta4",**
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-progressbar.js": "^0.2.0",
"react-router": "^3.2.1",
"react-router-dom": "^4.2.2"
}
}
and here is my .meteor/packages:
meteor-base#1.3.0 # Packages every Meteor app needs to have
mobile-experience#1.0.5 # Packages for a great mobile UX
**mongo#1.4.2 # The database Meteor supports right now**
blaze-html-templates#1.0.4 # Compile .html files into Meteor Blaze views
reactive-var#1.0.11 # Reactive variable for tracker
tracker#1.1.3 # Meteor's client-side reactive programming library
standard-minifier-css#1.4.0 # CSS minifier run for production mode
standard-minifier-js#2.3.1 # JS minifier run for production mode
es5-shim#4.7.0 # ECMAScript 5 compatibility for older browsers
ecmascript#0.10.6 # Enable ECMAScript2015+ syntax in app code
shell-server#0.3.1 # Server-side component of the `meteor shell` command
session#1.1.7
tarang:ssl
After updating to 1.6.1.1, my app won’t run, crashing with message 'Error: Cannot find module “mongodb” '.
Tried to run meteor npm install, even took away the entire node_modules folder and built it again.
Tried to run meteor npm update.
Tried to run meteor npm install mongodb.
Tried to downgrade back to version 1.6.0.1.
Still can’t find mongodb.
Important - mongodb is there, all collections are there - I can access it through the terminal with "meteor mongo".
Any help?
If it helps - The data in the db can be erased if there is no other way.
(running on ubuntu 16.04)
Thanks
In the end, the problem was not in the project but in meteor globally, so I uninstalled and re-installed meteor globally, and everything got back to normal…
Thank you all!

Why won't eslint-config-rallycoding work with create-react-app?

I'm using Atom and the linter-eslint npm package. I have installed the following dev dependencies:
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-rallycoding": "^3.2.0",
"eslint-plugin-react": "^7.4.0"
}
This is my .eslintrc file in order to use the eslint-config-rallycoding eslint rules:
{
"extends": "rallycoding"
}
When I open a file, the first line shows this message:
The eslint-config-rallycoding eslint rules work great with the React/Redux starter set that the same author made, so I'm thinking something isn't set up right to use with create-react-app?
The error message is incredibly vague though and I am not seeing any errors in the specified file.

how do you get the latest version of Polymer elements using bower?

I am experimenting with an asp.net core MVC web app using Polymer, and largely things seem to be going well. I used the now built in bower.json file to specify required packages (eg paper-fab), and they were dutifully installed. Nearly every time I could just use the package name and version from the appropriate Polymer catalogue page (example). But with a couple of the pages (paper-ripple and paper-card) bower can't find the specified version, so I tried the wildcard approach which resolved to a much earlier version. For paper-ripple it didn't seem to cause any problems, but paper-card just doesn't seem to work for me.
Here is my bower.json file:
{
"name": "asp.net",
"private": true,
"dependencies": {
"jquery": "2.2.0",
"jquery-validation": "1.14.0",
"jquery-validation-unobtrusive": "3.2.6",
"polymer": "1.4.0",
"PolymerElements/paper-material": "1.0.6",
"PolymerElements/iron-icons": "1.1.3",
"PolymerElements/iron-image": "1.2.5",
"PolymerElements/paper-button": "1.0.13",
"PolymerElements/paper-icon-button": "1.1.3",
"PolymerElements/app-layout": "0.10.4",
"PolymerElements/paper-header-panel": "1.1.6",
"PolymerElements/paper-toolbar": "1.1.7",
"PolymerElements/paper-drawer-panel": "1.0.10",
"PolymerElements/paper-fab": "1.2.1",
"PolymerElements/paper-item": "1.2.1",
"PolymerElements/paper-listbox": "1.1.2",
"PolymerElements/paper-ripple": "*",
"PolymerElements/paper-card": "*",
"normalize-css": "4.1.1"
},
"resolutions": {
"polymer": "^1.2.1",
"paper-ripple": "^1.0.0",
"font-roboto": "^1.0.1"
}
}
I know I could just download the latest versions from the catalogue, but I'd rather continue using bower if I can.
Of course it's always possible I am doing the cards wrong!
<link rel="import" href="~/lib/bower/paper-card/paper-card.html" />
<paper-material main elevation="0">
#for (int i = 0; i < 10; i++)
{
<paper-card heading="Card #i">
<div class="card-content">Some content #i</div>
</paper-card>
}
</paper-material>
The cards are just being output into the DOM like this (usually when using chrome dev tools I can see all the local DOM inside Polymer elements, but not in this case):
<paper-card heading="Card 0">
<div class="card-content">Some content 0</div>
</paper-card>
EDIT: Potential Workaround
So I have found that rather than directly editing the bower.json file in Visual Studio (which updates all your packages when saving), if I open up cmd in the same directory as the bower.json file and run bower commands from there I can install the versions shown in the Polymer catalog. For example bower install --save PolymerElements/paper-ripple which then updates the bower.json file accordingly. Perhaps this is the best way of doing it rather than relying editing it manually and relying on VS to update the packages?
If you want to install latest version on every bower install command you can add caret(^) to all your bower dependencies. Currently you have hard coded all the versions that needs to be used.
You can check out this answer for more details on bower versions

React-Native-Meteor update React-Native 0.33

I'm running a Meteor server and a React-Native client (working in iOS mainly for now). Since I updated to React-native 0.33 the MeteorListView Component throws the following error:
My 'UserDos' follows the example of InProgress-team/react-native-meteor. When replacing the MeteorListView with a regular ListView everything works fine. Is anyone experiences this issue or can pinpoint/direct me to solving the issue?
Version
"react": "^15.3.1",
"react-native": "^0.33.0",
"react-native-lock": "^0.4.0",
"react-native-meteor": "^1.0.0-rc15",
"react-native-scrollable-tab-view": "^0.6.0",
"react-redux": "^4.4.5",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0",
Fixed by reinstalling macOS and fresh install of React-native and dependances. Bit extreme solution but probably some complications with development version and upgrades; did the trick though!

Installing grunt on Openshift (without Node cartridge)

I would like to install grunt and grunt-cli to my OpenShift deployment (which is a Python 2.7 cartridge).
I have created a package.json file as follows:
{
"author": "--",
"name": "--",
"version": "0.3.0",
"homepage": "--",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli" : "~0.1.13",
"grunt-contrib-uglify": "~0.5.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-html2js": "^0.2.9",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-index-html-template": "^0.2.5",
"grunt-contrib-watch": "^0.6.1"
}
}
However, after SSHing into the server post deployment, grunt is not installed. My questions are:
requirements.json is more of a Node thing. Therefore, is it that OpenShift ignores this file because I am not using Node (even though NPM is installed).
If 1 is correct, how do I go about installing grunt? (I've tried running 'npm install -g grunt' both via SSH and in an action hook script, but the fails due to lack or permissions).
This guy had the same issue (Can I run Grunt/Gulp on my PHP 5.4 cartridge?) but I couldn't find what I needed in the answer.
Any suggestions?
you'll need to run scl enable nodejs010 in your ./action-hook/start command to enable a specific software collection in your gear. Hopefully that helps!

Resources