@factorim/monotui 0.1.0 → 0.3.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/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/.github/workflows/ci.yml +5 -2
- package/.github/workflows/release.yml +77 -0
- package/.vscode/settings.json +1 -0
- package/CHANGELOG.md +9 -0
- package/README.md +2 -0
- package/dist/app/pages/WorkspacePage.d.ts.map +1 -1
- package/dist/app/pages/WorkspacePage.js +3 -3
- package/dist/app/pages/WorkspacePage.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +33 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/components/features/ProjectGrid/ColPackageJson.d.ts +2 -2
- package/dist/components/features/ProjectGrid/ColPackageJson.d.ts.map +1 -1
- package/dist/components/features/ProjectGrid/ColPackageJson.js.map +1 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceGrid.js +1 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.d.ts.map +1 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.js +1 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo.js.map +1 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.js +2 -2
- package/dist/components/features/WorkspaceGrid/WorkspaceRow.js.map +1 -1
- package/dist/components/layouts/Header/Header.d.ts.map +1 -1
- package/dist/components/layouts/Header/Header.js +3 -7
- package/dist/components/layouts/Header/Header.js.map +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +21 -21
- package/dist/config/config.js.map +1 -1
- package/dist/config/defaults.d.ts +2 -2
- package/dist/config/defaults.js +2 -2
- package/dist/config/validation.d.ts +54 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +79 -0
- package/dist/config/validation.js.map +1 -0
- package/dist/contexts/ProjectGridContext.d.ts +1 -1
- package/dist/contexts/ProjectGridContext.d.ts.map +1 -1
- package/dist/contexts/WorkspaceDiscoveryContext.d.ts +2 -2
- package/dist/contexts/WorkspaceDiscoveryContext.d.ts.map +1 -1
- package/dist/contexts/WorkspaceDiscoveryContext.js +3 -3
- package/dist/contexts/WorkspaceDiscoveryContext.js.map +1 -1
- package/dist/contexts/WorkspaceGridContext.d.ts +1 -1
- package/dist/contexts/WorkspaceGridContext.d.ts.map +1 -1
- package/dist/contexts/WorkspaceGridContext.js +1 -1
- package/dist/contexts/WorkspaceGridContext.js.map +1 -1
- package/dist/hooks/useInterval.d.ts +5 -0
- package/dist/hooks/useInterval.d.ts.map +1 -0
- package/dist/hooks/useInterval.js +19 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useWorkspaceDiscovery.d.ts +3 -3
- package/dist/hooks/useWorkspaceDiscovery.d.ts.map +1 -1
- package/dist/hooks/useWorkspaceDiscovery.js +8 -13
- package/dist/hooks/useWorkspaceDiscovery.js.map +1 -1
- package/dist/hooks/useWorkspaceQuickActions.d.ts +1 -1
- package/dist/hooks/useWorkspaceQuickActions.d.ts.map +1 -1
- package/dist/hooks/useWorkspaceRuntime.d.ts +1 -1
- package/dist/hooks/useWorkspaceRuntime.d.ts.map +1 -1
- package/dist/hooks/useWorkspaceRuntime.js +30 -8
- package/dist/hooks/useWorkspaceRuntime.js.map +1 -1
- package/dist/services/discovery/facets/compose-parser.d.ts +1 -1
- package/dist/services/discovery/facets/compose-parser.d.ts.map +1 -1
- package/dist/services/discovery/facets/makefile-parser.d.ts +1 -1
- package/dist/services/discovery/facets/makefile-parser.d.ts.map +1 -1
- package/dist/services/discovery/facets/package-json-parser.d.ts +1 -1
- package/dist/services/discovery/facets/package-json-parser.d.ts.map +1 -1
- package/dist/services/discovery/workspace-discovery.d.ts +3 -3
- package/dist/services/discovery/workspace-discovery.d.ts.map +1 -1
- package/dist/services/discovery/workspace-discovery.js +17 -7
- package/dist/services/discovery/workspace-discovery.js.map +1 -1
- package/dist/services/runtime/docker-runtime.d.ts +1 -1
- package/dist/services/runtime/docker-runtime.d.ts.map +1 -1
- package/dist/services/runtime/node-runtime.d.ts +2 -2
- package/dist/services/runtime/node-runtime.d.ts.map +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/theme.js.map +1 -1
- package/dist/types/project-grid.d.ts +1 -1
- package/dist/types/project-grid.d.ts.map +1 -1
- package/dist/types/workspace-grid.d.ts +2 -2
- package/dist/types/workspace-grid.d.ts.map +1 -1
- package/dist/types/workspace.d.ts +9 -2
- package/dist/types/workspace.d.ts.map +1 -1
- package/dist/utils/logging/logger.js +2 -2
- package/dist/utils/logging/logger.js.map +1 -1
- package/dist/utils/project/project-grid.d.ts +1 -1
- package/dist/utils/project/project-grid.d.ts.map +1 -1
- package/dist/utils/project/project-grid.js.map +1 -1
- package/dist/utils/workspace/workspace-grid.d.ts +1 -1
- package/dist/utils/workspace/workspace-grid.d.ts.map +1 -1
- package/dist/utils/workspace/workspace-grid.js +5 -18
- package/dist/utils/workspace/workspace-grid.js.map +1 -1
- package/dist/utils/workspace/workspace-helper.d.ts +1 -1
- package/dist/utils/workspace/workspace-helper.d.ts.map +1 -1
- package/docs/images/monotui-screenshot-v0.2.0.png +0 -0
- package/package.json +11 -4
- package/src/app/pages/WorkspacePage.tsx +5 -3
- package/src/commands/init.ts +34 -4
- package/src/components/features/ProjectGrid/ColPackageJson.tsx +3 -2
- package/src/components/features/WorkspaceGrid/WorkspaceGrid.tsx +2 -2
- package/src/components/features/WorkspaceGrid/WorkspaceInfo.tsx +7 -9
- package/src/components/features/WorkspaceGrid/WorkspaceRow.tsx +6 -6
- package/src/components/layouts/Header/Header.tsx +2 -9
- package/src/config/config.ts +24 -21
- package/src/config/defaults.ts +2 -2
- package/src/config/validation.ts +90 -0
- package/src/contexts/ProjectGridContext.tsx +1 -1
- package/src/contexts/WorkspaceDiscoveryContext.tsx +5 -5
- package/src/contexts/WorkspaceGridContext.tsx +2 -2
- package/src/hooks/useWorkspaceDiscovery.ts +16 -17
- package/src/hooks/useWorkspaceQuickActions.ts +1 -1
- package/src/hooks/useWorkspaceRuntime.ts +52 -12
- package/src/services/discovery/facets/compose-parser.ts +1 -1
- package/src/services/discovery/facets/makefile-parser.ts +2 -2
- package/src/services/discovery/facets/package-json-parser.ts +1 -1
- package/src/services/discovery/workspace-discovery.ts +21 -11
- package/src/services/runtime/docker-runtime.ts +1 -1
- package/src/services/runtime/node-runtime.ts +2 -2
- package/src/theme/theme.ts +1 -1
- package/src/types/project-grid.ts +1 -1
- package/src/types/workspace-grid.ts +2 -2
- package/src/types/{project.ts → workspace.ts} +9 -2
- package/src/utils/logging/logger.ts +2 -2
- package/src/utils/project/project-grid.test.ts +175 -0
- package/src/utils/project/project-grid.ts +1 -2
- package/src/utils/workspace/workspace-grid.ts +6 -20
- package/src/utils/workspace/workspace-helper.ts +1 -1
- package/.github/workflows/publish-to-npm.yml +0 -36
- package/dist/app/pages/About.d.ts +0 -2
- package/dist/app/pages/About.d.ts.map +0 -1
- package/dist/app/pages/About.js +0 -6
- package/dist/app/pages/About.js.map +0 -1
- package/dist/app/pages/AboutPage.d.ts +0 -2
- package/dist/app/pages/AboutPage.d.ts.map +0 -1
- package/dist/app/pages/AboutPage.js +0 -6
- package/dist/app/pages/AboutPage.js.map +0 -1
- package/dist/app/pages/Workspace.d.ts +0 -2
- package/dist/app/pages/Workspace.d.ts.map +0 -1
- package/dist/app/pages/Workspace.js +0 -14
- package/dist/app/pages/Workspace.js.map +0 -1
- package/dist/app/pages/Workspaces.d.ts +0 -2
- package/dist/app/pages/Workspaces.d.ts.map +0 -1
- package/dist/app/pages/Workspaces.js +0 -16
- package/dist/app/pages/Workspaces.js.map +0 -1
- package/dist/app/pages/WorkspacesPage.d.ts +0 -2
- package/dist/app/pages/WorkspacesPage.d.ts.map +0 -1
- package/dist/app/pages/WorkspacesPage.js +0 -15
- package/dist/app/pages/WorkspacesPage.js.map +0 -1
- package/dist/components/features/ProjectGrid/ProjectCommands.d.ts +0 -2
- package/dist/components/features/ProjectGrid/ProjectCommands.d.ts.map +0 -1
- package/dist/components/features/ProjectGrid/ProjectCommands.js +0 -6
- package/dist/components/features/ProjectGrid/ProjectCommands.js.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceCommands.d.ts +0 -2
- package/dist/components/features/ProjectGrid/WorkspaceCommands.d.ts.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceCommands.js +0 -6
- package/dist/components/features/ProjectGrid/WorkspaceCommands.js.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceDetail.d.ts +0 -2
- package/dist/components/features/ProjectGrid/WorkspaceDetail.d.ts.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceDetail.js +0 -16
- package/dist/components/features/ProjectGrid/WorkspaceDetail.js.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceInfo.d.ts +0 -2
- package/dist/components/features/ProjectGrid/WorkspaceInfo.d.ts.map +0 -1
- package/dist/components/features/ProjectGrid/WorkspaceInfo.js +0 -11
- package/dist/components/features/ProjectGrid/WorkspaceInfo.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColCompose.d.ts +0 -10
- package/dist/components/features/WorkspaceDetail/ColCompose.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColCompose.js +0 -6
- package/dist/components/features/WorkspaceDetail/ColCompose.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColMakefile.d.ts +0 -9
- package/dist/components/features/WorkspaceDetail/ColMakefile.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColMakefile.js +0 -6
- package/dist/components/features/WorkspaceDetail/ColMakefile.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColPackageJson.d.ts +0 -11
- package/dist/components/features/WorkspaceDetail/ColPackageJson.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ColPackageJson.js +0 -6
- package/dist/components/features/WorkspaceDetail/ColPackageJson.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.d.ts +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.js +0 -2
- package/dist/components/features/WorkspaceDetail/ComposeCol copy 2.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.d.ts +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.js +0 -2
- package/dist/components/features/WorkspaceDetail/ComposeCol copy.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol.d.ts +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/ComposeCol.js +0 -2
- package/dist/components/features/WorkspaceDetail/ComposeCol.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/EmptyCol.d.ts +0 -2
- package/dist/components/features/WorkspaceDetail/EmptyCol.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/EmptyCol.js +0 -6
- package/dist/components/features/WorkspaceDetail/EmptyCol.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/EmptyRow.d.ts +0 -2
- package/dist/components/features/WorkspaceDetail/EmptyRow.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/EmptyRow.js +0 -6
- package/dist/components/features/WorkspaceDetail/EmptyRow.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.d.ts +0 -1
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.js +0 -2
- package/dist/components/features/WorkspaceDetail/PackageJsonCol.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.d.ts +0 -2
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.js +0 -12
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail copy.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.d.ts +0 -2
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.js +0 -16
- package/dist/components/features/WorkspaceDetail/WorkspaceDetail.js.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.d.ts +0 -2
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.d.ts.map +0 -1
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.js +0 -11
- package/dist/components/features/WorkspaceDetail/WorkspaceInfo.js.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.d.ts +0 -2
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.d.ts.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.js +0 -6
- package/dist/components/features/WorkspaceGrid/WorkspaceCommands.js.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.d.ts +0 -2
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.d.ts.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.js +0 -11
- package/dist/components/features/WorkspaceGrid/WorkspaceInfo copy.js.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.d.ts +0 -2
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.d.ts.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.js +0 -10
- package/dist/components/features/WorkspaceGrid/WorkspacesGrid.js.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.d.ts +0 -2
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.d.ts.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.js +0 -11
- package/dist/components/features/WorkspaceGrid/WorkspacesInfo.js.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.d.ts +0 -8
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.d.ts.map +0 -1
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.js +0 -18
- package/dist/components/features/WorkspaceGrid/WorkspacesRow.js.map +0 -1
- package/dist/components/features/WorkspaceList/WorkspaceList.d.ts +0 -2
- package/dist/components/features/WorkspaceList/WorkspaceList.d.ts.map +0 -1
- package/dist/components/features/WorkspaceList/WorkspaceList.js +0 -10
- package/dist/components/features/WorkspaceList/WorkspaceList.js.map +0 -1
- package/dist/components/features/WorkspaceList/WorkspacesRow.d.ts +0 -8
- package/dist/components/features/WorkspaceList/WorkspacesRow.d.ts.map +0 -1
- package/dist/components/features/WorkspaceList/WorkspacesRow.js +0 -15
- package/dist/components/features/WorkspaceList/WorkspacesRow.js.map +0 -1
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.d.ts +0 -4
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.d.ts.map +0 -1
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.js +0 -11
- package/dist/components/features/WorkspaceList/responsiveColumnWidths.js.map +0 -1
- package/dist/components/features/WorkspaceList/responsiveWidth.d.ts +0 -4
- package/dist/components/features/WorkspaceList/responsiveWidth.d.ts.map +0 -1
- package/dist/components/features/WorkspaceList/responsiveWidth.js +0 -11
- package/dist/components/features/WorkspaceList/responsiveWidth.js.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.d.ts +0 -2
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.d.ts.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.js +0 -13
- package/dist/components/features/WorkspacesGrid/WorkspaceInfo.js.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspaceList.d.ts +0 -2
- package/dist/components/features/WorkspacesGrid/WorkspaceList.d.ts.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspaceList.js +0 -10
- package/dist/components/features/WorkspacesGrid/WorkspaceList.js.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.d.ts +0 -2
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.d.ts.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.js +0 -10
- package/dist/components/features/WorkspacesGrid/WorkspacesGrid.js.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.d.ts +0 -2
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.d.ts.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.js +0 -11
- package/dist/components/features/WorkspacesGrid/WorkspacesInfo.js.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.d.ts +0 -8
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.d.ts.map +0 -1
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.js +0 -18
- package/dist/components/features/WorkspacesGrid/WorkspacesRow.js.map +0 -1
- package/dist/components/layouts/Footer/Footer.d.ts +0 -2
- package/dist/components/layouts/Footer/Footer.d.ts.map +0 -1
- package/dist/components/layouts/Footer/Footer.js +0 -7
- package/dist/components/layouts/Footer/Footer.js.map +0 -1
- package/dist/components/layouts/Header/WorkspaceCommands copy.d.ts +0 -2
- package/dist/components/layouts/Header/WorkspaceCommands copy.d.ts.map +0 -1
- package/dist/components/layouts/Header/WorkspaceCommands copy.js +0 -6
- package/dist/components/layouts/Header/WorkspaceCommands copy.js.map +0 -1
- package/dist/contexts/NavigationContext.d.ts +0 -27
- package/dist/contexts/NavigationContext.d.ts.map +0 -1
- package/dist/contexts/NavigationContext.js +0 -33
- package/dist/contexts/NavigationContext.js.map +0 -1
- package/dist/contexts/ProjectNavigationContext.d.ts +0 -20
- package/dist/contexts/ProjectNavigationContext.d.ts.map +0 -1
- package/dist/contexts/ProjectNavigationContext.js +0 -35
- package/dist/contexts/ProjectNavigationContext.js.map +0 -1
- package/dist/contexts/ResponsizeContext.d.ts +0 -14
- package/dist/contexts/ResponsizeContext.d.ts.map +0 -1
- package/dist/contexts/ResponsizeContext.js +0 -34
- package/dist/contexts/ResponsizeContext.js.map +0 -1
- package/dist/contexts/WorkspaceNavigationContext.d.ts +0 -29
- package/dist/contexts/WorkspaceNavigationContext.d.ts.map +0 -1
- package/dist/contexts/WorkspaceNavigationContext.js +0 -41
- package/dist/contexts/WorkspaceNavigationContext.js.map +0 -1
- package/dist/contexts/WorkspacesNavigationContext.d.ts +0 -29
- package/dist/contexts/WorkspacesNavigationContext.d.ts.map +0 -1
- package/dist/contexts/WorkspacesNavigationContext.js +0 -37
- package/dist/contexts/WorkspacesNavigationContext.js.map +0 -1
- package/dist/hooks/useDisovery.d.ts +0 -7
- package/dist/hooks/useDisovery.d.ts.map +0 -1
- package/dist/hooks/useDisovery.js +0 -38
- package/dist/hooks/useDisovery.js.map +0 -1
- package/dist/hooks/useGridNavigation.d.ts +0 -19
- package/dist/hooks/useGridNavigation.d.ts.map +0 -1
- package/dist/hooks/useGridNavigation.js +0 -52
- package/dist/hooks/useGridNavigation.js.map +0 -1
- package/dist/hooks/useNavigation.d.ts +0 -10
- package/dist/hooks/useNavigation.d.ts.map +0 -1
- package/dist/hooks/useNavigation.js +0 -43
- package/dist/hooks/useNavigation.js.map +0 -1
- package/dist/hooks/useNavigationMatrix.d.ts +0 -6
- package/dist/hooks/useNavigationMatrix.d.ts.map +0 -1
- package/dist/hooks/useNavigationMatrix.js +0 -34
- package/dist/hooks/useNavigationMatrix.js.map +0 -1
- package/dist/hooks/useRuntime.d.ts +0 -1
- package/dist/hooks/useRuntime.d.ts.map +0 -1
- package/dist/hooks/useRuntime.js +0 -2
- package/dist/hooks/useRuntime.js.map +0 -1
- package/dist/hooks/useWorkspaceNavigation.d.ts +0 -10
- package/dist/hooks/useWorkspaceNavigation.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceNavigation.js +0 -31
- package/dist/hooks/useWorkspaceNavigation.js.map +0 -1
- package/dist/hooks/useWorkspaceQuickActionts.d.ts +0 -4
- package/dist/hooks/useWorkspaceQuickActionts.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceQuickActionts.js +0 -28
- package/dist/hooks/useWorkspaceQuickActionts.js.map +0 -1
- package/dist/hooks/useWorkspacesGrid copy.d.ts +0 -10
- package/dist/hooks/useWorkspacesGrid copy.d.ts.map +0 -1
- package/dist/hooks/useWorkspacesGrid copy.js +0 -31
- package/dist/hooks/useWorkspacesGrid copy.js.map +0 -1
- package/dist/hooks/useWorkspacesGrid.d.ts +0 -11
- package/dist/hooks/useWorkspacesGrid.d.ts.map +0 -1
- package/dist/hooks/useWorkspacesGrid.js +0 -31
- package/dist/hooks/useWorkspacesGrid.js.map +0 -1
- package/dist/hooks/useWorkspacesNavigation.d.ts +0 -10
- package/dist/hooks/useWorkspacesNavigation.d.ts.map +0 -1
- package/dist/hooks/useWorkspacesNavigation.js +0 -31
- package/dist/hooks/useWorkspacesNavigation.js.map +0 -1
- package/dist/services/discovery/facets/biome-parser.d.ts +0 -3
- package/dist/services/discovery/facets/biome-parser.d.ts.map +0 -1
- package/dist/services/discovery/facets/biome-parser.js +0 -73
- package/dist/services/discovery/facets/biome-parser.js.map +0 -1
- package/dist/services/discovery/facets/composeParser.d.ts +0 -1
- package/dist/services/discovery/facets/composeParser.d.ts.map +0 -1
- package/dist/services/discovery/facets/composeParser.js +0 -2
- package/dist/services/discovery/facets/composeParser.js.map +0 -1
- package/dist/services/discovery/facets/makefileParser.d.ts +0 -1
- package/dist/services/discovery/facets/makefileParser.d.ts.map +0 -1
- package/dist/services/discovery/facets/makefileParser.js +0 -2
- package/dist/services/discovery/facets/makefileParser.js.map +0 -1
- package/dist/services/discovery/facets/manifest-parser.d.ts +0 -7
- package/dist/services/discovery/facets/manifest-parser.d.ts.map +0 -1
- package/dist/services/discovery/facets/manifest-parser.js +0 -43
- package/dist/services/discovery/facets/manifest-parser.js.map +0 -1
- package/dist/services/discovery/facets/manifestParser.d.ts +0 -1
- package/dist/services/discovery/facets/manifestParser.d.ts.map +0 -1
- package/dist/services/discovery/facets/manifestParser.js +0 -2
- package/dist/services/discovery/facets/manifestParser.js.map +0 -1
- package/dist/services/discovery/workspaceDiscovery.d.ts +0 -3
- package/dist/services/discovery/workspaceDiscovery.d.ts.map +0 -1
- package/dist/services/discovery/workspaceDiscovery.js +0 -17
- package/dist/services/discovery/workspaceDiscovery.js.map +0 -1
- package/dist/services/runtime/resolve-runtime-conflicts.d.ts +0 -15
- package/dist/services/runtime/resolve-runtime-conflicts.d.ts.map +0 -1
- package/dist/services/runtime/resolve-runtime-conflicts.js +0 -36
- package/dist/services/runtime/resolve-runtime-conflicts.js.map +0 -1
- package/dist/types/navigation.d.ts +0 -10
- package/dist/types/navigation.d.ts.map +0 -1
- package/dist/types/navigation.js +0 -59
- package/dist/types/navigation.js.map +0 -1
- package/dist/types/projects-grid.d.ts +0 -32
- package/dist/types/projects-grid.d.ts.map +0 -1
- package/dist/types/projects-grid.js +0 -2
- package/dist/types/projects-grid.js.map +0 -1
- package/dist/types/quick-actions.d.ts +0 -7
- package/dist/types/quick-actions.d.ts.map +0 -1
- package/dist/types/quick-actions.js +0 -2
- package/dist/types/quick-actions.js.map +0 -1
- package/dist/types/runtime.d.ts +0 -16
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/runtime.js +0 -2
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/workpace-grid.d.ts +0 -32
- package/dist/types/workpace-grid.d.ts.map +0 -1
- package/dist/types/workpace-grid.js +0 -2
- package/dist/types/workpace-grid.js.map +0 -1
- package/dist/types/workspace-navigation.d.ts +0 -37
- package/dist/types/workspace-navigation.d.ts.map +0 -1
- package/dist/types/workspace-navigation.js +0 -7
- package/dist/types/workspace-navigation.js.map +0 -1
- package/dist/types/workspaces-grid copy.d.ts +0 -37
- package/dist/types/workspaces-grid copy.d.ts.map +0 -1
- package/dist/types/workspaces-grid copy.js +0 -7
- package/dist/types/workspaces-grid copy.js.map +0 -1
- package/dist/types/workspaces-grid.d.ts +0 -37
- package/dist/types/workspaces-grid.d.ts.map +0 -1
- package/dist/types/workspaces-grid.js +0 -7
- package/dist/types/workspaces-grid.js.map +0 -1
- package/dist/types/worspace-state.d.ts +0 -19
- package/dist/types/worspace-state.d.ts.map +0 -1
- package/dist/types/worspace-state.js +0 -2
- package/dist/types/worspace-state.js.map +0 -1
- package/dist/utils/framework-detector.d.ts +0 -7
- package/dist/utils/framework-detector.d.ts.map +0 -1
- package/dist/utils/framework-detector.js +0 -111
- package/dist/utils/framework-detector.js.map +0 -1
- package/dist/utils/fs/scanner.d.ts +0 -6
- package/dist/utils/fs/scanner.d.ts.map +0 -1
- package/dist/utils/fs/scanner.js +0 -32
- package/dist/utils/fs/scanner.js.map +0 -1
- package/dist/utils/getPackageVersion.d.ts +0 -2
- package/dist/utils/getPackageVersion.d.ts.map +0 -1
- package/dist/utils/getPackageVersion.js +0 -6
- package/dist/utils/getPackageVersion.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -14
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -99
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/navigation-helper.d.ts +0 -9
- package/dist/utils/navigation-helper.d.ts.map +0 -1
- package/dist/utils/navigation-helper.js +0 -53
- package/dist/utils/navigation-helper.js.map +0 -1
- package/dist/utils/package-json.d.ts +0 -2
- package/dist/utils/package-json.d.ts.map +0 -1
- package/dist/utils/package-json.js +0 -11
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/port.d.ts +0 -6
- package/dist/utils/port.d.ts.map +0 -1
- package/dist/utils/port.js +0 -24
- package/dist/utils/port.js.map +0 -1
- package/dist/utils/project/workspace-grid.d.ts +0 -17
- package/dist/utils/project/workspace-grid.d.ts.map +0 -1
- package/dist/utils/project/workspace-grid.js +0 -121
- package/dist/utils/project/workspace-grid.js.map +0 -1
- package/dist/utils/workpace/workspace-grid.d.ts +0 -17
- package/dist/utils/workpace/workspace-grid.d.ts.map +0 -1
- package/dist/utils/workpace/workspace-grid.js +0 -121
- package/dist/utils/workpace/workspace-grid.js.map +0 -1
- package/dist/utils/workpace/workspace-helper.d.ts +0 -7
- package/dist/utils/workpace/workspace-helper.d.ts.map +0 -1
- package/dist/utils/workpace/workspace-helper.js +0 -10
- package/dist/utils/workpace/workspace-helper.js.map +0 -1
- package/dist/utils/workpace/workspace-navigation.d.ts +0 -17
- package/dist/utils/workpace/workspace-navigation.d.ts.map +0 -1
- package/dist/utils/workpace/workspace-navigation.js +0 -123
- package/dist/utils/workpace/workspace-navigation.js.map +0 -1
- package/dist/utils/workpace/workspaces-grid copy.d.ts +0 -30
- package/dist/utils/workpace/workspaces-grid copy.d.ts.map +0 -1
- package/dist/utils/workpace/workspaces-grid copy.js +0 -97
- package/dist/utils/workpace/workspaces-grid copy.js.map +0 -1
- package/dist/utils/workpace/workspaces-grid.d.ts +0 -22
- package/dist/utils/workpace/workspaces-grid.d.ts.map +0 -1
- package/dist/utils/workpace/workspaces-grid.js +0 -123
- package/dist/utils/workpace/workspaces-grid.js.map +0 -1
- package/dist/utils/workpace/worspace-state.d.ts +0 -18
- package/dist/utils/workpace/worspace-state.d.ts.map +0 -1
- package/dist/utils/workpace/worspace-state.js +0 -2
- package/dist/utils/workpace/worspace-state.js.map +0 -1
- package/dist/utils/workspace/workspaces-grid.d.ts +0 -22
- package/dist/utils/workspace/workspaces-grid.d.ts.map +0 -1
- package/dist/utils/workspace/workspaces-grid.js +0 -123
- package/dist/utils/workspace/workspaces-grid.js.map +0 -1
- package/dist/utils/workspace-helper.d.ts +0 -10
- package/dist/utils/workspace-helper.d.ts.map +0 -1
- package/dist/utils/workspace-helper.js +0 -46
- package/dist/utils/workspace-helper.js.map +0 -1
- package/dist/utils/workspace-navigation.d.ts +0 -1
- package/dist/utils/workspace-navigation.d.ts.map +0 -1
- package/dist/utils/workspace-navigation.js +0 -2
- package/dist/utils/workspace-navigation.js.map +0 -1
- package/src/utils/navigation/grid-navigation.ts +0 -60
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function getQuickActionByPath(quickActions, path) {
|
|
2
|
-
return quickActions.find((action) => action.workspacePath === path);
|
|
3
|
-
}
|
|
4
|
-
export function getRuntimeByPath(runtimes, path) {
|
|
5
|
-
return runtimes.find((runtime) => runtime.workspacePath === path);
|
|
6
|
-
}
|
|
7
|
-
export function getRootWorkspace(workspaces) {
|
|
8
|
-
return workspaces.find((ws) => ws.type === "workspace");
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=workspace-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-helper.js","sourceRoot":"","sources":["../../../src/utils/workpace/workspace-helper.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,oBAAoB,CAClC,YAAoC,EACpC,IAAY;IAEZ,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,QAAiC,EACjC,IAAY;IAEZ,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,CAAA;AACnE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAqB;IACpD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;AACzD,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceCell, WorkspaceQuickActionCell, WorkspaceRuntimeCell, WorkspacesNavigationGrid } from "../../types/workspace-navigation";
|
|
2
|
-
import type { WorkspacesNavigationCell } from "../../types/workspace-navigation.js";
|
|
3
|
-
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js";
|
|
4
|
-
import type { WorkspaceRuntime } from "../../types/workspace-runtime.js";
|
|
5
|
-
import type { Workspace } from "../../types/workspace.js";
|
|
6
|
-
export declare function buildWorkspacesNavigationGrid(workspaces: Workspace[], quickActions: WorkspaceQuickAction[], runtimes: WorkspaceRuntime[]): WorkspacesNavigationGrid;
|
|
7
|
-
/**
|
|
8
|
-
* Returns the highest number of facets found in any item of the array.
|
|
9
|
-
* Accepts any array of objects with a 'facets' property (array or undefined).
|
|
10
|
-
*/
|
|
11
|
-
export declare function getMaxFacets(arr: {
|
|
12
|
-
facets?: unknown[];
|
|
13
|
-
}[]): number;
|
|
14
|
-
export declare function getWorkspaceCell(cells: (WorkspacesNavigationCell | null)[]): WorkspaceCell;
|
|
15
|
-
export declare function getWorkspaceQuickActionCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceQuickActionCell[];
|
|
16
|
-
export declare function getWorkspaceRuntimeCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceRuntimeCell[];
|
|
17
|
-
//# sourceMappingURL=workspace-navigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-navigation.d.ts","sourceRoot":"","sources":["../../../src/utils/workpace/workspace-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAIzD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,SAAS,EAAE,EACvB,YAAY,EAAE,oBAAoB,EAAE,EACpC,QAAQ,EAAE,gBAAgB,EAAE,GAC3B,wBAAwB,CAkD1B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,EAAE,GAAG,MAAM,CAKlE;AAGD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,aAAa,CAIf;AAGD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,wBAAwB,EAAE,CAO5B;AAGD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,oBAAoB,EAAE,CAOxB"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { logger } from "../../utils/logger.js";
|
|
2
|
-
import { getQuickActionByPath, getRuntimeByPath } from "./workspace-helper.js";
|
|
3
|
-
export function buildWorkspacesNavigationGrid(workspaces, quickActions, runtimes) {
|
|
4
|
-
const maxQuickActionFacets = getMaxFacets(quickActions);
|
|
5
|
-
const maxRuntimeFacets = getMaxFacets(runtimes);
|
|
6
|
-
const grid = [];
|
|
7
|
-
for (let rowIndex = 0; rowIndex < workspaces.length; rowIndex++) {
|
|
8
|
-
const ws = workspaces[rowIndex];
|
|
9
|
-
const row = [];
|
|
10
|
-
// Workspace cell (col 0)
|
|
11
|
-
row.push({ type: "workspace", workspace: ws, row: rowIndex, col: 0 });
|
|
12
|
-
// Quick actions
|
|
13
|
-
const quickAction = getQuickActionByPath(quickActions, ws.path);
|
|
14
|
-
const qaFacets = quickAction?.facets ?? [];
|
|
15
|
-
for (let i = 0; i < maxQuickActionFacets; i++) {
|
|
16
|
-
if (qaFacets[i]) {
|
|
17
|
-
row.push({
|
|
18
|
-
type: "quickAction",
|
|
19
|
-
action: qaFacets[i],
|
|
20
|
-
row: rowIndex,
|
|
21
|
-
col: i + 1,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
row.push(null);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Runtimes
|
|
29
|
-
const runtime = getRuntimeByPath(runtimes, ws.path);
|
|
30
|
-
const rtFacets = runtime?.facets ?? [];
|
|
31
|
-
for (let i = 0; i < maxRuntimeFacets; i++) {
|
|
32
|
-
if (rtFacets[i]) {
|
|
33
|
-
row.push({
|
|
34
|
-
type: "runtime",
|
|
35
|
-
runtime: rtFacets[i],
|
|
36
|
-
row: rowIndex,
|
|
37
|
-
col: i + maxQuickActionFacets + 1,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
row.push(null);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
grid.push(row);
|
|
45
|
-
}
|
|
46
|
-
logger.debug("Navigation GridXOXO");
|
|
47
|
-
logger.debug(JSON.stringify(grid, null, 2), "Navigation Gridxx");
|
|
48
|
-
return grid;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Returns the highest number of facets found in any item of the array.
|
|
52
|
-
* Accepts any array of objects with a 'facets' property (array or undefined).
|
|
53
|
-
*/
|
|
54
|
-
export function getMaxFacets(arr) {
|
|
55
|
-
return arr.reduce((max, item) => {
|
|
56
|
-
const count = Array.isArray(item.facets) ? item.facets.length : 0;
|
|
57
|
-
return count > max ? count : max;
|
|
58
|
-
}, 0);
|
|
59
|
-
}
|
|
60
|
-
// Returns the first WorkspaceCell found in a row
|
|
61
|
-
export function getWorkspaceCell(cells) {
|
|
62
|
-
return cells.find((cell) => cell && cell.type === "workspace");
|
|
63
|
-
}
|
|
64
|
-
// Returns all WorkspaceQuickActionCell in a row
|
|
65
|
-
export function getWorkspaceQuickActionCells(cells) {
|
|
66
|
-
const result = [];
|
|
67
|
-
for (const cell of cells) {
|
|
68
|
-
if (cell && cell.type === "quickAction")
|
|
69
|
-
result.push(cell);
|
|
70
|
-
}
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
// Returns all WorkspaceRuntimeCell in a row
|
|
74
|
-
export function getWorkspaceRuntimeCells(cells) {
|
|
75
|
-
const result = [];
|
|
76
|
-
for (const cell of cells) {
|
|
77
|
-
if (cell && cell.type === "runtime")
|
|
78
|
-
result.push(cell);
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
// Optional: Navigation helpers (also utils)
|
|
83
|
-
/*
|
|
84
|
-
export function navigateGrid(
|
|
85
|
-
grid: WorkspaceNavigationGrid,
|
|
86
|
-
position: NavigationPosition,
|
|
87
|
-
direction: 'up' | 'down' | 'left' | 'right'
|
|
88
|
-
): NavigationPosition {
|
|
89
|
-
const newPosition = { ...position }
|
|
90
|
-
|
|
91
|
-
switch (direction) {
|
|
92
|
-
case 'up':
|
|
93
|
-
newPosition.row = Math.max(0, position.row - 1)
|
|
94
|
-
break
|
|
95
|
-
|
|
96
|
-
case 'down':
|
|
97
|
-
newPosition.row = Math.min(grid.length - 1, position.row + 1)
|
|
98
|
-
break
|
|
99
|
-
|
|
100
|
-
case 'left':
|
|
101
|
-
newPosition.col = Math.max(0, position.col - 1)
|
|
102
|
-
break
|
|
103
|
-
|
|
104
|
-
case 'right':
|
|
105
|
-
const currentRow = grid[position.row]
|
|
106
|
-
if (currentRow) {
|
|
107
|
-
newPosition.col = Math.min(currentRow.length - 1, position.col + 1)
|
|
108
|
-
}
|
|
109
|
-
break
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return newPosition
|
|
113
|
-
}
|
|
114
|
-
*/
|
|
115
|
-
/*
|
|
116
|
-
export function getCellAt(
|
|
117
|
-
grid: WorkspaceNavigationGrid,
|
|
118
|
-
position: NavigationPosition
|
|
119
|
-
): WorkspaceNavigationCell | null {
|
|
120
|
-
return grid[position.row]?.[position.col] ?? null
|
|
121
|
-
}
|
|
122
|
-
*/
|
|
123
|
-
//# sourceMappingURL=workspace-navigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-navigation.js","sourceRoot":"","sources":["../../../src/utils/workpace/workspace-navigation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,u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E,CAAC,CAAC,CAAA;AACP,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,gBAAgB,CAC9B,KAA0C;IAE1C,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,CAC3B,CAAA;AACpB,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,4BAA4B,CAC1C,KAA0C;IAE1C,MAAM,MAAM,GAA+B,EAAE,CAAA;IAC7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;YACrC,MAAM,CAAC,IAAI,CAAC,IAAgC,CAAC,CAAA;IACjD,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,wBAAwB,CACtC,KAA0C;IAE1C,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YACjC,MAAM,CAAC,IAAI,CAAC,IAA4B,CAAC,CAAA;IAC7C,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,4CAA4C;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;AACF;;;;;;;IAOI"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js";
|
|
2
|
-
import type { WorkspaceRuntime } from "../../types/workspace-runtime.js";
|
|
3
|
-
import type { Workspace } from "../../types/workspace.js";
|
|
4
|
-
import type { WorkspaceCell, WorkspaceQuickActionCell, WorkspaceRuntimeCell, WorkspacesNavigationGrid } from "../../types/workspaces-grid";
|
|
5
|
-
import type { WorkspacesNavigationCell } from "../../types/workspaces-grid.js";
|
|
6
|
-
export declare function buildWorkspacesNavigationGrid(workspaces: Workspace[], quickActions: WorkspaceQuickAction[], runtimes: WorkspaceRuntime[]): WorkspacesNavigationGrid;
|
|
7
|
-
/**
|
|
8
|
-
* Returns the highest number of facets found in any item of the array.
|
|
9
|
-
* Accepts any array of objects with a 'facets' property (array or undefined).
|
|
10
|
-
*/
|
|
11
|
-
export declare function getMaxFacets(arr: {
|
|
12
|
-
facets?: unknown[];
|
|
13
|
-
}[]): number;
|
|
14
|
-
/**
|
|
15
|
-
* Returns the first WorkspaceCell found in a row
|
|
16
|
-
*/
|
|
17
|
-
export declare function getWorkspaceCell(cells: (WorkspacesNavigationCell | null)[]): WorkspaceCell;
|
|
18
|
-
/**
|
|
19
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
20
|
-
*/
|
|
21
|
-
export declare function getWorkspaceQuickActionCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceQuickActionCell[];
|
|
22
|
-
/**
|
|
23
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
24
|
-
*/
|
|
25
|
-
export declare function getWorkspaceRuntimeCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceRuntimeCell[];
|
|
26
|
-
/**
|
|
27
|
-
* Returns the WorkspaceCell at the given cursor position (row, col) from the grid.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getWorkspaceCellByPosition(grid: WorkspacesNavigationGrid, row: number, col: number): WorkspaceCell | null;
|
|
30
|
-
//# sourceMappingURL=workspaces-grid%20copy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces-grid copy.d.ts","sourceRoot":"","sources":["../../../src/utils/workpace/workspaces-grid copy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AAI9E,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,SAAS,EAAE,EACvB,YAAY,EAAE,oBAAoB,EAAE,EACpC,QAAQ,EAAE,gBAAgB,EAAE,GAC3B,wBAAwB,CAkD1B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,EAAE,GAAG,MAAM,CAKlE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,aAAa,CAIf;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,wBAAwB,EAAE,CAO5B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,oBAAoB,EAAE,CAOxB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,wBAAwB,EAC9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,aAAa,GAAG,IAAI,CAItB"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { logger } from "../../utils/logger.js";
|
|
2
|
-
import { getQuickActionByPath, getRuntimeByPath } from "./workspace-helper.js";
|
|
3
|
-
export function buildWorkspacesNavigationGrid(workspaces, quickActions, runtimes) {
|
|
4
|
-
const maxQuickActionFacets = getMaxFacets(quickActions);
|
|
5
|
-
const maxRuntimeFacets = getMaxFacets(runtimes);
|
|
6
|
-
const grid = [];
|
|
7
|
-
for (let rowIndex = 0; rowIndex < workspaces.length; rowIndex++) {
|
|
8
|
-
const ws = workspaces[rowIndex];
|
|
9
|
-
const row = [];
|
|
10
|
-
// Workspace cell (col 0)
|
|
11
|
-
row.push({ type: "workspace", workspace: ws, row: rowIndex, col: 0 });
|
|
12
|
-
// Quick actions
|
|
13
|
-
const quickAction = getQuickActionByPath(quickActions, ws.path);
|
|
14
|
-
const qaFacets = quickAction?.facets ?? [];
|
|
15
|
-
for (let i = 0; i < maxQuickActionFacets; i++) {
|
|
16
|
-
if (qaFacets[i]) {
|
|
17
|
-
row.push({
|
|
18
|
-
type: "quickAction",
|
|
19
|
-
action: qaFacets[i],
|
|
20
|
-
row: rowIndex,
|
|
21
|
-
col: i + 1,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
row.push(null);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Runtimes
|
|
29
|
-
const runtime = getRuntimeByPath(runtimes, ws.path);
|
|
30
|
-
const rtFacets = runtime?.facets ?? [];
|
|
31
|
-
for (let i = 0; i < maxRuntimeFacets; i++) {
|
|
32
|
-
if (rtFacets[i]) {
|
|
33
|
-
row.push({
|
|
34
|
-
type: "runtime",
|
|
35
|
-
runtime: rtFacets[i],
|
|
36
|
-
row: rowIndex,
|
|
37
|
-
col: i + maxQuickActionFacets + 1,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
row.push(null);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
grid.push(row);
|
|
45
|
-
}
|
|
46
|
-
logger.debug("Navigation GridXOXO");
|
|
47
|
-
logger.debug(JSON.stringify(grid, null, 2), "Navigation Gridxx");
|
|
48
|
-
return grid;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Returns the highest number of facets found in any item of the array.
|
|
52
|
-
* Accepts any array of objects with a 'facets' property (array or undefined).
|
|
53
|
-
*/
|
|
54
|
-
export function getMaxFacets(arr) {
|
|
55
|
-
return arr.reduce((max, item) => {
|
|
56
|
-
const count = Array.isArray(item.facets) ? item.facets.length : 0;
|
|
57
|
-
return count > max ? count : max;
|
|
58
|
-
}, 0);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Returns the first WorkspaceCell found in a row
|
|
62
|
-
*/
|
|
63
|
-
export function getWorkspaceCell(cells) {
|
|
64
|
-
return cells.find((cell) => cell && cell.type === "workspace");
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
68
|
-
*/
|
|
69
|
-
export function getWorkspaceQuickActionCells(cells) {
|
|
70
|
-
const result = [];
|
|
71
|
-
for (const cell of cells) {
|
|
72
|
-
if (cell && cell.type === "quickAction")
|
|
73
|
-
result.push(cell);
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
79
|
-
*/
|
|
80
|
-
export function getWorkspaceRuntimeCells(cells) {
|
|
81
|
-
const result = [];
|
|
82
|
-
for (const cell of cells) {
|
|
83
|
-
if (cell && cell.type === "runtime")
|
|
84
|
-
result.push(cell);
|
|
85
|
-
}
|
|
86
|
-
return result;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Returns the WorkspaceCell at the given cursor position (row, col) from the grid.
|
|
90
|
-
*/
|
|
91
|
-
export function getWorkspaceCellByPosition(grid, row, col) {
|
|
92
|
-
if (!grid[row] || !grid[row][col])
|
|
93
|
-
return null;
|
|
94
|
-
const cell = grid[row][col];
|
|
95
|
-
return cell && cell.type === "workspace" ? cell : null;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=workspaces-grid%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces-grid copy.js","sourceRoot":"","sources":["../../../src/utils/workpace/workspaces-grid copy.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,oBAA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Cell, WorkspaceQuickActionCell, WorkspaceRuntimeCell, WorkspacesNavigationCell, WorkspacesNavigationGrid } from "../../types/workspace-grid";
|
|
3
|
-
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js";
|
|
4
|
-
import type { WorkspaceRuntimeState } from "../../types/workspace-runtime.js";
|
|
5
|
-
export declare function buildWorkspacesNavigationGrid(workspaces: Project[], quickActions: WorkspaceQuickAction[], runtimes: WorkspaceRuntimeState[]): WorkspacesNavigationGrid;
|
|
6
|
-
/**
|
|
7
|
-
* Returns the first WorkspaceCell found in a row
|
|
8
|
-
*/
|
|
9
|
-
export declare function getWorkspaceCell(cells: (WorkspacesNavigationCell | null)[]): WorkspaceCell;
|
|
10
|
-
/**
|
|
11
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
12
|
-
*/
|
|
13
|
-
export declare function getWorkspaceQuickActionCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceQuickActionCell[];
|
|
14
|
-
/**
|
|
15
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
16
|
-
*/
|
|
17
|
-
export declare function getWorkspaceRuntimeCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceRuntimeCell[];
|
|
18
|
-
/**
|
|
19
|
-
* Returns the WorkspacesNavigationCell (any type) at the given row and col from the grid.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getWorkspacesNavigationCellByPosition(grid: WorkspacesNavigationGrid, row: number, col: number): WorkspacesNavigationCell | null;
|
|
22
|
-
//# sourceMappingURL=workspaces-grid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces-grid.d.ts","sourceRoot":"","sources":["../../../src/utils/workpace/workspaces-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAI7E,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,OAAO,EAAE,EACrB,YAAY,EAAE,oBAAoB,EAAE,EACpC,QAAQ,EAAE,qBAAqB,EAAE,GAChC,wBAAwB,CAuD1B;AAsBD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,aAAa,CAIf;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,wBAAwB,EAAE,CAO5B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,oBAAoB,EAAE,CAOxB;AAgBD;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,wBAAwB,EAC9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,wBAAwB,GAAG,IAAI,CAKjC"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { logger } from "../../utils/logger.js";
|
|
2
|
-
import { getQuickActionByPath, getRuntimeByPath } from "./workspace-helper.js";
|
|
3
|
-
export function buildWorkspacesNavigationGrid(workspaces, quickActions, runtimes) {
|
|
4
|
-
const maxQuickActionFacets = getMaxQuickActionRowItems(quickActions);
|
|
5
|
-
const maxRuntimeFacets = getMaxRuntimeRowItems(runtimes);
|
|
6
|
-
const grid = [];
|
|
7
|
-
for (let rowIndex = 0; rowIndex < workspaces.length; rowIndex++) {
|
|
8
|
-
const ws = workspaces[rowIndex];
|
|
9
|
-
const cells = [];
|
|
10
|
-
// Workspace cell (col 0)
|
|
11
|
-
cells.push({ type: "workspace", workspace: ws, row: rowIndex, col: 0 });
|
|
12
|
-
// Quick actions
|
|
13
|
-
const quickAction = getQuickActionByPath(quickActions, ws.path);
|
|
14
|
-
const qaFacets = quickAction?.facets ?? [];
|
|
15
|
-
for (let i = 0; i < maxQuickActionFacets; i++) {
|
|
16
|
-
if (qaFacets[i]) {
|
|
17
|
-
cells.push({
|
|
18
|
-
type: "quickAction",
|
|
19
|
-
action: qaFacets[i],
|
|
20
|
-
row: rowIndex,
|
|
21
|
-
col: i + 1,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
cells.push(null);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Runtimes
|
|
29
|
-
const runtime = getRuntimeByPath(runtimes, ws.path);
|
|
30
|
-
const rtFacets = runtime?.runStates?.filter((rs) => rs.status !== "stopped") ?? [];
|
|
31
|
-
for (let i = 0; i < maxRuntimeFacets; i++) {
|
|
32
|
-
if (rtFacets[i]) {
|
|
33
|
-
cells.push({
|
|
34
|
-
type: "runtime",
|
|
35
|
-
runState: rtFacets[i],
|
|
36
|
-
row: rowIndex,
|
|
37
|
-
col: i + maxQuickActionFacets + 1,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
cells.push(null);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const navRow = {
|
|
45
|
-
id: ws.path,
|
|
46
|
-
cells,
|
|
47
|
-
};
|
|
48
|
-
grid.push(navRow);
|
|
49
|
-
}
|
|
50
|
-
logger.debug("Workspaces Navigation Grid");
|
|
51
|
-
logger.debug(JSON.stringify(grid, null, 2));
|
|
52
|
-
return grid;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the highest number of items found in the array.
|
|
56
|
-
*/
|
|
57
|
-
function getMaxQuickActionRowItems(arr) {
|
|
58
|
-
return arr.reduce((max, item) => {
|
|
59
|
-
const count = Array.isArray(item.facets) ? item.facets.length : 0;
|
|
60
|
-
return count > max ? count : max;
|
|
61
|
-
}, 0);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Returns the highest number of items found in the array.
|
|
65
|
-
*/
|
|
66
|
-
function getMaxRuntimeRowItems(arr) {
|
|
67
|
-
return arr.reduce((max, item) => {
|
|
68
|
-
const count = Array.isArray(item.runStates) ? item.runStates.length : 0;
|
|
69
|
-
return count > max ? count : max;
|
|
70
|
-
}, 0);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns the first WorkspaceCell found in a row
|
|
74
|
-
*/
|
|
75
|
-
export function getWorkspaceCell(cells) {
|
|
76
|
-
return cells.find((cell) => cell && cell.type === "workspace");
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
80
|
-
*/
|
|
81
|
-
export function getWorkspaceQuickActionCells(cells) {
|
|
82
|
-
const result = [];
|
|
83
|
-
for (const cell of cells) {
|
|
84
|
-
if (cell && cell.type === "quickAction")
|
|
85
|
-
result.push(cell);
|
|
86
|
-
}
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
91
|
-
*/
|
|
92
|
-
export function getWorkspaceRuntimeCells(cells) {
|
|
93
|
-
const result = [];
|
|
94
|
-
for (const cell of cells) {
|
|
95
|
-
if (cell && cell.type === "runtime")
|
|
96
|
-
result.push(cell);
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
100
|
-
// /**
|
|
101
|
-
// * Returns the WorkspaceCell at the given cursor position (row, col) from the grid.
|
|
102
|
-
// */
|
|
103
|
-
// export function getWorkspaceCellByPosition(
|
|
104
|
-
// grid: WorkspacesNavigationGrid,
|
|
105
|
-
// row: number,
|
|
106
|
-
// col: number,
|
|
107
|
-
// ): WorkspaceCell | null {
|
|
108
|
-
// const navRow = grid[row]
|
|
109
|
-
// if (!navRow || !navRow.cells[col]) return null
|
|
110
|
-
// const cell = navRow.cells[col]
|
|
111
|
-
// return cell && cell.type === "workspace" ? (cell as WorkspaceCell) : null
|
|
112
|
-
// }
|
|
113
|
-
/**
|
|
114
|
-
* Returns the WorkspacesNavigationCell (any type) at the given row and col from the grid.
|
|
115
|
-
*/
|
|
116
|
-
export function getWorkspacesNavigationCellByPosition(grid, row, col) {
|
|
117
|
-
const navRow = grid[row];
|
|
118
|
-
if (!navRow || !navRow.cells[col])
|
|
119
|
-
return null;
|
|
120
|
-
const cell = navRow.cells[col];
|
|
121
|
-
return cell ? cell : null;
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=workspaces-grid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces-grid.js","sourceRoot":"","sources":["../../../src/utils/workpace/workspaces-grid.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE9E,MAAM,UAAU,6BAA6B,CAC3C,UAAqB,EACrB,YAAoC,EACpC,QAAiC;IAEjC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAA;IACpE,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAA;IAExD,MAAM,IAAI,GAA6B,EAAE,CAAA;IACzC,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;QAChE,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;QAC/B,MAAM,KAAK,GAAwC,EAAE,CAAA;QAErD,yBAAyB;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QAEvE,gBAAgB;QAChB,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 -1,18 +0,0 @@
|
|
|
1
|
-
export type RuntimeStatus = "starting" | "running" | "stopping" | "stopped" | "failed";
|
|
2
|
-
/**
|
|
3
|
-
* Aggregated running state for an entire workspace
|
|
4
|
-
*/
|
|
5
|
-
export interface WorkspaceRuntimeState {
|
|
6
|
-
path: string;
|
|
7
|
-
runStates: RunState[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Running state for a single run (script, command, or service)
|
|
11
|
-
*/
|
|
12
|
-
export interface RunState {
|
|
13
|
-
id: string;
|
|
14
|
-
status: RuntimeStatus;
|
|
15
|
-
command: string;
|
|
16
|
-
port?: number;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=worspace-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worspace-state.d.ts","sourceRoot":"","sources":["../../../src/utils/workpace/worspace-state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,CAAA;AAEZ;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worspace-state.js","sourceRoot":"","sources":["../../../src/utils/workpace/worspace-state.ts"],"names":[],"mappings":""}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Project } from "../../types/project.js";
|
|
2
|
-
import type { WorkspaceCell, WorkspaceQuickActionCell, WorkspaceRuntimeCell, WorkspacesNavigationCell, WorkspacesNavigationGrid } from "../../types/workspace-grid";
|
|
3
|
-
import type { WorkspaceQuickAction } from "../../types/workspace-quick-actions.js";
|
|
4
|
-
import type { WorkspaceRuntimeState } from "../../types/workspace-runtime.js";
|
|
5
|
-
export declare function buildWorkspacesNavigationGrid(workspaces: Project[], quickActions: WorkspaceQuickAction[], runtimes: WorkspaceRuntimeState[]): WorkspacesNavigationGrid;
|
|
6
|
-
/**
|
|
7
|
-
* Returns the first WorkspaceCell found in a row
|
|
8
|
-
*/
|
|
9
|
-
export declare function getWorkspaceCell(cells: (WorkspacesNavigationCell | null)[]): WorkspaceCell;
|
|
10
|
-
/**
|
|
11
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
12
|
-
*/
|
|
13
|
-
export declare function getWorkspaceQuickActionCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceQuickActionCell[];
|
|
14
|
-
/**
|
|
15
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
16
|
-
*/
|
|
17
|
-
export declare function getWorkspaceRuntimeCells(cells: (WorkspacesNavigationCell | null)[]): WorkspaceRuntimeCell[];
|
|
18
|
-
/**
|
|
19
|
-
* Returns the WorkspacesNavigationCell (any type) at the given row and col from the grid.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getWorkspacesNavigationCellByPosition(grid: WorkspacesNavigationGrid, row: number, col: number): WorkspacesNavigationCell | null;
|
|
22
|
-
//# sourceMappingURL=workspaces-grid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces-grid.d.ts","sourceRoot":"","sources":["../../../src/utils/workspace/workspaces-grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAI7E,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,OAAO,EAAE,EACrB,YAAY,EAAE,oBAAoB,EAAE,EACpC,QAAQ,EAAE,qBAAqB,EAAE,GAChC,wBAAwB,CAuD1B;AAsBD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,aAAa,CAIf;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,wBAAwB,EAAE,CAO5B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,CAAC,wBAAwB,GAAG,IAAI,CAAC,EAAE,GACzC,oBAAoB,EAAE,CAOxB;AAgBD;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,wBAAwB,EAC9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,wBAAwB,GAAG,IAAI,CAKjC"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { logger } from "../../utils/logger.js";
|
|
2
|
-
import { getQuickActionByPath, getRuntimeByPath } from "./workspace-helper.js";
|
|
3
|
-
export function buildWorkspacesNavigationGrid(workspaces, quickActions, runtimes) {
|
|
4
|
-
const maxQuickActionFacets = getMaxQuickActionRowItems(quickActions);
|
|
5
|
-
const maxRuntimeFacets = getMaxRuntimeRowItems(runtimes);
|
|
6
|
-
const grid = [];
|
|
7
|
-
for (let rowIndex = 0; rowIndex < workspaces.length; rowIndex++) {
|
|
8
|
-
const ws = workspaces[rowIndex];
|
|
9
|
-
const cells = [];
|
|
10
|
-
// Workspace cell (col 0)
|
|
11
|
-
cells.push({ type: "workspace", workspace: ws, row: rowIndex, col: 0 });
|
|
12
|
-
// Quick actions
|
|
13
|
-
const quickAction = getQuickActionByPath(quickActions, ws.path);
|
|
14
|
-
const qaFacets = quickAction?.facets ?? [];
|
|
15
|
-
for (let i = 0; i < maxQuickActionFacets; i++) {
|
|
16
|
-
if (qaFacets[i]) {
|
|
17
|
-
cells.push({
|
|
18
|
-
type: "quickAction",
|
|
19
|
-
action: qaFacets[i],
|
|
20
|
-
row: rowIndex,
|
|
21
|
-
col: i + 1,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
cells.push(null);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Runtimes
|
|
29
|
-
const runtime = getRuntimeByPath(runtimes, ws.path);
|
|
30
|
-
const rtFacets = runtime?.runStates?.filter((rs) => rs.status !== "stopped") ?? [];
|
|
31
|
-
for (let i = 0; i < maxRuntimeFacets; i++) {
|
|
32
|
-
if (rtFacets[i]) {
|
|
33
|
-
cells.push({
|
|
34
|
-
type: "runtime",
|
|
35
|
-
runState: rtFacets[i],
|
|
36
|
-
row: rowIndex,
|
|
37
|
-
col: i + maxQuickActionFacets + 1,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
cells.push(null);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const navRow = {
|
|
45
|
-
id: ws.path,
|
|
46
|
-
cells,
|
|
47
|
-
};
|
|
48
|
-
grid.push(navRow);
|
|
49
|
-
}
|
|
50
|
-
logger.debug("Workspaces Navigation Grid");
|
|
51
|
-
logger.debug(JSON.stringify(grid, null, 2));
|
|
52
|
-
return grid;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the highest number of items found in the array.
|
|
56
|
-
*/
|
|
57
|
-
function getMaxQuickActionRowItems(arr) {
|
|
58
|
-
return arr.reduce((max, item) => {
|
|
59
|
-
const count = Array.isArray(item.facets) ? item.facets.length : 0;
|
|
60
|
-
return count > max ? count : max;
|
|
61
|
-
}, 0);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Returns the highest number of items found in the array.
|
|
65
|
-
*/
|
|
66
|
-
function getMaxRuntimeRowItems(arr) {
|
|
67
|
-
return arr.reduce((max, item) => {
|
|
68
|
-
const count = Array.isArray(item.runStates) ? item.runStates.length : 0;
|
|
69
|
-
return count > max ? count : max;
|
|
70
|
-
}, 0);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Returns the first WorkspaceCell found in a row
|
|
74
|
-
*/
|
|
75
|
-
export function getWorkspaceCell(cells) {
|
|
76
|
-
return cells.find((cell) => cell && cell.type === "workspace");
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Returns all WorkspaceQuickActionCell in a row
|
|
80
|
-
*/
|
|
81
|
-
export function getWorkspaceQuickActionCells(cells) {
|
|
82
|
-
const result = [];
|
|
83
|
-
for (const cell of cells) {
|
|
84
|
-
if (cell && cell.type === "quickAction")
|
|
85
|
-
result.push(cell);
|
|
86
|
-
}
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Returns all WorkspaceRuntimeCell in a row
|
|
91
|
-
*/
|
|
92
|
-
export function getWorkspaceRuntimeCells(cells) {
|
|
93
|
-
const result = [];
|
|
94
|
-
for (const cell of cells) {
|
|
95
|
-
if (cell && cell.type === "runtime")
|
|
96
|
-
result.push(cell);
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
100
|
-
// /**
|
|
101
|
-
// * Returns the WorkspaceCell at the given cursor position (row, col) from the grid.
|
|
102
|
-
// */
|
|
103
|
-
// export function getWorkspaceCellByPosition(
|
|
104
|
-
// grid: WorkspacesNavigationGrid,
|
|
105
|
-
// row: number,
|
|
106
|
-
// col: number,
|
|
107
|
-
// ): WorkspaceCell | null {
|
|
108
|
-
// const navRow = grid[row]
|
|
109
|
-
// if (!navRow || !navRow.cells[col]) return null
|
|
110
|
-
// const cell = navRow.cells[col]
|
|
111
|
-
// return cell && cell.type === "workspace" ? (cell as WorkspaceCell) : null
|
|
112
|
-
// }
|
|
113
|
-
/**
|
|
114
|
-
* Returns the WorkspacesNavigationCell (any type) at the given row and col from the grid.
|
|
115
|
-
*/
|
|
116
|
-
export function getWorkspacesNavigationCellByPosition(grid, row, col) {
|
|
117
|
-
const navRow = grid[row];
|
|
118
|
-
if (!navRow || !navRow.cells[col])
|
|
119
|
-
return null;
|
|
120
|
-
const cell = navRow.cells[col];
|
|
121
|
-
return cell ? cell : null;
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=workspaces-grid.js.map
|