Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async function runApp(
const landscapeTerrainEnabled = !!args['--landscape-terrain-enabled']
const openDeeplinkInNewInstance = !!args['-n']
const multiInstance = !!args['--multi-instance']
const assetBundles = !!args['--asset-bundles']
const mcp = !!args['--mcp']
const mcpPort = args['--mcp-port']

Expand Down Expand Up @@ -105,6 +106,11 @@ async function runApp(
if (multiInstance) {
params.set('multi-instance', 'true')
}
if (assetBundles) {
// The explorer owns asset-bundle conversion: local-ab makes it spawn its own
// JIT converter against this preview's content server. No sidecar runs here.
params.set('local-ab', 'true')
}
if (mcp) {
params.set('mcp', 'true')
}
Expand Down
2 changes: 2 additions & 0 deletions packages/@dcl/sdk-commands/src/commands/start/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const args = declareArgs({
'--bevy-web': Boolean,
'--web': '--bevy-web',
'--multi-instance': Boolean,
'--asset-bundles': Boolean,
'--no-client': Boolean,
'--mcp': Boolean,
'--mcp-port': Number
Expand Down Expand Up @@ -98,6 +99,7 @@ export async function help(options: Options) {
--web, --bevy-web Opens preview using the Bevy Web browser window.
--mobile Show QR code for mobile preview on the same network.
--multi-instance Allow running multiple Explorer instances simultaneously.
--asset-bundles Preview with optimized asset bundles (forwarded as local-ab=true in the deep link; the Desktop Explorer converts the scene's assets itself).
--no-client Suppress every auto-launch (desktop Explorer deeplink, browser open, mobile QR). The file watcher still notifies a desktop Explorer if it connects on its own — useful when an external tool owns the Explorer process.
--mcp Enable the MCP server in the Explorer (forwarded as a deep link parameter).
--mcp-port Port for the MCP server in the Explorer (forwarded as a deep link parameter).
Expand Down
42 changes: 42 additions & 0 deletions test/sdk-commands/commands/start/explorer-alpha.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,48 @@ describe('explorer-alpha', () => {
})
})

describe('assetBundles parameter', () => {
it('should include local-ab parameter when --asset-bundles flag is provided', async () => {
const args: any = {
'--asset-bundles': true
}

await runExplorerAlpha(mockComponents, {
cwd: '/test',
realm: 'test-realm',
baseCoords: { x: 0, y: 0 },
isHub: false,
args
})

expect(mockExec).toHaveBeenCalledWith(
'/test',
'open',
expect.arrayContaining([expect.stringContaining('local-ab=true')]),
{ silent: true }
)
})

it('should not include local-ab parameter when --asset-bundles flag is not provided', async () => {
const args: any = {}

await runExplorerAlpha(mockComponents, {
cwd: '/test',
realm: 'test-realm',
baseCoords: { x: 0, y: 0 },
isHub: false,
args
})

expect(mockExec).toHaveBeenCalledWith(
'/test',
'open',
expect.arrayContaining([expect.not.stringContaining('local-ab')]),
{ silent: true }
)
})
})

describe('mcp parameter', () => {
it('should include mcp parameter when --mcp flag is provided', async () => {
const args: any = {
Expand Down
Loading