源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
const requiredTiptapPeers = new Map([
|
||||
[
|
||||
"@tutti-os/agent-gui",
|
||||
[
|
||||
"@tiptap/core",
|
||||
"@tiptap/pm",
|
||||
"@tiptap/react",
|
||||
"@tiptap/starter-kit",
|
||||
"@tiptap/suggestion"
|
||||
]
|
||||
],
|
||||
["@tutti-os/ui-rich-text", ["@tiptap/core", "@tiptap/react"]]
|
||||
]);
|
||||
const bundledTiptapDependencies = new Map([
|
||||
[
|
||||
"@tutti-os/ui-rich-text",
|
||||
[
|
||||
"@tiptap/extension-document",
|
||||
"@tiptap/extension-hard-break",
|
||||
"@tiptap/extension-paragraph",
|
||||
"@tiptap/extension-text"
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
export function packagePeerContractViolations(packageName, manifest) {
|
||||
const requiredPeers = requiredTiptapPeers.get(packageName);
|
||||
const bundledDependencies = bundledTiptapDependencies.get(packageName) ?? [];
|
||||
if (!requiredPeers && bundledDependencies.length === 0) return [];
|
||||
|
||||
const dependencies = manifest.dependencies ?? {};
|
||||
const devDependencies = manifest.devDependencies ?? {};
|
||||
const peerDependencies = manifest.peerDependencies ?? {};
|
||||
const violations = [];
|
||||
|
||||
for (const name of requiredPeers ?? []) {
|
||||
if (Object.hasOwn(dependencies, name)) {
|
||||
violations.push(`${name} must be a peer dependency`);
|
||||
}
|
||||
if (!Object.hasOwn(peerDependencies, name)) {
|
||||
violations.push(`${name} is missing from peerDependencies`);
|
||||
} else if (devDependencies[name] !== peerDependencies[name]) {
|
||||
violations.push(`${name} must use the same peer and dev range`);
|
||||
}
|
||||
}
|
||||
|
||||
for (const name of bundledDependencies) {
|
||||
if (Object.hasOwn(dependencies, name)) {
|
||||
violations.push(`${name} must be bundled from devDependencies`);
|
||||
}
|
||||
if (Object.hasOwn(peerDependencies, name)) {
|
||||
violations.push(`${name} must not be a consumer peer dependency`);
|
||||
}
|
||||
if (!Object.hasOwn(devDependencies, name)) {
|
||||
violations.push(`${name} is missing from devDependencies`);
|
||||
}
|
||||
}
|
||||
|
||||
return violations;
|
||||
}
|
||||
|
||||
export function externalBundledTiptapImports(packageName, source) {
|
||||
return (bundledTiptapDependencies.get(packageName) ?? []).filter(
|
||||
(name) => source.includes(`"${name}"`) || source.includes(`'${name}'`)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user