voltra 1.2.0-rc.3 → 1.2.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voltra",
3
- "version": "1.2.0-rc.3",
3
+ "version": "1.2.0-rc.5",
4
4
  "description": "Build Live Activities with JSX in React Native",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -25,6 +25,9 @@ const withVoltra = (config, props = {}) => {
25
25
  // Use custom targetName if provided, otherwise fall back to default "{AppName}LiveActivity"
26
26
  const targetName = props.targetName || `${config_plugins_1.IOSConfig.XcodeUtils.sanitizedName(config.name)}LiveActivity`;
27
27
  const bundleIdentifier = `${config.ios.bundleIdentifier}.${targetName}`;
28
+ // Extract version and buildNumber from config, defaulting to Expo defaults
29
+ const version = config.version || '1.0.0';
30
+ const buildNumber = config.ios?.buildNumber || '1';
28
31
  // Ensure URL scheme is set for widget deep linking
29
32
  config = (0, urlScheme_1.ensureURLScheme)(config);
30
33
  // Configure iOS main app (Info.plist, entitlements, EAS)
@@ -38,6 +41,8 @@ const withVoltra = (config, props = {}) => {
38
41
  bundleIdentifier,
39
42
  deploymentTarget,
40
43
  widgets: props?.widgets,
44
+ version,
45
+ buildNumber,
41
46
  ...(props?.groupIdentifier ? { groupIdentifier: props.groupIdentifier } : {}),
42
47
  ...(props?.fonts ? { fonts: props.fonts } : {}),
43
48
  });
@@ -4,6 +4,8 @@ export interface GenerateWidgetExtensionFilesProps {
4
4
  targetName: string;
5
5
  widgets?: WidgetConfig[];
6
6
  groupIdentifier?: string;
7
+ version: string;
8
+ buildNumber: string;
7
9
  }
8
10
  /**
9
11
  * Plugin step that generates all widget extension files.
@@ -54,7 +54,7 @@ const swift_1 = require("./swift");
54
54
  * This should run before configureXcodeProject so the files exist when Xcode project is configured.
55
55
  */
56
56
  const generateWidgetExtensionFiles = (config, props) => {
57
- const { targetName, widgets, groupIdentifier } = props;
57
+ const { targetName, widgets, groupIdentifier, version, buildNumber } = props;
58
58
  return (0, config_plugins_1.withDangerousMod)(config, [
59
59
  'ios',
60
60
  async (config) => {
@@ -68,7 +68,7 @@ const generateWidgetExtensionFiles = (config, props) => {
68
68
  fs.mkdirSync(targetPath, { recursive: true });
69
69
  }
70
70
  // Generate Info.plist
71
- (0, infoPlist_1.generateInfoPlist)(targetPath);
71
+ (0, infoPlist_1.generateInfoPlist)(targetPath, targetName, version, buildNumber);
72
72
  // Generate Assets.xcassets and copy user images
73
73
  (0, assets_1.generateAssets)({ targetPath });
74
74
  // Generate Swift files (widget bundle, initial states)
@@ -2,5 +2,8 @@
2
2
  * Generates the Info.plist file for the widget extension.
3
3
  *
4
4
  * @param targetPath - Path to the widget extension target directory
5
+ * @param targetName - The widget extension target name (used for CFBundleDisplayName)
6
+ * @param version - The app version (CFBundleShortVersionString)
7
+ * @param buildNumber - The build number (CFBundleVersion)
5
8
  */
6
- export declare function generateInfoPlist(targetPath: string): void;
9
+ export declare function generateInfoPlist(targetPath: string, targetName: string, version: string, buildNumber: string): void;
@@ -40,14 +40,20 @@ const logger_1 = require("../../utils/logger");
40
40
  /**
41
41
  * Generates the Info.plist content for a WidgetKit extension.
42
42
  *
43
- * This is the minimal required Info.plist - it only declares the extension point.
44
- * Build settings (GENERATE_INFOPLIST_FILE=YES) handles the rest.
43
+ * This includes version information and the required WidgetKit extension point.
44
+ * Version keys are written directly to the plist following the Expo pattern.
45
45
  */
46
- function generateInfoPlistContent() {
46
+ function generateInfoPlistContent(targetName, version, buildNumber) {
47
47
  return `<?xml version="1.0" encoding="UTF-8"?>
48
48
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
49
49
  <plist version="1.0">
50
50
  <dict>
51
+ <key>CFBundleDisplayName</key>
52
+ <string>${targetName}</string>
53
+ <key>CFBundleShortVersionString</key>
54
+ <string>${version}</string>
55
+ <key>CFBundleVersion</key>
56
+ <string>${buildNumber}</string>
51
57
  <key>NSExtension</key>
52
58
  <dict>
53
59
  <key>NSExtensionPointIdentifier</key>
@@ -61,9 +67,12 @@ function generateInfoPlistContent() {
61
67
  * Generates the Info.plist file for the widget extension.
62
68
  *
63
69
  * @param targetPath - Path to the widget extension target directory
70
+ * @param targetName - The widget extension target name (used for CFBundleDisplayName)
71
+ * @param version - The app version (CFBundleShortVersionString)
72
+ * @param buildNumber - The build number (CFBundleVersion)
64
73
  */
65
- function generateInfoPlist(targetPath) {
74
+ function generateInfoPlist(targetPath, targetName, version, buildNumber) {
66
75
  const infoPlistPath = path.join(targetPath, 'Info.plist');
67
- fs.writeFileSync(infoPlistPath, generateInfoPlistContent());
76
+ fs.writeFileSync(infoPlistPath, generateInfoPlistContent(targetName, version, buildNumber));
68
77
  logger_1.logger.info('Generated Info.plist');
69
78
  }
@@ -7,6 +7,8 @@ export interface WithIOSProps {
7
7
  widgets?: WidgetConfig[];
8
8
  groupIdentifier?: string;
9
9
  fonts?: string[];
10
+ version: string;
11
+ buildNumber: string;
10
12
  }
11
13
  /**
12
14
  * Main iOS configuration plugin.
@@ -25,7 +25,7 @@ const xcode_1 = require("./xcode");
25
25
  * so fonts must be registered before configureXcodeProject.
26
26
  */
27
27
  const withIOS = (config, props) => {
28
- const { targetName, bundleIdentifier, deploymentTarget, widgets, groupIdentifier, fonts } = props;
28
+ const { targetName, bundleIdentifier, deploymentTarget, widgets, groupIdentifier, fonts, version, buildNumber } = props;
29
29
  const plugins = [
30
30
  // 1. Add custom fonts if provided
31
31
  ...(fonts && fonts.length > 0 ? [[fonts_1.withFonts, { fonts, targetName }]] : []),
@@ -38,7 +38,7 @@ const withIOS = (config, props) => {
38
38
  // 5. Configure EAS build settings
39
39
  [eas_1.configureEasBuild, { targetName, bundleIdentifier, groupIdentifier }],
40
40
  // 6. Generate widget extension files (dangerous mod should run before plist patchers)
41
- [files_1.generateWidgetExtensionFiles, { targetName, widgets, groupIdentifier }],
41
+ [files_1.generateWidgetExtensionFiles, { targetName, widgets, groupIdentifier, version, buildNumber }],
42
42
  ];
43
43
  return (0, config_plugins_1.withPlugins)(config, plugins);
44
44
  };
@@ -1,10 +1,8 @@
1
1
  import { XcodeProject } from '@expo/config-plugins';
2
2
  export interface AddConfigurationListOptions {
3
3
  targetName: string;
4
- currentProjectVersion: string;
5
4
  bundleIdentifier: string;
6
5
  deploymentTarget: string;
7
- marketingVersion?: string;
8
6
  codeSignStyle?: string;
9
7
  developmentTeam?: string;
10
8
  provisioningProfileSpecifier?: string;
@@ -4,27 +4,22 @@ exports.addXCConfigurationList = addXCConfigurationList;
4
4
  exports.ensureXCConfigurationList = ensureXCConfigurationList;
5
5
  const constants_1 = require("../../constants");
6
6
  function createCommonBuildSettings(options) {
7
- const { targetName, currentProjectVersion, bundleIdentifier, deploymentTarget, marketingVersion, codeSignStyle, developmentTeam, provisioningProfileSpecifier, } = options;
7
+ const { targetName, bundleIdentifier, deploymentTarget, codeSignStyle, developmentTeam, provisioningProfileSpecifier, } = options;
8
8
  const commonBuildSettings = {
9
9
  PRODUCT_NAME: `"$(TARGET_NAME)"`,
10
10
  SWIFT_VERSION: constants_1.IOS.SWIFT_VERSION,
11
11
  TARGETED_DEVICE_FAMILY: `"${constants_1.IOS.DEVICE_FAMILY}"`,
12
12
  INFOPLIST_FILE: `${targetName}/Info.plist`,
13
13
  INFOPLIST_OUTPUT_FORMAT: `"xml"`,
14
- CURRENT_PROJECT_VERSION: `"${currentProjectVersion}"`,
14
+ CURRENT_PROJECT_VERSION: `"1"`,
15
+ MARKETING_VERSION: `"1.0"`,
15
16
  IPHONEOS_DEPLOYMENT_TARGET: `"${deploymentTarget}"`,
16
17
  PRODUCT_BUNDLE_IDENTIFIER: `"${bundleIdentifier}"`,
17
- GENERATE_INFOPLIST_FILE: `"YES"`,
18
- INFOPLIST_KEY_CFBundleDisplayName: targetName,
19
- INFOPLIST_KEY_NSHumanReadableCopyright: `""`,
20
18
  SWIFT_OPTIMIZATION_LEVEL: `"-Onone"`,
21
19
  CODE_SIGN_ENTITLEMENTS: `"${targetName}/${targetName}.entitlements"`,
22
20
  APPLICATION_EXTENSION_API_ONLY: '"YES"',
23
21
  ASSETCATALOG_COMPILER_APPICON_NAME: '""',
24
22
  };
25
- if (marketingVersion) {
26
- commonBuildSettings.MARKETING_VERSION = `"${marketingVersion}"`;
27
- }
28
23
  // Synchronize code signing settings from main app target
29
24
  if (codeSignStyle) {
30
25
  commonBuildSettings.CODE_SIGN_STYLE = `"${codeSignStyle}"`;
@@ -70,25 +70,16 @@ const configureXcodeProject = (config, props) => {
70
70
  const { platformProjectRoot } = config.modRequest;
71
71
  const targetPath = path.join(platformProjectRoot, targetName);
72
72
  const widgetFiles = (0, fileDiscovery_1.getWidgetFiles)(targetPath, targetName);
73
- // Read main app target settings to synchronize code signing and version
73
+ // Read main app target settings to synchronize code signing
74
74
  const mainAppSettings = (0, mainAppSettings_1.getMainAppTargetSettings)(xcodeProject);
75
- // Use current project version (CFBundleVersion) from main app if available
76
- // Otherwise fall back to config.ios?.buildNumber or '1'
77
- const currentProjectVersion = mainAppSettings?.currentProjectVersion || config.ios?.buildNumber || '1';
78
- // Use marketing version (CFBundleShortVersionString) from main app if available
79
- // Otherwise fall back to config.version
80
- // This ensures the widget extension version matches the main app version
81
- const marketingVersion = mainAppSettings?.marketingVersion || config.version;
82
75
  // Use the deploymentTarget from plugin config (or default), ignore main app's deployment target
83
76
  // This allows the widget extension to have its own deployment target independent of the main app
84
77
  if (existingTarget && existingTargetKey) {
85
78
  // Ensure configuration list is up to date
86
79
  const xCConfigurationList = (0, configurationList_1.ensureXCConfigurationList)(xcodeProject, {
87
80
  targetName,
88
- currentProjectVersion,
89
81
  bundleIdentifier,
90
82
  deploymentTarget,
91
- marketingVersion,
92
83
  codeSignStyle: mainAppSettings?.codeSignStyle,
93
84
  developmentTeam: mainAppSettings?.developmentTeam,
94
85
  provisioningProfileSpecifier: mainAppSettings?.provisioningProfileSpecifier,
@@ -127,10 +118,8 @@ const configureXcodeProject = (config, props) => {
127
118
  const targetUuid = xcodeProject.generateUuid();
128
119
  const xCConfigurationList = (0, configurationList_1.addXCConfigurationList)(xcodeProject, {
129
120
  targetName,
130
- currentProjectVersion,
131
121
  bundleIdentifier,
132
122
  deploymentTarget,
133
- marketingVersion,
134
123
  codeSignStyle: mainAppSettings?.codeSignStyle,
135
124
  developmentTeam: mainAppSettings?.developmentTeam,
136
125
  provisioningProfileSpecifier: mainAppSettings?.provisioningProfileSpecifier,
@@ -1,14 +1,12 @@
1
1
  import { XcodeProject } from '@expo/config-plugins';
2
2
  export interface MainAppTargetSettings {
3
3
  deploymentTarget: string;
4
- marketingVersion?: string;
5
- currentProjectVersion?: string;
6
4
  codeSignStyle?: string;
7
5
  developmentTeam?: string;
8
6
  provisioningProfileSpecifier?: string;
9
7
  }
10
8
  /**
11
- * Reads build settings from the main app target to synchronize with the widget extension.
9
+ * Reads build settings from the main app target to synchronize code signing with the widget extension.
12
10
  *
13
11
  * @param xcodeProject The Xcode project instance
14
12
  * @returns The main app target's build settings, or null if not found
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getMainAppTargetSettings = getMainAppTargetSettings;
4
4
  /**
5
- * Reads build settings from the main app target to synchronize with the widget extension.
5
+ * Reads build settings from the main app target to synchronize code signing with the widget extension.
6
6
  *
7
7
  * @param xcodeProject The Xcode project instance
8
8
  * @returns The main app target's build settings, or null if not found
@@ -43,14 +43,6 @@ function getMainAppTargetSettings(xcodeProject) {
43
43
  const deploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET?.replace(/^"|"$/g, '') ||
44
44
  buildSettings['IPHONEOS_DEPLOYMENT_TARGET']?.replace(/^"|"$/g, '') ||
45
45
  null;
46
- // Extract marketing version (CFBundleShortVersionString)
47
- const marketingVersion = buildSettings.MARKETING_VERSION?.replace(/^"|"$/g, '') ||
48
- buildSettings['MARKETING_VERSION']?.replace(/^"|"$/g, '') ||
49
- null;
50
- // Extract current project version (CFBundleVersion)
51
- const currentProjectVersion = buildSettings.CURRENT_PROJECT_VERSION?.replace(/^"|"$/g, '') ||
52
- buildSettings['CURRENT_PROJECT_VERSION']?.replace(/^"|"$/g, '') ||
53
- null;
54
46
  // Extract code signing settings
55
47
  const codeSignStyle = buildSettings.CODE_SIGN_STYLE?.replace(/^"|"$/g, '') ||
56
48
  buildSettings['CODE_SIGN_STYLE']?.replace(/^"|"$/g, '') ||
@@ -66,8 +58,6 @@ function getMainAppTargetSettings(xcodeProject) {
66
58
  }
67
59
  return {
68
60
  deploymentTarget,
69
- marketingVersion: marketingVersion || undefined,
70
- currentProjectVersion: currentProjectVersion || undefined,
71
61
  codeSignStyle: codeSignStyle || undefined,
72
62
  developmentTeam: developmentTeam || undefined,
73
63
  provisioningProfileSpecifier: provisioningProfileSpecifier || undefined,