Skip to content

Commit

Permalink
update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Mar 24, 2024
1 parent dcde3e1 commit 2e2ed57
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/shared/log/to-console.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

var messages = require('@gulpjs/messages');

/* istanbul ignore next */
function noop() {}

Expand Down Expand Up @@ -49,7 +51,7 @@ function toConsole(log, opts, translate) {

function onDeprecated() {
if (!deprecatedPrinted) {
var msg = { tag: Symbol.for('GULP_CLI_GULPLOG_DEPRECATED') };
var msg = { tag: messages.GULPLOG_DEPRECATED };
// Get message and timestamp before printing anything to avoid
// logging a half message if there's an error in one of them
var message = translate.message(msg);
Expand Down
6 changes: 3 additions & 3 deletions lib/shared/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Timestamp.prototype[util.inspect.custom] = function (depth, opts) {

function getDefaultMessage(data) {
switch (data.tag) {
case Symbol.for('GULP_CLI_GULPLOG_DEPRECATED'): {
return chalk.yellow("gulplog v1 is deprecated. Please help your plugins update!");
}
case messages.PRELOAD_BEFORE: {
return 'Preloading external module: ' + chalk.magenta(data.name);
}
Expand Down Expand Up @@ -106,6 +103,9 @@ function getDefaultMessage(data) {
case messages.NPM_INSTALL_GULP: {
return chalk.red('Try running: npm install gulp');
}
case messages.GULPLOG_DEPRECATED: {
return chalk.yellow("gulplog v1 is deprecated. Please help your plugins update!");
}
case messages.COMPLETION_TYPE_MISSING: {
return 'Missing completion type';
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"cover": "nyc mocha --async-only --timeout 5000 test/lib test"
},
"dependencies": {
"@gulpjs/messages": "^1.0.0",
"@gulpjs/messages": "^1.1.0",
"chalk": "^4.1.2",
"copy-props": "^4.0.0",
"gulplog": "^2.2.0",
Expand Down
3 changes: 1 addition & 2 deletions test/fixtures/config/theming/GULPLOG_DEPRECATED/.gulp.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// TODO: Add the symbol to messages
var messages = require('@gulpjs/messages');

module.exports = {
message: function (data) {
if (data.tag === Symbol.for('GULP_CLI_GULPLOG_DEPRECATED')) {
if (data.tag === messages.GULPLOG_DEPRECATED) {
return 'GULPLOG V1 IS DEPRECATED';
}

Expand Down

0 comments on commit 2e2ed57

Please sign in to comment.