Skip to content

Commit

Permalink
feat: basic pluginified app running on dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Feb 13, 2024
1 parent 684db12 commit 369e4b8
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cli/src/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const handler = async ({
const config = parseConfig(paths)
const shell = makeShell({ config, paths })
const plugin = makePlugin({ config, paths })
const pluginifiedApp = makePlugin({ config, paths, pluginifiedApp: true })

if (config.type !== 'app') {
reporter.error(
Expand Down Expand Up @@ -133,19 +134,32 @@ const handler = async ({

const shellStartPromise = shell.start({ port: newPort })

const pluginifiedAppPort = await detectPort(newPort + 1)
reporter.print(
`The pluginifiedApp is now available on port ${pluginifiedAppPort} at /${paths.pluginifiedAppLaunchPath}`
)
reporter.print('')
const pluginifiedAppStartPromise = pluginifiedApp.start({
port: pluginifiedAppPort,
})

if (config.entryPoints.plugin) {
const pluginPort = await detectPort(newPort + 1)
const pluginPort = await detectPort(pluginifiedAppPort + 1)
reporter.print(
`The plugin is now available on port ${pluginPort} at /${paths.pluginLaunchPath}`
)
reporter.print('')

await Promise.all([
shellStartPromise,
pluginifiedAppStartPromise,
plugin.start({ port: pluginPort }),
])
} else {
await shellStartPromise
await Promise.all([
shellStartPromise,
pluginifiedAppStartPromise,
])
}
},
{
Expand Down

0 comments on commit 369e4b8

Please sign in to comment.