Skip to content
Permalink
Browse files

build: Move jQuery from Bower to NPM

Since we can’t have multiple versions for 1.x and 2.x in the
package.json, the legacy 1.x is handled by downloading it into the old
location with wget.
Fixed the server message template not using the correct version

mmend
  • Loading branch information...
nschonni committed Sep 15, 2017
1 parent 365e1c8 commit a7aea322ed48e2e95138bc5069f8e15c29945a31
Showing with 30 additions and 13 deletions.
  1. +22 −10 Gruntfile.coffee
  2. +0 −2 bower.json
  3. +6 −0 package-lock.json
  4. +1 −0 package.json
  5. +1 −1 site/includes/servermessageresources.hbs
@@ -93,6 +93,7 @@ module.exports = (grunt) ->
"Only needed when the repo is first cloned"
[
# "modernizr"
"wget:jqueryOldIE"
]
)

@@ -308,8 +309,8 @@ module.exports = (grunt) ->
pkg: @file.readJSON "package.json"
coreDist: "dist/wet-boew"
themeDist: "dist/theme-wet-boew"
jqueryVersion: @file.readJSON "lib/jquery/bower.json"
jqueryOldIEVersion: @file.readJSON "lib/jquery-oldIE/bower.json"
jqueryVersion: "<%= pkg.devDependencies.jquery %>"
jqueryOldIEVersion: "1.11.1"
MathJaxVersion: @file.readJSON "lib/MathJax/.bower.json"
banner: "/*!\n * Web Experience Toolkit (WET) / Boîte à outils de l'expérience Web (BOEW)\n * wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html\n" +
" * v<%= pkg.version %> - " + "<%= grunt.template.today('yyyy-mm-dd') %>\n *\n */"
@@ -352,6 +353,17 @@ module.exports = (grunt) ->
src: "https://docs.google.com/spreadsheets/d/<%= i18nGDocsID %>/export?gid=<%= i18nGDocsSheet %>&format=csv"
dest: "src/i18n/i18n.csv"

jqueryOldIE:
options:
baseUrl: "https://ajax.googleapis.com/ajax/libs/jquery/<%= jqueryOldIEVersion %>/"
overwrite: true
src: [
"jquery.js"
"jquery.min.js"
"jquery.min.map"
]
dest: "lib/jquery-oldIE"

concat:
options:
banner: "<%= banner %><%= modernizrBanner %>"
@@ -468,8 +480,8 @@ module.exports = (grunt) ->
layout: "default.hbs"
environment:
root: "/v4.0-ci/unmin"
jqueryVersion: "<%= jqueryVersion.version %>"
jqueryOldIEVersion: "<%= jqueryOldIEVersion.version %>"
jqueryVersion: "<%= jqueryVersion %>"
jqueryOldIEVersion: "<%= jqueryOldIEVersion %>"
assets: "dist/unmin"

theme:
@@ -1076,14 +1088,14 @@ module.exports = (grunt) ->
dest: "<%= coreDist %>/js/MathJax/"
expand: true
,
cwd: "lib/jquery/dist"
cwd: "node_modules/jquery/dist"
src: "*.*"
dest: "<%= coreDist %>/js/jquery/<%= jqueryVersion.version %>"
dest: "<%= coreDist %>/js/jquery/<%= jqueryVersion %>"
expand: true
,
cwd: "lib/jquery-oldIE/dist"
src: "*.*"
dest: "<%= coreDist %>/js/jquery/<%= jqueryOldIEVersion.version %>"
dest: "<%= coreDist %>/js/jquery/<%= jqueryOldIEVersion %>"
expand: true
,
cwd: "src"
@@ -1234,8 +1246,8 @@ module.exports = (grunt) ->
js:
files: "<%= eslint.all.src %>"
tasks: [
"js"
"string-replace"
"js"
"string-replace"
]
css:
files: [
@@ -1354,7 +1366,7 @@ module.exports = (grunt) ->
replacements: [
pattern: 'BOWER_VERSION_MATHJAX'
replacement: '<%= MathJaxVersion.version %>'
]
]

"gh-pages":
options:
@@ -28,8 +28,6 @@
"flot": "0.8.3",
"google-code-prettify": "1.0.4",
"html5shiv": "3.7.2",
"jquery": "2.1.4",
"jquery-oldIE": "jquery#1.11.1",
"jquery-pjax": "1.9.6",
"jquery-validation": "1.15.1",
"magnific-popup": "https://github.com/wet-boew/Magnific-Popup.git#1.0.0+keyboard_trap_fix",

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -63,6 +63,7 @@
"grunt-string-replace": "^1.3.1",
"grunt-wet-boew-postbuild": "^0.1.3",
"grunt-wget": "~0.1.0",
"jquery": "2.1.4",
"load-grunt-tasks": "^3.2.0",
"mocha": "^1.21.5",
"sinon": "~1.12.2",
@@ -5,7 +5,7 @@
<!--[if lt IE 9]>
<link href="{{assets}}/../{{site.theme}}/assets/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="{{assets}}/../{{site.theme}}/css/ie8-theme-srv.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/{{environment.jqueryOldIEVersion}}/jquery.js"></script>
<script src="{{assets}}/../wet-boew/js/ie8-wet-boew.js"></script>
<![endif]-->

0 comments on commit a7aea32

Please sign in to comment.
You can’t perform that action at this time.