quiesco 0.4.0 → 0.4.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,95 @@
1
+ import type { CliContext, CliPlatform } from './context.js';
2
+ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
3
+ export interface PackageJson {
4
+ name?: string;
5
+ main?: string;
6
+ scripts?: Record<string, string>;
7
+ dependencies?: Record<string, string>;
8
+ devDependencies?: Record<string, string>;
9
+ overrides?: Record<string, string>;
10
+ resolutions?: Record<string, string>;
11
+ [key: string]: unknown;
12
+ }
13
+ export interface AppJson {
14
+ expo?: {
15
+ name?: string;
16
+ slug?: string;
17
+ scheme?: string | string[];
18
+ plugins?: unknown[];
19
+ ios?: {
20
+ bundleIdentifier?: string;
21
+ [key: string]: unknown;
22
+ };
23
+ android?: {
24
+ package?: string;
25
+ [key: string]: unknown;
26
+ };
27
+ [key: string]: unknown;
28
+ };
29
+ }
30
+ export interface InitStep {
31
+ status: 'created' | 'updated' | 'skipped' | 'ran' | 'todo';
32
+ what: string;
33
+ note?: string;
34
+ }
35
+ /** Where steps record what they did; `dryRun`: change nothing, only record what would change. */
36
+ export interface StepLog {
37
+ ctx: CliContext;
38
+ steps: InitStep[];
39
+ dryRun: boolean;
40
+ }
41
+ /** Installed into `dependencies`: the app bundles them (stubbed / excluded in production builds). */
42
+ export declare const RUNTIME: string[];
43
+ /** Installed into `devDependencies`. */
44
+ export declare const DEV: string[];
45
+ export declare const WEB_DEV: string[];
46
+ /** The app config files Quiesco cannot edit (JavaScript / TypeScript). */
47
+ export declare const DYNAMIC_APP_CONFIGS: string[];
48
+ export declare function readJson<T>(ctx: CliContext, file: string): T | null;
49
+ export declare const writeJson: (ctx: CliContext, file: string, value: unknown) => void;
50
+ export declare function detectPackageManager(ctx: CliContext): PackageManager;
51
+ /** `@quiesco/agent` → `quiesco-agent-<version>.tgz` (the file name `pnpm pack` / `npm pack` writes). */
52
+ export declare function findTarballs(dir: string, names: readonly string[], list?: (d: string) => string[]): Map<string, string>;
53
+ export declare function addCommand(pm: PackageManager, dev: boolean, specs: string[]): {
54
+ command: string;
55
+ args: string[];
56
+ };
57
+ export interface InstallOptions {
58
+ pm: PackageManager;
59
+ runtime: readonly string[];
60
+ dev: readonly string[];
61
+ /** `--packages <dir>`: install from the tarballs in it. */
62
+ packagesDir?: string;
63
+ skipInstall: boolean;
64
+ }
65
+ /**
66
+ * Install `runtime` / `dev` with each Quiesco package at this CLI's version (issue #17: not whatever the
67
+ * package manager's cached registry metadata calls latest), then read the installed versions back.
68
+ * Returns false (after printing why) when it failed; the command should stop then.
69
+ */
70
+ export declare function installPackages(log: StepLog, o: InstallOptions): Promise<boolean>;
71
+ /**
72
+ * IDs for an app.json that has none: `com.anonymous.<slug>` (letters and digits, as Expo's prebuild derives
73
+ * the Android package; for iOS it keeps hyphens, so the two would differ) and the slug as URL scheme.
74
+ */
75
+ export declare function defaultAppIds(app: AppJson, fallbackName: string | undefined): {
76
+ id: string;
77
+ scheme: string;
78
+ };
79
+ export declare function firstScheme(app: AppJson): string | undefined;
80
+ /** The app config is JavaScript / TypeScript: Quiesco cannot read or change it. */
81
+ export declare function dynamicAppConfig(ctx: CliContext): string | undefined;
82
+ /**
83
+ * Write the IDs the platforms need into app.json when it has none (issue #34): `ios.bundleIdentifier` for
84
+ * iOS, `android.package` and `scheme` (the dev client's deep link) for Android. Without them the build uses
85
+ * Expo's defaults, which differ per platform and are not what quiesco.config names. Returns app.json as
86
+ * it is now.
87
+ */
88
+ export declare function ensureAppIds(log: StepLog, platforms: readonly CliPlatform[]): AppJson;
89
+ /** Step files import each other with .ts (Node's type stripping needs it): let tsc accept that. */
90
+ export declare function ensureTsconfig(log: StepLog): void;
91
+ export declare function e2eScripts(platforms: readonly CliPlatform[]): Record<string, string>;
92
+ /** Add the e2e scripts that are missing; existing scripts of the same name are left alone. */
93
+ export declare function ensureScripts(log: StepLog, platforms: readonly CliPlatform[]): void;
94
+ export declare function printSteps(ctx: CliContext, steps: readonly InitStep[]): void;
95
+ //# sourceMappingURL=setup-steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-steps.d.ts","sourceRoot":"","sources":["../src/setup-steps.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;QACpB,GAAG,CAAC,EAAE;YAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QAC5D,OAAO,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAA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 -0,0 +1,289 @@
1
+ /**
2
+ * The steps of `quiesco init` that `quiesco init --upgrade` repeats on an existing project: installing the
3
+ * Quiesco packages at this CLI's version, app IDs in app.json, tsconfig.json and the e2e scripts. Each step
4
+ * records what it did as an InitStep and, in a dry run, only says what it would do.
5
+ */
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import { installedVersion, isQuiescoPackage } from './packages.js';
9
+ /** Installed into `dependencies`: the app bundles them (stubbed / excluded in production builds). */
10
+ export const RUNTIME = ['@quiesco/agent', '@quiesco/native'];
11
+ /** Installed into `devDependencies`. */
12
+ export const DEV = ['quiesco', '@quiesco/core', '@quiesco/cucumber', '@quiesco/expo-plugin', '@cucumber/cucumber'];
13
+ export const WEB_DEV = ['@quiesco/web', 'playwright'];
14
+ /** Internal packages pulled in by the ones above; only pinned when installing from tarballs. */
15
+ const TRANSITIVE = ['@quiesco/protocol'];
16
+ /** The app config files Quiesco cannot edit (JavaScript / TypeScript). */
17
+ export const DYNAMIC_APP_CONFIGS = ['app.config.js', 'app.config.ts', 'app.config.mjs', 'app.config.cjs'];
18
+ export function readJson(ctx, file) {
19
+ const text = ctx.readFile(file);
20
+ if (text === null)
21
+ return null;
22
+ try {
23
+ return JSON.parse(text);
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ }
29
+ export const writeJson = (ctx, file, value) => ctx.writeFile(file, `${JSON.stringify(value, null, 2)}\n`);
30
+ export function detectPackageManager(ctx) {
31
+ if (ctx.exists(path.join(ctx.cwd, 'pnpm-lock.yaml')))
32
+ return 'pnpm';
33
+ if (ctx.exists(path.join(ctx.cwd, 'yarn.lock')))
34
+ return 'yarn';
35
+ if (ctx.exists(path.join(ctx.cwd, 'bun.lock')) || ctx.exists(path.join(ctx.cwd, 'bun.lockb')))
36
+ return 'bun';
37
+ return 'npm';
38
+ }
39
+ /** `@quiesco/agent` → `quiesco-agent-<version>.tgz` (the file name `pnpm pack` / `npm pack` writes). */
40
+ export function findTarballs(dir, names, list = (d) => fs.readdirSync(d)) {
41
+ const files = list(dir).filter((f) => f.endsWith('.tgz'));
42
+ const found = new Map();
43
+ for (const name of names) {
44
+ const base = name.replace(/^@/, '').replace('/', '-');
45
+ const match = files.find((f) => new RegExp(`^${base.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}-\\d[^/]*\\.tgz$`).test(f));
46
+ if (match !== undefined)
47
+ found.set(name, path.join(dir, match));
48
+ }
49
+ return found;
50
+ }
51
+ /** An `overrides:` block for pnpm-workspace.yaml (names and paths quoted: `@` starts no plain YAML scalar). */
52
+ function pnpmOverrides(pins) {
53
+ return `overrides:\n${Object.entries(pins).map(([n, f]) => ` ${JSON.stringify(n)}: ${JSON.stringify(f)}\n`).join('')}`;
54
+ }
55
+ export function addCommand(pm, dev, specs) {
56
+ switch (pm) {
57
+ case 'pnpm':
58
+ return { command: 'pnpm', args: ['add', ...(dev ? ['-D'] : []), ...specs] };
59
+ case 'yarn':
60
+ return { command: 'yarn', args: ['add', ...(dev ? ['-D'] : []), ...specs] };
61
+ case 'bun':
62
+ return { command: 'bun', args: ['add', ...(dev ? ['-d'] : []), ...specs] };
63
+ case 'npm':
64
+ return { command: 'npm', args: ['install', ...(dev ? ['--save-dev'] : []), ...specs] };
65
+ }
66
+ }
67
+ /**
68
+ * Install `runtime` / `dev` with each Quiesco package at this CLI's version (issue #17: not whatever the
69
+ * package manager's cached registry metadata calls latest), then read the installed versions back.
70
+ * Returns false (after printing why) when it failed; the command should stop then.
71
+ */
72
+ export async function installPackages(log, o) {
73
+ const { ctx, steps } = log;
74
+ let spec = (name) => (isQuiescoPackage(name) ? `${name}@${ctx.version}` : name);
75
+ /** The version each Quiesco package must have after the install. */
76
+ let expected = (_name) => ctx.version;
77
+ if (o.packagesDir !== undefined) {
78
+ const dir = path.resolve(ctx.cwd, o.packagesDir);
79
+ const ours = [...o.runtime, ...o.dev, ...TRANSITIVE].filter(isQuiescoPackage);
80
+ const tarballs = findTarballs(dir, ours);
81
+ const missing = ours.filter((n) => !tarballs.has(n));
82
+ if (missing.length > 0) {
83
+ ctx.err(`quiesco init: no tarball for ${missing.join(', ')} in ${dir}`);
84
+ return false;
85
+ }
86
+ spec = (name) => (tarballs.has(name) ? `file:${tarballs.get(name)}` : name);
87
+ expected = (name) => /-(\d[^/]*)\.tgz$/.exec(tarballs.get(name) ?? '')?.[1] ?? ctx.version;
88
+ // Their own dependencies on each other ("@quiesco/protocol": "0.0.0") must resolve to the tarballs too.
89
+ // npm refuses an override for a package that is also a direct dependency (EOVERRIDE) and reuses the
90
+ // directly installed tarballs for those ranges anyway: pin only the indirect ones there. pnpm and
91
+ // yarn resolve every dependency on its own, so they need all of them pinned.
92
+ const direct = new Set([...o.runtime, ...o.dev]);
93
+ const pins = Object.fromEntries([...tarballs].filter(([n]) => o.pm !== 'npm' || !direct.has(n)).map(([n, f]) => [n, `file:${f}`]));
94
+ const pinned = `installing from the tarballs in ${o.packagesDir} (${Object.keys(pins).length} indirect ${Object.keys(pins).length === 1 ? 'dependency' : 'dependencies'} pinned)`;
95
+ if (o.pm === 'pnpm') {
96
+ // pnpm 10+ reads overrides from pnpm-workspace.yaml only; the "pnpm" field of package.json is ignored.
97
+ const yamlFile = path.join(ctx.cwd, 'pnpm-workspace.yaml');
98
+ const yaml = ctx.readFile(yamlFile) ?? '';
99
+ if (/^overrides:/m.test(yaml)) {
100
+ ctx.err(`quiesco init: pnpm-workspace.yaml already has overrides; add these and run quiesco init again:\n${pnpmOverrides(pins)}`);
101
+ return false;
102
+ }
103
+ if (!log.dryRun)
104
+ ctx.writeFile(yamlFile, `${yaml}${yaml === '' || yaml.endsWith('\n') ? '' : '\n'}${pnpmOverrides(pins)}`);
105
+ steps.push({ status: 'updated', what: 'pnpm-workspace.yaml', note: pinned });
106
+ }
107
+ else {
108
+ const pkgFile = path.join(ctx.cwd, 'package.json');
109
+ const current = readJson(ctx, pkgFile);
110
+ if (o.pm === 'yarn')
111
+ current.resolutions = { ...current.resolutions, ...pins };
112
+ else
113
+ current.overrides = { ...current.overrides, ...pins };
114
+ if (!log.dryRun)
115
+ writeJson(ctx, pkgFile, current);
116
+ steps.push({ status: 'updated', what: 'package.json', note: pinned });
117
+ }
118
+ }
119
+ /** One command per dependency group that has packages (an upgrade may have no runtime ones to change). */
120
+ const commands = (names) => [[false, o.runtime], [true, o.dev]].filter(([, list]) => names(list).length > 0).map(([dev, list]) => addCommand(o.pm, dev, names(list).map(spec)));
121
+ const installs = commands((list) => list);
122
+ for (const cmd of installs) {
123
+ const line = `${cmd.command} ${cmd.args.join(' ')}`;
124
+ if (o.skipInstall || log.dryRun) {
125
+ steps.push({ status: 'todo', what: 'install', note: line });
126
+ continue;
127
+ }
128
+ ctx.out(`$ ${line}`);
129
+ const r = await ctx.exec(cmd.command, cmd.args, { cwd: ctx.cwd });
130
+ if (r.code !== 0) {
131
+ ctx.err(r.stderr.trim() || r.stdout.trim());
132
+ ctx.err(`quiesco init: \`${line}\` failed (exit ${r.code}).`);
133
+ return false;
134
+ }
135
+ steps.push({ status: 'ran', what: 'install', note: line });
136
+ }
137
+ if (o.skipInstall || log.dryRun)
138
+ return true;
139
+ const ours = [...o.runtime, ...o.dev].filter(isQuiescoPackage);
140
+ const wrong = ours.map((name) => ({ name, want: expected(name), got: installedVersion(ctx, name) })).filter((p) => p.got !== p.want);
141
+ if (wrong.length > 0) {
142
+ ctx.err(`quiesco init: the installed Quiesco packages are not the version that was asked for:`);
143
+ for (const p of wrong)
144
+ ctx.err(` ${p.name}: ${p.got ?? 'not found in node_modules'} (wanted ${p.want})`);
145
+ ctx.err('All Quiesco packages must have the same version as the CLI that writes the project files. The');
146
+ ctx.err("package manager may have used stale registry metadata from its cache, or held a new release back");
147
+ ctx.err('(pnpm minimumReleaseAge). Install them again with the version given:');
148
+ for (const cmd of commands((list) => list.filter(isQuiescoPackage)))
149
+ ctx.err(` ${cmd.command} ${cmd.args.join(' ')}`);
150
+ ctx.err('then run quiesco init again.');
151
+ return false;
152
+ }
153
+ steps.push({ status: 'ran', what: 'versions', note: `${ours.length} Quiesco packages at ${[...new Set(ours.map(expected))].join(', ')}` });
154
+ return true;
155
+ }
156
+ // ---- app IDs (issue #34) ----
157
+ /**
158
+ * IDs for an app.json that has none: `com.anonymous.<slug>` (letters and digits, as Expo's prebuild derives
159
+ * the Android package; for iOS it keeps hyphens, so the two would differ) and the slug as URL scheme.
160
+ */
161
+ export function defaultAppIds(app, fallbackName) {
162
+ const base = (app.expo?.slug ?? app.expo?.name ?? fallbackName ?? 'app').toLowerCase();
163
+ let idPart = base.replace(/[^a-z0-9]/g, '');
164
+ if (!/^[a-z]/.test(idPart))
165
+ idPart = `app${idPart}`;
166
+ let scheme = base.replace(/[^a-z0-9+.-]/g, '');
167
+ if (!/^[a-z]/.test(scheme))
168
+ scheme = `app${scheme}`;
169
+ return { id: `com.anonymous.${idPart}`, scheme };
170
+ }
171
+ export function firstScheme(app) {
172
+ const s = app.expo?.scheme;
173
+ return Array.isArray(s) ? s[0] : s;
174
+ }
175
+ /** The app config is JavaScript / TypeScript: Quiesco cannot read or change it. */
176
+ export function dynamicAppConfig(ctx) {
177
+ return DYNAMIC_APP_CONFIGS.find((f) => ctx.exists(path.join(ctx.cwd, f)));
178
+ }
179
+ /**
180
+ * Write the IDs the platforms need into app.json when it has none (issue #34): `ios.bundleIdentifier` for
181
+ * iOS, `android.package` and `scheme` (the dev client's deep link) for Android. Without them the build uses
182
+ * Expo's defaults, which differ per platform and are not what quiesco.config names. Returns app.json as
183
+ * it is now.
184
+ */
185
+ export function ensureAppIds(log, platforms) {
186
+ const { ctx, steps } = log;
187
+ const appFile = path.join(ctx.cwd, 'app.json');
188
+ const app = readJson(ctx, appFile) ?? {};
189
+ const expo = app.expo;
190
+ if (expo === undefined || !platforms.some((p) => p !== 'web'))
191
+ return app;
192
+ const dynamic = dynamicAppConfig(ctx);
193
+ const missing = [];
194
+ if (platforms.includes('ios') && expo.ios?.bundleIdentifier === undefined)
195
+ missing.push('ios.bundleIdentifier');
196
+ if (platforms.includes('android') && expo.android?.package === undefined)
197
+ missing.push('android.package');
198
+ if (platforms.includes('android') && firstScheme(app) === undefined)
199
+ missing.push('scheme');
200
+ if (missing.length === 0) {
201
+ steps.push({ status: 'skipped', what: 'app IDs', note: 'app.json has them' });
202
+ return app;
203
+ }
204
+ if (dynamic !== undefined) {
205
+ steps.push({ status: 'todo', what: 'app IDs', note: `set expo.${missing.join(', expo.')} in ${dynamic} and use the same values in quiesco.config` });
206
+ return app;
207
+ }
208
+ const { id, scheme } = defaultAppIds(app, readJson(ctx, path.join(ctx.cwd, 'package.json'))?.name);
209
+ const set = [];
210
+ if (missing.includes('ios.bundleIdentifier')) {
211
+ expo.ios = { ...expo.ios, bundleIdentifier: id };
212
+ set.push(`ios.bundleIdentifier "${id}"`);
213
+ }
214
+ if (missing.includes('android.package')) {
215
+ expo.android = { ...expo.android, package: id };
216
+ set.push(`android.package "${id}"`);
217
+ }
218
+ if (missing.includes('scheme')) {
219
+ expo.scheme = scheme;
220
+ set.push(`scheme "${scheme}"`);
221
+ }
222
+ if (!log.dryRun)
223
+ writeJson(ctx, appFile, app);
224
+ steps.push({ status: 'updated', what: 'app.json', note: `set ${set.join(', ')}: the build and quiesco.config must name the same app (change them here and in quiesco.config if you like)` });
225
+ return app;
226
+ }
227
+ // ---- tsconfig.json (issue #21) ----
228
+ /** Step files import each other with .ts (Node's type stripping needs it): let tsc accept that. */
229
+ export function ensureTsconfig(log) {
230
+ const { ctx, steps } = log;
231
+ const tsconfigFile = path.join(ctx.cwd, 'tsconfig.json');
232
+ const tsconfigText = ctx.readFile(tsconfigFile);
233
+ if (tsconfigText === null)
234
+ return;
235
+ let tsconfig;
236
+ try {
237
+ tsconfig = JSON.parse(tsconfigText);
238
+ }
239
+ catch {
240
+ tsconfig = null; // comments or trailing commas: leave the file to the user
241
+ }
242
+ if (tsconfig?.compilerOptions?.['allowImportingTsExtensions'] === true || /"allowImportingTsExtensions"\s*:\s*true/.test(tsconfigText)) {
243
+ steps.push({ status: 'skipped', what: 'tsconfig.json', note: 'already allows .ts imports' });
244
+ }
245
+ else if (tsconfig === null || typeof tsconfig !== 'object' || Array.isArray(tsconfig)) {
246
+ steps.push({ status: 'todo', what: 'tsconfig.json', note: 'add "allowImportingTsExtensions": true to compilerOptions (step files import each other with .ts)' });
247
+ }
248
+ else {
249
+ tsconfig.compilerOptions = { ...tsconfig.compilerOptions, allowImportingTsExtensions: true };
250
+ if (!log.dryRun)
251
+ writeJson(ctx, tsconfigFile, tsconfig);
252
+ steps.push({ status: 'updated', what: 'tsconfig.json', note: 'allowImportingTsExtensions: step files import each other with .ts' });
253
+ }
254
+ }
255
+ // ---- scripts ----
256
+ export function e2eScripts(platforms) {
257
+ return {
258
+ 'e2e:start': 'EXPO_PUBLIC_QUIESCO=1 expo start',
259
+ ...(platforms.includes('web') ? { 'e2e:web': 'EXPO_PUBLIC_QUIESCO=1 expo export --platform web && quiesco test --platform web' } : {}),
260
+ ...(platforms.includes('android') ? { 'e2e:build:android': 'quiesco build android', 'e2e:android': 'quiesco test --platform android' } : {}),
261
+ ...(platforms.includes('ios') ? { 'e2e:build:ios': 'quiesco build ios', 'e2e:ios': 'quiesco test --platform ios' } : {}),
262
+ };
263
+ }
264
+ /** Add the e2e scripts that are missing; existing scripts of the same name are left alone. */
265
+ export function ensureScripts(log, platforms) {
266
+ const { ctx, steps } = log;
267
+ const pkgFile = path.join(ctx.cwd, 'package.json');
268
+ const pkg = readJson(ctx, pkgFile);
269
+ const scripts = { ...(pkg.scripts ?? {}) };
270
+ const wanted = e2eScripts(platforms);
271
+ const added = Object.keys(wanted).filter((k) => scripts[k] === undefined);
272
+ if (added.length === 0) {
273
+ steps.push({ status: 'skipped', what: 'scripts', note: 'the e2e scripts exist' });
274
+ return;
275
+ }
276
+ for (const k of added)
277
+ scripts[k] = wanted[k];
278
+ pkg.scripts = scripts;
279
+ if (!log.dryRun)
280
+ writeJson(ctx, pkgFile, pkg);
281
+ steps.push({ status: 'updated', what: 'package.json', note: `scripts: ${added.join(', ')}` });
282
+ }
283
+ const ICON = { created: '+', updated: '~', skipped: '=', ran: '$', todo: '!' };
284
+ export function printSteps(ctx, steps) {
285
+ ctx.out('');
286
+ for (const s of steps)
287
+ ctx.out(`${ICON[s.status]} ${s.what}${s.note !== undefined ? ` — ${s.note}` : ''}`);
288
+ }
289
+ //# sourceMappingURL=setup-steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-steps.js","sourceRoot":"","sources":["../src/setup-steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAwCnE,qGAAqG;AACrG,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;AAC7D,wCAAwC;AACxC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AACnH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AACtD,gGAAgG;AAChG,MAAM,UAAU,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAEzC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAE1G,MAAM,UAAU,QAAQ,CAAI,GAAe,EAAE,IAAY;IACvD,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,O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AAI,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiesco",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Quiesco command line: init, test (with a progress bar), ui, list, doctor, tree",
5
5
  "license": "MIT",
6
6
  "author": "h2nology",
@@ -44,7 +44,7 @@
44
44
  "src"
45
45
  ],
46
46
  "dependencies": {
47
- "@quiesco/core": "0.4.0"
47
+ "@quiesco/core": "0.4.1"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsc -b",
package/src/cli.ts CHANGED
@@ -16,6 +16,8 @@ export const HELP = `Usage: quiesco <command> [options]
16
16
  Commands:
17
17
  init Set Quiesco up in this Expo project (dependencies, config plugin, Metro, entry, config, features)
18
18
  --platforms ios,android,web --packages <dir> (install from tarballs) --skip-install
19
+ --upgrade: bring a project set up by an older version to this one (packages, config, files)
20
+ --dry-run (list the changes only)
19
21
  build Build the app for e2e tests (prebuild + xcodebuild / gradle) into apps.<platform>.binaryPath
20
22
  ios|android --force (also when the native inputs did not change)
21
23
  test Run the tests with cucumber-js (or --runner jest|vitest); other arguments go to the runner unchanged