taskdex 0.1.2 → 0.1.3

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 CHANGED
@@ -36,6 +36,7 @@ taskdex init
36
36
 
37
37
  This will clone the repo and immediately run interactive terminal setup.
38
38
  Setup now defaults to `dev-client` runtime, can build the native app (`expo run:ios` / `expo run:android`), and then starts Expo in `--dev-client` mode.
39
+ For iOS builds, setup asks whether to run on a real iPhone or Simulator, and supports choosing a specific iPhone device name.
39
40
  When a `pnpm-lock.yaml` is present in `mobile`, the CLI installs mobile dependencies with pnpm automatically.
40
41
 
41
42
  For an already-cloned repo:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskdex",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Terminal-first installer and launcher for Taskdex mobile + bridge",
5
5
  "type": "module",
6
6
  "bin": {
@@ -160,6 +160,13 @@ function parseBuildPlatform(input) {
160
160
  return normalized;
161
161
  }
162
162
 
163
+ function parseIosTarget(input) {
164
+ const normalized = input.trim().toLowerCase() || 'iphone';
165
+ if (['iphone', 'device', 'physical'].includes(normalized)) return 'iphone';
166
+ if (['simulator', 'sim', 'ios-simulator'].includes(normalized)) return 'simulator';
167
+ throw new Error('iOS target must be "iphone" or "simulator".');
168
+ }
169
+
163
170
  function parseInstallChoice(input) {
164
171
  const normalized = input.trim().toLowerCase();
165
172
  if (!normalized || normalized === 'y' || normalized === 'yes') return true;
@@ -183,12 +190,21 @@ async function readSetupConfig() {
183
190
  const runtime = parseRuntime(runtimeInput);
184
191
  let buildDevClient = false;
185
192
  let buildPlatform = process.platform === 'darwin' ? 'ios' : 'android';
193
+ let iosTarget = 'iphone';
194
+ let iosDeviceName = '';
186
195
  if (runtime === 'dev-client') {
187
196
  const buildInput = await rl.question('Build native development client now? [Y/n]: ');
188
197
  buildDevClient = parseInstallChoice(buildInput);
189
198
  if (buildDevClient) {
190
199
  const platformInput = await rl.question(`Build platform (ios/android) [${buildPlatform}]: `);
191
200
  buildPlatform = parseBuildPlatform(platformInput);
201
+ if (buildPlatform === 'ios') {
202
+ const targetInput = await rl.question('iOS target (iphone/simulator) [iphone]: ');
203
+ iosTarget = parseIosTarget(targetInput);
204
+ if (iosTarget === 'iphone') {
205
+ iosDeviceName = (await rl.question('iPhone device name (optional, Enter to choose automatically): ')).trim();
206
+ }
207
+ }
192
208
  }
193
209
  }
194
210
 
@@ -199,6 +215,8 @@ async function readSetupConfig() {
199
215
  runtime,
200
216
  buildDevClient,
201
217
  buildPlatform,
218
+ iosTarget,
219
+ iosDeviceName,
202
220
  installDeps: parseInstallChoice(installInput),
203
221
  };
204
222
  } finally {
@@ -213,7 +231,17 @@ async function runInteractiveSetup(rootDir) {
213
231
  throw new Error(`Invalid Taskdex repository at ${rootDir}`);
214
232
  }
215
233
 
216
- const { port, apiKey, expoMode, runtime, buildDevClient, buildPlatform, installDeps } = await readSetupConfig();
234
+ const {
235
+ port,
236
+ apiKey,
237
+ expoMode,
238
+ runtime,
239
+ buildDevClient,
240
+ buildPlatform,
241
+ iosTarget,
242
+ iosDeviceName,
243
+ installDeps,
244
+ } = await readSetupConfig();
217
245
  const bridgeUrl = `ws://${getLocalIPv4()}:${port}`;
218
246
 
219
247
  console.log(`\nBridge URL: ${bridgeUrl}`);
@@ -255,7 +283,16 @@ async function runInteractiveSetup(rootDir) {
255
283
 
256
284
  if (runtime === 'dev-client' && buildDevClient) {
257
285
  console.log(`\nBuilding native dev client (${buildPlatform})...\n`);
258
- await runCommand(npxCmd, ['expo', `run:${buildPlatform}`, '--no-bundler'], {
286
+ const buildArgs = ['expo', `run:${buildPlatform}`, '--no-bundler'];
287
+ if (buildPlatform === 'ios' && iosTarget === 'iphone') {
288
+ if (iosDeviceName) {
289
+ buildArgs.push('--device', iosDeviceName);
290
+ } else {
291
+ buildArgs.push('--device');
292
+ }
293
+ }
294
+
295
+ await runCommand(npxCmd, buildArgs, {
259
296
  cwd: mobileDir,
260
297
  env: expoEnv,
261
298
  });