From e4725a50e3c39b55eddbce3a573456ac6323473f Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Mon, 6 Feb 2017 00:57:44 -0600 Subject: [PATCH] convert js-cookie dependency to an npm module --- app/assets/javascripts/application.js | 2 +- .../javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 | 2 +- app/assets/javascripts/merge_request_tabs.js.es6 | 2 +- package.json | 1 + spec/javascripts/test_bundle.js | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 4ecbf195b64..c9612784f9b 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,7 +20,7 @@ require('vendor/jquery.waitforimages'); require('vendor/jquery.caret'); require('vendor/jquery.atwho'); require('vendor/jquery.scrollTo'); -window.Cookies = require('vendor/js.cookie'); +window.Cookies = require('js-cookie'); require('./autosave'); require('bootstrap/js/affix'); require('bootstrap/js/alert'); diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 index c41c57c1dcd..dbdb01c8c68 100644 --- a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 +++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js.es6 @@ -3,7 +3,7 @@ /* global Flash */ window.Vue = require('vue'); -window.Cookies = require('vendor/js.cookie'); +window.Cookies = require('js-cookie'); function requireAll(context) { return context.keys().map(context); } requireAll(require.context('./svg', false, /^\.\/.*\.(js|es6)$/)); diff --git a/app/assets/javascripts/merge_request_tabs.js.es6 b/app/assets/javascripts/merge_request_tabs.js.es6 index 7540889bce6..cc049e00477 100644 --- a/app/assets/javascripts/merge_request_tabs.js.es6 +++ b/app/assets/javascripts/merge_request_tabs.js.es6 @@ -4,7 +4,7 @@ /* global Flash */ require('./breakpoints'); -window.Cookies = require('vendor/js.cookie'); +window.Cookies = require('js-cookie'); require('./flash'); /* eslint-disable max-len */ diff --git a/package.json b/package.json index 2ef6c599b84..24e11a4607f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "jquery": "2.2.1", "jquery-ui": "github:jquery/jquery-ui#1.11.4", "jquery-ujs": "1.2.1", + "js-cookie": "^2.1.3", "mousetrap": "1.4.6", "pikaday": "^1.5.1", "select2": "3.5.2-browserify", diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 7df8d2fd8b4..030d2de090a 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -7,7 +7,7 @@ jasmine.getJSONFixtures().fixturesPath = 'base/spec/javascripts/fixtures'; // include common libraries window.$ = window.jQuery = require('jquery'); window._ = require('underscore'); -window.Cookies = require('vendor/js.cookie'); +window.Cookies = require('js-cookie'); window.Vue = require('vue'); window.Vue.use(require('vue-resource')); require('jquery-ujs');