From 1069d4e0ef2f9e6dc78fc8cab5122f60522d7343 Mon Sep 17 00:00:00 2001 From: David LJ Date: Tue, 29 Oct 2024 17:08:47 +0100 Subject: [PATCH] refactor: hide JSON-LD provider, switch to `Provider` around --- projects/ngx-meta/api-extractor/ngx-meta.api.md | 13 +++++-------- projects/ngx-meta/src/json-ld/index.ts | 1 - projects/ngx-meta/src/json-ld/src/managers/index.ts | 1 - .../src/providers/ngx-meta-json-ld.module.ts | 2 +- .../src/providers/provide-ngx-meta-json-ld.ts | 4 ++-- .../src/json-ld/src/types/json-ld-metadata.ts | 2 +- .../providers/ngx-meta-open-graph.module.ts | 2 +- .../providers/provide-ngx-meta-open-graph.ts | 2 +- .../providers/ngx-meta-open-graph-profile.module.ts | 2 +- .../provide-ngx-meta-open-graph-profile.ts | 2 +- .../src/providers/ngx-meta-standard.module.ts | 2 +- .../src/providers/provide-ngx-meta-standard.ts | 2 +- .../src/providers/ngx-meta-twitter-card.module.ts | 2 +- .../src/providers/provide-ngx-meta-twitter-card.ts | 2 +- 14 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 projects/ngx-meta/src/json-ld/src/managers/index.ts diff --git a/projects/ngx-meta/api-extractor/ngx-meta.api.md b/projects/ngx-meta/api-extractor/ngx-meta.api.md index e223d721..887bd89c 100644 --- a/projects/ngx-meta/api-extractor/ngx-meta.api.md +++ b/projects/ngx-meta/api-extractor/ngx-meta.api.md @@ -377,14 +377,11 @@ export type OpenGraphProfileGender = typeof OPEN_GRAPH_PROFILE_GENDER_FEMALE | t // @public export type OpenGraphType = typeof OPEN_GRAPH_TYPE_MUSIC_SONG | typeof OPEN_GRAPH_TYPE_MUSIC_ALBUM | typeof OPEN_GRAPH_TYPE_MUSIC_PLAYLIST | typeof OPEN_GRAPH_TYPE_MUSIC_RADIO_STATION | typeof OPEN_GRAPH_TYPE_VIDEO_MOVIE | typeof OPEN_GRAPH_TYPE_VIDEO_EPISODE | typeof OPEN_GRAPH_TYPE_VIDEO_TV_SHOW | typeof OPEN_GRAPH_TYPE_VIDEO_OTHER | typeof OPEN_GRAPH_TYPE_ARTICLE | typeof OPEN_GRAPH_TYPE_BOOK | typeof OPEN_GRAPH_TYPE_PROFILE | typeof OPEN_GRAPH_TYPE_WEBSITE; -// @public -export const provideJsonLdInHead: () => Provider; - // @public export const provideNgxMetaCore: (...features: CoreFeatures) => EnvironmentProviders; // @public -export const provideNgxMetaJsonLd: () => Provider[]; +export const provideNgxMetaJsonLd: () => Provider; // Warning: (ae-incompatible-release-tags) The symbol "provideNgxMetaManager" is marked as @public, but its signature references "_ProvideNgxMetaManagerOptions" which is marked as @internal // @@ -415,19 +412,19 @@ export type _ProvideNgxMetaModuleManagerOptions = Partial<{ }> & _ProvideNgxMetaManagerOptions; // @public -export const provideNgxMetaOpenGraph: () => Provider[]; +export const provideNgxMetaOpenGraph: () => Provider; // @public -export const provideNgxMetaOpenGraphProfile: () => Provider[]; +export const provideNgxMetaOpenGraphProfile: () => Provider; // @public export const provideNgxMetaRouting: () => EnvironmentProviders; // @public -export const provideNgxMetaStandard: () => Provider[]; +export const provideNgxMetaStandard: () => Provider; // @public -export const provideNgxMetaTwitterCard: () => Provider[]; +export const provideNgxMetaTwitterCard: () => Provider; // @public export const provideOpenGraphDescription: () => Provider; diff --git a/projects/ngx-meta/src/json-ld/index.ts b/projects/ngx-meta/src/json-ld/index.ts index 9b9e9c18..97493d26 100644 --- a/projects/ngx-meta/src/json-ld/index.ts +++ b/projects/ngx-meta/src/json-ld/index.ts @@ -1,3 +1,2 @@ -export * from './src/managers' export * from './src/types' export * from './src/providers' diff --git a/projects/ngx-meta/src/json-ld/src/managers/index.ts b/projects/ngx-meta/src/json-ld/src/managers/index.ts deleted file mode 100644 index feb8266d..00000000 --- a/projects/ngx-meta/src/json-ld/src/managers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { provideJsonLdInHead } from './provide-json-ld-in-head' diff --git a/projects/ngx-meta/src/json-ld/src/providers/ngx-meta-json-ld.module.ts b/projects/ngx-meta/src/json-ld/src/providers/ngx-meta-json-ld.module.ts index bcafe4da..2bfd6914 100644 --- a/projects/ngx-meta/src/json-ld/src/providers/ngx-meta-json-ld.module.ts +++ b/projects/ngx-meta/src/json-ld/src/providers/ngx-meta-json-ld.module.ts @@ -10,6 +10,6 @@ import { provideNgxMetaJsonLd } from './provide-ngx-meta-json-ld' * @public */ @NgModule({ - providers: provideNgxMetaJsonLd(), + providers: [provideNgxMetaJsonLd()], }) export class NgxMetaJsonLdModule {} diff --git a/projects/ngx-meta/src/json-ld/src/providers/provide-ngx-meta-json-ld.ts b/projects/ngx-meta/src/json-ld/src/providers/provide-ngx-meta-json-ld.ts index 98765eec..2923b620 100644 --- a/projects/ngx-meta/src/json-ld/src/providers/provide-ngx-meta-json-ld.ts +++ b/projects/ngx-meta/src/json-ld/src/providers/provide-ngx-meta-json-ld.ts @@ -1,4 +1,4 @@ -import { provideJsonLdInHead } from '../managers' +import { provideJsonLdInHead } from '../managers/provide-json-ld-in-head' import { Provider } from '@angular/core' /** @@ -12,4 +12,4 @@ import { Provider } from '@angular/core' * * @public */ -export const provideNgxMetaJsonLd = (): Provider[] => [provideJsonLdInHead()] +export const provideNgxMetaJsonLd = (): Provider => [provideJsonLdInHead()] diff --git a/projects/ngx-meta/src/json-ld/src/types/json-ld-metadata.ts b/projects/ngx-meta/src/json-ld/src/types/json-ld-metadata.ts index 33ad12eb..fc570734 100644 --- a/projects/ngx-meta/src/json-ld/src/types/json-ld-metadata.ts +++ b/projects/ngx-meta/src/json-ld/src/types/json-ld-metadata.ts @@ -14,7 +14,7 @@ export interface JsonLdMetadata { * * Provider: * - * {@link provideJsonLdInHead} + * {@link provideNgxMetaJsonLd} */ readonly jsonLd?: object | null } diff --git a/projects/ngx-meta/src/open-graph/src/basic-optional/providers/ngx-meta-open-graph.module.ts b/projects/ngx-meta/src/open-graph/src/basic-optional/providers/ngx-meta-open-graph.module.ts index e47cf9e4..1c736b08 100644 --- a/projects/ngx-meta/src/open-graph/src/basic-optional/providers/ngx-meta-open-graph.module.ts +++ b/projects/ngx-meta/src/open-graph/src/basic-optional/providers/ngx-meta-open-graph.module.ts @@ -10,6 +10,6 @@ import { provideNgxMetaOpenGraph } from './provide-ngx-meta-open-graph' * @public */ @NgModule({ - providers: provideNgxMetaOpenGraph(), + providers: [provideNgxMetaOpenGraph()], }) export class NgxMetaOpenGraphModule {} diff --git a/projects/ngx-meta/src/open-graph/src/basic-optional/providers/provide-ngx-meta-open-graph.ts b/projects/ngx-meta/src/open-graph/src/basic-optional/providers/provide-ngx-meta-open-graph.ts index cda9bf33..7f75abe8 100644 --- a/projects/ngx-meta/src/open-graph/src/basic-optional/providers/provide-ngx-meta-open-graph.ts +++ b/projects/ngx-meta/src/open-graph/src/basic-optional/providers/provide-ngx-meta-open-graph.ts @@ -20,7 +20,7 @@ import { * * @public */ -export const provideNgxMetaOpenGraph = (): Provider[] => [ +export const provideNgxMetaOpenGraph = (): Provider => [ provideOpenGraphTitle(), provideOpenGraphType(), provideOpenGraphImage(), diff --git a/projects/ngx-meta/src/open-graph/src/profile/providers/ngx-meta-open-graph-profile.module.ts b/projects/ngx-meta/src/open-graph/src/profile/providers/ngx-meta-open-graph-profile.module.ts index 6821fec3..146d72b7 100644 --- a/projects/ngx-meta/src/open-graph/src/profile/providers/ngx-meta-open-graph-profile.module.ts +++ b/projects/ngx-meta/src/open-graph/src/profile/providers/ngx-meta-open-graph-profile.module.ts @@ -10,6 +10,6 @@ import { provideNgxMetaOpenGraphProfile } from './provide-ngx-meta-open-graph-pr * @public */ @NgModule({ - providers: provideNgxMetaOpenGraphProfile(), + providers: [provideNgxMetaOpenGraphProfile()], }) export class NgxMetaOpenGraphProfileModule {} diff --git a/projects/ngx-meta/src/open-graph/src/profile/providers/provide-ngx-meta-open-graph-profile.ts b/projects/ngx-meta/src/open-graph/src/profile/providers/provide-ngx-meta-open-graph-profile.ts index 22805451..cb174bde 100644 --- a/projects/ngx-meta/src/open-graph/src/profile/providers/provide-ngx-meta-open-graph-profile.ts +++ b/projects/ngx-meta/src/open-graph/src/profile/providers/provide-ngx-meta-open-graph-profile.ts @@ -17,7 +17,7 @@ import { * * @public */ -export const provideNgxMetaOpenGraphProfile = (): Provider[] => [ +export const provideNgxMetaOpenGraphProfile = (): Provider => [ provideOpenGraphProfileFirstName(), provideOpenGraphProfileLastName(), provideOpenGraphProfileUsername(), diff --git a/projects/ngx-meta/src/standard/src/providers/ngx-meta-standard.module.ts b/projects/ngx-meta/src/standard/src/providers/ngx-meta-standard.module.ts index f32a3a57..3bc64153 100644 --- a/projects/ngx-meta/src/standard/src/providers/ngx-meta-standard.module.ts +++ b/projects/ngx-meta/src/standard/src/providers/ngx-meta-standard.module.ts @@ -10,6 +10,6 @@ import { provideNgxMetaStandard } from './provide-ngx-meta-standard' * @public */ @NgModule({ - providers: provideNgxMetaStandard(), + providers: [provideNgxMetaStandard()], }) export class NgxMetaStandardModule {} diff --git a/projects/ngx-meta/src/standard/src/providers/provide-ngx-meta-standard.ts b/projects/ngx-meta/src/standard/src/providers/provide-ngx-meta-standard.ts index 7a76bfe4..de79672c 100644 --- a/projects/ngx-meta/src/standard/src/providers/provide-ngx-meta-standard.ts +++ b/projects/ngx-meta/src/standard/src/providers/provide-ngx-meta-standard.ts @@ -22,7 +22,7 @@ import { * * @public */ -export const provideNgxMetaStandard = (): Provider[] => [ +export const provideNgxMetaStandard = (): Provider => [ provideStandardTitle(), provideStandardDescription(), provideStandardAuthor(), diff --git a/projects/ngx-meta/src/twitter-card/src/providers/ngx-meta-twitter-card.module.ts b/projects/ngx-meta/src/twitter-card/src/providers/ngx-meta-twitter-card.module.ts index d03a970b..c12a5a8b 100644 --- a/projects/ngx-meta/src/twitter-card/src/providers/ngx-meta-twitter-card.module.ts +++ b/projects/ngx-meta/src/twitter-card/src/providers/ngx-meta-twitter-card.module.ts @@ -10,6 +10,6 @@ import { provideNgxMetaTwitterCard } from './provide-ngx-meta-twitter-card' * @public */ @NgModule({ - providers: provideNgxMetaTwitterCard(), + providers: [provideNgxMetaTwitterCard()], }) export class NgxMetaTwitterCardModule {} diff --git a/projects/ngx-meta/src/twitter-card/src/providers/provide-ngx-meta-twitter-card.ts b/projects/ngx-meta/src/twitter-card/src/providers/provide-ngx-meta-twitter-card.ts index a2f26628..d0c30a99 100644 --- a/projects/ngx-meta/src/twitter-card/src/providers/provide-ngx-meta-twitter-card.ts +++ b/projects/ngx-meta/src/twitter-card/src/providers/provide-ngx-meta-twitter-card.ts @@ -19,7 +19,7 @@ import { * * @public */ -export const provideNgxMetaTwitterCard = (): Provider[] => [ +export const provideNgxMetaTwitterCard = (): Provider => [ provideTwitterCardCard(), provideTwitterCardSite(), provideTwitterCardCreator(),