diff --git a/.changeset/tall-tips-fail.md b/.changeset/tall-tips-fail.md new file mode 100644 index 00000000..bedcf4c7 --- /dev/null +++ b/.changeset/tall-tips-fail.md @@ -0,0 +1,5 @@ +--- +"gyp-to-cmake": patch +--- + +Fixed escaping bundle ids to no longer contain "\_" diff --git a/packages/gyp-to-cmake/src/transformer.ts b/packages/gyp-to-cmake/src/transformer.ts index a5660eba..4901df4f 100644 --- a/packages/gyp-to-cmake/src/transformer.ts +++ b/packages/gyp-to-cmake/src/transformer.ts @@ -27,8 +27,12 @@ function escapeSpaces(source: string) { return source.replace(/ /g, "\\ "); } -function escapeBundleIdentifier(identifier: string) { - return identifier.replaceAll("__", ".").replace(/[^A-Za-z0-9.-_]/g, "-"); +/** + * Escapes any input to match a CFBundleIdentifier + * See https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleidentifier + */ +export function escapeBundleIdentifier(input: string) { + return input.replaceAll("__", ".").replace(/[^A-Za-z0-9-.]/g, "-"); } /**