Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/expo/bundledNativeModules.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@
"unimodules-image-loader-interface": "~6.1.0",
"@shopify/react-native-skia": "2.4.14",
"@shopify/flash-list": "2.0.2",
"@sentry/react-native": "~7.2.0",
"@sentry/react-native": "~7.10.0",
"react-native-bootsplash": "^6.3.10"
}
28 changes: 21 additions & 7 deletions tools/src/publish-packages/tasks/selectPackagesToPublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const selectPackagesToPublish = new Task<TaskArgs>(
// From the dependents select these that should be published too.
const selectedDependentNodes = options.templatesOnly
? []
: await promptForDependentNodes([...dependentNodes]);
: await promptForDependentNodes([...dependentNodes], parcelsToPublish);

logger.log();

Expand Down Expand Up @@ -418,23 +418,37 @@ async function selectParcelsToPublish(

/**
* Asks whether to publish the dependents of the requested packages.
* Shows which dependencies are being updated for each dependent.
*/
async function promptForDependentNodes(nodes: PackagesGraphNode[]): Promise<PackagesGraphNode[]> {
async function promptForDependentNodes(
nodes: PackagesGraphNode[],
parcelsToPublish: Set<Parcel>
): Promise<PackagesGraphNode[]> {
if (nodes.length === 0) {
return [];
}

// Get names of packages being published
const publishingPackageNames = new Set([...parcelsToPublish].map((p) => p.pkg.packageName));

const { dependents } = await inquirer.prompt([
{
type: 'checkbox',
name: 'dependents',
message: `Found some dependents that you may want to publish as well, select which ones:\n`,
message: `These packages depend on packages being published.\nPublish them to update their dependency versions on npm:\n`,
choices: nodes.map((node) => {
// Find which dependencies of this node are being published
const updatedDeps = node.outgoingEdges
.filter((edge) => publishingPackageNames.has(edge.destination.name))
.map((edge) => edge.destination.name);

const depsInfo = updatedDeps.length > 0 ? ` ${cyan(`(${updatedDeps.join(', ')})`)}` : '';

return {
name: node.name,
name: `${node.name}${depsInfo}`,
value: node,
// `expo` package is the one we often want to publish as a dependent,
// so make it checked by default.
checked: node.name === 'expo',
// Check by default if it has dependencies being published
checked: updatedDeps.length > 0,
};
}),
},
Expand Down
Loading