Demo for query storing
Change-Id: I947bcac841992c3f6cfd01ab337c265b0d01cb70
diff --git a/node_modules/grunt-legacy-log/.github/workflows/test.yml b/node_modules/grunt-legacy-log/.github/workflows/test.yml
new file mode 100644
index 0000000..6cb24fa
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.github/workflows/test.yml
@@ -0,0 +1,40 @@
+name: Tests
+on: [push, pull_request]
+env:
+ CI: true
+
+jobs:
+ run:
+ name: Node ${{ matrix.node }} on ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ fail-fast: false
+ matrix:
+ node: [10, 12, 14]
+ os: [ubuntu-latest, windows-latest]
+
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v2
+
+ - name: Set Node.js version
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node }}
+
+ - run: node --version
+ - run: npm --version
+
+ - name: Install npm dependencies
+ run: npm i
+
+ - name: Run tests
+ run: npm test
+
+ # We test multiple Windows shells because of prior stdout buffering issues
+ # filed against Grunt. https://github.com/joyent/node/issues/3584
+ - name: Run PowerShell tests
+ run: "npm test # PowerShell" # Pass comment to PS for easier debugging
+ shell: powershell
+ if: startsWith(matrix.os, 'windows')
diff --git a/node_modules/grunt-legacy-log/.idea/grunt-legacy-log.iml b/node_modules/grunt-legacy-log/.idea/grunt-legacy-log.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.idea/grunt-legacy-log.iml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
\ No newline at end of file
diff --git a/node_modules/grunt-legacy-log/.idea/misc.xml b/node_modules/grunt-legacy-log/.idea/misc.xml
new file mode 100644
index 0000000..28a804d
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.idea/misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="JavaScriptSettings">
+ <option name="languageLevel" value="ES6" />
+ </component>
+</project>
\ No newline at end of file
diff --git a/node_modules/grunt-legacy-log/.idea/modules.xml b/node_modules/grunt-legacy-log/.idea/modules.xml
new file mode 100644
index 0000000..20a40a8
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/grunt-legacy-log.iml" filepath="$PROJECT_DIR$/.idea/grunt-legacy-log.iml" />
+ </modules>
+ </component>
+</project>
\ No newline at end of file
diff --git a/node_modules/grunt-legacy-log/.idea/vcs.xml b/node_modules/grunt-legacy-log/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
\ No newline at end of file
diff --git a/node_modules/grunt-legacy-log/.idea/workspace.xml b/node_modules/grunt-legacy-log/.idea/workspace.xml
new file mode 100644
index 0000000..85cdee0
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.idea/workspace.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ChangeListManager">
+ <list default="true" id="332ba4df-ff23-413b-8040-2aec296022c8" name="Default Changelist" comment="">
+ <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
+ </list>
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="Git.Settings">
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+ </component>
+ <component name="MacroExpansionManager">
+ <option name="directoryName" value="olk0g0b4" />
+ </component>
+ <component name="ProjectId" id="1fHB57wKxOm3R468DcBGpuZlYSS" />
+ <component name="ProjectViewState">
+ <option name="hideEmptyMiddlePackages" value="true" />
+ <option name="showLibraryContents" value="true" />
+ </component>
+ <component name="PropertiesComponent">
+ <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+ <property name="WebServerToolWindowFactoryState" value="false" />
+ <property name="node.js.detected.package.eslint" value="true" />
+ <property name="node.js.detected.package.tslint" value="true" />
+ <property name="node.js.path.for.package.eslint" value="project" />
+ <property name="node.js.path.for.package.tslint" value="project" />
+ <property name="node.js.selected.package.eslint" value="(autodetect)" />
+ <property name="node.js.selected.package.tslint" value="(autodetect)" />
+ <property name="nodejs_package_manager_path" value="npm" />
+ </component>
+ <component name="SvnConfiguration">
+ <configuration />
+ </component>
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="332ba4df-ff23-413b-8040-2aec296022c8" name="Default Changelist" comment="" />
+ <created>1595864952019</created>
+ <option name="number" value="Default" />
+ <option name="presentableId" value="Default" />
+ <updated>1595864952019</updated>
+ <workItem from="1595864953191" duration="1373000" />
+ </task>
+ <servers />
+ </component>
+ <component name="TypeScriptGeneratedFilesManager">
+ <option name="version" value="2" />
+ </component>
+</project>
\ No newline at end of file
diff --git a/node_modules/grunt-legacy-log/.jshintrc b/node_modules/grunt-legacy-log/.jshintrc
new file mode 100644
index 0000000..2b7e39b
--- /dev/null
+++ b/node_modules/grunt-legacy-log/.jshintrc
@@ -0,0 +1,14 @@
+{
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "latedef": "nofunc",
+ "newcap": true,
+ "noarg": true,
+ "sub": true,
+ "undef": true,
+ "unused": true,
+ "boss": true,
+ "eqnull": true,
+ "node": true
+}
diff --git a/node_modules/grunt-legacy-log/CHANGELOG b/node_modules/grunt-legacy-log/CHANGELOG
new file mode 100644
index 0000000..a5863ab
--- /dev/null
+++ b/node_modules/grunt-legacy-log/CHANGELOG
@@ -0,0 +1,19 @@
+v3.0.0:
+ date: 2020-07-27
+ changes:
+ - Update dependencies
+v2.0.0:
+ date: 2018-05-19
+ changes:
+ - Fix to security warnings
+ - Update to latest grunt-legacy-log-utils
+v1.0.1:
+ date: 2018-03-01
+ changes:
+ - Update lodash to fix security warning
+v1.0.0:
+ date: 2016-04-03
+ changes:
+ - Add appveyor testing
+ - Fix node.js version support
+ - Peer dependency updates
diff --git a/node_modules/grunt-legacy-log/Gruntfile.js b/node_modules/grunt-legacy-log/Gruntfile.js
new file mode 100644
index 0000000..d7e5845
--- /dev/null
+++ b/node_modules/grunt-legacy-log/Gruntfile.js
@@ -0,0 +1,30 @@
+'use strict';
+
+module.exports = function(grunt) {
+
+ grunt.initConfig({
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc',
+ },
+ all: ['*.js', 'test/*.js'],
+ },
+ nodeunit: {
+ util: ['test/index.js']
+ },
+ watch: {
+ all: {
+ files: ['<%= jshint.all %>'],
+ tasks: ['test'],
+ },
+ },
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-nodeunit');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+
+ grunt.registerTask('test', ['jshint', 'nodeunit']);
+ grunt.registerTask('default', ['test', 'watch']);
+
+};
diff --git a/node_modules/grunt-legacy-log/LICENSE-MIT b/node_modules/grunt-legacy-log/LICENSE-MIT
new file mode 100644
index 0000000..5c0695e
--- /dev/null
+++ b/node_modules/grunt-legacy-log/LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2018 "Cowboy" Ben Alman
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/grunt-legacy-log/README.md b/node_modules/grunt-legacy-log/README.md
new file mode 100644
index 0000000..3597e5b
--- /dev/null
+++ b/node_modules/grunt-legacy-log/README.md
@@ -0,0 +1,5 @@
+# grunt-legacy-log
+> The Grunt logger.
+
+[](http://gruntjs.com/)
+[](https://github.com/gruntjs/grunt-legacy-log/actions?workflow=Tests)
diff --git a/node_modules/grunt-legacy-log/examples.js b/node_modules/grunt-legacy-log/examples.js
new file mode 100644
index 0000000..888ed80
--- /dev/null
+++ b/node_modules/grunt-legacy-log/examples.js
@@ -0,0 +1,26 @@
+var Log = require('./').Log;
+
+function doThings(options) {
+ console.log();
+ console.log(options);
+ var log = new Log(options);
+ log.header("Header line.");
+ log.subhead("Subhead line.");
+ log.write("Testing").write(" 123...").writeln("done!");
+ log.write("Verbose: ").verbose.write("YES").or.write("NO").always.write(", ");
+ log.notverbose.write("NO").or.write("YES").always.writeln("!");
+ log.warn("This is a warning.");
+ log.write("Doing something...").warn();
+ log.error("This is an error.");
+ log.write("Doing something...").error();
+ log.ok("This is ok.");
+ log.write("Doing something...").ok();
+ log.errorlns("This is a very long line in errorlns that should wrap eventually, given that it is a very long line.");
+ log.oklns("This is a very long line in oklns that should wrap eventually, given that it is a very long line.");
+ log.success("This is a success message.");
+ log.fail("This is a fail message.");
+ log.debug("This is a debug message.");
+}
+
+doThings({});
+doThings({verbose: true});
diff --git a/node_modules/grunt-legacy-log/index.js b/node_modules/grunt-legacy-log/index.js
new file mode 100644
index 0000000..52d34ed
--- /dev/null
+++ b/node_modules/grunt-legacy-log/index.js
@@ -0,0 +1,299 @@
+/*
+ * grunt
+ * http://gruntjs.com/
+ *
+ * Copyright (c) 2018 "Cowboy" Ben Alman
+ * Licensed under the MIT license.
+ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
+ */
+
+'use strict';
+
+// Nodejs libs.
+var util = require('util');
+
+// External libs.
+var hooker = require('hooker');
+// Requiring this here modifies the String prototype!
+var colors = require('colors');
+var _ = require('lodash');
+// TODO: ADD CHALK
+
+var logUtils = require('grunt-legacy-log-utils');
+
+function Log(options) {
+ // This property always refers to the "base" logger.
+ this.always = this;
+ // Extend options.
+ this.options = _.extend({}, {
+ // Show colors in output?
+ color: true,
+ // Enable verbose-mode logging?
+ verbose: false,
+ // Enable debug logging statement?
+ debug: false,
+ // Where should messages be output?
+ outStream: process.stdout,
+ // NOTE: the color, verbose, debug options will be ignored if the
+ // "grunt" option is specified! See the Log.prototype.option and
+ // the Log.prototype.error methods for more info.
+ grunt: null,
+ // Where should output wrap? If null, use legacy Grunt defaults.
+ maxCols: null,
+ // Should logger start muted?
+ muted: false,
+ }, options);
+ // True once anything has actually been logged.
+ this.hasLogged = false;
+
+ // Related verbose / notverbose loggers.
+ this.verbose = new VerboseLog(this, true);
+ this.notverbose = new VerboseLog(this, false);
+ this.verbose.or = this.notverbose;
+ this.notverbose.or = this.verbose;
+
+ // Apparently, people have using grunt.log in interesting ways. Just bind
+ // all methods so that "this" is irrelevant.
+ if (this.options.grunt) {
+ var properties = [
+ 'write',
+ 'writeln',
+ 'writetableln',
+ 'writelns',
+ 'writeflags',
+ 'warn',
+ 'error',
+ 'ok',
+ 'errorlns',
+ 'oklns',
+ 'success',
+ 'fail',
+ 'header',
+ 'subhead',
+ 'debug'
+ ];
+ _.bindAll(this, properties);
+ _.bindAll(this.verbose, properties);
+ _.bindAll(this.notverbose, properties);
+ }
+}
+exports.Log = Log;
+
+// Am I doing it wrong? :P
+function VerboseLog(parentLog, verbose) {
+ // Keep track of the original, base "Log" instance.
+ this.always = parentLog;
+ // This logger is either verbose (true) or notverbose (false).
+ this._isVerbose = verbose;
+}
+util.inherits(VerboseLog, Log);
+
+VerboseLog.prototype._write = function() {
+ // Abort if not in correct verbose mode.
+ if (Boolean(this.option('verbose')) !== this._isVerbose) { return; }
+ // Otherwise... log!
+ return VerboseLog.super_.prototype._write.apply(this, arguments);
+};
+
+// Create read/write accessors that prefer the parent log's properties (in
+// the case of verbose/notverbose) to the current log's properties.
+function makeSmartAccessor(name, isOption) {
+ Object.defineProperty(Log.prototype, name, {
+ enumerable: true,
+ configurable: true,
+ get: function() {
+ return isOption ? this.always._options[name] : this.always['_' + name];
+ },
+ set: function(value) {
+ if (isOption) {
+ this.always._options[name] = value;
+ } else {
+ this.always['_' + name] = value;
+ }
+ },
+ });
+}
+makeSmartAccessor('options');
+makeSmartAccessor('hasLogged');
+makeSmartAccessor('muted', true);
+
+// Disable colors if --no-colors was passed.
+Log.prototype.initColors = function() {
+ if (this.option('no-color')) {
+ // String color getters should just return the string.
+ colors.mode = 'none';
+ // Strip colors from strings passed to console.log.
+ hooker.hook(console, 'log', function() {
+ var args = _.toArray(arguments);
+ return hooker.filter(this, args.map(function(arg) {
+ return typeof arg === 'string' ? colors.stripColors(arg) : arg;
+ }));
+ });
+ }
+};
+
+// Check for color, verbose, debug options through Grunt if specified,
+// otherwise defer to options object properties.
+Log.prototype.option = function(name) {
+ if (this.options.grunt && this.options.grunt.option) {
+ return this.options.grunt.option(name);
+ }
+ var no = name.match(/^no-(.+)$/);
+ return no ? !this.options[no[1]] : this.options[name];
+};
+
+// Parse certain markup in strings to be logged.
+Log.prototype._markup = function(str) {
+ str = str || '';
+ // Make _foo_ underline.
+ str = str.replace(/(\s|^)_(\S|\S[\s\S]+?\S)_(?=[\s,.!?]|$)/g, '$1' + '$2'.underline);
+ // Make *foo* bold.
+ str = str.replace(/(\s|^)\*(\S|\S[\s\S]+?\S)\*(?=[\s,.!?]|$)/g, '$1' + '$2'.bold);
+ return str;
+};
+
+// Similar to util.format in the standard library, however it'll always
+// convert the first argument to a string and treat it as the format string.
+Log.prototype._format = function(args) {
+ args = _.toArray(args);
+ if (args.length > 0) {
+ args[0] = String(args[0]);
+ }
+ return util.format.apply(util, args);
+};
+
+Log.prototype._write = function(msg) {
+ // Abort if muted.
+ if (this.muted) { return; }
+ // Actually write output.
+ this.hasLogged = true;
+ msg = msg || '';
+ // Users should probably use the colors-provided methods, but if they
+ // don't, this should strip extraneous color codes.
+ if (this.option('no-color')) { msg = colors.stripColors(msg); }
+ // Actually write to stdout.
+ this.options.outStream.write(this._markup(msg));
+};
+
+Log.prototype._writeln = function(msg) {
+ // Write blank line if no msg is passed in.
+ this._write((msg || '') + '\n');
+};
+
+// Write output.
+Log.prototype.write = function() {
+ this._write(this._format(arguments));
+ return this;
+};
+
+// Write a line of output.
+Log.prototype.writeln = function() {
+ this._writeln(this._format(arguments));
+ return this;
+};
+
+Log.prototype.warn = function() {
+ var msg = this._format(arguments);
+ if (arguments.length > 0) {
+ this._writeln('>> '.red + _.trim(msg).replace(/\n/g, '\n>> '.red));
+ } else {
+ this._writeln('ERROR'.red);
+ }
+ return this;
+};
+Log.prototype.error = function() {
+ if (this.options.grunt && this.options.grunt.fail) {
+ this.options.grunt.fail.errorcount++;
+ }
+ this.warn.apply(this, arguments);
+ return this;
+};
+Log.prototype.ok = function() {
+ var msg = this._format(arguments);
+ if (arguments.length > 0) {
+ this._writeln('>> '.green + _.trim(msg).replace(/\n/g, '\n>> '.green));
+ } else {
+ this._writeln('OK'.green);
+ }
+ return this;
+};
+Log.prototype.errorlns = function() {
+ var msg = this._format(arguments);
+ this.error(this.wraptext(this.options.maxCols || 77, msg));
+ return this;
+};
+Log.prototype.oklns = function() {
+ var msg = this._format(arguments);
+ this.ok(this.wraptext(this.options.maxCols || 77, msg));
+ return this;
+};
+Log.prototype.success = function() {
+ var msg = this._format(arguments);
+ this._writeln(msg.green);
+ return this;
+};
+Log.prototype.fail = function() {
+ var msg = this._format(arguments);
+ this._writeln(msg.red);
+ return this;
+};
+Log.prototype.header = function() {
+ var msg = this._format(arguments);
+ // Skip line before header, but not if header is the very first line output.
+ if (this.hasLogged) { this._writeln(); }
+ this._writeln(msg.underline);
+ return this;
+};
+Log.prototype.subhead = function() {
+ var msg = this._format(arguments);
+ // Skip line before subhead, but not if subhead is the very first line output.
+ if (this.hasLogged) { this._writeln(); }
+ this._writeln(msg.bold);
+ return this;
+};
+// For debugging.
+Log.prototype.debug = function() {
+ var msg = this._format(arguments);
+ if (this.option('debug')) {
+ this._writeln('[D] ' + msg.magenta);
+ }
+ return this;
+};
+
+// Write a line of a table.
+Log.prototype.writetableln = function(widths, texts) {
+ this._writeln(this.table(widths, texts));
+ return this;
+};
+
+// Wrap a long line of text.
+Log.prototype.writelns = function() {
+ var msg = this._format(arguments);
+ this._writeln(this.wraptext(this.options.maxCols || 80, msg));
+ return this;
+};
+
+// Display flags in verbose mode.
+Log.prototype.writeflags = function(obj, prefix) {
+ var wordlist;
+ if (Array.isArray(obj)) {
+ wordlist = this.wordlist(obj);
+ } else if (typeof obj === 'object' && obj) {
+ wordlist = this.wordlist(Object.keys(obj).map(function(key) {
+ var val = obj[key];
+ return key + (val === true ? '' : '=' + JSON.stringify(val));
+ }));
+ }
+ this._writeln((prefix || 'Flags') + ': ' + (wordlist || '(none)'.cyan));
+ return this;
+};
+
+// Add static methods.
+[
+ 'wordlist',
+ 'uncolor',
+ 'wraptext',
+ 'table',
+].forEach(function(prop) {
+ Log.prototype[prop] = exports[prop] = logUtils[prop];
+});
diff --git a/node_modules/grunt-legacy-log/package.json b/node_modules/grunt-legacy-log/package.json
new file mode 100644
index 0000000..79bc08b
--- /dev/null
+++ b/node_modules/grunt-legacy-log/package.json
@@ -0,0 +1,67 @@
+{
+ "_from": "grunt-legacy-log@~3.0.0",
+ "_id": "grunt-legacy-log@3.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==",
+ "_location": "/grunt-legacy-log",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "grunt-legacy-log@~3.0.0",
+ "name": "grunt-legacy-log",
+ "escapedName": "grunt-legacy-log",
+ "rawSpec": "~3.0.0",
+ "saveSpec": null,
+ "fetchSpec": "~3.0.0"
+ },
+ "_requiredBy": [
+ "/grunt"
+ ],
+ "_resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz",
+ "_shasum": "1c6eaf92371ea415af31ea84ce50d434ef6d39c4",
+ "_spec": "grunt-legacy-log@~3.0.0",
+ "_where": "C:\\Users\\marcr\\Desktop\\KorAp\\Git\\Kalamar\\node_modules\\grunt",
+ "author": {
+ "name": "\"Cowboy\" Ben Alman",
+ "url": "http://benalman.com/"
+ },
+ "bugs": {
+ "url": "http://github.com/gruntjs/grunt-legacy-log/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "colors": "~1.1.2",
+ "grunt-legacy-log-utils": "~2.1.0",
+ "hooker": "~0.2.3",
+ "lodash": "~4.17.19"
+ },
+ "deprecated": false,
+ "description": "The Grunt 0.4.x logger.",
+ "devDependencies": {
+ "grunt": "^1.2.1",
+ "grunt-cli": "^1.3.2",
+ "grunt-contrib-jshint": "^2.1.0",
+ "grunt-contrib-nodeunit": "^2.1.0",
+ "grunt-contrib-watch": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "homepage": "http://gruntjs.com/",
+ "keywords": [
+ "grunt",
+ "legacy"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "grunt-legacy-log",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/gruntjs/grunt-legacy-log.git"
+ },
+ "scripts": {
+ "test": "grunt test"
+ },
+ "version": "3.0.0"
+}
diff --git a/node_modules/grunt-legacy-log/test/index.js b/node_modules/grunt-legacy-log/test/index.js
new file mode 100644
index 0000000..4806231
--- /dev/null
+++ b/node_modules/grunt-legacy-log/test/index.js
@@ -0,0 +1,519 @@
+'use strict';
+
+var legacyLog = require('../');
+var Log = legacyLog.Log;
+
+// Helper for testing stdout
+var hooker = require('hooker');
+function stdoutEqual(test, callback, expected) {
+ var actual = '';
+ // Hook process.stdout.write
+ hooker.hook(process.stdout, 'write', {
+ // This gets executed before the original process.stdout.write.
+ pre: function(result) {
+ // Concatenate uncolored result onto actual.
+ actual += result;
+ // Prevent the original process.stdout.write from executing.
+ return hooker.preempt();
+ },
+ });
+ // Execute the logging code to be tested.
+ callback();
+ // Restore process.stdout.write to its original value.
+ stdoutUnmute();
+ // Actually test the actually-logged stdout string to the expected value.
+ // test.equal(legacyLog.uncolor(actual), expected);
+ test.equal(actual, expected);
+}
+
+// Outright mute stdout.
+function stdoutMute() {
+ hooker.hook(process.stdout, 'write', {
+ pre: function() {
+ return hooker.preempt();
+ },
+ });
+}
+
+// Unmute stdout.
+function stdoutUnmute() {
+ hooker.unhook(process.stdout, 'write');
+}
+
+// Helper function: repeat('a', 3) -> 'aaa', repeat('a', 3, '-') -> 'a-a-a'
+function repeat(str, n, separator) {
+ var result = str;
+ for (var i = 1; i < n; i++) {
+ result += (separator || '') + str;
+ }
+ return result;
+}
+
+var fooBuffer = Buffer.from('foo');
+
+exports['Log instance'] = {
+ setUp: function(done) {
+ this.grunt = {fail: {errorcount: 0}};
+ done();
+ },
+ 'write': function(test) {
+ test.expect(4);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.write(''); }, '');
+ stdoutEqual(test, function() { log.write('foo'); }, 'foo');
+ stdoutEqual(test, function() { log.write('%s', 'foo'); }, 'foo');
+ stdoutEqual(test, function() { log.write(fooBuffer); }, 'foo');
+
+ test.done();
+ },
+ 'writeln': function(test) {
+ test.expect(4);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.writeln(); }, '\n');
+ stdoutEqual(test, function() { log.writeln('foo'); }, 'foo\n');
+ stdoutEqual(test, function() { log.writeln('%s', 'foo'); }, 'foo\n');
+ stdoutEqual(test, function() { log.writeln(fooBuffer); }, 'foo\n');
+
+ test.done();
+ },
+ 'warn': function(test) {
+ test.expect(5);
+ var log = new Log({grunt: this.grunt});
+
+ stdoutEqual(test, function() { log.warn(); }, 'ERROR'.red + '\n');
+ stdoutEqual(test, function() { log.warn('foo'); }, '>> '.red + 'foo\n');
+ stdoutEqual(test, function() { log.warn('%s', 'foo'); }, '>> '.red + 'foo\n');
+ stdoutEqual(test, function() { log.warn(fooBuffer); }, '>> '.red + 'foo\n');
+ test.equal(this.grunt.fail.errorcount, 0);
+
+ test.done();
+ },
+ 'error': function(test) {
+ test.expect(5);
+ var log = new Log({grunt: this.grunt});
+
+ stdoutEqual(test, function() { log.error(); }, 'ERROR'.red + '\n');
+ stdoutEqual(test, function() { log.error('foo'); }, '>> '.red + 'foo\n');
+ stdoutEqual(test, function() { log.error('%s', 'foo'); }, '>> '.red + 'foo\n');
+ stdoutEqual(test, function() { log.error(fooBuffer); }, '>> '.red + 'foo\n');
+ test.equal(this.grunt.fail.errorcount, 4);
+
+ test.done();
+ },
+ 'ok': function(test) {
+ test.expect(4);
+ var log = new Log({grunt: this.grunt});
+
+ stdoutEqual(test, function() { log.ok(); }, 'OK'.green + '\n');
+ stdoutEqual(test, function() { log.ok('foo'); }, '>> '.green + 'foo\n');
+ stdoutEqual(test, function() { log.ok('%s', 'foo'); }, '>> '.green + 'foo\n');
+ stdoutEqual(test, function() { log.ok(fooBuffer); }, '>> '.green + 'foo\n');
+
+ test.done();
+ },
+ 'errorlns': function(test) {
+ test.expect(2);
+ var log = new Log({grunt: this.grunt});
+
+ stdoutEqual(test, function() {
+ log.errorlns(repeat('foo', 30, ' '));
+ }, '>> '.red + repeat('foo', 19, ' ') +
+ '\n>> '.red + repeat('foo', 11, ' ') + '\n');
+ test.equal(this.grunt.fail.errorcount, 1);
+
+ test.done();
+ },
+ 'oklns': function(test) {
+ test.expect(1);
+ var log = new Log();
+
+ stdoutEqual(test, function() {
+ log.oklns(repeat('foo', 30, ' '));
+ }, '>> '.green + repeat('foo', 19, ' ') +
+ '\n>> '.green + repeat('foo', 11, ' ') + '\n');
+
+ test.done();
+ },
+ 'success': function(test) {
+ test.expect(4);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.success(); }, ''.green + '\n');
+ stdoutEqual(test, function() { log.success('foo'); }, 'foo'.green + '\n');
+ stdoutEqual(test, function() { log.success('%s', 'foo'); }, 'foo'.green + '\n');
+ stdoutEqual(test, function() { log.success(fooBuffer); }, 'foo'.green + '\n');
+
+ test.done();
+ },
+ 'fail': function(test) {
+ test.expect(4);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.fail(); }, ''.red + '\n');
+ stdoutEqual(test, function() { log.fail('foo'); }, 'foo'.red + '\n');
+ stdoutEqual(test, function() { log.fail('%s', 'foo'); }, 'foo'.red + '\n');
+ stdoutEqual(test, function() { log.fail(fooBuffer); }, 'foo'.red + '\n');
+
+ test.done();
+ },
+ 'header': function(test) {
+ test.expect(5);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.header(); }, ''.underline + '\n');
+ stdoutEqual(test, function() { log.header(); }, '\n' + ''.underline + '\n');
+ stdoutEqual(test, function() { log.header('foo'); }, '\n' + 'foo'.underline + '\n');
+ stdoutEqual(test, function() { log.header('%s', 'foo'); }, '\n' + 'foo'.underline + '\n');
+ stdoutEqual(test, function() { log.header(fooBuffer); }, '\n' + 'foo'.underline + '\n');
+
+ test.done();
+ },
+ 'subhead': function(test) {
+ test.expect(5);
+ var log = new Log();
+
+ stdoutEqual(test, function() { log.subhead(); }, ''.bold + '\n');
+ stdoutEqual(test, function() { log.subhead(); }, '\n' + ''.bold + '\n');
+ stdoutEqual(test, function() { log.subhead('foo'); }, '\n' + 'foo'.bold + '\n');
+ stdoutEqual(test, function() { log.subhead('%s', 'foo'); }, '\n' + 'foo'.bold + '\n');
+ stdoutEqual(test, function() { log.subhead(fooBuffer); }, '\n' + 'foo'.bold + '\n');
+
+ test.done();
+ },
+ 'writetableln': function(test) {
+ test.expect(1);
+ var log = new Log();
+
+ stdoutEqual(test, function() {
+ log.writetableln([10], [repeat('foo', 10)]);
+ }, 'foofoofoof\noofoofoofo\nofoofoofoo\n');
+
+ test.done();
+ },
+ 'writelns': function(test) {
+ test.expect(1);
+ var log = new Log();
+
+ stdoutEqual(test, function() {
+ log.writelns(repeat('foo', 30, ' '));
+ }, repeat('foo', 20, ' ') + '\n' +
+ repeat('foo', 10, ' ') + '\n');
+
+ test.done();
+ },
+ 'writeflags': function(test) {
+ test.expect(3);
+ var log = new Log();
+
+ stdoutEqual(test, function() {
+ log.writeflags(['a', 'b']);
+ }, 'Flags: ' + 'a'.cyan + ', ' + 'b'.cyan + '\n');
+ stdoutEqual(test, function() {
+ log.writeflags(['a', 'b'], 'Prefix');
+ }, 'Prefix: ' + 'a'.cyan + ', ' + 'b'.cyan + '\n');
+ stdoutEqual(test, function() {
+ log.writeflags({a: true, b: false, c: 0, d: null}, 'Prefix');
+ }, 'Prefix: ' + 'a'.cyan + ', ' + 'b=false'.cyan + ', ' + 'c=0'.cyan + ', ' + 'd=null'.cyan + '\n');
+
+ test.done();
+ },
+ 'always': function(test) {
+ test.expect(3);
+ var log = new Log();
+
+ test.strictEqual(log.always, log);
+ test.strictEqual(log.verbose.always, log);
+ test.strictEqual(log.notverbose.always, log);
+
+ test.done();
+ },
+ 'or': function(test) {
+ test.expect(2);
+ var log = new Log();
+
+ test.strictEqual(log.verbose.or, log.notverbose);
+ test.strictEqual(log.notverbose.or, log.verbose);
+
+ test.done();
+ },
+ 'hasLogged': function(test) {
+ // Should only be true if output has been written!
+ test.expect(24);
+ var log = new Log();
+ test.equal(log.hasLogged, false);
+ test.equal(log.verbose.hasLogged, false);
+ test.equal(log.notverbose.hasLogged, false);
+ log.write('');
+ test.equal(log.hasLogged, true);
+ test.equal(log.verbose.hasLogged, true);
+ test.equal(log.notverbose.hasLogged, true);
+
+ log = new Log({verbose: true});
+ log.verbose.write('');
+ test.equal(log.hasLogged, true);
+ test.equal(log.verbose.hasLogged, true);
+ test.equal(log.notverbose.hasLogged, true);
+
+ log = new Log();
+ log.notverbose.write('');
+ test.equal(log.hasLogged, true);
+ test.equal(log.verbose.hasLogged, true);
+ test.equal(log.notverbose.hasLogged, true);
+
+ stdoutMute();
+ log = new Log({debug: true});
+ log.debug('');
+ test.equal(log.hasLogged, true);
+ test.equal(log.verbose.hasLogged, true);
+ test.equal(log.notverbose.hasLogged, true);
+ stdoutUnmute();
+
+ // The following should be false since there's a verbose mismatch!
+ log = new Log();
+ log.verbose.write('');
+ test.equal(log.hasLogged, false);
+ test.equal(log.verbose.hasLogged, false);
+ test.equal(log.notverbose.hasLogged, false);
+
+ log = new Log({verbose: true});
+ log.notverbose.write('');
+ test.equal(log.hasLogged, false);
+ test.equal(log.verbose.hasLogged, false);
+ test.equal(log.notverbose.hasLogged, false);
+
+ // The following should be false since there's a debug mismatch!
+ log = new Log();
+ log.debug('');
+ test.equal(log.hasLogged, false);
+ test.equal(log.verbose.hasLogged, false);
+ test.equal(log.notverbose.hasLogged, false);
+
+ test.done();
+ },
+ 'muted': function(test) {
+ test.expect(30);
+ var log = new Log();
+
+ test.equal(log.muted, false);
+ test.equal(log.verbose.muted, false);
+ test.equal(log.notverbose.muted, false);
+ test.equal(log.options.muted, false);
+ test.equal(log.verbose.options.muted, false);
+ test.equal(log.notverbose.options.muted, false);
+
+ log.muted = true;
+ test.equal(log.muted, true);
+ test.equal(log.verbose.muted, true);
+ test.equal(log.notverbose.muted, true);
+ test.equal(log.options.muted, true);
+ test.equal(log.verbose.options.muted, true);
+ test.equal(log.notverbose.options.muted, true);
+
+ log.muted = false;
+ test.equal(log.muted, false);
+ test.equal(log.verbose.muted, false);
+ test.equal(log.notverbose.muted, false);
+ test.equal(log.options.muted, false);
+ test.equal(log.verbose.options.muted, false);
+ test.equal(log.notverbose.options.muted, false);
+
+ log.options.muted = true;
+ test.equal(log.muted, true);
+ test.equal(log.verbose.muted, true);
+ test.equal(log.notverbose.muted, true);
+ test.equal(log.options.muted, true);
+ test.equal(log.verbose.options.muted, true);
+ test.equal(log.notverbose.options.muted, true);
+
+ log.options.muted = false;
+ test.equal(log.muted, false);
+ test.equal(log.verbose.muted, false);
+ test.equal(log.notverbose.muted, false);
+ test.equal(log.options.muted, false);
+ test.equal(log.verbose.options.muted, false);
+ test.equal(log.notverbose.options.muted, false);
+
+ test.done();
+ },
+ 'verbose': function(test) {
+ test.expect(15);
+ var log = new Log();
+ log.muted = true;
+
+ // Test verbose methods to make sure they always return the verbose object.
+ test.strictEqual(log.verbose.write(''), log.verbose);
+ test.strictEqual(log.verbose.writeln(''), log.verbose);
+ test.strictEqual(log.verbose.warn(''), log.verbose);
+ test.strictEqual(log.verbose.error(''), log.verbose);
+ test.strictEqual(log.verbose.ok(''), log.verbose);
+ test.strictEqual(log.verbose.errorlns(''), log.verbose);
+ test.strictEqual(log.verbose.oklns(''), log.verbose);
+ test.strictEqual(log.verbose.success(''), log.verbose);
+ test.strictEqual(log.verbose.fail(''), log.verbose);
+ test.strictEqual(log.verbose.header(''), log.verbose);
+ test.strictEqual(log.verbose.subhead(''), log.verbose);
+ test.strictEqual(log.verbose.debug(''), log.verbose);
+ test.strictEqual(log.verbose.writetableln([]), log.verbose);
+ test.strictEqual(log.verbose.writelns(''), log.verbose);
+ test.strictEqual(log.verbose.writeflags([]), log.verbose);
+
+ test.done();
+ },
+ 'notverbose': function(test) {
+ test.expect(15);
+ var log = new Log();
+ log.muted = true;
+
+ // Test notverbose methods to make sure they always return the notverbose object.
+ test.strictEqual(log.notverbose.write(''), log.notverbose);
+ test.strictEqual(log.notverbose.writeln(''), log.notverbose);
+ test.strictEqual(log.notverbose.warn(''), log.notverbose);
+ test.strictEqual(log.notverbose.error(''), log.notverbose);
+ test.strictEqual(log.notverbose.ok(''), log.notverbose);
+ test.strictEqual(log.notverbose.errorlns(''), log.notverbose);
+ test.strictEqual(log.notverbose.oklns(''), log.notverbose);
+ test.strictEqual(log.notverbose.success(''), log.notverbose);
+ test.strictEqual(log.notverbose.fail(''), log.notverbose);
+ test.strictEqual(log.notverbose.header(''), log.notverbose);
+ test.strictEqual(log.notverbose.subhead(''), log.notverbose);
+ test.strictEqual(log.notverbose.debug(''), log.notverbose);
+ test.strictEqual(log.notverbose.writetableln([]), log.notverbose);
+ test.strictEqual(log.notverbose.writelns(''), log.notverbose);
+ test.strictEqual(log.notverbose.writeflags([]), log.notverbose);
+
+ test.done();
+ },
+ 'options.debug = true': function(test) {
+ test.expect(4);
+ var log = new Log({debug: true});
+
+ stdoutEqual(test, function() { log.debug(); }, '[D] ' + ''.magenta + '\n');
+ stdoutEqual(test, function() { log.debug('foo'); }, '[D] ' + 'foo'.magenta + '\n');
+ stdoutEqual(test, function() { log.debug('%s', 'foo'); }, '[D] ' + 'foo'.magenta + '\n');
+ stdoutEqual(test, function() { log.debug(fooBuffer); }, '[D] ' + 'foo'.magenta + '\n');
+
+ test.done();
+ },
+ 'options.verbose = false': function(test) {
+ test.expect(7);
+ var log = new Log({verbose: false});
+
+ stdoutEqual(test, function() { log.notverbose.write('foo'); }, 'foo');
+ stdoutEqual(test, function() { log.notverbose.write('%s', 'foo'); }, 'foo');
+ stdoutEqual(test, function() { log.notverbose.write(fooBuffer); }, 'foo');
+ stdoutEqual(test, function() { log.verbose.write('foo'); }, '');
+ stdoutEqual(test, function() { log.verbose.write('%s', 'foo'); }, '');
+ stdoutEqual(test, function() { log.verbose.write(fooBuffer); }, '');
+ stdoutEqual(test, function() { log.verbose.write('a').or.write('b'); }, 'b');
+
+ test.done();
+ },
+ 'options.verbose = true': function(test) {
+ test.expect(7);
+ var log = new Log({verbose: true});
+
+ stdoutEqual(test, function() { log.verbose.write('foo'); }, 'foo');
+ stdoutEqual(test, function() { log.verbose.write('%s', 'foo'); }, 'foo');
+ stdoutEqual(test, function() { log.verbose.write(fooBuffer); }, 'foo');
+ stdoutEqual(test, function() { log.notverbose.write('foo'); }, '');
+ stdoutEqual(test, function() { log.notverbose.write('%s', 'foo'); }, '');
+ stdoutEqual(test, function() { log.notverbose.write(fooBuffer); }, '');
+ stdoutEqual(test, function() { log.notverbose.write('a').or.write('b'); }, 'b');
+
+ test.done();
+ },
+ 'options.debug = false': function(test) {
+ test.expect(1);
+ var log = new Log({debug: false});
+
+ stdoutEqual(test, function() { log.debug('foo'); }, '');
+
+ test.done();
+ },
+ 'options.color = true': function(test) {
+ test.expect(1);
+ var log = new Log({color: true});
+
+ stdoutEqual(test, function() { log.write('foo'.blue + 'bar'.underline); }, 'foo'.blue + 'bar'.underline);
+
+ test.done();
+ },
+ 'options.color = false': function(test) {
+ test.expect(1);
+ var log = new Log({color: false});
+
+ stdoutEqual(test, function() { log.write('foo'.blue + 'bar'.underline); }, 'foobar');
+
+ test.done();
+ },
+ 'perma-bind this when passing grunt in (backcompat)': function(test) {
+ test.expect(43);
+ var log = new Log({grunt: this.grunt});
+ stdoutMute();
+ [
+ 'write',
+ 'writeln',
+ 'warn',
+ 'error',
+ 'ok',
+ 'errorlns',
+ 'oklns',
+ 'success',
+ 'fail',
+ 'header',
+ 'subhead',
+ 'debug',
+ ].forEach(function(method) {
+ var fn = log[method];
+ var verboseFn = log.verbose[method];
+ var notVerboseFn = log.notverbose[method];
+ test.equal(fn(), log, 'Should return log if invoked in a way where this is not log.');
+ test.equal(verboseFn(), log.verbose, 'Should return log.verbose if invoked in a way where this is not log.');
+ test.equal(notVerboseFn(), log.notverbose, 'Should return log.notverbose if invoked in a way where this is not log.');
+ });
+
+ test.doesNotThrow(function() { var fn = log.writetableln; fn([]); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.writelns; fn([]); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.writeflags; fn([]); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.wordlist; fn([]); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.uncolor; fn(''); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.wraptext; fn(1,''); }, 'Should not throw if invoked in a way where this is not log.');
+ test.doesNotThrow(function() { var fn = log.table; fn([],''); }, 'Should not throw if invoked in a way where this is not log.');
+ stdoutUnmute();
+
+ test.done();
+ },
+};
+
+exports['Helpers'] = {
+ 'uncolor': function(test) {
+ test.expect(2);
+ var log = new Log();
+ test.ok(log.uncolor);
+ test.strictEqual(log.uncolor, legacyLog.uncolor);
+ test.done();
+ },
+ 'wordlist': function(test) {
+ test.expect(2);
+ var log = new Log();
+ test.ok(log.wordlist);
+ test.strictEqual(log.wordlist, legacyLog.wordlist);
+ test.done();
+ },
+ 'wraptext': function(test) {
+ test.expect(2);
+ var log = new Log();
+ test.ok(log.wraptext);
+ test.strictEqual(log.wraptext, legacyLog.wraptext);
+ test.done();
+ },
+ 'table': function(test) {
+ test.expect(2);
+ var log = new Log();
+ test.ok(log.table);
+ test.strictEqual(log.table, legacyLog.table);
+ test.done();
+ },
+};