Skip to content

Commit 21f37aa

Browse files
heswellCopilot
andcommitted
Separate portal from shared core entry
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 05beb0d commit 21f37aa

12 files changed

Lines changed: 47 additions & 34 deletions

File tree

vuu-ui/packages/core/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
# @vuu-ui/core portal
1+
# @vuu-ui/core
22

3-
Reusable VUU portal host and Module Federation integration components.
3+
Core VUU authentication and data-context APIs are exported from
4+
`@vuu-ui/core` and can be registered as a shared Module Federation dependency.
45

5-
See [DESIGN.md](./DESIGN.md) for the package design.
6+
Portal host and remote-module APIs are exported separately from
7+
`@vuu-ui/core/portal` so portal dependencies are not included in the shared
8+
module.
9+
10+
See [the portal design](./docs/portal-design.md) for details.

vuu-ui/packages/core/docs/portal-design.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Purpose
44

5-
`@vuu-ui/core` provides the reusable components, types, and utilities
5+
`@vuu-ui/core/portal` provides the reusable components, types, and utilities
66
needed to build VUU portals with Module Federation. It is the package boundary
77
for portal host behavior and remote-module integration.
88

@@ -45,8 +45,9 @@ core/
4545
| |-- portal-shell/
4646
| |-- remote-module/
4747
| |-- index.ts
48+
| |-- portal.ts
4849
| `-- RemoteModuleDescriptor.ts
49-
|-- DESIGN.md
50+
|-- docs/
5051
|-- README.md
5152
|-- package.json
5253
`-- tsconfig.json

vuu-ui/packages/core/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"docs"
77
],
88
"main": "src/index.ts",
9+
"exports": {
10+
".": "./src/index.ts",
11+
"./portal": "./src/portal.ts"
12+
},
913
"author": "heswell",
1014
"license": "Apache-2.0",
1115
"type": "module",

vuu-ui/packages/core/src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,3 @@ export {
44
DataProvider,
55
useData,
66
} from "./context-definitions/DataProvider";
7-
export {
8-
PortalHeader,
9-
type PortalHeaderProps,
10-
} from "./portal-header/PortalHeader";
11-
export { PortalNav, type PortalNavProps } from "./portal-nav/PortalNav";
12-
export { PortalShell, type PortalShellProps } from "./portal-shell/PortalShell";
13-
export {
14-
RemoteModule,
15-
type RemoteModuleProps,
16-
} from "./remote-module/RemoteModule";
17-
export type { RemoteModuleDescriptor } from "./RemoteModuleDescriptor";

vuu-ui/packages/core/src/portal-header/PortalHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Button, Toolbar, ToolbarContent, Tooltray } from "@salt-ds/core";
2-
import { useLogout } from "../auth";
2+
import { useLogout } from "@vuu-ui/core";
33
import cx from "clsx";
44
import type { HTMLAttributes } from "react";
55

vuu-ui/packages/core/src/portal.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export {
2+
PortalHeader,
3+
type PortalHeaderProps,
4+
} from "./portal-header/PortalHeader";
5+
export { PortalNav, type PortalNavProps } from "./portal-nav/PortalNav";
6+
export { PortalShell, type PortalShellProps } from "./portal-shell/PortalShell";
7+
export {
8+
RemoteModule,
9+
type RemoteModuleProps,
10+
} from "./remote-module/RemoteModule";
11+
export type { RemoteModuleDescriptor } from "./RemoteModuleDescriptor";

vuu-ui/packages/core/src/remote-module/RemoteModule.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { AuthenticationProvider, type RemoteModuleConnection } from "../auth";
1+
import {
2+
AuthenticationProvider,
3+
type RemoteModuleConnection,
4+
} from "@vuu-ui/core";
25
import {
36
loadRemote,
47
registerRemotes,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { RemoteModule } from "@vuu-ui/core";
1+
import { RemoteModule } from "@vuu-ui/core/portal";
22
import { registerComponent } from "@vuu-ui/vuu-utils";
33

4-
/** @deprecated Use RemoteModule from @vuu-ui/core. */
4+
/** @deprecated Use RemoteModule from @vuu-ui/core/portal. */
55
export const Feature = RemoteModule;
66
Feature.displayName = "Feature";
77
registerComponent("Feature", Feature, "view");

vuu-ui/packages/vuu-shell/src/feature/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export * from "./Feature";
22
export {
33
RemoteModule,
44
type RemoteModuleProps,
5-
} from "@vuu-ui/core";
5+
} from "@vuu-ui/core/portal";

vuu-ui/sample-apps/vuu-portal/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { registerComponent } from "@vuu-ui/vuu-utils";
44
import { useEffect, useState } from "react";
55
import { ConfirmSelectionPanel } from "./order-management/cancel-confirm-prompt/ConfirmSelectionPanel";
66
import { BrowserRouter } from "react-router-dom";
7-
import { PortalShell, type RemoteModuleDescriptor } from "@vuu-ui/core";
7+
import { PortalShell, type RemoteModuleDescriptor } from "@vuu-ui/core/portal";
88
import { getRegisteredModules } from "@vuu-ui/vuu-shell";
99

1010
import "./App.css";

0 commit comments

Comments
 (0)