Commit 6a10b922 by Adeel Mujahid

Merge pull request #717 from am11/build-fixes

Misc. improvements
parents b2d2b9a6 74ce9131
*.log
.DS_Store
.sass-cache
build
lib-cov
node_modules
vendor
test
language: node_js
env:
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler:
- gcc
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- "0.10"
- "0.12"
- iojs
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
allow_failures:
- node_js: iojs
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
- sudo apt-get update;
- sudo apt-get install gcc-4.8 g++-4.8;
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20;
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20;
- g++ --version;
- sudo apt-get update -qq;
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.8 g++-4.8
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success:
- npm run-script coverage
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
......
......@@ -5,14 +5,31 @@
* Add tests for it. This is important so I don't break it in a future version unintentionally.
* Send a pull request. Bonus points for topic branches.
## Reporting Sass compilation and syntax issues
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful, so thanks!
Guidelines for bug reports:
1. **Use the GitHub issue search** — check if the issue has already been
reported.
2. **Check if the issue has been fixed** — try to reproduce it using the
latest `master` branch in the repository.
3. **Isolate the problem** — ideally create an
[SSCCE](http://www.sscce.org/) and a live example.
The [libsass] library is not currently at feature parity with the 3.2 [Ruby Gem](https://github.com/nex3/sass) that most Sass users will use, and has little-to-no support for 3.3 syntax. While we try our best to maintain feature parity with [libsass], we can not enable features that have not been implemented in [libsass] yet.
If you'd like to see what features are still upcoming in [libsass], [Jo Liss](http://twitter.com/jo_liss) has written [a blog post on the subject](http://www.solitr.com/blog/2014/01/state-of-libsass/).
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? Do other browsers show the bug differently? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
Please check for [issues on the libsass repo](https://github.com/hcatlin/libsass/issues) (as there is a good chance that it may already be an issue there for it), and otherwise [create a new issue there](https://github.com/hcatlin/libsass/issues/new).
If you are facing binary related issues, please create a gist (see [Creating gists on GitHub](https://help.github.com/articles/creating-gists/)) with the output of this set of commands:
*nix: https://gist.github.com/am11/9f429c211822a9b15aee.
win: https://gist.github.com/am11/e5de3c49c219f0811e1d.
If this project is missing an API or command line flag that has been added to [libsass], then please open an issue here. We will then look at updating our [libsass] submodule and create a new release. You can help us create the new release by rebuilding binaries, and then creating a pull request to the [node-sass-binaries](https://github.com/sass/node-sass-binaries) repo.
[libsass]: https://github.com/hcatlin/libsass
## Reporting Sass compilation and syntax issues
Please check for [issues on the libsass repo](https://github.com/hcatlin/libsass/issues) (as there is a good chance that it may already be an issue there for it), and otherwise [create a new issue there](https://github.com/sass/libsass/issues/new).
[libsass]: https://github.com/sass/libsass
......@@ -232,14 +232,19 @@ console.log(result.stats);
### Version information (v2 change)
Both `node-sass` and `libsass` version info is now present in `package.json` and is exposed via `info()` method:
Both `node-sass` and `libsass` version info is now present in `package.json` and is exposed via `info` method:
```javascript
require('node-sass').info();
var sass = require('node-sass');
console.log(sass.info);
/*
it will output something like:
// outputs something like:
// node-sass version: 2.0.0-beta
// libsass version: 3.1.0-beta
node-sass 2.0.1 (Wrapper) [JavaScript]
libsass 3.1.0 (Sass Compiler) [C/C++]
*/
```
## Integrations
......@@ -329,6 +334,7 @@ Output will be saved with the same name as input SASS file into the current work
-o, --output Output directory
-x, --omit-source-map-url Omit source map URL comment from output
-i, --indented-syntax Treat data from stdin as sass code (versus scss)
-v, --version Prints version info
--output-style CSS output style (nested|expanded|compact|compressed)
--source-comments Include debug info in output
--source-map Emit source map
......
version: "{build}"
init:
- git config --global core.autocrlf input
build: off
environment:
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI: true
matrix:
# node.js
- nodejs_version: 0.10
- nodejs_version: 0.12
- nodejs_version: 0 # will fetch the latest node.js version
# io.js
- nodejs_version: "1.2"
- nodejs_version: 1 # will fetch the latest io.js version
install:
- ps: Install-Product node $env:nodejs_version
- cmd: SET PATH=C:\python27;%PATH%
- git submodule update --init --recursive
- ps: npm install --msvs_version=2013
- node --version
- npm --version
- git submodule update --init --recursive
- ps: npm install --msvs_version=2013
test_script:
- npm test
build: off
test_script: npm test
#!/usr/bin/env node
var Emitter = require('events').EventEmitter,
path = require('path'),
Gaze = require('gaze'),
meow = require('meow'),
stdin = require('get-stdin'),
grapher = require('sass-graph'),
render = require('../lib/render');
meow = require('meow'),
path = require('path'),
render = require('../lib/render'),
stdin = require('get-stdin');
/**
* Initialize CLI
......@@ -13,9 +13,8 @@ var Emitter = require('events').EventEmitter,
var cli = meow({
pkg: '../package.json',
version: process.sassInfo,
help: [
require('../lib/').info(),
'',
'Usage',
' node-sass [options] <input.scss> [output.css]',
' cat <input.scss> | node-sass > output.css',
......@@ -30,6 +29,7 @@ var cli = meow({
' -o, --output Output directory',
' -x, --omit-source-map-url Omit source map URL comment from output',
' -i, --indented-syntax Treat data from stdin as sass code (versus scss)',
' -v, --version Prints version info',
' --output-style CSS output style (nested|expanded|compact|compressed)',
' --source-comments Include debug info in output',
' --source-map Emit source map',
......@@ -56,12 +56,13 @@ var cli = meow({
'precision'
],
alias: {
c: 'source-comments',
i: 'indented-syntax',
o: 'output',
w: 'watch',
r: 'recursive',
x: 'omit-source-map-url',
c: 'source-comments',
r: 'recursive'
v: 'version',
w: 'watch'
},
default: {
'include-path': process.cwd(),
......
var fs = require('fs');
var eol = require('os').EOL,
fs = require('fs'),
package = require('../package.json');
/**
* Get Runtime Info
......@@ -28,10 +30,20 @@ function getRuntimeInfo() {
*/
function getBinaryIdentifiableName() {
var v8SemVersion = process.versions.v8.split('.').slice(0, 3).join('.');
return [process.platform, '-',
process.arch, '-',
process.versions.v8].join('');
v8SemVersion].join('');
}
function getSassInfo() {
return [
['node-sass', package.version, '(Wrapper)', '[JavaScript]'].join('\t'),
['libsass ', package.libsass, '(Sass Compiler)', '[C/C++]'].join('\t'),
].join(eol);
}
process.runtime = getRuntimeInfo();
process.sassInfo = getSassInfo();
process.sassBinaryName = getBinaryIdentifiableName();
......@@ -259,11 +259,4 @@ module.exports.renderSync = function(options) {
* @api public
*/
module.exports.info = function() {
var package = require('../package.json');
return [
'node-sass version: ' + package.version,
'libsass version: ' + package.libsass
].join('\n');
};
module.exports.info = process.sassInfo;
......@@ -43,16 +43,16 @@
"style"
],
"dependencies": {
"chalk": "^0.5.1",
"chalk": "^1.0.0",
"cross-spawn": "^0.2.6",
"gaze": "^0.5.1",
"get-stdin": "^4.0.1",
"meow": "^3.0.0",
"meow": "^3.1.0",
"mkdirp": "^0.5.0",
"mocha": "^2.1.0",
"nan": "^1.6.2",
"npmconf": "^2.1.1",
"object-assign": "^2.0.0",
"pangyp": "^2.1.0",
"request": "^2.53.0",
"sass-graph": "^1.0.3",
"shelljs": "^0.3.0"
......@@ -61,7 +61,7 @@
"coveralls": "^2.11.2",
"jscoverage": "^0.5.9",
"jshint": "^2.6.0",
"mocha-lcov-reporter": "^0.0.1",
"pangyp": "^2.1.0"
"mocha": "^2.1.0",
"mocha-lcov-reporter": "^0.0.2"
}
}
var fs = require('fs'),
path = require('path'),
spawn = require('child_process').spawn,
var eol = require('os').EOL,
fs = require('fs'),
mkdir = require('mkdirp'),
Mocha = require('mocha');
path = require('path'),
spawn = require('child_process').spawn;
require('../lib/extensions');
/**
......@@ -50,7 +50,7 @@ function afterBuild(options) {
*/
function build(options) {
var arguments = ['node_modules/pangyp/bin/node-gyp', 'rebuild'].concat(options.args);
var arguments = [path.join('node_modules', 'pangyp', 'bin', 'node-gyp'), 'rebuild'].concat(options.args);
console.log(['Building:', process.runtime.execPath].concat(arguments).join(' '));
......@@ -58,22 +58,14 @@ function build(options) {
stdio: [0, 1, 2]
});
proc.on('exit', function(code) {
if (code) {
if (code === 127) {
console.error([
'node-gyp not found! Please upgrade your install of npm!',
'You need at least 1.1.5 (I think) and preferably 1.1.30.'
].join(' '));
proc.on('exit', function(errorCode) {
if (!errorCode) {
afterBuild(options);
return;
}
console.error('Build failed');
return;
}
afterBuild(options);
console.error(errorCode === 127 ? 'node-gyp not found!' : 'Build failed');
});
}
......@@ -123,28 +115,19 @@ function testBinary(options) {
return build(options);
}
console.log('`' + process.sassBinaryName + '` exists; testing');
console.log('`' + process.sassBinaryName + '` exists; testing.');
var mocha = new Mocha({
ui: 'bdd',
timeout: 999999,
reporter: function() {}
});
mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js'));
mocha.grep(/should compile sass to css with file/).run(function (done) {
if (done !== 0) {
console.log([
'Problem with the binary.',
'Manual build incoming.',
'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.'
].join('\n'));
try {
require('../').renderSync({
data: 's: { a: ss }'
});
return build(options);
}
console.log('Binary is fine; exiting.');
} catch (e) {
console.log(['Problem with the binary.', 'Manual build incoming.'].join(eol));
console.log('Binary is fine; exiting');
});
return build(options);
}
});
}
......
......@@ -792,11 +792,16 @@ describe('api', function() {
});
describe('.info()', function() {
var package = require('../package.json'),
info = sass.info;
it('should return a correct version info', function(done) {
assert.equal(sass.info(), [
'node-sass version: ' + require('../package.json').version,
'libsass version: ' + require('../package.json').libsass
].join('\n'));
assert(info.indexOf(package.version) > 0);
assert(info.indexOf('(Wrapper)') > 0);
assert(info.indexOf('[JavaScript]') > 0);
assert(info.indexOf(package.libsass) > 0);
assert(info.indexOf('(Sass Compiler)') > 0);
assert(info.indexOf('[C/C++]') > 0);
done();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment