Skip to content

Commit a32ae5c

Browse files
committed
more changes and fixes, kill taskdetail
1 parent 3aafda6 commit a32ae5c

File tree

21 files changed

+758
-624
lines changed

21 files changed

+758
-624
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,64 @@ array-monorepo/
6565
├── pnpm-workspace.yaml # Workspace configuration
6666
└── package.json # Root package.json
6767
```
68+
69+
## Workspace Configuration (array.json)
70+
71+
Array supports per-repository configuration through an `array.json` file. This lets you define scripts that run automatically when workspaces are created or destroyed.
72+
73+
### File Locations
74+
75+
Array searches for configuration in this order:
76+
77+
1. `.array/{workspace-name}/array.json` - Workspace-specific config
78+
2. `array.json` - Repository root config
79+
80+
### Schema
81+
82+
```json
83+
{
84+
"scripts": {
85+
"init": "npm install",
86+
"start": ["npm run server", "npm run client"],
87+
"destroy": "docker-compose down"
88+
}
89+
}
90+
```
91+
92+
| Script | When it runs | Behavior |
93+
|--------|--------------|----------|
94+
| `init` | Workspace creation | Runs first, fails fast (stops on error) |
95+
| `start` | After init completes | Continues even if scripts fail |
96+
| `destroy` | Workspace deletion | Runs silently before cleanup |
97+
98+
Each script can be a single command string or an array of commands. Commands run sequentially in dedicated terminal sessions.
99+
100+
### Examples
101+
102+
Install dependencies on workspace creation:
103+
```json
104+
{
105+
"scripts": {
106+
"init": "pnpm install"
107+
}
108+
}
109+
```
110+
111+
Start development servers:
112+
```json
113+
{
114+
"scripts": {
115+
"init": ["pnpm install", "pnpm run build"],
116+
"start": ["pnpm run dev", "pnpm run storybook"]
117+
}
118+
}
119+
```
120+
121+
Clean up Docker containers:
122+
```json
123+
{
124+
"scripts": {
125+
"destroy": "docker-compose down -v"
126+
}
127+
}
128+
```

apps/array/src/main/services/contextMenu.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,31 @@ export const showFolderContextMenuService = createIpcService({
163163
handler: async (
164164
_event,
165165
_folderId: string,
166-
_folderName: string,
166+
folderName: string,
167167
folderPath?: string,
168168
): Promise<FolderContextMenuResult> => {
169169
return new Promise((resolve) => {
170170
const template: MenuItemConstructorOptions[] = [
171171
{
172172
label: "Remove folder",
173-
click: () => resolve({ action: "remove" }),
173+
click: async () => {
174+
const result = await dialog.showMessageBox({
175+
type: "question",
176+
title: "Remove Folder",
177+
message: `Remove "${folderName}" from Array?`,
178+
detail:
179+
"This will clean up any worktrees but keep your folder and tasks intact.",
180+
buttons: ["Cancel", "Remove"],
181+
defaultId: 1,
182+
cancelId: 0,
183+
});
184+
185+
if (result.response === 1) {
186+
resolve({ action: "remove" });
187+
} else {
188+
resolve({ action: null });
189+
}
190+
},
174191
},
175192
];
176193

0 commit comments

Comments
 (0)