@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,60 @@
|
|
|
1
|
+
import type { WorkspacesNavigationGrid } from "../../types/workspace-grid"
|
|
2
|
+
|
|
3
|
+
export function findNextPosition(
|
|
4
|
+
grid: WorkspacesNavigationGrid,
|
|
5
|
+
position: { row: number; col: number },
|
|
6
|
+
direction: "up" | "down" | "left" | "right",
|
|
7
|
+
): { row: number; col: number } {
|
|
8
|
+
const numRows = grid.length
|
|
9
|
+
const numCols = grid[0]?.cells.length || 0
|
|
10
|
+
const { row, col } = position
|
|
11
|
+
|
|
12
|
+
function isValid(r: number, c: number) {
|
|
13
|
+
const navRow = grid[r]
|
|
14
|
+
return (
|
|
15
|
+
r >= 0 &&
|
|
16
|
+
r < numRows &&
|
|
17
|
+
c >= 0 &&
|
|
18
|
+
c < (navRow?.cells.length || 0) &&
|
|
19
|
+
navRow?.cells[c] !== null &&
|
|
20
|
+
navRow?.cells[c] !== undefined
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let nextRow = row
|
|
25
|
+
let nextCol = col
|
|
26
|
+
let found = false
|
|
27
|
+
let attempts = 0
|
|
28
|
+
const maxAttempts = numRows * numCols
|
|
29
|
+
|
|
30
|
+
while (!found && attempts < maxAttempts) {
|
|
31
|
+
switch (direction) {
|
|
32
|
+
case "up":
|
|
33
|
+
nextRow = (nextRow - 1 + numRows) % numRows
|
|
34
|
+
break
|
|
35
|
+
case "down":
|
|
36
|
+
nextRow = (nextRow + 1) % numRows
|
|
37
|
+
break
|
|
38
|
+
case "left":
|
|
39
|
+
nextCol = (nextCol - 1 + numCols) % numCols
|
|
40
|
+
break
|
|
41
|
+
case "right":
|
|
42
|
+
nextCol = (nextCol + 1) % numCols
|
|
43
|
+
break
|
|
44
|
+
}
|
|
45
|
+
if (isValid(nextRow, nextCol)) {
|
|
46
|
+
found = true
|
|
47
|
+
} else {
|
|
48
|
+
// If moving left/right, stay in the same row; if up/down, stay in the same col
|
|
49
|
+
if (direction === "left" || direction === "right") {
|
|
50
|
+
// wrap around row if needed
|
|
51
|
+
if (nextCol === col) break
|
|
52
|
+
} else {
|
|
53
|
+
if (nextRow === row) break
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
attempts++
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { row: nextRow, col: nextCol }
|
|
60
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { WorkspacesNavigationGrid } from "../../types/workspace-grid.js"
|
|
2
|
+
|
|
3
|
+
interface QuickActionLikeCell {
|
|
4
|
+
action: {
|
|
5
|
+
name: string
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function findNextPosition(
|
|
10
|
+
grid: WorkspacesNavigationGrid,
|
|
11
|
+
position: { row: number; col: number },
|
|
12
|
+
direction: "up" | "down" | "left" | "right",
|
|
13
|
+
): { row: number; col: number } {
|
|
14
|
+
const numRows = grid.length
|
|
15
|
+
const numCols = grid[0]?.cells.length || 0
|
|
16
|
+
const { row, col } = position
|
|
17
|
+
|
|
18
|
+
function isValid(r: number, c: number) {
|
|
19
|
+
const navRow = grid[r]
|
|
20
|
+
return (
|
|
21
|
+
r >= 0 &&
|
|
22
|
+
r < numRows &&
|
|
23
|
+
c >= 0 &&
|
|
24
|
+
c < (navRow?.cells.length || 0) &&
|
|
25
|
+
navRow?.cells[c] !== null &&
|
|
26
|
+
navRow?.cells[c] !== undefined
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let nextRow = row
|
|
31
|
+
let nextCol = col
|
|
32
|
+
let found = false
|
|
33
|
+
let attempts = 0
|
|
34
|
+
const maxAttempts = numRows * numCols
|
|
35
|
+
|
|
36
|
+
while (!found && attempts < maxAttempts) {
|
|
37
|
+
switch (direction) {
|
|
38
|
+
case "up":
|
|
39
|
+
nextRow = (nextRow - 1 + numRows) % numRows
|
|
40
|
+
break
|
|
41
|
+
case "down":
|
|
42
|
+
nextRow = (nextRow + 1) % numRows
|
|
43
|
+
break
|
|
44
|
+
case "left":
|
|
45
|
+
nextCol = (nextCol - 1 + numCols) % numCols
|
|
46
|
+
break
|
|
47
|
+
case "right":
|
|
48
|
+
nextCol = (nextCol + 1) % numCols
|
|
49
|
+
break
|
|
50
|
+
}
|
|
51
|
+
if (isValid(nextRow, nextCol)) {
|
|
52
|
+
found = true
|
|
53
|
+
} else {
|
|
54
|
+
// If moving left/right, stay in the same row; if up/down, stay in the same col
|
|
55
|
+
if (direction === "left" || direction === "right") {
|
|
56
|
+
// wrap around row if needed
|
|
57
|
+
if (nextCol === col) break
|
|
58
|
+
} else {
|
|
59
|
+
if (nextRow === row) break
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
attempts++
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return { row: nextRow, col: nextCol }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns max text width for each quick-action column index across all rows.
|
|
70
|
+
*/
|
|
71
|
+
export function getQuickActionColumnMaxSizes(
|
|
72
|
+
quickActionRows: QuickActionLikeCell[][],
|
|
73
|
+
): number[] {
|
|
74
|
+
const maxSizes: number[] = []
|
|
75
|
+
|
|
76
|
+
for (const row of quickActionRows) {
|
|
77
|
+
row.forEach((cell, index) => {
|
|
78
|
+
const width = cell.action.name.length
|
|
79
|
+
maxSizes[index] = Math.max(maxSizes[index] ?? 0, width)
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return maxSizes
|
|
84
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
|
|
3
|
+
import type { Project } from "../../types/project.js"
|
|
4
|
+
import {
|
|
5
|
+
COMPOSE_COMMANDS,
|
|
6
|
+
type ComposeCommandCell,
|
|
7
|
+
type ComposeServiceCell,
|
|
8
|
+
type MakefileCell,
|
|
9
|
+
type PackageJsonCell,
|
|
10
|
+
type ProjectGridCell,
|
|
11
|
+
type ProjectGridGrid,
|
|
12
|
+
} from "../../types/project-grid.js"
|
|
13
|
+
|
|
14
|
+
export function buildProjectGrid(workspace: Project): ProjectGridGrid {
|
|
15
|
+
const makefileCells: MakefileCell[] = []
|
|
16
|
+
const packageJsonCells: PackageJsonCell[] = []
|
|
17
|
+
const composeCommandCells: ComposeCommandCell[] = []
|
|
18
|
+
const composeServiceCells: ComposeServiceCell[] = []
|
|
19
|
+
|
|
20
|
+
const makefileCommands = workspace.facets.makefile?.commands ?? []
|
|
21
|
+
const scripts = workspace.facets.packageJson?.scripts ?? []
|
|
22
|
+
const services = workspace.facets.compose?.services ?? []
|
|
23
|
+
const hasCompose = services.length > 0
|
|
24
|
+
|
|
25
|
+
// Assign column indices dynamically, skipping empty facets
|
|
26
|
+
let nextCol = 0
|
|
27
|
+
const makefileCol = makefileCommands.length > 0 ? nextCol++ : -1
|
|
28
|
+
const packageJsonCol = scripts.length > 0 ? nextCol++ : -1
|
|
29
|
+
const composeCol = hasCompose ? nextCol++ : -1
|
|
30
|
+
|
|
31
|
+
// Always show compose commands if column exists (even without services)
|
|
32
|
+
// but only create the column if there are services
|
|
33
|
+
const maxCol = Math.max(nextCol - 1, 0)
|
|
34
|
+
|
|
35
|
+
// Column: Makefile commands
|
|
36
|
+
if (makefileCol >= 0) {
|
|
37
|
+
for (let i = 0; i < makefileCommands.length; i++) {
|
|
38
|
+
makefileCells.push({
|
|
39
|
+
type: "makefile",
|
|
40
|
+
filepath: path.join(
|
|
41
|
+
workspace.path,
|
|
42
|
+
workspace.facets.makefile?.filename ?? "",
|
|
43
|
+
),
|
|
44
|
+
row: i,
|
|
45
|
+
col: makefileCol,
|
|
46
|
+
command: makefileCommands[i],
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Column: Package.json scripts
|
|
52
|
+
if (packageJsonCol >= 0) {
|
|
53
|
+
for (let i = 0; i < scripts.length; i++) {
|
|
54
|
+
packageJsonCells.push({
|
|
55
|
+
type: "packageJson",
|
|
56
|
+
filepath: path.join(
|
|
57
|
+
workspace.path,
|
|
58
|
+
workspace.facets.packageJson?.filename ?? "",
|
|
59
|
+
),
|
|
60
|
+
row: i,
|
|
61
|
+
col: packageJsonCol,
|
|
62
|
+
script: scripts[i],
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Column: Compose commands + services
|
|
68
|
+
if (composeCol >= 0) {
|
|
69
|
+
let composeRow = 0
|
|
70
|
+
for (const command of COMPOSE_COMMANDS) {
|
|
71
|
+
composeCommandCells.push({
|
|
72
|
+
type: "composeCommand",
|
|
73
|
+
filepath: path.join(
|
|
74
|
+
workspace.path,
|
|
75
|
+
workspace.facets.compose?.filename ?? "",
|
|
76
|
+
),
|
|
77
|
+
row: composeRow,
|
|
78
|
+
col: composeCol,
|
|
79
|
+
action: {
|
|
80
|
+
name: command,
|
|
81
|
+
command: `docker compose ${command}`,
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
composeRow++
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
for (const service of services) {
|
|
88
|
+
composeServiceCells.push({
|
|
89
|
+
type: "composeService",
|
|
90
|
+
filepath: path.join(
|
|
91
|
+
workspace.path,
|
|
92
|
+
workspace.facets.compose?.filename ?? "",
|
|
93
|
+
),
|
|
94
|
+
row: composeRow,
|
|
95
|
+
col: composeCol,
|
|
96
|
+
service,
|
|
97
|
+
})
|
|
98
|
+
composeRow++
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
makefileCells,
|
|
104
|
+
packageJsonCells,
|
|
105
|
+
composeCommandCells,
|
|
106
|
+
composeServiceCells,
|
|
107
|
+
maxCol,
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns the cell at the given position from the grid.
|
|
113
|
+
*/
|
|
114
|
+
export function getProjectCellByPosition(
|
|
115
|
+
grid: ProjectGridGrid,
|
|
116
|
+
row: number,
|
|
117
|
+
col: number,
|
|
118
|
+
): ProjectGridCell | null {
|
|
119
|
+
const allCells: ProjectGridCell[] = [
|
|
120
|
+
...grid.makefileCells,
|
|
121
|
+
...grid.packageJsonCells,
|
|
122
|
+
...grid.composeCommandCells,
|
|
123
|
+
...grid.composeServiceCells,
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
return allCells.find((cell) => cell.row === row && cell.col === col) ?? null
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Returns the maximum row count across all columns.
|
|
131
|
+
*/
|
|
132
|
+
export function getMaxRows(grid: ProjectGridGrid): number {
|
|
133
|
+
const col0Max = grid.makefileCells.length
|
|
134
|
+
const col1Max = grid.packageJsonCells.length
|
|
135
|
+
const col2Max =
|
|
136
|
+
grid.composeCommandCells.length + grid.composeServiceCells.length
|
|
137
|
+
return Math.max(col0Max, col1Max, col2Max)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns all cells for a given column.
|
|
142
|
+
*/
|
|
143
|
+
export function getCellsByColumn(
|
|
144
|
+
grid: ProjectGridGrid,
|
|
145
|
+
col: number,
|
|
146
|
+
): ProjectGridCell[] {
|
|
147
|
+
const allCells: ProjectGridCell[] = [
|
|
148
|
+
...grid.makefileCells,
|
|
149
|
+
...grid.packageJsonCells,
|
|
150
|
+
...grid.composeCommandCells,
|
|
151
|
+
...grid.composeServiceCells,
|
|
152
|
+
]
|
|
153
|
+
return allCells.filter((cell) => cell.col === col)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const CELL_TYPE_LABELS: Record<ProjectGridCell["type"], string> = {
|
|
157
|
+
makefile: "Makefile",
|
|
158
|
+
packageJson: "Package.json",
|
|
159
|
+
composeCommand: "Docker Compose",
|
|
160
|
+
composeService: "Docker Service",
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function getCellLabel(cell: ProjectGridCell): string {
|
|
164
|
+
return `${CELL_TYPE_LABELS[cell.type]} - ${cell.filepath}`
|
|
165
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createServer } from "node:net"
|
|
2
|
+
import { afterEach, describe, expect, it } from "@jest/globals"
|
|
3
|
+
|
|
4
|
+
import { isPortInUse } from "./port"
|
|
5
|
+
|
|
6
|
+
describe("isPortInUse", () => {
|
|
7
|
+
let server: ReturnType<typeof createServer> | null = null
|
|
8
|
+
const testPort = 45678
|
|
9
|
+
|
|
10
|
+
afterEach((done) => {
|
|
11
|
+
if (server) {
|
|
12
|
+
server.close(() => {
|
|
13
|
+
server = null
|
|
14
|
+
done()
|
|
15
|
+
})
|
|
16
|
+
} else {
|
|
17
|
+
done()
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it("returns false for a free port", async () => {
|
|
22
|
+
const inUse = await isPortInUse(testPort)
|
|
23
|
+
expect(inUse).toBe(false)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it("returns true for a taken port", async () => {
|
|
27
|
+
server = createServer()
|
|
28
|
+
await new Promise((resolve) =>
|
|
29
|
+
server?.listen(testPort, () => resolve(undefined)),
|
|
30
|
+
)
|
|
31
|
+
const inUse = await isPortInUse(testPort)
|
|
32
|
+
expect(inUse).toBe(true)
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createServer } from "node:net"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check whether a TCP port is already in use on localhost.
|
|
5
|
+
* Returns `true` if the port is taken, `false` if it is free.
|
|
6
|
+
*/
|
|
7
|
+
export function isPortInUse(port: number): Promise<boolean> {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
const server = createServer()
|
|
10
|
+
|
|
11
|
+
server.once("error", (err: NodeJS.ErrnoException) => {
|
|
12
|
+
if (err.code === "EADDRINUSE") {
|
|
13
|
+
resolve(true)
|
|
14
|
+
} else {
|
|
15
|
+
// Unexpected error — treat as in use to be safe
|
|
16
|
+
resolve(true)
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
server.once("listening", () => {
|
|
21
|
+
server.close(() => resolve(false))
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
server.listen(port, "127.0.0.1")
|
|
25
|
+
})
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PackageJson } from "type-fest"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Detect framework based on package.json dependencies
|
|
5
|
+
* Priority order matters - checks more specific frameworks first
|
|
6
|
+
*/
|
|
7
|
+
export function detectFramework(pkg: PackageJson): string | undefined {
|
|
8
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies }
|
|
9
|
+
const depKeys = Object.keys(deps)
|
|
10
|
+
|
|
11
|
+
// Meta-frameworks (check first - most specific)
|
|
12
|
+
if (depKeys.includes("next")) return "Next.js"
|
|
13
|
+
if (depKeys.includes("@remix-run/react")) return "Remix"
|
|
14
|
+
if (depKeys.includes("@sveltejs/kit")) return "SvelteKit"
|
|
15
|
+
if (depKeys.includes("nuxt")) return "Nuxt"
|
|
16
|
+
if (depKeys.includes("astro")) return "Astro"
|
|
17
|
+
if (depKeys.includes("gatsby")) return "Gatsby"
|
|
18
|
+
if (depKeys.includes("@redwoodjs/core")) return "RedwoodJS"
|
|
19
|
+
if (depKeys.includes("blitz")) return "Blitz"
|
|
20
|
+
if (depKeys.includes("@solidjs/start")) return "SolidStart"
|
|
21
|
+
if (depKeys.includes("@analogjs/platform")) return "Analog"
|
|
22
|
+
if (depKeys.includes("hardhat")) return "Hardhat"
|
|
23
|
+
|
|
24
|
+
// Backend frameworks
|
|
25
|
+
if (depKeys.includes("@nestjs/core")) return "NestJS"
|
|
26
|
+
if (depKeys.includes("h3")) return "H3"
|
|
27
|
+
if (depKeys.includes("express")) return "Express"
|
|
28
|
+
if (depKeys.includes("fastify")) return "Fastify"
|
|
29
|
+
if (depKeys.includes("koa")) return "Koa"
|
|
30
|
+
if (depKeys.includes("@hapi/hapi")) return "Hapi"
|
|
31
|
+
if (depKeys.includes("nitro")) return "Nitro"
|
|
32
|
+
if (depKeys.includes("@trpc/server")) return "tRPC"
|
|
33
|
+
if (depKeys.includes("elysia")) return "Elysia"
|
|
34
|
+
if (depKeys.includes("hono")) return "Hono"
|
|
35
|
+
|
|
36
|
+
// Frontend frameworks
|
|
37
|
+
if (depKeys.includes("@docusaurus/core")) return "Docusaurus"
|
|
38
|
+
if (depKeys.includes("react")) return "React"
|
|
39
|
+
if (depKeys.includes("vue")) return "Vue"
|
|
40
|
+
if (depKeys.includes("svelte")) return "Svelte"
|
|
41
|
+
if (depKeys.includes("@angular/core")) return "Angular"
|
|
42
|
+
if (depKeys.includes("solid-js")) return "Solid"
|
|
43
|
+
if (depKeys.includes("preact")) return "Preact"
|
|
44
|
+
if (depKeys.includes("@builder.io/qwik")) return "Qwik"
|
|
45
|
+
if (depKeys.includes("lit")) return "Lit"
|
|
46
|
+
if (depKeys.includes("alpine")) return "Alpine.js"
|
|
47
|
+
if (depKeys.includes("htmx.org")) return "HTMX"
|
|
48
|
+
|
|
49
|
+
// Build tools (fallback)
|
|
50
|
+
if (depKeys.includes("vite")) return "Vite"
|
|
51
|
+
if (depKeys.includes("webpack")) return "Webpack"
|
|
52
|
+
if (depKeys.includes("parcel")) return "Parcel"
|
|
53
|
+
if (depKeys.includes("rollup")) return "Rollup"
|
|
54
|
+
if (depKeys.includes("turbo")) return "Turborepo"
|
|
55
|
+
if (depKeys.includes("esbuild")) return "esbuild"
|
|
56
|
+
|
|
57
|
+
// Mobile frameworks
|
|
58
|
+
if (depKeys.includes("react-native")) return "React Native"
|
|
59
|
+
if (
|
|
60
|
+
depKeys.includes("@ionic/react") ||
|
|
61
|
+
depKeys.includes("@ionic/angular") ||
|
|
62
|
+
depKeys.includes("@ionic/vue")
|
|
63
|
+
)
|
|
64
|
+
return "Ionic"
|
|
65
|
+
if (depKeys.includes("@nativescript/core")) return "NativeScript"
|
|
66
|
+
if (depKeys.includes("@tauri-apps/api")) return "Tauri"
|
|
67
|
+
if (depKeys.includes("electron")) return "Electron"
|
|
68
|
+
|
|
69
|
+
// Desktop frameworks
|
|
70
|
+
if (depKeys.includes("@neutralinojs/lib")) return "Neutralino"
|
|
71
|
+
if (depKeys.includes("nw")) return "NW.js"
|
|
72
|
+
|
|
73
|
+
// Testing frameworks (only if no other framework detected)
|
|
74
|
+
if (depKeys.includes("vitest")) return "Vitest"
|
|
75
|
+
|
|
76
|
+
return undefined
|
|
77
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { Project } from "../../types/project.js"
|
|
2
|
+
import type {
|
|
3
|
+
WorkspaceCell,
|
|
4
|
+
WorkspaceQuickActionCell,
|
|
5
|
+
WorkspaceRuntimeCell,
|
|
6
|
+
WorkspacesNavigationCell,
|
|
7
|
+
WorkspacesNavigationGrid,
|
|
8
|
+
WorkspacesNavigationRow,
|
|
9
|
+
} from "../../types/workspace-grid"
|
|
10
|
+
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js"
|
|
11
|
+
import type { WorkspaceRuntimeState } from "../../types/workspace-runtime.js"
|
|
12
|
+
import { logger } from "../../utils/logging/logger.js"
|
|
13
|
+
import { getQuickActionByPath, getRuntimeByPath } from "./workspace-helper.js"
|
|
14
|
+
|
|
15
|
+
export function buildWorkspacesGrid(
|
|
16
|
+
workspaces: Project[],
|
|
17
|
+
quickActions: WorkspaceQuickAction[],
|
|
18
|
+
runtimes: WorkspaceRuntimeState[],
|
|
19
|
+
): WorkspacesNavigationGrid {
|
|
20
|
+
const maxQuickActionFacets = getMaxQuickActionRowItems(quickActions)
|
|
21
|
+
const maxRuntimeFacets = getMaxRuntimeRowItems(runtimes)
|
|
22
|
+
|
|
23
|
+
const grid: WorkspacesNavigationGrid = []
|
|
24
|
+
for (let rowIndex = 0; rowIndex < workspaces.length; rowIndex++) {
|
|
25
|
+
const ws = workspaces[rowIndex]
|
|
26
|
+
const cells: (WorkspacesNavigationCell | null)[] = []
|
|
27
|
+
|
|
28
|
+
// Workspace cell (col 0)
|
|
29
|
+
cells.push({ type: "workspace", workspace: ws, row: rowIndex, col: 0 })
|
|
30
|
+
|
|
31
|
+
// Quick actions
|
|
32
|
+
const quickAction = getQuickActionByPath(quickActions, ws.path)
|
|
33
|
+
const qaFacets = quickAction?.facets ?? []
|
|
34
|
+
for (let i = 0; i < maxQuickActionFacets; i++) {
|
|
35
|
+
if (qaFacets[i]) {
|
|
36
|
+
cells.push({
|
|
37
|
+
type: "quickAction",
|
|
38
|
+
action: qaFacets[i],
|
|
39
|
+
row: rowIndex,
|
|
40
|
+
col: i + 1,
|
|
41
|
+
})
|
|
42
|
+
} else {
|
|
43
|
+
cells.push(null)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Runtimes
|
|
48
|
+
const runtime = getRuntimeByPath(runtimes, ws.path)
|
|
49
|
+
const rtFacets =
|
|
50
|
+
runtime?.runStates?.filter((rs) => rs.status !== "stopped") ?? []
|
|
51
|
+
for (let i = 0; i < maxRuntimeFacets; i++) {
|
|
52
|
+
if (rtFacets[i]) {
|
|
53
|
+
cells.push({
|
|
54
|
+
type: "runtime",
|
|
55
|
+
runState: rtFacets[i],
|
|
56
|
+
row: rowIndex,
|
|
57
|
+
col: i + maxQuickActionFacets + 1,
|
|
58
|
+
})
|
|
59
|
+
} else {
|
|
60
|
+
cells.push(null)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const navRow: WorkspacesNavigationRow = {
|
|
65
|
+
id: ws.path,
|
|
66
|
+
cells,
|
|
67
|
+
}
|
|
68
|
+
grid.push(navRow)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
logger.debug("Workspaces Navigation Grid")
|
|
72
|
+
logger.debug(JSON.stringify(grid, null, 2))
|
|
73
|
+
return grid
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Returns the highest number of items found in the array.
|
|
78
|
+
*/
|
|
79
|
+
function getMaxQuickActionRowItems(arr: { facets?: unknown[] }[]): number {
|
|
80
|
+
return arr.reduce((max, item) => {
|
|
81
|
+
const count = Array.isArray(item.facets) ? item.facets.length : 0
|
|
82
|
+
return count > max ? count : max
|
|
83
|
+
}, 0)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns the highest number of items found in the array.
|
|
88
|
+
*/
|
|
89
|
+
function getMaxRuntimeRowItems(arr: { runStates?: unknown[] }[]): number {
|
|
90
|
+
return arr.reduce((max, item) => {
|
|
91
|
+
const count = Array.isArray(item.runStates) ? item.runStates.length : 0
|
|
92
|
+
return count > max ? count : max
|
|
93
|
+
}, 0)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns the first WorkspaceCell found in a row
|
|
98
|
+
*/
|
|
99
|
+
export function getWorkspaceCell(
|
|
100
|
+
cells: (WorkspacesNavigationCell | null)[],
|
|
101
|
+
): WorkspaceCell {
|
|
102
|
+
return cells.find(
|
|
103
|
+
(cell) => cell && cell.type === "workspace",
|
|
104
|
+
) as WorkspaceCell
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns all WorkspaceQuickActionCell in a row
|
|
109
|
+
*/
|
|
110
|
+
export function getWorkspaceQuickActionCells(
|
|
111
|
+
cells: (WorkspacesNavigationCell | null)[],
|
|
112
|
+
): WorkspaceQuickActionCell[] {
|
|
113
|
+
const result: WorkspaceQuickActionCell[] = []
|
|
114
|
+
for (const cell of cells) {
|
|
115
|
+
if (cell && cell.type === "quickAction")
|
|
116
|
+
result.push(cell as WorkspaceQuickActionCell)
|
|
117
|
+
}
|
|
118
|
+
return result
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns all WorkspaceRuntimeCell in a row
|
|
123
|
+
*/
|
|
124
|
+
export function getWorkspaceRuntimeCells(
|
|
125
|
+
cells: (WorkspacesNavigationCell | null)[],
|
|
126
|
+
): WorkspaceRuntimeCell[] {
|
|
127
|
+
const result: WorkspaceRuntimeCell[] = []
|
|
128
|
+
for (const cell of cells) {
|
|
129
|
+
if (cell && cell.type === "runtime")
|
|
130
|
+
result.push(cell as WorkspaceRuntimeCell)
|
|
131
|
+
}
|
|
132
|
+
return result
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// /**
|
|
136
|
+
// * Returns the WorkspaceCell at the given cursor position (row, col) from the grid.
|
|
137
|
+
// */
|
|
138
|
+
// export function getWorkspaceCellByPosition(
|
|
139
|
+
// grid: WorkspacesNavigationGrid,
|
|
140
|
+
// row: number,
|
|
141
|
+
// col: number,
|
|
142
|
+
// ): WorkspaceCell | null {
|
|
143
|
+
// const navRow = grid[row]
|
|
144
|
+
// if (!navRow || !navRow.cells[col]) return null
|
|
145
|
+
// const cell = navRow.cells[col]
|
|
146
|
+
// return cell && cell.type === "workspace" ? (cell as WorkspaceCell) : null
|
|
147
|
+
// }
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Returns the WorkspacesNavigationCell (any type) at the given row and col from the grid.
|
|
151
|
+
*/
|
|
152
|
+
export function getWorkspaceCellByPosition(
|
|
153
|
+
grid: WorkspacesNavigationGrid,
|
|
154
|
+
row: number,
|
|
155
|
+
col: number,
|
|
156
|
+
): WorkspacesNavigationCell | null {
|
|
157
|
+
const navRow = grid[row]
|
|
158
|
+
if (!navRow || !navRow.cells[col]) return null
|
|
159
|
+
const cell = navRow.cells[col]
|
|
160
|
+
return cell ? cell : null
|
|
161
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Project } from "../../types/project.js"
|
|
2
|
+
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js"
|
|
3
|
+
import type { WorkspaceRuntimeState } from "../../types/workspace-runtime.js"
|
|
4
|
+
|
|
5
|
+
export function getQuickActionByPath(
|
|
6
|
+
quickActions: WorkspaceQuickAction[],
|
|
7
|
+
path: string,
|
|
8
|
+
): WorkspaceQuickAction | undefined {
|
|
9
|
+
return quickActions.find((action) => action.workspacePath === path)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function getRuntimeByPath(
|
|
13
|
+
runtimes: WorkspaceRuntimeState[],
|
|
14
|
+
path: string,
|
|
15
|
+
): WorkspaceRuntimeState | undefined {
|
|
16
|
+
return runtimes.find((runtime) => runtime.workspacePath === path)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getRootWorkspace(workspaces: Project[]): Project | undefined {
|
|
20
|
+
return workspaces.find((ws) => ws.type === "workspace")
|
|
21
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"rootDir": "./src",
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"declarationMap": true,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
"jsxImportSource": "react"
|
|
20
|
+
},
|
|
21
|
+
"include": ["src/**/*"],
|
|
22
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
discovery: {
|
|
3
|
+
enabled: true,
|
|
4
|
+
maxDepth: 4,
|
|
5
|
+
ignore: ["node_modules", ".git", "dist", "build"],
|
|
6
|
+
scripts: {
|
|
7
|
+
exclude: [],
|
|
8
|
+
},
|
|
9
|
+
env: {
|
|
10
|
+
files: [".env.local", ".env.development", ".env", ".env.example"],
|
|
11
|
+
portKeys: ["PORT", "APP_PORT", "VITE_PORT", "NEXT_PUBLIC_PORT"],
|
|
12
|
+
},
|
|
13
|
+
order: ["workspace", "app", "contract", "infra", "package"],
|
|
14
|
+
},
|
|
15
|
+
execution: {
|
|
16
|
+
useTmux: true,
|
|
17
|
+
},
|
|
18
|
+
}
|