2014-06-28 20:40:46 +00:00
|
|
|
/**
|
2017-01-11 15:24:33 +00:00
|
|
|
* Copyright JS Foundation and other contributors, http://js.foundation
|
2014-06-28 20:40:46 +00:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
**/
|
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
var path = require("path");
|
2019-01-20 10:10:54 +00:00
|
|
|
var fs = require("fs-extra");
|
2021-05-11 17:13:21 +00:00
|
|
|
var sass = require("sass");
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2014-03-31 12:31:31 +00:00
|
|
|
module.exports = function(grunt) {
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2020-09-29 11:11:10 +00:00
|
|
|
var nodemonArgs = ["-V"];
|
2015-08-13 21:41:51 +00:00
|
|
|
var flowFile = grunt.option('flowFile');
|
|
|
|
if (flowFile) {
|
|
|
|
nodemonArgs.push(flowFile);
|
2020-11-14 14:09:24 +00:00
|
|
|
process.env.NODE_RED_ENABLE_PROJECTS=false;
|
2015-08-13 21:41:51 +00:00
|
|
|
}
|
2020-08-13 23:08:09 +00:00
|
|
|
var userDir = grunt.option('userDir');
|
|
|
|
if (userDir) {
|
|
|
|
nodemonArgs.push("-u");
|
|
|
|
nodemonArgs.push(userDir);
|
|
|
|
}
|
2015-08-13 21:41:51 +00:00
|
|
|
|
2020-01-21 00:49:19 +00:00
|
|
|
var browserstack = grunt.option('browserstack');
|
|
|
|
if (browserstack) {
|
|
|
|
process.env.BROWSERSTACK = true;
|
|
|
|
}
|
2018-07-10 11:42:56 +00:00
|
|
|
var nonHeadless = grunt.option('non-headless');
|
|
|
|
if (nonHeadless) {
|
2020-01-14 11:36:10 +00:00
|
|
|
process.env.NODE_RED_NON_HEADLESS = true;
|
2018-07-10 11:42:56 +00:00
|
|
|
}
|
2021-04-27 16:30:30 +00:00
|
|
|
const pkg = grunt.file.readJSON('package.json');
|
|
|
|
process.env.NODE_RED_PACKAGE_VERSION = pkg.version;
|
2014-03-31 12:31:31 +00:00
|
|
|
grunt.initConfig({
|
2021-04-27 16:30:30 +00:00
|
|
|
pkg: pkg,
|
2015-04-01 22:24:47 +00:00
|
|
|
paths: {
|
|
|
|
dist: ".dist"
|
|
|
|
},
|
|
|
|
simplemocha: {
|
|
|
|
options: {
|
|
|
|
globals: ['expect'],
|
|
|
|
timeout: 3000,
|
|
|
|
ignoreLeaks: false,
|
|
|
|
ui: 'bdd',
|
|
|
|
reporter: 'spec'
|
|
|
|
},
|
2020-10-19 20:10:34 +00:00
|
|
|
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
|
|
|
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
|
2015-04-01 22:24:47 +00:00
|
|
|
nodes: { src: ["test/nodes/**/*_spec.js"]}
|
|
|
|
},
|
2017-12-01 10:50:59 +00:00
|
|
|
webdriver: {
|
|
|
|
all: {
|
|
|
|
configFile: 'test/editor/wdio.conf.js'
|
|
|
|
}
|
|
|
|
},
|
2020-10-19 20:10:34 +00:00
|
|
|
nyc: {
|
2017-03-09 15:28:13 +00:00
|
|
|
options: {
|
2020-10-19 20:10:34 +00:00
|
|
|
cwd: '.',
|
|
|
|
include: ['packages/node_modules/**'],
|
|
|
|
excludeNodeModules: false,
|
|
|
|
exclude: ['packages/node_modules/@node-red/editor-client/**'],
|
|
|
|
reporter: ['lcov', 'html','text-summary'],
|
|
|
|
reportDir: 'coverage',
|
|
|
|
all: true
|
2017-03-09 15:28:13 +00:00
|
|
|
},
|
2020-10-19 20:10:34 +00:00
|
|
|
all: { cmd: false, args: ['grunt', 'simplemocha:all'] },
|
|
|
|
core: { options: { exclude:['packages/node_modules/@node-red/editor-client/**', 'packages/node_modules/@node-red/nodes/**']},cmd: false, args: ['grunt', 'simplemocha:core'] },
|
|
|
|
nodes: { cmd: false, args: ['grunt', 'simplemocha:nodes'] }
|
2017-03-09 15:28:13 +00:00
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
jshint: {
|
|
|
|
options: {
|
2015-04-16 10:53:39 +00:00
|
|
|
jshintrc:true
|
2015-04-01 22:24:47 +00:00
|
|
|
// http://www.jshint.com/docs/options/
|
2015-04-16 10:53:39 +00:00
|
|
|
//"asi": true, // allow missing semicolons
|
|
|
|
//"curly": true, // require braces
|
|
|
|
//"eqnull": true, // ignore ==null
|
|
|
|
//"forin": true, // require property filtering in "for in" loops
|
|
|
|
//"immed": true, // require immediate functions to be wrapped in ( )
|
|
|
|
//"nonbsp": true, // warn on unexpected whitespace breaking chars
|
|
|
|
////"strict": true, // commented out for now as it causes 100s of warnings, but want to get there eventually
|
|
|
|
//"loopfunc": true, // allow functions to be defined in loops
|
|
|
|
//"sub": true // don't warn that foo['bar'] should be written as foo.bar
|
2015-04-01 22:24:47 +00:00
|
|
|
},
|
2020-01-22 11:53:41 +00:00
|
|
|
// all: [
|
|
|
|
// 'Gruntfile.js',
|
|
|
|
// 'red.js',
|
|
|
|
// 'packages/**/*.js'
|
|
|
|
// ],
|
|
|
|
// core: {
|
|
|
|
// files: {
|
|
|
|
// src: [
|
|
|
|
// 'Gruntfile.js',
|
|
|
|
// 'red.js',
|
|
|
|
// 'packages/**/*.js',
|
|
|
|
// ]
|
|
|
|
// }
|
|
|
|
// },
|
2015-04-01 22:24:47 +00:00
|
|
|
nodes: {
|
|
|
|
files: {
|
2015-06-15 19:38:40 +00:00
|
|
|
src: [ 'nodes/core/*/*.js' ]
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
editor: {
|
|
|
|
files: {
|
2020-01-22 11:53:41 +00:00
|
|
|
src: [ 'packages/node_modules/@node-red/editor-client/src/js/**/*.js' ]
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
tests: {
|
|
|
|
files: {
|
|
|
|
src: ['test/**/*.js']
|
2014-03-31 12:31:31 +00:00
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
options: {
|
2016-05-18 10:11:59 +00:00
|
|
|
"expr": true
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
concat: {
|
|
|
|
options: {
|
|
|
|
separator: ";",
|
2014-06-28 20:40:46 +00:00
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
build: {
|
2016-05-18 10:11:59 +00:00
|
|
|
src: [
|
|
|
|
// Ensure editor source files are concatenated in
|
|
|
|
// the right order
|
2020-04-03 15:56:46 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/polyfills.js",
|
2018-10-24 21:57:16 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/jquery-addons.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/red.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/events.js",
|
2021-05-13 12:35:12 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/hooks.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/i18n.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/settings.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/user.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/comms.js",
|
2022-06-08 20:56:17 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/runtime.js",
|
2024-03-27 17:30:44 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/multiplayer.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/text/bidi.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
|
2020-12-14 10:40:06 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/plugins.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/nodes.js",
|
2018-09-26 00:16:15 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/font-awesome.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/history.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/validators.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/utils.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js",
|
2018-12-20 13:15:31 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/checkboxSet.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/panels.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/popover.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/stack.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js",
|
2019-05-21 14:25:38 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/toggleButton.js",
|
2021-10-05 16:59:44 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/common/autoComplete.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/actions.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js",
|
2022-03-29 19:59:35 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/diagnostics.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/diff.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/keyboard.js",
|
2022-11-04 09:42:51 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js",
|
2019-03-26 22:22:13 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/statusBar.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view.js",
|
2021-06-24 16:40:26 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view-annotations.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view-navigator.js",
|
2019-01-18 21:19:03 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/view-tools.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/sidebar.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/palette.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js",
|
2020-04-27 10:17:19 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js",
|
2020-05-06 15:15:12 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editor.js",
|
2021-09-02 09:33:43 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/*.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/*.js",
|
2021-04-29 16:58:41 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/*.js",
|
2018-10-18 22:49:47 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/event-log.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tray.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/notifications.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/search.js",
|
2022-06-16 12:59:14 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js",
|
2019-06-11 21:43:01 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/actionList.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js",
|
2020-03-03 19:04:32 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/group.js",
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/userSettings.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectUserSettings.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js",
|
2021-09-08 21:57:35 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/touch/radialMenu.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/js/ui/tour/*.js"
|
2016-05-18 10:11:59 +00:00
|
|
|
],
|
2024-05-30 12:35:55 +00:00
|
|
|
nonull: true,
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: "packages/node_modules/@node-red/editor-client/public/red/red.js"
|
2015-04-12 23:10:10 +00:00
|
|
|
},
|
|
|
|
vendor: {
|
2024-05-30 12:35:55 +00:00
|
|
|
files: [
|
|
|
|
{
|
|
|
|
src: [
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-3.5.1.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-migrate-3.3.0.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-ui.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js",
|
|
|
|
"node_modules/marked/marked.min.js",
|
|
|
|
"node_modules/dompurify/dist/purify.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/d3/d3.v3.min.js",
|
|
|
|
"node_modules/i18next/i18next.min.js",
|
|
|
|
"node_modules/i18next-http-backend/i18nextHttpBackend.min.js",
|
|
|
|
"node_modules/jquery-i18next/jquery-i18next.min.js",
|
|
|
|
"node_modules/jsonata/jsonata-es5.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/formatter.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ace.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/ace/ext-language_tools.js"
|
|
|
|
],
|
|
|
|
nonull: true,
|
|
|
|
dest: "packages/node_modules/@node-red/editor-client/public/vendor/vendor.js"
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// src: [
|
|
|
|
// // TODO: resolve relative resource paths in
|
|
|
|
// // bootstrap/FA/jquery
|
|
|
|
// ],
|
|
|
|
// dest: "packages/node_modules/@node-red/editor-client/public/vendor/vendor.css"
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
src: [
|
|
|
|
"node_modules/jsonata/jsonata-es5.min.js",
|
|
|
|
"packages/node_modules/@node-red/editor-client/src/vendor/jsonata/worker-jsonata.js"
|
|
|
|
],
|
|
|
|
nonull: true,
|
|
|
|
dest: "packages/node_modules/@node-red/editor-client/public/vendor/ace/worker-jsonata.js",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: "node_modules/mermaid/dist/mermaid.min.js",
|
|
|
|
nonull: true,
|
|
|
|
dest: "packages/node_modules/@node-red/editor-client/public/vendor/mermaid/mermaid.min.js",
|
|
|
|
},
|
|
|
|
]
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {
|
|
|
|
build: {
|
|
|
|
files: {
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/public/red/red.min.js': 'packages/node_modules/@node-red/editor-client/public/red/red.js',
|
|
|
|
'packages/node_modules/@node-red/editor-client/public/red/main.min.js': 'packages/node_modules/@node-red/editor-client/public/red/main.js',
|
|
|
|
'packages/node_modules/@node-red/editor-client/public/vendor/ace/mode-jsonata.js': 'packages/node_modules/@node-red/editor-client/src/vendor/jsonata/mode-jsonata.js',
|
|
|
|
'packages/node_modules/@node-red/editor-client/public/vendor/ace/snippets/jsonata.js': 'packages/node_modules/@node-red/editor-client/src/vendor/jsonata/snippets-jsonata.js'
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
sass: {
|
|
|
|
build: {
|
2014-06-28 20:40:46 +00:00
|
|
|
options: {
|
2019-10-25 14:23:51 +00:00
|
|
|
implementation: sass,
|
2015-04-01 22:24:47 +00:00
|
|
|
outputStyle: 'compressed'
|
2014-06-28 20:40:46 +00:00
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
files: [{
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/style.min.css',
|
|
|
|
src: 'packages/node_modules/@node-red/editor-client/src/sass/style.scss'
|
2015-04-01 22:24:47 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
2015-05-28 14:28:17 +00:00
|
|
|
jsonlint: {
|
|
|
|
messages: {
|
|
|
|
src: [
|
2018-09-06 14:16:43 +00:00
|
|
|
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
2018-10-03 13:08:16 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
2018-09-06 14:16:43 +00:00
|
|
|
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
2015-05-28 14:28:17 +00:00
|
|
|
]
|
2016-12-04 22:59:43 +00:00
|
|
|
},
|
|
|
|
keymaps: {
|
|
|
|
src: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/src/js/keymap.json'
|
2016-12-04 22:59:43 +00:00
|
|
|
]
|
2015-05-28 14:28:17 +00:00
|
|
|
}
|
|
|
|
},
|
2015-04-09 20:12:39 +00:00
|
|
|
attachCopyright: {
|
|
|
|
js: {
|
|
|
|
src: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/public/red/red.min.js',
|
|
|
|
'packages/node_modules/@node-red/editor-client/public/red/main.min.js'
|
2015-04-09 20:12:39 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
css: {
|
|
|
|
src: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/public/red/style.min.css'
|
2015-04-09 20:12:39 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
clean: {
|
|
|
|
build: {
|
|
|
|
src: [
|
2018-08-17 21:10:54 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/public/red",
|
|
|
|
"packages/node_modules/@node-red/editor-client/public/index.html",
|
|
|
|
"packages/node_modules/@node-red/editor-client/public/favicon.ico",
|
|
|
|
"packages/node_modules/@node-red/editor-client/public/icons",
|
2021-04-29 16:58:41 +00:00
|
|
|
"packages/node_modules/@node-red/editor-client/public/vendor",
|
|
|
|
"packages/node_modules/@node-red/editor-client/public/types/node",
|
|
|
|
"packages/node_modules/@node-red/editor-client/public/types/node-red",
|
2015-04-01 22:24:47 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
release: {
|
|
|
|
src: [
|
|
|
|
'<%= paths.dist %>'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
js: {
|
|
|
|
files: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/src/js/**/*.js'
|
2014-06-28 20:40:46 +00:00
|
|
|
],
|
2019-09-10 16:04:53 +00:00
|
|
|
tasks: ['copy:build','concat',/*'uglify',*/ 'attachCopyright:js']
|
2015-04-01 22:24:47 +00:00
|
|
|
},
|
|
|
|
sass: {
|
|
|
|
files: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/src/sass/**/*.scss'
|
2015-04-01 22:24:47 +00:00
|
|
|
],
|
2015-04-09 20:12:39 +00:00
|
|
|
tasks: ['sass','attachCopyright:css']
|
2015-05-28 14:28:17 +00:00
|
|
|
},
|
|
|
|
json: {
|
|
|
|
files: [
|
2018-09-06 14:16:43 +00:00
|
|
|
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
2018-10-03 13:08:16 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
2018-09-06 14:16:43 +00:00
|
|
|
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
2015-05-28 14:28:17 +00:00
|
|
|
],
|
|
|
|
tasks: ['jsonlint:messages']
|
2016-06-08 15:18:24 +00:00
|
|
|
},
|
2016-12-04 22:59:43 +00:00
|
|
|
keymaps: {
|
|
|
|
files: [
|
2018-08-17 21:10:54 +00:00
|
|
|
'packages/node_modules/@node-red/editor-client/src/js/keymap.json'
|
2016-12-04 22:59:43 +00:00
|
|
|
],
|
|
|
|
tasks: ['jsonlint:keymaps','copy:build']
|
|
|
|
},
|
2021-09-08 21:57:35 +00:00
|
|
|
tours: {
|
|
|
|
files: [
|
|
|
|
'packages/node_modules/@node-red/editor-client/src/tours/**/*.js'
|
|
|
|
],
|
|
|
|
tasks: ['copy:build']
|
|
|
|
},
|
2016-06-08 15:18:24 +00:00
|
|
|
misc: {
|
|
|
|
files: [
|
|
|
|
'CHANGELOG.md'
|
|
|
|
],
|
|
|
|
tasks: ['copy:build']
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
},
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
nodemon: {
|
|
|
|
/* uses .nodemonignore */
|
|
|
|
dev: {
|
2018-08-18 23:44:17 +00:00
|
|
|
script: 'packages/node_modules/node-red/red.js',
|
2015-04-01 22:24:47 +00:00
|
|
|
options: {
|
2015-08-13 21:41:51 +00:00
|
|
|
args: nodemonArgs,
|
2015-05-28 14:28:17 +00:00
|
|
|
ext: 'js,html,json',
|
2015-04-09 21:18:37 +00:00
|
|
|
watch: [
|
2018-09-06 14:16:43 +00:00
|
|
|
'packages/node_modules',
|
|
|
|
'!packages/node_modules/@node-red/editor-client'
|
2015-04-09 21:18:37 +00:00
|
|
|
]
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
concurrent: {
|
|
|
|
dev: {
|
|
|
|
tasks: ['nodemon', 'watch'],
|
|
|
|
options: {
|
|
|
|
logConcurrentOutput: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
copy: {
|
|
|
|
build: {
|
2016-11-02 22:53:18 +00:00
|
|
|
files:[
|
|
|
|
{
|
2018-08-17 21:10:54 +00:00
|
|
|
src: 'packages/node_modules/@node-red/editor-client/src/js/main.js',
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/main.js'
|
2016-11-02 22:53:18 +00:00
|
|
|
},
|
2016-12-04 22:59:43 +00:00
|
|
|
{
|
2018-08-17 21:10:54 +00:00
|
|
|
src: 'packages/node_modules/@node-red/editor-client/src/js/keymap.json',
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/keymap.json'
|
2016-12-04 22:59:43 +00:00
|
|
|
},
|
2016-11-02 22:53:18 +00:00
|
|
|
{
|
2018-08-17 21:10:54 +00:00
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src/images',
|
2016-11-02 22:53:18 +00:00
|
|
|
src: '**',
|
|
|
|
expand: true,
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/images/'
|
2016-11-02 22:53:18 +00:00
|
|
|
},
|
|
|
|
{
|
2018-08-17 21:10:54 +00:00
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src/vendor',
|
2016-11-02 22:53:18 +00:00
|
|
|
src: [
|
|
|
|
'ace/**',
|
2019-04-29 10:50:15 +00:00
|
|
|
'jquery/css/base/**',
|
2021-04-29 16:58:41 +00:00
|
|
|
'font-awesome/**',
|
|
|
|
'monaco/dist/**',
|
|
|
|
'monaco/types/extraLibs.js',
|
|
|
|
'monaco/style.css',
|
|
|
|
'monaco/monaco-bootstrap.js'
|
2016-11-02 22:53:18 +00:00
|
|
|
],
|
|
|
|
expand: true,
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/'
|
2016-11-02 22:53:18 +00:00
|
|
|
},
|
2021-04-29 16:58:41 +00:00
|
|
|
{
|
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src',
|
|
|
|
src: [
|
2023-03-03 10:55:06 +00:00
|
|
|
'types/node/**/*.ts',
|
2021-04-29 16:58:41 +00:00
|
|
|
'types/node-red/*.ts',
|
|
|
|
],
|
|
|
|
expand: true,
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/'
|
|
|
|
},
|
2016-11-02 22:53:18 +00:00
|
|
|
{
|
2018-08-17 21:10:54 +00:00
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src/icons',
|
2016-11-02 22:53:18 +00:00
|
|
|
src: '**',
|
|
|
|
expand: true,
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/icons/'
|
2016-11-02 22:53:18 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
expand: true,
|
2018-08-17 21:10:54 +00:00
|
|
|
src: ['packages/node_modules/@node-red/editor-client/src/index.html','packages/node_modules/@node-red/editor-client/src/favicon.ico'],
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/',
|
2016-11-02 22:53:18 +00:00
|
|
|
flatten: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'CHANGELOG.md',
|
2018-08-17 21:10:54 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/about'
|
2018-10-02 22:01:34 +00:00
|
|
|
},
|
2018-12-07 16:10:51 +00:00
|
|
|
{
|
|
|
|
src: 'CHANGELOG.md',
|
|
|
|
dest: 'packages/node_modules/node-red/'
|
|
|
|
},
|
2018-10-02 22:01:34 +00:00
|
|
|
{
|
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src/ace/bin/',
|
|
|
|
src: '**',
|
|
|
|
expand: true,
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/ace/'
|
2021-09-08 21:57:35 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
cwd: 'packages/node_modules/@node-red/editor-client/src/tours',
|
|
|
|
src: '**',
|
|
|
|
expand: true,
|
|
|
|
dest: 'packages/node_modules/@node-red/editor-client/public/red/tours/'
|
2016-11-02 22:53:18 +00:00
|
|
|
}
|
2016-06-08 15:18:24 +00:00
|
|
|
]
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
|
|
|
},
|
2015-06-17 12:38:49 +00:00
|
|
|
chmod: {
|
|
|
|
options: {
|
|
|
|
mode: '755'
|
|
|
|
},
|
|
|
|
release: {
|
|
|
|
src: [
|
2018-08-30 14:28:24 +00:00
|
|
|
"packages/node_modules/@node-red/nodes/core/hardware/nrgpio",
|
|
|
|
"packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/git/node-red-*sh"
|
2015-06-17 12:38:49 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2018-10-25 10:18:13 +00:00
|
|
|
'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']
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2015-04-01 22:24:47 +00:00
|
|
|
compress: {
|
|
|
|
release: {
|
|
|
|
options: {
|
|
|
|
archive: '<%= paths.dist %>/node-red-<%= pkg.version %>.zip'
|
|
|
|
},
|
|
|
|
expand: true,
|
2018-08-30 14:28:24 +00:00
|
|
|
cwd: 'packages/node_modules/',
|
|
|
|
src: [
|
|
|
|
'**',
|
|
|
|
'!@node-red/editor-client/src/**'
|
|
|
|
]
|
2014-03-31 12:31:31 +00:00
|
|
|
}
|
2018-04-24 15:48:32 +00:00
|
|
|
},
|
|
|
|
jsdoc : {
|
2018-12-05 13:00:25 +00:00
|
|
|
modules: {
|
2018-11-30 23:01:09 +00:00
|
|
|
src: [
|
2019-02-28 22:21:22 +00:00
|
|
|
'API.md',
|
2018-11-30 23:01:09 +00:00
|
|
|
'packages/node_modules/node-red/lib/red.js',
|
|
|
|
'packages/node_modules/@node-red/runtime/lib/index.js',
|
|
|
|
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
2018-12-05 13:00:25 +00:00
|
|
|
'packages/node_modules/@node-red/runtime/lib/events.js',
|
2020-07-30 16:52:11 +00:00
|
|
|
'packages/node_modules/@node-red/runtime/lib/hooks.js',
|
2018-12-05 13:00:25 +00:00
|
|
|
'packages/node_modules/@node-red/util/**/*.js',
|
2019-01-28 14:40:24 +00:00
|
|
|
'packages/node_modules/@node-red/editor-api/lib/index.js',
|
2020-12-02 09:25:10 +00:00
|
|
|
'packages/node_modules/@node-red/editor-api/lib/auth/index.js',
|
|
|
|
'packages/node_modules/@node-red/registry/lib/index.js'
|
2019-01-28 14:40:24 +00:00
|
|
|
],
|
2018-04-24 15:48:32 +00:00
|
|
|
options: {
|
|
|
|
destination: 'docs',
|
2021-04-16 10:56:23 +00:00
|
|
|
configure: './jsdoc.json',
|
|
|
|
fred: "hi there"
|
2018-04-24 15:48:32 +00:00
|
|
|
}
|
2018-12-10 22:20:56 +00:00
|
|
|
},
|
2019-02-28 22:21:22 +00:00
|
|
|
_editor: {
|
2018-12-10 22:20:56 +00:00
|
|
|
src: [
|
|
|
|
'packages/node_modules/@node-red/editor-client/src/js'
|
|
|
|
],
|
|
|
|
options: {
|
|
|
|
destination: 'packages/node_modules/@node-red/editor-client/docs',
|
|
|
|
configure: './jsdoc.json'
|
|
|
|
}
|
2018-04-24 15:48:32 +00:00
|
|
|
}
|
2018-12-10 22:20:56 +00:00
|
|
|
|
2018-04-24 15:48:32 +00:00
|
|
|
},
|
|
|
|
jsdoc2md: {
|
|
|
|
runtimeAPI: {
|
|
|
|
options: {
|
|
|
|
separators: true
|
|
|
|
},
|
2018-12-05 13:00:25 +00:00
|
|
|
src: [
|
|
|
|
'packages/node_modules/@node-red/runtime/lib/index.js',
|
|
|
|
'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
|
|
|
'packages/node_modules/@node-red/runtime/lib/events.js'
|
|
|
|
],
|
2018-11-16 10:04:53 +00:00
|
|
|
dest: 'packages/node_modules/@node-red/runtime/docs/api.md'
|
2018-08-22 09:00:03 +00:00
|
|
|
},
|
|
|
|
nodeREDUtil: {
|
|
|
|
options: {
|
|
|
|
separators: true
|
|
|
|
},
|
|
|
|
src: 'packages/node_modules/@node-red/util/**/*.js',
|
|
|
|
dest: 'packages/node_modules/@node-red/util/docs/api.md'
|
2018-04-24 15:48:32 +00:00
|
|
|
}
|
2015-04-01 22:24:47 +00:00
|
|
|
}
|
2014-03-31 12:31:31 +00:00
|
|
|
});
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2014-03-31 12:31:31 +00:00
|
|
|
grunt.loadNpmTasks('grunt-simple-mocha');
|
2014-06-28 20:40:46 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-concurrent');
|
|
|
|
grunt.loadNpmTasks('grunt-sass');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-compress');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
2015-06-17 12:38:49 +00:00
|
|
|
grunt.loadNpmTasks('grunt-chmod');
|
2015-05-28 14:28:17 +00:00
|
|
|
grunt.loadNpmTasks('grunt-jsonlint');
|
2019-08-06 15:32:46 +00:00
|
|
|
if (fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
|
|
|
grunt.loadNpmTasks('grunt-webdriver');
|
|
|
|
}
|
2018-04-24 15:48:32 +00:00
|
|
|
grunt.loadNpmTasks('grunt-jsdoc');
|
|
|
|
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
2018-10-25 10:18:13 +00:00
|
|
|
grunt.loadNpmTasks('grunt-npm-command');
|
|
|
|
grunt.loadNpmTasks('grunt-mkdir');
|
2020-10-19 20:10:34 +00:00
|
|
|
grunt.loadNpmTasks('grunt-simple-nyc');
|
2015-07-10 18:49:31 +00:00
|
|
|
|
2020-09-29 11:11:10 +00:00
|
|
|
grunt.registerMultiTask('nodemon', 'Runs a nodemon monitor of your node.js server.', function () {
|
|
|
|
const nodemon = require('nodemon');
|
|
|
|
this.async();
|
|
|
|
const options = this.options();
|
|
|
|
options.script = this.data.script;
|
|
|
|
let callback;
|
|
|
|
if (options.callback) {
|
|
|
|
callback = options.callback;
|
|
|
|
delete options.callback;
|
|
|
|
} else {
|
|
|
|
callback = function(nodemonApp) {
|
|
|
|
nodemonApp.on('log', function (event) {
|
|
|
|
console.log(event.colour);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
callback(nodemon(options));
|
|
|
|
});
|
|
|
|
|
2015-04-09 20:12:39 +00:00
|
|
|
grunt.registerMultiTask('attachCopyright', function() {
|
|
|
|
var files = this.data.src;
|
|
|
|
var copyright = "/**\n"+
|
2021-10-22 08:14:01 +00:00
|
|
|
" * Copyright OpenJS Foundation and other contributors, https://openjsf.org/\n"+
|
2015-04-09 20:12:39 +00:00
|
|
|
" *\n"+
|
|
|
|
" * Licensed under the Apache License, Version 2.0 (the \"License\");\n"+
|
|
|
|
" * you may not use this file except in compliance with the License.\n"+
|
|
|
|
" * You may obtain a copy of the License at\n"+
|
|
|
|
" *\n"+
|
|
|
|
" * http://www.apache.org/licenses/LICENSE-2.0\n"+
|
|
|
|
" *\n"+
|
|
|
|
" * Unless required by applicable law or agreed to in writing, software\n"+
|
|
|
|
" * distributed under the License is distributed on an \"AS IS\" BASIS,\n"+
|
|
|
|
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"+
|
|
|
|
" * See the License for the specific language governing permissions and\n"+
|
|
|
|
" * limitations under the License.\n"+
|
|
|
|
" **/\n";
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-09 20:12:39 +00:00
|
|
|
if (files) {
|
2017-03-10 20:04:14 +00:00
|
|
|
for (var i=0; i<files.length; i++) {
|
2015-04-09 20:12:39 +00:00
|
|
|
var file = files[i];
|
|
|
|
if (!grunt.file.exists(file)) {
|
|
|
|
grunt.log.warn('File '+ file + ' not found');
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
var content = grunt.file.read(file);
|
|
|
|
if (content.indexOf(copyright) == -1) {
|
|
|
|
content = copyright+content;
|
|
|
|
if (!grunt.file.write(file, content)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
grunt.log.writeln("Attached copyright to "+file);
|
|
|
|
} else {
|
|
|
|
grunt.log.writeln("Copyright already on "+file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2015-06-15 19:38:40 +00:00
|
|
|
|
2018-08-18 23:44:17 +00:00
|
|
|
grunt.registerTask('verifyPackageDependencies', function() {
|
2018-12-07 14:13:59 +00:00
|
|
|
var done = this.async();
|
2018-08-18 23:44:17 +00:00
|
|
|
var verifyDependencies = require("./scripts/verify-package-dependencies.js");
|
2018-12-07 14:13:59 +00:00
|
|
|
verifyDependencies().then(function(failures) {
|
|
|
|
if (failures.length > 0) {
|
|
|
|
failures.forEach(f => grunt.log.error(f));
|
|
|
|
grunt.fail.fatal("Failed to verify package dependencies");
|
|
|
|
}
|
|
|
|
done();
|
|
|
|
});
|
2018-08-18 23:44:17 +00:00
|
|
|
});
|
|
|
|
|
2019-01-20 10:10:54 +00:00
|
|
|
grunt.registerTask('verifyUiTestDependencies', function() {
|
2019-08-06 15:32:46 +00:00
|
|
|
if (!fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
|
|
|
grunt.fail.fatal('You need to install the UI test dependencies first.\nUse the script in "scripts/install-ui-test-dependencies.sh"');
|
2019-01-20 10:10:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
2019-10-14 14:50:48 +00:00
|
|
|
grunt.registerTask('generatePublishScript',
|
|
|
|
'Generates a script to publish build output to npm',
|
|
|
|
function () {
|
|
|
|
const done = this.async();
|
|
|
|
const generatePublishScript = require("./scripts/generate-publish-script.js");
|
|
|
|
generatePublishScript().then(function(output) {
|
|
|
|
grunt.log.writeln(output);
|
|
|
|
|
|
|
|
const filePath = path.join(grunt.config.get('paths.dist'),"modules","publish.sh");
|
|
|
|
grunt.file.write(filePath,output);
|
2019-01-20 10:10:54 +00:00
|
|
|
|
2019-10-14 14:50:48 +00:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
2015-05-11 19:24:15 +00:00
|
|
|
grunt.registerTask('setDevEnv',
|
2015-06-15 19:38:40 +00:00
|
|
|
'Sets NODE_ENV=development so non-minified assets are used',
|
2015-05-11 19:24:15 +00:00
|
|
|
function () {
|
|
|
|
process.env.NODE_ENV = 'development';
|
|
|
|
});
|
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('default',
|
|
|
|
'Builds editor content then runs code style checks and unit tests on all components',
|
2020-10-19 20:10:34 +00:00
|
|
|
['build','verifyPackageDependencies','jshint:editor','nyc:all']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2020-12-07 11:45:53 +00:00
|
|
|
grunt.registerTask('no-coverage',
|
|
|
|
'Builds editor content then runs code style checks and unit tests on all components without code coverage',
|
|
|
|
['build','verifyPackageDependencies','jshint:editor','simplemocha:all']);
|
|
|
|
|
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('test-core',
|
|
|
|
'Runs code style check and unit tests on core runtime code',
|
2020-10-19 20:10:34 +00:00
|
|
|
['build','nyc:core']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('test-editor',
|
|
|
|
'Runs code style check on editor code',
|
|
|
|
['jshint:editor']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2019-08-06 15:32:46 +00:00
|
|
|
if (!fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
|
|
|
|
grunt.registerTask('test-ui',
|
|
|
|
'Builds editor content then runs unit tests on editor ui',
|
|
|
|
['verifyUiTestDependencies']);
|
|
|
|
} else {
|
|
|
|
grunt.registerTask('test-ui',
|
|
|
|
'Builds editor content then runs unit tests on editor ui',
|
|
|
|
['verifyUiTestDependencies','build','jshint:editor','webdriver:all']);
|
|
|
|
}
|
2017-12-01 10:50:59 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('test-nodes',
|
|
|
|
'Runs unit tests on core nodes',
|
2020-10-19 20:10:34 +00:00
|
|
|
['build','nyc:nodes']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('build',
|
|
|
|
'Builds editor content',
|
2016-12-04 22:59:43 +00:00
|
|
|
['clean:build','jsonlint','concat:build','concat:vendor','copy:build','uglify:build','sass:build','attachCopyright']);
|
2020-08-13 23:08:09 +00:00
|
|
|
|
2020-06-27 10:24:06 +00:00
|
|
|
grunt.registerTask('build-dev',
|
|
|
|
'Developer mode: build dev version',
|
|
|
|
['clean:build','concat:build','concat:vendor','copy:build','sass:build','setDevEnv']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('dev',
|
|
|
|
'Developer mode: run node-red, watch for source changes and build/restart',
|
2015-05-11 19:24:15 +00:00
|
|
|
['build','setDevEnv','concurrent:dev']);
|
2015-04-16 10:53:39 +00:00
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
grunt.registerTask('release',
|
|
|
|
'Create distribution zip file',
|
2019-10-14 14:50:48 +00:00
|
|
|
['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules','generatePublishScript']);
|
2018-10-25 10:18:13 +00:00
|
|
|
|
|
|
|
grunt.registerTask('pack-modules',
|
|
|
|
'Create module pack files for release',
|
|
|
|
['mkdir:release','npm-command']);
|
|
|
|
|
2015-04-01 22:24:47 +00:00
|
|
|
|
2017-03-10 20:04:14 +00:00
|
|
|
grunt.registerTask('coverage',
|
|
|
|
'Run Istanbul code test coverage task',
|
2020-10-19 20:10:34 +00:00
|
|
|
['build','nyc:all']);
|
2018-04-24 15:48:32 +00:00
|
|
|
|
|
|
|
grunt.registerTask('docs',
|
|
|
|
'Generates API documentation',
|
2019-02-28 22:21:22 +00:00
|
|
|
['jsdoc']);
|
2014-03-31 12:31:31 +00:00
|
|
|
};
|