From 0269b015766b65e98a6e44200135e24e88c37959 Mon Sep 17 00:00:00 2001 From: Patrick Jungermann Date: Mon, 8 Jan 2024 19:37:29 +0100 Subject: [PATCH] refactor(tech-insights): reorg exports Signed-off-by: Patrick Jungermann --- .../src/index.ts | 10 ++----- .../src/service/index.ts | 25 ++++++++++++++++++ plugins/tech-insights-backend/src/index.ts | 19 +------------- .../src/service/fact/factRetrievers/index.ts | 3 ++- .../src/service/fact/index.ts | 21 +++++++++++++++ .../src/service/index.ts | 26 +++++++++++++++++++ .../src/service/persistence/index.ts | 21 +++++++++++++++ 7 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 plugins/tech-insights-backend-module-jsonfc/src/service/index.ts create mode 100644 plugins/tech-insights-backend/src/service/fact/index.ts create mode 100644 plugins/tech-insights-backend/src/service/index.ts create mode 100644 plugins/tech-insights-backend/src/service/persistence/index.ts diff --git a/plugins/tech-insights-backend-module-jsonfc/src/index.ts b/plugins/tech-insights-backend-module-jsonfc/src/index.ts index 1239211f73..6462efc403 100644 --- a/plugins/tech-insights-backend-module-jsonfc/src/index.ts +++ b/plugins/tech-insights-backend-module-jsonfc/src/index.ts @@ -13,15 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { - JsonRulesEngineFactCheckerFactory, - JsonRulesEngineFactChecker, -} from './service/JsonRulesEngineFactChecker'; + export { JSON_RULE_ENGINE_CHECK_TYPE } from './constants'; -export type { - JsonRulesEngineFactCheckerFactoryOptions, - JsonRulesEngineFactCheckerOptions, -} from './service/JsonRulesEngineFactChecker'; +export * from './service'; export type { JsonRuleCheckResponse, JsonRuleBooleanCheckResult, diff --git a/plugins/tech-insights-backend-module-jsonfc/src/service/index.ts b/plugins/tech-insights-backend-module-jsonfc/src/service/index.ts new file mode 100644 index 0000000000..5670c138a1 --- /dev/null +++ b/plugins/tech-insights-backend-module-jsonfc/src/service/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { + JsonRulesEngineFactCheckerFactory, + JsonRulesEngineFactChecker, +} from './JsonRulesEngineFactChecker'; + +export type { + JsonRulesEngineFactCheckerFactoryOptions, + JsonRulesEngineFactCheckerOptions, +} from './JsonRulesEngineFactChecker'; diff --git a/plugins/tech-insights-backend/src/index.ts b/plugins/tech-insights-backend/src/index.ts index e9e037cce1..d6b845a78d 100644 --- a/plugins/tech-insights-backend/src/index.ts +++ b/plugins/tech-insights-backend/src/index.ts @@ -14,21 +14,4 @@ * limitations under the License. */ -export * from './service/router'; -export type { RouterOptions } from './service/router'; - -export { buildTechInsightsContext } from './service/techInsightsContextBuilder'; -export { initializePersistenceContext } from './service/persistence/persistenceContext'; -export type { - TechInsightsOptions, - TechInsightsContext, -} from './service/techInsightsContextBuilder'; -export type { FactRetrieverEngine } from './service/fact/FactRetrieverEngine'; -export type { - PersistenceContext, - PersistenceContextOptions, -} from './service/persistence/persistenceContext'; -export { createFactRetrieverRegistration } from './service/fact/createFactRetriever'; -export type { FactRetrieverRegistry } from './service/fact/FactRetrieverRegistry'; -export type { FactRetrieverRegistrationOptions } from './service/fact/createFactRetriever'; -export * from './service/fact/factRetrievers'; +export * from './service'; diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts index 587db8c4b9..5983a82e1d 100644 --- a/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts +++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './entityOwnershipFactRetriever'; + export * from './entityMetadataFactRetriever'; +export * from './entityOwnershipFactRetriever'; export * from './techdocsFactRetriever'; diff --git a/plugins/tech-insights-backend/src/service/fact/index.ts b/plugins/tech-insights-backend/src/service/fact/index.ts new file mode 100644 index 0000000000..0eeb498481 --- /dev/null +++ b/plugins/tech-insights-backend/src/service/fact/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { createFactRetrieverRegistration } from './createFactRetriever'; +export type { FactRetrieverRegistrationOptions } from './createFactRetriever'; +export type { FactRetrieverEngine } from './FactRetrieverEngine'; +export type { FactRetrieverRegistry } from './FactRetrieverRegistry'; +export * from './factRetrievers'; diff --git a/plugins/tech-insights-backend/src/service/index.ts b/plugins/tech-insights-backend/src/service/index.ts new file mode 100644 index 0000000000..5306ad26d6 --- /dev/null +++ b/plugins/tech-insights-backend/src/service/index.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './fact'; +export * from './persistence'; +export * from './router'; +export type { RouterOptions } from './router'; + +export { buildTechInsightsContext } from './techInsightsContextBuilder'; +export type { + TechInsightsOptions, + TechInsightsContext, +} from './techInsightsContextBuilder'; diff --git a/plugins/tech-insights-backend/src/service/persistence/index.ts b/plugins/tech-insights-backend/src/service/persistence/index.ts new file mode 100644 index 0000000000..64cc876026 --- /dev/null +++ b/plugins/tech-insights-backend/src/service/persistence/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { initializePersistenceContext } from './persistenceContext'; +export type { + PersistenceContext, + PersistenceContextOptions, +} from './persistenceContext';