Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/219306
Change subject: Untangle external libraries into their own subtree
......................................................................
Untangle external libraries into their own subtree
* Configuring jshint/jscs. By removing this nesting, we can
configure JSHint more natively from .jshintignore and .jshintrc,
without relying on exclusions only known to Grunt. That way
other applications that support JSHint (such as command-line
tools, Phabricator, and JSHint plugins for text editors) aren't
filled with warnings.
These were previously excluded via "javascripts/externals", but
this was changed in 13aff2e53bdbd6.
* Configuring JSDuck. It's supposed to be given a fixed set
of parameters, ideally via the json file. Relying on Grunts
matching makes it significantly harder to publish MF docs.
* Maintenance overhead and code management. Having external libraries
organised together is conventional in most other projects. It makes
it easier to get an overview of what libraries are used and depended
on. It also makes performance and security review easier.
* Add missing license for 'micro.js'. The other libs don't have a license file
either,
but those have a license header instead.
Change-Id: Ia5599be6a409df69890ba793d217534e532a50a9
---
M .jscsrc
M .jshintignore
M Gruntfile.js
R libs/hogan.js/hogan.js
R libs/md5/md5.js
A libs/micro.js/LICENSE
R libs/micro.js/micro.autosize.js
7 files changed, 35 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/06/219306/1
diff --git a/.jscsrc b/.jscsrc
index c64f899..32a9969 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -8,6 +8,10 @@
"requireParamTypes": true,
"checkRedundantParams": true
},
+ "excludeFiles": [
+ "libs/**",
+ "node_modules/**"
+ ],
"additionalRules": [
"node_modules/jscs-jsdoc/lib/rules/*.js"
],
diff --git a/.jshintignore b/.jshintignore
index 26801f9..ca4770d 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1 +1,3 @@
+libs
styleguide-template
+node_modules
diff --git a/Gruntfile.js b/Gruntfile.js
index f1e01f7..16a6621 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -22,8 +22,7 @@
QUNIT_MODULE: ( process.env.QUNIT_MODULE && '&module=' +
process.env.QUNIT_MODULE ) || '',
files: {
js: 'resources/**/*.js',
- jsTests: 'tests/qunit/**/*.js',
- jsExternals: 'resources/*/externals/**/*.js'
+ jsTests: 'tests/qunit/**/*.js'
},
mkdir: {
jsdocs: {
@@ -36,20 +35,18 @@
options: {
jshintrc: true
},
- tests: '<%= files.jsTests %>',
- sources: [
+ all: [
'<%= files.js %>',
- '!<%= files.jsExternals %>',
+ '<%= files.jsTests %>'
]
},
jscs: {
main: [
- '<%= files.js %>',
- '!<%= files.jsExternals %>'
+ '<%= files.js %>'
],
test: {
options: {
- config: '.jscsrctest.js',
+ config: '.jscsrctest.js'
},
files: {
src: '<%= files.jsTests %>'
@@ -77,8 +74,7 @@
prefixUrl: 'w/', // Prefix url
on the server
baseUrl: '../../', // Path to
assets from the server (extensions/Mobile...)
src: [
- '<%= files.js %>',
- '!<%= files.jsExternals
%>'
+ '<%= files.js %>'
],
instrumentedFiles:
'tests/report/tmp',
htmlReport: 'tests/report'
@@ -105,8 +101,7 @@
jsduck: {
main: {
src: [
- '<%= files.js %>',
- '!<%= files.jsExternals %>'
+ '<%= files.js %>'
],
dest: 'docs/js',
options: {
diff --git a/resources/mediawiki.template.hogan/externals/hogan.js
b/libs/hogan.js/hogan.js
similarity index 100%
rename from resources/mediawiki.template.hogan/externals/hogan.js
rename to libs/hogan.js/hogan.js
diff --git a/resources/mobile.hexmd5/externals/md5.js b/libs/md5/md5.js
similarity index 100%
rename from resources/mobile.hexmd5/externals/md5.js
rename to libs/md5/md5.js
diff --git a/libs/micro.js/LICENSE b/libs/micro.js/LICENSE
new file mode 100644
index 0000000..027cab6
--- /dev/null
+++ b/libs/micro.js/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012 Juliusz Gonera
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/resources/mobile.microAutoSize/externals/micro.autosize.js
b/libs/micro.js/micro.autosize.js
similarity index 100%
rename from resources/mobile.microAutoSize/externals/micro.autosize.js
rename to libs/micro.js/micro.autosize.js
--
To view, visit https://gerrit.wikimedia.org/r/219306
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5599be6a409df69890ba793d217534e532a50a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits