@factorim/monotui 0.1.0
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/.github/workflows/ci.yml +36 -0
- package/.github/workflows/publish-to-npm.yml +36 -0
- package/.husky/commit-msg +2 -0
- package/.husky/pre-commit +2 -0
- package/.vscode/settings.json +34 -0
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/biome.json +37 -0
- package/commitlint.config.cjs +3 -0
- package/dist/app/App.d.ts +2 -0
- package/dist/app/App.d.ts.map +1 -0
- package/dist/app/App.js +15 -0
- package/dist/app/App.js.map +1 -0
- package/dist/app/Layout.d.ts +2 -0
- package/dist/app/Layout.d.ts.map +1 -0
- package/dist/app/Layout.js +25 -0
- package/dist/app/Layout.js.map +1 -0
- package/dist/app/pages/About.d.ts +2 -0
- package/dist/app/pages/About.d.ts.map +1 -0
- package/dist/app/pages/About.js +6 -0
- package/dist/app/pages/About.js.map +1 -0
- package/dist/app/pages/AboutPage.d.ts +2 -0
- package/dist/app/pages/AboutPage.d.ts.map +1 -0
- package/dist/app/pages/AboutPage.js +6 -0
- package/dist/app/pages/AboutPage.js.map +1 -0
- package/dist/app/pages/Exit.d.ts +2 -0
- package/dist/app/pages/Exit.d.ts.map +1 -0
- package/dist/app/pages/Exit.js +6 -0
- package/dist/app/pages/Exit.js.map +1 -0
- package/dist/app/pages/ProjectPage.d.ts +2 -0
- package/dist/app/pages/ProjectPage.d.ts.map +1 -0
- package/dist/app/pages/ProjectPage.js +20 -0
- package/dist/app/pages/ProjectPage.js.map +1 -0
- package/dist/app/pages/Workspace.d.ts +2 -0
- package/dist/app/pages/Workspace.d.ts.map +1 -0
- package/dist/app/pages/Workspace.js +14 -0
- package/dist/app/pages/Workspace.js.map +1 -0
- package/dist/app/pages/WorkspacePage.d.ts +2 -0
- package/dist/app/pages/WorkspacePage.d.ts.map +1 -0
- package/dist/app/pages/WorkspacePage.js +16 -0
- package/dist/app/pages/WorkspacePage.js.map +1 -0
- package/dist/app/pages/Workspaces.d.ts +2 -0
- package/dist/app/pages/Workspaces.d.ts.map +1 -0
- package/dist/app/pages/Workspaces.js +16 -0
- package/dist/app/pages/Workspaces.js.map +1 -0
- package/dist/app/pages/WorkspacesPage.d.ts +2 -0
- package/dist/app/pages/WorkspacesPage.d.ts.map +1 -0
- package/dist/app/pages/WorkspacesPage.js +15 -0
- package/dist/app/pages/WorkspacesPage.js.map +1 -0
- package/dist/bin/init.d.ts +3 -0
- package/dist/bin/init.d.ts.map +1 -0
- package/dist/bin/init.js +7 -0
- package/dist/bin/init.js.map +1 -0
- package/dist/bin/trace-warnings.d.ts +3 -0
- package/dist/bin/trace-warnings.d.ts.map +1 -0
- package/dist/bin/trace-warnings.js +17 -0
- package/dist/bin/trace-warnings.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +65 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/components/features/ProjectGrid/ColCompose.d.ts +12 -0
- package/dist/components/features/ProjectGrid/ColCompose.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ColCompose.js +16 -0
- package/dist/components/features/ProjectGrid/ColCompose.js.map +1 -0
- package/dist/components/features/ProjectGrid/ColMakefile.d.ts +9 -0
- package/dist/components/features/ProjectGrid/ColMakefile.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ColMakefile.js +8 -0
- package/dist/components/features/ProjectGrid/ColMakefile.js.map +1 -0
- package/dist/components/features/ProjectGrid/ColPackageJson.d.ts +11 -0
- package/dist/components/features/ProjectGrid/ColPackageJson.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ColPackageJson.js +8 -0
- package/dist/components/features/ProjectGrid/ColPackageJson.js.map +1 -0
- package/dist/components/features/ProjectGrid/EmptyCol.d.ts +2 -0
- package/dist/components/features/ProjectGrid/EmptyCol.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/EmptyCol.js +8 -0
- package/dist/components/features/ProjectGrid/EmptyCol.js.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectCommands.d.ts +2 -0
- package/dist/components/features/ProjectGrid/ProjectCommands.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectCommands.js +6 -0
- package/dist/components/features/ProjectGrid/ProjectCommands.js.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectGrid.d.ts +2 -0
- package/dist/components/features/ProjectGrid/ProjectGrid.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectGrid.js +25 -0
- package/dist/components/features/ProjectGrid/ProjectGrid.js.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectInfo.d.ts +2 -0
- package/dist/components/features/ProjectGrid/ProjectInfo.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/ProjectInfo.js +13 -0
- package/dist/components/features/ProjectGrid/ProjectInfo.js.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceCommands.d.ts +2 -0
- package/dist/components/features/ProjectGrid/WorkspaceCommands.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceCommands.js +6 -0
- package/dist/components/features/ProjectGrid/WorkspaceCommands.js.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceDetail.d.ts +2 -0
- package/dist/components/features/ProjectGrid/WorkspaceDetail.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceDetail.js +16 -0
- package/dist/components/features/ProjectGrid/WorkspaceDetail.js.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceInfo.d.ts +2 -0
- package/dist/components/features/ProjectGrid/WorkspaceInfo.d.ts.map +1 -0
- package/dist/components/features/ProjectGrid/WorkspaceInfo.js +11 -0
- package/dist/components/features/ProjectGrid/WorkspaceInfo.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColCompose.d.ts +10 -0
- package/dist/components/features/WorkspaceDetail/ColCompose.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColCompose.js +6 -0
- package/dist/components/features/WorkspaceDetail/ColCompose.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColMakefile.d.ts +9 -0
- package/dist/components/features/WorkspaceDetail/ColMakefile.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColMakefile.js +6 -0
- package/dist/components/features/WorkspaceDetail/ColMakefile.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColPackageJson.d.ts +11 -0
- package/dist/components/features/WorkspaceDetail/ColPackageJson.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ColPackageJson.js +6 -0
- package/dist/components/features/WorkspaceDetail/ColPackageJson.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.d.ts +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.js +2 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.d.ts +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.js +2 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol.d.ts +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol.js +2 -0
- package/dist/components/features/WorkspaceDetail/ComposeCol.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/EmptyCol.d.ts +2 -0
- package/dist/components/features/WorkspaceDetail/EmptyCol.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/EmptyCol.js +6 -0
- package/dist/components/features/WorkspaceDetail/EmptyCol.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/EmptyRow.d.ts +2 -0
- package/dist/components/features/WorkspaceDetail/EmptyRow.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/EmptyRow.js +6 -0
- package/dist/components/features/WorkspaceDetail/EmptyRow.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.d.ts +1 -0
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.js +2 -0
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.d.ts +2 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.js +12 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.d.ts +2 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.js +16 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.js.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.d.ts +2 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.d.ts.map +1 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.js +11 -0
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.js +6 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceGrid.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceGrid.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceGrid.js +15 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceGrid.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.js +11 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.js +13 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.d.ts +9 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.js +18 -0
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.js +10 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.d.ts +2 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.js +11 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.js.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.d.ts +8 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.d.ts.map +1 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.js +18 -0
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.js.map +1 -0
- package/dist/components/features/WorkspaceList/WorkspaceList.d.ts +2 -0
- package/dist/components/features/WorkspaceList/WorkspaceList.d.ts.map +1 -0
- package/dist/components/features/WorkspaceList/WorkspaceList.js +10 -0
- package/dist/components/features/WorkspaceList/WorkspaceList.js.map +1 -0
- package/dist/components/features/WorkspaceList/WorkspacesRow.d.ts +8 -0
- package/dist/components/features/WorkspaceList/WorkspacesRow.d.ts.map +1 -0
- package/dist/components/features/WorkspaceList/WorkspacesRow.js +15 -0
- package/dist/components/features/WorkspaceList/WorkspacesRow.js.map +1 -0
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.d.ts +4 -0
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.d.ts.map +1 -0
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.js +11 -0
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.js.map +1 -0
- package/dist/components/features/WorkspaceList/responsiveWidth.d.ts +4 -0
- package/dist/components/features/WorkspaceList/responsiveWidth.d.ts.map +1 -0
- package/dist/components/features/WorkspaceList/responsiveWidth.js +11 -0
- package/dist/components/features/WorkspaceList/responsiveWidth.js.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.d.ts +2 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.d.ts.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.js +13 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.js.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceList.d.ts +2 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceList.d.ts.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceList.js +10 -0
- package/dist/components/features/WorkspacesGrid/WorkspaceList.js.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.d.ts +2 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.d.ts.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.js +10 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.js.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.d.ts +2 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.d.ts.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.js +11 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.js.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.d.ts +8 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.d.ts.map +1 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.js +18 -0
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.js.map +1 -0
- package/dist/components/layouts/Footer/Footer.d.ts +2 -0
- package/dist/components/layouts/Footer/Footer.d.ts.map +1 -0
- package/dist/components/layouts/Footer/Footer.js +7 -0
- package/dist/components/layouts/Footer/Footer.js.map +1 -0
- package/dist/components/layouts/Header/Header.d.ts +2 -0
- package/dist/components/layouts/Header/Header.d.ts.map +1 -0
- package/dist/components/layouts/Header/Header.js +22 -0
- package/dist/components/layouts/Header/Header.js.map +1 -0
- package/dist/components/layouts/Header/ProjectCommands.d.ts +2 -0
- package/dist/components/layouts/Header/ProjectCommands.d.ts.map +1 -0
- package/dist/components/layouts/Header/ProjectCommands.js +8 -0
- package/dist/components/layouts/Header/ProjectCommands.js.map +1 -0
- package/dist/components/layouts/Header/WorkspaceCommands copy.d.ts +2 -0
- package/dist/components/layouts/Header/WorkspaceCommands copy.d.ts.map +1 -0
- package/dist/components/layouts/Header/WorkspaceCommands copy.js +6 -0
- package/dist/components/layouts/Header/WorkspaceCommands copy.js.map +1 -0
- package/dist/components/layouts/Header/WorkspaceCommands.d.ts +2 -0
- package/dist/components/layouts/Header/WorkspaceCommands.d.ts.map +1 -0
- package/dist/components/layouts/Header/WorkspaceCommands.js +13 -0
- package/dist/components/layouts/Header/WorkspaceCommands.js.map +1 -0
- package/dist/config/config.d.ts +8 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +39 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +43 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/contexts/NavigationContext.d.ts +27 -0
- package/dist/contexts/NavigationContext.d.ts.map +1 -0
- package/dist/contexts/NavigationContext.js +33 -0
- package/dist/contexts/NavigationContext.js.map +1 -0
- package/dist/contexts/PageNavigationContext.d.ts +15 -0
- package/dist/contexts/PageNavigationContext.d.ts.map +1 -0
- package/dist/contexts/PageNavigationContext.js +16 -0
- package/dist/contexts/PageNavigationContext.js.map +1 -0
- package/dist/contexts/ProjectGridContext.d.ts +20 -0
- package/dist/contexts/ProjectGridContext.d.ts.map +1 -0
- package/dist/contexts/ProjectGridContext.js +40 -0
- package/dist/contexts/ProjectGridContext.js.map +1 -0
- package/dist/contexts/ProjectNavigationContext.d.ts +20 -0
- package/dist/contexts/ProjectNavigationContext.d.ts.map +1 -0
- package/dist/contexts/ProjectNavigationContext.js +35 -0
- package/dist/contexts/ProjectNavigationContext.js.map +1 -0
- package/dist/contexts/ResponsizeContext.d.ts +14 -0
- package/dist/contexts/ResponsizeContext.d.ts.map +1 -0
- package/dist/contexts/ResponsizeContext.js +34 -0
- package/dist/contexts/ResponsizeContext.js.map +1 -0
- package/dist/contexts/WorkspaceDiscoveryContext.d.ts +15 -0
- package/dist/contexts/WorkspaceDiscoveryContext.d.ts.map +1 -0
- package/dist/contexts/WorkspaceDiscoveryContext.js +14 -0
- package/dist/contexts/WorkspaceDiscoveryContext.js.map +1 -0
- package/dist/contexts/WorkspaceGridContext.d.ts +29 -0
- package/dist/contexts/WorkspaceGridContext.d.ts.map +1 -0
- package/dist/contexts/WorkspaceGridContext.js +47 -0
- package/dist/contexts/WorkspaceGridContext.js.map +1 -0
- package/dist/contexts/WorkspaceNavigationContext.d.ts +29 -0
- package/dist/contexts/WorkspaceNavigationContext.d.ts.map +1 -0
- package/dist/contexts/WorkspaceNavigationContext.js +41 -0
- package/dist/contexts/WorkspaceNavigationContext.js.map +1 -0
- package/dist/contexts/WorkspacesNavigationContext.d.ts +29 -0
- package/dist/contexts/WorkspacesNavigationContext.d.ts.map +1 -0
- package/dist/contexts/WorkspacesNavigationContext.js +37 -0
- package/dist/contexts/WorkspacesNavigationContext.js.map +1 -0
- package/dist/hooks/useDisovery.d.ts +7 -0
- package/dist/hooks/useDisovery.d.ts.map +1 -0
- package/dist/hooks/useDisovery.js +38 -0
- package/dist/hooks/useDisovery.js.map +1 -0
- package/dist/hooks/useGridNavigation.d.ts +19 -0
- package/dist/hooks/useGridNavigation.d.ts.map +1 -0
- package/dist/hooks/useGridNavigation.js +52 -0
- package/dist/hooks/useGridNavigation.js.map +1 -0
- package/dist/hooks/useNavigation.d.ts +10 -0
- package/dist/hooks/useNavigation.d.ts.map +1 -0
- package/dist/hooks/useNavigation.js +43 -0
- package/dist/hooks/useNavigation.js.map +1 -0
- package/dist/hooks/useNavigationMatrix.d.ts +6 -0
- package/dist/hooks/useNavigationMatrix.d.ts.map +1 -0
- package/dist/hooks/useNavigationMatrix.js +34 -0
- package/dist/hooks/useNavigationMatrix.js.map +1 -0
- package/dist/hooks/useProjectGrid.d.ts +12 -0
- package/dist/hooks/useProjectGrid.d.ts.map +1 -0
- package/dist/hooks/useProjectGrid.js +62 -0
- package/dist/hooks/useProjectGrid.js.map +1 -0
- package/dist/hooks/useRuntime.d.ts +1 -0
- package/dist/hooks/useRuntime.d.ts.map +1 -0
- package/dist/hooks/useRuntime.js +2 -0
- package/dist/hooks/useRuntime.js.map +1 -0
- package/dist/hooks/useWorkspaceDiscovery.d.ts +11 -0
- package/dist/hooks/useWorkspaceDiscovery.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceDiscovery.js +48 -0
- package/dist/hooks/useWorkspaceDiscovery.js.map +1 -0
- package/dist/hooks/useWorkspaceGrid.d.ts +11 -0
- package/dist/hooks/useWorkspaceGrid.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceGrid.js +59 -0
- package/dist/hooks/useWorkspaceGrid.js.map +1 -0
- package/dist/hooks/useWorkspaceNavigation.d.ts +10 -0
- package/dist/hooks/useWorkspaceNavigation.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceNavigation.js +31 -0
- package/dist/hooks/useWorkspaceNavigation.js.map +1 -0
- package/dist/hooks/useWorkspaceQuickActions.d.ts +4 -0
- package/dist/hooks/useWorkspaceQuickActions.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceQuickActions.js +100 -0
- package/dist/hooks/useWorkspaceQuickActions.js.map +1 -0
- package/dist/hooks/useWorkspaceQuickActionts.d.ts +4 -0
- package/dist/hooks/useWorkspaceQuickActionts.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceQuickActionts.js +28 -0
- package/dist/hooks/useWorkspaceQuickActionts.js.map +1 -0
- package/dist/hooks/useWorkspaceRuntime.d.ts +4 -0
- package/dist/hooks/useWorkspaceRuntime.d.ts.map +1 -0
- package/dist/hooks/useWorkspaceRuntime.js +65 -0
- package/dist/hooks/useWorkspaceRuntime.js.map +1 -0
- package/dist/hooks/useWorkspacesGrid copy.d.ts +10 -0
- package/dist/hooks/useWorkspacesGrid copy.d.ts.map +1 -0
- package/dist/hooks/useWorkspacesGrid copy.js +31 -0
- package/dist/hooks/useWorkspacesGrid copy.js.map +1 -0
- package/dist/hooks/useWorkspacesGrid.d.ts +11 -0
- package/dist/hooks/useWorkspacesGrid.d.ts.map +1 -0
- package/dist/hooks/useWorkspacesGrid.js +31 -0
- package/dist/hooks/useWorkspacesGrid.js.map +1 -0
- package/dist/hooks/useWorkspacesNavigation.d.ts +10 -0
- package/dist/hooks/useWorkspacesNavigation.d.ts.map +1 -0
- package/dist/hooks/useWorkspacesNavigation.js +31 -0
- package/dist/hooks/useWorkspacesNavigation.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/services/discovery/facets/biome-parser.d.ts +3 -0
- package/dist/services/discovery/facets/biome-parser.d.ts.map +1 -0
- package/dist/services/discovery/facets/biome-parser.js +73 -0
- package/dist/services/discovery/facets/biome-parser.js.map +1 -0
- package/dist/services/discovery/facets/compose-parser.d.ts +17 -0
- package/dist/services/discovery/facets/compose-parser.d.ts.map +1 -0
- package/dist/services/discovery/facets/compose-parser.js +168 -0
- package/dist/services/discovery/facets/compose-parser.js.map +1 -0
- package/dist/services/discovery/facets/composeParser.d.ts +1 -0
- package/dist/services/discovery/facets/composeParser.d.ts.map +1 -0
- package/dist/services/discovery/facets/composeParser.js +2 -0
- package/dist/services/discovery/facets/composeParser.js.map +1 -0
- package/dist/services/discovery/facets/makefile-parser.d.ts +8 -0
- package/dist/services/discovery/facets/makefile-parser.d.ts.map +1 -0
- package/dist/services/discovery/facets/makefile-parser.js +143 -0
- package/dist/services/discovery/facets/makefile-parser.js.map +1 -0
- package/dist/services/discovery/facets/makefileParser.d.ts +1 -0
- package/dist/services/discovery/facets/makefileParser.d.ts.map +1 -0
- package/dist/services/discovery/facets/makefileParser.js +2 -0
- package/dist/services/discovery/facets/makefileParser.js.map +1 -0
- package/dist/services/discovery/facets/manifest-parser.d.ts +7 -0
- package/dist/services/discovery/facets/manifest-parser.d.ts.map +1 -0
- package/dist/services/discovery/facets/manifest-parser.js +43 -0
- package/dist/services/discovery/facets/manifest-parser.js.map +1 -0
- package/dist/services/discovery/facets/manifestParser.d.ts +1 -0
- package/dist/services/discovery/facets/manifestParser.d.ts.map +1 -0
- package/dist/services/discovery/facets/manifestParser.js +2 -0
- package/dist/services/discovery/facets/manifestParser.js.map +1 -0
- package/dist/services/discovery/facets/package-json-parser.d.ts +7 -0
- package/dist/services/discovery/facets/package-json-parser.d.ts.map +1 -0
- package/dist/services/discovery/facets/package-json-parser.js +118 -0
- package/dist/services/discovery/facets/package-json-parser.js.map +1 -0
- package/dist/services/discovery/index.d.ts +2 -0
- package/dist/services/discovery/index.d.ts.map +1 -0
- package/dist/services/discovery/index.js +2 -0
- package/dist/services/discovery/index.js.map +1 -0
- package/dist/services/discovery/workspace-discovery.d.ts +4 -0
- package/dist/services/discovery/workspace-discovery.d.ts.map +1 -0
- package/dist/services/discovery/workspace-discovery.js +86 -0
- package/dist/services/discovery/workspace-discovery.js.map +1 -0
- package/dist/services/discovery/workspaceDiscovery.d.ts +3 -0
- package/dist/services/discovery/workspaceDiscovery.d.ts.map +1 -0
- package/dist/services/discovery/workspaceDiscovery.js +17 -0
- package/dist/services/discovery/workspaceDiscovery.js.map +1 -0
- package/dist/services/runtime/command-runner.d.ts +17 -0
- package/dist/services/runtime/command-runner.d.ts.map +1 -0
- package/dist/services/runtime/command-runner.js +70 -0
- package/dist/services/runtime/command-runner.js.map +1 -0
- package/dist/services/runtime/docker-runtime.d.ts +15 -0
- package/dist/services/runtime/docker-runtime.d.ts.map +1 -0
- package/dist/services/runtime/docker-runtime.js +133 -0
- package/dist/services/runtime/docker-runtime.js.map +1 -0
- package/dist/services/runtime/node-runtime.d.ts +4 -0
- package/dist/services/runtime/node-runtime.d.ts.map +1 -0
- package/dist/services/runtime/node-runtime.js +210 -0
- package/dist/services/runtime/node-runtime.js.map +1 -0
- package/dist/services/runtime/resolve-runtime-conflicts.d.ts +15 -0
- package/dist/services/runtime/resolve-runtime-conflicts.d.ts.map +1 -0
- package/dist/services/runtime/resolve-runtime-conflicts.js +36 -0
- package/dist/services/runtime/resolve-runtime-conflicts.js.map +1 -0
- package/dist/services/runtime/resolve-runtime.d.ts +15 -0
- package/dist/services/runtime/resolve-runtime.d.ts.map +1 -0
- package/dist/services/runtime/resolve-runtime.js +36 -0
- package/dist/services/runtime/resolve-runtime.js.map +1 -0
- package/dist/services/runtime/stop-runtime.d.ts +14 -0
- package/dist/services/runtime/stop-runtime.d.ts.map +1 -0
- package/dist/services/runtime/stop-runtime.js +48 -0
- package/dist/services/runtime/stop-runtime.js.map +1 -0
- package/dist/theme/theme.d.ts +33 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/theme.js +61 -0
- package/dist/theme/theme.js.map +1 -0
- package/dist/types/config.d.ts +44 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/navigation.d.ts +10 -0
- package/dist/types/navigation.d.ts.map +1 -0
- package/dist/types/navigation.js +59 -0
- package/dist/types/navigation.js.map +1 -0
- package/dist/types/page.d.ts +6 -0
- package/dist/types/page.d.ts.map +1 -0
- package/dist/types/page.js +7 -0
- package/dist/types/page.js.map +1 -0
- package/dist/types/project-grid.d.ts +48 -0
- package/dist/types/project-grid.d.ts.map +1 -0
- package/dist/types/project-grid.js +9 -0
- package/dist/types/project-grid.js.map +1 -0
- package/dist/types/project.d.ts +64 -0
- package/dist/types/project.d.ts.map +1 -0
- package/dist/types/project.js +2 -0
- package/dist/types/project.js.map +1 -0
- package/dist/types/projects-grid.d.ts +32 -0
- package/dist/types/projects-grid.d.ts.map +1 -0
- package/dist/types/projects-grid.js +2 -0
- package/dist/types/projects-grid.js.map +1 -0
- package/dist/types/quick-actions.d.ts +7 -0
- package/dist/types/quick-actions.d.ts.map +1 -0
- package/dist/types/quick-actions.js +2 -0
- package/dist/types/quick-actions.js.map +1 -0
- package/dist/types/runtime.d.ts +16 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +2 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/workpace-grid.d.ts +32 -0
- package/dist/types/workpace-grid.d.ts.map +1 -0
- package/dist/types/workpace-grid.js +2 -0
- package/dist/types/workpace-grid.js.map +1 -0
- package/dist/types/workspace-grid.d.ts +32 -0
- package/dist/types/workspace-grid.d.ts.map +1 -0
- package/dist/types/workspace-grid.js +2 -0
- package/dist/types/workspace-grid.js.map +1 -0
- package/dist/types/workspace-navigation.d.ts +37 -0
- package/dist/types/workspace-navigation.d.ts.map +1 -0
- package/dist/types/workspace-navigation.js +7 -0
- package/dist/types/workspace-navigation.js.map +1 -0
- package/dist/types/workspace-quick-actions.d.ts +12 -0
- package/dist/types/workspace-quick-actions.d.ts.map +1 -0
- package/dist/types/workspace-quick-actions.js +2 -0
- package/dist/types/workspace-quick-actions.js.map +1 -0
- package/dist/types/workspace-runtime.d.ts +21 -0
- package/dist/types/workspace-runtime.d.ts.map +1 -0
- package/dist/types/workspace-runtime.js +2 -0
- package/dist/types/workspace-runtime.js.map +1 -0
- package/dist/types/workspace.d.ts +63 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types/workspace.js +2 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/types/workspaces-grid copy.d.ts +37 -0
- package/dist/types/workspaces-grid copy.d.ts.map +1 -0
- package/dist/types/workspaces-grid copy.js +7 -0
- package/dist/types/workspaces-grid copy.js.map +1 -0
- package/dist/types/workspaces-grid.d.ts +37 -0
- package/dist/types/workspaces-grid.d.ts.map +1 -0
- package/dist/types/workspaces-grid.js +7 -0
- package/dist/types/workspaces-grid.js.map +1 -0
- package/dist/types/worspace-state.d.ts +19 -0
- package/dist/types/worspace-state.d.ts.map +1 -0
- package/dist/types/worspace-state.js +2 -0
- package/dist/types/worspace-state.js.map +1 -0
- package/dist/utils/framework-detector.d.ts +7 -0
- package/dist/utils/framework-detector.d.ts.map +1 -0
- package/dist/utils/framework-detector.js +111 -0
- package/dist/utils/framework-detector.js.map +1 -0
- package/dist/utils/fs/directories.d.ts +7 -0
- package/dist/utils/fs/directories.d.ts.map +1 -0
- package/dist/utils/fs/directories.js +41 -0
- package/dist/utils/fs/directories.js.map +1 -0
- package/dist/utils/fs/file.d.ts +8 -0
- package/dist/utils/fs/file.d.ts.map +1 -0
- package/dist/utils/fs/file.js +31 -0
- package/dist/utils/fs/file.js.map +1 -0
- package/dist/utils/fs/package-json.d.ts +2 -0
- package/dist/utils/fs/package-json.d.ts.map +1 -0
- package/dist/utils/fs/package-json.js +11 -0
- package/dist/utils/fs/package-json.js.map +1 -0
- package/dist/utils/fs/scanner.d.ts +6 -0
- package/dist/utils/fs/scanner.d.ts.map +1 -0
- package/dist/utils/fs/scanner.js +32 -0
- package/dist/utils/fs/scanner.js.map +1 -0
- package/dist/utils/getPackageVersion.d.ts +2 -0
- package/dist/utils/getPackageVersion.d.ts.map +1 -0
- package/dist/utils/getPackageVersion.js +6 -0
- package/dist/utils/getPackageVersion.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +99 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logging/logger.d.ts +14 -0
- package/dist/utils/logging/logger.d.ts.map +1 -0
- package/dist/utils/logging/logger.js +99 -0
- package/dist/utils/logging/logger.js.map +1 -0
- package/dist/utils/navigation/grid-navigation.d.ts +9 -0
- package/dist/utils/navigation/grid-navigation.d.ts.map +1 -0
- package/dist/utils/navigation/grid-navigation.js +53 -0
- package/dist/utils/navigation/grid-navigation.js.map +1 -0
- package/dist/utils/navigation/navigation-helper.d.ts +19 -0
- package/dist/utils/navigation/navigation-helper.d.ts.map +1 -0
- package/dist/utils/navigation/navigation-helper.js +66 -0
- package/dist/utils/navigation/navigation-helper.js.map +1 -0
- package/dist/utils/navigation-helper.d.ts +9 -0
- package/dist/utils/navigation-helper.d.ts.map +1 -0
- package/dist/utils/navigation-helper.js +53 -0
- package/dist/utils/navigation-helper.js.map +1 -0
- package/dist/utils/package-json.d.ts +2 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +11 -0
- package/dist/utils/package-json.js.map +1 -0
- package/dist/utils/port.d.ts +6 -0
- package/dist/utils/port.d.ts.map +1 -0
- package/dist/utils/port.js +24 -0
- package/dist/utils/port.js.map +1 -0
- package/dist/utils/project/project-grid.d.ts +17 -0
- package/dist/utils/project/project-grid.d.ts.map +1 -0
- package/dist/utils/project/project-grid.js +121 -0
- package/dist/utils/project/project-grid.js.map +1 -0
- package/dist/utils/project/workspace-grid.d.ts +17 -0
- package/dist/utils/project/workspace-grid.d.ts.map +1 -0
- package/dist/utils/project/workspace-grid.js +121 -0
- package/dist/utils/project/workspace-grid.js.map +1 -0
- package/dist/utils/runtime/port.d.ts +6 -0
- package/dist/utils/runtime/port.d.ts.map +1 -0
- package/dist/utils/runtime/port.js +24 -0
- package/dist/utils/runtime/port.js.map +1 -0
- package/dist/utils/workpace/workspace-grid.d.ts +17 -0
- package/dist/utils/workpace/workspace-grid.d.ts.map +1 -0
- package/dist/utils/workpace/workspace-grid.js +121 -0
- package/dist/utils/workpace/workspace-grid.js.map +1 -0
- package/dist/utils/workpace/workspace-helper.d.ts +7 -0
- package/dist/utils/workpace/workspace-helper.d.ts.map +1 -0
- package/dist/utils/workpace/workspace-helper.js +10 -0
- package/dist/utils/workpace/workspace-helper.js.map +1 -0
- package/dist/utils/workpace/workspace-navigation.d.ts +17 -0
- package/dist/utils/workpace/workspace-navigation.d.ts.map +1 -0
- package/dist/utils/workpace/workspace-navigation.js +123 -0
- package/dist/utils/workpace/workspace-navigation.js.map +1 -0
- package/dist/utils/workpace/workspaces-grid copy.d.ts +30 -0
- package/dist/utils/workpace/workspaces-grid copy.d.ts.map +1 -0
- package/dist/utils/workpace/workspaces-grid copy.js +97 -0
- package/dist/utils/workpace/workspaces-grid copy.js.map +1 -0
- package/dist/utils/workpace/workspaces-grid.d.ts +22 -0
- package/dist/utils/workpace/workspaces-grid.d.ts.map +1 -0
- package/dist/utils/workpace/workspaces-grid.js +123 -0
- package/dist/utils/workpace/workspaces-grid.js.map +1 -0
- package/dist/utils/workpace/worspace-state.d.ts +18 -0
- package/dist/utils/workpace/worspace-state.d.ts.map +1 -0
- package/dist/utils/workpace/worspace-state.js +2 -0
- package/dist/utils/workpace/worspace-state.js.map +1 -0
- package/dist/utils/workspace/framework-detector.d.ts +7 -0
- package/dist/utils/workspace/framework-detector.d.ts.map +1 -0
- package/dist/utils/workspace/framework-detector.js +111 -0
- package/dist/utils/workspace/framework-detector.js.map +1 -0
- package/dist/utils/workspace/workspace-grid.d.ts +22 -0
- package/dist/utils/workspace/workspace-grid.d.ts.map +1 -0
- package/dist/utils/workspace/workspace-grid.js +123 -0
- package/dist/utils/workspace/workspace-grid.js.map +1 -0
- package/dist/utils/workspace/workspace-helper.d.ts +7 -0
- package/dist/utils/workspace/workspace-helper.d.ts.map +1 -0
- package/dist/utils/workspace/workspace-helper.js +10 -0
- package/dist/utils/workspace/workspace-helper.js.map +1 -0
- package/dist/utils/workspace/workspaces-grid.d.ts +22 -0
- package/dist/utils/workspace/workspaces-grid.d.ts.map +1 -0
- package/dist/utils/workspace/workspaces-grid.js +123 -0
- package/dist/utils/workspace/workspaces-grid.js.map +1 -0
- package/dist/utils/workspace-helper.d.ts +10 -0
- package/dist/utils/workspace-helper.d.ts.map +1 -0
- package/dist/utils/workspace-helper.js +46 -0
- package/dist/utils/workspace-helper.js.map +1 -0
- package/dist/utils/workspace-navigation.d.ts +1 -0
- package/dist/utils/workspace-navigation.d.ts.map +1 -0
- package/dist/utils/workspace-navigation.js +2 -0
- package/dist/utils/workspace-navigation.js.map +1 -0
- package/jest.config.mjs +31 -0
- package/package.json +69 -0
- package/scripts/run-commitlint.sh +48 -0
- package/src/app/App.tsx +25 -0
- package/src/app/Layout.tsx +37 -0
- package/src/app/pages/Exit.tsx +9 -0
- package/src/app/pages/ProjectPage.tsx +37 -0
- package/src/app/pages/WorkspacePage.tsx +33 -0
- package/src/bin/init.ts +7 -0
- package/src/bin/trace-warnings.ts +25 -0
- package/src/commands/init.ts +80 -0
- package/src/components/features/ProjectGrid/ColCompose.tsx +99 -0
- package/src/components/features/ProjectGrid/ColMakefile.tsx +44 -0
- package/src/components/features/ProjectGrid/ColPackageJson.tsx +54 -0
- package/src/components/features/ProjectGrid/EmptyCol.tsx +28 -0
- package/src/components/features/ProjectGrid/ProjectGrid.tsx +94 -0
- package/src/components/features/ProjectGrid/ProjectInfo.tsx +67 -0
- package/src/components/features/WorkspaceGrid/WorkspaceGrid.tsx +52 -0
- package/src/components/features/WorkspaceGrid/WorkspaceInfo.tsx +89 -0
- package/src/components/features/WorkspaceGrid/WorkspaceRow.tsx +115 -0
- package/src/components/layouts/Header/Header.tsx +51 -0
- package/src/components/layouts/Header/ProjectCommands.tsx +17 -0
- package/src/components/layouts/Header/WorkspaceCommands.tsx +60 -0
- package/src/config/config.ts +46 -0
- package/src/config/defaults.ts +44 -0
- package/src/contexts/PageNavigationContext.tsx +39 -0
- package/src/contexts/ProjectGridContext.tsx +92 -0
- package/src/contexts/WorkspaceDiscoveryContext.tsx +46 -0
- package/src/contexts/WorkspaceGridContext.tsx +113 -0
- package/src/hooks/useProjectGrid.ts +77 -0
- package/src/hooks/useWorkspaceDiscovery.ts +61 -0
- package/src/hooks/useWorkspaceGrid.ts +85 -0
- package/src/hooks/useWorkspaceQuickActions.ts +114 -0
- package/src/hooks/useWorkspaceRuntime.ts +92 -0
- package/src/index.ts +10 -0
- package/src/services/discovery/facets/compose-parser.ts +236 -0
- package/src/services/discovery/facets/makefile-parser.ts +196 -0
- package/src/services/discovery/facets/package-json-parser.ts +151 -0
- package/src/services/discovery/index.ts +1 -0
- package/src/services/discovery/workspace-discovery.ts +105 -0
- package/src/services/runtime/command-runner.ts +87 -0
- package/src/services/runtime/docker-runtime.ts +171 -0
- package/src/services/runtime/node-runtime.ts +253 -0
- package/src/services/runtime/resolve-runtime.ts +45 -0
- package/src/services/runtime/stop-runtime.ts +52 -0
- package/src/theme/theme.ts +72 -0
- package/src/types/config.ts +50 -0
- package/src/types/page.ts +5 -0
- package/src/types/project-grid.ts +73 -0
- package/src/types/project.ts +81 -0
- package/src/types/workspace-grid.ts +41 -0
- package/src/types/workspace-quick-actions.ts +12 -0
- package/src/types/workspace-runtime.ts +28 -0
- package/src/utils/fs/directories.test.ts +60 -0
- package/src/utils/fs/directories.ts +54 -0
- package/src/utils/fs/file.test.ts +90 -0
- package/src/utils/fs/file.ts +32 -0
- package/src/utils/fs/package-json.ts +12 -0
- package/src/utils/logging/logger.ts +103 -0
- package/src/utils/navigation/grid-navigation.ts +60 -0
- package/src/utils/navigation/navigation-helper.ts +84 -0
- package/src/utils/project/project-grid.ts +165 -0
- package/src/utils/runtime/port.test.ts +34 -0
- package/src/utils/runtime/port.ts +26 -0
- package/src/utils/workspace/framework-detector.ts +77 -0
- package/src/utils/workspace/workspace-grid.ts +161 -0
- package/src/utils/workspace/workspace-helper.ts +21 -0
- package/tsconfig.json +23 -0
- package/workspace-cli.mjs +18 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createContext, type JSX, type ReactNode, useMemo } from "react"
|
|
2
|
+
|
|
3
|
+
import { useProjectGrid } from "../hooks/useProjectGrid.js"
|
|
4
|
+
import {
|
|
5
|
+
getCommandFromCell,
|
|
6
|
+
getExecFromCell,
|
|
7
|
+
runCellCommand,
|
|
8
|
+
shouldKeepTuiOpen,
|
|
9
|
+
} from "../services/runtime/command-runner.js"
|
|
10
|
+
import { Page } from "../types/page.js"
|
|
11
|
+
import type { Project } from "../types/project.js"
|
|
12
|
+
import type { ProjectGridGrid } from "../types/project-grid.js"
|
|
13
|
+
import {
|
|
14
|
+
buildProjectGrid,
|
|
15
|
+
getProjectCellByPosition,
|
|
16
|
+
} from "../utils/project/project-grid.js"
|
|
17
|
+
|
|
18
|
+
interface ProjectGridContextType {
|
|
19
|
+
project?: Project
|
|
20
|
+
workspaceNavigationGrid: ProjectGridGrid
|
|
21
|
+
row: number
|
|
22
|
+
col: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const ProjectGridContext = createContext<ProjectGridContextType>(
|
|
26
|
+
{} as ProjectGridContextType,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
// The React 19 / TypeScript 5.9 Fix
|
|
30
|
+
const Provider = ProjectGridContext as unknown as (props: {
|
|
31
|
+
value: ProjectGridContextType
|
|
32
|
+
children: ReactNode
|
|
33
|
+
}) => JSX.Element
|
|
34
|
+
|
|
35
|
+
interface ProjectGridProviderProps {
|
|
36
|
+
children: ReactNode
|
|
37
|
+
project: Project
|
|
38
|
+
setPage: (page: Page) => void
|
|
39
|
+
setProject: (project: Project | null) => void
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function ProjectGridProvider({
|
|
43
|
+
children,
|
|
44
|
+
project,
|
|
45
|
+
setPage,
|
|
46
|
+
setProject,
|
|
47
|
+
}: ProjectGridProviderProps) {
|
|
48
|
+
const workspaceNavigationGrid = useMemo(
|
|
49
|
+
() => buildProjectGrid(project),
|
|
50
|
+
[project],
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
const { position } = useProjectGrid({
|
|
54
|
+
grid: workspaceNavigationGrid,
|
|
55
|
+
onExit: () => {
|
|
56
|
+
setPage(Page.Workspace)
|
|
57
|
+
setProject(null)
|
|
58
|
+
},
|
|
59
|
+
onSelect: (newRow, newCol) => {
|
|
60
|
+
const cell = getProjectCellByPosition(
|
|
61
|
+
workspaceNavigationGrid,
|
|
62
|
+
newRow,
|
|
63
|
+
newCol,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if (cell) {
|
|
67
|
+
const command = getCommandFromCell(cell)
|
|
68
|
+
const exec = getExecFromCell(cell)
|
|
69
|
+
if (command && exec) {
|
|
70
|
+
const keepTuiOpen = shouldKeepTuiOpen(exec)
|
|
71
|
+
runCellCommand(command, project.path, { detached: keepTuiOpen })
|
|
72
|
+
if (!keepTuiOpen) {
|
|
73
|
+
setPage(Page.Exit)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<Provider
|
|
82
|
+
value={{
|
|
83
|
+
project,
|
|
84
|
+
workspaceNavigationGrid,
|
|
85
|
+
row: position.row,
|
|
86
|
+
col: position.col,
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{children}
|
|
90
|
+
</Provider>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
type JSX,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useMemo,
|
|
6
|
+
useState,
|
|
7
|
+
} from "react"
|
|
8
|
+
|
|
9
|
+
import { useWorkspaceDiscovery } from "../hooks/useWorkspaceDiscovery.js"
|
|
10
|
+
import { useWorkspaceRuntime } from "../hooks/useWorkspaceRuntime.js"
|
|
11
|
+
import type { Project } from "../types/project.js"
|
|
12
|
+
import type { WorkspaceRuntimeState } from "../types/workspace-runtime.js"
|
|
13
|
+
|
|
14
|
+
interface WorkspaceDiscoveryContextType {
|
|
15
|
+
projects: Project[]
|
|
16
|
+
workspaceRuntimes: WorkspaceRuntimeState[]
|
|
17
|
+
project: Project | null
|
|
18
|
+
setProject: (project: Project | null) => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const WorkspaceDiscoveryContext =
|
|
22
|
+
createContext<WorkspaceDiscoveryContextType>(
|
|
23
|
+
{} as WorkspaceDiscoveryContextType,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
const Provider = WorkspaceDiscoveryContext as unknown as (props: {
|
|
27
|
+
value: WorkspaceDiscoveryContextType
|
|
28
|
+
children: ReactNode
|
|
29
|
+
}) => JSX.Element
|
|
30
|
+
|
|
31
|
+
export function WorkspaceDiscoveryProvider({
|
|
32
|
+
children,
|
|
33
|
+
}: {
|
|
34
|
+
children: ReactNode
|
|
35
|
+
}) {
|
|
36
|
+
const [project, setProject] = useState<Project | null>(null)
|
|
37
|
+
const rootPath = useMemo(() => process.cwd(), [])
|
|
38
|
+
const { projects } = useWorkspaceDiscovery(rootPath)
|
|
39
|
+
const workspaceRuntimes = useWorkspaceRuntime(projects)
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Provider value={{ projects, workspaceRuntimes, project, setProject }}>
|
|
43
|
+
{children}
|
|
44
|
+
</Provider>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createContext, type JSX, type ReactNode, useMemo } from "react"
|
|
2
|
+
|
|
3
|
+
import { useWorkspaceGrid } from "../hooks/useWorkspaceGrid.js"
|
|
4
|
+
import {
|
|
5
|
+
runCellCommand,
|
|
6
|
+
shouldKeepTuiOpen,
|
|
7
|
+
} from "../services/runtime/command-runner.js"
|
|
8
|
+
import { Page } from "../types/page.js"
|
|
9
|
+
import type { Project } from "../types/project.js"
|
|
10
|
+
import type { CursorPosition } from "../types/workspace-grid.js"
|
|
11
|
+
import type { WorkspaceQuickAction } from "../types/workspace-quick-actions.js"
|
|
12
|
+
import type { WorkspaceRuntimeState } from "../types/workspace-runtime.js"
|
|
13
|
+
import { logger } from "../utils/logging/logger.js"
|
|
14
|
+
import {
|
|
15
|
+
buildWorkspacesGrid,
|
|
16
|
+
getWorkspaceCellByPosition,
|
|
17
|
+
} from "../utils/workspace/workspace-grid.js"
|
|
18
|
+
|
|
19
|
+
interface WorkspaceGridContextType {
|
|
20
|
+
projects?: Project[]
|
|
21
|
+
workspaceQuickActions?: WorkspaceQuickAction[]
|
|
22
|
+
workspaceRuntimes?: WorkspaceRuntimeState[]
|
|
23
|
+
workspacesNavigationGrid: ReturnType<typeof buildWorkspacesGrid>
|
|
24
|
+
row: number
|
|
25
|
+
col: number
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const WorkspaceGridContext = createContext<WorkspaceGridContextType>(
|
|
29
|
+
{} as WorkspaceGridContextType,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
// The Type-Safe Provider Fix
|
|
33
|
+
const Provider = WorkspaceGridContext as unknown as (props: {
|
|
34
|
+
value: WorkspaceGridContextType
|
|
35
|
+
children: ReactNode
|
|
36
|
+
}) => JSX.Element
|
|
37
|
+
|
|
38
|
+
interface WorkspacesNavigationProviderProps {
|
|
39
|
+
children: ReactNode
|
|
40
|
+
projects: Project[]
|
|
41
|
+
workspaceQuickActions?: WorkspaceQuickAction[]
|
|
42
|
+
workspaceRuntimes: WorkspaceRuntimeState[]
|
|
43
|
+
initialPosition?: CursorPosition
|
|
44
|
+
setPage: (page: Page) => void
|
|
45
|
+
setProject: (workspace: Project | null) => void
|
|
46
|
+
onPositionChange?: (position: CursorPosition) => void
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function WorkspacesNavigationProvider({
|
|
50
|
+
children,
|
|
51
|
+
projects,
|
|
52
|
+
workspaceQuickActions,
|
|
53
|
+
workspaceRuntimes,
|
|
54
|
+
initialPosition,
|
|
55
|
+
setPage,
|
|
56
|
+
setProject,
|
|
57
|
+
onPositionChange,
|
|
58
|
+
}: WorkspacesNavigationProviderProps) {
|
|
59
|
+
const workspacesNavigationGrid = useMemo(
|
|
60
|
+
() =>
|
|
61
|
+
buildWorkspacesGrid(
|
|
62
|
+
projects,
|
|
63
|
+
workspaceQuickActions ?? [],
|
|
64
|
+
workspaceRuntimes,
|
|
65
|
+
),
|
|
66
|
+
[projects, workspaceQuickActions, workspaceRuntimes],
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
const { position } = useWorkspaceGrid({
|
|
70
|
+
grid: workspacesNavigationGrid,
|
|
71
|
+
initialPosition,
|
|
72
|
+
onSelect: (newRow, newCol) => {
|
|
73
|
+
const selectedCell = getWorkspaceCellByPosition(
|
|
74
|
+
workspacesNavigationGrid,
|
|
75
|
+
newRow,
|
|
76
|
+
newCol,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
logger.debug(`Selected position: Row ${newRow}, Col ${newCol}`)
|
|
80
|
+
onPositionChange?.({ row: newRow, col: newCol })
|
|
81
|
+
|
|
82
|
+
if (selectedCell?.type === "workspace") {
|
|
83
|
+
setPage(Page.Project)
|
|
84
|
+
setProject(selectedCell.workspace)
|
|
85
|
+
} else if (selectedCell?.type === "quickAction") {
|
|
86
|
+
const workspace = projects[newRow]
|
|
87
|
+
const command = selectedCell.action.command
|
|
88
|
+
const keepTuiOpen = shouldKeepTuiOpen(selectedCell.action.exec)
|
|
89
|
+
runCellCommand(command, workspace.path, { detached: keepTuiOpen })
|
|
90
|
+
if (!keepTuiOpen) {
|
|
91
|
+
setPage(Page.Exit)
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
console.warn("No workspace cell found at the selected position")
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Provider
|
|
101
|
+
value={{
|
|
102
|
+
projects,
|
|
103
|
+
workspaceQuickActions,
|
|
104
|
+
workspaceRuntimes,
|
|
105
|
+
workspacesNavigationGrid,
|
|
106
|
+
row: position.row,
|
|
107
|
+
col: position.col,
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
{children}
|
|
111
|
+
</Provider>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { exit } from "node:process"
|
|
2
|
+
import { type Key, useInput } from "ink"
|
|
3
|
+
import { useState } from "react"
|
|
4
|
+
import type { ProjectGridGrid } from "../types/project-grid.js"
|
|
5
|
+
import type { CursorPosition } from "../types/workspace-grid.js"
|
|
6
|
+
import { getCellsByColumn } from "../utils/project/project-grid.js"
|
|
7
|
+
|
|
8
|
+
interface UseNavigationOptions {
|
|
9
|
+
grid: ProjectGridGrid
|
|
10
|
+
onSelect?: (row: number, col: number) => void
|
|
11
|
+
onExit?: () => void
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useProjectGrid({
|
|
15
|
+
grid,
|
|
16
|
+
onSelect,
|
|
17
|
+
onExit,
|
|
18
|
+
}: UseNavigationOptions) {
|
|
19
|
+
const [position, setPosition] = useState<CursorPosition>({ row: 0, col: 0 })
|
|
20
|
+
|
|
21
|
+
const maxCol = grid.maxCol
|
|
22
|
+
|
|
23
|
+
const getMaxRowForCol = (col: number): number => {
|
|
24
|
+
const cells = getCellsByColumn(grid, col)
|
|
25
|
+
return cells.length > 0 ? cells.length - 1 : 0
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
useInput((_input: string, key: Key) => {
|
|
29
|
+
if (key.upArrow) {
|
|
30
|
+
setPosition((prev) => {
|
|
31
|
+
const maxRow = getMaxRowForCol(prev.col)
|
|
32
|
+
const newRow = prev.row - 1 < 0 ? maxRow : prev.row - 1
|
|
33
|
+
return { ...prev, row: newRow }
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
if (key.downArrow) {
|
|
37
|
+
setPosition((prev) => {
|
|
38
|
+
const maxRow = getMaxRowForCol(prev.col)
|
|
39
|
+
const newRow = prev.row + 1 > maxRow ? 0 : prev.row + 1
|
|
40
|
+
return { ...prev, row: newRow }
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
if (key.leftArrow) {
|
|
44
|
+
if (position.col - 1 < 0) {
|
|
45
|
+
onExit?.()
|
|
46
|
+
} else {
|
|
47
|
+
setPosition((prev) => {
|
|
48
|
+
const newCol = prev.col - 1
|
|
49
|
+
const maxRow = getMaxRowForCol(newCol)
|
|
50
|
+
const newRow = Math.min(prev.row, maxRow)
|
|
51
|
+
return { row: newRow, col: newCol }
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (key.rightArrow) {
|
|
56
|
+
setPosition((prev) => {
|
|
57
|
+
if (prev.col + 1 > maxCol) {
|
|
58
|
+
return prev
|
|
59
|
+
}
|
|
60
|
+
const newCol = prev.col + 1
|
|
61
|
+
const maxRow = getMaxRowForCol(newCol)
|
|
62
|
+
const newRow = Math.min(prev.row, maxRow)
|
|
63
|
+
return { row: newRow, col: newCol }
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
if (key.return && onSelect) {
|
|
67
|
+
onSelect(position.row, position.col)
|
|
68
|
+
}
|
|
69
|
+
if (key.escape) {
|
|
70
|
+
exit()
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
position,
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useEffect, useState } from "react"
|
|
2
|
+
|
|
3
|
+
import { discoverWorkspaces } from "../services/discovery/workspace-discovery.js"
|
|
4
|
+
import type { Project } from "../types/project.js"
|
|
5
|
+
import { logger } from "../utils/logging/logger.js"
|
|
6
|
+
|
|
7
|
+
interface UseWorkspaceDiscoveryOptions {
|
|
8
|
+
refreshIntervalMs?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useWorkspaceDiscovery(
|
|
12
|
+
rootPath: string,
|
|
13
|
+
options?: UseWorkspaceDiscoveryOptions,
|
|
14
|
+
) {
|
|
15
|
+
const [loading, setLoading] = useState(true)
|
|
16
|
+
const [projects, setProjects] = useState<Project[]>([])
|
|
17
|
+
const [error, setError] = useState<Error | null>(null)
|
|
18
|
+
const refreshIntervalMs = options?.refreshIntervalMs ?? 0
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let cancelled = false
|
|
22
|
+
let pending = false
|
|
23
|
+
|
|
24
|
+
async function load() {
|
|
25
|
+
if (pending || cancelled) {
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pending = true
|
|
30
|
+
setLoading(true)
|
|
31
|
+
setError(null)
|
|
32
|
+
try {
|
|
33
|
+
const result = await discoverWorkspaces(rootPath)
|
|
34
|
+
logger.debug(rootPath, "discovered workspaces")
|
|
35
|
+
if (!cancelled) {
|
|
36
|
+
setProjects(result)
|
|
37
|
+
logger.debug(`Workspace discovery result count: ${result.length}`)
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
if (!cancelled) setError(err as Error)
|
|
41
|
+
} finally {
|
|
42
|
+
if (!cancelled) setLoading(false)
|
|
43
|
+
pending = false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
load()
|
|
48
|
+
|
|
49
|
+
const intervalId =
|
|
50
|
+
refreshIntervalMs > 0 ? setInterval(load, refreshIntervalMs) : null
|
|
51
|
+
|
|
52
|
+
return () => {
|
|
53
|
+
cancelled = true
|
|
54
|
+
if (intervalId) {
|
|
55
|
+
clearInterval(intervalId)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, [rootPath, refreshIntervalMs])
|
|
59
|
+
|
|
60
|
+
return { loading, projects, error }
|
|
61
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type Key, useApp, useInput } from "ink"
|
|
2
|
+
import { useState } from "react"
|
|
3
|
+
import {
|
|
4
|
+
stopComposeService,
|
|
5
|
+
stopScriptProcess,
|
|
6
|
+
} from "../services/runtime/stop-runtime.js"
|
|
7
|
+
import type {
|
|
8
|
+
CursorPosition,
|
|
9
|
+
WorkspacesNavigationCell,
|
|
10
|
+
WorkspacesNavigationGrid,
|
|
11
|
+
} from "../types/workspace-grid.js"
|
|
12
|
+
import { findNextPosition } from "../utils/navigation/navigation-helper.js"
|
|
13
|
+
import { getWorkspaceCellByPosition } from "../utils/workspace/workspace-grid.js"
|
|
14
|
+
|
|
15
|
+
interface UseNavigationOptions {
|
|
16
|
+
grid: WorkspacesNavigationGrid
|
|
17
|
+
initialPosition?: CursorPosition
|
|
18
|
+
onSelect?: (row: number, col: number) => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function useWorkspaceGrid({
|
|
22
|
+
grid,
|
|
23
|
+
initialPosition,
|
|
24
|
+
onSelect,
|
|
25
|
+
}: UseNavigationOptions) {
|
|
26
|
+
const { exit } = useApp()
|
|
27
|
+
const [position, setPosition] = useState<CursorPosition>(
|
|
28
|
+
initialPosition ?? { row: 0, col: 0 },
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
useInput((input: string, key: Key) => {
|
|
32
|
+
if (key.upArrow) {
|
|
33
|
+
const next = findNextPosition(grid, position, "up")
|
|
34
|
+
setPosition(next)
|
|
35
|
+
}
|
|
36
|
+
if (key.downArrow) {
|
|
37
|
+
const next = findNextPosition(grid, position, "down")
|
|
38
|
+
setPosition(next)
|
|
39
|
+
}
|
|
40
|
+
if (key.leftArrow) {
|
|
41
|
+
const next = findNextPosition(grid, position, "left")
|
|
42
|
+
setPosition(next)
|
|
43
|
+
}
|
|
44
|
+
if (key.rightArrow) {
|
|
45
|
+
const next = findNextPosition(grid, position, "right")
|
|
46
|
+
setPosition(next)
|
|
47
|
+
}
|
|
48
|
+
if (key.return && onSelect) {
|
|
49
|
+
onSelect(position.row, position.col)
|
|
50
|
+
}
|
|
51
|
+
// Handle 's' key to stop/kill
|
|
52
|
+
if (input === "s" && !key.ctrl && !key.meta && !key.shift) {
|
|
53
|
+
const cell = getWorkspaceCellByPosition(grid, position.row, position.col)
|
|
54
|
+
stopWorkspaceCell(cell)
|
|
55
|
+
}
|
|
56
|
+
// Helper to stop a running workspace cell (script or service)
|
|
57
|
+
function stopWorkspaceCell(cell: WorkspacesNavigationCell | null) {
|
|
58
|
+
if (
|
|
59
|
+
!cell ||
|
|
60
|
+
cell.type !== "runtime" ||
|
|
61
|
+
cell.runState.status !== "running"
|
|
62
|
+
)
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
// Optimistically reflect stopping state in the UI
|
|
66
|
+
cell.runState.status = "stopping"
|
|
67
|
+
setPosition((current) => ({ ...current }))
|
|
68
|
+
|
|
69
|
+
const runState = cell.runState
|
|
70
|
+
if (runState.type === "script") {
|
|
71
|
+
stopScriptProcess(runState)
|
|
72
|
+
} else if (runState.type === "service") {
|
|
73
|
+
stopComposeService(runState)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (key.escape) {
|
|
78
|
+
exit()
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
position,
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Project } from "../types/project.js"
|
|
2
|
+
import type {
|
|
3
|
+
FacetQuickAction,
|
|
4
|
+
WorkspaceQuickAction,
|
|
5
|
+
} from "../types/workspace-quick-actions.js"
|
|
6
|
+
import { logger } from "../utils/logging/logger.js"
|
|
7
|
+
|
|
8
|
+
export function useWorkspaceQuickActions(projects: Project[]) {
|
|
9
|
+
const quickActions: WorkspaceQuickAction[] = []
|
|
10
|
+
|
|
11
|
+
for (const project of projects) {
|
|
12
|
+
const faccetQuickActions: FacetQuickAction[] = []
|
|
13
|
+
|
|
14
|
+
// Priority 1: Makefile (dev, up)
|
|
15
|
+
const makefile = project.facets.makefile
|
|
16
|
+
let hasMakefileUp = false
|
|
17
|
+
let hasMakefileUpDetached = false
|
|
18
|
+
if (makefile) {
|
|
19
|
+
const dev = makefile.commands.find((cmd) => cmd.name === "dev")
|
|
20
|
+
if (dev)
|
|
21
|
+
faccetQuickActions.push({
|
|
22
|
+
facetPath: makefile.path,
|
|
23
|
+
name: dev.name,
|
|
24
|
+
command: dev.command,
|
|
25
|
+
exec: dev.exec,
|
|
26
|
+
order: 1,
|
|
27
|
+
})
|
|
28
|
+
const up = makefile.commands.find((cmd) => cmd.name === "up")
|
|
29
|
+
if (up)
|
|
30
|
+
faccetQuickActions.push({
|
|
31
|
+
facetPath: makefile.path,
|
|
32
|
+
name: up.name,
|
|
33
|
+
command: up.command,
|
|
34
|
+
exec: up.exec,
|
|
35
|
+
order: 2,
|
|
36
|
+
})
|
|
37
|
+
hasMakefileUp = Boolean(up)
|
|
38
|
+
const upDetached = makefile.commands.find(
|
|
39
|
+
(cmd) => cmd.name === "up-detached",
|
|
40
|
+
)
|
|
41
|
+
if (upDetached)
|
|
42
|
+
faccetQuickActions.push({
|
|
43
|
+
facetPath: makefile.path,
|
|
44
|
+
name: "up -d",
|
|
45
|
+
command: upDetached.command,
|
|
46
|
+
exec: upDetached.exec,
|
|
47
|
+
order: 2,
|
|
48
|
+
})
|
|
49
|
+
hasMakefileUpDetached = Boolean(upDetached)
|
|
50
|
+
|
|
51
|
+
if (project.facets.compose) {
|
|
52
|
+
const compose = project.facets.compose
|
|
53
|
+
if (!hasMakefileUp)
|
|
54
|
+
faccetQuickActions.push({
|
|
55
|
+
facetPath: compose.path,
|
|
56
|
+
name: "up",
|
|
57
|
+
command: "docker compose up",
|
|
58
|
+
exec: "docker compose up",
|
|
59
|
+
order: 2,
|
|
60
|
+
})
|
|
61
|
+
if (!hasMakefileUpDetached)
|
|
62
|
+
faccetQuickActions.push({
|
|
63
|
+
facetPath: compose.path,
|
|
64
|
+
name: "up -d",
|
|
65
|
+
command: "docker compose up -d",
|
|
66
|
+
exec: "docker compose up -d",
|
|
67
|
+
order: 2,
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Priority 2: package.json (dev)
|
|
73
|
+
if (faccetQuickActions.length === 0 && project.facets.packageJson) {
|
|
74
|
+
const pkg = project.facets.packageJson
|
|
75
|
+
const dev = pkg.scripts.find((s) => s.name === "dev")
|
|
76
|
+
if (dev)
|
|
77
|
+
faccetQuickActions.push({
|
|
78
|
+
facetPath: pkg.path,
|
|
79
|
+
name: dev.name,
|
|
80
|
+
command: dev.command,
|
|
81
|
+
exec: dev.exec,
|
|
82
|
+
order: 1,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Priority 3: compose (up)
|
|
87
|
+
if (faccetQuickActions.length === 0 && project.facets.compose) {
|
|
88
|
+
const compose = project.facets.compose
|
|
89
|
+
faccetQuickActions.push({
|
|
90
|
+
facetPath: compose.path,
|
|
91
|
+
name: "up",
|
|
92
|
+
command: "docker compose up",
|
|
93
|
+
exec: "docker compose up",
|
|
94
|
+
order: 1,
|
|
95
|
+
})
|
|
96
|
+
faccetQuickActions.push({
|
|
97
|
+
facetPath: compose.path,
|
|
98
|
+
name: "up -d",
|
|
99
|
+
command: "docker compose up -d",
|
|
100
|
+
exec: "docker compose up -d",
|
|
101
|
+
order: 2,
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const quickWorkspaceAction: WorkspaceQuickAction = {
|
|
106
|
+
workspacePath: project.path,
|
|
107
|
+
facets: faccetQuickActions,
|
|
108
|
+
}
|
|
109
|
+
quickActions.push(quickWorkspaceAction)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
logger.debug(quickActions, "Quick Actions")
|
|
113
|
+
return quickActions
|
|
114
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useEffect, useState } from "react"
|
|
2
|
+
|
|
3
|
+
import { getDockerRunStates } from "../services/runtime/docker-runtime.js"
|
|
4
|
+
import { getNodeRunStates } from "../services/runtime/node-runtime.js"
|
|
5
|
+
import { resolveRuntimeConflicts } from "../services/runtime/resolve-runtime.js"
|
|
6
|
+
import type { Project } from "../types/project.js"
|
|
7
|
+
import type { WorkspaceRuntimeState } from "../types/workspace-runtime.js"
|
|
8
|
+
import { logger } from "../utils/logging/logger.js"
|
|
9
|
+
|
|
10
|
+
function mergeTransientStatuses(
|
|
11
|
+
previous: WorkspaceRuntimeState[],
|
|
12
|
+
next: WorkspaceRuntimeState[],
|
|
13
|
+
): WorkspaceRuntimeState[] {
|
|
14
|
+
const previousById = new Map<string, string>()
|
|
15
|
+
|
|
16
|
+
for (const workspace of previous) {
|
|
17
|
+
for (const runState of workspace.runStates) {
|
|
18
|
+
previousById.set(runState.id, runState.status)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return next.map((workspace) => ({
|
|
23
|
+
...workspace,
|
|
24
|
+
runStates: workspace.runStates.map((runState) => {
|
|
25
|
+
const prevStatus = previousById.get(runState.id)
|
|
26
|
+
const isTransientPrevStatus =
|
|
27
|
+
prevStatus === "starting" || prevStatus === "stopping"
|
|
28
|
+
const isRunningNow = runState.status === "running"
|
|
29
|
+
|
|
30
|
+
if (isTransientPrevStatus && isRunningNow) {
|
|
31
|
+
return {
|
|
32
|
+
...runState,
|
|
33
|
+
status: prevStatus,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return runState
|
|
38
|
+
}),
|
|
39
|
+
}))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function useWorkspaceRuntime(projects: Project[]) {
|
|
43
|
+
const [runtimeStates, setRuntimeStates] = useState<WorkspaceRuntimeState[]>(
|
|
44
|
+
[],
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
let cancelled = false
|
|
49
|
+
async function fetchStatus() {
|
|
50
|
+
const results: WorkspaceRuntimeState[] = []
|
|
51
|
+
for (const project of projects) {
|
|
52
|
+
const scripts = project.facets.packageJson?.scripts ?? []
|
|
53
|
+
const services = project.facets.compose?.services ?? []
|
|
54
|
+
|
|
55
|
+
// const [nodeStates, dockerStates] = await Promise.all([
|
|
56
|
+
// getNodeRunStates(project.absolutePath, project.path, scripts),
|
|
57
|
+
// getDockerRunStates(project.path, services),
|
|
58
|
+
// ])
|
|
59
|
+
|
|
60
|
+
const nodeStates = await getNodeRunStates(
|
|
61
|
+
project.absolutePath,
|
|
62
|
+
project.path,
|
|
63
|
+
scripts,
|
|
64
|
+
)
|
|
65
|
+
const dockerStates = await getDockerRunStates(project.path, services)
|
|
66
|
+
|
|
67
|
+
// Resolve conflicts between node and docker run states
|
|
68
|
+
const { node: resolvedNodeStates, docker: resolvedDockerStates } =
|
|
69
|
+
resolveRuntimeConflicts(nodeStates, dockerStates)
|
|
70
|
+
|
|
71
|
+
results.push({
|
|
72
|
+
workspacePath: project.path,
|
|
73
|
+
runStates: [...resolvedNodeStates, ...resolvedDockerStates],
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
if (!cancelled) {
|
|
77
|
+
setRuntimeStates((previous) =>
|
|
78
|
+
mergeTransientStatuses(previous, results),
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
fetchStatus()
|
|
83
|
+
const interval = setInterval(fetchStatus, 5000)
|
|
84
|
+
return () => {
|
|
85
|
+
cancelled = true
|
|
86
|
+
clearInterval(interval)
|
|
87
|
+
}
|
|
88
|
+
}, [projects])
|
|
89
|
+
|
|
90
|
+
logger.debug(runtimeStates, "Runtime States")
|
|
91
|
+
return runtimeStates
|
|
92
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { loadConfig } from "./config/config.js"
|
|
3
|
+
import { initLogger } from "./utils/logging/logger.js"
|
|
4
|
+
|
|
5
|
+
// Initialize config and logger before starting app
|
|
6
|
+
const config = await loadConfig(process.cwd())
|
|
7
|
+
initLogger(config)
|
|
8
|
+
|
|
9
|
+
// Start the app (dynamic import so config is ready)
|
|
10
|
+
await import("./app/App.js")
|