Skip to content

Commit f1c8ae4

Browse files
committed
feat: make the right sidebar edit the tasks
Signed-off-by: Simon Emms <simon@simonemms.com>
1 parent ca9b670 commit f1c8ae4

37 files changed

Lines changed: 6989 additions & 150 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ static/fonts
3333

3434
/workflows
3535
!/workflows/demo-workflow.yaml
36+
.claude/

CLAUDE.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,26 @@ Key expectations:
417417

418418
Claude should not introduce formatting changes that contradict Prettier output.
419419

420-
**IMPORTANT: Before completing any work, always run `npm run format` and
421-
`npm run lint` to ensure all files are properly formatted. This is mandatory.**
420+
**IMPORTANT: Before completing any work, always run the following commands in
421+
order and ensure they all pass. This is mandatory.**
422+
423+
```sh
424+
npm run format # auto-formats all files
425+
npm run lint # Prettier check + ESLint + markdownlint
426+
npm run check # svelte-check TypeScript type checking
427+
npm run dev # verify the app starts without errors
428+
pre-commit run --all-files # full pre-commit suite (license, YAML, markdown, ESLint, format)
429+
```
422430

423431
The `npm run lint` command includes:
424432

425433
- Prettier code formatting check
426434
- ESLint for JavaScript/TypeScript code
427435
- Markdown linting (markdownlint-cli2) for all .md files
428436

429-
**IMPORTANT: After fixing format and lint issues, run `npm run dev` to verify
430-
the application starts without errors. Fix any runtime errors before considering
431-
the work complete. This is mandatory.**
437+
The `npm run check` command runs `svelte-kit sync && svelte-check` and must
438+
report 0 errors before work is considered complete. Fix type errors in source
439+
and test files; do not suppress them.
432440

433441
---
434442

@@ -439,8 +447,9 @@ the work complete. This is mandatory.**
439447
- `no-undef` is intentionally disabled
440448
- Svelte files are type-checked via `typescript-eslint`
441449

442-
**IMPORTANT: Before completing any work, always run `npm run lint` to ensure
443-
all code passes linting. This is mandatory.**
450+
**IMPORTANT: Before completing any work, always run `npm run lint` and
451+
`npm run check` to ensure all code passes linting and type checking. This is
452+
mandatory.**
444453

445454
Do not:
446455

src/lib/export/yaml.ts

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// Each SwitchBranch carries an embedded FlowGraph. The exporter "hoists"
2323
// those graphs as named `do` tasks at the top level of the document, then
2424
// generates `then: <hoisted-name>` references in the switch entries.
25+
import { isActivityComplexArg } from '$lib/tasks/model';
2526
import type {
2627
CallActivityConfig,
2728
CallGRPCConfig,
@@ -228,17 +229,29 @@ function exportCallActivityConfig(
228229
c: CallActivityConfig,
229230
): Record<string, unknown> {
230231
const w: Record<string, unknown> = { name: c.name };
231-
if (c.arguments !== undefined) w.arguments = c.arguments;
232232
if (c.taskQueue !== undefined) w.taskQueue = c.taskQueue;
233+
if (c.arguments !== undefined) {
234+
w.arguments = c.arguments.map((arg) =>
235+
isActivityComplexArg(arg) ? arg.value : arg,
236+
);
237+
}
233238
return { call: 'activity', with: w };
234239
}
235240

236241
function exportRunContainerConfig(
237242
c: RunContainerConfig,
238243
): Record<string, unknown> {
239244
const container: Record<string, unknown> = { image: c.image };
240-
if (c.arguments !== undefined) container.arguments = c.arguments;
245+
if (c.arguments !== undefined)
246+
container.arguments = c.arguments.map((arg) =>
247+
isActivityComplexArg(arg) ? arg.value : arg,
248+
);
241249
if (c.environment !== undefined) container.environment = c.environment;
250+
if (c.workingDirectory !== undefined)
251+
container.workingDirectory = c.workingDirectory;
252+
if (c.lifetime !== undefined) container.lifetime = c.lifetime;
253+
if (c.await === false) container.await = false;
254+
if (c.ports !== undefined) container.ports = c.ports;
242255
return { run: { container } };
243256
}
244257

@@ -247,39 +260,56 @@ function exportRunScriptConfig(c: RunScriptConfig): Record<string, unknown> {
247260
language: c.language,
248261
code: c.code,
249262
};
250-
if (c.arguments !== undefined) script.arguments = c.arguments;
263+
if (c.arguments !== undefined)
264+
script.arguments = c.arguments.map((arg) =>
265+
isActivityComplexArg(arg) ? arg.value : arg,
266+
);
251267
if (c.environment !== undefined) script.environment = c.environment;
252268
return { run: { script } };
253269
}
254270

255271
function exportRunShellConfig(c: RunShellConfig): Record<string, unknown> {
256272
const shell: Record<string, unknown> = { command: c.command };
257-
if (c.arguments !== undefined) shell.arguments = c.arguments;
273+
if (c.arguments !== undefined)
274+
shell.arguments = c.arguments.map((arg) =>
275+
isActivityComplexArg(arg) ? arg.value : arg,
276+
);
258277
if (c.environment !== undefined) shell.environment = c.environment;
278+
if (c.workingDirectory !== undefined)
279+
shell.workingDirectory = c.workingDirectory;
280+
if (c.await === false) shell.await = false;
259281
return { run: { shell } };
260282
}
261283

262284
function exportRunWorkflowConfig(
263285
c: RunWorkflowConfig,
264286
): Record<string, unknown> {
265-
return {
266-
run: {
267-
workflow: { name: c.name, namespace: c.namespace, version: c.version },
268-
},
287+
const workflow: Record<string, unknown> = {
288+
name: c.name,
289+
namespace: c.namespace,
290+
version: c.version,
269291
};
292+
if (c.await === false) workflow.await = false;
293+
return { run: { workflow } };
270294
}
271295

272296
function exportWaitConfig(c: WaitConfig): Record<string, unknown> {
273297
return { wait: c.duration };
274298
}
275299

276300
function exportRaiseConfig(c: RaiseConfig): Record<string, unknown> {
277-
const error: Record<string, unknown> = {
278-
type: c.errorType,
279-
status: c.errorStatus,
280-
};
281-
if (c.errorDetail !== undefined) error.detail = c.errorDetail;
282-
return { raise: { error } };
301+
if (!c.definition) {
302+
return { raise: { error: {} } };
303+
}
304+
const definition: Record<string, unknown> = {};
305+
if (c.definition.type !== undefined) definition['type'] = c.definition.type;
306+
if (c.definition.title !== undefined)
307+
definition['title'] = c.definition.title;
308+
if (c.definition.detail !== undefined)
309+
definition['detail'] = c.definition.detail;
310+
if (c.definition.status !== undefined)
311+
definition['status'] = c.definition.status;
312+
return { raise: { error: { definition } } };
283313
}
284314

285315
function exportListenConfig(c: ListenConfig): Record<string, unknown> {

0 commit comments

Comments
 (0)