@contember/create 1.4.0-rc.4 → 1.4.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/commands/WorkspaceCreateCommand.d.ts +4 -3
- package/dist/src/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/src/commands/WorkspaceCreateCommand.js +10 -4
- package/dist/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/src/lib/FileSystem.d.ts +14 -0
- package/dist/src/lib/FileSystem.d.ts.map +1 -0
- package/dist/src/lib/FileSystem.js +54 -0
- package/dist/src/lib/FileSystem.js.map +1 -0
- package/dist/src/lib/PackageDownloader.d.ts +7 -0
- package/dist/src/lib/PackageDownloader.d.ts.map +1 -0
- package/dist/src/lib/PackageDownloader.js +32 -0
- package/dist/src/lib/PackageDownloader.js.map +1 -0
- package/dist/src/lib/TemplateInstaller.d.ts +13 -0
- package/dist/src/lib/TemplateInstaller.d.ts.map +1 -0
- package/dist/src/lib/TemplateInstaller.js +75 -0
- package/dist/src/lib/TemplateInstaller.js.map +1 -0
- package/dist/src/lib/pathUtils.d.ts +3 -0
- package/dist/src/lib/pathUtils.d.ts.map +1 -0
- package/dist/src/lib/pathUtils.js +7 -0
- package/dist/src/lib/pathUtils.js.map +1 -0
- package/dist/src/run.js +7 -3
- package/dist/src/run.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/resources/templates/template-workspace/.gitignore.dist +3 -0
- package/resources/templates/template-workspace/admin/.env.development +3 -0
- package/resources/templates/template-workspace/admin/.env.production +3 -0
- package/resources/templates/template-workspace/admin/app/components/layout.tsx +32 -0
- package/resources/templates/template-workspace/admin/app/components/logo.tsx +16 -0
- package/resources/templates/template-workspace/admin/app/components/navigation.tsx +1 -0
- package/resources/templates/template-workspace/admin/app/config.ts +27 -0
- package/resources/templates/template-workspace/admin/app/index.html +15 -0
- package/resources/templates/template-workspace/admin/app/index.tsx +40 -0
- package/resources/templates/template-workspace/admin/app/pages/index.tsx +5 -0
- package/resources/templates/template-workspace/admin/index.css +53 -0
- package/resources/templates/template-workspace/admin/index.html +13 -0
- package/resources/templates/template-workspace/admin/index.tsx +268 -0
- package/resources/templates/template-workspace/admin/lib/binding/binding.tsx +45 -0
- package/resources/templates/template-workspace/admin/lib/binding/delete.tsx +43 -0
- package/resources/templates/template-workspace/admin/lib/binding/hooks.tsx +71 -0
- package/resources/templates/template-workspace/admin/lib/binding/identity.tsx +19 -0
- package/resources/templates/template-workspace/admin/lib/binding/index.ts +5 -0
- package/resources/templates/template-workspace/admin/lib/binding/persist.tsx +70 -0
- package/resources/templates/template-workspace/admin/lib/block-repeater/block-repeater.tsx +224 -0
- package/resources/templates/template-workspace/admin/lib/block-repeater/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/board/board.tsx +240 -0
- package/resources/templates/template-workspace/admin/lib/board/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/buttons/back-button.tsx +20 -0
- package/resources/templates/template-workspace/admin/lib/buttons/index.ts +2 -0
- package/resources/templates/template-workspace/admin/lib/buttons/link-back-button.tsx +21 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/cells.tsx +64 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/column-header.tsx +65 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/columns.tsx +166 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +42 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/empty.tsx +8 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/export.tsx +17 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/boolean.tsx +76 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/common.tsx +29 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/date.tsx +153 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/enum.tsx +115 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/index.ts +7 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/mobile.tsx +19 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/number.tsx +100 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/relation.tsx +180 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/filters/text.tsx +121 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/grid.tsx +61 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/index.ts +16 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/layout-switcher.tsx +32 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/loader.tsx +10 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/pagination.tsx +103 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/table.tsx +69 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/tiles.tsx +24 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/toolbar.tsx +66 -0
- package/resources/templates/template-workspace/admin/lib/datagrid/ui.tsx +153 -0
- package/resources/templates/template-workspace/admin/lib/dev/index.ts +2 -0
- package/resources/templates/template-workspace/admin/lib/dev/login-panel.tsx +56 -0
- package/resources/templates/template-workspace/admin/lib/dev/todo.tsx +14 -0
- package/resources/templates/template-workspace/admin/lib/dict.ts +324 -0
- package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +135 -0
- package/resources/templates/template-workspace/admin/lib/dimensions/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/editor/block-editor.tsx +111 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/baseEditorPlugins.tsx +66 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/buttons.tsx +83 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-block-toolbar.tsx +17 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-canvas.tsx +30 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-editable-canvas.tsx +50 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/editor-inline-toolbar.tsx +63 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/AnchorRenderer.tsx +36 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/BlockElement.tsx +48 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/HeadingRenderer.tsx +48 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +28 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/ListItemRenderer.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/OrderedListRenderer.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/ParagraphRenderer.tsx +15 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +30 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +20 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/TableElementRenderer.tsx +96 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +15 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/editor/common/index.ts +6 -0
- package/resources/templates/template-workspace/admin/lib/editor/editor-block.tsx +96 -0
- package/resources/templates/template-workspace/admin/lib/editor/index.ts +5 -0
- package/resources/templates/template-workspace/admin/lib/editor/plugins.tsx +36 -0
- package/resources/templates/template-workspace/admin/lib/editor/rich-text.tsx +54 -0
- package/resources/templates/template-workspace/admin/lib/editor/sortable-block.tsx +51 -0
- package/resources/templates/template-workspace/admin/lib/errors/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/errors/use-error-formatter.ts +26 -0
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +63 -0
- package/resources/templates/template-workspace/admin/lib/form/index.ts +5 -0
- package/resources/templates/template-workspace/admin/lib/form/inputs.tsx +99 -0
- package/resources/templates/template-workspace/admin/lib/form/select.tsx +123 -0
- package/resources/templates/template-workspace/admin/lib/form/ui.tsx +29 -0
- package/resources/templates/template-workspace/admin/lib/form/upload.tsx +243 -0
- package/resources/templates/template-workspace/admin/lib/formatting/formatting.ts +62 -0
- package/resources/templates/template-workspace/admin/lib/formatting/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/images/formatImageResizeUrl.ts +23 -0
- package/resources/templates/template-workspace/admin/lib/images/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/layout/index.ts +2 -0
- package/resources/templates/template-workspace/admin/lib/layout/layout.tsx +167 -0
- package/resources/templates/template-workspace/admin/lib/layout/slots.tsx +24 -0
- package/resources/templates/template-workspace/admin/lib/outdated-application-dialog/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +41 -0
- package/resources/templates/template-workspace/admin/lib/repeater/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/repeater/repeater.tsx +142 -0
- package/resources/templates/template-workspace/admin/lib/select/create-new.tsx +34 -0
- package/resources/templates/template-workspace/admin/lib/select/filter.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/select/highlight.tsx +16 -0
- package/resources/templates/template-workspace/admin/lib/select/index.ts +7 -0
- package/resources/templates/template-workspace/admin/lib/select/list.tsx +49 -0
- package/resources/templates/template-workspace/admin/lib/select/multi-select.tsx +95 -0
- package/resources/templates/template-workspace/admin/lib/select/pagination.tsx +48 -0
- package/resources/templates/template-workspace/admin/lib/select/select.tsx +87 -0
- package/resources/templates/template-workspace/admin/lib/select/sortable-select.tsx +129 -0
- package/resources/templates/template-workspace/admin/lib/select/ui.tsx +80 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/change-my-password.tsx +40 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/common.tsx +94 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/create-api-key.tsx +39 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/index.ts +8 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/invite.tsx +46 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/login.tsx +52 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/memberships-control.tsx +128 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/password-reset-request.tsx +31 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/password-reset.tsx +44 -0
- package/resources/templates/template-workspace/admin/lib/tenant/forms/update-project-member.tsx +32 -0
- package/resources/templates/template-workspace/admin/lib/tenant/hooks/useInvite.ts +28 -0
- package/resources/templates/template-workspace/admin/lib/tenant/hooks/useInviteUser.tsx +45 -0
- package/resources/templates/template-workspace/admin/lib/tenant/index.ts +3 -0
- package/resources/templates/template-workspace/admin/lib/tenant/listing/api-key-list.tsx +25 -0
- package/resources/templates/template-workspace/admin/lib/tenant/listing/index.ts +4 -0
- package/resources/templates/template-workspace/admin/lib/tenant/listing/member-delete-dialog.tsx +38 -0
- package/resources/templates/template-workspace/admin/lib/tenant/listing/member-list.tsx +147 -0
- package/resources/templates/template-workspace/admin/lib/tenant/listing/person-list.tsx +25 -0
- package/resources/templates/template-workspace/admin/lib/tenant/otp/index.ts +1 -0
- package/resources/templates/template-workspace/admin/lib/tenant/otp/otp-setup.tsx +146 -0
- package/resources/templates/template-workspace/admin/lib/toast/index.ts +2 -0
- package/resources/templates/template-workspace/admin/lib/toast/toast.tsx +112 -0
- package/resources/templates/template-workspace/admin/lib/toast/toaster.tsx +104 -0
- package/resources/templates/template-workspace/admin/lib/ui/alert-dialog.tsx +59 -0
- package/resources/templates/template-workspace/admin/lib/ui/button.tsx +29 -0
- package/resources/templates/template-workspace/admin/lib/ui/card.tsx +25 -0
- package/resources/templates/template-workspace/admin/lib/ui/dialog.tsx +51 -0
- package/resources/templates/template-workspace/admin/lib/ui/divider.tsx +11 -0
- package/resources/templates/template-workspace/admin/lib/ui/dropdown.tsx +108 -0
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +62 -0
- package/resources/templates/template-workspace/admin/lib/ui/label.tsx +7 -0
- package/resources/templates/template-workspace/admin/lib/ui/loader.tsx +30 -0
- package/resources/templates/template-workspace/admin/lib/ui/menu.tsx +103 -0
- package/resources/templates/template-workspace/admin/lib/ui/overlay.tsx +33 -0
- package/resources/templates/template-workspace/admin/lib/ui/popover.tsx +31 -0
- package/resources/templates/template-workspace/admin/lib/ui/progress.tsx +25 -0
- package/resources/templates/template-workspace/admin/lib/ui/scroll-area.tsx +45 -0
- package/resources/templates/template-workspace/admin/lib/ui/sheet.tsx +67 -0
- package/resources/templates/template-workspace/admin/lib/ui/sortable.tsx +13 -0
- package/resources/templates/template-workspace/admin/lib/ui/switch.tsx +10 -0
- package/resources/templates/template-workspace/admin/lib/ui/table.tsx +46 -0
- package/resources/templates/template-workspace/admin/lib/ui/textarea.tsx +18 -0
- package/resources/templates/template-workspace/admin/lib/ui/toggle-group.tsx +44 -0
- package/resources/templates/template-workspace/admin/lib/ui/toggle.tsx +29 -0
- package/resources/templates/template-workspace/admin/lib/ui/tooltip.tsx +24 -0
- package/resources/templates/template-workspace/admin/lib/upload/dropzone.tsx +21 -0
- package/resources/templates/template-workspace/admin/lib/upload/index.ts +3 -0
- package/resources/templates/template-workspace/admin/lib/upload/repeater.tsx +12 -0
- package/resources/templates/template-workspace/admin/lib/upload/ui.tsx +57 -0
- package/resources/templates/template-workspace/admin/lib/upload/upload-progress.tsx +130 -0
- package/resources/templates/template-workspace/admin/lib/upload/view.tsx +219 -0
- package/resources/templates/template-workspace/admin/lib/utils/cn.ts +4 -0
- package/resources/templates/template-workspace/admin/lib/utils/dict-format.tsx +3 -0
- package/resources/templates/template-workspace/admin/lib/utils/format-image-resize-url.ts +17 -0
- package/resources/templates/template-workspace/admin/lib/utils/formatting.ts +60 -0
- package/resources/templates/template-workspace/admin/lib/utils/index.ts +2 -0
- package/resources/templates/template-workspace/admin/lib/utils/uic.tsx +79 -0
- package/resources/templates/template-workspace/admin/package.json +63 -0
- package/resources/templates/template-workspace/admin/postcss.config.js +6 -0
- package/resources/templates/template-workspace/admin/public/favicon.png +0 -0
- package/resources/templates/template-workspace/admin/tailwind.config.js +73 -0
- package/resources/templates/template-workspace/admin/tsconfig.json +23 -0
- package/resources/templates/template-workspace/admin/vite-env.d.ts +7 -0
- package/resources/templates/template-workspace/admin/vite.config.ts +39 -0
- package/resources/templates/template-workspace/api/index.ts +7 -0
- package/resources/templates/template-workspace/api/migrations/.gitkeep +1 -0
- package/resources/templates/template-workspace/api/model/index.ts +1 -0
- package/resources/templates/template-workspace/api/package.json +16 -0
- package/resources/templates/template-workspace/api/tsconfig.json +10 -0
- package/resources/templates/template-workspace/biome.json +45 -0
- package/resources/templates/template-workspace/client/package.json +16 -0
- package/resources/templates/template-workspace/client/src/index.ts +1 -0
- package/resources/templates/template-workspace/client/tsconfig.json +9 -0
- package/resources/templates/template-workspace/contember.template.yaml +7 -0
- package/resources/templates/template-workspace/docker-compose.yaml +124 -0
- package/resources/templates/template-workspace/package.json +32 -0
- package/resources/templates/template-workspace/scripts/generate-client.sh +8 -0
- package/resources/templates/template-workspace/tsconfig.json +9 -0
- package/resources/templates/template-workspace/tsconfig.settings.json +15 -0
- package/src/commands/WorkspaceCreateCommand.ts +15 -6
- package/src/lib/FileSystem.ts +24 -0
- package/src/lib/PackageDownloader.ts +33 -0
- package/src/lib/TemplateInstaller.ts +102 -0
- package/src/lib/pathUtils.ts +4 -0
- package/src/run.ts +14 -5
- package/tsconfig.settings.json +5 -1
- package/types/download-tarball/index.d.ts +7 -0
- package/types/get-package-json-from-registry/index.d.ts +3 -0
- package/types/registry-info/index.d.ts +7 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { dict } from '../dict'
|
|
2
|
+
|
|
3
|
+
export const formatDate = (date: string | null) => {
|
|
4
|
+
if (date === null) {
|
|
5
|
+
return null
|
|
6
|
+
}
|
|
7
|
+
const d = new Date(date)
|
|
8
|
+
return d.toLocaleDateString()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const formatDateTime = (date: string | null) => {
|
|
12
|
+
if (date === null) {
|
|
13
|
+
return null
|
|
14
|
+
}
|
|
15
|
+
const d = new Date(date)
|
|
16
|
+
return d.toLocaleString()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const formatBoolean = (value: boolean | null) => {
|
|
20
|
+
if (value === null) {
|
|
21
|
+
return null
|
|
22
|
+
}
|
|
23
|
+
return value ? dict.boolean.true : dict.boolean.false
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const createEnumFormatter = (enumValues: Record<string, string>) => (value: string | null) => {
|
|
27
|
+
if (value === null) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
return enumValues[value]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const withFallback = <T>(formatter: (value: T) => string, fallback: string) => (value: T | null) => {
|
|
34
|
+
if (value === null) {
|
|
35
|
+
return fallback
|
|
36
|
+
}
|
|
37
|
+
return formatter(value)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const formatNumber = (value: number | null) => {
|
|
41
|
+
if (value === null) {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
return value.toLocaleString()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const formatBytes = (bytes: number, decimals = 1) => {
|
|
48
|
+
if (bytes === 0) return '0 Bytes'
|
|
49
|
+
const k = 1024
|
|
50
|
+
const dm = decimals + 1 || 3
|
|
51
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
52
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
|
53
|
+
return `${Number.parseFloat((bytes / k ** i).toFixed(dm))} ${sizes[i]}`
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const formatDuration = (duration: number) => {
|
|
57
|
+
const minutes = Math.floor(duration / 60)
|
|
58
|
+
const seconds = duration % 60
|
|
59
|
+
return `${minutes}:${seconds.toString().padStart(2, '0')}`
|
|
60
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ClassValue, clsx } from 'clsx'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { ComponentType, ReactElement, ReactNode } from 'react'
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
5
|
+
import { cva } from 'class-variance-authority'
|
|
6
|
+
import { twMerge } from 'tailwind-merge'
|
|
7
|
+
|
|
8
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T;
|
|
9
|
+
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
10
|
+
|
|
11
|
+
export type ConfigVariants<T extends ConfigSchema | undefined> = T extends ConfigSchema ? {
|
|
12
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined;
|
|
13
|
+
} : {}
|
|
14
|
+
|
|
15
|
+
type ConfigVariantsMulti<T extends ConfigSchema | undefined> = T extends ConfigSchema ? {
|
|
16
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined;
|
|
17
|
+
} : {}
|
|
18
|
+
|
|
19
|
+
type Config<T extends ConfigSchema | undefined, El extends React.ElementType> = {
|
|
20
|
+
baseClass?: ClassValue
|
|
21
|
+
variants?: T;
|
|
22
|
+
passVariantProps?: string[]
|
|
23
|
+
defaultProps?: Partial<React.ComponentProps<El>>
|
|
24
|
+
defaultVariants?: ConfigVariants<T>;
|
|
25
|
+
compoundVariants?: ((ConfigVariants<T> | ConfigVariantsMulti<T>) & { className?: string })[];
|
|
26
|
+
displayName?: string;
|
|
27
|
+
wrapOuter?: ComponentType<{ children?: ReactNode } & ConfigVariants<T>>
|
|
28
|
+
wrapInner?: ComponentType<{ children?: ReactNode } & ConfigVariants<T>>
|
|
29
|
+
beforeChildren?: ReactElement
|
|
30
|
+
afterChildren?: ReactElement
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const uiconfig = <T extends ConfigSchema | undefined>(config: Config<T, ComponentType<{}>>) => config
|
|
34
|
+
|
|
35
|
+
export type NoInfer<T> = T & { [K in keyof T]: T[K] }
|
|
36
|
+
|
|
37
|
+
export const uic = <El extends React.ElementType, Variants extends ConfigSchema | undefined = undefined>(Component: El, config: Config<Variants, NoInfer<El>>) => {
|
|
38
|
+
const cls = cva<any>(config?.baseClass, {
|
|
39
|
+
variants: config?.variants,
|
|
40
|
+
defaultVariants: config?.defaultVariants,
|
|
41
|
+
compoundVariants: config?.compoundVariants,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const component = React.forwardRef<React.ElementRef<El>, React.ComponentProps<El> & {
|
|
45
|
+
asChild?: boolean
|
|
46
|
+
children?: React.ReactNode
|
|
47
|
+
className?: string
|
|
48
|
+
} & ConfigVariants<Variants>>((props, ref) => {
|
|
49
|
+
const { className: classNameProp, children: childrenBase, ...rest } = props
|
|
50
|
+
|
|
51
|
+
for (const key in config?.variants) {
|
|
52
|
+
if (key in rest && !config?.passVariantProps?.includes(key)) {
|
|
53
|
+
delete (rest as any)[key]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let Comp: React.ElementType = Component
|
|
57
|
+
if (props.asChild && typeof Component === 'string') {
|
|
58
|
+
Comp = Slot
|
|
59
|
+
delete (rest as any).asChild
|
|
60
|
+
}
|
|
61
|
+
let children = childrenBase
|
|
62
|
+
if (config?.wrapInner) {
|
|
63
|
+
children = React.createElement(config.wrapInner, props, children)
|
|
64
|
+
}
|
|
65
|
+
if (config?.beforeChildren || config?.afterChildren) {
|
|
66
|
+
children = <>
|
|
67
|
+
{config?.beforeChildren}
|
|
68
|
+
{children}
|
|
69
|
+
{config?.afterChildren}
|
|
70
|
+
</>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const innerEl = <Comp ref={ref} className={twMerge(clsx(cls(props), classNameProp))} {...(config.defaultProps ?? {})} {...rest}>{children}</Comp>
|
|
74
|
+
return config?.wrapOuter ? React.createElement(config.wrapOuter, props, innerEl) : innerEl
|
|
75
|
+
})
|
|
76
|
+
component.displayName = config?.displayName
|
|
77
|
+
|
|
78
|
+
return component
|
|
79
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app/admin",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite --port 1480 --host 0.0.0.0",
|
|
7
|
+
"build": "vite build . \"$0\"",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@contember/vite-plugin": "2.0.0-alpha.5",
|
|
12
|
+
"@types/react": "^18",
|
|
13
|
+
"@types/react-dom": "^18",
|
|
14
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
15
|
+
"autoprefixer": "^10",
|
|
16
|
+
"postcss": "^8",
|
|
17
|
+
"tailwindcss": "^3",
|
|
18
|
+
"tailwindcss-animate": "^1.0.7",
|
|
19
|
+
"vite": "^5"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@contember/client-content": "2.0.0-alpha.5",
|
|
23
|
+
"@contember/graphql-client": "2.0.0-alpha.5",
|
|
24
|
+
"@contember/graphql-client-tenant": "{version}",
|
|
25
|
+
"@contember/interface": "2.0.0-alpha.5",
|
|
26
|
+
"@contember/react-block-repeater": "2.0.0-alpha.5",
|
|
27
|
+
"@contember/react-board": "2.0.0-alpha.5",
|
|
28
|
+
"@contember/react-board-dnd-kit": "2.0.0-alpha.5",
|
|
29
|
+
"@contember/react-dataview": "2.0.0-alpha.5",
|
|
30
|
+
"@contember/react-form": "2.0.0-alpha.5",
|
|
31
|
+
"@contember/react-repeater": "2.0.0-alpha.5",
|
|
32
|
+
"@contember/react-repeater-dnd-kit": "2.0.0-alpha.5",
|
|
33
|
+
"@contember/react-select": "2.0.0-alpha.5",
|
|
34
|
+
"@contember/react-slate-editor": "2.0.0-alpha.5",
|
|
35
|
+
"@contember/react-slate-editor-base": "2.0.0-alpha.5",
|
|
36
|
+
"@contember/react-slots": "2.0.0-alpha.5",
|
|
37
|
+
"@contember/react-uploader": "2.0.0-alpha.5",
|
|
38
|
+
"@contember/react-uploader-dropzone": "2.0.0-alpha.5",
|
|
39
|
+
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
40
|
+
"@radix-ui/react-checkbox": "^1.0.4",
|
|
41
|
+
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
42
|
+
"@radix-ui/react-label": "^2.0.2",
|
|
43
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
44
|
+
"@radix-ui/react-primitive": "^1.0.3",
|
|
45
|
+
"@radix-ui/react-progress": "^1.0.3",
|
|
46
|
+
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
47
|
+
"@radix-ui/react-select": "^2.0.0",
|
|
48
|
+
"@radix-ui/react-separator": "^1.0.3",
|
|
49
|
+
"@radix-ui/react-slot": "^1.0.2",
|
|
50
|
+
"@radix-ui/react-switch": "^1.0.3",
|
|
51
|
+
"@radix-ui/react-toast": "^1.1.5",
|
|
52
|
+
"@radix-ui/react-toolbar": "^1.0.4",
|
|
53
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
54
|
+
"class-variance-authority": "^0.7.0",
|
|
55
|
+
"lucide-react": "^0.377.0",
|
|
56
|
+
"qrcode-generator": "^1.4.4",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0",
|
|
59
|
+
"slate": "^0.103.0",
|
|
60
|
+
"slate-react": "^0.102.0",
|
|
61
|
+
"tailwind-merge": "^2.2.1"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
/** @type {import('tailwindcss').Config} */
|
|
3
|
+
module.exports = {
|
|
4
|
+
content: ['./{app,lib}/**/*.{html,js,tsx,ts}', '*.{html,js,ts,tsx}'],
|
|
5
|
+
darkMode: ['class'],
|
|
6
|
+
theme: {
|
|
7
|
+
container: {
|
|
8
|
+
center: true,
|
|
9
|
+
padding: '2rem',
|
|
10
|
+
screens: {
|
|
11
|
+
'2xl': '1400px',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
extend: {
|
|
15
|
+
colors: {
|
|
16
|
+
border: 'hsl(var(--border))',
|
|
17
|
+
input: 'hsl(var(--input))',
|
|
18
|
+
ring: 'hsl(var(--ring))',
|
|
19
|
+
background: 'hsl(var(--background))',
|
|
20
|
+
foreground: 'hsl(var(--foreground))',
|
|
21
|
+
primary: {
|
|
22
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
23
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
24
|
+
},
|
|
25
|
+
secondary: {
|
|
26
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
27
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
28
|
+
},
|
|
29
|
+
destructive: {
|
|
30
|
+
DEFAULT: 'hsl(var(--destructive) / <alpha-value>)',
|
|
31
|
+
foreground: 'hsl(var(--destructive-foreground) / <alpha-value>)',
|
|
32
|
+
},
|
|
33
|
+
muted: {
|
|
34
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
35
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
36
|
+
},
|
|
37
|
+
accent: {
|
|
38
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
39
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
40
|
+
},
|
|
41
|
+
popover: {
|
|
42
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
43
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
44
|
+
},
|
|
45
|
+
card: {
|
|
46
|
+
DEFAULT: 'hsl(var(--card))',
|
|
47
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
borderRadius: {
|
|
51
|
+
xl: `calc(var(--radius) + 4px)`,
|
|
52
|
+
lg: `var(--radius)`,
|
|
53
|
+
md: `calc(var(--radius) - 2px)`,
|
|
54
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
55
|
+
},
|
|
56
|
+
keyframes: {
|
|
57
|
+
'accordion-down': {
|
|
58
|
+
from: { height: '0' },
|
|
59
|
+
to: { height: 'var(--radix-accordion-content-height)' },
|
|
60
|
+
},
|
|
61
|
+
'accordion-up': {
|
|
62
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
63
|
+
to: { height: '0' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
animation: {
|
|
67
|
+
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
68
|
+
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
plugins: [require('tailwindcss-animate')],
|
|
73
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../tsconfig.settings.json"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"lib": [
|
|
7
|
+
"esnext",
|
|
8
|
+
"dom",
|
|
9
|
+
"dom.iterable",
|
|
10
|
+
],
|
|
11
|
+
"paths": {
|
|
12
|
+
"@app/components": [
|
|
13
|
+
"./app/components/*"
|
|
14
|
+
],
|
|
15
|
+
"@app/lib/*": [
|
|
16
|
+
"./lib/*"
|
|
17
|
+
],
|
|
18
|
+
"@app/lib/plugins/*": [
|
|
19
|
+
"./lib/plugins/*"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import { contember } from '@contember/vite-plugin'
|
|
3
|
+
import react from '@vitejs/plugin-react'
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
6
|
+
|
|
7
|
+
export default defineConfig(() => {
|
|
8
|
+
const dsn = process.argv.find(it => it.includes('contember://'))
|
|
9
|
+
const projectName = dsn ? new URL(dsn).username : null
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
define: projectName ? { 'import.meta.env.VITE_CONTEMBER_ADMIN_PROJECT_NAME': JSON.stringify(projectName) } : {},
|
|
13
|
+
base: '/',
|
|
14
|
+
plugins: [
|
|
15
|
+
tsconfigPaths(),
|
|
16
|
+
react(),
|
|
17
|
+
contember(),
|
|
18
|
+
{
|
|
19
|
+
name: 'rewrite-middleware',
|
|
20
|
+
configureServer(serve) {
|
|
21
|
+
serve.middlewares.use((req, res, next) => {
|
|
22
|
+
if (req.url === '/app' || (req.url?.startsWith('/app/') && !req.url?.match(/\.\w+($|\?)/))) {
|
|
23
|
+
req.url = '/app/'
|
|
24
|
+
}
|
|
25
|
+
next()
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
build: {
|
|
31
|
+
rollupOptions: {
|
|
32
|
+
input: {
|
|
33
|
+
root: resolve(__dirname, './index.html'),
|
|
34
|
+
app: resolve(__dirname, './app/index.html'),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// silence is golden
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default null
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app/api",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\""
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@contember/schema": "{version}",
|
|
11
|
+
"@contember/schema-definition": "{version}"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"graphql": "^16.8.1"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
|
|
3
|
+
"organizeImports": {
|
|
4
|
+
"enabled": true
|
|
5
|
+
},
|
|
6
|
+
"files": {
|
|
7
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
8
|
+
"ignore": ["node_modules/**", "dist/**", "client/src/**"]
|
|
9
|
+
},
|
|
10
|
+
"formatter": {
|
|
11
|
+
"enabled": true,
|
|
12
|
+
"lineWidth": 150
|
|
13
|
+
},
|
|
14
|
+
"javascript": {
|
|
15
|
+
"formatter": {
|
|
16
|
+
"jsxQuoteStyle": "double",
|
|
17
|
+
"quoteStyle": "single",
|
|
18
|
+
"semicolons": "asNeeded",
|
|
19
|
+
"arrowParentheses": "asNeeded"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"linter": {
|
|
23
|
+
"enabled": true,
|
|
24
|
+
"rules": {
|
|
25
|
+
"recommended": true,
|
|
26
|
+
"correctness": {
|
|
27
|
+
"noChildrenProp": "off"
|
|
28
|
+
},
|
|
29
|
+
"style": {
|
|
30
|
+
"useNodejsImportProtocol": "off",
|
|
31
|
+
"useImportType": "off",
|
|
32
|
+
"noNonNullAssertion": "off"
|
|
33
|
+
},
|
|
34
|
+
"suspicious": {
|
|
35
|
+
"noConsoleLog": "error",
|
|
36
|
+
"noExplicitAny": "off",
|
|
37
|
+
"noConfusingVoidType": "off",
|
|
38
|
+
"noArrayIndexKey": "off"
|
|
39
|
+
},
|
|
40
|
+
"a11y": {
|
|
41
|
+
"all": false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app/client",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"typings": "./dist/src/index.d.ts",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/src/index.d.ts",
|
|
8
|
+
"import": "./dist/src/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "echo \"No test\""
|
|
13
|
+
},
|
|
14
|
+
"private": true,
|
|
15
|
+
"type": "module"
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
services:
|
|
2
|
+
contember-engine:
|
|
3
|
+
image: contember/engine:{version}
|
|
4
|
+
|
|
5
|
+
environment:
|
|
6
|
+
NODE_ENV: 'development'
|
|
7
|
+
|
|
8
|
+
CONTEMBER_PORT: '4000'
|
|
9
|
+
CONTEMBER_ROOT_EMAIL: 'contember@localhost'
|
|
10
|
+
CONTEMBER_ROOT_PASSWORD: 'contember'
|
|
11
|
+
CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000' # openssl rand -hex 20
|
|
12
|
+
CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111' # openssl rand -hex 20
|
|
13
|
+
CONTEMBER_ENCRYPTION_KEY: '2222222222222222222222222222222222222222222222222222222222222222' # openssl rand -hex 32
|
|
14
|
+
|
|
15
|
+
DEFAULT_DB_HOST: 'postgres'
|
|
16
|
+
DEFAULT_DB_PORT: '5432'
|
|
17
|
+
DEFAULT_DB_NAME: 'contember'
|
|
18
|
+
DEFAULT_DB_USER: 'contember'
|
|
19
|
+
DEFAULT_DB_PASSWORD: 'contember'
|
|
20
|
+
|
|
21
|
+
DEFAULT_S3_ENDPOINT: 'http://localhost:1483'
|
|
22
|
+
DEFAULT_S3_BUCKET: 'contember'
|
|
23
|
+
DEFAULT_S3_REGION: ''
|
|
24
|
+
DEFAULT_S3_KEY: 'contember'
|
|
25
|
+
DEFAULT_S3_SECRET: 'contember'
|
|
26
|
+
DEFAULT_S3_PROVIDER: 'minio'
|
|
27
|
+
|
|
28
|
+
TENANT_MAILER_HOST: 'mailhog'
|
|
29
|
+
TENANT_MAILER_PORT: '1025'
|
|
30
|
+
TENANT_MAILER_FROM: 'contember@localhost'
|
|
31
|
+
|
|
32
|
+
ports:
|
|
33
|
+
- '1481:4000'
|
|
34
|
+
|
|
35
|
+
healthcheck:
|
|
36
|
+
test: 'curl --fail http://localhost:4000'
|
|
37
|
+
interval: 5s
|
|
38
|
+
timeout: 5s
|
|
39
|
+
retries: 10
|
|
40
|
+
|
|
41
|
+
depends_on:
|
|
42
|
+
postgres:
|
|
43
|
+
condition: service_healthy
|
|
44
|
+
|
|
45
|
+
contember-cli:
|
|
46
|
+
image: contember/cli:{version}
|
|
47
|
+
user: '1000:1000'
|
|
48
|
+
|
|
49
|
+
deploy:
|
|
50
|
+
replicas: 0
|
|
51
|
+
|
|
52
|
+
environment:
|
|
53
|
+
CONTEMBER_API_URL: 'http://contember-engine:4000/'
|
|
54
|
+
CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
|
|
55
|
+
CONTEMBER_PROJECT_NAME: 'app'
|
|
56
|
+
|
|
57
|
+
volumes:
|
|
58
|
+
- ./:/src
|
|
59
|
+
|
|
60
|
+
depends_on:
|
|
61
|
+
contember-engine:
|
|
62
|
+
condition: service_healthy
|
|
63
|
+
|
|
64
|
+
postgres:
|
|
65
|
+
image: postgres:16-alpine
|
|
66
|
+
|
|
67
|
+
environment:
|
|
68
|
+
POSTGRES_USER: 'contember'
|
|
69
|
+
POSTGRES_PASSWORD: 'contember'
|
|
70
|
+
POSTGRES_DB: 'contember'
|
|
71
|
+
|
|
72
|
+
ports:
|
|
73
|
+
- '1482:5432'
|
|
74
|
+
|
|
75
|
+
volumes:
|
|
76
|
+
- pgsql-data:/var/lib/postgresql/data
|
|
77
|
+
|
|
78
|
+
healthcheck:
|
|
79
|
+
test: 'pg_isready --username contember'
|
|
80
|
+
interval: 5s
|
|
81
|
+
timeout: 5s
|
|
82
|
+
retries: 10
|
|
83
|
+
|
|
84
|
+
minio:
|
|
85
|
+
image: bitnami/minio
|
|
86
|
+
|
|
87
|
+
environment:
|
|
88
|
+
MINIO_ROOT_USER: 'contember'
|
|
89
|
+
MINIO_ROOT_PASSWORD: 'contember'
|
|
90
|
+
MINIO_DEFAULT_BUCKETS: 'contember:download'
|
|
91
|
+
|
|
92
|
+
ports:
|
|
93
|
+
- '1483:9000'
|
|
94
|
+
|
|
95
|
+
volumes:
|
|
96
|
+
- minio-data:/bitnami/minio/data
|
|
97
|
+
|
|
98
|
+
mailhog:
|
|
99
|
+
image: mailhog/mailhog
|
|
100
|
+
ports:
|
|
101
|
+
- '1484:8025'
|
|
102
|
+
|
|
103
|
+
adminer:
|
|
104
|
+
image: michalhosna/adminer:4.8.0-en_v1
|
|
105
|
+
|
|
106
|
+
environment:
|
|
107
|
+
ADMINER_DRIVER: 'pgsql'
|
|
108
|
+
ADMINER_SERVER: 'postgres'
|
|
109
|
+
ADMINER_DB: 'contember'
|
|
110
|
+
ADMINER_USERNAME: 'contember'
|
|
111
|
+
ADMINER_PASSWORD: 'contember'
|
|
112
|
+
ADMINER_AUTOLOGIN: '1'
|
|
113
|
+
ADMINER_NAME: 'Contember'
|
|
114
|
+
|
|
115
|
+
ports:
|
|
116
|
+
- '1485:8080'
|
|
117
|
+
|
|
118
|
+
depends_on:
|
|
119
|
+
postgres:
|
|
120
|
+
condition: service_healthy
|
|
121
|
+
|
|
122
|
+
volumes:
|
|
123
|
+
pgsql-data: ~
|
|
124
|
+
minio-data: ~
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"scripts": {
|
|
4
|
+
"contember": "docker-compose run --rm contember-cli",
|
|
5
|
+
"start": "yarn run contember:start-engine && yarn run client:generate && yarn contember:start-admin",
|
|
6
|
+
"build": "yarn run ts:build && yarn run contember:build-admin \"$0\" && yarn run contember:build-api",
|
|
7
|
+
"deploy": "yarn run build \"$0\" && docker-compose run --no-deps contember-cli deploy \"$@\" --root",
|
|
8
|
+
"contember:start-engine": "docker-compose up --detach && yarn run contember migrations:execute --yes",
|
|
9
|
+
"contember:start-admin": "yarn workspace @app/admin dev",
|
|
10
|
+
"contember:build-admin": "tsc --project admin && yarn workspace @app/admin build \"$0\"",
|
|
11
|
+
"contember:build-api": "tsc --project api",
|
|
12
|
+
"client:build": "tsc --project client",
|
|
13
|
+
"client:generate": "bash ./scripts/generate-client.sh",
|
|
14
|
+
"ts:build": "tsc --build",
|
|
15
|
+
"ts:clean": "tsc --build --clean",
|
|
16
|
+
"ts:watch": "tsc --build --watch",
|
|
17
|
+
"lint": "biome lint .",
|
|
18
|
+
"lint:fix": "biome lint . --apply"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@biomejs/biome": "^1.7.1",
|
|
22
|
+
"@contember/client-content-generator": "2.0.0-alpha.5",
|
|
23
|
+
"typescript": "^5.0",
|
|
24
|
+
"vite": "^5",
|
|
25
|
+
"vite-tsconfig-paths": "^4.3.1"
|
|
26
|
+
},
|
|
27
|
+
"workspaces": [
|
|
28
|
+
"admin",
|
|
29
|
+
"api",
|
|
30
|
+
"client"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
docker-compose run --rm --entrypoint="" contember-cli sh -c "
|
|
4
|
+
node /opt/contember/run.js project:print-schema --format=schema > /tmp/contember-schema.json
|
|
5
|
+
yarn run --silent contember-client-generator /tmp/contember-schema.json ./client/src
|
|
6
|
+
rm /tmp/contember-schema.json
|
|
7
|
+
"
|
|
8
|
+
|