Skip to content

Commit

Permalink
fix: configure target platform as string to accommodate sub-targets
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Dec 22, 2024
1 parent bce9e3f commit 2628906
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEVICE_ALIAS } from '../toolbox/prompt/devices'
type Mode = 'development' | 'production'

interface BuildOptions {
device?: Device
device?: string
port?: string
example?: string
'list-examples'?: boolean
Expand Down Expand Up @@ -42,7 +42,7 @@ const command = buildCommand({
port,
config = [],
} = flags
const targetPlatform: string = DEVICE_ALIAS[device] ?? device
const targetPlatform: string = DEVICE_ALIAS[device as Device] ?? device
projectPath = filesystem.resolve(projectPath)
const parsedConfig = config.reduce<Record<string, string>>(
(result, setting) => {
Expand Down Expand Up @@ -81,8 +81,8 @@ const command = buildCommand({
},
flags: {
device: {
kind: 'enum',
values: Object.keys(DEVICE_ALIAS) as NonNullable<Device[]>,
kind: 'parsed',
parse: String,
brief:
'Target device or platform for the project, use --list-devices to select from interactive list; defaults to current OS simulator',
optional: true,
Expand Down
8 changes: 4 additions & 4 deletions src/commands/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEVICE_ALIAS } from '../toolbox/prompt/devices'
type Mode = 'development' | 'production'

interface CleanOptions {
device?: Device
device?: string
example?: string
'list-examples'?: boolean
'list-devices'?: boolean
Expand Down Expand Up @@ -38,7 +38,7 @@ const command = buildCommand({
output,
config = [],
} = flags
const targetPlatform: string = DEVICE_ALIAS[device] ?? device
const targetPlatform: string = DEVICE_ALIAS[device as Device] ?? device
projectPath = filesystem.resolve(projectPath)
const parsedConfig = config.reduce<Record<string, string>>(
(result, setting) => {
Expand Down Expand Up @@ -76,8 +76,8 @@ const command = buildCommand({
},
flags: {
device: {
kind: 'enum',
values: Object.keys(DEVICE_ALIAS) as NonNullable<Device[]>,
kind: 'parsed',
parse: String,
brief:
'Target device or platform for the project, use --list-devices to select from interactive list; defaults to current OS simulator',
optional: true,
Expand Down
8 changes: 4 additions & 4 deletions src/commands/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEVICE_ALIAS } from '../toolbox/prompt/devices'
type Mode = 'development' | 'production'

interface DebugOptions {
device?: Device
device?: string
port?: string
example?: string
'list-examples'?: boolean
Expand Down Expand Up @@ -40,7 +40,7 @@ const command = buildCommand({
output,
} = flags
const { build } = await import('../toolbox/build/index')
const targetPlatform: string = DEVICE_ALIAS[device] ?? device
const targetPlatform: string = DEVICE_ALIAS[device as Device] ?? device
projectPath = filesystem.resolve(projectPath)

await build({
Expand Down Expand Up @@ -71,8 +71,8 @@ const command = buildCommand({
},
flags: {
device: {
kind: 'enum',
values: Object.keys(DEVICE_ALIAS) as NonNullable<Device[]>,
kind: 'parsed',
parse: String,
brief:
'Target device or platform for the project, use --list-devices to select from interactive list; defaults to current OS simulator',
optional: true,
Expand Down
8 changes: 4 additions & 4 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEVICE_ALIAS } from '../toolbox/prompt/devices'
type Mode = 'development' | 'production'

interface RunOptions {
device?: Device
device?: string
port?: string
example?: string
'list-examples'?: boolean
Expand Down Expand Up @@ -38,7 +38,7 @@ const command = buildCommand({
port,
config = [],
} = flags
const targetPlatform: string = DEVICE_ALIAS[device] ?? device
const targetPlatform: string = DEVICE_ALIAS[device as Device] ?? device
projectPath = filesystem.resolve(projectPath)
const parsedConfig = config.reduce<Record<string, string>>(
(result, setting) => {
Expand Down Expand Up @@ -78,8 +78,8 @@ const command = buildCommand({
},
flags: {
device: {
kind: 'enum',
values: Object.keys(DEVICE_ALIAS) as NonNullable<Device[]>,
kind: 'parsed',
parse: String,
brief:
'Target device or platform for the project, use --list-devices to select from interactive list; defaults to current OS simulator',
optional: true,
Expand Down

0 comments on commit 2628906

Please sign in to comment.