diff --git a/.gitignore b/.gitignore index a3c4361..50b385c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ *~ *.kate-swp -composer.phar composer.lock +package-lock.json + !.* .idea/ diff --git a/.travis.yml b/.travis.yml index d7499dd..81f7edc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,17 @@ -language: php +language: node_js -php: -- 5.5 +node_js: +- 4 +- 5 +- 6 +- 7 +- 8 before_script: - - nvm install 4 - npm install - - composer install script: - npm test - - composer test notifications: irc: @@ -21,6 +22,3 @@ notifications: template: - "%{repository}/%{branch}/%{commit} : %{author} %{message} %{build_url}" -cache: - directories: - - $HOME/.composer/cache diff --git a/DataValuesJavaScript.php b/DataValuesJavaScript.php deleted file mode 100644 index 5a9c00e..0000000 --- a/DataValuesJavaScript.php +++ /dev/null @@ -1,40 +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+' -]; - -// 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/README.md b/README.md index 8c71bd2..c6871a0 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ 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 +### 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 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" - ] - } -} diff --git a/package.json b/package.json index 3540f8b..12ef23a 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,32 @@ { - "name": "DataValuesJavaScript", + "name": "wikibase-data-values", + "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" diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 4128010..0000000 --- a/phpcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - . - 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', - ], - ], - ]; -} );