@akiojin/gwt 4.3.1 → 4.4.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.
Files changed (46) hide show
  1. package/dist/cli/ui/components/App.d.ts.map +1 -1
  2. package/dist/cli/ui/components/App.js +12 -61
  3. package/dist/cli/ui/components/App.js.map +1 -1
  4. package/dist/cli/ui/components/common/SpinnerIcon.d.ts +20 -0
  5. package/dist/cli/ui/components/common/SpinnerIcon.d.ts.map +1 -0
  6. package/dist/cli/ui/components/common/SpinnerIcon.js +61 -0
  7. package/dist/cli/ui/components/common/SpinnerIcon.js.map +1 -0
  8. package/dist/cli/ui/components/parts/Stats.d.ts +2 -5
  9. package/dist/cli/ui/components/parts/Stats.d.ts.map +1 -1
  10. package/dist/cli/ui/components/parts/Stats.js +16 -3
  11. package/dist/cli/ui/components/parts/Stats.js.map +1 -1
  12. package/dist/cli/ui/components/screens/BranchListScreen.d.ts +6 -2
  13. package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
  14. package/dist/cli/ui/components/screens/BranchListScreen.js +95 -42
  15. package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
  16. package/dist/cli/ui/hooks/useAppInput.d.ts +1 -0
  17. package/dist/cli/ui/hooks/useAppInput.d.ts.map +1 -1
  18. package/dist/cli/ui/hooks/useAppInput.js +2 -1
  19. package/dist/cli/ui/hooks/useAppInput.js.map +1 -1
  20. package/dist/cli/ui/hooks/useGitData.d.ts +1 -0
  21. package/dist/cli/ui/hooks/useGitData.d.ts.map +1 -1
  22. package/dist/cli/ui/hooks/useGitData.js +43 -15
  23. package/dist/cli/ui/hooks/useGitData.js.map +1 -1
  24. package/dist/cli/ui/types.d.ts +4 -0
  25. package/dist/cli/ui/types.d.ts.map +1 -1
  26. package/dist/git.d.ts +2 -0
  27. package/dist/git.d.ts.map +1 -1
  28. package/dist/git.js +38 -14
  29. package/dist/git.js.map +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +14 -1
  33. package/dist/index.js.map +1 -1
  34. package/package.json +4 -4
  35. package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +208 -0
  36. package/src/cli/ui/__tests__/hooks/useGitData.nonblocking.test.tsx +158 -0
  37. package/src/cli/ui/components/App.tsx +22 -77
  38. package/src/cli/ui/components/common/SpinnerIcon.tsx +86 -0
  39. package/src/cli/ui/components/parts/Stats.tsx +24 -3
  40. package/src/cli/ui/components/screens/BranchListScreen.tsx +117 -45
  41. package/src/cli/ui/hooks/useAppInput.ts +2 -1
  42. package/src/cli/ui/hooks/useGitData.ts +101 -18
  43. package/src/cli/ui/screens/__tests__/BranchActionSelectorScreen.test.tsx +46 -1
  44. package/src/cli/ui/types.ts +5 -0
  45. package/src/git.ts +48 -17
  46. package/src/index.ts +14 -1
package/src/index.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
3
5
  import {
4
6
  isGitRepository,
5
7
  getRepositoryRoot,
@@ -914,8 +916,19 @@ export async function main(): Promise<void> {
914
916
  await runInteractiveLoop();
915
917
  }
916
918
 
919
+ export function isEntryPoint(metaUrl: string, argv1?: string): boolean {
920
+ if (!argv1) {
921
+ return false;
922
+ }
923
+ try {
924
+ return fileURLToPath(metaUrl) === path.resolve(argv1);
925
+ } catch {
926
+ return false;
927
+ }
928
+ }
929
+
917
930
  // Run the application if this module is executed directly
918
- if (import.meta.url === `file://${process.argv[1]}`) {
931
+ if (isEntryPoint(import.meta.url, process.argv[1])) {
919
932
  main().catch(async (error) => {
920
933
  console.error("Fatal error:", error);
921
934
  await waitForErrorAcknowledgement();