Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[publish] silence workflow warning in 41 (#3249)
Browse files Browse the repository at this point in the history
* Silence workflow warning in SDK 41

* Update publish.ts

* use better bullet

* Update publish.ts
  • Loading branch information
EvanBacon authored Feb 22, 2021
1 parent d078b35 commit fedc413
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions packages/expo-cli/src/commands/publish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { getConfig, getDefaultTarget, PackageJSONConfig, ProjectTarget } from '@expo/config';
import {
getConfig,
getDefaultTarget,
isLegacyImportsEnabled,
PackageJSONConfig,
ProjectTarget,
} from '@expo/config';
import simpleSpinner from '@expo/simple-spinner';
import { Project, UserManager } from '@expo/xdl';
import chalk from 'chalk';
Expand Down Expand Up @@ -26,17 +32,17 @@ type Options = {
};

export async function action(
projectDir: string,
projectRoot: string,
options: Options = {}
): Promise<Project.PublishedProjectResult> {
assertValidReleaseChannel(options.releaseChannel);

const { exp, pkg } = getConfig(projectDir, {
const { exp, pkg } = getConfig(projectRoot, {
skipSDKVersionRequirement: true,
});
const { sdkVersion, isDetached } = exp;

const target = options.target ?? getDefaultTarget(projectDir);
const target = options.target ?? getDefaultTarget(projectRoot);

// note: this validates the exp.owner when the user is a robot
const user = await UserManager.ensureLoggedInAsync();
Expand All @@ -47,13 +53,13 @@ export async function action(
// Log building info before building.
// This gives the user sometime to bail out if the info is unexpected.

if (sdkVersion && target === 'managed') {
Log.log(`- Expo SDK: ${Log.chalk.bold(exp.sdkVersion)}`);
if (sdkVersion) {
Log.log(`\u203A Expo SDK: ${Log.chalk.bold(exp.sdkVersion)}`);
}
Log.log(`- Release channel: ${Log.chalk.bold(options.releaseChannel)}`);
Log.log(`- Workflow: ${Log.chalk.bold(target.replace(/\b\w/g, l => l.toUpperCase()))}`);
Log.log(`\u203A Release channel: ${Log.chalk.bold(options.releaseChannel)}`);
Log.log(`\u203A Workflow: ${Log.chalk.bold(target.replace(/\b\w/g, l => l.toUpperCase()))}`);
if (user.kind === 'robot') {
Log.log(`- Owner: ${Log.chalk.bold(owner)}`);
Log.log(`\u203A Owner: ${Log.chalk.bold(owner)}`);
}

Log.newLine();
Expand All @@ -63,17 +69,17 @@ export async function action(
if (!isDetached && !options.duringBuild) {
// Check for SDK version and release channel mismatches only after displaying the values.
await logSDKMismatchWarningsAsync({
projectRoot: projectDir,
projectRoot,
releaseChannel: options.releaseChannel,
sdkVersion,
});
}

logExpoUpdatesWarnings(pkg);

logOptimizeWarnings({ projectRoot: projectDir });
logOptimizeWarnings({ projectRoot });

if (!options.target && target === 'bare') {
if (!options.target && target === 'bare' && isLegacyImportsEnabled(exp)) {
logBareWorkflowWarnings(pkg);
}

Expand All @@ -87,7 +93,7 @@ export async function action(
simpleSpinner.start();
}

const result = await Project.publishAsync(projectDir, {
const result = await Project.publishAsync(projectRoot, {
releaseChannel: options.releaseChannel,
quiet: options.quiet,
target,
Expand Down

0 comments on commit fedc413

Please sign in to comment.