From 9777540dbc3dad39eece381df0adc12937e69b28 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Fri, 14 Sep 2018 11:59:46 -0400 Subject: [PATCH] ignore: move plugin packages to their own file --- generators/app/package-json.js | 2 +- greenkeeper.json | 10 +++++++++ package.json | 15 +------------- plugin/package.json | 37 ++++++++++++++++++++++++++++++++++ test/app.test.js | 19 +++++------------ 5 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 greenkeeper.json create mode 100644 plugin/package.json diff --git a/generators/app/package-json.js b/generators/app/package-json.js index c0d9fdce..f8d98277 100644 --- a/generators/app/package-json.js +++ b/generators/app/package-json.js @@ -2,7 +2,7 @@ const _ = require('lodash'); const generatorVersion = require('./generator-version'); -const pkg = require('../../package.json'); +const pkg = require('../../plugin/package.json'); pkg.optionalDependencies = pkg.optionalDependencies || {}; pkg.devDependencies = pkg.devDependencies || {}; diff --git a/greenkeeper.json b/greenkeeper.json new file mode 100644 index 00000000..d89a0a78 --- /dev/null +++ b/greenkeeper.json @@ -0,0 +1,10 @@ +{ + "groups": { + "generator": { + "packages": ["./package.json"] + }, + "plugin": { + "packages": ["./plugin/package.json"] + } + } +} diff --git a/package.json b/package.json index 61b664a9..99731737 100644 --- a/package.json +++ b/package.json @@ -65,20 +65,7 @@ "videojs-generator-verify": "~1.0.4", "videojs-standard": "^7.1.0", "yeoman-assert": "^3.1.1", - "yeoman-test": "^2.0.0", - "jsdoc": "https://github.com/BrandonOCasey/jsdoc#feat/plugin-from-cli" - }, - "optionalDependencies": { - "global": "^4.3.2", - "karma": "^3.0.0", - "postcss-cli": "^6.0.0", - "rollup": "^0.65.0", - "sinon": "^6.1.5", - "video.js": "^6 || ^7", - "videojs-generate-karma-config": "~3.0.0", - "videojs-generate-postcss-config": "~2.0.1", - "videojs-generate-rollup-config": "~2.2.0", - "videojs-languages": "^1.0.0" + "yeoman-test": "^2.0.0" }, "husky": { "hooks": { diff --git a/plugin/package.json b/plugin/package.json new file mode 100644 index 00000000..dd392a2b --- /dev/null +++ b/plugin/package.json @@ -0,0 +1,37 @@ +{ + "name": "plugin-pkg-template", + "version": "0.0.0", + "description": "", + "main": "", + "scripts": {}, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "global": "^4.3.2", + "video.js": "^6 || ^7" + }, + "devDependencies": { + "conventional-changelog-cli": "^2.0.1", + "conventional-changelog-videojs": "^3.0.0", + "doctoc": "^1.3.1", + "husky": "^1.0.0-rc.13", + "in-publish": "^2.0.0", + "jsdoc": "https://github.com/BrandonOCasey/jsdoc#feat/plugin-from-cli", + "karma": "^3.0.0", + "lint-staged": "^7.2.2", + "not-prerelease": "^1.0.1", + "npm-merge-driver-install": "^1.0.0", + "npm-run-all": "^4.1.3", + "postcss-cli": "^6.0.0", + "rollup": "^0.65.0", + "shx": "^0.3.2", + "sinon": "^6.1.5", + "videojs-generate-karma-config": "~3.0.0", + "videojs-generate-postcss-config": "~2.0.1", + "videojs-generate-rollup-config": "~2.2.0", + "videojs-generator-verify": "~1.0.4", + "videojs-languages": "^1.0.0", + "videojs-standard": "^7.1.0" + } +} diff --git a/test/app.test.js b/test/app.test.js index 1c334c22..2bc4d1c9 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -11,7 +11,7 @@ const fs = require('fs'); const libs = require('./libs'); const packageJSON = require('../generators/app/package-json'); const generatorVersion = require('../generators/app/generator-version'); -const generatorPkg = require('../package.json'); +const pluginPkg = require('../plugin/package.json'); describe('videojs-plugin:app', function() { const scripts = [ @@ -207,21 +207,12 @@ describe('videojs-plugin:app', function() { libs.allAreNonEmpty(this.pkg.devDependencies, Object.keys(this.pkg.devDependencies)); }); - it('(generator) has no extra optional deps', function() { - const optionalPackages = Object.keys(generatorPkg.optionalDependencies); - const packages = Object.keys(this.pkg.dependencies) - .concat(Object.keys(this.pkg.devDependencies)); - let i = optionalPackages.length; + it('should have the same deps as the template package', function() { - while (i--) { - const pkg = optionalPackages[i]; + const templatePackages = Object.keys(pluginPkg.dependencies).concat(Object.keys(pluginPkg.devDependencies)); + const packages = Object.keys(this.pkg.dependencies).concat(Object.keys(this.pkg.devDependencies)); - if (packages.indexOf(pkg) !== -1) { - optionalPackages.splice(i, 1); - } - } - - assert.deepEqual(optionalPackages, [], 'there are no extra packages in optional dependencies'); + assert.deepEqual(templatePackages, packages, 'have the same packages'); }); });