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

Remove target name modules #291

Merged
merged 1 commit into from
Jan 11, 2025
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
5 changes: 5 additions & 0 deletions .changeset/calm-fireants-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inversifyjs/core": major
---

Removed `MetadataTargetName`
5 changes: 5 additions & 0 deletions .changeset/orange-carrots-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inversifyjs/core": major
---

Updated `ManagedClassElementMetadata` with no `targetName`
5 changes: 5 additions & 0 deletions .changeset/tender-chairs-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inversifyjs/core": major
---

Updated `MaybeManagedClassElementMetadata` with no `targetName`
5 changes: 5 additions & 0 deletions .changeset/warm-candles-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inversifyjs/core": major
---

Removed `targetName`
4 changes: 0 additions & 4 deletions packages/container/libraries/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { optional } from './metadata/decorators/optional';
import { postConstruct } from './metadata/decorators/postConstruct';
import { preDestroy } from './metadata/decorators/preDestroy';
import { tagged } from './metadata/decorators/tagged';
import { targetName } from './metadata/decorators/targetName';
import { unmanaged } from './metadata/decorators/unmanaged';
import { ClassElementMetadata } from './metadata/models/ClassElementMetadata';
import { ClassElementMetadataKind } from './metadata/models/ClassElementMetadataKind';
Expand All @@ -47,7 +46,6 @@ import { ClassMetadataLifecycle } from './metadata/models/ClassMetadataLifecycle
import { ManagedClassElementMetadata } from './metadata/models/ManagedClassElementMetadata';
import { MetadataName } from './metadata/models/MetadataName';
import { MetadataTag } from './metadata/models/MetadataTag';
import { MetadataTargetName } from './metadata/models/MetadataTargetName';
import { UnmanagedClassElementMetadata } from './metadata/models/UnmanagedClassElementMetadata';
import { plan } from './planning/calculations/plan';
import { BaseBindingNode } from './planning/models/BaseBindingNode';
Expand Down Expand Up @@ -101,7 +99,6 @@ export type {
ManagedClassElementMetadata,
MetadataName,
MetadataTag,
MetadataTargetName,
OptionalGetOptions,
PlanBindingNode,
PlanParams,
Expand Down Expand Up @@ -144,6 +141,5 @@ export {
resolveModuleDeactivations,
resolveServiceDeactivations,
tagged,
targetName,
unmanaged,
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe(decrementPendingClassMetadataCount.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe(updateMaybeClassMetadataConstructorArgument.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: Symbol(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe(updateMaybeClassMetadataProperty.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: Symbol(),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ describe(updateMetadataName.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: 'service-id',
};
nameFixture = 'name-fixture';
Expand Down Expand Up @@ -59,7 +58,6 @@ describe(updateMetadataName.name, () => {
name: 'name-fixture',
optional: false,
tags: new Map(),
targetName: undefined,
value: 'service-id',
};
nameFixture = 'name-fixture';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe(updateMetadataOptional.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: 'service-id',
};
});
Expand Down Expand Up @@ -55,7 +54,6 @@ describe(updateMetadataOptional.name, () => {
name: undefined,
optional: true,
tags: new Map(),
targetName: undefined,
value: 'service-id',
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ describe(updateMetadataTag.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: 'service-id',
};
keyFixture = 'tag-fixture';
Expand Down Expand Up @@ -62,7 +61,6 @@ describe(updateMetadataTag.name, () => {
name: undefined,
optional: false,
tags: new Map([['tag-fixture', Symbol()]]),
targetName: undefined,
value: 'service-id',
};
keyFixture = 'tag-fixture';
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe(buildClassElementMetadataFromMaybeClassElementMetadata.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe(buildClassElementMetadataFromTypescriptParameterType.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: typeFixture,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function buildClassElementMetadataFromTypescriptParameterType(
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: type,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ describe(buildDefaultManagedMetadata.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: serviceIdentifierFixture,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function buildDefaultManagedMetadata(
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
value: serviceIdentifier,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe(buildDefaultMaybeClassElementMetadata.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};

expect(result).toStrictEqual(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export function buildDefaultMaybeClassElementMetadata(): MaybeManagedClassElemen
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ describe(buildManagedMetadataFromMaybeManagedMetadata.name, () => {
name: 'name-fixture',
optional: true,
tags: new Map(),
targetName: 'target-name-fixture',
};

kindFixture = ClassElementMetadataKind.singleInjection;
Expand Down Expand Up @@ -57,7 +56,6 @@ describe(buildManagedMetadataFromMaybeManagedMetadata.name, () => {
name: metadataFixture.name,
optional: metadataFixture.optional,
tags: metadataFixture.tags,
targetName: metadataFixture.targetName,
value: serviceIdentifierFixture,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ describe(
name: undefined,
optional: false,
tags: new Map([['foo', 'bar']]),
targetName: undefined,
value: 'service-identifier',
};
updateMetadataMock = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ describe(buildUnmanagedMetadataFromMaybeManagedMetadata.name, () => {
name: 'name-fixture',
optional: false,
tags: new Map(),
targetName: undefined,
},
],
[
Expand All @@ -32,7 +31,6 @@ describe(buildUnmanagedMetadataFromMaybeManagedMetadata.name, () => {
name: undefined,
optional: true,
tags: new Map(),
targetName: undefined,
},
],
[
Expand All @@ -42,17 +40,6 @@ describe(buildUnmanagedMetadataFromMaybeManagedMetadata.name, () => {
name: undefined,
optional: false,
tags: new Map([['foo', 'bar']]),
targetName: undefined,
},
],
[
'with targetName',
{
kind: MaybeClassElementMetadataKind.unknown,
name: undefined,
optional: false,
tags: new Map(),
targetName: 'target-name-fixture',
},
],
])(
Expand Down Expand Up @@ -112,7 +99,6 @@ describe(buildUnmanagedMetadataFromMaybeManagedMetadata.name, () => {
name: undefined,
optional: false,
tags: new Map(),
targetName: undefined,
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ function hasManagedMetadata(
metadata: MaybeManagedClassElementMetadata | ManagedClassElementMetadata,
): boolean {
return (
metadata.name !== undefined ||
metadata.optional ||
metadata.tags.size > 0 ||
metadata.targetName !== undefined
metadata.name !== undefined || metadata.optional || metadata.tags.size > 0
);
}
Loading
Loading