mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 09:00:05 +00:00
[feat] Add header registry infrastructure
Create extensible header registration system for HTTP requests: - Add HeaderRegistry service with VSCode-style registration patterns - Create network client adapters for axios and fetch with automatic header injection - Add comprehensive TypeScript types for header providers - Include example implementations for extension developers This provides the foundation for extensions to register custom headers that will be automatically added to all network requests. Part of #5017
This commit is contained in:
33
replace_helper.cjs
Normal file
33
replace_helper.cjs
Normal file
@@ -0,0 +1,33 @@
|
||||
const fs = require('fs');
|
||||
|
||||
// Read the file
|
||||
let content = fs.readFileSync('/home/c_byrne/projects/comfyui-frontend-testing/ComfyUI_frontend-clone-39/src/lib/litegraph/src/LGraphCanvas.ts', 'utf8');
|
||||
|
||||
// Replace the first occurrence (canvas menu)
|
||||
content = content.replace(
|
||||
/ content: 'Convert to Group Node \\(Deprecated\\) 🧾',\\n callback: \\(\\) => \\{[^}]+\\n \\}\\n \\}\\n \\},/s,
|
||||
` {
|
||||
content: 'Convert to Group Node (Deprecated) 🧾',
|
||||
callback: () => {
|
||||
// Convert selected nodes to group node using our helper function
|
||||
const selectedNodes = Object.values(this.selected_nodes);
|
||||
LGraphCanvas.convertSelectedNodesToGroupNode(selectedNodes);
|
||||
}
|
||||
},`
|
||||
);
|
||||
|
||||
// Replace the second occurrence (node menu)
|
||||
content = content.replace(
|
||||
/ content: 'Convert to Group Node \\(Deprecated\\) 🧾',\\n callback: \\(\\) => \\{[^}]+\\n \\}\\n \\}\\n \\}/s,
|
||||
` {
|
||||
content: 'Convert to Group Node (Deprecated) 🧾',
|
||||
callback: () => {
|
||||
// Convert selected nodes to group node using our helper function
|
||||
const selectedNodes = Object.values(this.selected_nodes);
|
||||
LGraphCanvas.convertSelectedNodesToGroupNode(selectedNodes);
|
||||
}
|
||||
}`
|
||||
);
|
||||
|
||||
// Write the file back
|
||||
fs.writeFileSync('/home/c_byrne/projects/comfyui-frontend-testing/ComfyUI_frontend-clone-39/src/lib/litegraph/src/LGraphCanvas.ts', content);
|
||||
Reference in New Issue
Block a user