Skip to content

Commit 50c8451

Browse files
authored
Merge pull request #85 from lossless-group/refactor/deadweight-and-mount-collapse
Refactor: collapse 17 mount files, delete the deadweight, fix the build, and give federated tokens a floor
2 parents 5f633ca + 3be8172 commit 50c8451

85 files changed

Lines changed: 1001 additions & 938 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ pnpm-debug.log*
5454
# Playwright MCP browser-drive artifacts (session snapshots/logs)
5555
.playwright-mcp/
5656

57+
# surreal sql REPL history (rustyline #V2 format) — a tool artifact that
58+
# lands at the repo root when you run the SurrealDB shell from here.
59+
history.txt
60+
5761
# graphify knowledge-graph output (~7MB generated: graph.html, graph.json,
5862
# GRAPH_REPORT.md, AST cache, manifest). Rebuild with `graphify --update`.
5963
# Corpus scope is committed in .graphifyignore, not here.

apps/affiliation-rating-resolver/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"check": "svelte-check --tsconfig ./tsconfig.json"
1111
},
1212
"dependencies": {
13+
"@augment-it/federation": "workspace:*",
1314
"@augment-it/theme": "workspace:*",
1415
"@augment-it/workspace": "workspace:*",
1516
"svelte": "^5.56.4"
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
// Federation-exposed mount function. Same shape as the other remotes.
2-
// theme.css + ./app.css imported as side effects so the bundler's CSS
3-
// pipeline injects them — Svelte's append_styles doesn't fire reliably
4-
// across the federation chunk boundary. theme.css first so its :root
5-
// tokens exist before app.css's var() refs resolve.
1+
// Federation-exposed mount. The shared body lives in @augment-it/federation,
2+
// which also carries the theme.css import — see that module for why the
3+
// ordering below (federation first, ./app.css second) is load-bearing.
64

7-
import '@augment-it/theme/theme.css';
5+
import { makeMount } from '@augment-it/federation';
86
import './app.css';
9-
import { mount, unmount, type Component } from 'svelte';
7+
import type { Component } from 'svelte';
108
import App from './App.svelte';
119

12-
export type MountResult = {
13-
destroy: () => void;
14-
};
10+
export type { MountResult } from '@augment-it/federation';
1511

16-
export function mountAffiliationRatingResolver(target: HTMLElement): MountResult {
17-
const component = mount(App as Component, { target });
18-
return {
19-
destroy: () => {
20-
unmount(component);
21-
},
22-
};
23-
}
12+
export const mountAffiliationRatingResolver = makeMount(App as Component);
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2022",
4-
"module": "ESNext",
5-
"moduleResolution": "bundler",
6-
"lib": ["DOM", "DOM.Iterable", "ES2022"],
7-
"strict": true,
8-
"noImplicitAny": true,
9-
"esModuleInterop": true,
10-
"skipLibCheck": true,
11-
"resolveJsonModule": true,
12-
"verbatimModuleSyntax": true,
13-
"noEmit": true,
14-
"allowImportingTsExtensions": true,
15-
"isolatedModules": true,
16-
"useDefineForClassFields": true,
17-
"types": ["svelte"]
18-
},
2+
"extends": "../../tsconfig.base.json",
193
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.svelte.ts", "src/**/*.d.ts"],
204
"exclude": ["node_modules", "dist"]
215
}

apps/chat/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"check": "svelte-check --tsconfig ./tsconfig.json"
1111
},
1212
"dependencies": {
13+
"@augment-it/federation": "workspace:*",
1314
"@augment-it/theme": "workspace:*",
1415
"@augment-it/workspace": "workspace:*",
1516
"svelte": "^5.56.4"

apps/chat/src/mount.ts

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
1-
// Federation-exposed mount. Same pattern as prompt-template-manager —
2-
// theme.css first (so :root tokens exist before app.css's var() refs
3-
// resolve), then app.css, then mount the App component.
1+
// Federation-exposed mount. The shared body lives in @augment-it/federation,
2+
// which also carries the theme.css import — see that module for why the
3+
// ordering below (federation first, ./app.css second) is load-bearing.
44
//
5-
// The chat connects to the workspace WebSocket on mount and disconnects
6-
// on unmount. In federation mode the workspace singleton is per-remote
7-
// (the shell's no-`shared` discipline), so the chat owns its own
8-
// workspace connection and exchanges state with the rest of the stack
9-
// via the same broadcast subjects everyone else sees.
5+
// The chat connects to the workspace WebSocket on mount and disconnects on
6+
// unmount. In federation mode the workspace singleton is per-remote (the
7+
// shell's no-`shared` discipline), so the chat owns its own workspace
8+
// connection and exchanges state with the rest of the stack via the same
9+
// broadcast subjects everyone else sees.
1010

11-
import '@augment-it/theme/theme.css';
11+
import { makeMount } from '@augment-it/federation';
1212
import './app.css';
13-
import { mount, unmount, type Component } from 'svelte';
13+
import type { Component } from 'svelte';
1414
import App from './App.svelte';
1515

16-
export type MountResult = {
17-
destroy: () => void;
18-
};
16+
export type { MountResult } from '@augment-it/federation';
1917

20-
export function mountChat(target: HTMLElement): MountResult {
21-
const component = mount(App as Component, { target });
22-
return {
23-
destroy: () => {
24-
unmount(component);
25-
},
26-
};
27-
}
18+
export const mountChat = makeMount(App as Component);

apps/chat/tsconfig.json

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2022",
4-
"module": "ESNext",
5-
"moduleResolution": "bundler",
6-
"lib": ["DOM", "DOM.Iterable", "ES2022"],
7-
"strict": true,
8-
"noImplicitAny": true,
9-
"esModuleInterop": true,
10-
"skipLibCheck": true,
11-
"resolveJsonModule": true,
12-
"verbatimModuleSyntax": true,
13-
"noEmit": true,
14-
"allowImportingTsExtensions": true,
15-
"isolatedModules": true,
16-
"useDefineForClassFields": true,
17-
"types": ["svelte"]
18-
},
19-
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.svelte.ts"],
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.svelte.ts", "src/**/*.d.ts"],
204
"exclude": ["node_modules", "dist"]
215
}

apps/enhanced-records-list/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"check": "svelte-check --tsconfig ./tsconfig.json"
1111
},
1212
"dependencies": {
13+
"@augment-it/federation": "workspace:*",
1314
"@augment-it/theme": "workspace:*",
1415
"@augment-it/workspace": "workspace:*",
1516
"svelte": "^5.56.4"
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
// Federation-exposed mount. Same pattern as apps/chat and
2-
// apps/prompt-template-manager — theme.css first, then app.css, then
3-
// mount the App.
1+
// Federation-exposed mount. The shared body lives in @augment-it/federation,
2+
// which also carries the theme.css import — see that module for why the
3+
// ordering below (federation first, ./app.css second) is load-bearing.
44

5-
import '@augment-it/theme/theme.css';
5+
import { makeMount } from '@augment-it/federation';
66
import './app.css';
7-
import { mount, unmount, type Component } from 'svelte';
7+
import type { Component } from 'svelte';
88
import App from './App.svelte';
99

10-
export type MountResult = {
11-
destroy: () => void;
12-
};
10+
export type { MountResult } from '@augment-it/federation';
1311

14-
export function mountEnhancedRecordsList(target: HTMLElement): MountResult {
15-
const component = mount(App as Component, { target });
16-
return {
17-
destroy: () => {
18-
unmount(component);
19-
},
20-
};
21-
}
12+
export const mountEnhancedRecordsList = makeMount(App as Component);
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2022",
4-
"module": "ESNext",
5-
"moduleResolution": "bundler",
6-
"lib": ["DOM", "DOM.Iterable", "ES2022"],
7-
"strict": true,
8-
"noImplicitAny": true,
9-
"esModuleInterop": true,
10-
"skipLibCheck": true,
11-
"resolveJsonModule": true,
12-
"verbatimModuleSyntax": true,
13-
"noEmit": true,
14-
"allowImportingTsExtensions": true,
15-
"isolatedModules": true,
16-
"useDefineForClassFields": true,
17-
"types": ["svelte"]
18-
},
19-
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.svelte.ts"],
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["src/**/*.ts", "src/**/*.svelte", "src/**/*.svelte.ts", "src/**/*.d.ts"],
204
"exclude": ["node_modules", "dist"]
215
}

0 commit comments

Comments
 (0)