Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
port = debugPiralDefaults.port,
cacheDir = debugPiralDefaults.cacheDir,
open = debugPiralDefaults.open,
scopeHoist = debugPiralDefaults.scopeHoist,
hmr = debugPiralDefaults.hmr,
autoInstall = debugPiralDefaults.autoInstall,
publicUrl = debugPiralDefaults.publicUrl,
logLevel = debugPiralDefaults.logLevel,
fresh = debugPiralDefaults.fresh,
} = options;
const entryFiles = await retrievePiralRoot(baseDir, entry);
const { externals, name, root } = await retrievePiletsInfo(entryFiles);
await checkCliCompatibility(root);
const krasConfig = readKrasConfig({ port }, krasrc);
if (krasConfig.directory === undefined) {
krasConfig.directory = join(dirname(entryFiles), 'mocks');
}
if (krasConfig.ssl === undefined) {
krasConfig.ssl = undefined;
}
if (krasConfig.map === undefined) {
krasConfig.map = {};
}
if (krasConfig.api === undefined) {
krasConfig.api = '/manage-mock-server';
}
port = debugPiletDefaults.port,
cacheDir = debugPiletDefaults.cacheDir,
open = debugPiletDefaults.open,
scopeHoist = debugPiletDefaults.scopeHoist,
hmr = debugPiletDefaults.hmr,
autoInstall = debugPiletDefaults.autoInstall,
logLevel = debugPiletDefaults.logLevel,
fresh = debugPiletDefaults.fresh,
app,
} = options;
const entryFile = join(baseDir, entry);
const targetDir = dirname(entryFile);
const entryModule = await findEntryModule(entryFile, targetDir);
const { peerDependencies, root, appPackage, appFile } = await retrievePiletData(targetDir, app);
const externals = Object.keys(peerDependencies);
const krasConfig = readKrasConfig({ port }, krasrc);
if (krasConfig.directory === undefined) {
krasConfig.directory = join(targetDir, 'mocks');
}
if (krasConfig.ssl === undefined) {
krasConfig.ssl = undefined;
}
if (krasConfig.map === undefined) {
krasConfig.map = {};
}
if (krasConfig.api === undefined) {
krasConfig.api = '/manage-mock-server';
}
export async function runDebug(
port: number,
entry: string,
{ publicUrl, options, source = entry, logLevel, fresh, root }: DebugOptions,
) {
const krasConfig = readKrasConfig({ port }, krasrc);
if (krasConfig.directory === undefined) {
krasConfig.directory = join(dirname(source), 'mocks');
}
if (krasConfig.ssl === undefined) {
krasConfig.ssl = undefined;
}
if (krasConfig.map === undefined) {
krasConfig.map = {};
}
if (krasConfig.api === undefined) {
krasConfig.api = '/manage-mock-server';
}