Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/eas-cli/src/commands/preview/go.ts
Original file line number Diff line number Diff line change
@@ -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);
}
}
21 changes: 21 additions & 0 deletions packages/eas-cli/src/utils/expodash/__tests__/omit-test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
10 changes: 10 additions & 0 deletions packages/eas-cli/src/utils/expodash/omit.ts
Original file line number Diff line number Diff line change
@@ -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>;
}
Loading