fix(js): handle empty objects for migration to remove deprecated buil… (#19996)
This commit is contained in:
parent
41f276b84e
commit
61ad9c3d21
@ -53,6 +53,17 @@ describe('remove-deprecated-build-options', () => {
|
|||||||
await expect(migration(tree)).resolves.not.toThrow();
|
await expect(migration(tree)).resolves.not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should work if a target is an empty object', async () => {
|
||||||
|
addProjectConfiguration(tree, 'proj', {
|
||||||
|
root: 'proj',
|
||||||
|
targets: {
|
||||||
|
build: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await expect(migration(tree)).resolves.not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it('should not update community executors', async () => {
|
it('should not update community executors', async () => {
|
||||||
addProjectConfiguration(tree, 'proj', {
|
addProjectConfiguration(tree, 'proj', {
|
||||||
root: 'proj',
|
root: 'proj',
|
||||||
|
|||||||
@ -19,7 +19,8 @@ export default async function (tree: Tree) {
|
|||||||
|
|
||||||
for (const target of Object.values(projectConfig.targets)) {
|
for (const target of Object.values(projectConfig.targets)) {
|
||||||
if (
|
if (
|
||||||
target.executor.startsWith('@nx/') &&
|
target.executor?.startsWith('@nx/') &&
|
||||||
|
target.options &&
|
||||||
('buildableProjectDepsInPackageJsonType' in target.options ||
|
('buildableProjectDepsInPackageJsonType' in target.options ||
|
||||||
'updateBuildableProjectDepsInPackageJson' in target.options)
|
'updateBuildableProjectDepsInPackageJson' in target.options)
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user