Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/app/src/cli/models/app/app.test-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export async function testUIExtension(
},
},
supported_features: {
offline_mode: false,
runs_offline: false,
},
extension_points: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/cli/models/app/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ redirect_urls = [ "https://example.com/api/auth" ]
sources = ["https://my-iframe.com"]

[extensions.supported_features]
offline_mode = true
runs_offline = true

[extensions.settings]
[[extensions.settings.fields]]
Expand Down Expand Up @@ -1564,7 +1564,7 @@ redirect_urls = [ "https://example.com/api/auth" ]
},
},
supported_features: {
offline_mode: true,
runs_offline: true,
},
settings: {
fields: [
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/models/extensions/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const CapabilitiesSchema = zod.object({
})

const SupportedFeaturesSchema = zod.object({
offline_mode: zod.boolean().optional(),
runs_offline: zod.boolean().optional(),
})

export const ExtensionsArraySchema = zod.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ Please check the configuration in ${joinPath(tmpDir, 'shopify.extension.toml')}`
})
})

test('returns supported_features with offline_mode true when configured', async () => {
test('returns supported_features with runs_offline true when configured', async () => {
await inTemporaryDirectory(async (tmpDir) => {
// Given
vi.spyOn(loadLocales, 'loadLocalesConfig').mockResolvedValue({})
Expand All @@ -1012,7 +1012,7 @@ Please check the configuration in ${joinPath(tmpDir, 'shopify.extension.toml')}`
metafields: [],
capabilities: {},
supported_features: {
offline_mode: true,
runs_offline: true,
},
settings: {},
},
Expand All @@ -1030,12 +1030,12 @@ Please check the configuration in ${joinPath(tmpDir, 'shopify.extension.toml')}`

// Then
expect(deployConfig?.supported_features).toStrictEqual({
offline_mode: true,
runs_offline: true,
})
})
})

test('returns supported_features with offline_mode false when configured', async () => {
test('returns supported_features with runs_offline false when configured', async () => {
await inTemporaryDirectory(async (tmpDir) => {
// Given
vi.spyOn(loadLocales, 'loadLocalesConfig').mockResolvedValue({})
Expand All @@ -1051,7 +1051,7 @@ Please check the configuration in ${joinPath(tmpDir, 'shopify.extension.toml')}`
metafields: [],
capabilities: {},
supported_features: {
offline_mode: false,
runs_offline: false,
},
settings: {},
},
Expand All @@ -1069,7 +1069,7 @@ Please check the configuration in ${joinPath(tmpDir, 'shopify.extension.toml')}`

// Then
expect(deployConfig?.supported_features).toStrictEqual({
offline_mode: false,
runs_offline: false,
})
})
})
Expand Down
8 changes: 4 additions & 4 deletions packages/app/src/cli/services/dev/extension/payload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ describe('getUIExtensionPayload', () => {
})

describe('supportedFeatures', () => {
test('returns supportedFeatures with offlineMode true when offline_mode is enabled', async () => {
test('returns supportedFeatures with offlineMode true when runs_offline is enabled', async () => {
await inTemporaryDirectory(async (tmpDir) => {
// Given
const uiExtension = await testUIExtension({
Expand All @@ -473,7 +473,7 @@ describe('getUIExtensionPayload', () => {
metafields: [],
capabilities: {},
supported_features: {
offline_mode: true,
runs_offline: true,
},
extension_points: [],
},
Expand All @@ -493,7 +493,7 @@ describe('getUIExtensionPayload', () => {
})
})

test('returns supportedFeatures with offlineMode false when offline_mode is disabled', async () => {
test('returns supportedFeatures with offlineMode false when runs_offline is disabled', async () => {
await inTemporaryDirectory(async (tmpDir) => {
// Given
const uiExtension = await testUIExtension({
Expand All @@ -504,7 +504,7 @@ describe('getUIExtensionPayload', () => {
metafields: [],
capabilities: {},
supported_features: {
offline_mode: false,
runs_offline: false,
},
extension_points: [],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/services/dev/extension/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function getUIExtensionPayload(
},
},
supportedFeatures: {
offlineMode: extension.configuration.supported_features?.offline_mode ?? false,
offlineMode: extension.configuration.supported_features?.runs_offline ?? false,
},
capabilities: {
blockProgress: extension.configuration.capabilities?.block_progress ?? false,
Expand Down
Loading