create-yoshi-app
Advanced tools
Comparing version 4.56.1 to 4.57.0
{ | ||
"name": "create-yoshi-app", | ||
"version": "4.56.1", | ||
"version": "4.57.0", | ||
"description": "create yoshi powered apps", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import chance from 'chance'; | ||
declare const testKitEnv: any; | ||
export const appDriver = () => { | ||
@@ -4,0 +6,0 @@ const waitForVisibilityOf = async (selector: string) => { |
import { | ||
createTestkit, | ||
testkitConfigBuilder, | ||
ModuleConfigFileEmitter, | ||
anAppConfigBuilder, | ||
} from '@wix/business-manager/dist/testkit'; | ||
@@ -15,8 +15,10 @@ | ||
const serverUrl = 'http://localhost:3200/'; | ||
const path = './templates/module_{%PROJECT_NAME%}.json.erb'; | ||
const path = '../app-config-templates/module_{%PROJECT_NAME%}.json'; | ||
const serviceId = 'com.wixpress.{%projectName%}'; | ||
const moduleConfig = await new ModuleConfigFileEmitter(path) | ||
.registerStaticService({ serviceId, serverUrl }) | ||
.emit(); | ||
const moduleConfig = anAppConfigBuilder() | ||
.fromJsonTemplate(require(path)) // replace this line with the next once your config is merged | ||
// .fromModuleId('{%PROJECT_NAME%}') | ||
.withArtifactMapping({ [serviceId]: { url: serverUrl } }) | ||
.build(); | ||
@@ -23,0 +25,0 @@ let builder = testkitConfigBuilder() |
@@ -1,20 +0,23 @@ | ||
const testKitEnv = require('./environment') | ||
.environment() | ||
.then((env: any) => { | ||
env.start(); | ||
return env; | ||
}); | ||
import { watch } from 'chokidar'; | ||
import { environment } from './environment'; | ||
// We need to stop the testkit explicitly, since it's running in a different process | ||
const stopTestKit = () => testKitEnv.then((tk: any) => tk.stop()); | ||
(async () => { | ||
let testkit = await environment(); | ||
await testkit.start(); | ||
const signals: Array<'SIGINT' | 'SIGUSR1' | 'SIGUSR2'> = [ | ||
'SIGINT', | ||
'SIGUSR1', | ||
'SIGUSR2', | ||
]; | ||
const restartTestkit = async () => { | ||
await testkit.stop(); | ||
testkit = await environment(); | ||
await testkit.start(); | ||
}; | ||
signals.forEach(ev => process.on(ev, stopTestKit)); | ||
watch(['app-config-templates/module_{%PROJECT_NAME%}.json']).on( | ||
'all', | ||
async () => { | ||
await restartTestkit(); | ||
}, | ||
); | ||
process.on('uncaughtException', stopTestKit); | ||
process.on('exit', stopTestKit); | ||
process.on('SIGINT', () => testkit.stop()); | ||
process.on('exit', () => testkit.stop()); | ||
})(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1021601
12737
55