adaptivejs
Advanced tools
Comparing version 0.1.19 to 0.1.20
{ | ||
"name": "adaptivejs", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "A framework for creating adaptive websites.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -43,2 +43,61 @@ var path = require("path"); | ||
grunt.registerTask('adaptive:build-zepto', function() { | ||
var path = require('path'); | ||
var done = this.async(); | ||
var envCopy = {}; | ||
var directory = path.join(process.cwd(), 'bower_components/zeptojs'); | ||
// Copy env variables and add proper zepto modules to build | ||
for (var varName in process.env) { | ||
envCopy[varName] = process.env[varName]; | ||
} | ||
var modules = grunt.option('modules') || 'zepto event ajax form fx'; | ||
envCopy.MODULES = modules; | ||
grunt.log.write('Building Zepto with the following modules: ' + modules); | ||
var installOptions = { | ||
cmd: 'npm', | ||
args: ['install'], | ||
opts: { | ||
cwd: directory, | ||
} | ||
}; | ||
var buildOptions = { | ||
cmd: 'npm', | ||
args: ['run-script', 'dist'], | ||
opts: { | ||
cwd: directory, | ||
env: envCopy | ||
} | ||
}; | ||
// First, do an `npm install` in the Zepto directory | ||
grunt.util.spawn(installOptions, function(error, result, code) { | ||
if (error) { | ||
grunt.log.error(error); | ||
done(); | ||
} | ||
grunt.log.write(result); | ||
// Then, build zepto! | ||
grunt.util.spawn(buildOptions, function(error, result, code) { | ||
if (error) { | ||
grunt.log.error(error); | ||
done(); | ||
} | ||
grunt.log.write(result); | ||
['.js', '.min.js'].forEach(function(extension) { | ||
var src = path.join(directory, 'dist/zepto' + extension); | ||
var dest = path.join(process.cwd(), 'vendor', 'zepto' + extension); | ||
grunt.file.copy(src, dest); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
// restore cwd | ||
@@ -45,0 +104,0 @@ process.chdir(parentcwd); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142961
3166
6