quiesco 0.7.0 → 0.8.1

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.
@@ -0,0 +1,13 @@
1
+ import type { CliContext } from './context.js';
2
+ /** The option the commands that work on the app take. */
3
+ export declare const APP_DIR_OPTION = "--app-dir";
4
+ /**
5
+ * The context for the app: `ctx` itself when the app is the project directory, else a copy whose `cwd`
6
+ * is the app's directory. `flag` (relative to the working directory) wins over `config.appDir`.
7
+ */
8
+ export declare function appContext(ctx: CliContext, config: {
9
+ appDir?: string;
10
+ } | null, flag?: string): CliContext;
11
+ /** How a path in the app is shown: relative to the working directory when near it, else absolute. */
12
+ export declare function inApp(ctx: CliContext, app: CliContext, file?: string): string;
13
+ //# sourceMappingURL=app-dir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-dir.d.ts","sourceRoot":"","sources":["../src/app-dir.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,yDAAyD;AACzD,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAGzG;AAED,qGAAqG;AACrG,wBAAgB,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,SAAK,GAAG,MAAM,CAIzE"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Where the Expo app is (issue #54): the test project's directory, or `appDir` in quiesco.config (tests in
3
+ * a package of their own: a monorepo, or `app/` and `e2e/` side by side). `--app-dir` overrides it.
4
+ */
5
+ import path from 'node:path';
6
+ /** The option the commands that work on the app take. */
7
+ export const APP_DIR_OPTION = '--app-dir';
8
+ /**
9
+ * The context for the app: `ctx` itself when the app is the project directory, else a copy whose `cwd`
10
+ * is the app's directory. `flag` (relative to the working directory) wins over `config.appDir`.
11
+ */
12
+ export function appContext(ctx, config, flag) {
13
+ const dir = flag !== undefined ? path.resolve(ctx.cwd, flag) : config?.appDir !== undefined ? path.resolve(ctx.cwd, config.appDir) : ctx.cwd;
14
+ return path.resolve(dir) === path.resolve(ctx.cwd) ? ctx : { ...ctx, cwd: dir };
15
+ }
16
+ /** How a path in the app is shown: relative to the working directory when near it, else absolute. */
17
+ export function inApp(ctx, app, file = '') {
18
+ const abs = path.join(app.cwd, file);
19
+ const rel = path.relative(ctx.cwd, abs);
20
+ return rel === '' ? '.' : rel.split(path.sep).filter((p) => p === '..').length > 2 ? abs : rel;
21
+ }
22
+ //# sourceMappingURL=app-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-dir.js","sourceRoot":"","sources":["../src/app-dir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,GAAe,EAAE,MAAkC,EAAE,IAAa;IAC3F,MAAM,GAAG,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7I,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAClF,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,KAAK,CAAC,GAAe,EAAE,GAAe,EAAE,IAAI,GAAG,EAAE;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACjG,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Command dispatch for the `quiesco` binary (requirements.md §6.12). */
2
2
  import type { CliContext } from './context.js';
3
- export declare const HELP = "Usage: quiesco <command> [options]\n\nCommands:\n init Set Quiesco up in this Expo project (dependencies, config plugin, Metro, entry, config, features)\n --platforms ios,android,web --runner vitest|jest|cucumber (asked when not given; default vitest)\n --packages <dir> (install from tarballs) --skip-install\n --upgrade: bring a project set up by an older version to this one (packages, config, files)\n --dry-run (list the changes only)\n build Build the app for e2e tests (prebuild + xcodebuild / gradle) into apps.<platform>.binaryPath\n ios|android --force (also when the native inputs did not change)\n test Run the tests with the project's runner (or --runner vitest|jest|cucumber); other arguments go to the runner unchanged\n --platform ios|android|web --workers N (N devices in parallel) (quiesco test --help for more)\n ui Open the test UI: run tests from the browser and watch them live (needs @quiesco/ui)\n --platform ios|android|web --runner \u2026 --port N --no-open\n list List the tests the runner would run, without running them\n --runner cucumber|jest|vitest --json\n doctor Check the tools and the project setup\n --platform ios|android|web\n tree Print the element tree of the running app (to find testIDs)\n --launch (boot the device and launch the app first) --json --timeout <ms> --platform \u2026\n devices List the simulators / AVDs Quiesco created for parallel workers\n --prune (shut them down and delete them)\n\nOptions:\n -h, --help Show this help\n -v, --version Show the version";
3
+ export declare const HELP = "Usage: quiesco <command> [options]\n\nCommands:\n init Set Quiesco up in this Expo project (dependencies, config plugin, Metro, entry, config, features)\n --platforms ios,android,web --runner vitest|jest|cucumber (asked when not given; default vitest)\n --packages <dir> (install from tarballs) --skip-install\n --upgrade: bring a project set up by an older version to this one (packages, config, files)\n --dry-run (list the changes only) --app-dir <dir> (the app, when the tests are elsewhere)\n build Build the app for e2e tests (prebuild + xcodebuild / gradle) into apps.<platform>.binaryPath\n ios|android --force (also when the native inputs did not change)\n --clean (delete and generate ios/ / android/ again: expo prebuild --clean) --app-dir <dir>\n test Run the tests with the project's runner (or --runner vitest|jest|cucumber); other arguments go to the runner unchanged\n --platform ios|android|web --workers N (N devices in parallel) (quiesco test --help for more)\n ui Open the test UI: run tests from the browser and watch them live (needs @quiesco/ui)\n --platform ios|android|web --runner \u2026 --port N --no-open\n list List the tests the runner would run, without running them\n --runner cucumber|jest|vitest --json\n doctor Check the tools and the project setup\n --platform ios|android|web --app-dir <dir> (the app, when the tests are elsewhere; or appDir in quiesco.config)\n tree Print the element tree of the running app (to find testIDs)\n --launch (boot the device and launch the app first) --json --timeout <ms> --platform \u2026\n devices List the simulators / AVDs Quiesco created for parallel workers\n --prune (shut them down and delete them)\n\nOptions:\n -h, --help Show this help\n -v, --version Show the version";
4
4
  export declare function main(argv: readonly string[], ctx?: CliContext): Promise<number>;
5
5
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAUzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,IAAI,wrDAyBiB,CAAC;AAEnC,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,UAA6B,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCvG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAUzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,IAAI,o7DA0BiB,CAAC;AAEnC,wBAAsB,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,UAA6B,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCvG"}
package/dist/cli.js CHANGED
@@ -15,9 +15,10 @@ Commands:
15
15
  --platforms ios,android,web --runner vitest|jest|cucumber (asked when not given; default vitest)
16
16
  --packages <dir> (install from tarballs) --skip-install
17
17
  --upgrade: bring a project set up by an older version to this one (packages, config, files)
18
- --dry-run (list the changes only)
18
+ --dry-run (list the changes only) --app-dir <dir> (the app, when the tests are elsewhere)
19
19
  build Build the app for e2e tests (prebuild + xcodebuild / gradle) into apps.<platform>.binaryPath
20
20
  ios|android --force (also when the native inputs did not change)
21
+ --clean (delete and generate ios/ / android/ again: expo prebuild --clean) --app-dir <dir>
21
22
  test Run the tests with the project's runner (or --runner vitest|jest|cucumber); other arguments go to the runner unchanged
22
23
  --platform ios|android|web --workers N (N devices in parallel) (quiesco test --help for more)
23
24
  ui Open the test UI: run tests from the browser and watch them live (needs @quiesco/ui)
@@ -25,7 +26,7 @@ Commands:
25
26
  list List the tests the runner would run, without running them
26
27
  --runner cucumber|jest|vitest --json
27
28
  doctor Check the tools and the project setup
28
- --platform ios|android|web
29
+ --platform ios|android|web --app-dir <dir> (the app, when the tests are elsewhere; or appDir in quiesco.config)
29
30
  tree Print the element tree of the running app (to find testIDs)
30
31
  --launch (boot the device and launch the app first) --json --timeout <ms> --platform …
31
32
  devices List the simulators / AVDs Quiesco created for parallel workers
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;kCAyBc,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAuB,EAAE,MAAkB,cAAc,EAAE;IACpF,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC;QACH,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,MAAM;gBACT,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACtC,KAAK,OAAO;gBACV,OAAO,MAAM,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACvC,KAAK,MAAM;gBACT,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACtC,KAAK,IAAI;gBACP,OAAO,MAAM,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACpC,KAAK,MAAM;gBACT,OAAO,MAAM,WAAW,CAAC,I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,CAAC;YACd,KAAK,MAAM;gBACT,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACd,OAAO,CAAC,CAAC;YACX;gBACE,GAAG,CAAC,GAAG,CAAC,6BAA6B,OAAO,QAAQ,IAAI,EAAE,CAAC,CAAC;gBAC5D,OAAO,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,GAAG,CAAC,WAAW,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { QuiescoConfig } from '@quiesco/core';
2
2
  import type { CliContext } from '../context.js';
3
- export declare const BUILD_HELP = "Usage: quiesco build ios|android [--force]\n\nBuilds the app for e2e tests (EXPO_PUBLIC_QUIESCO=1: expo prebuild, then xcodebuild / gradle) and writes it\nto apps.<platform>.binaryPath in quiesco.config. A Debug build is skipped when the native inputs (app config,\ndependencies) did not change since the last one; --force builds anyway.";
3
+ export declare const BUILD_HELP = "Usage: quiesco build ios|android [--force] [--clean] [--app-dir <dir>]\n\nBuilds the app for e2e tests (EXPO_PUBLIC_QUIESCO=1: expo prebuild, then xcodebuild / gradle) and writes it\nto apps.<platform>.binaryPath in quiesco.config. A Debug build is skipped when the native inputs (app config,\ndependencies) did not change since the last one; --force builds anyway. --clean deletes ios/ / android/ and\ngenerates them again (expo prebuild --clean; changes made by hand in them are lost), then builds. The app is the one in appDir\n(quiesco.config) or --app-dir when the tests are in a package of their own.";
4
4
  export interface BuildDeps {
5
5
  loadConfig: (cwd: string) => Promise<QuiescoConfig>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,e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mG;AACnG,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEtE;AAID;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAe1G;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,GAAE,SAA4B,GAAG,OAAO,CAAC,MAAM,CAAC,CA6FhI"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `quiesco build ios|android [--force]` (issue #5): the e2e build of the app, written where the config's
2
+ * `quiesco build ios|android [--force] [--clean]` (issue #5): the e2e build of the app, written where the config's
3
3
  * `binaryPath` says, so `quiesco test` finds it. `expo prebuild` with EXPO_PUBLIC_QUIESCO=1, then
4
4
  * - iOS: `xcodebuild` for the simulator, with the derived data path, configuration and scheme read from
5
5
  * `apps.ios.binaryPath` (`<derivedData>/Build/Products/<Configuration>-iphonesimulator/<Name>.app`);
@@ -7,18 +7,24 @@
7
7
  * `binaryPath` when that is somewhere else.
8
8
  * A Debug build is skipped when its native inputs (app config, dependencies and their installed versions)
9
9
  * did not change since the last build and the binary is still there; `--force` builds anyway. Release builds
10
- * embed the JS bundle, so they are always built.
10
+ * embed the JS bundle, so they are always built. `--clean` runs `expo prebuild --clean` (ios/ / android/ are
11
+ * deleted and generated again) and so builds anyway too.
12
+ * With `appDir` (or `--app-dir`, issue #54) the app is built in that directory; `binaryPath` stays relative
13
+ * to the working directory (the config's).
11
14
  */
12
15
  import { createHash } from 'node:crypto';
13
16
  import fs from 'node:fs';
14
17
  import path from 'node:path';
15
18
  import { loadConfig } from '@quiesco/core';
19
+ import { APP_DIR_OPTION, appContext } from '../app-dir.js';
16
20
  import { takeOption } from '../context.js';
17
- export const BUILD_HELP = `Usage: quiesco build ios|android [--force]
21
+ export const BUILD_HELP = `Usage: quiesco build ios|android [--force] [--clean] [--app-dir <dir>]
18
22
 
19
23
  Builds the app for e2e tests (EXPO_PUBLIC_QUIESCO=1: expo prebuild, then xcodebuild / gradle) and writes it
20
24
  to apps.<platform>.binaryPath in quiesco.config. A Debug build is skipped when the native inputs (app config,
21
- dependencies) did not change since the last one; --force builds anyway.`;
25
+ dependencies) did not change since the last one; --force builds anyway. --clean deletes ios/ / android/ and
26
+ generates them again (expo prebuild --clean; changes made by hand in them are lost), then builds. The app is the one in appDir
27
+ (quiesco.config) or --app-dir when the tests are in a package of their own.`;
22
28
  const defaultBuildDeps = {
23
29
  loadConfig: async (cwd) => (await loadConfig({ cwd, worker: { workerIndex: 0, workerCount: 1 } })).config,
24
30
  };
@@ -60,8 +66,20 @@ export async function buildCommand(args, ctx, deps = defaultBuildDeps) {
60
66
  ctx.out(BUILD_HELP);
61
67
  return 0;
62
68
  }
63
- const force = args.includes('--force');
64
- const rest = takeOption(args.filter((a) => a !== '--force'), '--platform');
69
+ const clean = args.includes('--clean');
70
+ const force = clean || args.includes('--force');
71
+ const appDirOpt = takeOption(args.filter((a) => a !== '--force' && a !== '--clean'), APP_DIR_OPTION);
72
+ const rest = takeOption(appDirOpt.rest, '--platform');
73
+ const unknown = rest.rest.find((a) => a.startsWith('-'));
74
+ if (unknown !== undefined) {
75
+ ctx.err(`quiesco build: unknown option ${unknown}\n\n${BUILD_HELP}`);
76
+ return 2;
77
+ }
78
+ const extra = rest.value === undefined ? rest.rest.slice(1) : rest.rest;
79
+ if (extra.length > 0) {
80
+ ctx.err(`quiesco build: unexpected argument ${extra[0]}\n\n${BUILD_HELP}`);
81
+ return 2;
82
+ }
65
83
  const platform = rest.value ?? rest.rest[0];
66
84
  if (platform !== 'ios' && platform !== 'android') {
67
85
  ctx.err(`quiesco build: choose ios or android (quiesco build ios). The web needs no build: quiesco test starts Metro, or export it with EXPO_PUBLIC_QUIESCO=1 npx expo export --platform web.`);
@@ -75,6 +93,7 @@ export async function buildCommand(args, ctx, deps = defaultBuildDeps) {
75
93
  ctx.err(`quiesco build: ${e.message}`);
76
94
  return 1;
77
95
  }
96
+ const app = appContext(ctx, config, appDirOpt.value);
78
97
  const binaryPath = config.apps[platform]?.binaryPath;
79
98
  if (binaryPath === undefined) {
80
99
  ctx.err(`quiesco build: apps.${platform}.binaryPath is not set in quiesco.config: that is where the build goes (npx quiesco init writes it).`);
@@ -87,8 +106,8 @@ export async function buildCommand(args, ctx, deps = defaultBuildDeps) {
87
106
  }
88
107
  const release = platform === 'ios' ? !/^debug$/i.test(ios?.configuration ?? '') : androidVariant(binaryPath) === 'release';
89
108
  const binary = path.resolve(ctx.cwd, binaryPath);
90
- const stampFile = path.join(ctx.cwd, '.expo', 'quiesco', `build-${platform}.json`);
91
- const fingerprint = nativeFingerprint(ctx, platform, binaryPath);
109
+ const stampFile = path.join(app.cwd, '.expo', 'quiesco', `build-${platform}.json`);
110
+ const fingerprint = nativeFingerprint(app, platform, binaryPath);
92
111
  if (!force && !release && ctx.exists(binary)) {
93
112
  const stamp = ctx.readFile(stampFile);
94
113
  if (stamp !== null && JSON.parse(stamp).fingerprint === fingerprint) {
@@ -97,19 +116,24 @@ export async function buildCommand(args, ctx, deps = defaultBuildDeps) {
97
116
  }
98
117
  }
99
118
  const env = { ...ctx.env, EXPO_PUBLIC_QUIESCO: '1' };
100
- ctx.out(`quiesco build: expo prebuild --platform ${platform} (EXPO_PUBLIC_QUIESCO=1)`);
101
- let code = await ctx.run('npx', ['expo', 'prebuild', '--platform', platform], { cwd: ctx.cwd, env });
119
+ const prebuild = ['expo', 'prebuild', '--platform', platform, ...(clean ? ['--clean'] : [])];
120
+ ctx.out(`quiesco build: ${prebuild.join(' ')} (EXPO_PUBLIC_QUIESCO=1)`);
121
+ if (app !== ctx)
122
+ ctx.out(`quiesco build: the app in ${app.cwd}`);
123
+ let code = await ctx.run('npx', prebuild, { cwd: app.cwd, env });
102
124
  if (code !== 0)
103
125
  return fail(ctx, 'expo prebuild', code);
104
126
  if (ios !== null) {
105
127
  const workspace = path.join('ios', `${ios.name}.xcworkspace`);
106
- if (!ctx.exists(path.join(ctx.cwd, workspace))) {
128
+ if (!app.exists(path.join(app.cwd, workspace))) {
107
129
  ctx.err(`quiesco build: ${workspace} not found after prebuild. The .app name in apps.ios.binaryPath must be the Xcode scheme (expo prebuild names it after expo.name).`);
108
130
  return 1;
109
131
  }
110
- const xcode = ['-workspace', workspace, '-scheme', ios.name, '-configuration', ios.configuration, '-sdk', 'iphonesimulator', '-destination', 'generic/platform=iOS Simulator', '-derivedDataPath', ios.derivedData, '-quiet', 'build'];
132
+ // binaryPath (and so the derived data) is relative to the working directory; xcodebuild runs in the app.
133
+ const derivedData = path.relative(app.cwd, path.resolve(ctx.cwd, ios.derivedData)) || '.';
134
+ const xcode = ['-workspace', workspace, '-scheme', ios.name, '-configuration', ios.configuration, '-sdk', 'iphonesimulator', '-destination', 'generic/platform=iOS Simulator', '-derivedDataPath', derivedData, '-quiet', 'build'];
111
135
  ctx.out(`quiesco build: xcodebuild ${xcode.join(' ')}`);
112
- code = await ctx.run('xcodebuild', xcode, { cwd: ctx.cwd, env });
136
+ code = await ctx.run('xcodebuild', xcode, { cwd: app.cwd, env });
113
137
  if (code !== 0)
114
138
  return fail(ctx, 'xcodebuild', code);
115
139
  }
@@ -118,10 +142,10 @@ export async function buildCommand(args, ctx, deps = defaultBuildDeps) {
118
142
  const task = `assemble${variant === 'release' ? 'Release' : 'Debug'}`;
119
143
  const gradlew = ctx.platform === 'win32' ? 'gradlew.bat' : './gradlew';
120
144
  ctx.out(`quiesco build: ${gradlew} ${task} (in android/)`);
121
- code = await ctx.run(gradlew, [task], { cwd: path.join(ctx.cwd, 'android'), env });
145
+ code = await ctx.run(gradlew, [task], { cwd: path.join(app.cwd, 'android'), env });
122
146
  if (code !== 0)
123
147
  return fail(ctx, `gradle ${task}`, code);
124
- const output = path.join(ctx.cwd, 'android', 'app', 'build', 'outputs', 'apk', variant, `app-${variant}.apk`);
148
+ const output = path.join(app.cwd, 'android', 'app', 'build', 'outputs', 'apk', variant, `app-${variant}.apk`);
125
149
  if (path.resolve(output) !== binary) {
126
150
  fs.mkdirSync(path.dirname(binary), { recursive: true });
127
151
  fs.copyFileSync(output, binary);
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG;;;;wEAI8C,CAAC;AAMzE,MAAM,gBAAgB,GAAc;IAClC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,UAAU,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM;CAC1G,CAAC;AAEF,iHAAiH;AACjH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,MAAM,CAAC,GAAG,uFAAuF,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnH,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAW,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,CAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAW,EAAE,CAAC;AAC9F,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,OAAO,iCAAiC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,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;IACH,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,GAAG,CAAC,GAAG,CAAC,yCAAyC,UAAU,6BAA6B,QAAQ,cAAc,CAAC,CAAC;QAChH,OAAO,CAAC,CAAC;IACX,CAAC;IACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzH,GAAG,CAAC,GAAG,CAAC,kBAAkB,UAAU,YAAY,CAAC,CAAC;IAClD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,IAAY;IACvD,GAAG,CAAC,GAAG,CAAC,kBAAkB,IAAI,sBAAsB,IAAI,IAAI,CAAC,CAAC;IAC9D,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/B,CAAC"}
@@ -15,6 +15,6 @@ export interface DoctorDeps {
15
15
  /** The entry module's first import / require target, ignoring comments. */
16
16
  export declare function firstImport(source: string): string | null;
17
17
  export declare const defaultDoctorDeps: DoctorDeps;
18
- export declare function runChecks(ctx: CliContext, only: CliPlatform | undefined, deps?: DoctorDeps): Promise<CheckResult[]>;
18
+ export declare function runChecks(ctx: CliContext, only: CliPlatform | undefined, deps?: DoctorDeps, appDirFlag?: string): Promise<CheckResult[]>;
19
19
  export declare function doctorCommand(args: readonly string[], ctx: CliContext, deps?: DoctorDeps): Promise<number>;
20
20
  //# sourceMappingURL=doctor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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,MAAM,CAAC;AAE1D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACpD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9C;AA4BD,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIzD;AA+ZD,eAAO,MAAM,iBAAiB,EAAE,UAQ/B,CAAC;AAEF,wBAAsB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,IAAI,GAAE,UAA8B,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAqDjK;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,GAAE,UAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBnI"}
@@ -1,12 +1,14 @@
1
1
  /**
2
- * `quiesco doctor [--platform ios|android|web]` (requirements.md §6.12): check the environment and the
3
- * project's Quiesco setup. Every check says what is wrong and how to fix it; exit code 1 when a check
4
- * fails (warnings do not fail).
2
+ * `quiesco doctor [--platform ios|android|web] [--app-dir <dir>]` (requirements.md §6.12): check the
3
+ * environment and the project's Quiesco setup. Every check says what is wrong and how to fix it; exit code
4
+ * 1 when a check fails (warnings do not fail). With `appDir` (issue #54) the app's checks run in the app's
5
+ * directory and the test setup's (runner, config, features) in the working directory.
5
6
  */
6
7
  import fs from 'node:fs';
7
8
  import net from 'node:net';
8
9
  import path from 'node:path';
9
10
  import { loadConfig, serverPort } from '@quiesco/core';
11
+ import { APP_DIR_OPTION, appContext, inApp } from '../app-dir.js';
10
12
  import { PLATFORMS, parsePlatform, takeOption } from '../context.js';
11
13
  import { MIN_EXPO_SDK, UPGRADE_SDK_FIX, expoSdk } from '../expo-sdk.js';
12
14
  import { CLI_COMMANDS, installedVersion, isQuiescoPackage, scriptCommands } from '../packages.js';
@@ -55,32 +57,49 @@ function expoCheck(ctx, pkg) {
55
57
  const detail = `expo ${sdk.version} (SDK ${sdk.sdk}${sdk.installed ? '' : ', not installed'})`;
56
58
  return sdk.sdk >= MIN_EXPO_SDK ? { name: 'Expo project', status: 'ok', detail } : { name: 'Expo project', status: 'fail', detail, fix: UPGRADE_SDK_FIX };
57
59
  }
58
- function projectChecks(ctx) {
60
+ /**
61
+ * The app (expo, @quiesco/agent, config plugin, Metro, entry) in `app`, the test setup (runner packages,
62
+ * older inits' files) in `ctx`: the same directory unless appDir is set (issue #54).
63
+ */
64
+ function projectChecks(ctx, app) {
59
65
  const results = [];
60
- const pkg = readJson(ctx, path.join(ctx.cwd, 'package.json'));
66
+ const separate = app !== ctx;
67
+ const pkg = readJson(app, path.join(app.cwd, 'package.json'));
61
68
  if (pkg === null) {
62
- return [{ name: 'project', status: 'fail', detail: `no package.json in ${ctx.cwd}`, fix: 'Run quiesco in the Expo app directory.' }];
69
+ return [
70
+ {
71
+ name: 'project',
72
+ status: 'fail',
73
+ detail: `no package.json in ${app.cwd}`,
74
+ fix: separate ? 'appDir (quiesco.config) or --app-dir must name the Expo app\'s directory.' : 'Run quiesco in the Expo app directory, or set appDir in quiesco.config to where the app is.',
75
+ },
76
+ ];
63
77
  }
64
- results.push(expoCheck(ctx, pkg));
65
- // The runner the commands use without --runner, with Quiesco's integration and the runner itself.
66
- const wanted = ['@quiesco/agent', ...RUNNER_PACKAGES[projectRunner(ctx)]];
67
- const missing = wanted.filter((d) => !hasDep(pkg, d));
78
+ const testPkg = separate ? readJson(ctx, path.join(ctx.cwd, 'package.json')) : pkg;
79
+ results.push(expoCheck(app, pkg));
80
+ // The app has the agent; the test project has the runner the commands use without --runner, with
81
+ // Quiesco's integration and the runner itself.
82
+ const runnerPkgs = RUNNER_PACKAGES[projectRunner(ctx)];
83
+ const missing = [
84
+ ...(hasDep(pkg, '@quiesco/agent') ? [] : [`@quiesco/agent${separate ? ` (in ${inApp(ctx, app)})` : ''}`]),
85
+ ...runnerPkgs.filter((d) => testPkg === null || !hasDep(testPkg, d)),
86
+ ];
68
87
  results.push(missing.length === 0
69
- ? { name: 'Quiesco packages', status: 'ok', detail: wanted.join(', ') }
88
+ ? { name: 'Quiesco packages', status: 'ok', detail: ['@quiesco/agent', ...runnerPkgs].join(', ') }
70
89
  : { name: 'Quiesco packages', status: 'fail', detail: `missing ${missing.join(', ')}`, fix: 'Run `npx quiesco init`, or install them.' });
71
- results.push(...versionChecks(ctx, pkg));
90
+ results.push(...versionChecks(ctx, [{ ctx: app, pkg }, ...(separate && testPkg !== null ? [{ ctx, pkg: testPkg }] : [])]));
72
91
  results.push(...legacyChecks(ctx));
73
- const appJson = readJson(ctx, path.join(ctx.cwd, 'app.json'));
92
+ const appJson = readJson(app, path.join(app.cwd, 'app.json'));
74
93
  const plugins = appJson?.expo?.plugins ?? [];
75
94
  const listed = plugins.some((p) => p === '@quiesco/expo-plugin' || (Array.isArray(p) && p[0] === '@quiesco/expo-plugin'));
76
- const dynamic = ['app.config.ts', 'app.config.js', 'app.config.mjs'].some((f) => ctx.exists(path.join(ctx.cwd, f)));
95
+ const dynamic = ['app.config.ts', 'app.config.js', 'app.config.mjs'].some((f) => app.exists(path.join(app.cwd, f)));
77
96
  results.push(listed
78
97
  ? { name: 'config plugin', status: 'ok', detail: '@quiesco/expo-plugin in app.json' }
79
98
  : dynamic
80
99
  ? { name: 'config plugin', status: 'warn', detail: 'app.config.* found; cannot check its plugins', fix: 'Make sure "@quiesco/expo-plugin" is in plugins (native e2e builds need it).' }
81
100
  : { name: 'config plugin', status: 'warn', detail: '@quiesco/expo-plugin is not in app.json plugins', fix: 'Add "@quiesco/expo-plugin" to expo.plugins (needed for iOS / Android e2e builds, not for web).' });
82
- const metro = ['metro.config.js', 'metro.config.cjs', 'metro.config.mjs', 'metro.config.ts'].map((f) => path.join(ctx.cwd, f)).find((f) => ctx.exists(f));
83
- const metroSrc = metro !== undefined ? ctx.readFile(metro) : null;
101
+ const metro = ['metro.config.js', 'metro.config.cjs', 'metro.config.mjs', 'metro.config.ts'].map((f) => path.join(app.cwd, f)).find((f) => app.exists(f));
102
+ const metroSrc = metro !== undefined ? app.readFile(metro) : null;
84
103
  results.push(metroSrc !== null && metroSrc.includes('withQuiesco')
85
104
  ? { name: 'Metro', status: 'ok', detail: `${path.basename(metro)} uses withQuiesco()` }
86
105
  : {
@@ -99,8 +118,8 @@ function projectChecks(ctx) {
99
118
  });
100
119
  }
101
120
  else {
102
- const entry = [main, `${main}.ts`, `${main}.tsx`, `${main}.js`].map((f) => path.join(ctx.cwd, f)).find((f) => ctx.exists(f));
103
- const src = entry !== undefined ? ctx.readFile(entry) : null;
121
+ const entry = [main, `${main}.ts`, `${main}.tsx`, `${main}.js`].map((f) => path.join(app.cwd, f)).find((f) => app.exists(f));
122
+ const src = entry !== undefined ? app.readFile(entry) : null;
104
123
  const first = src !== null ? firstImport(src) : null;
105
124
  results.push(first === '@quiesco/agent'
106
125
  ? { name: 'entry file', status: 'ok', detail: `${main} imports @quiesco/agent first` }
@@ -112,14 +131,17 @@ function projectChecks(ctx) {
112
131
  }
113
132
  /**
114
133
  * Issue #17: every Quiesco package in package.json is installed at one version, and every `quiesco <cmd>`
115
- * in the scripts exists in it.
134
+ * in the scripts exists in it. With appDir (issue #54) the app's and the test project's packages together.
116
135
  */
117
- function versionChecks(ctx, pkg) {
136
+ function versionChecks(ctx, projects) {
118
137
  const results = [];
119
- const names = [...new Set([...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.devDependencies ?? {})])].filter(isQuiescoPackage).sort();
138
+ const declared = projects.flatMap((p) => [...new Set([...Object.keys(p.pkg.dependencies ?? {}), ...Object.keys(p.pkg.devDependencies ?? {})])].filter(isQuiescoPackage).map((name) => ({ name, dir: p.ctx })));
139
+ const names = [...new Set(declared.map((d) => d.name))].sort();
120
140
  if (names.length === 0)
121
141
  return results;
122
- const installed = names.map((name) => ({ name, version: installedVersion(ctx, name) }));
142
+ const installed = declared
143
+ .sort((a, b) => a.name.localeCompare(b.name))
144
+ .map((d) => ({ name: d.dir === ctx ? d.name : `${d.name} (${inApp(ctx, d.dir)})`, version: installedVersion(d.dir, d.name) }));
123
145
  const missing = installed.filter((p) => p.version === null).map((p) => p.name);
124
146
  const versions = [...new Set(installed.flatMap((p) => (p.version !== null ? [p.version] : [])))];
125
147
  const list = installed.map((p) => `${p.name} ${p.version ?? '(not installed)'}`).join(', ');
@@ -147,7 +169,7 @@ function versionChecks(ctx, pkg) {
147
169
  fix: "Run the project's own CLI (npx quiesco doctor in the project directory), or upgrade the project with npx quiesco@latest init --upgrade.",
148
170
  });
149
171
  }
150
- const unknown = scriptCommands(pkg.scripts).filter((c) => !CLI_COMMANDS.includes(c.command));
172
+ const unknown = projects.flatMap((p) => scriptCommands(p.pkg.scripts)).filter((c) => !CLI_COMMANDS.includes(c.command));
151
173
  if (unknown.length > 0) {
152
174
  results.push({
153
175
  name: 'scripts',
@@ -220,7 +242,7 @@ function buildScriptChecks(pkg, config) {
220
242
  * uses) and, when they exist, with the prebuilt Android project and the iOS build. Placeholders left by
221
243
  * init fail.
222
244
  */
223
- async function appIdChecks(ctx, config) {
245
+ async function appIdChecks(ctx, app, config) {
224
246
  const { ios, android } = config.apps;
225
247
  if (ios === undefined && android === undefined)
226
248
  return [];
@@ -236,13 +258,13 @@ async function appIdChecks(ctx, config) {
236
258
  },
237
259
  ];
238
260
  }
239
- const dynamic = DYNAMIC_APP_CONFIGS.find((f) => ctx.exists(path.join(ctx.cwd, f)));
261
+ const dynamic = DYNAMIC_APP_CONFIGS.find((f) => app.exists(path.join(app.cwd, f)));
240
262
  const results = [];
241
263
  if (dynamic !== undefined) {
242
264
  results.push({ name: 'app IDs', status: 'warn', detail: `${dynamic} found; cannot compare the app IDs with it`, fix: 'Make sure apps.ios.bundleId, apps.android.package and devClient.scheme are the values your app config sets.' });
243
265
  }
244
266
  else {
245
- const expo = readJson(ctx, path.join(ctx.cwd, 'app.json'))?.expo ?? {};
267
+ const expo = readJson(app, path.join(app.cwd, 'app.json'))?.expo ?? {};
246
268
  const schemes = expo.scheme === undefined ? [] : Array.isArray(expo.scheme) ? expo.scheme : [expo.scheme];
247
269
  const problems = [];
248
270
  const compare = (what, want, have) => {
@@ -265,9 +287,9 @@ async function appIdChecks(ctx, config) {
265
287
  }
266
288
  // The builds: an app built before the IDs changed is another app.
267
289
  if (android !== undefined) {
268
- const gradle = ctx.readFile(path.join(ctx.cwd, 'android/app/build.gradle'));
290
+ const gradle = app.readFile(path.join(app.cwd, 'android/app/build.gradle'));
269
291
  const built = gradle === null ? undefined : /applicationId\s*(?:=\s*)?['"]([^'"]+)['"]/.exec(gradle)?.[1];
270
- const manifest = ctx.readFile(path.join(ctx.cwd, 'android/app/src/main/AndroidManifest.xml'));
292
+ const manifest = app.readFile(path.join(app.cwd, 'android/app/src/main/AndroidManifest.xml'));
271
293
  const scheme = android.devClient?.scheme;
272
294
  const wrong = [];
273
295
  if (built !== undefined && built !== android.package)
@@ -410,7 +432,7 @@ export const defaultDoctorDeps = {
410
432
  srv.listen(port, () => srv.close(() => resolve(true)));
411
433
  }),
412
434
  };
413
- export async function runChecks(ctx, only, deps = defaultDoctorDeps) {
435
+ export async function runChecks(ctx, only, deps = defaultDoctorDeps, appDirFlag) {
414
436
  const results = [];
415
437
  const major = Number.parseInt(ctx.nodeVersion, 10);
416
438
  results.push(major >= MIN_NODE_MAJOR
@@ -426,17 +448,29 @@ export async function runChecks(ctx, only, deps = defaultDoctorDeps) {
426
448
  fix: 'Metro started with CI set does not watch files, so code changes do not reach the app under test. Unset it (unset CI) before EXPO_PUBLIC_QUIESCO=1 npx expo start.',
427
449
  });
428
450
  }
429
- results.push(...projectChecks(ctx));
430
- results.push(rootCheck(ctx, readJson(ctx, path.join(ctx.cwd, 'package.json'))?.main));
451
+ // The config first: its appDir says where the app is (issue #54).
431
452
  let config = null;
453
+ let configError = null;
432
454
  try {
433
455
  config = await deps.loadConfig(ctx.cwd);
434
- results.push({ name: 'quiesco.config', status: 'ok', detail: `apps: ${Object.keys(config.apps).join(', ') || 'none'}` });
435
- results.push(...(await appIdChecks(ctx, config)));
436
- results.push(...buildScriptChecks(readJson(ctx, path.join(ctx.cwd, 'package.json')), config));
437
456
  }
438
457
  catch (e) {
439
- results.push({ name: 'quiesco.config', status: 'fail', detail: e.message.split('\n')[0] ?? '', fix: 'Create quiesco.config.mts (npx quiesco init writes one).' });
458
+ configError = e.message.split('\n')[0] ?? '';
459
+ }
460
+ const app = appContext(ctx, config, appDirFlag);
461
+ if (app !== ctx)
462
+ results.push({ name: 'app', status: 'ok', detail: `${inApp(ctx, app)} (${appDirFlag !== undefined ? APP_DIR_OPTION : 'appDir'}); the test setup in ${ctx.cwd}` });
463
+ results.push(...projectChecks(ctx, app));
464
+ results.push(rootCheck(app, readJson(app, path.join(app.cwd, 'package.json'))?.main));
465
+ if (config !== null) {
466
+ results.push({ name: 'quiesco.config', status: 'ok', detail: `apps: ${Object.keys(config.apps).join(', ') || 'none'}` });
467
+ results.push(...(await appIdChecks(ctx, app, config)));
468
+ // A script that builds may be in either package.json.
469
+ const scripts = { ...readJson(app, path.join(app.cwd, 'package.json'))?.scripts, ...readJson(ctx, path.join(ctx.cwd, 'package.json'))?.scripts };
470
+ results.push(...buildScriptChecks({ scripts }, config));
471
+ }
472
+ else {
473
+ results.push({ name: 'quiesco.config', status: 'fail', detail: configError ?? '', fix: 'Create quiesco.config.mts (npx quiesco init writes one), in the test project when the app is elsewhere (appDir).' });
440
474
  }
441
475
  const platforms = only !== undefined ? [only] : PLATFORMS.filter((p) => config?.apps[p] !== undefined);
442
476
  for (const p of platforms)
@@ -450,12 +484,13 @@ export async function runChecks(ctx, only, deps = defaultDoctorDeps) {
450
484
  return results;
451
485
  }
452
486
  export async function doctorCommand(args, ctx, deps = defaultDoctorDeps) {
453
- const { value, rest } = takeOption(args, '--platform');
454
- if (rest.length > 0) {
455
- ctx.err(`quiesco doctor: unknown arguments ${rest.join(' ')}`);
487
+ const { value, rest: afterPlatform } = takeOption(args, '--platform');
488
+ const appDir = takeOption(afterPlatform, APP_DIR_OPTION);
489
+ if (appDir.rest.length > 0) {
490
+ ctx.err(`quiesco doctor: unknown arguments ${appDir.rest.join(' ')}`);
456
491
  return 2;
457
492
  }
458
- const results = await runChecks(ctx, parsePlatform(value), deps);
493
+ const results = await runChecks(ctx, parsePlatform(value), deps, appDir.value);
459
494
  for (const r of results) {
460
495
  ctx.out(`${ICON[r.status]} ${r.name}: ${r.detail}`);
461
496
  if (r.fix !== undefined && r.status !== 'ok')