New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grunt-google-cdn

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-google-cdn - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

.npmignore

11

Gruntfile.js

@@ -14,10 +14,15 @@ 'use strict';

]
},
nodeunit: {
tests: ['test/*_test.js']
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadTasks('tasks');
grunt.registerTask('default', ['jshint']);
grunt.registerTask('test', ['nodeunit']);
grunt.registerTask('default', ['jshint', 'test']);
};

@@ -0,1 +1,2 @@

'use strict';
var replacements = exports.replacements = {};

@@ -22,3 +23,3 @@ var versions = exports.versions = {};

replacements[item] = {
from: 'components/' + item + '/' + item + '.js',
from: item + '/' + item + '.js',
to: function (version) {

@@ -36,4 +37,4 @@ return '//ajax.googleapis.com/ajax/libs/angularjs/' + version + '/' + item + '.min.js';

versions.jquery = ['2.0.0', '1.9.1', '1.9.0', '1.8.3', '1.8.2', '1.8.1', '1.8.0', '1.7.2', '1.7.1', '1.7.0', '1.6.4', '1.6.3', '1.6.2', '1.6.1', '1.6.0', '1.5.2', '1.5.1', '1.5.0', '1.4.4', '1.4.3', '1.4.2', '1.4.1', '1.4.0', '1.3.2', '1.3.1', '1.3.0', '1.2.6', '1.2.3'];
replacements['jquery'] = {
from: 'components/jquery/jquery.js',
replacements.jquery = {
from: 'jquery/jquery.js',
to: function (version) {

@@ -40,0 +41,0 @@ return '//ajax.googleapis.com/ajax/libs/jquery/' + version + '/jquery.min.js';

{
"name": "grunt-google-cdn",
"version": "0.1.4",
"version": "0.2.0",
"description": "Grunt task for replacing refs to resources on the Google CDN",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "grunt test"
},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-jshint": "~0.1.1"
"grunt-contrib-jshint": "~0.4.3",
"proxyquire": "~0.4.1",
"grunt-contrib-nodeunit": "~0.1.2"
},
"dependencies": {
"semver": "~1.1.3",
"bower": "~0.9.2"
},
"repository": {

@@ -23,6 +29,3 @@ "type": "git",

"author": "Brian Ford",
"license": "BSD",
"dependencies": {
"semver": "~1.1.3"
}
"license": "BSD"
}

@@ -1,5 +0,63 @@

# grunt-google-cdn
Grunt task for replacing refs to resources on the Google CDN
# grunt-google-cdn [![Build Status](https://travis-ci.org/btford/grunt-google-cdn.png)](https://travis-ci.org/btford/grunt-google-cdn)
Grunt task for replacing refs to resources on the Google CDN
## Getting Started
This plugin requires Grunt `~0.4.0`
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-google-cdn
```
It manages dependencies using [Bower](http://bower.io/), be sure to have it installed, and a bower.json/component.json in your project.
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
grunt.loadNpmTasks('grunt-google-cdn');
```
Run this task with the `grunt cdnify` command.
### Configuration
Within your Gruntfile.js file, you need to specify the html directory that contains the html referencing your CDN files.
```js
cdnify: {
dist: {
html: ['app/*.html']
}
}
```
You will need a valid bower.json/component.json file in your project, that has dependencies and a version listed accordingly
```json
{
"name": "myAwesomeApp",
"version": "0.0.1",
"dependencies": {
"rsvp": "*",
"carve": ">=0.0.1",
"es5-shim": "~2.0.8",
"optimist" : "0.2.x"
}
```
If any updates are found, it will go through the files you specified, updating any references to those scripts.
## Release History
* 2013-04-24   v0.1.4   removed the extra s in component.json
* 2013-04-22   v0.1.3   Made 'components.json' configurable via bowerrc, added unstable AngularJS and jQuery 2.0.0
* 2013-04-07   v0.1.2   update available AngularJS versions, add .jshintrc
* 2013-02-24   v0.1.0   add support for versions, hositing to avoid conflicts with usemin
* 2013-02-18   v0.0.1   Initial Commit
---
## License
BSD
'use strict';
var semver = require('semver');
var fs = require('fs');
var hoist = require('../util/hoist.js');
var hoist = require('../util/hoist');
var bower = require('../util/bower');

@@ -16,22 +16,6 @@

function readBowerJson() {
var bowerrc = {};
var componentsFilename;
// Read bowerrc first, if present
if (fs.existsSync('.bowerrc')) {
bowerrc = grunt.file.readJSON('.bowerrc');
}
// If bowerrc defines a 'json' attribute, use that
componentsFilename = bowerrc.json || 'component.json';
return grunt.file.readJSON(componentsFilename);
}
grunt.registerMultiTask('cdnify', 'replace scripts with refs to the Google CDN', function () {
var options = this.options();
// collect files
var files = grunt.file.expand({ filter: 'isFile' }, this.data.html);
var dest = options.dest;
var compJson = readBowerJson();
var compJson = bower.readJson(grunt);

@@ -53,2 +37,3 @@ grunt.log

var versionStr = compJson.dependencies[name] || compJson.devDependencies[name];
var from;
if (!versionStr) {

@@ -59,3 +44,4 @@ return;

if (version) {
content = content.replace(rep.from, rep.to(version));
from = bower.joinComponent(rep.from);
content = content.replace(from, rep.to(version));
}

@@ -62,0 +48,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc