rork-xcode 0.5.0 → 0.6.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/README.md +1 -0
- package/dist/index.d.ts +89 -13
- package/dist/index.js +61 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -223,6 +223,7 @@ for (const [id, object] of project.objects()) {
|
|
|
223
223
|
### Semantics
|
|
224
224
|
|
|
225
225
|
- **A view class for every kind.** Every `isa` Xcode writes has its own class, and each class declares its `isa` through a static field the view factory dispatches on. Targets of every kind, groups, variant and version groups, synchronized folders and their exception sets, every build phase kind, build rules, build files, build styles, configurations and configuration lists, file references, target dependencies, container item proxies, reference proxies, and Swift package references and products all come back typed. Kinds outside the vocabulary fall back to a generic `XcodeObject` with the same read and write access, so nothing in a document is out of reach.
|
|
226
|
+
- **Isa literals type the returns.** Creation and lookup take the isa and give back the exact class for it, with no cast at the call site. `project.add(Isa.fileReference, ...)` is a `FileReference`, `target.ensureBuildPhase(Isa.copyFilesBuildPhase, ...)` is a `CopyFilesBuildPhase`, and `target.findBuildPhase(Isa.shellScriptBuildPhase)` is a `ShellScriptBuildPhase | undefined`. A dynamic string falls back to the generic view type.
|
|
226
227
|
- **`is()` narrowing.** Every view class carries a static type guard for discriminating mixed objects: `if (NativeTarget.is(object))` narrows the way `instanceof` does, subclasses included. Relationships resolve typed too, from `dependency.target()` and `buildFile.productDependency()` to `configuration.buildSettings` as a live typed dictionary.
|
|
227
228
|
- **Typed, open property shapes.** Known keys autocomplete (`target.properties.productType`) and the shape stays open, so keys like `INFOPLIST_KEY_*` settings remain first-class. The shapes describe well-formed documents. When reading untrusted input, use the narrowing accessors, which never trust them.
|
|
228
229
|
- **Two verb families.** `add*` wires something to its owner (a dependency, a package, a framework, a synchronized folder) and is idempotent, so re-adding returns the existing wiring. `ensure*` returns a structural container, creating it when missing (a build phase, a group chain, the Products group). Both families can therefore run unconditionally in scaffold and repair flows.
|
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,16 @@ declare const Isa: {
|
|
|
234
234
|
readonly swiftPackageProductDependency: "XCSwiftPackageProductDependency";
|
|
235
235
|
readonly versionGroup: "XCVersionGroup";
|
|
236
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* One of the `isa` names of the vocabulary, the union of the values of
|
|
239
|
+
* {@link Isa}.
|
|
240
|
+
*/
|
|
241
|
+
type IsaValue = (typeof Isa)[keyof typeof Isa];
|
|
242
|
+
/**
|
|
243
|
+
* The `isa` names of the build phase kinds. The phase helpers on targets
|
|
244
|
+
* accept these, and the literal passed picks the phase class they return.
|
|
245
|
+
*/
|
|
246
|
+
type BuildPhaseIsa = typeof Isa.appleScriptBuildPhase | typeof Isa.copyFilesBuildPhase | typeof Isa.frameworksBuildPhase | typeof Isa.headersBuildPhase | typeof Isa.resourcesBuildPhase | typeof Isa.rezBuildPhase | typeof Isa.shellScriptBuildPhase | typeof Isa.sourcesBuildPhase;
|
|
237
247
|
/**
|
|
238
248
|
* Product type identifiers of the targets the model creates or reasons
|
|
239
249
|
* about. Other product types pass through untouched.
|
|
@@ -613,18 +623,21 @@ declare class Target<Properties extends TargetProperties = TargetProperties> ext
|
|
|
613
623
|
buildPhases(): BuildPhase[];
|
|
614
624
|
/**
|
|
615
625
|
* Finds the target's first build phase with the given isa, and, when
|
|
616
|
-
* `name` is provided, the given display name.
|
|
626
|
+
* `name` is provided, the given display name. An isa literal of the
|
|
627
|
+
* vocabulary types the result, so `findBuildPhase(Isa.copyFilesBuildPhase)`
|
|
628
|
+
* gives a `CopyFilesBuildPhase | undefined`.
|
|
617
629
|
*/
|
|
618
|
-
findBuildPhase(isa:
|
|
630
|
+
findBuildPhase<I extends string>(isa: I, name?: string): BuildPhaseOf<I> | undefined;
|
|
619
631
|
/**
|
|
620
632
|
* Returns the target's build phase with the given isa and properties,
|
|
621
633
|
* creating and appending it when missing. The properties apply only on
|
|
622
|
-
* creation
|
|
634
|
+
* creation. An existing phase is returned as is, already typed as the
|
|
635
|
+
* phase class the isa names.
|
|
623
636
|
*
|
|
624
637
|
* The match key is the isa plus the `name` property when one is given,
|
|
625
638
|
* so differently named copy-files phases coexist.
|
|
626
639
|
*/
|
|
627
|
-
ensureBuildPhase(isa:
|
|
640
|
+
ensureBuildPhase<I extends BuildPhaseIsa>(isa: I, properties?: PbxprojObject): BuildPhaseOf<I>;
|
|
628
641
|
/**
|
|
629
642
|
* The target's shell-script phase with the given name, created with the
|
|
630
643
|
* usual defaults (`/bin/sh`, empty input and output lists) when missing.
|
|
@@ -1365,17 +1378,20 @@ declare class XcodeProject {
|
|
|
1365
1378
|
*/
|
|
1366
1379
|
generateId(seed: string): string;
|
|
1367
1380
|
/**
|
|
1368
|
-
* Adds an object to the document and returns its view.
|
|
1381
|
+
* Adds an object to the document and returns its view. When the isa is
|
|
1382
|
+
* a literal of the vocabulary, the returned view is already the exact
|
|
1383
|
+
* class for it, so `add(Isa.fileReference, ...)` gives a `FileReference`
|
|
1384
|
+
* with no cast at the call site.
|
|
1369
1385
|
*
|
|
1370
|
-
* @param isa The object's kind
|
|
1386
|
+
* @param isa The object's kind, written as the `isa` property.
|
|
1371
1387
|
* @param properties The object's remaining properties. The dictionary is
|
|
1372
1388
|
* stored as passed (not copied), with `isa` written first so the
|
|
1373
1389
|
* serialized entry leads with it.
|
|
1374
|
-
* @param seed Seed for the deterministic id
|
|
1390
|
+
* @param seed Seed for the deterministic id. Defaults to the isa, which
|
|
1375
1391
|
* is only sensible for singleton objects.
|
|
1376
1392
|
* @returns The view of the created object.
|
|
1377
1393
|
*/
|
|
1378
|
-
add(isa:
|
|
1394
|
+
add<I extends string>(isa: I, properties: PbxprojObject, seed?: string): ViewOf<I>;
|
|
1379
1395
|
/**
|
|
1380
1396
|
* The view of the document's root `PBXProject` object.
|
|
1381
1397
|
*
|
|
@@ -1526,6 +1542,65 @@ declare class XcodeProject {
|
|
|
1526
1542
|
*/
|
|
1527
1543
|
private createView;
|
|
1528
1544
|
}
|
|
1545
|
+
/**
|
|
1546
|
+
* The view class for every isa of the vocabulary. The runtime registry
|
|
1547
|
+
* and the {@link ViewByIsa} type are both derived from this one object,
|
|
1548
|
+
* so the class an object routes to and the class its isa literal promises
|
|
1549
|
+
* are always the same. The `satisfies` clause keeps the object covering
|
|
1550
|
+
* the whole vocabulary, and the model tests check that every entry agrees
|
|
1551
|
+
* with its class's own `isa` declaration.
|
|
1552
|
+
*/
|
|
1553
|
+
declare const VIEWS: {
|
|
1554
|
+
readonly PBXAggregateTarget: typeof AggregateTarget;
|
|
1555
|
+
readonly PBXAppleScriptBuildPhase: typeof AppleScriptBuildPhase;
|
|
1556
|
+
readonly XCBuildConfiguration: typeof BuildConfiguration;
|
|
1557
|
+
readonly PBXBuildFile: typeof BuildFile;
|
|
1558
|
+
readonly PBXBuildRule: typeof BuildRule;
|
|
1559
|
+
readonly PBXBuildStyle: typeof BuildStyle;
|
|
1560
|
+
readonly XCConfigurationList: typeof ConfigurationList;
|
|
1561
|
+
readonly PBXContainerItemProxy: typeof ContainerItemProxy;
|
|
1562
|
+
readonly PBXCopyFilesBuildPhase: typeof CopyFilesBuildPhase;
|
|
1563
|
+
readonly PBXFileReference: typeof FileReference;
|
|
1564
|
+
readonly PBXFileSystemSynchronizedBuildFileExceptionSet: typeof BuildFileExceptionSet;
|
|
1565
|
+
readonly PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet: typeof BuildPhaseMembershipExceptionSet;
|
|
1566
|
+
readonly PBXFileSystemSynchronizedRootGroup: typeof SyncRootGroup;
|
|
1567
|
+
readonly PBXFrameworksBuildPhase: typeof FrameworksBuildPhase;
|
|
1568
|
+
readonly PBXGroup: typeof Group;
|
|
1569
|
+
readonly PBXHeadersBuildPhase: typeof HeadersBuildPhase;
|
|
1570
|
+
readonly PBXLegacyTarget: typeof LegacyTarget;
|
|
1571
|
+
readonly XCLocalSwiftPackageReference: typeof LocalSwiftPackageReference;
|
|
1572
|
+
readonly PBXNativeTarget: typeof NativeTarget;
|
|
1573
|
+
readonly PBXProject: typeof RootProject;
|
|
1574
|
+
readonly PBXReferenceProxy: typeof ReferenceProxy;
|
|
1575
|
+
readonly XCRemoteSwiftPackageReference: typeof RemoteSwiftPackageReference;
|
|
1576
|
+
readonly PBXResourcesBuildPhase: typeof ResourcesBuildPhase;
|
|
1577
|
+
readonly PBXRezBuildPhase: typeof RezBuildPhase;
|
|
1578
|
+
readonly PBXShellScriptBuildPhase: typeof ShellScriptBuildPhase;
|
|
1579
|
+
readonly PBXSourcesBuildPhase: typeof SourcesBuildPhase;
|
|
1580
|
+
readonly XCSwiftPackageProductDependency: typeof SwiftPackageProductDependency;
|
|
1581
|
+
readonly PBXTargetDependency: typeof TargetDependency;
|
|
1582
|
+
readonly PBXVariantGroup: typeof VariantGroup;
|
|
1583
|
+
readonly XCVersionGroup: typeof VersionGroup;
|
|
1584
|
+
};
|
|
1585
|
+
/**
|
|
1586
|
+
* The view class each isa of the vocabulary maps to, as a type. Derived
|
|
1587
|
+
* from the same {@link VIEWS} object the runtime registry is built from,
|
|
1588
|
+
* which is what lets creation and lookup helpers return the exact class
|
|
1589
|
+
* for an isa literal instead of a base class the caller has to cast.
|
|
1590
|
+
*/
|
|
1591
|
+
type ViewByIsa = { [I in keyof typeof VIEWS]: InstanceType<(typeof VIEWS)[I]> };
|
|
1592
|
+
/**
|
|
1593
|
+
* The view type an isa literal resolves to. Literals of the vocabulary
|
|
1594
|
+
* give the dedicated class, and anything else gives the generic
|
|
1595
|
+
* `XcodeObject`.
|
|
1596
|
+
*/
|
|
1597
|
+
type ViewOf<I extends string> = I extends keyof ViewByIsa ? ViewByIsa[I] : XcodeObject;
|
|
1598
|
+
/**
|
|
1599
|
+
* The build phase view an isa literal resolves to. Isas outside the
|
|
1600
|
+
* vocabulary give the generic `BuildPhase`, matching the view factory's
|
|
1601
|
+
* suffix fallback.
|
|
1602
|
+
*/
|
|
1603
|
+
type BuildPhaseOf<I extends string> = I extends keyof ViewByIsa ? Extract<ViewByIsa[I], BuildPhase> : BuildPhase;
|
|
1529
1604
|
//#endregion
|
|
1530
1605
|
//#region src/model/object.d.ts
|
|
1531
1606
|
/**
|
|
@@ -1543,10 +1618,11 @@ declare class XcodeProject {
|
|
|
1543
1618
|
declare class XcodeObject<Properties extends PbxprojObject = PbxprojObject> {
|
|
1544
1619
|
/**
|
|
1545
1620
|
* The `isa` name this view class models. Each concrete view declares
|
|
1546
|
-
* its own,
|
|
1547
|
-
* class
|
|
1548
|
-
* Classes that only share behavior, like this base class
|
|
1549
|
-
* abstract target and phase bases, declare `null` and never
|
|
1621
|
+
* its own, the factory registry routes objects of that isa to the
|
|
1622
|
+
* class, and the model tests keep the registry and these declarations
|
|
1623
|
+
* in agreement. Classes that only share behavior, like this base class
|
|
1624
|
+
* and the abstract target and phase bases, declare `null` and never
|
|
1625
|
+
* route.
|
|
1550
1626
|
*/
|
|
1551
1627
|
static readonly isa: string | null;
|
|
1552
1628
|
/** The project this object belongs to. */
|
|
@@ -1870,4 +1946,4 @@ declare function parseXcscheme(text: string): XcschemeDocument;
|
|
|
1870
1946
|
*/
|
|
1871
1947
|
declare function generateObjectId(seed: string, existing: ReadonlySet<string>): string;
|
|
1872
1948
|
//#endregion
|
|
1873
|
-
export { type AddNativeTargetOptions, AggregateTarget, type ApplePlatform, AppleScriptBuildPhase, BuildConfiguration, type BuildConfigurationProperties, BuildFile, BuildFileExceptionSet, type BuildFileProperties, BuildPhase, BuildPhaseMembershipExceptionSet, type BuildPhaseMembershipExceptionSetProperties, 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, 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, XcodeModelError, XcodeObject, XcodeProject, Xcscheme, XcschemeBuildError, type XcschemeComment, type XcschemeDocument, type XcschemeElement, type XcschemeNode, XcschemeParseError, buildPbxproj, buildXcscheme, createXcscheme, generateObjectId, isXcschemeElement, parsePbxproj, parseXcscheme, xcschemeElements };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1033,10 +1033,11 @@ function stringItems(value) {
|
|
|
1033
1033
|
var XcodeObject = class {
|
|
1034
1034
|
/**
|
|
1035
1035
|
* The `isa` name this view class models. Each concrete view declares
|
|
1036
|
-
* its own,
|
|
1037
|
-
* class
|
|
1038
|
-
* Classes that only share behavior, like this base class
|
|
1039
|
-
* abstract target and phase bases, declare `null` and never
|
|
1036
|
+
* its own, the factory registry routes objects of that isa to the
|
|
1037
|
+
* class, and the model tests keep the registry and these declarations
|
|
1038
|
+
* in agreement. Classes that only share behavior, like this base class
|
|
1039
|
+
* and the abstract target and phase bases, declare `null` and never
|
|
1040
|
+
* route.
|
|
1040
1041
|
*/
|
|
1041
1042
|
static isa = null;
|
|
1042
1043
|
/** The project this object belongs to. */
|
|
@@ -2962,7 +2963,9 @@ var Target = class extends XcodeObject {
|
|
|
2962
2963
|
}
|
|
2963
2964
|
/**
|
|
2964
2965
|
* Finds the target's first build phase with the given isa, and, when
|
|
2965
|
-
* `name` is provided, the given display name.
|
|
2966
|
+
* `name` is provided, the given display name. An isa literal of the
|
|
2967
|
+
* vocabulary types the result, so `findBuildPhase(Isa.copyFilesBuildPhase)`
|
|
2968
|
+
* gives a `CopyFilesBuildPhase | undefined`.
|
|
2966
2969
|
*/
|
|
2967
2970
|
findBuildPhase(isa, name) {
|
|
2968
2971
|
return this.buildPhases().find((phase) => phase.isa === isa && (name == null || phase.name === name));
|
|
@@ -2970,7 +2973,8 @@ var Target = class extends XcodeObject {
|
|
|
2970
2973
|
/**
|
|
2971
2974
|
* Returns the target's build phase with the given isa and properties,
|
|
2972
2975
|
* creating and appending it when missing. The properties apply only on
|
|
2973
|
-
* creation
|
|
2976
|
+
* creation. An existing phase is returned as is, already typed as the
|
|
2977
|
+
* phase class the isa names.
|
|
2974
2978
|
*
|
|
2975
2979
|
* The match key is the isa plus the `name` property when one is given,
|
|
2976
2980
|
* so differently named copy-files phases coexist.
|
|
@@ -3419,13 +3423,16 @@ var XcodeProject = class XcodeProject {
|
|
|
3419
3423
|
return generateObjectId(seed, new Set(Object.keys(this.objectsDictionary)));
|
|
3420
3424
|
}
|
|
3421
3425
|
/**
|
|
3422
|
-
* Adds an object to the document and returns its view.
|
|
3426
|
+
* Adds an object to the document and returns its view. When the isa is
|
|
3427
|
+
* a literal of the vocabulary, the returned view is already the exact
|
|
3428
|
+
* class for it, so `add(Isa.fileReference, ...)` gives a `FileReference`
|
|
3429
|
+
* with no cast at the call site.
|
|
3423
3430
|
*
|
|
3424
|
-
* @param isa The object's kind
|
|
3431
|
+
* @param isa The object's kind, written as the `isa` property.
|
|
3425
3432
|
* @param properties The object's remaining properties. The dictionary is
|
|
3426
3433
|
* stored as passed (not copied), with `isa` written first so the
|
|
3427
3434
|
* serialized entry leads with it.
|
|
3428
|
-
* @param seed Seed for the deterministic id
|
|
3435
|
+
* @param seed Seed for the deterministic id. Defaults to the isa, which
|
|
3429
3436
|
* is only sensible for singleton objects.
|
|
3430
3437
|
* @returns The view of the created object.
|
|
3431
3438
|
*/
|
|
@@ -3528,11 +3535,10 @@ var XcodeProject = class XcodeProject {
|
|
|
3528
3535
|
productType: options.productType
|
|
3529
3536
|
}, `${Isa.nativeTarget} ${options.name}`);
|
|
3530
3537
|
ensureArray(this.rootProject.properties, "targets").push(target.id);
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
return nativeTarget;
|
|
3538
|
+
target.ensureSourcesPhase();
|
|
3539
|
+
target.ensureFrameworksPhase();
|
|
3540
|
+
target.ensureResourcesPhase();
|
|
3541
|
+
return target;
|
|
3536
3542
|
}
|
|
3537
3543
|
/**
|
|
3538
3544
|
* Finds the remote Swift package reference for a repository URL.
|
|
@@ -3736,48 +3742,49 @@ var XcodeProject = class XcodeProject {
|
|
|
3736
3742
|
}
|
|
3737
3743
|
};
|
|
3738
3744
|
/**
|
|
3739
|
-
*
|
|
3740
|
-
*
|
|
3741
|
-
*
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
RootProject,
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
]
|
|
3745
|
+
* The view class for every isa of the vocabulary. The runtime registry
|
|
3746
|
+
* and the {@link ViewByIsa} type are both derived from this one object,
|
|
3747
|
+
* so the class an object routes to and the class its isa literal promises
|
|
3748
|
+
* are always the same. The `satisfies` clause keeps the object covering
|
|
3749
|
+
* the whole vocabulary, and the model tests check that every entry agrees
|
|
3750
|
+
* with its class's own `isa` declaration.
|
|
3751
|
+
*/
|
|
3752
|
+
const VIEWS = {
|
|
3753
|
+
[Isa.aggregateTarget]: AggregateTarget,
|
|
3754
|
+
[Isa.appleScriptBuildPhase]: AppleScriptBuildPhase,
|
|
3755
|
+
[Isa.buildConfiguration]: BuildConfiguration,
|
|
3756
|
+
[Isa.buildFile]: BuildFile,
|
|
3757
|
+
[Isa.buildRule]: BuildRule,
|
|
3758
|
+
[Isa.buildStyle]: BuildStyle,
|
|
3759
|
+
[Isa.configurationList]: ConfigurationList,
|
|
3760
|
+
[Isa.containerItemProxy]: ContainerItemProxy,
|
|
3761
|
+
[Isa.copyFilesBuildPhase]: CopyFilesBuildPhase,
|
|
3762
|
+
[Isa.fileReference]: FileReference,
|
|
3763
|
+
[Isa.fileSystemSynchronizedBuildFileExceptionSet]: BuildFileExceptionSet,
|
|
3764
|
+
[Isa.fileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet]: BuildPhaseMembershipExceptionSet,
|
|
3765
|
+
[Isa.fileSystemSynchronizedRootGroup]: SyncRootGroup,
|
|
3766
|
+
[Isa.frameworksBuildPhase]: FrameworksBuildPhase,
|
|
3767
|
+
[Isa.group]: Group,
|
|
3768
|
+
[Isa.headersBuildPhase]: HeadersBuildPhase,
|
|
3769
|
+
[Isa.legacyTarget]: LegacyTarget,
|
|
3770
|
+
[Isa.localSwiftPackageReference]: LocalSwiftPackageReference,
|
|
3771
|
+
[Isa.nativeTarget]: NativeTarget,
|
|
3772
|
+
[Isa.project]: RootProject,
|
|
3773
|
+
[Isa.referenceProxy]: ReferenceProxy,
|
|
3774
|
+
[Isa.remoteSwiftPackageReference]: RemoteSwiftPackageReference,
|
|
3775
|
+
[Isa.resourcesBuildPhase]: ResourcesBuildPhase,
|
|
3776
|
+
[Isa.rezBuildPhase]: RezBuildPhase,
|
|
3777
|
+
[Isa.shellScriptBuildPhase]: ShellScriptBuildPhase,
|
|
3778
|
+
[Isa.sourcesBuildPhase]: SourcesBuildPhase,
|
|
3779
|
+
[Isa.swiftPackageProductDependency]: SwiftPackageProductDependency,
|
|
3780
|
+
[Isa.targetDependency]: TargetDependency,
|
|
3781
|
+
[Isa.variantGroup]: VariantGroup,
|
|
3782
|
+
[Isa.versionGroup]: VersionGroup
|
|
3783
|
+
};
|
|
3775
3784
|
/**
|
|
3776
|
-
* View constructors by the isa they model,
|
|
3777
|
-
* `isa` declaration.
|
|
3785
|
+
* View constructors by the isa they model, in `Map` form for the factory.
|
|
3778
3786
|
*/
|
|
3779
|
-
const VIEW_BY_ISA =
|
|
3780
|
-
for (const viewClass of VIEW_CLASSES) if (viewClass.isa != null) VIEW_BY_ISA.set(viewClass.isa, viewClass);
|
|
3787
|
+
const VIEW_BY_ISA = new Map(Object.entries(VIEWS));
|
|
3781
3788
|
/**
|
|
3782
3789
|
* Joins two path segments with a `/`, treating an empty prefix as the
|
|
3783
3790
|
* project root.
|
package/package.json
CHANGED