Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): update error message #2571

Merged
merged 1 commit into from
Dec 4, 2024
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: 2 additions & 0 deletions .changeset/grumpy-bulldogs-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ${
path.join(target, 'embedded', toSuppress, 'index.js'),
`
throw new Error(
'The package "${toSuppress}" has been marked as a native module and removed from this dynamic plugin package "${derivedPackageName}"'
'The package "${toSuppress}" has been marked as a native module and removed from this dynamic plugin package "${derivedPackageName}", as native modules are not currently supported by dynamic plugins'
);`,
);
}
Expand Down Expand Up @@ -233,11 +233,15 @@ throw new Error(
})(path.join(embeddedDestDir, 'package.json'));
}

const embeddedDependenciesResolutions: { [key: string]: any } = {};
embeddedResolvedPackages.map(ep => {
embeddedDependenciesResolutions[ep.packageName] =
`file:./${embeddedPackageRelativePath(ep)}`;
});
const embeddedDependenciesResolutions = embeddedResolvedPackages.reduce(
(resolutions, embeddedPkg) => ({
...resolutions,
...{
[embeddedPkg.packageName]: `file:./${embeddedPackageRelativePath(embeddedPkg)}`,
},
}),
{},
);

if (opts.build) {
Task.log(`Building main package`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ export function addToMainDependencies(
Task.log(
`The version of a dependency ('${dep}') of an embedded module differs from the main module's dependencies: '${dependenciesToAdd[dep]}', '${existingVersion}': keeping it as it is compatible`,
);
continue;
}
if (ignoreVersionCheck.includes(dep)) {
Task.log(
`The version of a dependency ('${dep}') of an embedded module conflicts with the main module's dependencies: '${dependenciesToAdd[dep]}', '${existingVersion}': however this has been overridden`,
);
} else {
if (!ignoreVersionCheck.includes(dep)) {
throw new Error(
`The version of a dependency ('${dep}') of an embedded module conflicts with main module dependencies: '${dependenciesToAdd[dep]}', '${existingVersion}': cannot proceed!`,
);
} else {
Task.log(
`The version of a dependency ('${dep}') of an embedded module conflicts with the main module's dependencies: '${dependenciesToAdd[dep]}', '${existingVersion}': however this has been overridden`,
);
}
throw new Error(
`The version of a dependency ('${dep}') of an embedded module conflicts with main module dependencies: '${dependenciesToAdd[dep]}', '${existingVersion}': cannot proceed!`,
);
}
}
}
Expand Down
Loading