Skip to content

Commit 0f7021c

Browse files
committed
Remove unnecessary awaits
1 parent ccbd42a commit 0f7021c

File tree

9 files changed

+13
-14
lines changed

9 files changed

+13
-14
lines changed

packages/app/src/cli/services/dev/extension/payload/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export async function getExtensionsPayloadStoreRawPayload(
2323
app: {
2424
title: options.appName,
2525
apiKey: options.apiKey,
26-
url: await buildAppURLForWeb(options.storeFqdn, options.apiKey),
27-
mobileUrl: await buildAppURLForMobile(options.storeFqdn, options.apiKey),
26+
url: buildAppURLForWeb(options.storeFqdn, options.apiKey),
27+
mobileUrl: buildAppURLForMobile(options.storeFqdn, options.apiKey),
2828
},
2929
appId: options.id,
3030
version: options.manifestVersion,

packages/app/src/cli/services/dev/processes/previewable-extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const launchPreviewableExtensionProcess: DevProcessFunction<PreviewableEx
6060
signal: abortSignal,
6161
url: proxyUrl,
6262
port,
63-
storeFqdn: await normalizeStoreFqdn(storeFqdn),
63+
storeFqdn: normalizeStoreFqdn(storeFqdn),
6464
storeId,
6565
apiKey,
6666
grantedScopes,

packages/app/src/cli/services/dev/processes/setup-dev-processes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function setupDevProcesses({
9090
}> {
9191
const apiKey = remoteApp.apiKey
9292
const apiSecret = remoteApp.apiSecretKeys[0]?.secret ?? ''
93-
const appPreviewUrl = await buildAppURLForWeb(storeFqdn, apiKey)
93+
const appPreviewUrl = buildAppURLForWeb(storeFqdn, apiKey)
9494
const env = getEnvironmentVariables()
9595
const shouldRenderGraphiQL = !isTruthy(env[environmentVariableNames.disableGraphiQLExplorer])
9696

packages/app/src/cli/services/store-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function storeContext({
5656
}
5757

5858
await logMetadata(selectedStore, forceReselectStore)
59-
selectedStore.shopDomain = await normalizeStoreFqdn(selectedStore.shopDomain)
59+
selectedStore.shopDomain = normalizeStoreFqdn(selectedStore.shopDomain)
6060

6161
// Save the selected store in the hidden config file
6262
if (selectedStore.shopDomain !== cachedStoreURL || !devStoreUrlFromHiddenConfig) {

packages/app/src/cli/utilities/app/app-url.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {normalizeStoreFqdn} from '@shopify/cli-kit/node/context/fqdn'
22

3-
export async function buildAppURLForWeb(storeFqdn: string, apiKey: string) {
4-
const normalizedFQDN = await normalizeStoreFqdn(storeFqdn)
3+
export function buildAppURLForWeb(storeFqdn: string, apiKey: string) {
4+
const normalizedFQDN = normalizeStoreFqdn(storeFqdn)
55
return `https://${normalizedFQDN}/admin/oauth/redirect_from_cli?client_id=${apiKey}`
66
}
77

8-
export async function buildAppURLForMobile(storeFqdn: string, apiKey: string) {
9-
const normalizedFQDN = await normalizeStoreFqdn(storeFqdn)
8+
export function buildAppURLForMobile(storeFqdn: string, apiKey: string) {
9+
const normalizedFQDN = normalizeStoreFqdn(storeFqdn)
1010
const hostUrl = `${normalizedFQDN}/admin/apps/${apiKey}`
1111
const hostParam = Buffer.from(hostUrl).toString('base64').replace(/[=]/g, '')
1212
return `https://${hostUrl}?shop=${normalizedFQDN}&host=${hostParam}`

packages/app/src/cli/utilities/extensions/fetch-product-variant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function fetchProductVariant(store: string) {
1515
const result: FindProductVariantSchema = await adminRequest(FindProductVariantQuery, adminSession)
1616
const products = result.products.edges
1717
if (products.length === 0) {
18-
const normalizedUrl = `https://${await normalizeStoreFqdn(store)}/admin/products/new`
18+
const normalizedUrl = `https://${normalizeStoreFqdn(store)}/admin/products/new`
1919
const addProductLink = outputContent`${outputToken.link(
2020
'Add a product',
2121
normalizedUrl,

packages/cli-kit/src/private/node/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export async function ensureAuthenticated(
200200

201201
const previousStoreFqdn = applications.adminApi?.storeFqdn
202202
if (previousStoreFqdn) {
203-
const normalizedStoreName = await normalizeStoreFqdn(previousStoreFqdn)
203+
const normalizedStoreName = normalizeStoreFqdn(previousStoreFqdn)
204204
if (previousStoreFqdn === applications.adminApi?.storeFqdn) {
205205
applications.adminApi.storeFqdn = normalizedStoreName
206206
}

packages/cli-kit/src/public/node/api/app-dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function appDevRequestDoc<TResult, TVariables extends Variables>(
4040
options: AppDevRequestOptions<TResult, TVariables>,
4141
): Promise<TResult> {
4242
const api = 'App Dev'
43-
const normalizedShopFqdn = await normalizeStoreFqdn(options.shopFqdn)
43+
const normalizedShopFqdn = normalizeStoreFqdn(options.shopFqdn)
4444
const fqdn = await appDevFqdn(normalizedShopFqdn)
4545
const url = `https://${fqdn}/app_dev/unstable/graphql.json`
4646

packages/theme/src/cli/utilities/theme-command.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ export default abstract class ThemeCommand extends Command {
139139
})
140140

141141
if (environmentFlags?.store && typeof environmentFlags.store === 'string') {
142-
// eslint-disable-next-line no-await-in-loop
143-
environmentFlags.store = await normalizeStoreFqdn(environmentFlags.store)
142+
environmentFlags.store = normalizeStoreFqdn(environmentFlags.store)
144143
}
145144

146145
if (environmentFlags?.path && typeof environmentFlags.path === 'string') {

0 commit comments

Comments
 (0)