static-cms/packages/core/src/extensions.ts

63 lines
1.3 KiB
TypeScript
Raw Normal View History

2022-10-20 11:57:30 -04:00
import {
BitbucketBackend,
GitGatewayBackend,
GitHubBackend,
GitLabBackend,
2023-01-18 00:08:45 +01:00
GiteaBackend,
2022-10-20 11:57:30 -04:00
ProxyBackend,
TestBackend,
} from './backends';
import { registerBackend, registerLocale, registerWidget } from './lib/registry';
import locales from './locales';
2022-10-20 11:57:30 -04:00
import {
BooleanWidget,
CodeWidget,
ColorStringWidget,
DateTimeWidget,
FileWidget,
ImageWidget,
ListWidget,
MapWidget,
MarkdownWidget,
2022-12-11 09:03:53 -05:00
MdxWidget,
2022-10-20 11:57:30 -04:00
NumberWidget,
ObjectWidget,
RelationWidget,
SelectWidget,
StringWidget,
TextWidget,
} from './widgets';
export default function addExtensions() {
2022-10-20 11:57:30 -04:00
// Register all the things
registerBackend('git-gateway', GitGatewayBackend);
registerBackend('github', GitHubBackend);
registerBackend('gitlab', GitLabBackend);
2023-01-18 00:08:45 +01:00
registerBackend('gitea', GiteaBackend);
2022-10-20 11:57:30 -04:00
registerBackend('bitbucket', BitbucketBackend);
registerBackend('test-repo', TestBackend);
registerBackend('proxy', ProxyBackend);
registerWidget([
2022-12-06 08:31:07 -05:00
BooleanWidget(),
CodeWidget(),
ColorStringWidget(),
DateTimeWidget(),
2022-10-20 11:57:30 -04:00
FileWidget(),
2022-12-06 08:31:07 -05:00
ImageWidget(),
2022-10-20 11:57:30 -04:00
ListWidget(),
2022-12-06 08:31:07 -05:00
MapWidget(),
MarkdownWidget(),
2022-12-11 09:03:53 -05:00
MdxWidget(),
2022-12-06 08:31:07 -05:00
NumberWidget(),
2022-10-20 11:57:30 -04:00
ObjectWidget(),
RelationWidget(),
2022-12-06 08:31:07 -05:00
SelectWidget(),
StringWidget(),
TextWidget(),
2022-10-20 11:57:30 -04:00
]);
Object.keys(locales).forEach(locale => {
registerLocale(locale, locales[locale]);
});
2022-10-20 11:57:30 -04:00
}