Add js.Batch

Fixes #12626
Closes #7499
Closes #9978
Closes #12879
Closes #13113
Fixes #13116
This commit is contained in:
Bjørn Erik Pedersen
2024-12-10 16:22:08 +01:00
parent 157d86414d
commit e293e7ca6d
61 changed files with 4520 additions and 1003 deletions

View File

@@ -0,0 +1,20 @@
{{ range $i, $e := .Scripts -}}
{{ if eq .Export "*" }}
{{- printf "import %s as Script%d from %q;" .Export $i .Import -}}
{{ else -}}
{{- printf "import { %s as Script%d } from %q;" .Export $i .Import -}}
{{ end -}}
{{ end -}}
{{ range $i, $e := .Runners }}
{{- printf "import { %s as Run%d } from %q;" .Export $i .Import -}}
{{ end -}}
{{ if .Runners -}}
let group = { id: "{{ $.ID }}", scripts: [] }
{{ range $i, $e := .Scripts -}}
group.scripts.push({{ .RunnerJSON $i }});
{{ end -}}
{{ range $i, $e := .Runners -}}
{{ $id := printf "Run%d" $i }}
{{ $id }}(group);
{{ end -}}
{{ end -}}