-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Lets try autogenerating the entitlements instead * Clean up project * Add INTERNALLY_TEST_PREBUILD * Fix type errors * Clean up entitlements in project * Add createExpoTargetConfig * Bun install * Add node for swift-test * Update getAppGroupFromExpoConfig export import * Add bundle-example and config-example tests to CI * Try with more specific path to hashFiles * Bump some workflow actions * Add prebuild CI check * Publish 0.2.3, use npx to publish * remove unsupported cache * Add prepublishOnly * Remove packageManager field
- Loading branch information
1 parent
570f065
commit 55ae2b5
Showing
31 changed files
with
207 additions
and
245 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const getAppGroupFromExpoConfig = require("./getAppGroupFromExpoConfig"); | ||
|
||
/** | ||
* Creates a configuration function for Apple target extensions | ||
* @param {('shield-action' | 'shield-configuration' | 'device-activity-monitor')} targetType - The type of target extension | ||
* @returns {import('@kingstinct/expo-apple-targets/build/config-plugin').ConfigFunction} | ||
*/ | ||
const createConfig = (targetType) => { | ||
/** @type {import('@kingstinct/expo-apple-targets/build/config-plugin').ConfigFunction} */ | ||
const config = (config) => { | ||
const appGroup = getAppGroupFromExpoConfig(config); | ||
|
||
return { | ||
type: targetType, | ||
entitlements: { | ||
"com.apple.developer.family-controls": true, | ||
"com.apple.security.application-groups": [appGroup], | ||
}, | ||
}; | ||
}; | ||
return config; | ||
}; | ||
|
||
module.exports = { createConfig }; |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Extracts the app group from Expo config | ||
* @param {import("expo/config").ExpoConfig} config - The Expo config object | ||
* @returns {string|undefined} The app group identifier or undefined if not found | ||
*/ | ||
const getAppGroupFromExpoConfig = (config) => { | ||
const plugin = config.plugins?.find((plugin) => { | ||
if (Array.isArray(plugin)) { | ||
const [pluginName] = plugin; | ||
return ( | ||
pluginName === "react-native-device-activity" || | ||
(process.env.INTERNALLY_TEST_PREBUILD && | ||
pluginName === "../app.plugin.js") | ||
); | ||
} | ||
|
||
return null; | ||
}); | ||
|
||
const { appGroup } = plugin?.[1] ?? {}; | ||
|
||
if (!appGroup) { | ||
console.error( | ||
"[react-native-device-activity] Required 'appGroup' property missing from Config Plugin", | ||
); | ||
} | ||
|
||
return appGroup; | ||
}; | ||
|
||
module.exports = getAppGroupFromExpoConfig; |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.