diff --git a/README.md b/README.md new file mode 100644 index 0000000..137868b --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# No trailing comma + +Placeholder package for clean diffs in JSON package definition files. + +## Usage + +### Composer + +1. Configure root project to automatically sort packages. + ```sh + $ composer config sort-packages true + ``` + ```json + "config": { + "sort-packages": true + } + ``` + +1. Install this package as dependency. + ```sh + $ composer require zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma + $ composer require --dev zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma + ``` + +### npm + +1. Install this package as dependency. + ```sh + $ npm install zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma + $ npm install --save-dev zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma + ``` + +Notes +* npm sorts packages alphabetically whenever you invoke the commands `install` and `remove`. You can pass the name of a non-existing package to them to manually sort dependencies in `package.json` once. diff --git a/composer.json b/composer.json index 1cca7d9..bdb0020 100644 --- a/composer.json +++ b/composer.json @@ -10,5 +10,8 @@ } ], "minimum-stability": "dev", - "require": {} + "require": {}, + "config": { + "sort-packages": true + } } diff --git a/index.js b/index.js new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..a2708da --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-no-trailing-comma", + "version": "1.1.0", + "description": "Placeholder package for clean diffs in package.json.", + "keywords": ["npm", "package", "json", "package.json", "diff", "dev", "development"], + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma.git" + }, + "author": "Daniel Kudwien (https://netzstrategen.com)", + "license": "MIT", + "bugs": { + "url": "https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma/issues" + }, + "homepage": "https://github.com/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz/no-trailing-comma" +}