Skip to content

Commit 26860f8

Browse files
farfromrefugclaude
andcommitted
refactor(catalyst): name the platform catalyst rather than macos
`ns run macos` is being taken by a separate effort that builds a native macOS app against a macOS runtime. That is a different product from a Mac Catalyst build -- the iOS app rebuilt against the macOS SDK -- so this one takes the name that says what it actually is: `ns build catalyst`, `ns run catalyst`, preparing into platforms/catalyst. Only the platform identifier changes; the build, device and LiveSync behaviour is untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b5d6670 commit 26860f8

21 files changed

Lines changed: 62 additions & 62 deletions

lib/bootstrap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ injector.requireCommand("run|ios", "./commands/run");
183183
injector.requireCommand("run|android", "./commands/run");
184184
injector.requireCommand("run|vision", "./commands/run");
185185
injector.requireCommand("run|visionos", "./commands/run");
186-
injector.requireCommand("run|macos", "./commands/run");
186+
injector.requireCommand("run|catalyst", "./commands/run");
187187
injector.requireCommand("typings", "./commands/typings");
188188

189189
injector.requireCommand("preview", "./commands/preview");
@@ -199,7 +199,7 @@ injector.requireCommand("build|ios", "./commands/build");
199199
injector.requireCommand("build|android", "./commands/build");
200200
injector.requireCommand("build|vision", "./commands/build");
201201
injector.requireCommand("build|visionos", "./commands/build");
202-
injector.requireCommand("build|macos", "./commands/build");
202+
injector.requireCommand("build|catalyst", "./commands/build");
203203
injector.requireCommand("deploy", "./commands/deploy");
204204

205205
injector.requireCommand("embed", "./commands/embedding/embed");

lib/commands/build.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ injector.registerCommand("build|visionos", BuildVisionOsCommand);
282282
/**
283283
* Builds the iOS target against the macOS SDK as a Mac Catalyst app.
284284
*/
285-
export class BuildMacOsCommand extends BuildIosCommand implements ICommand {
285+
export class BuildCatalystCommand extends BuildIosCommand implements ICommand {
286286
constructor(
287287
protected $options: IOptions,
288288
$errors: IErrors,
@@ -311,12 +311,12 @@ export class BuildMacOsCommand extends BuildIosCommand implements ICommand {
311311

312312
public async execute(args: string[]): Promise<void> {
313313
await this.executeCore([
314-
this.$devicePlatformsConstants.macOS.toLowerCase(),
314+
this.$devicePlatformsConstants.Catalyst.toLowerCase(),
315315
]);
316316
}
317317

318318
public async canExecute(args: string[]): Promise<boolean> {
319-
const platform = this.$devicePlatformsConstants.macOS;
319+
const platform = this.$devicePlatformsConstants.Catalyst;
320320
if (!this.$options.force) {
321321
await this.$migrateController.validate({
322322
projectDir: this.$projectData.projectDir,
@@ -335,4 +335,4 @@ export class BuildMacOsCommand extends BuildIosCommand implements ICommand {
335335
}
336336
}
337337

338-
injector.registerCommand("build|macos", BuildMacOsCommand);
338+
injector.registerCommand("build|catalyst", BuildCatalystCommand);

lib/commands/run.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ export class RunCommandBase implements ICommand {
3030
private $migrateController: IMigrateController,
3131
private $options: IOptions,
3232
private $projectData: IProjectData,
33-
private $keyCommandHelper: IKeyCommandHelper
33+
private $keyCommandHelper: IKeyCommandHelper,
3434
) {}
3535

3636
public allowedParameters: ICommandParameter[] = [];
3737
public async execute(args: string[]): Promise<void> {
3838
await this.$liveSyncCommandHelper.executeCommandLiveSync(
3939
this.platform,
40-
this.liveSyncCommandHelperAdditionalOptions
40+
this.liveSyncCommandHelperAdditionalOptions,
4141
);
4242

4343
if (process.env.NS_IS_INTERACTIVE) {
4444
this.$keyCommandHelper.attachKeyCommands(
4545
this.platform as IKeyCommandPlatform,
46-
"run"
46+
"run",
4747
);
4848
}
4949
}
@@ -64,7 +64,7 @@ export class RunCommandBase implements ICommand {
6464
: [
6565
this.$devicePlatformsConstants.Android,
6666
this.$devicePlatformsConstants.iOS,
67-
];
67+
];
6868

6969
if (!this.$options.force) {
7070
await this.$migrateController.validate({
@@ -100,7 +100,7 @@ export class RunIosCommand implements ICommand {
100100
protected $injector: IInjector,
101101
protected $options: IOptions,
102102
protected $platformValidationService: IPlatformValidationService,
103-
protected $projectDataService: IProjectDataService
103+
protected $projectDataService: IProjectDataService,
104104
) {}
105105

106106
public async execute(args: string[]): Promise<void> {
@@ -113,11 +113,11 @@ export class RunIosCommand implements ICommand {
113113
if (
114114
!this.$platformValidationService.isPlatformSupportedForOS(
115115
this.platform,
116-
projectData
116+
projectData,
117117
)
118118
) {
119119
this.$errors.fail(
120-
`Applications for platform ${this.platform} can not be built on this OS`
120+
`Applications for platform ${this.platform} can not be built on this OS`,
121121
);
122122
}
123123

@@ -127,7 +127,7 @@ export class RunIosCommand implements ICommand {
127127
this.$options.provision,
128128
this.$options.teamId,
129129
projectData,
130-
this.platform.toLowerCase()
130+
this.platform.toLowerCase(),
131131
));
132132
return result;
133133
}
@@ -154,7 +154,7 @@ export class RunAndroidCommand implements ICommand {
154154
private $injector: IInjector,
155155
private $options: IOptions,
156156
private $platformValidationService: IPlatformValidationService,
157-
private $projectData: IProjectData
157+
private $projectData: IProjectData,
158158
) {}
159159

160160
public async execute(args: string[]): Promise<void> {
@@ -167,11 +167,11 @@ export class RunAndroidCommand implements ICommand {
167167
if (
168168
!this.$platformValidationService.isPlatformSupportedForOS(
169169
this.$devicePlatformsConstants.Android,
170-
this.$projectData
170+
this.$projectData,
171171
)
172172
) {
173173
this.$errors.fail(
174-
`Applications for platform ${this.$devicePlatformsConstants.Android} can not be built on this OS`
174+
`Applications for platform ${this.$devicePlatformsConstants.Android} can not be built on this OS`,
175175
);
176176
}
177177

@@ -190,7 +190,7 @@ export class RunAndroidCommand implements ICommand {
190190
this.$options.provision,
191191
this.$options.teamId,
192192
this.$projectData,
193-
this.$devicePlatformsConstants.Android.toLowerCase()
193+
this.$devicePlatformsConstants.Android.toLowerCase(),
194194
);
195195
}
196196
}
@@ -208,15 +208,15 @@ export class RunVisionOSCommand extends RunIosCommand {
208208
protected $injector: IInjector,
209209
protected $options: IOptions,
210210
protected $platformValidationService: IPlatformValidationService,
211-
protected $projectDataService: IProjectDataService
211+
protected $projectDataService: IProjectDataService,
212212
) {
213213
super(
214214
$devicePlatformsConstants,
215215
$errors,
216216
$injector,
217217
$options,
218218
$platformValidationService,
219-
$projectDataService
219+
$projectDataService,
220220
);
221221
}
222222
}
@@ -227,9 +227,9 @@ injector.registerCommand("run|visionos", RunVisionOSCommand);
227227
/**
228228
* Runs the Mac Catalyst build of the app on this machine.
229229
*/
230-
export class RunMacOSCommand extends RunIosCommand {
230+
export class RunCatalystCommand extends RunIosCommand {
231231
public get platform(): string {
232-
return this.$devicePlatformsConstants.macOS;
232+
return this.$devicePlatformsConstants.Catalyst;
233233
}
234234

235235
constructor(
@@ -251,4 +251,4 @@ export class RunMacOSCommand extends RunIosCommand {
251251
}
252252
}
253253

254-
injector.registerCommand("run|macos", RunMacOSCommand);
254+
injector.registerCommand("run|catalyst", RunCatalystCommand);

lib/common/definitions/mobile.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ declare global {
12111211
isAndroidPlatform(platform: string): boolean;
12121212
isiOSPlatform(platform: string): boolean;
12131213
isvisionOSPlatform(platform: string): boolean;
1214-
ismacOSPlatform(platform: string): boolean;
1214+
isCatalystPlatform(platform: string): boolean;
12151215
isApplePlatform(platform: string): boolean;
12161216
normalizePlatformName(platform: string): string;
12171217
validatePlatformName(platform: string): string;
@@ -1256,12 +1256,12 @@ declare global {
12561256
iOS: string;
12571257
Android: string;
12581258
visionOS: string;
1259-
macOS: string;
1259+
Catalyst: string;
12601260

12611261
isiOS(value: string): boolean;
12621262
isAndroid(value: string): boolean;
12631263
isvisionOS(value: string): boolean;
1264-
ismacOS(value: string): boolean;
1264+
isCatalyst(value: string): boolean;
12651265
}
12661266

12671267
interface IDeviceApplication {

lib/common/mobile/device-platforms-constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class DevicePlatformsConstants
77
public Android = "Android";
88
public visionOS = "visionOS";
99
// Not a runtime of its own: iOS rebuilt against the macOS SDK.
10-
public macOS = "macOS";
10+
public Catalyst = "Catalyst";
1111

1212
public isiOS(value: string) {
1313
return value.toLowerCase() === this.iOS.toLowerCase();
@@ -21,8 +21,8 @@ export class DevicePlatformsConstants
2121
return value.toLowerCase() === this.visionOS.toLowerCase();
2222
}
2323

24-
public ismacOS(value: string) {
25-
return value.toLowerCase() === this.macOS.toLowerCase();
24+
public isCatalyst(value: string) {
25+
return value.toLowerCase() === this.Catalyst.toLowerCase();
2626
}
2727
}
2828
injector.register("devicePlatformsConstants", DevicePlatformsConstants);

lib/common/mobile/mac/mac-catalyst-application-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class MacCatalystApplicationManager extends ApplicationManagerBase {
134134
const action = (data: Buffer | string) => {
135135
this.$deviceLogProvider.logData(
136136
data.toString(),
137-
this.$devicePlatformsConstants.macOS,
137+
this.$devicePlatformsConstants.Catalyst,
138138
this.device.deviceInfo.identifier,
139139
);
140140
};

lib/common/mobile/mac/mac-catalyst-device.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class MacCatalystDevice implements Mobile.IMacCatalystDevice {
4242
model: "Mac",
4343
version: os.release(),
4444
vendor: "Apple",
45-
platform: this.$devicePlatformsConstants.macOS,
45+
platform: this.$devicePlatformsConstants.Catalyst,
4646
status: constants.CONNECTED_STATUS,
4747
errorHelp: null,
4848
isTablet: false,
@@ -81,7 +81,7 @@ export class MacCatalystDevice implements Mobile.IMacCatalystDevice {
8181

8282
private getBuiltApplicationBundlePath(): string {
8383
const projectData = this.$projectDataService.getProjectData();
84-
const platform = this.$devicePlatformsConstants.macOS;
84+
const platform = this.$devicePlatformsConstants.Catalyst;
8585
const platformData = this.$platformsDataService.getPlatformData(
8686
platform.toLowerCase(),
8787
projectData,

lib/common/mobile/mobile-core/ios-device-discovery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class IOSDeviceDiscovery extends DeviceDiscovery {
2323
options &&
2424
options.platform &&
2525
(!this.$mobileHelper.isApplePlatform(options.platform) ||
26-
// macOS runs on this machine, not over usbmux.
27-
this.$mobileHelper.ismacOSPlatform(options.platform) ||
26+
// Catalyst runs on this machine, not over usbmux.
27+
this.$mobileHelper.isCatalystPlatform(options.platform) ||
2828
options.emulator)
2929
) {
3030
return;

lib/common/mobile/mobile-core/mac-catalyst-discovery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class MacCatalystDeviceDiscovery extends DeviceDiscovery {
2626
if (
2727
!options ||
2828
!options.platform ||
29-
!this.$mobileHelper.ismacOSPlatform(options.platform)
29+
!this.$mobileHelper.isCatalystPlatform(options.platform)
3030
) {
3131
return;
3232
}

lib/common/mobile/mobile-helper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class MobileHelper implements Mobile.IMobileHelper {
2121
this.$devicePlatformsConstants.iOS,
2222
this.$devicePlatformsConstants.Android,
2323
this.$devicePlatformsConstants.visionOS,
24-
this.$devicePlatformsConstants.macOS,
24+
this.$devicePlatformsConstants.Catalyst,
2525
];
2626
}
2727

@@ -49,10 +49,10 @@ export class MobileHelper implements Mobile.IMobileHelper {
4949
);
5050
}
5151

52-
public ismacOSPlatform(platform: string): boolean {
52+
public isCatalystPlatform(platform: string): boolean {
5353
return !!(
5454
platform &&
55-
this.$devicePlatformsConstants.macOS.toLowerCase() ===
55+
this.$devicePlatformsConstants.Catalyst.toLowerCase() ===
5656
platform.toLowerCase()
5757
);
5858
}
@@ -61,7 +61,7 @@ export class MobileHelper implements Mobile.IMobileHelper {
6161
return (
6262
this.isiOSPlatform(platform) ||
6363
this.isvisionOSPlatform(platform) ||
64-
this.ismacOSPlatform(platform)
64+
this.isCatalystPlatform(platform)
6565
);
6666
}
6767

@@ -72,8 +72,8 @@ export class MobileHelper implements Mobile.IMobileHelper {
7272
return "iOS";
7373
} else if (this.isvisionOSPlatform(platform)) {
7474
return "visionOS";
75-
} else if (this.ismacOSPlatform(platform)) {
76-
return "macOS";
75+
} else if (this.isCatalystPlatform(platform)) {
76+
return "Catalyst";
7777
}
7878

7979
return undefined;

0 commit comments

Comments
 (0)