Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'transformIgnorePatterns',
'reporters',
];
if (overrides) {
supportedKeys.forEach((key) => {
// eslint-disable-next-line
if (overrides.hasOwnProperty(key)) {
config[key] = overrides[key];
delete overrides[key];
}
});
const unsupportedKeys = Object.keys(overrides);
if (unsupportedKeys.length) {
/* eslint-disable */
console.error(
color.red(
'Out of the box, kkt-ssr only supports overriding ' +
'these Jest options:\n\n' +
supportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n') +
'.\n\n' +
'These options in your package.json Jest configuration ' +
'are not currently supported by kkt-ssr:\n\n' +
unsupportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n')
)
);
/* eslint-enable */
process.exit(1);
}
}
return config;
};
'transformIgnorePatterns',
'reporters',
];
if (overrides) {
supportedKeys.forEach((key) => {
// eslint-disable-next-line
if (overrides.hasOwnProperty(key)) {
config[key] = overrides[key];
delete overrides[key];
}
});
const unsupportedKeys = Object.keys(overrides);
if (unsupportedKeys.length) {
/* eslint-disable */
console.error(
color.red(
'Out of the box, kkt only supports overriding ' +
'these Jest options:\n\n' +
supportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n') +
'.\n\n' +
'These options in your package.json Jest configuration ' +
'are not currently supported by kkt:\n\n' +
unsupportedKeys.map(key => color.bold(' \u2022 ' + key)).join('\n')
)
);
/* eslint-enable */
process.exit(1);
}
}
return config;
};
if (appPkg) {
if (appPkg.dependencies && appPkg.dependencies[dependName]) {
appPkg.dependencies[dependName] = `^${pkg.data.version}`;
}
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`🎉 ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'👉 Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
watcher.on('all', (event, path) => {
if (event === 'change' || event === 'add') {
try {
// 当监听的可能是多个配置文件时,需要清理掉更新文件以及入口文件的缓存,重新获取
cleanCache(path);
watchFiles.forEach(file => cleanCache(file));
mocker = getConfig();
console.log(`${color.green_b.black(' Done: ')} Hot Mocker ${color.green(path.replace(process.cwd(), ''))} file replacement success!`);
} catch (ex) {
console.error(`${color.red_b.black(' Failed: ')} Hot Mocker ${color.red(path.replace(process.cwd(), ''))} file replacement failed!!`);
}
}
})
// 监听文件修改重新加载代码
if (appPkg) {
if (appPkg.dependencies && appPkg.dependencies[dependName]) {
appPkg.dependencies[dependName] = `^${pkg.data.version}`;
}
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`🎉 ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'👉 Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
watcher.on('all', (event, path) => {
if (event === 'change' || event === 'add') {
try {
// 当监听的可能是多个配置文件时,需要清理掉更新文件以及入口文件的缓存,重新获取
cleanCache(path);
watchFiles.forEach(file => cleanCache(file));
mocker = getConfig();
console.log(`${color.green_b.black(' Done: ')} Hot Mocker ${color.green(path.replace(process.cwd(), ''))} file replacement success!`);
} catch (ex) {
console.error(`${color.red_b.black(' Failed: ')} Hot Mocker ${color.red(path.replace(process.cwd(), ''))} file replacement failed!!`);
}
}
})
// 监听文件修改重新加载代码
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`🎉 ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'👉 Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
}
fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
}
output.success(
`Dependent on ${output.cmd(dependName)} version has been set.`
);
}
await installDeps(projectPath, 'npm');
// eslint-disable-next-line
console.log(`🎉 ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
// eslint-disable-next-line
console.log(
'👉 Get started with the following commands:\n\n' +
`${projectPath === process.cwd() ? '' : color.cyan(` ${color.white('$')} cd ${projectName}\n`)}` +
` ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
);
}).catch((err) => {
stopExampleSpinner();
module.exports = (conf, { kktrc, ...optionConf }, webpack) => {
if (kktrc && kktrc.config && typeof kktrc.config === 'function') {
conf = kktrc.config(conf, optionConf, webpack) || conf;
} else if (kktrc && kktrc.config) {
console.log(color.yellow('Check for .kkt.conf.js file, kktrc.config is not a function.')); // eslint-disable-line
}
if (kktrc && kktrc.plugins && kktrc.plugins.length > 0) {
kktrc.plugins.forEach((item) => {
const plugin = require(item); // eslint-disable-line
conf = plugin(conf, optionConf, webpack) || conf;
});
}
return conf;
};
function preview_itskill(){
var its = itskill.data;
log()
log(" "+color.x46(itskill.title))
log()
for (var i = 0; i < its.length; i++) {
var txt = ''
for(var a in its[i]){
if(its[i][a]) {
txt += a + ':' + its[i][a] + ' | ';
// log(" ■ " + (its[i][a]? a + ':' + its[i][a]:"") )
}
}
log(" " + color.x161('■ ') + txt)
// log(" ----------------------------");
};
log()
}