Skip to content

Commit 41ec03f

Browse files
authored
Merge pull request #5817 from Shopify/shauns/05-16-use_improved_config_module_loading_by_default
Use improved config module loading by default
2 parents 817bf4b + d691457 commit 41ec03f

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

.changeset/famous-humans-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/app': minor
3+
---
4+
5+
Unsupported sections in your app.toml file will present a validation error. Opt-out with SHOPIFY_CLI_DISABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS.

packages/app/src/cli/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export const environmentVariableNames = {
55
enableAppLogPolling: 'SHOPIFY_CLI_ENABLE_APP_LOG_POLLING',
66
templatesJsonPath: 'SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH',
77
mkcertBinaryPath: 'SHOPIFY_CLI_MKCERT_BINARY',
8-
enableUnsupportedConfigPropertyChecks: 'SHOPIFY_CLI_ENABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS',
98
disableUnsupportedConfigPropertyChecks: 'SHOPIFY_CLI_DISABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS',
109
disableMinificationOnDev: 'SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV',
1110
disableWasmTomlPatch: 'SHOPIFY_CLI_DISABLE_WASM_TOML_PATCH',

packages/app/src/cli/models/app/loader.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,8 +2547,7 @@ wrong = "property"
25472547
await expect(loadTestingApp()).rejects.toThrow(AbortError)
25482548
})
25492549

2550-
test('loads the app with an unsupported config property, under failure mode', async () => {
2551-
vi.stubEnv('SHOPIFY_CLI_ENABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS', '1')
2550+
test('loads the app with an unsupported config property, under failure mode (default)', async () => {
25522551
const linkedAppConfigurationWithExtraConfig = `
25532552
name = "for-testing"
25542553
client_id = "1234567890"
@@ -2575,7 +2574,6 @@ wrong = "property"
25752574
await expect(loadTestingApp()).rejects.toThrow(
25762575
'Unsupported section(s) in app configuration: and_another, something_else',
25772576
)
2578-
vi.unstubAllEnvs()
25792577
})
25802578

25812579
test('loads the app with an unsupported config property, under passthrough mode', async () => {

packages/app/src/cli/models/app/loader.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import {getArrayRejectingUndefined} from '@shopify/cli-kit/common/array'
5555
import {showNotificationsIfNeeded} from '@shopify/cli-kit/node/notifications-system'
5656
import ignore from 'ignore'
5757
import {getEnvironmentVariables} from '@shopify/cli-kit/node/environment'
58-
import {isShopify} from '@shopify/cli-kit/node/context/local'
5958
import {isTruthy} from '@shopify/cli-kit/node/context/utilities'
6059

6160
const defaultExtensionDirectory = 'extensions/*'
@@ -185,18 +184,11 @@ export function parseConfigurationObjectAgainstSpecification<TSchema extends zod
185184
/**
186185
* Returns true if we should fail if an unsupported app.toml config property is found.
187186
*
188-
* This is activated if SHOPIFY_CLI_ENABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS is set or the developer is an internal Shopify dev.
187+
* This is deactivated if SHOPIFY_CLI_DISABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS is set
189188
*/
190189
async function shouldFailIfUnsupportedConfigProperty(): Promise<boolean> {
191190
const env = getEnvironmentVariables()
192-
const enableUnsupportedConfigPropertyChecks = env[environmentVariableNames.enableUnsupportedConfigPropertyChecks]
193-
194-
if (isTruthy(enableUnsupportedConfigPropertyChecks)) return true
195-
196-
const isInternalDeveloper = await isShopify()
197-
if (!isInternalDeveloper) return false
198-
199-
// internal devs can also opt-out
191+
// devs can also opt-out
200192
const disableUnsupportedConfigPropertyChecks = env[environmentVariableNames.disableUnsupportedConfigPropertyChecks]
201193
return !isTruthy(disableUnsupportedConfigPropertyChecks)
202194
}

0 commit comments

Comments
 (0)