Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break
}
case 'build': {
await build(merge(defaultResolveConfig, appConfig, prodConfig))
break
}
case 'start': {
await start(merge(defaultResolveConfig, appConfig, prodConfig))
break
}
case 'test:functional': {
await runTestcafe({
resolveConfig: merge(
defaultResolveConfig,
appConfig,
testFunctionalConfig
),
functionalTestsDir: 'test/functional',
browser: process.argv[3]
})
break
}
default: {
throw new Error('Unknown option')
}
}
})().catch(error => {
// eslint-disable-next-line no-console
dropSnapshots: true,
dropReadModels: true,
dropSagas: true
})
await runTestcafe({
resolveConfig,
functionalTestsDir: 'test/functional',
browser: process.argv[3]
})
break
}
case 'import': {
const config = merge(baseConfig, devConfig)
await reset(config, {
dropEventStore: true,
dropSnapshots: true,
dropReadModels: true,
dropSagas: true
})
const importConfig = merge(baseConfig, devConfig, {
eventBroker: { launchBroker: false },
apiHandlers: [
{
method: 'POST',
path: 'import_events',
controller: {
module: 'import/import_api_handler.js',
options: {}
await importEventStore(resolveConfig, { importFile })
break
}
case 'export-event-store': {
const resolveConfig = merge(baseConfig, devConfig)
const exportFile = process.argv[3]
await exportEventStore(resolveConfig, { exportFile })
break
}
case 'test:functional': {
const resolveConfig = merge(baseConfig, testFunctionalConfig)
await reset(resolveConfig, {
dropEventStore: true,
dropSnapshots: true,
dropReadModels: true,
dropSagas: true
})
await runTestcafe({
resolveConfig,
functionalTestsDir: 'test/functional',
browser: process.argv[3]
})
break
}
method: 'POST',
callback: 'domain/auth/route_register_callback.js'
},
{
path: 'auth/local/login',
method: 'POST',
callback: 'domain/auth/route_login_callback.js'
}
]
}
])
switch (launchMode) {
case 'dev': {
await watch(
merge(defaultResolveConfig, appConfig, devConfig, authModule),
adjustWebpackConfigs.bind(null, devConfig)
)
break
}
case 'build': {
await build(
merge(defaultResolveConfig, appConfig, prodConfig, authModule),
adjustWebpackConfigs.bind(null, prodConfig)
)
break
}
case 'cloud': {
await build(
merge(defaultResolveConfig, appConfig, cloudConfig, authModule),
case 'start': {
await start(merge(defaultResolveConfig, appConfig, prodConfig))
break
}
case 'import-event-store': {
const resolveConfig = merge(defaultResolveConfig, appConfig, devConfig)
const importFile = process.argv[3]
await importEventStore(resolveConfig, { importFile })
break
}
case 'export-event-store': {
const resolveConfig = merge(defaultResolveConfig, appConfig, devConfig)
const exportFile = process.argv[3]
await exportEventStore(resolveConfig, { exportFile })
break
}
case 'test:functional': {
const resolveConfig = merge(
defaultResolveConfig,
appConfig,
testFunctionalConfig
)
await reset(
resolveConfig,