@motiadev/workbench 0.13.2-beta.164-110989 → 0.13.2-beta.164-704005

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.
Files changed (237) hide show
  1. package/dist/index.d.ts +10 -189
  2. package/dist/index.html +1 -1
  3. package/dist/index.js +7 -1065
  4. package/dist/middleware.d.ts +8 -66
  5. package/dist/middleware.js +86 -694
  6. package/dist/motia-plugin/__tests__/generator.test.d.ts +1 -0
  7. package/dist/motia-plugin/__tests__/generator.test.js +97 -0
  8. package/dist/motia-plugin/__tests__/resolver.test.d.ts +1 -0
  9. package/dist/motia-plugin/__tests__/resolver.test.js +64 -0
  10. package/dist/motia-plugin/__tests__/validator.test.d.ts +1 -0
  11. package/dist/motia-plugin/__tests__/validator.test.js +59 -0
  12. package/dist/motia-plugin/generator.d.ts +78 -0
  13. package/dist/motia-plugin/{generator.ts → generator.js} +35 -37
  14. package/dist/motia-plugin/hmr.d.ts +22 -0
  15. package/dist/motia-plugin/hmr.js +100 -0
  16. package/dist/motia-plugin/index.d.ts +3 -0
  17. package/dist/motia-plugin/index.js +153 -0
  18. package/dist/motia-plugin/{resolver.ts → resolver.d.ts} +5 -38
  19. package/dist/motia-plugin/resolver.js +92 -0
  20. package/dist/motia-plugin/types.d.ts +169 -0
  21. package/dist/motia-plugin/types.js +36 -0
  22. package/dist/motia-plugin/{utils.ts → utils.d.ts} +4 -17
  23. package/dist/motia-plugin/utils.js +75 -0
  24. package/dist/motia-plugin/validator.d.ts +19 -0
  25. package/dist/motia-plugin/validator.js +163 -0
  26. package/dist/src/App.d.ts +2 -0
  27. package/dist/src/App.js +35 -0
  28. package/dist/src/components/NotFoundPage.d.ts +1 -0
  29. package/dist/src/components/NotFoundPage.js +3 -0
  30. package/dist/src/components/bottom-panel.d.ts +1 -0
  31. package/dist/src/components/bottom-panel.js +15 -0
  32. package/dist/src/components/flow/base-edge.d.ts +3 -0
  33. package/dist/src/components/flow/base-edge.js +39 -0
  34. package/dist/src/components/flow/flow-loader.d.ts +1 -0
  35. package/dist/src/components/flow/flow-loader.js +4 -0
  36. package/dist/src/components/flow/flow-page.d.ts +1 -0
  37. package/dist/src/components/flow/flow-page.js +25 -0
  38. package/dist/src/components/flow/flow-tab-menu-item.d.ts +1 -0
  39. package/dist/src/components/flow/flow-tab-menu-item.js +18 -0
  40. package/dist/src/components/flow/flow-view.d.ts +12 -0
  41. package/dist/src/components/flow/flow-view.js +22 -0
  42. package/dist/src/components/flow/hooks/use-get-flow-state.d.ts +10 -0
  43. package/dist/src/components/flow/hooks/use-get-flow-state.js +133 -0
  44. package/dist/src/components/flow/hooks/use-save-workflow-config.d.ts +2 -0
  45. package/dist/src/components/flow/hooks/use-save-workflow-config.js +22 -0
  46. package/dist/src/components/flow/node-organizer.d.ts +10 -0
  47. package/dist/src/components/flow/node-organizer.js +82 -0
  48. package/dist/src/components/flow/nodes/api-flow-node.d.ts +2 -0
  49. package/dist/src/components/flow/nodes/api-flow-node.js +5 -0
  50. package/dist/src/components/flow/nodes/cron-flow-node.d.ts +2 -0
  51. package/dist/src/components/flow/nodes/cron-flow-node.js +5 -0
  52. package/dist/src/components/flow/nodes/event-flow-node.d.ts +2 -0
  53. package/dist/src/components/flow/nodes/event-flow-node.js +5 -0
  54. package/dist/src/components/flow/nodes/noop-flow-node.d.ts +2 -0
  55. package/dist/src/components/flow/nodes/noop-flow-node.js +5 -0
  56. package/dist/src/components/header/deploy-button.d.ts +1 -0
  57. package/dist/src/components/header/deploy-button.js +28 -0
  58. package/dist/src/components/header/header.d.ts +2 -0
  59. package/dist/src/components/header/header.js +23 -0
  60. package/dist/src/components/root-motia.d.ts +2 -0
  61. package/dist/src/components/root-motia.js +7 -0
  62. package/dist/src/components/top-panel.d.ts +1 -0
  63. package/dist/src/components/top-panel.js +15 -0
  64. package/dist/src/components/tutorial/engine/tutorial-engine.d.ts +12 -0
  65. package/dist/src/components/tutorial/engine/tutorial-engine.js +36 -0
  66. package/dist/src/components/tutorial/engine/tutorial-types.d.ts +22 -0
  67. package/dist/src/components/tutorial/engine/tutorial-types.js +1 -0
  68. package/dist/src/components/tutorial/engine/workbench-xpath.d.ts +45 -0
  69. package/dist/src/components/tutorial/engine/workbench-xpath.js +45 -0
  70. package/dist/src/components/tutorial/hooks/tutorial-utils.d.ts +1 -0
  71. package/dist/src/components/tutorial/hooks/tutorial-utils.js +17 -0
  72. package/dist/src/components/tutorial/hooks/use-tutorial-engine.d.ts +15 -0
  73. package/dist/src/components/tutorial/hooks/use-tutorial-engine.js +183 -0
  74. package/dist/src/components/tutorial/hooks/use-tutorial.d.ts +5 -0
  75. package/dist/src/components/tutorial/hooks/use-tutorial.js +10 -0
  76. package/dist/src/components/tutorial/tutorial-button.d.ts +2 -0
  77. package/dist/src/components/tutorial/tutorial-button.js +21 -0
  78. package/dist/src/components/tutorial/tutorial-step.d.ts +14 -0
  79. package/dist/src/components/tutorial/tutorial-step.js +19 -0
  80. package/dist/src/components/tutorial/tutorial.css +2 -2
  81. package/dist/src/components/tutorial/tutorial.d.ts +2 -0
  82. package/dist/src/components/tutorial/tutorial.js +32 -0
  83. package/dist/src/components/ui/json-editor.d.ts +12 -0
  84. package/dist/src/components/ui/json-editor.js +35 -0
  85. package/dist/src/components/ui/table.d.ts +10 -0
  86. package/dist/src/components/ui/table.js +20 -0
  87. package/dist/src/components/ui/theme-toggle.d.ts +2 -0
  88. package/dist/src/components/ui/theme-toggle.js +19 -0
  89. package/dist/src/components/ui/tooltip.d.ts +6 -0
  90. package/dist/src/components/ui/tooltip.js +3 -0
  91. package/dist/src/hooks/use-debounced.d.ts +1 -0
  92. package/dist/src/hooks/use-debounced.js +18 -0
  93. package/dist/src/hooks/use-fetch-flows.d.ts +1 -0
  94. package/dist/src/hooks/use-fetch-flows.js +26 -0
  95. package/dist/src/hooks/use-mobile.d.ts +1 -0
  96. package/dist/src/hooks/use-mobile.js +15 -0
  97. package/dist/src/hooks/use-update-handle-positions.d.ts +10 -0
  98. package/dist/src/hooks/use-update-handle-positions.js +35 -0
  99. package/dist/src/index.css +5 -5
  100. package/dist/src/lib/__tests__/utils.test.d.ts +1 -0
  101. package/dist/src/lib/__tests__/utils.test.js +94 -0
  102. package/dist/src/lib/motia-analytics.d.ts +38 -0
  103. package/dist/src/lib/motia-analytics.js +132 -0
  104. package/dist/src/lib/plugins.d.ts +2 -0
  105. package/dist/src/lib/plugins.js +105 -0
  106. package/dist/src/lib/utils.d.ts +7 -0
  107. package/dist/src/lib/utils.js +34 -0
  108. package/dist/src/main.d.ts +2 -0
  109. package/dist/src/main.js +17 -0
  110. package/dist/src/project-view-mode.d.ts +1 -0
  111. package/dist/src/project-view-mode.js +20 -0
  112. package/dist/src/publicComponents/api-node.d.ts +5 -0
  113. package/dist/src/publicComponents/api-node.js +5 -0
  114. package/dist/src/publicComponents/base-node/base-handle.d.ts +9 -0
  115. package/dist/src/publicComponents/base-node/base-handle.js +8 -0
  116. package/dist/src/publicComponents/base-node/base-node.d.ts +15 -0
  117. package/dist/src/publicComponents/base-node/base-node.js +30 -0
  118. package/dist/src/publicComponents/base-node/code-display.d.ts +9 -0
  119. package/dist/src/publicComponents/base-node/code-display.js +64 -0
  120. package/dist/src/publicComponents/base-node/emits.d.ts +5 -0
  121. package/dist/src/publicComponents/base-node/emits.js +5 -0
  122. package/dist/src/publicComponents/base-node/feature-card.d.ts +10 -0
  123. package/dist/src/publicComponents/base-node/feature-card.js +5 -0
  124. package/dist/src/publicComponents/base-node/language-indicator.d.ts +10 -0
  125. package/dist/src/publicComponents/base-node/language-indicator.js +29 -0
  126. package/dist/src/publicComponents/base-node/node-header.d.ts +13 -0
  127. package/dist/src/publicComponents/base-node/node-header.js +30 -0
  128. package/dist/src/publicComponents/base-node/node-sidebar.d.ts +14 -0
  129. package/dist/src/publicComponents/base-node/node-sidebar.js +9 -0
  130. package/dist/src/publicComponents/base-node/subscribe.d.ts +4 -0
  131. package/dist/src/publicComponents/base-node/subscribe.js +4 -0
  132. package/dist/src/publicComponents/cron-node.d.ts +4 -0
  133. package/dist/src/publicComponents/cron-node.js +6 -0
  134. package/dist/src/publicComponents/event-node.d.ts +4 -0
  135. package/dist/src/publicComponents/event-node.js +5 -0
  136. package/dist/src/publicComponents/node-props.d.ts +21 -0
  137. package/dist/src/publicComponents/node-props.js +1 -0
  138. package/dist/src/publicComponents/noop-node.d.ts +4 -0
  139. package/dist/src/publicComponents/noop-node.js +5 -0
  140. package/dist/src/setupTests.d.ts +1 -0
  141. package/dist/src/setupTests.js +1 -0
  142. package/dist/src/stores/use-app-tabs-store.d.ts +16 -0
  143. package/dist/src/stores/use-app-tabs-store.js +31 -0
  144. package/dist/src/stores/use-flow-store.d.ts +21 -0
  145. package/dist/src/stores/use-flow-store.js +16 -0
  146. package/dist/src/stores/use-global-store.d.ts +18 -0
  147. package/dist/src/stores/use-global-store.js +12 -0
  148. package/dist/src/stores/use-motia-config-store.d.ts +12 -0
  149. package/dist/src/stores/use-motia-config-store.js +24 -0
  150. package/dist/src/stores/use-tabs-store.d.ts +19 -0
  151. package/dist/src/stores/use-tabs-store.js +22 -0
  152. package/dist/src/system-view-mode.d.ts +1 -0
  153. package/dist/src/system-view-mode.js +10 -0
  154. package/dist/src/types/endpoint.d.ts +14 -0
  155. package/dist/src/types/endpoint.js +1 -0
  156. package/dist/src/types/file.d.ts +7 -0
  157. package/dist/src/types/file.js +1 -0
  158. package/dist/src/types/flow.d.ts +115 -0
  159. package/dist/src/types/flow.js +1 -0
  160. package/dist/tsconfig.app.tsbuildinfo +1 -0
  161. package/dist/tsconfig.node.tsbuildinfo +1 -0
  162. package/package.json +51 -53
  163. package/dist/motia-plugin/__tests__/generator.test.ts +0 -129
  164. package/dist/motia-plugin/__tests__/resolver.test.ts +0 -82
  165. package/dist/motia-plugin/__tests__/validator.test.ts +0 -71
  166. package/dist/motia-plugin/hmr.ts +0 -123
  167. package/dist/motia-plugin/index.ts +0 -183
  168. package/dist/motia-plugin/types.ts +0 -198
  169. package/dist/motia-plugin/validator.ts +0 -197
  170. package/dist/src/App.tsx +0 -41
  171. package/dist/src/components/NotFoundPage.tsx +0 -11
  172. package/dist/src/components/bottom-panel.tsx +0 -39
  173. package/dist/src/components/flow/base-edge.tsx +0 -61
  174. package/dist/src/components/flow/flow-loader.tsx +0 -3
  175. package/dist/src/components/flow/flow-page.tsx +0 -75
  176. package/dist/src/components/flow/flow-tab-menu-item.tsx +0 -52
  177. package/dist/src/components/flow/flow-view.tsx +0 -66
  178. package/dist/src/components/flow/hooks/use-get-flow-state.tsx +0 -171
  179. package/dist/src/components/flow/hooks/use-save-workflow-config.ts +0 -25
  180. package/dist/src/components/flow/node-organizer.tsx +0 -103
  181. package/dist/src/components/flow/nodes/api-flow-node.tsx +0 -6
  182. package/dist/src/components/flow/nodes/cron-flow-node.tsx +0 -6
  183. package/dist/src/components/flow/nodes/event-flow-node.tsx +0 -6
  184. package/dist/src/components/flow/nodes/noop-flow-node.tsx +0 -6
  185. package/dist/src/components/header/deploy-button.tsx +0 -110
  186. package/dist/src/components/header/header.tsx +0 -39
  187. package/dist/src/components/root-motia.tsx +0 -10
  188. package/dist/src/components/top-panel.tsx +0 -40
  189. package/dist/src/components/tutorial/engine/tutorial-engine.ts +0 -26
  190. package/dist/src/components/tutorial/engine/tutorial-types.ts +0 -26
  191. package/dist/src/components/tutorial/engine/workbench-xpath.ts +0 -53
  192. package/dist/src/components/tutorial/hooks/tutorial-utils.ts +0 -26
  193. package/dist/src/components/tutorial/hooks/use-tutorial-engine.ts +0 -213
  194. package/dist/src/components/tutorial/hooks/use-tutorial.ts +0 -14
  195. package/dist/src/components/tutorial/tutorial-button.tsx +0 -46
  196. package/dist/src/components/tutorial/tutorial-step.tsx +0 -82
  197. package/dist/src/components/tutorial/tutorial.tsx +0 -59
  198. package/dist/src/components/ui/json-editor.tsx +0 -68
  199. package/dist/src/components/ui/table.tsx +0 -75
  200. package/dist/src/components/ui/theme-toggle.tsx +0 -54
  201. package/dist/src/components/ui/tooltip.tsx +0 -26
  202. package/dist/src/hooks/use-debounced.ts +0 -22
  203. package/dist/src/hooks/use-fetch-flows.ts +0 -33
  204. package/dist/src/hooks/use-mobile.ts +0 -19
  205. package/dist/src/hooks/use-update-handle-positions.ts +0 -42
  206. package/dist/src/lib/__tests__/utils.test.ts +0 -110
  207. package/dist/src/lib/motia-analytics.ts +0 -140
  208. package/dist/src/lib/plugins.tsx +0 -132
  209. package/dist/src/lib/utils.ts +0 -37
  210. package/dist/src/main.tsx +0 -30
  211. package/dist/src/project-view-mode.tsx +0 -32
  212. package/dist/src/publicComponents/api-node.tsx +0 -26
  213. package/dist/src/publicComponents/base-node/base-handle.tsx +0 -50
  214. package/dist/src/publicComponents/base-node/base-node.tsx +0 -114
  215. package/dist/src/publicComponents/base-node/code-display.tsx +0 -119
  216. package/dist/src/publicComponents/base-node/emits.tsx +0 -17
  217. package/dist/src/publicComponents/base-node/feature-card.tsx +0 -32
  218. package/dist/src/publicComponents/base-node/language-indicator.tsx +0 -131
  219. package/dist/src/publicComponents/base-node/node-header.tsx +0 -49
  220. package/dist/src/publicComponents/base-node/node-sidebar.tsx +0 -41
  221. package/dist/src/publicComponents/base-node/subscribe.tsx +0 -13
  222. package/dist/src/publicComponents/cron-node.tsx +0 -24
  223. package/dist/src/publicComponents/event-node.tsx +0 -20
  224. package/dist/src/publicComponents/node-props.tsx +0 -15
  225. package/dist/src/publicComponents/noop-node.tsx +0 -19
  226. package/dist/src/setupTests.ts +0 -1
  227. package/dist/src/stores/use-app-tabs-store.ts +0 -49
  228. package/dist/src/stores/use-flow-store.ts +0 -31
  229. package/dist/src/stores/use-global-store.ts +0 -24
  230. package/dist/src/stores/use-motia-config-store.ts +0 -36
  231. package/dist/src/stores/use-tabs-store.ts +0 -34
  232. package/dist/src/system-view-mode.tsx +0 -28
  233. package/dist/src/types/endpoint.ts +0 -12
  234. package/dist/src/types/file.ts +0 -7
  235. package/dist/src/types/flow.ts +0 -103
  236. package/eslint.config.cjs +0 -22
  237. package/jest.config.cjs +0 -68
@@ -1,15 +0,0 @@
1
- import type { ApiNodeData, CronNodeData, EventNodeData, NoopNodeData } from '../types/flow'
2
-
3
- export type NodeProps = EventNodeProps | NoopNodeProps | ApiNodeProps | CronNodeProps
4
- export type BaseNodeProps = {
5
- id: string
6
- nodeConfig?: {
7
- sourceHandlePosition?: 'bottom' | 'right'
8
- targetHandlePosition?: 'top' | 'left'
9
- }
10
- }
11
-
12
- export type EventNodeProps = { data: BaseNodeProps & EventNodeData }
13
- export type NoopNodeProps = { data: BaseNodeProps & NoopNodeData }
14
- export type ApiNodeProps = { data: BaseNodeProps & ApiNodeData }
15
- export type CronNodeProps = { data: BaseNodeProps & CronNodeData }
@@ -1,19 +0,0 @@
1
- import type React from 'react'
2
- import type { PropsWithChildren } from 'react'
3
- import { BaseNode } from './base-node/base-node'
4
- import type { NoopNodeProps } from './node-props'
5
-
6
- export const NoopNode: React.FC<PropsWithChildren<NoopNodeProps>> = ({ data, children }) => {
7
- return (
8
- <BaseNode
9
- data={data}
10
- variant="noop"
11
- title={data.name}
12
- subtitle={data.description}
13
- disableSourceHandle={!data.virtualEmits.length}
14
- disableTargetHandle={!data.subscribes?.length}
15
- >
16
- {children}
17
- </BaseNode>
18
- )
19
- }
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom'
@@ -1,49 +0,0 @@
1
- import { create } from 'zustand'
2
-
3
- export enum TabLocation {
4
- TOP = 'top',
5
- BOTTOM = 'bottom',
6
- }
7
-
8
- export type AppTab = {
9
- id: string
10
- tabLabel: React.ElementType
11
- content: React.ElementType
12
- }
13
-
14
- export interface AppTabsState {
15
- tabs: Record<TabLocation, AppTab[]>
16
- addTab: (position: TabLocation, tab: AppTab) => void
17
- setTabs: (position: TabLocation, tabs: AppTab[]) => void
18
- removeTab: (position: TabLocation, id: string) => void
19
- }
20
-
21
- const defaultTabs: Record<TabLocation, AppTab[]> = {
22
- [TabLocation.TOP]: [],
23
- [TabLocation.BOTTOM]: [],
24
- }
25
-
26
- export const useAppTabsStore = create<AppTabsState>((set) => ({
27
- tabs: defaultTabs,
28
- addTab: (position: TabLocation, tab: AppTab) =>
29
- set((state) => ({
30
- tabs: {
31
- ...state.tabs,
32
- [position]: [...state.tabs[position], tab],
33
- },
34
- })),
35
- setTabs: (position: TabLocation, tabs: AppTab[]) =>
36
- set((state) => ({
37
- tabs: {
38
- ...state.tabs,
39
- [position]: tabs,
40
- },
41
- })),
42
- removeTab: (position: TabLocation, id: string) =>
43
- set((state) => ({
44
- tabs: {
45
- ...state.tabs,
46
- [position]: state.tabs[position].filter((tab) => tab.id !== id),
47
- },
48
- })),
49
- }))
@@ -1,31 +0,0 @@
1
- import { create } from 'zustand'
2
- import { createJSONStorage, persist } from 'zustand/middleware'
3
-
4
- type UseFlowStore = {
5
- selectedFlowId?: string
6
- selectFlowId: (flowId: string) => void
7
- clearSelectedFlowId: () => void
8
- flows: string[]
9
- setFlows: (flows: string[]) => void
10
- }
11
-
12
- export const useFlowStore = create(
13
- persist<UseFlowStore>(
14
- (set) => ({
15
- flows: [],
16
- setFlows: (flows) => set({ flows }),
17
- selectFlowId: (flowId) =>
18
- set((state) => {
19
- if (state.selectedFlowId === flowId) {
20
- return state
21
- }
22
- return { selectedFlowId: flowId }
23
- }),
24
- clearSelectedFlowId: () => set({ selectedFlowId: undefined }),
25
- }),
26
- {
27
- name: 'motia-flow-storage',
28
- storage: createJSONStorage(() => localStorage),
29
- },
30
- ),
31
- )
@@ -1,24 +0,0 @@
1
- import { create } from 'zustand'
2
- import { createJSONStorage, persist } from 'zustand/middleware'
3
-
4
- type UseGlobalStore = {
5
- selectedEndpointId?: string
6
- selectEndpointId: (endpointId?: string) => void
7
- }
8
-
9
- const select = (id: string | undefined, name: keyof UseGlobalStore) => (state: UseGlobalStore) => {
10
- return id ? (state[name] === id ? state : { ...state, [name]: id }) : { ...state, [name]: undefined }
11
- }
12
-
13
- export const useGlobalStore = create(
14
- persist<UseGlobalStore>(
15
- (set) => ({
16
- selectedEndpointId: undefined,
17
- selectEndpointId: (endpointId) => set(select(endpointId, 'selectedEndpointId')),
18
- }),
19
- {
20
- name: 'motia-global-storage',
21
- storage: createJSONStorage(() => localStorage),
22
- },
23
- ),
24
- )
@@ -1,36 +0,0 @@
1
- import { create } from 'zustand'
2
-
3
- interface MotiaConfig {
4
- isDev: boolean
5
- isTutorialDisabled: boolean
6
- }
7
-
8
- interface MotiaConfigState {
9
- config: MotiaConfig | null
10
- isLoading: boolean
11
- error: Error | null
12
- fetchConfig: () => Promise<void>
13
- }
14
-
15
- export const useMotiaConfigStore = create<MotiaConfigState>((set, get) => ({
16
- config: null,
17
- isLoading: false,
18
- error: null,
19
- fetchConfig: async () => {
20
- const { config, isLoading } = get()
21
- if (isLoading || config) return
22
-
23
- set({ isLoading: true, error: null })
24
- try {
25
- const response = await fetch('/__motia')
26
- if (!response.ok) {
27
- throw new Error(`Failed to fetch Motia config: ${response.statusText}`)
28
- }
29
- const data = await response.json()
30
- set({ config: data, isLoading: false })
31
- } catch (error) {
32
- console.error('Failed to fetch Motia config:', error)
33
- set({ error: error as Error, isLoading: false })
34
- }
35
- },
36
- }))
@@ -1,34 +0,0 @@
1
- import { create } from 'zustand'
2
- import { createJSONStorage, persist } from 'zustand/middleware'
3
- import { motiaAnalytics } from '../lib/motia-analytics'
4
-
5
- interface TabsState {
6
- tab: Record<string, string>
7
- setTopTab: (tab: string) => void
8
- setBottomTab: (tab: string) => void
9
- }
10
-
11
- export const useTabsStore = create(
12
- persist<TabsState>(
13
- (set, get) => ({
14
- tab: {
15
- top: 'flow',
16
- bottom: 'tracing',
17
- },
18
- setTopTab: (tab) => {
19
- const currentTab = get().tab
20
- motiaAnalytics.track('Top panel tab changed', { 'new.top': tab, tab: currentTab })
21
- set((state) => ({ tab: { ...state.tab, top: tab } }))
22
- },
23
- setBottomTab: (tab) => {
24
- const currentTab = get().tab
25
- motiaAnalytics.track('Bottom panel tab changed', { 'new.bottom': tab, tab: currentTab })
26
- set((state) => ({ tab: { ...state.tab, bottom: tab } }))
27
- },
28
- }),
29
- {
30
- name: 'motia-tabs-storage',
31
- storage: createJSONStorage(() => localStorage),
32
- },
33
- ),
34
- )
@@ -1,28 +0,0 @@
1
- import { APP_SIDEBAR_CONTAINER_ID, CollapsiblePanelGroup } from '@motiadev/ui'
2
- import { memo } from 'react'
3
- import { BottomPanel } from './components/bottom-panel'
4
- import { Header } from './components/header/header'
5
- import { TopPanel } from './components/top-panel'
6
-
7
- export const SystemViewMode = memo(() => {
8
- return (
9
- <div className="grid grid-rows-[auto_1fr] grid-cols-[1fr_auto] bg-background text-foreground h-screen">
10
- <div className="col-span-2">
11
- <Header />
12
- </div>
13
- <main className="m-2 overflow-hidden">
14
- <CollapsiblePanelGroup
15
- autoSaveId="app-panel"
16
- direction="vertical"
17
- className="gap-1 h-full"
18
- aria-label="Workbench panels"
19
- >
20
- <TopPanel />
21
- <BottomPanel />
22
- </CollapsiblePanelGroup>
23
- </main>
24
- <div id={APP_SIDEBAR_CONTAINER_ID} />
25
- </div>
26
- )
27
- })
28
- SystemViewMode.displayName = 'SystemViewMode'
@@ -1,12 +0,0 @@
1
- export type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD'
2
- export type QueryParam = { name: string; description: string }
3
-
4
- export type ApiEndpoint = {
5
- id: string
6
- method: ApiRouteMethod
7
- path: string
8
- description?: string
9
- queryParams?: QueryParam[]
10
- responseSchema?: Record<string, any> // eslint-disable-line @typescript-eslint/no-explicit-any
11
- bodySchema?: Record<string, Record<string, any>> // eslint-disable-line @typescript-eslint/no-explicit-any
12
- }
@@ -1,7 +0,0 @@
1
- export type Feature = {
2
- id?: string
3
- title: string
4
- description: string
5
- lines: string[]
6
- link?: string
7
- }
@@ -1,103 +0,0 @@
1
- import type { JSONSchema7 } from 'json-schema'
2
-
3
- export type EventNodeData = {
4
- type: string
5
- name: string
6
- description?: string
7
- subscribes: string[]
8
- emits: Array<string | { topic: string; label?: string }>
9
- virtualEmits?: Array<string | { topic: string; label?: string }>
10
- virtualSubscribes?: string[]
11
- language?: string
12
- }
13
-
14
- export type NoopNodeData = {
15
- type: string
16
- name: string
17
- description?: string
18
- virtualEmits: string[]
19
- subscribes: string[]
20
- }
21
-
22
- export type ApiNodeData = {
23
- type: string
24
- name: string
25
- language?: string
26
- description?: string
27
- emits: Array<string | { topic: string; label?: string }>
28
- subscribes?: string[]
29
- virtualEmits?: Array<string | { topic: string; label?: string }>
30
- virtualSubscribes?: string[]
31
- webhookUrl?: string
32
- bodySchema?: JSONSchema7
33
- }
34
-
35
- export type CronNodeData = {
36
- type: string
37
- name: string
38
- description?: string
39
- emits: Array<string | { topic: string; label?: string }>
40
- virtualEmits?: Array<string | { topic: string; label?: string }>
41
- virtualSubscribes?: string[]
42
- cronExpression: string
43
- language?: string
44
- }
45
- export type NodeData = (EventNodeData | ApiNodeData | NoopNodeData | CronNodeData) & {
46
- position?: { x: number; y: number }
47
- filePath?: string
48
- nodeConfig?: {
49
- sourceHandlePosition?: 'bottom' | 'right'
50
- targetHandlePosition?: 'top' | 'left'
51
- }
52
- }
53
-
54
- // ducplicate of packages/core/src/flows-endpoint.ts
55
- export type EdgeData = {
56
- variant: 'event' | 'virtual'
57
- label?: string
58
- labelVariant?: 'default' | 'conditional'
59
- }
60
-
61
- export type Emit = string | { topic: string; label?: string }
62
-
63
- export type FlowStep = {
64
- id: string
65
- name: string
66
- type: 'event' | 'api' | 'noop' | 'cron'
67
- description?: string
68
- subscribes?: string[]
69
- emits: Emit[]
70
- virtualEmits?: Emit[]
71
- action?: 'webhook'
72
- webhookUrl?: string
73
- language?: string
74
- nodeComponentPath?: string
75
- filePath?: string
76
- }
77
-
78
- export type FlowResponse = {
79
- id: string
80
- name: string
81
- steps: FlowStep[]
82
- edges: FlowEdge[]
83
- error?: string
84
- }
85
-
86
- export type FlowConfigResponse = {
87
- id: string
88
- config: Record<string, NodeConfig>
89
- }
90
-
91
- export type FlowEdge = {
92
- id: string
93
- source: string
94
- target: string
95
- data: EdgeData
96
- }
97
-
98
- export type NodeConfig = {
99
- x: number
100
- y: number
101
- sourceHandlePosition?: 'bottom' | 'right'
102
- targetHandlePosition?: 'top' | 'left'
103
- }
package/eslint.config.cjs DELETED
@@ -1,22 +0,0 @@
1
- const config = require('../../eslint.config.js')
2
-
3
- module.exports = [
4
- // ignore src files
5
- { ignores: ['**/src/**/*'] },
6
- ...config.map((cfg) => {
7
- if (!cfg.files) {
8
- return cfg
9
- }
10
-
11
- return {
12
- ...cfg,
13
- languageOptions: {
14
- ...cfg.languageOptions,
15
- parserOptions: {
16
- project: null,
17
- },
18
- },
19
- files: ['middleware.ts', 'tailwind.config.ts', 'vite.config.ts'],
20
- }
21
- }),
22
- ]
package/jest.config.cjs DELETED
@@ -1,68 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'jsdom',
4
- setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
5
- moduleNameMapper: {
6
- '^@/(.*)$': '<rootDir>/src/$1',
7
- },
8
- testMatch: [
9
- '<rootDir>/src/**/__tests__/**/*.(ts|tsx|js)',
10
- '<rootDir>/src/**/*.(test|spec).(ts|tsx|js)',
11
- '<rootDir>/motia-plugin/**/__tests__/**/*.(ts|tsx|js)',
12
- '<rootDir>/motia-plugin/**/*.(test|spec).(ts|tsx|js)',
13
- '<rootDir>/__tests__/**/*.(ts|tsx|js)',
14
- ],
15
- collectCoverageFrom: [
16
- 'src/**/*.(ts|tsx)',
17
- '!src/**/*.d.ts',
18
- '!src/index.tsx',
19
- 'motia-plugin/**/*.(ts|tsx)',
20
- '!motia-plugin/**/*.d.ts',
21
- ],
22
- transform: {
23
- '^.+\\.(ts|tsx)$': [
24
- 'ts-jest',
25
- {
26
- tsconfig: {
27
- jsx: 'react-jsx',
28
- esModuleInterop: true,
29
- allowSyntheticDefaultImports: true,
30
- types: ['jest', '@testing-library/jest-dom', 'node'],
31
- module: 'commonjs',
32
- target: 'es2020',
33
- lib: ['es2020', 'dom', 'dom.iterable'],
34
- moduleResolution: 'node',
35
- strict: true,
36
- skipLibCheck: true,
37
- isolatedModules: true,
38
- },
39
- isolatedModules: true,
40
- useESM: false,
41
- },
42
- ],
43
- '^.+\\.(js|jsx)$': [
44
- 'ts-jest',
45
- {
46
- tsconfig: {
47
- allowJs: true,
48
- jsx: 'react-jsx',
49
- esModuleInterop: true,
50
- allowSyntheticDefaultImports: true,
51
- module: 'commonjs',
52
- target: 'es2020',
53
- },
54
- isolatedModules: true,
55
- useESM: false,
56
- },
57
- ],
58
- },
59
- transformIgnorePatterns: ['node_modules/(?!(@motiadev/stream-client-react|@motiadev/stream-client-browser)/)'],
60
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
61
- testEnvironmentOptions: {
62
- url: 'http://localhost',
63
- },
64
- clearMocks: true,
65
- resetMocks: true,
66
- restoreMocks: true,
67
- }
68
-