From 854fd796ae396aa3227d466c30720937ffee2672 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Sat, 26 Jul 2014 21:27:10 +0400 Subject: [PATCH] auto-compile package.json on "npm install" --- Gruntfile.js | 4 ++-- package.json => index.js | 6 +++++- package.yaml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) rename package.json => index.js (63%) diff --git a/Gruntfile.js b/Gruntfile.js index 7dd004dc4..83e51e911 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,6 @@ module.exports = function(grunt) { grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), + pkg: grunt.file.readYAML('package.yaml'), browserify: { dist: { files: { @@ -36,4 +36,4 @@ module.exports = function(grunt) { 'browserify', 'less' ]); -}; \ No newline at end of file +}; diff --git a/package.json b/index.js similarity index 63% rename from package.json rename to index.js index c36e46264..f3ee2d88f 100644 --- a/package.json +++ b/index.js @@ -1,5 +1,9 @@ +module.exports = require('./lib') + +/**package { "name": "sinopia", "version": "0.0.0", "dependencies": {"js-yaml": "*"}, - "scripts": {"postinstall": "js-yaml package.yaml > package.json ; npm install --production ; git update-index --assume-unchanged package.json"} + "scripts": {"postinstall": "js-yaml package.yaml > package.json ; npm install"} } +**/ diff --git a/package.yaml b/package.yaml index bdf511fec..64161e26d 100644 --- a/package.yaml +++ b/package.yaml @@ -73,7 +73,7 @@ keywords: scripts: test: mocha ./test/functional ./test/unit lint: eslint -c ./.eslint.yaml ./lib - #prepublish: js-yaml package.yaml > package.json + prepublish: js-yaml package.yaml > package.json # we depend on streams2 stuff # it can be replaced with isaacs/readable-stream, ask if you need to use 0.8