Compare commits

...
Author SHA1 Message Date
Will Schurman 9b3e3c85d2 [eas-cli] Add eas preview:go command 2026-01-27 06:09:11 +00:00
3 changed files with 53 additions and 0 deletions

No files matched your search

@@ -0,0 +1,22 @@
import EasCommand from '../../commandUtils/EasCommand';
import omit from '../../utils/expodash/omit';
import UpdatePublish from '../update';
export default class PreviewGo extends EasCommand {
static override description = 'Publish an update that is compatible with Expo Go';
static override flags = omit(UpdatePublish.flags, ['source-maps', 'no-bytecode']);
static override args = UpdatePublish.args;
static override contextDefinition = UpdatePublish.contextDefinition;
static override hidden = true; // hidden for now until feature is settled
override async runAsync(): Promise<void> {
await this.parse(PreviewGo); // validation only
const newArgv = [...this.argv, '--source-maps', 'inline', '--no-bytecode'];
await UpdatePublish.run(newArgv, this.config);
}
}
@@ -0,0 +1,21 @@
import omit from '../omit';
describe(omit, () => {
it('omits specified keys from an object', () => {
const original = { a: 1, b: 2, c: 3 };
const result = omit(original, ['b', 'c']);
expect(result).toEqual({ a: 1 });
});
it('returns the same object if no keys are specified', () => {
const original = { a: 1, b: 2, c: 3 };
const result = omit(original, []);
expect(result).toEqual(original);
});
it('handles non-existent keys gracefully', () => {
const original = { a: 1, b: 2, c: 3 };
const result = omit(original, ['d', 'e'] as any);
expect(result).toEqual(original);
});
});
@@ -0,0 +1,10 @@
export default function omit<T extends object, K extends keyof T>(
obj: T,
keys: readonly K[]
): Omit<T, K> {
const newObj = { ...obj };
for (const key of keys) {
delete newObj[key];
}
return newObj as Omit<T, K>;
}