惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
Y
Y Combinator Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
M
MIT News - Artificial intelligence
Last Week in AI
Last Week in AI
V
V2EX
腾讯CDC
F
Fortinet All Blogs
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: resolve root aliases in ui dev · openclaw/openclaw@6...
shakkernerd · 2026-05-31 · via Recent Commits to openclaw:main

@@ -11,6 +11,10 @@ const repoRoot = path.resolve(here, "..");

1111

const outDir = path.resolve(here, "../dist/control-ui");

1212

const require = createRequire(import.meta.url);

1313

const json5EsmPath = require.resolve("json5/dist/index.mjs");

14+

type ControlUiViteAlias = {

15+

find: string | RegExp;

16+

replacement: string;

17+

};

1418

const commonJsOptimizeDeps = [

1519

"highlight.js/lib/core",

1620

"highlight.js/lib/languages/bash",

@@ -83,6 +87,72 @@ function resolveControlUiBuildId(): string {

8387

return normalizeBuildId(gitSha ? `${version}-${gitSha}` : version);

8488

}

858990+

function escapeRegExp(input: string): string {

91+

return input.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

92+

}

93+94+

function sortTsconfigPathEntries(entries: Array<[string, unknown]>): Array<[string, unknown]> {

95+

return entries.toSorted(([left], [right]) => {

96+

const leftPrefixLength = left.includes("*") ? left.indexOf("*") : left.length;

97+

const rightPrefixLength = right.includes("*") ? right.indexOf("*") : right.length;

98+

if (leftPrefixLength !== rightPrefixLength) {

99+

return rightPrefixLength - leftPrefixLength;

100+

}

101+

return right.length - left.length || left.localeCompare(right);

102+

});

103+

}

104+105+

function resolveTsconfigTargetPath(target: string): string {

106+

return path.resolve(repoRoot, target.replace(/^\.\//, ""));

107+

}

108+109+

function resolveTsconfigPathAlias(key: string, target: string): ControlUiViteAlias | null {

110+

const keyWildcardIndex = key.indexOf("*");

111+

const targetWildcardIndex = target.indexOf("*");

112+

if (keyWildcardIndex === -1 || targetWildcardIndex === -1) {

113+

if (keyWildcardIndex !== -1 || targetWildcardIndex !== -1) {

114+

return null;

115+

}

116+

return {

117+

find: key,

118+

replacement: resolveTsconfigTargetPath(target),

119+

};

120+

}

121+122+

if (

123+

key.indexOf("*", keyWildcardIndex + 1) !== -1 ||

124+

target.indexOf("*", targetWildcardIndex + 1) !== -1

125+

) {

126+

return null;

127+

}

128+129+

const prefix = key.slice(0, keyWildcardIndex);

130+

const suffix = key.slice(keyWildcardIndex + 1);

131+

return {

132+

find: new RegExp(`^${escapeRegExp(prefix)}(.+)${escapeRegExp(suffix)}$`),

133+

replacement: resolveTsconfigTargetPath(target).replace("*", "$1"),

134+

};

135+

}

136+137+

export function resolveTsconfigPathAliasesForVite(): ControlUiViteAlias[] {

138+

const raw = fs.readFileSync(path.join(repoRoot, "tsconfig.json"), "utf8");

139+

const parsed = JSON.parse(raw) as {

140+

compilerOptions?: { paths?: Record<string, unknown> };

141+

};

142+

const paths = parsed.compilerOptions?.paths;

143+

if (!paths) {

144+

return [];

145+

}

146+147+

return sortTsconfigPathEntries(Object.entries(paths)).flatMap(([key, targets]) => {

148+

if (!Array.isArray(targets) || typeof targets[0] !== "string") {

149+

return [];

150+

}

151+

const alias = resolveTsconfigPathAlias(key, targets[0]);

152+

return alias ? [alias] : [];

153+

});

154+

}

155+86156

function controlUiServiceWorkerBuildIdPlugin(buildId: string): Plugin {

87157

return {

88158

name: "control-ui-service-worker-build-id",

@@ -121,9 +191,7 @@ export default defineConfig(() => {

121191

],

122192

},

123193

resolve: {

124-

alias: {

125-

json5: json5EsmPath,

126-

},

194+

alias: [{ find: "json5", replacement: json5EsmPath }, ...resolveTsconfigPathAliasesForVite()],

127195

},

128196

build: {

129197

outDir,