From 0ffc7d4b20617fac9f85c2f986c1307bac800e2e Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 7 Mar 2023 15:57:12 +0100 Subject: [PATCH] move router library into src/core to avoid exposing it to the public --- src/Umbraco.Web.UI.Client/src/app.ts | 4 ++-- .../src/backoffice/backoffice.element.ts | 2 -- .../{libs => src/core}/router/index.ts | 1 + .../{libs => src/core}/router/router-slot-change.event.ts | 0 .../{libs => src/core}/router/router-slot-init.event.ts | 0 .../{libs => src/core}/router/router-slot.element.ts | 6 ++++-- src/Umbraco.Web.UI.Client/tsconfig.json | 2 +- src/Umbraco.Web.UI.Client/web-test-runner.config.mjs | 5 ++--- 8 files changed, 10 insertions(+), 10 deletions(-) rename src/Umbraco.Web.UI.Client/{libs => src/core}/router/index.ts (81%) rename src/Umbraco.Web.UI.Client/{libs => src/core}/router/router-slot-change.event.ts (100%) rename src/Umbraco.Web.UI.Client/{libs => src/core}/router/router-slot-init.event.ts (100%) rename src/Umbraco.Web.UI.Client/{libs => src/core}/router/router-slot.element.ts (90%) diff --git a/src/Umbraco.Web.UI.Client/src/app.ts b/src/Umbraco.Web.UI.Client/src/app.ts index 2b389e431d..3dafb8e9df 100644 --- a/src/Umbraco.Web.UI.Client/src/app.ts +++ b/src/Umbraco.Web.UI.Client/src/app.ts @@ -7,14 +7,14 @@ import '@umbraco-ui/uui-modal-container'; import '@umbraco-ui/uui-modal-dialog'; import '@umbraco-ui/uui-modal-sidebar'; import 'element-internals-polyfill'; -import '@umbraco-cms/router'; -import type { Guard, IRoute } from 'router-slot/model'; +import './core/router/router-slot.element'; import { UUIIconRegistryEssential } from '@umbraco-ui/uui'; import { css, html } from 'lit'; import { customElement, property, state } from 'lit/decorators.js'; +import type { Guard, IRoute } from '@umbraco-cms/router'; import { UmbLitElement } from '@umbraco-cms/element'; import { tryExecuteAndNotify } from '@umbraco-cms/resources'; import { OpenAPI, RuntimeLevelModel, ServerResource } from '@umbraco-cms/backend-api'; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts index cee5fd1db9..31d1af18bc 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/backoffice.element.ts @@ -49,8 +49,6 @@ import { umbExtensionsRegistry } from '@umbraco-cms/extensions-api'; import { UmbNotificationContext, UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/notification'; import { UmbLitElement } from '@umbraco-cms/element'; -import '@umbraco-cms/router'; - // Domains import './settings'; import './documents'; diff --git a/src/Umbraco.Web.UI.Client/libs/router/index.ts b/src/Umbraco.Web.UI.Client/src/core/router/index.ts similarity index 81% rename from src/Umbraco.Web.UI.Client/libs/router/index.ts rename to src/Umbraco.Web.UI.Client/src/core/router/index.ts index 9ba378560a..75fd79f5e4 100644 --- a/src/Umbraco.Web.UI.Client/libs/router/index.ts +++ b/src/Umbraco.Web.UI.Client/src/core/router/index.ts @@ -1,3 +1,4 @@ +export * from 'router-slot'; export * from './router-slot.element'; export * from './router-slot-change.event'; export * from './router-slot-init.event'; diff --git a/src/Umbraco.Web.UI.Client/libs/router/router-slot-change.event.ts b/src/Umbraco.Web.UI.Client/src/core/router/router-slot-change.event.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/libs/router/router-slot-change.event.ts rename to src/Umbraco.Web.UI.Client/src/core/router/router-slot-change.event.ts diff --git a/src/Umbraco.Web.UI.Client/libs/router/router-slot-init.event.ts b/src/Umbraco.Web.UI.Client/src/core/router/router-slot-init.event.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/libs/router/router-slot-init.event.ts rename to src/Umbraco.Web.UI.Client/src/core/router/router-slot-init.event.ts diff --git a/src/Umbraco.Web.UI.Client/libs/router/router-slot.element.ts b/src/Umbraco.Web.UI.Client/src/core/router/router-slot.element.ts similarity index 90% rename from src/Umbraco.Web.UI.Client/libs/router/router-slot.element.ts rename to src/Umbraco.Web.UI.Client/src/core/router/router-slot.element.ts index 8bf9e2a175..a343c9acf4 100644 --- a/src/Umbraco.Web.UI.Client/libs/router/router-slot.element.ts +++ b/src/Umbraco.Web.UI.Client/src/core/router/router-slot.element.ts @@ -1,7 +1,9 @@ -import { IRoute, RouterSlot } from 'router-slot'; +import type { IRoute } from 'router-slot/model'; +import { RouterSlot } from 'router-slot'; import { LitElement, PropertyValueMap } from 'lit'; import { customElement, property } from 'lit/decorators.js'; -import { UmbRouterSlotChangeEvent, UmbRouterSlotInitEvent } from '@umbraco-cms/router'; +import { UmbRouterSlotInitEvent } from './router-slot-init.event'; +import { UmbRouterSlotChangeEvent } from './router-slot-change.event'; /** * @element umb-router-slot-element diff --git a/src/Umbraco.Web.UI.Client/tsconfig.json b/src/Umbraco.Web.UI.Client/tsconfig.json index 1e55e986af..73ddb9a903 100644 --- a/src/Umbraco.Web.UI.Client/tsconfig.json +++ b/src/Umbraco.Web.UI.Client/tsconfig.json @@ -35,7 +35,7 @@ "@umbraco-cms/entity-action": ["libs/entity-action"], "@umbraco-cms/workspace": ["libs/workspace"], "@umbraco-cms/utils": ["libs/utils"], - "@umbraco-cms/router": ["libs/router"], + "@umbraco-cms/router": ["src/core/router"], "@umbraco-cms/test-utils": ["libs/test-utils"], "@umbraco-cms/repository": ["libs/repository"], "@umbraco-cms/resources": ["libs/resources"], diff --git a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs index bcdbcb895c..70be4bf8f8 100644 --- a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs +++ b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs @@ -55,8 +55,8 @@ export default { '@umbraco-cms/utils': './libs/utils/index.ts', '@umbraco-cms/test-utils': './libs/test-utils/index.ts', '@umbraco-cms/resources': './libs/resources/index.ts', - '@umbraco-cms/repository': './libs/repository', - '@umbraco-cms/router': './libs/router/index.ts', + '@umbraco-cms/repository': './libs/repository/index.ts', + '@umbraco-cms/router': './src/core/router/index.ts', }, }, }, @@ -82,7 +82,6 @@ export default { `,