rork-xcode 0.6.0 → 0.8.0

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
@@ -261,6 +261,15 @@ declare const ProductType: {
261
261
  * The Apple platforms the model can resolve a main application target for.
262
262
  */
263
263
  type ApplePlatform = "ios" | "macos" | "tvos" | "watchos" | "visionos";
264
+ /**
265
+ * Normalizes a platform name to an {@link ApplePlatform}. Punctuation and
266
+ * casing are ignored, so spellings like `tvOS`, `TV_OS`, and `visionos`
267
+ * all resolve, and the SDK names Xcode writes into `SDKROOT` (for
268
+ * example `iphoneos`, `appletvos`, and `xros`, with their simulator
269
+ * variants) resolve to the platform they build for. Anything else
270
+ * returns `undefined`.
271
+ */
272
+ declare function parseApplePlatform(value: string): ApplePlatform | undefined;
264
273
  /**
265
274
  * `dstSubfolderSpec` values for copy-files build phases, named after the
266
275
  * destination each selects.
@@ -723,6 +732,14 @@ declare class NativeTarget extends Target<NativeTargetProperties> {
723
732
  * target has no product reference to embed.
724
733
  */
725
734
  embed(extension: NativeTarget): CopyFilesBuildPhase | undefined;
735
+ /**
736
+ * The targets whose products this target's copy-files phases carry,
737
+ * in phase and file order. This is the read-side counterpart of
738
+ * {@link embed}: extensions, watch apps, and App Clips embedded here
739
+ * come back as their target views. Targets embedding further targets
740
+ * of their own can be walked recursively through this accessor.
741
+ */
742
+ embeddedTargets(): NativeTarget[];
726
743
  /**
727
744
  * The on-disk folder paths of the file-system-synchronized groups linked
728
745
  * to this target. Empty for targets without synchronized folders
@@ -942,6 +959,11 @@ declare class CopyFilesBuildPhase extends BuildPhase<CopyFilesBuildPhaseProperti
942
959
  * when present.
943
960
  */
944
961
  get dstPath(): string | undefined;
962
+ /**
963
+ * The destination folder code, when present. Compare against the
964
+ * {@link CopyFilesDestination} constants.
965
+ */
966
+ get dstSubfolderSpec(): number | undefined;
945
967
  }
946
968
  /**
947
969
  * A `PBXShellScriptBuildPhase` runs a script during the build.
@@ -1946,4 +1968,4 @@ declare function parseXcscheme(text: string): XcschemeDocument;
1946
1968
  */
1947
1969
  declare function generateObjectId(seed: string, existing: ReadonlySet<string>): string;
1948
1970
  //#endregion
1949
- export { type AddNativeTargetOptions, AggregateTarget, type ApplePlatform, AppleScriptBuildPhase, BuildConfiguration, type BuildConfigurationProperties, BuildFile, BuildFileExceptionSet, type BuildFileProperties, BuildPhase, type BuildPhaseIsa, BuildPhaseMembershipExceptionSet, type BuildPhaseMembershipExceptionSetProperties, type BuildPhaseOf, type BuildPhaseProperties, BuildRule, type BuildRuleProperties, type BuildSettings, BuildStyle, type BuildStyleProperties, BuildableReference, ConfigurationList, type ConfigurationListProperties, ContainerItemProxy, type ContainerItemProxyProperties, CopyFilesBuildPhase, type CopyFilesBuildPhaseProperties, CopyFilesDestination, type CreateXcschemeOptions, ExceptionSet, type ExceptionSetProperties, FileReference, type FileReferenceProperties, FrameworksBuildPhase, Group, type GroupProperties, HeadersBuildPhase, Isa, type IsaValue, LegacyTarget, type LegacyTargetProperties, LocalSwiftPackageReference, type LocalSwiftPackageReferenceProperties, NativeTarget, type NativeTargetProperties, type PbxprojArray, PbxprojBuildError, type PbxprojErrorPosition, type PbxprojObject, PbxprojParseError, type PbxprojValue, ProductType, type ProjectIssue, type ProjectIssueKind, ReferenceProxy, type ReferenceProxyProperties, RemoteSwiftPackageReference, type RemoteSwiftPackageReferenceProperties, ResourcesBuildPhase, RezBuildPhase, RootProject, type RootProjectProperties, ShellScriptBuildPhase, type ShellScriptBuildPhaseProperties, SourcesBuildPhase, SwiftPackageProductDependency, type SwiftPackageProductDependencyProperties, SwiftPackageReference, type SwiftPackageReferenceProperties, SyncRootGroup, type SyncRootGroupProperties, Target, TargetDependency, type TargetDependencyProperties, type TargetProperties, VariantGroup, VersionGroup, type VersionGroupProperties, type ViewByIsa, type ViewOf, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, type XcschemeComment, type XcschemeDocument, type XcschemeElement, type XcschemeNode, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parsePbxproj, parseXcscheme, xcschemeElements };
1971
+ export { type AddNativeTargetOptions, AggregateTarget, type ApplePlatform, AppleScriptBuildPhase, BuildConfiguration, type BuildConfigurationProperties, BuildFile, BuildFileExceptionSet, type BuildFileProperties, BuildPhase, type BuildPhaseIsa, BuildPhaseMembershipExceptionSet, type BuildPhaseMembershipExceptionSetProperties, type BuildPhaseOf, type BuildPhaseProperties, BuildRule, type BuildRuleProperties, type BuildSettings, BuildStyle, type BuildStyleProperties, BuildableReference, ConfigurationList, type ConfigurationListProperties, ContainerItemProxy, type ContainerItemProxyProperties, CopyFilesBuildPhase, type CopyFilesBuildPhaseProperties, CopyFilesDestination, type CreateXcschemeOptions, ExceptionSet, type ExceptionSetProperties, FileReference, type FileReferenceProperties, FrameworksBuildPhase, Group, type GroupProperties, HeadersBuildPhase, Isa, type IsaValue, LegacyTarget, type LegacyTargetProperties, LocalSwiftPackageReference, type LocalSwiftPackageReferenceProperties, NativeTarget, type NativeTargetProperties, type PbxprojArray, PbxprojBuildError, type PbxprojErrorPosition, type PbxprojObject, PbxprojParseError, type PbxprojValue, ProductType, type ProjectIssue, type ProjectIssueKind, ReferenceProxy, type ReferenceProxyProperties, RemoteSwiftPackageReference, type RemoteSwiftPackageReferenceProperties, ResourcesBuildPhase, RezBuildPhase, RootProject, type RootProjectProperties, ShellScriptBuildPhase, type ShellScriptBuildPhaseProperties, SourcesBuildPhase, SwiftPackageProductDependency, type SwiftPackageProductDependencyProperties, SwiftPackageReference, type SwiftPackageReferenceProperties, SyncRootGroup, type SyncRootGroupProperties, Target, TargetDependency, type TargetDependencyProperties, type TargetProperties, VariantGroup, VersionGroup, type VersionGroupProperties, type ViewByIsa, type ViewOf, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, type XcschemeComment, type XcschemeDocument, type XcschemeElement, type XcschemeNode, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parseApplePlatform, parsePbxproj, parseXcscheme, xcschemeElements };
package/dist/index.js CHANGED
@@ -887,6 +887,33 @@ const PRODUCT_FILE_INFO = {
887
887
  }
888
888
  };
889
889
  /**
890
+ * Normalizes a platform name to an {@link ApplePlatform}. Punctuation and
891
+ * casing are ignored, so spellings like `tvOS`, `TV_OS`, and `visionos`
892
+ * all resolve, and the SDK names Xcode writes into `SDKROOT` (for
893
+ * example `iphoneos`, `appletvos`, and `xros`, with their simulator
894
+ * variants) resolve to the platform they build for. Anything else
895
+ * returns `undefined`.
896
+ */
897
+ function parseApplePlatform(value) {
898
+ switch (value.toLowerCase().replaceAll(/[^a-z]/gu, "")) {
899
+ case "ios":
900
+ case "iphoneos":
901
+ case "iphonesimulator": return "ios";
902
+ case "macos":
903
+ case "macosx":
904
+ case "osx": return "macos";
905
+ case "tvos":
906
+ case "appletvos":
907
+ case "appletvsimulator": return "tvos";
908
+ case "watchos":
909
+ case "watchsimulator": return "watchos";
910
+ case "visionos":
911
+ case "xros":
912
+ case "xrsimulator": return "visionos";
913
+ default: return;
914
+ }
915
+ }
916
+ /**
890
917
  * The build-setting key that carries each platform's deployment target.
891
918
  * A target (or its project) sets exactly one of these per platform it
892
919
  * builds for, which is what makes them usable as a platform signal.
@@ -1343,6 +1370,14 @@ var CopyFilesBuildPhase = class extends BuildPhase {
1343
1370
  get dstPath() {
1344
1371
  return this.getString("dstPath");
1345
1372
  }
1373
+ /**
1374
+ * The destination folder code, when present. Compare against the
1375
+ * {@link CopyFilesDestination} constants.
1376
+ */
1377
+ get dstSubfolderSpec() {
1378
+ const value = this.properties["dstSubfolderSpec"];
1379
+ return typeof value === "number" ? value : void 0;
1380
+ }
1346
1381
  };
1347
1382
  /**
1348
1383
  * A `PBXShellScriptBuildPhase` runs a script during the build.
@@ -3136,6 +3171,32 @@ var NativeTarget = class extends Target {
3136
3171
  return phase;
3137
3172
  }
3138
3173
  /**
3174
+ * The targets whose products this target's copy-files phases carry,
3175
+ * in phase and file order. This is the read-side counterpart of
3176
+ * {@link embed}: extensions, watch apps, and App Clips embedded here
3177
+ * come back as their target views. Targets embedding further targets
3178
+ * of their own can be walked recursively through this accessor.
3179
+ */
3180
+ embeddedTargets() {
3181
+ const ownersByProductId = /* @__PURE__ */ new Map();
3182
+ for (const candidate of this.project.nativeTargets()) {
3183
+ const product = candidate.productReference;
3184
+ if (product != null) ownersByProductId.set(product.id, candidate);
3185
+ }
3186
+ const embedded = [];
3187
+ for (const phase of this.buildPhases()) {
3188
+ if (!CopyFilesBuildPhase.is(phase)) continue;
3189
+ for (const buildFileId of phase.buildFileIds) {
3190
+ const buildFile = this.project.get(buildFileId);
3191
+ if (!BuildFile.is(buildFile)) continue;
3192
+ const reference = buildFile.fileReference();
3193
+ const owner = reference == null ? void 0 : ownersByProductId.get(reference.id);
3194
+ if (owner != null && owner !== this && !embedded.includes(owner)) embedded.push(owner);
3195
+ }
3196
+ }
3197
+ return embedded;
3198
+ }
3199
+ /**
3139
3200
  * The on-disk folder paths of the file-system-synchronized groups linked
3140
3201
  * to this target. Empty for targets without synchronized folders
3141
3202
  * (projects predating Xcode 16).
@@ -4496,4 +4557,4 @@ function createXcscheme(options) {
4496
4557
  };
4497
4558
  }
4498
4559
  //#endregion
4499
- export { AggregateTarget, AppleScriptBuildPhase, BuildConfiguration, BuildFile, BuildFileExceptionSet, BuildPhase, BuildPhaseMembershipExceptionSet, BuildRule, BuildStyle, BuildableReference, ConfigurationList, ContainerItemProxy, CopyFilesBuildPhase, CopyFilesDestination, ExceptionSet, FileReference, FrameworksBuildPhase, Group, HeadersBuildPhase, Isa, LegacyTarget, LocalSwiftPackageReference, NativeTarget, PbxprojBuildError, PbxprojParseError, ProductType, ReferenceProxy, RemoteSwiftPackageReference, ResourcesBuildPhase, RezBuildPhase, RootProject, ShellScriptBuildPhase, SourcesBuildPhase, SwiftPackageProductDependency, SwiftPackageReference, SyncRootGroup, Target, TargetDependency, VariantGroup, VersionGroup, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parsePbxproj, parseXcscheme, xcschemeElements };
4560
+ export { AggregateTarget, AppleScriptBuildPhase, BuildConfiguration, BuildFile, BuildFileExceptionSet, BuildPhase, BuildPhaseMembershipExceptionSet, BuildRule, BuildStyle, BuildableReference, ConfigurationList, ContainerItemProxy, CopyFilesBuildPhase, CopyFilesDestination, ExceptionSet, FileReference, FrameworksBuildPhase, Group, HeadersBuildPhase, Isa, LegacyTarget, LocalSwiftPackageReference, NativeTarget, PbxprojBuildError, PbxprojParseError, ProductType, ReferenceProxy, RemoteSwiftPackageReference, ResourcesBuildPhase, RezBuildPhase, RootProject, ShellScriptBuildPhase, SourcesBuildPhase, SwiftPackageProductDependency, SwiftPackageReference, SyncRootGroup, Target, TargetDependency, VariantGroup, VersionGroup, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parseApplePlatform, parsePbxproj, parseXcscheme, xcschemeElements };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rork-xcode",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Zero-dependency Xcode project (pbxproj) and scheme (xcscheme) parser, builder, and object model that runs identically in every JavaScript runtime",
5
5
  "keywords": [
6
6
  "apple",