Skip to content

Commit

Permalink
add new params for explorer alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
gonpombo8 committed Dec 9, 2024
1 parent 396cf5a commit 732ecd8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
12 changes: 8 additions & 4 deletions packages/@dcl/sdk-commands/src/commands/start/explorer-alpha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function runApp(
components: CliComponents,
{
cwd,
realm,
realm: realmValue,
baseCoords,
isHub,
args
Expand All @@ -40,10 +40,14 @@ async function runApp(
}
) {
const cmd = isWindows ? 'start' : 'open'
// Remove (--) from the command
const extraArgs = args._.map(($) => $.replace(/^-+/, '')).join('&')
const position = args['--position'] ?? `${baseCoords.x},${baseCoords.y}`
const realm = args['--realm'] ?? realmValue
const localScene = args['--local-scene'] ?? true
const debug = args['--debug'] ?? true
const dclenv = args['--dclenv'] ?? 'org'

try {
const params = `realm=${realm}&position=${baseCoords.x},${baseCoords.y}&local-scene=true&debug=true&hub=${isHub}&${extraArgs}`
const params = `realm=${realm}&position=${position}&local-scene=${localScene}&debug=${debug}&hub=${isHub}&dclenv=${dclenv}`
const app = `decentraland://"${params}"`
await components.spawner.exec(cwd, cmd, [app], { silent: true })
components.logger.info(`Desktop client: decentraland://${params}\n`)
Expand Down
14 changes: 13 additions & 1 deletion packages/@dcl/sdk-commands/src/commands/start/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ export const args = declareArgs({
'--desktop-client': Boolean,
'--data-layer': Boolean,
'--explorer-alpha': Boolean,
'--hub': Boolean
'--hub': Boolean,
// Params related to the explorer-alpha
'--debug': Boolean,
'--dclenv': String,
'--realm': String,
'--local-scene': String,
'--position': String
})

export async function help(options: Options) {
Expand All @@ -70,6 +76,12 @@ export async function help(options: Options) {
--web3 Connects preview to browser wallet to use the associated avatar and account
--skip-build Skip build and only serve the files in preview mode
--desktop-client Show URL to launch preview in the desktop client (BETA)
--debug Enables Debug panel mode inside DCL Explorer (default=true)
--dclenv Decentraland Environment. Which environment uses for the content: catalyst, asset-bundles, etc. Posible values: org, zone, today. (default=org)
--realm Realm used to serve the content. (default=Localhost)
--local-scene Enable local scene development.
--position Initial Position to start the explorer. (default=position defined at scene.json)
Examples:
Expand Down
2 changes: 1 addition & 1 deletion packages/@dcl/sdk-commands/src/logic/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type Args = {

export function parseArgs<T extends Args>(argv: string[], args: T): Result<T> {
try {
return arg({ '--json': Boolean, '-h': '--help', '--help': Boolean, ...args }, { permissive: true, argv })
return arg({ '--json': Boolean, '-h': '--help', '--help': Boolean, ...args }, { permissive: false, argv })
} catch (err: any) {
if (err.name === 'ArgError') throw new CliError(`Argument error: ` + err.message)
/* istanbul ignore next */
Expand Down

0 comments on commit 732ecd8

Please sign in to comment.