Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// It is misleading (and unrelated to the warnings) so we clean it up.
// It is only useful for syntax errors but we have beautiful frames for them.
return line.indexOf(" @ ") !== 0;
});
// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].indexOf("Module not found: ") === 0) {
lines = [
lines[0],
lines[1]
.replace("Error: ", "")
.replace("Module not found: Cannot find file:", "Cannot find file:")
];
}
lines[0] = colors.inverse(lines[0]);
message = lines.join("\n");
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by Webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
""
); // at ... ...:x:y
message = message.replace(/^\s*at\s(\n|$)/gm, ""); // at
lines = message.split("\n");
// Remove duplicated newlines
lines = lines.filter(
(line, index, arr) =>
taskLog(rainbow("↑↑↑↑↑↑"), colors.greenBright.bold(colors.symbols.check + ' All compilation tasks done!'), rainbow("↑↑↑↑↑↑"))
))
// 重新生成文件
gulp.task('build', gulp.series('clean', 'compile'));
// 监测文件修改
gulp.task('watch', gulp.series(
gulp.parallel('js-watch', 'wxs-watch', 'wxss-watch', 'wxml-watch', 'json-watch', 'image-watch', 'copy-watch', 'npm-watch'),
taskLog(colors.greenBright.bold('\tAll watch tasks started !')))
);
//开发模式
gulp.task('dev', gulp.series(
'try-quit',
'clean', 'compile',
gulp.parallel('try-open', 'watch'),
taskLog(colors.inverse(rainbow('all tasks are ready, waiting for code change ...')))
));
gulp.on('error', console.trace);
gulp.on('error', error('gulp'));
async.waterfall(tasks, function (aErr, aResults) {
if (aErr) {
console.error(
colors.inverse(colors.red('Project dependency error!\n\n')),
'Code ' + aErr.code + '\n',
aErr.message
);
return;
}
aResults.push(colors.cyan('Completed checking project dependencies'));
console.log(aResults.join('\n'));
});
fs.writeFileSync(`${profilePath}/config.json`, jsonConfig);
if(!isLinux){
let batch = `@echo off\r\n node src ${serverProfile}\r\n pause`;
fs.writeFileSync(`start_${serverProfile}.bat`, batch);
}
} catch (error) {
logError(`Error setting up folder structure in '${profilePath}'`, context);
logError(error);
process.exit();
}
printDivider();
//Printing goodbye :)
logOk(`Server profile saved in '${profilePath}'`, context);
let cmd = ac.inverse(` node src ${serverProfile} `);
logOk(`To start txAdmin with this profile run: ${cmd}`, context);
if(!isLinux){
let cmd2 = ac.inverse(` txAdmin/start_${serverProfile}.bat `);
logOk(`You can also execute: ${cmd2}`, context);
}
process.exit();
})();
var deprecationWarning = function(msg) {
//eslint-disable-next-line no-console
console.log(ansi.inverse(msg));
};
var deprecationWarning = function(msg) {
//eslint-disable-next-line no-console
console.log(ansi.inverse(msg));
};
run() {
logger.info(c.inverse(`Executing ${this.step.getTitle()}`));
return this.step.execute(this.context);
}
};
function cmd(str) {
return c.inverse(' ' + str + ' ');
}
async(dir, i) => {
logger.info(c.inverse(`Executing ${i + 1}/${dirs.length} ${dir}`));
const context = {
suite: dir,
resultOutputFolder: path.join(resultOutputFolder, dir),
workingDirectory: path.join(testDir, dir)
};
const suiteRunner = new SuiteRunner(context, reporter);
try {
const result = await suiteRunner.run();
await writeLog(context.resultOutputFolder, 'log-full.txt');
return result;
} catch (e) {
logger.error(e);
throw e;
}