Skip to content
Draft
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
3 changes: 1 addition & 2 deletions packages/cli-kit/src/public/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ async function addInitToArgvWhenRunningCreateCLI(
const {moduleDirectory} = await import('./path.js')

const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const packageName = (packageJson.content as any).name as string
const packageName = packageJson.content.name ?? ''
const name = packageName.replace('@shopify/create-', '')
const initIndex = argv.findIndex((arg) => arg.includes('init'))
if (initIndex === -1) {
Expand Down
10 changes: 5 additions & 5 deletions packages/cli-kit/src/public/node/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ export async function handler(error: unknown): Promise<unknown> {
fatal.stack = error.stack
} else {
// errors can come in all shapes and sizes...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const maybeError = error as any
fatal = new BugError(maybeError?.message ?? 'Unknown error')
if (maybeError?.stack) {
fatal.stack = maybeError?.stack
const maybeError = error as Record<string, unknown>
const message = typeof maybeError?.message === 'string' ? maybeError.message : 'Unknown error'
fatal = new BugError(message)
if (typeof maybeError?.stack === 'string') {
fatal.stack = maybeError.stack
}
}

Expand Down
8 changes: 3 additions & 5 deletions packages/cli-kit/src/public/node/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,15 @@ export function createRuntimeMetadataContainer<
durationStack[durationStack.length - 1] = (durationStack[durationStack.length - 1] ?? 0) + wallClockDuration
}

// Log it -- we include it in the metadata, but also log via the standard performance API. The TS types for this library are not quite right, so we have to cast to `any` here.
// Log it -- we include it in the metadata, but also log via the standard performance API.
performance.measure(`${field}#measurable`, {
start,
duration,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any)
} as PerformanceMeasureOptions)
performance.measure(`${field}#wall`, {
start,
end,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any)
} as PerformanceMeasureOptions)

// There might not be a value set, yet
let currentValue = (raw.public[field] || 0) as number
Expand Down
5 changes: 3 additions & 2 deletions packages/cli-kit/src/public/node/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export async function fanoutHooks<TPluginMap extends HookReturnsPerPlugin, TEven
timeout?: number,
): Promise<Partial<TPluginMap[typeof event]['pluginReturns']>> {
const res = await config.runHook(event, options, timeout)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return Object.fromEntries(res.successes.map(({result, plugin}) => [plugin.name, result])) as any
return Object.fromEntries(
res.successes.map(({result, plugin}) => [plugin.name, result]),
) as Partial<TPluginMap[typeof event]['pluginReturns']>
}

type AppSpecificMonorailFields = PickByPrefix<
Expand Down
Loading