Restructure frontend code to allow for extensions (#4721)

# Description of Changes
Move frontend code into `core` folder and add infrastructure for
`proprietary` folder to include premium, non-OSS features
This commit is contained in:
James Brunton
2025-10-28 10:29:36 +00:00
committed by GitHub
parent 960d48f80c
commit d2b38ef4b8
725 changed files with 2485 additions and 2226 deletions
@@ -0,0 +1,30 @@
import { createContext, useContext } from 'react';
import type {
ToolRegistryEntry,
ToolRegistry,
RegularToolRegistry,
SuperToolRegistry,
LinkToolRegistry,
} from '@app/data/toolsTaxonomy';
import type { ToolId } from '@app/types/toolId';
export interface ToolRegistryCatalog {
regularTools: RegularToolRegistry;
superTools: SuperToolRegistry;
linkTools: LinkToolRegistry;
allTools: ToolRegistry;
getToolById: (toolId: ToolId | null) => ToolRegistryEntry | null;
}
const ToolRegistryContext = createContext<ToolRegistryCatalog | null>(null);
export const useToolRegistry = (): ToolRegistryCatalog => {
const context = useContext(ToolRegistryContext);
if (context === null) {
throw new Error('useToolRegistry must be used within a ToolRegistryProvider');
}
return context;
};
export default ToolRegistryContext;