feat: add Starlark as a second function language - #43
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Starlark (google/starlark-go) as a second function language alongside Lua, chosen once at function creation and fixed across versions. A new
internal/starlarkrtpackage implements the engine'sRuntimeinterface — 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 newfunction_versions.languagecolumn (migration 000011, defaulting to lua, sticky on updates). Language is wired through the store, GraphQL (Languageenum +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 largecode-editor.jsinto per-languageeditor-lua-api.js/editor-starlark-api.js+ a genericeditor-completions.js, and theseed/vendor-jsmise tasks moved tomise-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 alunar-starlarkauthoring skill.🤖 Generated with Claude Code