-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix intermittent JSON schema building errors in CI (#687)
This PR drops the usage of `as const` in `supported-php-extensions.ts` since they don't seem to play well with the `ts-json-schema-generator` package that generates Blueprint JSON schema from TypeScript types. Specifically, it seems to be the root cause behind these intermittent failures only happening in GitHub actions: ``` UnknownNodeError: Unknown node " supportedPHPExtensions" of kind "Identifier" ``` It's unclear to me why `as const` is fine in `supported-php-versions.ts`. Perhaps it's because that file uses just lists and not objects? I also don't get why the failures are only intermittent. Let's further investigate if and when these errors return.
- Loading branch information
Showing
2 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
17 changes: 8 additions & 9 deletions
17
packages/php-wasm/universal/src/lib/supported-php-extensions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
export const supportedPHPExtensions = [ | ||
// The extensions list is repeated on purpose to avoid CI errors | ||
// @see https://github.com/WordPress/wordpress-playground/pull/687 | ||
export type SupportedPHPExtension = 'iconv' | 'mbstring' | 'xml-bundle' | 'gd'; | ||
export const SupportedPHPExtensionsList = [ | ||
'iconv', | ||
'mbstring', | ||
'xml-bundle', | ||
'gd', | ||
] as const; | ||
export type SupportedPHPExtension = (typeof supportedPHPExtensions)[number]; | ||
export const SupportedPHPExtensionsList = | ||
supportedPHPExtensions as any as SupportedPHPExtension[]; | ||
]; | ||
|
||
export const SupportedPHPExtensionBundles = { | ||
'kitchen-sink': supportedPHPExtensions, | ||
} as const; | ||
export type SupportedPHPExtensionBundle = | ||
keyof typeof SupportedPHPExtensionBundles; | ||
'kitchen-sink': SupportedPHPExtensionsList, | ||
}; | ||
export type SupportedPHPExtensionBundle = 'kitchen-sink'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters