From 1111d2518b9c50e998cd0aa05b018a78e95fcee1 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 25 Oct 2018 11:18:13 +0100 Subject: [PATCH] Add pack-modules grunt task --- Gruntfile.js | 31 ++++++++++++++++++- package.json | 2 ++ .../@node-red/editor-api/.npmignore | 2 ++ .../@node-red/editor-client/.npmignore | 1 + .../node_modules/@node-red/nodes/.npmignore | 2 ++ .../@node-red/registry/.npmignore | 2 ++ .../node_modules/@node-red/runtime/.npmignore | 2 ++ .../node_modules/@node-red/util/.npmignore | 2 ++ packages/node_modules/node-red/.npmignore | 2 ++ 9 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 packages/node_modules/@node-red/editor-api/.npmignore create mode 100644 packages/node_modules/@node-red/nodes/.npmignore create mode 100644 packages/node_modules/@node-red/registry/.npmignore create mode 100644 packages/node_modules/@node-red/runtime/.npmignore create mode 100644 packages/node_modules/@node-red/util/.npmignore create mode 100644 packages/node_modules/node-red/.npmignore diff --git a/Gruntfile.js b/Gruntfile.js index eec9726a2..f4845c736 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -392,6 +392,28 @@ module.exports = function(grunt) { ] } }, + 'npm-command': { + options: { + cmd: "pack", + cwd: "<%= paths.dist %>/modules" + }, + 'node-red': { options: { args: [__dirname+'/packages/node_modules/node-red'] } }, + '@node-red/editor-api': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-api'] } }, + '@node-red/editor-client': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-client'] } }, + '@node-red/nodes': { options: { args: [__dirname+'/packages/node_modules/@node-red/nodes'] } }, + '@node-red/registry': { options: { args: [__dirname+'/packages/node_modules/@node-red/registry'] } }, + '@node-red/runtime': { options: { args: [__dirname+'/packages/node_modules/@node-red/runtime'] } }, + '@node-red/util': { options: { args: [__dirname+'/packages/node_modules/@node-red/util'] } } + + + }, + mkdir: { + release: { + options: { + create: ['<%= paths.dist %>/modules'] + }, + }, + }, compress: { release: { options: { @@ -456,6 +478,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-webdriver'); grunt.loadNpmTasks('grunt-jsdoc'); grunt.loadNpmTasks('grunt-jsdoc-to-markdown'); + grunt.loadNpmTasks('grunt-npm-command'); + grunt.loadNpmTasks('grunt-mkdir'); grunt.registerMultiTask('attachCopyright', function() { var files = this.data.src; @@ -542,7 +566,12 @@ module.exports = function(grunt) { grunt.registerTask('release', 'Create distribution zip file', - ['build','verifyPackageDependencies','clean:release','chmod:release','compress:release']); + ['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules']); + + grunt.registerTask('pack-modules', + 'Create module pack files for release', + ['mkdir:release','npm-command']); + grunt.registerTask('coverage', 'Run Istanbul code test coverage task', diff --git a/package.json b/package.json index 570173117..2f19c1c61 100644 --- a/package.json +++ b/package.json @@ -90,8 +90,10 @@ "grunt-jsdoc": "^2.2.1", "grunt-jsdoc-to-markdown": "^4.0.0", "grunt-jsonlint": "~1.1.0", + "grunt-mkdir": "~1.0.0", "grunt-mocha-istanbul": "5.0.2", "grunt-nodemon": "~0.4.2", + "grunt-npm-command": "~0.1.2", "grunt-sass": "~2.0.0", "grunt-simple-mocha": "~0.4.1", "grunt-webdriver": "^2.0.3", diff --git a/packages/node_modules/@node-red/editor-api/.npmignore b/packages/node_modules/@node-red/editor-api/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/@node-red/editor-api/.npmignore @@ -0,0 +1,2 @@ +src +docs diff --git a/packages/node_modules/@node-red/editor-client/.npmignore b/packages/node_modules/@node-red/editor-client/.npmignore index 85de9cf93..99c96b465 100644 --- a/packages/node_modules/@node-red/editor-client/.npmignore +++ b/packages/node_modules/@node-red/editor-client/.npmignore @@ -1 +1,2 @@ src +docs diff --git a/packages/node_modules/@node-red/nodes/.npmignore b/packages/node_modules/@node-red/nodes/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/.npmignore @@ -0,0 +1,2 @@ +src +docs diff --git a/packages/node_modules/@node-red/registry/.npmignore b/packages/node_modules/@node-red/registry/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/@node-red/registry/.npmignore @@ -0,0 +1,2 @@ +src +docs diff --git a/packages/node_modules/@node-red/runtime/.npmignore b/packages/node_modules/@node-red/runtime/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/@node-red/runtime/.npmignore @@ -0,0 +1,2 @@ +src +docs diff --git a/packages/node_modules/@node-red/util/.npmignore b/packages/node_modules/@node-red/util/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/@node-red/util/.npmignore @@ -0,0 +1,2 @@ +src +docs diff --git a/packages/node_modules/node-red/.npmignore b/packages/node_modules/node-red/.npmignore new file mode 100644 index 000000000..99c96b465 --- /dev/null +++ b/packages/node_modules/node-red/.npmignore @@ -0,0 +1,2 @@ +src +docs