From 7cdafe84eab5e0f806448a7d1d6fd493b0d492fd Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Sun, 4 May 2014 10:56:20 +0800 Subject: [PATCH 1/3] update yamljs, xml2js library --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6f42899..0d0f35f 100644 --- a/package.json +++ b/package.json @@ -28,18 +28,18 @@ "test": "grunt test" }, "dependencies": { - "yamljs": "~0.1.4", + "yamljs": "~0.1.5", "pretty-data": "~0.40.0", "csv": "~0.3.7", "plist": "~0.4.3", - "xml2js": "~0.4.1", + "xml2js": "~0.4.2", "async": "~0.2.10" }, "devDependencies": { - "grunt": "~0.4.2", - "grunt-contrib-jshint": "~0.8.0", + "grunt": "~0.4.4", + "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-clean": "~0.5.0", - "grunt-readme": "~0.4.5" + "grunt-verb": "~0.2.2" }, "keywords": [ "convert json", From 13ae896003efc1225045b6be2945f33237301bfc Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Sun, 4 May 2014 10:57:32 +0800 Subject: [PATCH 2/3] use verb --- .verbrc.md | 34 ++++++++++++ Gruntfile.js | 4 +- README.md | 130 +++++++++++++++++++++----------------------- docs/README.tmpl.md | 55 ------------------- 4 files changed, 98 insertions(+), 125 deletions(-) create mode 100644 .verbrc.md delete mode 100644 docs/README.tmpl.md diff --git a/.verbrc.md b/.verbrc.md new file mode 100644 index 0000000..33791ef --- /dev/null +++ b/.verbrc.md @@ -0,0 +1,34 @@ +# {%= name %} {%= badge('fury') %} {% if (travis) { %} {%= badge('travis') %}{% } %} + +> {%= description %} + +## Getting Started +{%= docs("getting-started") %} + +## Options + +{%= docs("options") %} + +## Usage Examples + +{%= docs("examples-csv") %} +{%= docs("examples-json") %} +{%= docs("examples-xml") %} +{%= docs("examples-plist") %} + +## Contributing + +We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involved please see the [Contributing to {%= name %}](http://assemble.io/contributing/) guide for information on contributing to this project. + +## Changes +{%= changelog() %} + +## Author +{%= contrib("jon") %} +{%= contrib("hariadi") %} + +## License +{%= copyright() %} +{%= license() %} + +{%= include('footer.md') %} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 60868d8..bfb9465 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -150,7 +150,7 @@ module.exports = function(grunt) { // These plugins provide necessary tasks. grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-readme'); + grunt.loadNpmTasks('grunt-verb'); // Actually load this plugin's task(s). grunt.loadTasks('tasks'); @@ -159,7 +159,7 @@ module.exports = function(grunt) { grunt.registerTask('test', ['jshint', 'convert']); // By default, lint and run all tests. - grunt.registerTask('default', ['clean', 'test', 'readme']); + grunt.registerTask('default', ['clean', 'test', 'verb']); }; diff --git a/README.md b/README.md index bda0963..c4bd71a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -# grunt-convert [![NPM version](https://badge.fury.io/js/grunt-convert.png)](http://badge.fury.io/js/grunt-convert) [![Build Status](https://travis-ci.org/assemble/grunt-convert.png)](https://travis-ci.org/assemble/grunt-convert) +# grunt-convert [![NPM version](https://badge.fury.io/js/grunt-convert.png)](http://badge.fury.io/js/grunt-convert) [![Build Status](https://travis-ci.org/assemble/grunt-convert.png)](https://travis-ci.org/assemble/grunt-convert) > Convert between XML, JSON and YAML, from one format to another. ## Getting Started - _If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._ From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command: @@ -24,7 +23,6 @@ If the plugin has been installed correctly, running `grunt --help` at the comman [Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md [package.json]: https://npmjs.org/doc/json.html - ## Options ###### type @@ -67,7 +65,6 @@ List of fields or true if autodiscovered in the first CSV line. See [node-csv](https://github.com/wdavidw/node-csv/blob/master/doc/from.md#from.options) for other available options. - ## Usage Examples @@ -88,7 +85,6 @@ grunt.initConfig({ ``` - ### Convert JSON to XML ```js @@ -131,6 +127,44 @@ grunt.initConfig({ }); ``` +### Convert XML to YAML + +```js +grunt.initConfig({ + convert: { + options: { + explicitArray: false, + }, + xml2yml: { + src: ['convert.xml'], + dest: 'dist/convert.yml' + } + } +}); +``` + +### Convert XML to JSON + +```js +grunt.initConfig({ + convert: { + options: { + explicitArray: false, + }, + xml2json: { + files: [ + { + expand: true, + cwd: 'test/fixtures/', + src: ['**/*.xml'], + dest: 'tmp/result/', + ext: '.json' + } + ] + }, + } +}); +``` ### Convert PLIST to JSON @@ -173,78 +207,38 @@ grunt.initConfig({ ``` - -### Convert XML to YAML - -```js -grunt.initConfig({ - convert: { - options: { - explicitArray: false, - }, - xml2yml: { - src: ['convert.xml'], - dest: 'dist/convert.yml' - } - } -}); -``` - -### Convert XML to JSON - -```js -grunt.initConfig({ - convert: { - options: { - explicitArray: false, - }, - xml2json: { - files: [ - { - expand: true, - cwd: 'test/fixtures/', - src: ['**/*.xml'], - dest: 'tmp/result/', - ext: '.json' - } - ] - }, - } -}); -``` - - ## Contributing -Please see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project. +We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involved please see the [Contributing to grunt-convert](http://assemble.io/contributing/) guide for information on contributing to this project. + +## Changes +**DATE** **VERSION** **CHANGES** +* 2013-12-14 v0.1.9 Fix json to yml converter,Add `type` option to define content with unknown + extension +* 2013-12-18 v0.1.8 adding missing write file statement when converting xml to json +* 2013-12-12 v0.1.7 Fix async issues +* 2013-12-02 v0.1.6 Add support for Grunt 0.4.2,Use external library,Fix missing "Release + History" +* 2013-09-10 v0.1.5 Add support for JSON to CSV. +* 2013-09-10 v0.1.4 Add support for CSV to JSON. +* 2013-07-16 v0.1.3 JSON/YAML to XML. +* 2013-07-15 v0.1.2 Add support YAML. Added XML to JSON/YAML, JSON to YAML, and YAML to JSON. +* 2013-07-02 v0.1.1 XML to JSON. -## Authors +## Author **Jon Schlinkert** -+ [http://twitter.com/jonschlinkert](http://twitter.com/jonschlinkert) -+ [http://github.com/jonschlinkert](http://github.com/jonschlinkert) ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) **Hariadi Hinta** -+ [http://twitter.com/hariadi](http://twitter.com/hariadi) -+ [http://github.com/hariadi](http://github.com/hariadi) - -## Release History - - * 2013-12-14   v0.1.9   Fix json to yml converter Add `type` option to define content with unknown extension - * 2013-12-18   v0.1.8   adding missing write file statement when converting xml to json - * 2013-12-12   v0.1.7   Fix async issues - * 2013-12-02   v0.1.6   Add support for Grunt 0.4.2 Use external library Fix missing "Release History" - * 2013-09-10   v0.1.5   Add support for JSON to CSV. - * 2013-09-10   v0.1.4   Add support for CSV to JSON. - * 2013-07-16   v0.1.3   JSON/YAML to XML. - * 2013-07-15   v0.1.2   Add support YAML. Added XML to JSON/YAML, JSON to YAML, and YAML to JSON. - * 2013-07-02   v0.1.1   XML to JSON. ++ [github.com/assemble](https://github.com/assemble) ++ [twitter.com/assemble](http://twitter.com/assemble) ## License -[MIT License](LICENSE-MIT) - -*** +Copyright (c) 2014 Jon Schlinkert, contributors. +Released under the MIT license -_This file was generated by [grunt-readme](https://github.com/assemble/grunt-readme) on Tuesday, March 11, 2014._ \ No newline at end of file +_This file was generated by [grunt-verb](https://github.com/assemble/grunt-verb) on May 04, 2014._ \ No newline at end of file diff --git a/docs/README.tmpl.md b/docs/README.tmpl.md deleted file mode 100644 index 1ecf6cd..0000000 --- a/docs/README.tmpl.md +++ /dev/null @@ -1,55 +0,0 @@ -# {%= name %} [![NPM version](https://badge.fury.io/js/{%= name %}.png)](http://badge.fury.io/js/{%= name %}) {% if (travis) { %} [![Build Status]({%= travis %}.png)]({%= travis %}){% } %} - -> {%= description %} - -## Getting Started - -{%= _.doc("getting-started.md") %} - -## Options - -{%= _.doc("options.md") %} - -## Usage Examples - -{%= _.doc("examples-*.md") %} - -## Contributing - -Please see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project. - -## Authors - -**Jon Schlinkert** - -+ [http://twitter.com/jonschlinkert](http://twitter.com/jonschlinkert) -+ [http://github.com/jonschlinkert](http://github.com/jonschlinkert) - -**Hariadi Hinta** - -+ [http://twitter.com/hariadi](http://twitter.com/hariadi) -+ [http://github.com/hariadi](http://github.com/hariadi) - -## Release History -{% if (changelog) { - _.each(changelog, function(details, version) { - var date = details.date; - if (date instanceof Date) { - date = grunt.template.date(new Date(date.getTime() + date.getTimezoneOffset() * 60000), 'yyyy-mm-dd'); - } - print('\n * ' + [ - date, - version, - details.changes.join(' '), - ].join('\u2003\u2003\u2003')); - }); -} else { %} -_(Nothing yet)_ -{% } %} - -## License -[MIT License](LICENSE-MIT) - -*** - -_This file was generated by [grunt-readme](https://github.com/assemble/grunt-readme) on {%= grunt.template.date("fullDate") %}._ \ No newline at end of file From 2b9903af99c07d5e8ff0504e7ed013a4e9be72af Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Sun, 4 May 2014 11:36:08 +0800 Subject: [PATCH 3/3] v0.1.11 --- CHANGELOG | 11 +++++++++++ README.md | 3 +++ package.json | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 82393d6..fe5c96b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,14 @@ +v0.1.11: + date: 2014-05-03 + changes: + - Fix (empty string), xml2js (only invoke parseString callback once) + - XML parser error display a warning and abort Grunt immediately + +v0.1.10: + date: 2014-03-11 + changes: + - Fixing options.type issue and adding more tests around it + v0.1.9: date: 2013-12-14 changes: diff --git a/README.md b/README.md index c4bd71a..728c5fa 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,9 @@ We welcome all kinds of contributions! The most basic way to show your support i ## Changes **DATE** **VERSION** **CHANGES** +* 2014-05-03 v0.1.11 Fix (empty string), xml2js (only invoke parseString callback once),XML + parser error display a warning and abort Grunt immediately +* 2014-03-11 v0.1.10 Fixing options.type issue and adding more tests around it * 2013-12-14 v0.1.9 Fix json to yml converter,Add `type` option to define content with unknown extension * 2013-12-18 v0.1.8 adding missing write file statement when converting xml to json diff --git a/package.json b/package.json index 0d0f35f..aaedd66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "grunt-convert", "description": "Convert between XML, JSON and YAML, from one format to another.", - "version": "0.1.10", + "version": "0.1.11", "homepage": "https://github.com/assemble/grunt-convert", "author": { "name": "Jon Schlinkert",