migrate backbone and underscore to npm and refactored test modules

This commit is contained in:
Mike Ng
2018-01-19 15:03:00 +04:00
parent 802c52d7ff
commit 374f8eaff4
13 changed files with 42 additions and 41 deletions

View File

@@ -2,12 +2,13 @@
"name": "Phraseanet", "name": "Phraseanet",
"version": "4.0.0", "version": "4.0.0",
"dependencies": { "dependencies": {
"underscore-amd": "~1.4",
"alchemy-embed-medias": "~0.3.4", "alchemy-embed-medias": "~0.3.4",
"i18next": "~1.6", "i18next": "~1.6"
"backbone-amd": "~1.0"
}, },
"resolutions": { "resolutions": {
"jquery": "~1.11.3" "jquery": "~1.11.3"
},
"devDependencies": {
"qunit": "v1.11.0"
} }
} }

View File

@@ -5,6 +5,7 @@
"bower": "^1.6.5", "bower": "^1.6.5",
"bower-files": "^3.11.3", "bower-files": "^3.11.3",
"browser-sync": "^2.10.0", "browser-sync": "^2.10.0",
"chai": "^1.6.1",
"del": "^2.1.0", "del": "^2.1.0",
"fs": "0.0.2", "fs": "0.0.2",
"gulp": "^3.9.0", "gulp": "^3.9.0",
@@ -21,15 +22,16 @@
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5", "gulp-watch": "^4.3.5",
"jake": "latest", "jake": "latest",
"path": "^0.12.7",
"tmp": "0.0.23",
"wrench": "^1.5.8",
"chai": "^1.6.1",
"js-fixtures": "^1.5.3", "js-fixtures": "^1.5.3",
"mocha": "^4.1.0", "mocha": "^4.1.0",
"path": "^0.12.7",
"qunit": "^1.0.0",
"qunitjs": "https://github.com/qunitjs/qunit/archive/v1.11.0.tar.gz",
"sinon": "^1.17.7", "sinon": "^1.17.7",
"sinon-chai": "^2.5.0", "sinon-chai": "^2.5.0",
"squire": "^1.1.8" "squirejs": "^0.2.1",
"tmp": "0.0.23",
"wrench": "^1.5.8"
}, },
"engines": { "engines": {
"node": ">=5.8" "node": ">=5.8"
@@ -43,7 +45,7 @@
"dependencies": { "dependencies": {
"JSON2": "^0.1.0", "JSON2": "^0.1.0",
"alchemy-embed-medias": "^0.4.4", "alchemy-embed-medias": "^0.4.4",
"backbone": "^1.0.0", "backbone": "^1.3.3",
"blueimp-file-upload": "^8.3.0", "blueimp-file-upload": "^8.3.0",
"blueimp-load-image": "^2.17.1", "blueimp-load-image": "^2.17.1",
"bootstrap-multiselect": "^0.9.13", "bootstrap-multiselect": "^0.9.13",
@@ -53,8 +55,7 @@
"geonames-server-jquery-plugin": "^0.2.2", "geonames-server-jquery-plugin": "^0.2.2",
"html5shiv": "^3.7.3", "html5shiv": "^3.7.3",
"humane-js": "^3.0.6", "humane-js": "^3.0.6",
"i18next": "^1.10.6", "jquery": "^3.2.1",
"jquery": "^1.11.3",
"jquery-lazyload": "^1.9.7", "jquery-lazyload": "^1.9.7",
"jquery-mobile": "^1.5.0-alpha.1", "jquery-mobile": "^1.5.0-alpha.1",
"jquery-simplecolorpicker": "^0.3.1", "jquery-simplecolorpicker": "^0.3.1",
@@ -67,10 +68,9 @@
"normalize-css": "^2.1.0", "normalize-css": "^2.1.0",
"npm": "^5.6.0", "npm": "^5.6.0",
"phraseanet-production-client": "^0.32.3", "phraseanet-production-client": "^0.32.3",
"qunit": "^1.0.0",
"requirejs": "^2.1.22", "requirejs": "^2.1.22",
"tinymce": "^4.0.28", "tinymce": "^4.0.28",
"underscore": "^1.4.4", "underscore": "^1.8.3",
"zxcvbn": "git+https://github.com/lowe/zxcvbn.git" "zxcvbn": "git+https://github.com/lowe/zxcvbn.git"
} }
} }

View File

@@ -15,7 +15,7 @@ gulp.task('build-admin-css', function(){
gulp.task('build-admin-js', function(){ gulp.task('build-admin-js', function(){
var adminGroup = [ var adminGroup = [
config.paths.vendors + 'underscore-amd/underscore.js', config.paths.nodes + 'underscore/underscore.js',
config.paths.nodes + 'jquery-treeview/jquery.treeview.js', config.paths.nodes + 'jquery-treeview/jquery.treeview.js',
// config.paths.vendors + 'jquery-file-upload/js/vendor/jquery.ui.widget.js', // config.paths.vendors + 'jquery-file-upload/js/vendor/jquery.ui.widget.js',
// config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js', // config.paths.vendors + 'jquery-file-upload/js/jquery.iframe-transport.js',

View File

@@ -7,11 +7,11 @@ var utils = require('../../utils.js');
gulp.task('build-underscore', function(){ gulp.task('build-underscore', function(){
return utils.buildJsGroup([ return utils.buildJsGroup([
config.paths.vendors + 'underscore-amd/underscore.js' config.paths.nodes + 'underscore/underscore.js'
], 'underscore', 'vendors/underscore'); ], 'underscore', 'vendors/underscore');
}); });
gulp.task('build-backbone', ['build-underscore'], function(){ gulp.task('build-backbone', ['build-underscore'], function(){
return utils.buildJsGroup([ return utils.buildJsGroup([
config.paths.vendors + 'backbone-amd/backbone.js' config.paths.nodes + 'backbone/backbone.js'
], 'backbone', 'vendors/backbone'); ], 'backbone', 'vendors/backbone');
}); });

View File

@@ -4,9 +4,9 @@
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../../../../../www/assets/vendors/jquery/jquery.js"></script> <script src="../../../../../www/assets/vendors/jquery/jquery.js"></script>
<script src="../../../../../www/bower_components/qunit/qunit/qunit.js"></script> <script src="../../../../../node_modules/qunitjs/qunit/qunit/qunit.js"></script>
<script src="../jquery.Edit.js"></script> <script src="../jquery.Edit.js"></script>
<link type="text/css" rel="stylesheet" href="../../../../../www/bower_components/qunit/qunit/qunit.css"/> <link type="text/css" rel="stylesheet" href="../../../../../node_modules/qunitjs/qunit/qunit.css"/>
<script> $(document).ready(function(){ <script> $(document).ready(function(){
// disable log messages in tests // disable log messages in tests

View File

@@ -4,9 +4,9 @@
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../../../../../www/assets/vendors/jquery/jquery.js"></script> <script src="../../../../../www/assets/vendors/jquery/jquery.js"></script>
<script src="../../../../../www/bower_components/qunit/qunit/qunit.js"></script> <script src="../../../../../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../jquery.Selection.js"></script> <script src="../jquery.Selection.js"></script>
<link type="text/css" rel="stylesheet" href="../../../../../www/bower_components/qunit/qunit/qunit.css"/> <link type="text/css" rel="stylesheet" href="../../../../../node_modules/qunitjs/qunit/qunit.css"/>
<script> $(document).ready(function(){ <script> $(document).ready(function(){

View File

@@ -5,10 +5,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../../../../../www/assets/vendors/jquery/jquery.js"></script> <script src="../../../../../www/assets/vendors/jquery/jquery.js"></script>
<script src="../../../../../www/assets/vendors/jquery-ui/jquery-ui.js"></script> <script src="../../../../../www/assets/vendors/jquery-ui/jquery-ui.js"></script>
<script src="../../../../../www/bower_components/qunit/qunit/qunit.js"></script> <script src="../../../../../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../../../../../www/assets/vendors/blueimp-load-image/load-image.js"></script> <script src="../../../../../www/assets/vendors/blueimp-load-image/load-image.js"></script>
<script src="../components/upload/jquery.Upload.js"></script> <script src="../components/upload/jquery.Upload.js"></script>
<link type="text/css" rel="stylesheet" href="../../../../../www/bower_components/qunit/qunit/qunit.css"/> <link type="text/css" rel="stylesheet" href="../../../../../node_modules/qunitjs/qunit/qunit.css"/>
<script> $(document).ready(function(){ <script> $(document).ready(function(){
var getUploadManager = function(){ var getUploadManager = function(){

View File

@@ -9,20 +9,20 @@
<form id="dashboard-form" class="form-inline" method="GET" action="{{ path("report_dashboard") }}"> <form id="dashboard-form" class="form-inline" method="GET" action="{{ path("report_dashboard") }}">
<label for="dminDash" style="color:#eee">{{ "from"|trans|title }}</label> <label for="dminDash" style="color:#eee">{{ "from"|trans|title }}</label>
<div class="input-prepend"> <div class="input-prepend">
<span class="add-on"><i class="icon icon-calendar"></i></span> <span class="add-on"><i class="icon fa fa-calendar" aria-hidden="true"></i></span>
<input id="dminDash" name="dmin" style="font-size: 14px;width:220px;" size="10" type="text" placeholder="{{ "from"|trans }}" value="{{ "-1 month"|date("Y-m-d") }}"> <input id="dminDash" name="dmin" style="font-size: 14px;width:220px;" size="10" type="text" placeholder="{{ "from"|trans }}" value="{{ "-1 month"|date("Y-m-d") }}">
</div> </div>
<label for="dmaxDash" style="color:#eee">{{ "to"|trans|title }}</label> <label for="dmaxDash" style="color:#eee">{{ "to"|trans|title }}</label>
<div class="input-prepend"> <div class="input-prepend">
to to
<span class="add-on"><i class="icon icon-calendar"></i></span> <span class="add-on"><i class="icon fa fa-calendar" aria-hidden="true"></i></span>
<input id="dmaxDash" name="dmax" style="font-size: 14px;width:220px;" size="10" type="text" placeholder="{{ "to"|trans }}" value="{{ "now"|date("Y-m-d") }}"> <input id="dmaxDash" name="dmax" style="font-size: 14px;width:220px;" size="10" type="text" placeholder="{{ "to"|trans }}" value="{{ "now"|date("Y-m-d") }}">
</div> </div>
<button class="btn submit-dashboard" type="button">{{ "Generate" | trans }}</button> <button class="btn submit-dashboard" type="button">{{ "Generate" | trans }}</button>
</form> </form>
<div> <div>
<span class="text-info" style="font-style: italic"> <span class="text-info" style="font-style: italic">
<i class="icon icon-warning-sign"></i> <i class="icon fa fa-exclamation-triangle" aria-hidden="true"></i>
{{ {{
"Report generation may take a long time to generate, depending on the number of collections and the period selected." | trans "Report generation may take a long time to generate, depending on the number of collections and the period selected." | trans
}} }}

View File

@@ -3,12 +3,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Mocha Spec Runner</title> <title>Mocha Spec Runner</title>
<link rel="stylesheet" href="../../bower_components/mocha/mocha.css"> <link rel="stylesheet" href="../../../node_modules/mocha/mocha.css">
</head> </head>
<body> <body>
<div id="mocha"></div> <div id="mocha"></div>
<script src="../../bower_components/mocha/mocha.js"></script> <script src="../../../node_modules/mocha/mocha.js"></script>
<script src="../../bower_components/sinonjs/sinon.js"></script> <script src="../../../node_modules/sinon/lib/sinon.js"></script>
<script src="../../assets/vendors/requirejs/require.js"></script> <script src="../../assets/vendors/requirejs/require.js"></script>
<script src="common.js"></script> <script src="common.js"></script>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -1,15 +1,15 @@
require.config({ require.config({
baseUrl: "../../scripts", baseUrl: "../../scripts",
paths: { paths: {
"chai" : "../bower_components/chai/chai", "chai": "../../node_modules/chai/lib/chai",
"fixtures": "../bower_components/js-fixtures/fixtures", "fixtures": "../../node_modules/js-fixtures/fixtures",
jquery: "../assets/vendors/jquery/jquery.min", jquery: "../assets/vendors/jquery/jquery.min",
underscore: "../assets/vendors/underscore/underscore.min", underscore: "../assets/vendors/underscore/underscore.min",
backbone: "../assets/vendors/backbone/backbone.min", backbone: "../assets/vendors/backbone/backbone.min",
i18n: "../assets/vendors/i18next/i18next.min", i18n: "../assets/vendors/i18next/i18next.min",
bootstrap: "../assets/vendors/bootstrap/js/bootstrap.min", bootstrap: "../assets/vendors/bootstrap/js/bootstrap.min",
"sinonchai": "../bower_components/sinon-chai/lib/sinon-chai", "sinonchai": "../../node_modules/sinon-chai/lib/sinon-chai",
"squire": "../bower_components/squire/src/Squire", "squire": "../../node_modules/squirejs/src/Squire",
"jquery.ui": "../assets/vendors/jquery-ui/jquery-ui.min", "jquery.ui": "../assets/vendors/jquery-ui/jquery-ui.min",
"jquery.ui.widget": "../assets/vendors/jquery-file-upload/jquery.ui.widget.min", "jquery.ui.widget": "../assets/vendors/jquery-file-upload/jquery.ui.widget.min",
"jquery.cookie": "../assets/vendors/jquery.cookie/jquery.cookie.min", "jquery.cookie": "../assets/vendors/jquery.cookie/jquery.cookie.min",

View File

@@ -3,12 +3,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Mocha Spec Runner</title> <title>Mocha Spec Runner</title>
<link rel="stylesheet" href="../../bower_components/mocha/mocha.css"> <link rel="stylesheet" href="../../../node_modules/mocha/mocha.css">
</head> </head>
<body> <body>
<div id="mocha"></div> <div id="mocha"></div>
<script src="../../bower_components/mocha/mocha.js"></script> <script src="../../../node_modules/mocha/mocha.js"></script>
<script src="../../bower_components/sinonjs/sinon.js"></script> <script src="../../../node_modules/sinon/lib/sinon.js"></script>
<script src="../../assets/vendors/requirejs/require.js"></script> <script src="../../assets/vendors/requirejs/require.js"></script>
<script src="common.js"></script> <script src="common.js"></script>
<script> <script>

View File

@@ -3,12 +3,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Mocha Spec Runner</title> <title>Mocha Spec Runner</title>
<link rel="stylesheet" href="../../bower_components/mocha/mocha.css"> <link rel="stylesheet" href="../../../node_modules/mocha/mocha.css">
</head> </head>
<body> <body>
<div id="mocha"></div> <div id="mocha"></div>
<script src="../../bower_components/mocha/mocha.js"></script> <script src="../../../node_modules/mocha/mocha.js"></script>
<script src="../../bower_components/sinonjs/sinon.js"></script> <script src="../../../node_modules/sinon/lib/sinon.js"></script>
<script src="../../assets/vendors/requirejs/require.js"></script> <script src="../../assets/vendors/requirejs/require.js"></script>
<script src="common.js"></script> <script src="common.js"></script>
<script> <script>

View File

@@ -3,12 +3,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Mocha Spec Runner</title> <title>Mocha Spec Runner</title>
<link rel="stylesheet" href="../../bower_components/mocha/mocha.css"> <link rel="stylesheet" href="../../../node_modules/mocha/mocha.css">
</head> </head>
<body> <body>
<div id="mocha"></div> <div id="mocha"></div>
<script src="../../bower_components/mocha/mocha.js"></script> <script src="../../../node_modules/mocha/mocha.js"></script>
<script src="../../bower_components/sinonjs/sinon.js"></script> <script src="../../../node_modules/sinon/lib/sinon.js"></script>
<script src="../../assets/vendors/requirejs/require.js"></script> <script src="../../assets/vendors/requirejs/require.js"></script>
<script src="common.js"></script> <script src="common.js"></script>
<script> <script>