node-sass
Advanced tools
Comparing version 4.2.0 to 4.3.0
{ | ||
"name": "node-sass", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"libsass": "3.4.3", | ||
@@ -5,0 +5,0 @@ "description": "Wrapper around libsass", |
@@ -260,3 +260,3 @@ # node-sass | ||
`true` Enables the line number and file where a selector is defined to be emitted into the compiled CSS as a comment. Useful for debugging, especially when using imports and mixins. | ||
`true` Enables the line number and file where a selector is defined to be emitted into the compiled CSS as a comment. Useful for debugging, especially when using imports and mixins. | ||
@@ -355,3 +355,3 @@ ### sourceMap | ||
outFile: '/to/my/output.css', | ||
sourceMap: true, // or an absolute or relative (to outFile) path | ||
sourceMap: true, // or an absolute or relative (to outFile) path | ||
importer: function(url, prev, done) { | ||
@@ -466,3 +466,2 @@ // url is the path in import as is, which LibSass encountered. | ||
cd node-sass | ||
git submodule update --init --recursive | ||
npm install | ||
@@ -481,4 +480,4 @@ node scripts/build -f # use -d switch for debug release | ||
### Usage | ||
`node-sass [options] <input> [output]` | ||
Or: | ||
`node-sass [options] <input> [output]` | ||
Or: | ||
`cat <input> | node-sass > output` | ||
@@ -485,0 +484,0 @@ |
@@ -5,4 +5,3 @@ /*! | ||
var pkg = require('../package.json'), | ||
fs = require('fs'), | ||
var fs = require('fs'), | ||
mkdir = require('mkdirp'), | ||
@@ -54,108 +53,33 @@ path = require('path'), | ||
/** | ||
* manageProcess | ||
* Build | ||
* | ||
* @param {ChildProcess} proc | ||
* @param {Function} cb | ||
* @param {Object} options | ||
* @api private | ||
*/ | ||
function manageProcess(proc, cb) { | ||
var errorMsg = ''; | ||
proc.stderr.on('data', function(data) { | ||
errorMsg += data.toString(); | ||
}); | ||
proc.on('close', function(code) { | ||
cb(code === 0 ? null : { message: errorMsg }); | ||
}); | ||
} | ||
function build(options) { | ||
var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat( | ||
['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) { | ||
return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join(''); | ||
})).concat(options.args); | ||
/** | ||
* initSubmodules | ||
* | ||
* @param {Function} cb | ||
* @api private | ||
*/ | ||
console.log('Building:', [process.execPath].concat(args).join(' ')); | ||
function initSubmodules(cb) { | ||
console.log('Detected a git install'); | ||
console.log('Cloning LibSass into src/libsass'); | ||
var proc = spawn(process.execPath, args, { | ||
stdio: [0, 1, 2] | ||
}); | ||
var clone = spawn('git', ['clone', 'https://github.com/sass/libsass.git', './src/libsass']); | ||
manageProcess(clone, function(err) { | ||
if (err) { | ||
cb(err); | ||
proc.on('exit', function(errorCode) { | ||
if (!errorCode) { | ||
afterBuild(options); | ||
return; | ||
} | ||
console.log('Checking out LibSass to', pkg.libsass); | ||
var checkout = spawn('git', ['checkout', pkg.libsass], { cwd: './src/libsass' }); | ||
manageProcess(checkout, function(err) { | ||
cb(err); | ||
}); | ||
}); | ||
} | ||
/** | ||
* installGitDependencies | ||
* | ||
* @param {Function} cb | ||
* @api private | ||
*/ | ||
function installGitDependencies(options, cb) { | ||
var libsassPath = './src/libsass'; | ||
if (process.env.LIBSASS_EXT || options.libsassExt) { | ||
cb(); | ||
} else if (fs.access) { // node 0.12+, iojs 1.0.0+ | ||
fs.access(libsassPath, fs.R_OK, function(err) { | ||
err && err.code === 'ENOENT' ? initSubmodules(cb) : cb(); | ||
}); | ||
} else { // node < 0.12 | ||
fs.exists(libsassPath, function(exists) { | ||
exists ? cb() : initSubmodules(cb); | ||
}); | ||
} | ||
} | ||
/** | ||
* Build | ||
* | ||
* @param {Object} options | ||
* @api private | ||
*/ | ||
function build(options) { | ||
installGitDependencies(options, function(err) { | ||
if (err) { | ||
console.error(err.message); | ||
process.exit(1); | ||
if (errorCode === 127 ) { | ||
console.error('node-gyp not found!'); | ||
} else { | ||
console.error('Build failed with error code:', errorCode); | ||
} | ||
var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat( | ||
['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) { | ||
return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join(''); | ||
})).concat(options.args); | ||
console.log('Building:', [process.execPath].concat(args).join(' ')); | ||
var proc = spawn(process.execPath, args, { | ||
stdio: [0, 1, 2] | ||
}); | ||
proc.on('exit', function(errorCode) { | ||
if (!errorCode) { | ||
afterBuild(options); | ||
return; | ||
} | ||
if (errorCode === 127 ) { | ||
console.error('node-gyp not found!'); | ||
} else { | ||
console.error('Build failed with error code:', errorCode); | ||
} | ||
process.exit(1); | ||
}); | ||
process.exit(1); | ||
}); | ||
@@ -162,0 +86,0 @@ } |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
91
1715549
4580
577