mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 17:50:32 -10:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a669bccb0 | ||
|
|
d33cfaba67 | ||
|
|
7363164889 |
No files matched your search
@@ -8,6 +8,8 @@ This is the log of notable changes to EAS CLI and related packages.
|
|||||||
|
|
||||||
### 🎉 New features
|
### 🎉 New features
|
||||||
|
|
||||||
|
- Add --no-channel flag for update and rollback to embedded. ([#2339](https://github.com/expo/eas-cli/pull/2339) by [@quinlanj](https://github.com/quinlanj))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
|
||||||
### 🧹 Chores
|
### 🧹 Chores
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { instance, mock } from 'ts-mockito';
|
|||||||
|
|
||||||
import UpdatePublish from '..';
|
import UpdatePublish from '..';
|
||||||
import { ensureBranchExistsAsync } from '../../../branch/queries';
|
import { ensureBranchExistsAsync } from '../../../branch/queries';
|
||||||
|
import { ensureChannelExistsAsync } from '../../../channel/queries';
|
||||||
import {
|
import {
|
||||||
DynamicPrivateProjectConfigContextField,
|
DynamicPrivateProjectConfigContextField,
|
||||||
DynamicPublicProjectConfigContextField,
|
DynamicPublicProjectConfigContextField,
|
||||||
@@ -45,6 +46,7 @@ jest.mock('fs');
|
|||||||
jest.mock('@expo/config');
|
jest.mock('@expo/config');
|
||||||
jest.mock('@expo/config-plugins');
|
jest.mock('@expo/config-plugins');
|
||||||
jest.mock('../../../branch/queries');
|
jest.mock('../../../branch/queries');
|
||||||
|
jest.mock('../../../channel/queries');
|
||||||
jest.mock('../../../commandUtils/context/contextUtils/getProjectIdAsync');
|
jest.mock('../../../commandUtils/context/contextUtils/getProjectIdAsync');
|
||||||
jest.mock('../../../update/configure');
|
jest.mock('../../../update/configure');
|
||||||
jest.mock('../../../update/getBranchNameFromChannelNameAsync');
|
jest.mock('../../../update/getBranchNameFromChannelNameAsync');
|
||||||
@@ -94,6 +96,16 @@ describe(UpdatePublish.name, () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('errors with both --channel and --no-channel', async () => {
|
||||||
|
const flags = ['--channel=channel123', '--no-channel'];
|
||||||
|
|
||||||
|
mockTestProject();
|
||||||
|
|
||||||
|
await expect(new UpdatePublish(flags, commandOptions).run()).rejects.toThrow(
|
||||||
|
'Cannot use --channel with --no-channel'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('creates a new update with --non-interactive, --branch, and --message', async () => {
|
it('creates a new update with --non-interactive, --branch, and --message', async () => {
|
||||||
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
||||||
|
|
||||||
@@ -147,6 +159,31 @@ describe(UpdatePublish.name, () => {
|
|||||||
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('creates a new update with --no-channel', async () => {
|
||||||
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc', '--no-channel'];
|
||||||
|
|
||||||
|
const { platforms, runtimeVersion } = mockTestExport();
|
||||||
|
|
||||||
|
jest.mocked(getBranchNameFromChannelNameAsync).mockResolvedValue('branchFromChannel');
|
||||||
|
jest.mocked(ensureBranchExistsAsync).mockResolvedValue({
|
||||||
|
branchId: 'branch123',
|
||||||
|
createdBranch: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
jest.mocked(PublishMutation.publishUpdateGroupAsync).mockResolvedValue(
|
||||||
|
platforms.map(platform => ({
|
||||||
|
...updateStub,
|
||||||
|
runtimeVersion,
|
||||||
|
platform,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
await new UpdatePublish(flags, commandOptions).run();
|
||||||
|
|
||||||
|
expect(ensureChannelExistsAsync).not.toHaveBeenCalled();
|
||||||
|
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
it('creates a new update with the public expo config', async () => {
|
it('creates a new update with the public expo config', async () => {
|
||||||
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import path from 'path';
|
|||||||
import { instance, mock } from 'ts-mockito';
|
import { instance, mock } from 'ts-mockito';
|
||||||
|
|
||||||
import { ensureBranchExistsAsync } from '../../../branch/queries';
|
import { ensureBranchExistsAsync } from '../../../branch/queries';
|
||||||
|
import { ensureChannelExistsAsync } from '../../../channel/queries';
|
||||||
import {
|
import {
|
||||||
DynamicPrivateProjectConfigContextField,
|
DynamicPrivateProjectConfigContextField,
|
||||||
DynamicPublicProjectConfigContextField,
|
DynamicPublicProjectConfigContextField,
|
||||||
@@ -44,6 +45,7 @@ jest.mock('fs');
|
|||||||
jest.mock('@expo/config');
|
jest.mock('@expo/config');
|
||||||
jest.mock('@expo/config-plugins');
|
jest.mock('@expo/config-plugins');
|
||||||
jest.mock('../../../branch/queries');
|
jest.mock('../../../branch/queries');
|
||||||
|
jest.mock('../../../channel/queries');
|
||||||
jest.mock('../../../commandUtils/context/contextUtils/getProjectIdAsync');
|
jest.mock('../../../commandUtils/context/contextUtils/getProjectIdAsync');
|
||||||
jest.mock('../../../project/projectUtils', () => ({
|
jest.mock('../../../project/projectUtils', () => ({
|
||||||
...jest.requireActual('../../../project/projectUtils'),
|
...jest.requireActual('../../../project/projectUtils'),
|
||||||
@@ -80,6 +82,16 @@ describe(UpdateRollBackToEmbedded.name, () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('errors with both --channel and --no-channel', async () => {
|
||||||
|
const flags = ['--channel=channel123', '--no-channel'];
|
||||||
|
|
||||||
|
mockTestProject();
|
||||||
|
|
||||||
|
await expect(new UpdateRollBackToEmbedded(flags, commandOptions).run()).rejects.toThrow(
|
||||||
|
'Cannot use --channel with --no-channel'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('creates a roll back to embedded with --non-interactive, --branch, and --message', async () => {
|
it('creates a roll back to embedded with --non-interactive, --branch, and --message', async () => {
|
||||||
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
||||||
|
|
||||||
@@ -137,6 +149,42 @@ describe(UpdateRollBackToEmbedded.name, () => {
|
|||||||
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('creates a roll back to embedded with --no-channel', async () => {
|
||||||
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc', '--no-channel'];
|
||||||
|
|
||||||
|
const { projectId } = mockTestProject();
|
||||||
|
const platforms = ['android', 'ios'];
|
||||||
|
const runtimeVersion = 'exposdk:47.0.0';
|
||||||
|
jest.mocked(Updates.getRuntimeVersionAsync).mockResolvedValue(runtimeVersion);
|
||||||
|
|
||||||
|
jest.mocked(getBranchNameFromChannelNameAsync).mockResolvedValue('branchFromChannel');
|
||||||
|
jest.mocked(ensureBranchExistsAsync).mockResolvedValue({
|
||||||
|
branchId: 'branch123',
|
||||||
|
createdBranch: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
jest.mocked(PublishMutation.publishUpdateGroupAsync).mockResolvedValue(
|
||||||
|
platforms.map(platform => ({
|
||||||
|
...updateStub,
|
||||||
|
runtimeVersion,
|
||||||
|
platform,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
await new UpdateRollBackToEmbedded(flags, commandOptions).run();
|
||||||
|
|
||||||
|
expect(ensureChannelExistsAsync).not.toHaveBeenCalled();
|
||||||
|
expect(ensureBranchExistsAsync).toHaveBeenCalledWith(
|
||||||
|
expect.any(Object), // graphql client
|
||||||
|
{
|
||||||
|
appId: projectId,
|
||||||
|
branchName: 'branchFromChannel',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(PublishMutation.publishUpdateGroupAsync).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
it('creates a roll back to embedded with the public expo config', async () => {
|
it('creates a roll back to embedded with the public expo config', async () => {
|
||||||
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
const flags = ['--non-interactive', '--branch=branch123', '--message=abc'];
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ type RawUpdateFlags = {
|
|||||||
'skip-bundler': boolean;
|
'skip-bundler': boolean;
|
||||||
'clear-cache': boolean;
|
'clear-cache': boolean;
|
||||||
'private-key-path'?: string;
|
'private-key-path'?: string;
|
||||||
|
'no-channel': boolean;
|
||||||
'non-interactive': boolean;
|
'non-interactive': boolean;
|
||||||
json: boolean;
|
json: boolean;
|
||||||
/** @deprecated see UpdateRepublish command */
|
/** @deprecated see UpdateRepublish command */
|
||||||
@@ -81,6 +82,7 @@ type UpdateFlags = {
|
|||||||
inputDir: string;
|
inputDir: string;
|
||||||
skipBundler: boolean;
|
skipBundler: boolean;
|
||||||
clearCache: boolean;
|
clearCache: boolean;
|
||||||
|
noChannel: boolean;
|
||||||
privateKeyPath?: string;
|
privateKeyPath?: string;
|
||||||
json: boolean;
|
json: boolean;
|
||||||
nonInteractive: boolean;
|
nonInteractive: boolean;
|
||||||
@@ -143,6 +145,10 @@ export default class UpdatePublish extends EasCommand {
|
|||||||
description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
|
description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
|
||||||
required: false,
|
required: false,
|
||||||
}),
|
}),
|
||||||
|
'no-channel': Flags.boolean({
|
||||||
|
description: `Skip EAS channel creation.`,
|
||||||
|
default: false,
|
||||||
|
}),
|
||||||
...EasNonInteractiveAndJsonFlags,
|
...EasNonInteractiveAndJsonFlags,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -164,6 +170,7 @@ export default class UpdatePublish extends EasCommand {
|
|||||||
skipBundler,
|
skipBundler,
|
||||||
clearCache,
|
clearCache,
|
||||||
privateKeyPath,
|
privateKeyPath,
|
||||||
|
noChannel: noChannelFlag,
|
||||||
json: jsonFlag,
|
json: jsonFlag,
|
||||||
nonInteractive,
|
nonInteractive,
|
||||||
branchName: branchNameArg,
|
branchName: branchNameArg,
|
||||||
@@ -372,7 +379,7 @@ export default class UpdatePublish extends EasCommand {
|
|||||||
appId: projectId,
|
appId: projectId,
|
||||||
branchName,
|
branchName,
|
||||||
});
|
});
|
||||||
if (createdBranch) {
|
if (createdBranch && !noChannelFlag) {
|
||||||
await ensureChannelExistsAsync(graphqlClient, {
|
await ensureChannelExistsAsync(graphqlClient, {
|
||||||
appId: projectId,
|
appId: projectId,
|
||||||
branchId,
|
branchId,
|
||||||
@@ -548,6 +555,10 @@ export default class UpdatePublish extends EasCommand {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channelName && flags['no-channel']) {
|
||||||
|
Errors.error('Cannot use --channel with --no-channel', { exit: 1 });
|
||||||
|
}
|
||||||
|
|
||||||
if (flags.group || flags.republish) {
|
if (flags.group || flags.republish) {
|
||||||
// Pick the first flag set that is defined, in this specific order
|
// Pick the first flag set that is defined, in this specific order
|
||||||
const args = [
|
const args = [
|
||||||
@@ -575,6 +586,7 @@ export default class UpdatePublish extends EasCommand {
|
|||||||
clearCache: flags['clear-cache'],
|
clearCache: flags['clear-cache'],
|
||||||
platform: flags.platform as RequestedPlatform,
|
platform: flags.platform as RequestedPlatform,
|
||||||
privateKeyPath: flags['private-key-path'],
|
privateKeyPath: flags['private-key-path'],
|
||||||
|
noChannel: flags['no-channel'],
|
||||||
nonInteractive,
|
nonInteractive,
|
||||||
json: flags.json ?? false,
|
json: flags.json ?? false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ type RawUpdateFlags = {
|
|||||||
message?: string;
|
message?: string;
|
||||||
platform: string;
|
platform: string;
|
||||||
'private-key-path'?: string;
|
'private-key-path'?: string;
|
||||||
|
'no-channel': boolean;
|
||||||
'non-interactive': boolean;
|
'non-interactive': boolean;
|
||||||
json: boolean;
|
json: boolean;
|
||||||
};
|
};
|
||||||
@@ -65,6 +66,7 @@ type UpdateFlags = {
|
|||||||
channelName?: string;
|
channelName?: string;
|
||||||
updateMessage?: string;
|
updateMessage?: string;
|
||||||
privateKeyPath?: string;
|
privateKeyPath?: string;
|
||||||
|
noChannel: boolean;
|
||||||
json: boolean;
|
json: boolean;
|
||||||
nonInteractive: boolean;
|
nonInteractive: boolean;
|
||||||
};
|
};
|
||||||
@@ -104,6 +106,10 @@ export default class UpdateRollBackToEmbedded extends EasCommand {
|
|||||||
description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
|
description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
|
||||||
required: false,
|
required: false,
|
||||||
}),
|
}),
|
||||||
|
'no-channel': Flags.boolean({
|
||||||
|
description: `Skip EAS channel creation.`,
|
||||||
|
default: false,
|
||||||
|
}),
|
||||||
...EasNonInteractiveAndJsonFlags,
|
...EasNonInteractiveAndJsonFlags,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,6 +128,7 @@ export default class UpdateRollBackToEmbedded extends EasCommand {
|
|||||||
channelName: channelNameArg,
|
channelName: channelNameArg,
|
||||||
updateMessage: updateMessageArg,
|
updateMessage: updateMessageArg,
|
||||||
privateKeyPath,
|
privateKeyPath,
|
||||||
|
noChannel: noChannelFlag,
|
||||||
json: jsonFlag,
|
json: jsonFlag,
|
||||||
nonInteractive,
|
nonInteractive,
|
||||||
branchName: branchNameArg,
|
branchName: branchNameArg,
|
||||||
@@ -188,16 +195,17 @@ export default class UpdateRollBackToEmbedded extends EasCommand {
|
|||||||
appId: projectId,
|
appId: projectId,
|
||||||
branchName,
|
branchName,
|
||||||
});
|
});
|
||||||
if (createdBranch) {
|
if (createdBranch && !noChannelFlag) {
|
||||||
await ensureChannelExistsAsync(graphqlClient, {
|
await ensureChannelExistsAsync(graphqlClient, {
|
||||||
appId: projectId,
|
appId: projectId,
|
||||||
branchId,
|
branchId,
|
||||||
channelName: branchName,
|
channelName: branchName,
|
||||||
});
|
});
|
||||||
|
Log.withTick(
|
||||||
|
`Channel: ${chalk.bold(branchName)} pointed at branch: ${chalk.bold(branchName)}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.withTick(`Channel: ${chalk.bold(branchName)} pointed at branch: ${chalk.bold(branchName)}`);
|
|
||||||
|
|
||||||
const gitCommitHash = await vcsClient.getCommitHashAsync();
|
const gitCommitHash = await vcsClient.getCommitHashAsync();
|
||||||
const isGitWorkingTreeDirty = await vcsClient.hasUncommittedChangesAsync();
|
const isGitWorkingTreeDirty = await vcsClient.hasUncommittedChangesAsync();
|
||||||
|
|
||||||
@@ -387,6 +395,10 @@ export default class UpdateRollBackToEmbedded extends EasCommand {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channelName && flags['no-channel']) {
|
||||||
|
Errors.error('Cannot use --channel with --no-channel', { exit: 1 });
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
auto,
|
auto,
|
||||||
branchName,
|
branchName,
|
||||||
@@ -394,6 +406,7 @@ export default class UpdateRollBackToEmbedded extends EasCommand {
|
|||||||
updateMessage,
|
updateMessage,
|
||||||
platform: flags.platform as RequestedPlatform,
|
platform: flags.platform as RequestedPlatform,
|
||||||
privateKeyPath: flags['private-key-path'],
|
privateKeyPath: flags['private-key-path'],
|
||||||
|
noChannel: flags['no-channel'],
|
||||||
nonInteractive,
|
nonInteractive,
|
||||||
json: flags.json ?? false,
|
json: flags.json ?? false,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user