@craft-native/ios 0.0.233 → 0.0.234

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/dist/index.d.ts CHANGED
@@ -503,7 +503,10 @@ export declare function installRuntime(output: string, runtimeDir: string): Prom
503
503
  * valid Swift type.
504
504
  */
505
505
  export declare function productName(name: string): string;
506
- /** Restore package-owned Swift into an existing project, without changing its Xcode metadata or bundled screens. */
506
+ /** Restore package-owned Swift, retaining Xcode metadata and bundled screens.
507
+ * Xcode Cloud assigns the distributed build number independently of the source
508
+ * config; keep the packaged runtime identity in step with Apple's build.
509
+ */
507
510
  export declare function restoreShell(output: string): void;
508
511
  export { assertNoApplicationSwiftSources, findApplicationSwiftSources } from './source-audit.js';
509
512
  export declare function init(options: InitOptions): Promise<void>;
package/dist/index.js CHANGED
@@ -1057,8 +1057,17 @@ function productName(name) {
1057
1057
  return /^\d/.test(joined) ? `App${joined}` : joined;
1058
1058
  }
1059
1059
  function restoreShell(output) {
1060
- const config = JSON.parse(readFileSync2(join3(output, "craft.config.json"), "utf8"));
1060
+ const file = join3(output, "craft.config.json");
1061
+ const config = JSON.parse(readFileSync2(file, "utf8"));
1062
+ const cloudBuild = process.env.CI_BUILD_NUMBER;
1063
+ if (cloudBuild !== undefined) {
1064
+ if (!/^[1-9]\d*$/.test(cloudBuild) || cloudBuild.trim() !== cloudBuild)
1065
+ throw new Error("CI_BUILD_NUMBER must be a positive integer");
1066
+ config.buildNumber = cloudBuild;
1067
+ }
1061
1068
  writeShell(output, config);
1069
+ if (cloudBuild !== undefined)
1070
+ writeFileSync2(file, JSON.stringify(config, null, 2));
1062
1071
  }
1063
1072
  function writeShell(output, config) {
1064
1073
  if (!config.appName || !/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(config.bundleId))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craft-native/ios",
3
- "version": "0.0.233",
3
+ "version": "0.0.234",
4
4
  "homepage": "https://github.com/craft-native/craft/tree/main/packages/ios#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -7454,7 +7454,6 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
7454
7454
  var traits: UIAccessibilityTraits = []
7455
7455
  switch type {
7456
7456
  case "Slider", "Picker", "DatePicker": traits.insert(.adjustable)
7457
- case "Switch": traits.insert(.button)
7458
7457
  default: break
7459
7458
  }
7460
7459
  switch role ?? type.lowercased() {
@@ -7496,7 +7495,10 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
7496
7495
  // that is what UI tests and VoiceOver read focus from. Setting them
7497
7496
  // froze them, so it read as static text that never had focus ("neither
7498
7497
  // element nor any descendant has keyboard focus"); it keeps its own.
7499
- if view is UITextView { return }
7498
+ // UISwitch also owns its native identity and enabled/on state.
7499
+ // Assigning .button changes its legacy AX type into a button while
7500
+ // modern XCTest still identifies its UIKit class as a switch.
7501
+ if view is UITextView || view is UISwitch { return }
7500
7502
  view.accessibilityTraits = traits
7501
7503
  }
7502
7504