From 36efef9f31f83f84eaad78976dd91c37d34ff48d Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 13:17:00 +0200 Subject: [PATCH 01/10] Move over some more information from composer.json to package.json Moved contriburs, package description, keywords, and the bug tracker URL. --- package.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/package.json b/package.json index 3540f8b..6d33c48 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,32 @@ { "name": "DataValuesJavaScript", + "description": "DataValues implementation in JavaScript", + "keywords": [ + "datavalues", + "wikidata" + ], "repository": { "type": "git", "url": "https://github.com/wmde/DataValuesJavaScript" }, + "contributors": [ + { + "name": "Daniel Werner", + "url": "https://www.mediawiki.org/wiki/User:Danwe" + }, + { + "name": "H. Snater", + "url": "http://www.snater.com" + }, + { + "name": "Jeroen De Dauw", + "email": "jeroendedauw@gmail.com", + "homepage": "http://jeroendedauw.com" + } + ], + "bugs": { + "url": "https://phabricator.wikimedia.org/" + }, "license": "GPL-2.0+", "dependencies": { "jquery": "^3.2.1" From 017a35f5319a308ce59dd95a040f99fb2a920cc3 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 15:18:39 +0200 Subject: [PATCH 02/10] Remove composer files --- .gitignore | 1 - .travis.yml | 5 ----- composer.json | 45 --------------------------------------------- 3 files changed, 51 deletions(-) delete mode 100644 composer.json diff --git a/.gitignore b/.gitignore index a3c4361..1e11e0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *~ *.kate-swp -composer.phar composer.lock !.* diff --git a/.travis.yml b/.travis.yml index d7499dd..b7c1e43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,9 @@ php: before_script: - nvm install 4 - npm install - - composer install script: - npm test - - composer test notifications: irc: @@ -21,6 +19,3 @@ notifications: template: - "%{repository}/%{branch}/%{commit} : %{author} %{message} %{build_url}" -cache: - directories: - - $HOME/.composer/cache diff --git a/composer.json b/composer.json deleted file mode 100644 index 5aa287e..0000000 --- a/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "data-values/javascript", - "description": "DataValues implementation in JavaScript", - "keywords": [ - "datavalues", - "wikidata" - ], - "license": "GPL-2.0+", - "authors": [ - { - "name": "Daniel Werner", - "homepage": "https://www.mediawiki.org/wiki/User:Danwe" - }, - { - "name": "H. Snater", - "homepage": "http://www.snater.com" - }, - { - "name": "Jeroen De Dauw", - "email": "jeroendedauw@gmail.com", - "homepage": "http://jeroendedauw.com" - } - ], - "support": { - "issues": "https://phabricator.wikimedia.org/", - "irc": "irc://irc.freenode.net/wikidata" - }, - "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "wikibase/wikibase-codesniffer": "^0.1.0" - }, - "autoload": { - "files" : [ - "DataValuesJavaScript.php" - ] - }, - "scripts": { - "test": [ - "composer validate --no-interaction", - "phpcs -p -s" - ] - } -} From ed30228c57570bcae989efa4679fd06a6f0db559 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 15:19:58 +0200 Subject: [PATCH 03/10] Remove PHPCS config --- phpcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 phpcs.xml diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 4128010..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - . - From 447d4701d8b13ac7b7d560b211c2a72d98db69b2 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 15:55:56 +0200 Subject: [PATCH 04/10] Use node/JS build environment on Travis CI --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7c1e43..81f7edc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,13 @@ -language: php +language: node_js -php: -- 5.5 +node_js: +- 4 +- 5 +- 6 +- 7 +- 8 before_script: - - nvm install 4 - npm install script: From dbadf1874cddaf0467798604af7a7bd65fa58634 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 16:20:07 +0200 Subject: [PATCH 05/10] Remove MediaWiki ResourceLoader module definitions --- DataValuesJavaScript.php | 7 --- src/resources.php | 78 ------------------------------- src/valueFormatters/resources.php | 46 ------------------ src/valueParsers/resources.php | 59 ----------------------- 4 files changed, 190 deletions(-) delete mode 100644 src/resources.php delete mode 100644 src/valueFormatters/resources.php delete mode 100644 src/valueParsers/resources.php diff --git a/DataValuesJavaScript.php b/DataValuesJavaScript.php index 5a9c00e..dd5aa7c 100644 --- a/DataValuesJavaScript.php +++ b/DataValuesJavaScript.php @@ -31,10 +31,3 @@ 'description' => 'JavaScript related to the DataValues library', 'license-name' => 'GPL-2.0+' ]; - -// Resource Loader module registration -$GLOBALS['wgResourceModules'] = array_merge( - isset( $GLOBALS['wgResourceModules'] ) ? $GLOBALS['wgResourceModules'] : [], - include __DIR__ . '/lib/resources.php', - include __DIR__ . '/src/resources.php' -); diff --git a/src/resources.php b/src/resources.php deleted file mode 100644 index 72b55b0..0000000 --- a/src/resources.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author H. Snater < mediawiki@snater.com > - * - * @codeCoverageIgnoreStart - */ -return call_user_func( function() { - preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . '(?:vendor|extensions)' - . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, $remoteExtPath ); - - $moduleTemplate = [ - 'localBasePath' => __DIR__, - 'remoteExtPath' => '..' . $remoteExtPath[0], - ]; - - $modules = [ - 'dataValues' => $moduleTemplate + [ - 'scripts' => [ - 'dataValues.js', - ], - ], - - 'dataValues.DataValue' => $moduleTemplate + [ - 'scripts' => [ - 'DataValue.js', - ], - 'dependencies' => [ - 'dataValues', - 'util.inherit', - ], - ], - - 'dataValues.values' => $moduleTemplate + [ - 'scripts' => [ - // Note: The order here is relevant, scripts should be places after the ones they - // depend on. - 'values/BoolValue.js', - 'values/DecimalValue.js', - 'values/GlobeCoordinateValue.js', - 'values/MonolingualTextValue.js', - 'values/MultilingualTextValue.js', - 'values/StringValue.js', - 'values/NumberValue.js', - 'values/TimeValue.js', - 'values/QuantityValue.js', - 'values/UnknownValue.js', - 'values/UnDeserializableValue.js', - ], - 'dependencies' => [ - 'dataValues.DataValue', - 'dataValues.TimeValue', - 'globeCoordinate.js', // required by GlobeCoordinateValue - 'util.inherit', - ], - ], - - 'dataValues.TimeValue' => $moduleTemplate + [ - 'scripts' => [ - 'values/TimeValue.js', - ], - 'dependencies' => [ - 'dataValues.DataValue', - 'util.inherit', - ], - ], - - ]; - - $modules = array_merge( - $modules, - include __DIR__ . '/valueFormatters/resources.php', - include __DIR__ . '/valueParsers/resources.php' - ); - - return $modules; -} ); diff --git a/src/valueFormatters/resources.php b/src/valueFormatters/resources.php deleted file mode 100644 index 1074620..0000000 --- a/src/valueFormatters/resources.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * @codeCoverageIgnoreStart - */ -return call_user_func( function() { - preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . '(?:vendor|extensions)' - . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, $remoteExtPath ); - - $moduleTemplate = [ - 'localBasePath' => __DIR__, - 'remoteExtPath' => '..' . $remoteExtPath[0], - ]; - - return [ - 'valueFormatters' => $moduleTemplate + [ - 'scripts' => [ - 'valueFormatters.js', - ], - ], - - 'valueFormatters.ValueFormatter' => $moduleTemplate + [ - 'scripts' => [ - 'formatters/ValueFormatter.js', - ], - 'dependencies' => [ - 'util.inherit', - 'valueFormatters', - ], - ], - - 'valueFormatters.formatters' => $moduleTemplate + [ - 'scripts' => [ - 'formatters/NullFormatter.js', - 'formatters/StringFormatter.js', - ], - 'dependencies' => [ - 'dataValues.values', - 'util.inherit', - 'valueFormatters.ValueFormatter', - ], - ], - ]; -} ); diff --git a/src/valueParsers/resources.php b/src/valueParsers/resources.php deleted file mode 100644 index 07a6808..0000000 --- a/src/valueParsers/resources.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @author Daniel Werner < daniel.werner@wikimedia.de > - * - * @codeCoverageIgnoreStart - */ -return call_user_func( function() { - preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . '(?:vendor|extensions)' - . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, $remoteExtPath ); - - $moduleTemplate = [ - 'localBasePath' => __DIR__, - 'remoteExtPath' => '..' . $remoteExtPath[0], - ]; - - return [ - 'valueParsers' => $moduleTemplate + [ - 'scripts' => [ - 'valueParsers.js', - ], - ], - - 'valueParsers.ValueParser' => $moduleTemplate + [ - 'scripts' => [ - 'parsers/ValueParser.js', - ], - 'dependencies' => [ - 'util.inherit', - 'valueParsers', - ], - ], - - 'valueParsers.ValueParserStore' => $moduleTemplate + [ - 'scripts' => [ - 'ValueParserStore.js', - ], - 'dependencies' => [ - 'valueParsers', - ], - ], - - 'valueParsers.parsers' => $moduleTemplate + [ - 'scripts' => [ - 'parsers/BoolParser.js', - 'parsers/FloatParser.js', - 'parsers/IntParser.js', - 'parsers/NullParser.js', - 'parsers/StringParser.js', - ], - 'dependencies' => [ - 'dataValues.values', - 'util.inherit', - 'valueParsers.ValueParser', - ], - ], - ]; -} ); From bfd7eb80da6edba9d14d04997b7430008325a804 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 16:29:27 +0200 Subject: [PATCH 06/10] Remove remaining MediaWiki integration PHP files --- DataValuesJavaScript.php | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 DataValuesJavaScript.php diff --git a/DataValuesJavaScript.php b/DataValuesJavaScript.php deleted file mode 100644 index dd5aa7c..0000000 --- a/DataValuesJavaScript.php +++ /dev/null @@ -1,33 +0,0 @@ - __DIR__, - 'name' => 'DataValues JavaScript', - 'version' => DATA_VALUES_JAVASCRIPT_VERSION, - 'author' => [ - '[https://www.mediawiki.org/wiki/User:Danwe Daniel Werner]', - '[http://www.snater.com H. Snater]', - '[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', - ], - 'url' => 'https://github.com/wmde/DataValuesJavascript', - 'description' => 'JavaScript related to the DataValues library', - 'license-name' => 'GPL-2.0+' -]; From bd9a981d8f7b0c9c0d8ecc3b33569178d65dd29b Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 16:31:12 +0200 Subject: [PATCH 07/10] Changed name of the package (soon-to-become a npm package name) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d33c48..12ef23a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "DataValuesJavaScript", + "name": "wikibase-data-values", "description": "DataValues implementation in JavaScript", "keywords": [ "datavalues", From 1fa7a396770539240af2a14865f6f75d501f9b3a Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 17:27:16 +0200 Subject: [PATCH 08/10] Ignore package-lock file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 1e11e0f..50b385c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ composer.lock +package-lock.json + !.* .idea/ From 2bd86102b93fc98c5b4bad9581769f82b53e6ac3 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 17:27:54 +0200 Subject: [PATCH 09/10] Remove Packagist badges from README --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 8c71bd2..40c4583 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,6 @@ It contains various JavaScript related to the DataValues library. [![Build Status](https://secure.travis-ci.org/wmde/DataValuesJavaScript.png?branch=master)](http://travis-ci.org/wmde/DataValuesJavaScript) -On [Packagist](https://packagist.org/packages/data-values/javascript): -[![Latest Stable Version](https://poser.pugx.org/data-values/javascript/version.png)](https://packagist.org/packages/data-values/javascript) -[![Download count](https://poser.pugx.org/data-values/javascript/d/total.png)](https://packagist.org/packages/data-values/javascript) - ## Release notes ### 0.9.0 (2017-09-06) From 27654c6f6481eaed647db67dfa84b81cb4dd4942 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Mon, 2 Oct 2017 17:58:29 +0200 Subject: [PATCH 10/10] Updated README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 40c4583..c6871a0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ It contains various JavaScript related to the DataValues library. ## Release notes +### 1.0.0 (dev) +* The library is now a pure JavaScript library. +* Removed MediaWiki ResourceLoader module definitions. + ### 0.9.0 (2017-09-06) * Removed `valueFormatters.ValueFormatterStore`. * Removed the `options` constructor parameter as well as the `getOptions` method from