Skip to content

Commit

Permalink
build: Move jQuery from Bower to NPM
Browse files Browse the repository at this point in the history
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 Nov 23, 2017
1 parent 365e1c8 commit a7aea32
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
32 changes: 22 additions & 10 deletions Gruntfile.coffee
Expand Up @@ -93,6 +93,7 @@ module.exports = (grunt) ->
"Only needed when the repo is first cloned" "Only needed when the repo is first cloned"
[ [
# "modernizr" # "modernizr"
"wget:jqueryOldIE"
] ]
) )


Expand Down Expand Up @@ -308,8 +309,8 @@ module.exports = (grunt) ->
pkg: @file.readJSON "package.json" pkg: @file.readJSON "package.json"
coreDist: "dist/wet-boew" coreDist: "dist/wet-boew"
themeDist: "dist/theme-wet-boew" themeDist: "dist/theme-wet-boew"
jqueryVersion: @file.readJSON "lib/jquery/bower.json" jqueryVersion: "<%= pkg.devDependencies.jquery %>"
jqueryOldIEVersion: @file.readJSON "lib/jquery-oldIE/bower.json" jqueryOldIEVersion: "1.11.1"
MathJaxVersion: @file.readJSON "lib/MathJax/.bower.json" 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" + 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 */" " * v<%= pkg.version %> - " + "<%= grunt.template.today('yyyy-mm-dd') %>\n *\n */"
Expand Down Expand Up @@ -352,6 +353,17 @@ module.exports = (grunt) ->
src: "https://docs.google.com/spreadsheets/d/<%= i18nGDocsID %>/export?gid=<%= i18nGDocsSheet %>&format=csv" src: "https://docs.google.com/spreadsheets/d/<%= i18nGDocsID %>/export?gid=<%= i18nGDocsSheet %>&format=csv"
dest: "src/i18n/i18n.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: concat:
options: options:
banner: "<%= banner %><%= modernizrBanner %>" banner: "<%= banner %><%= modernizrBanner %>"
Expand Down Expand Up @@ -468,8 +480,8 @@ module.exports = (grunt) ->
layout: "default.hbs" layout: "default.hbs"
environment: environment:
root: "/v4.0-ci/unmin" root: "/v4.0-ci/unmin"
jqueryVersion: "<%= jqueryVersion.version %>" jqueryVersion: "<%= jqueryVersion %>"
jqueryOldIEVersion: "<%= jqueryOldIEVersion.version %>" jqueryOldIEVersion: "<%= jqueryOldIEVersion %>"
assets: "dist/unmin" assets: "dist/unmin"


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


"gh-pages": "gh-pages":
options: options:
Expand Down
2 changes: 0 additions & 2 deletions bower.json
Expand Up @@ -28,8 +28,6 @@
"flot": "0.8.3", "flot": "0.8.3",
"google-code-prettify": "1.0.4", "google-code-prettify": "1.0.4",
"html5shiv": "3.7.2", "html5shiv": "3.7.2",
"jquery": "2.1.4",
"jquery-oldIE": "jquery#1.11.1",
"jquery-pjax": "1.9.6", "jquery-pjax": "1.9.6",
"jquery-validation": "1.15.1", "jquery-validation": "1.15.1",
"magnific-popup": "https://github.com/wet-boew/Magnific-Popup.git#1.0.0+keyboard_trap_fix", "magnific-popup": "https://github.com/wet-boew/Magnific-Popup.git#1.0.0+keyboard_trap_fix",
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -63,6 +63,7 @@
"grunt-string-replace": "^1.3.1", "grunt-string-replace": "^1.3.1",
"grunt-wet-boew-postbuild": "^0.1.3", "grunt-wet-boew-postbuild": "^0.1.3",
"grunt-wget": "~0.1.0", "grunt-wget": "~0.1.0",
"jquery": "2.1.4",
"load-grunt-tasks": "^3.2.0", "load-grunt-tasks": "^3.2.0",
"mocha": "^1.21.5", "mocha": "^1.21.5",
"sinon": "~1.12.2", "sinon": "~1.12.2",
Expand Down
2 changes: 1 addition & 1 deletion site/includes/servermessageresources.hbs
Expand Up @@ -5,7 +5,7 @@
<!--[if lt IE 9]> <!--[if lt IE 9]>
<link href="{{assets}}/../{{site.theme}}/assets/favicon.ico" rel="shortcut icon" /> <link href="{{assets}}/../{{site.theme}}/assets/favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="{{assets}}/../{{site.theme}}/css/ie8-theme-srv.css" /> <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> <script src="{{assets}}/../wet-boew/js/ie8-wet-boew.js"></script>
<![endif]--> <![endif]-->


Expand Down

0 comments on commit a7aea32

Please sign in to comment.