Skip to content

feat: add Starlark as a second function language - #43

Merged
dimiro1 merged 3 commits into
mainfrom
dimiro1/starlark-go-eval
Jun 3, 2026
Merged

feat: add Starlark as a second function language#43
dimiro1 merged 3 commits into
mainfrom
dimiro1/starlark-go-eval

Conversation

@dimiro1

@dimiro1 dimiro1 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Adds Starlark (google/starlark-go) as a second function language alongside Lua, chosen once at function creation and fixed across versions. A new internal/starlarkrt package implements the engine's Runtime interface — mirroring the Lua runner with the full stdlib surface (log, kv, env, http, json, base64, crypto, time, url, strings, random, router, ai, email) over the shared services plus Starlark-specific error formatting — and the engine selects the runtime per version via an fx value group keyed by a new function_versions.language column (migration 000011, defaulting to lua, sticky on updates). Language is wired through the store, GraphQL (Language enum + CreateFunctionInput.language), the CLI (functions create --language), and the frontend (language selector, Lua/Starlark starter templates, language-aware Monaco editor with hover/completions, API reference, and a function-list column). Editor IntelliSense data was refactored out of the large code-editor.js into per-language editor-lua-api.js/editor-starlark-api.js + a generic editor-completions.js, and the seed/vendor-js mise tasks moved to mise-tasks/ file tasks (seed now also creates Starlark examples). Adds starlarkrt unit tests, engine runtime-selection and store language tests, browser + HTTP e2e coverage, ADR 0013, and a lunar-starlark authoring skill.

🤖 Generated with Claude Code

dimiro1 added 3 commits June 3, 2026 17:30
Offer Starlark (google/starlark-go) alongside Lua for authoring functions.
The language is chosen once at creation and stays fixed across versions.

- internal/starlarkrt: new engine.Runtime mirroring the Lua runner, with all
  stdlib modules (log, kv, env, http, json, base64, crypto, time, url, strings,
  random, router, ai, email) over the shared services, plus Starlark-specific
  error formatting.
- Per-version language: function_versions.language column (migration 000011,
  defaults to lua), sticky on updates; engine selects the runtime via an fx
  value group keyed by language.
- GraphQL Language enum + CreateFunctionInput.language; CLI `functions create
  --language`; frontend language selector, Lua/Starlark starter templates,
  language-aware Monaco editor + hover/completions (refactored into
  editor-*-api.js + editor-completions.js), API reference, and a list column.
- Tests: starlarkrt unit tests, engine runtime-selection tests, store language
  tests, and e2e coverage for execution (both languages), pages, and listing.
- mise: seed and vendor-js moved to mise-tasks/ file tasks; seed now also
  creates Starlark examples. ADR 0013 and a lunar-starlark skill document it.
The lunar-cli/integration module imports internal/api (which now wires the
Starlark runtime) via the parent replace, so its go.mod/go.sum needed the
go.starlark.net dependency — `go mod tidy` adds it, fixing the "missing go.sum
entry" build failure in the Test job.

Also bump the per-test e2e browser budget from 30s to 60s for headroom on
slower CI runners (Chrome cold-start + Monaco load on the first browser test).
golangci-lint's unused check flagged starlarkrt/helpers.go:result, which was
superseded by direct okResult/errResult use. Removing it; lint is clean.
@dimiro1
dimiro1 merged commit a84f03f into main Jun 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant