Skip to content

feat: fastbelt scaffold#59

Merged
msujew merged 18 commits intoTypeFox:mainfrom
SteveRuble:ruble/scaffold
Apr 8, 2026
Merged

feat: fastbelt scaffold#59
msujew merged 18 commits intoTypeFox:mainfrom
SteveRuble:ruble/scaffold

Conversation

@SteveRuble
Copy link
Copy Markdown
Contributor

@SteveRuble SteveRuble commented Apr 6, 2026

This implements a fastbelt scaffold command.

It can produce an entire Go module or just add a package to an existing module.

The generated code includes the VS Code extension, LSP server, and go:generate wiring, as well as a placeholder .fb file.

Partially completes #57 (the scaffolding part).

This is a big PR but that's inevitable when you're introducing scaffolding... there are a bunch of templates involved.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 48a1f50. Configure here.

Comment thread cmd/fastbelt/help.go
Comment thread internal/scaffold/templates/vscode-extension/package.json.tmpl Outdated
Comment thread internal/scaffold/names.go Outdated
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 6, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

This relocates the `main` package to `cmd/fastbelt`, allowing  to work as users will probably expect. Also updates related documentation and codegen examples.
@SteveRuble
Copy link
Copy Markdown
Contributor Author

Oops, clicked the wrong button.

@SteveRuble SteveRuble reopened this Apr 6, 2026
Copy link
Copy Markdown
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really nice, thank you! Just a few minor improvements, see below.

Comment thread internal/scaffold/templates/vscode-extension/src/extension.sample.ts Outdated
Comment thread internal/scaffold/templates/vscode-extension/src/tsc-stub.ts
Comment thread cmd/fastbelt/scaffold.go Outdated
Comment thread internal/scaffold/templates/README.md.tmpl Outdated
Comment thread README.md Outdated
Comment thread internal/grammar/generated/lexer_gen.go Outdated
@SteveRuble
Copy link
Copy Markdown
Contributor Author

@msujew, sorry for the churn, but I realized there's a more intuitive behavior for the flags. Now --module means "create a Go module and put the generated package in it" and --package means "generate a package with the templated files at this location (which defaults to .)". So you can do --module example.com/foo/bar --package lang --language quux and get a new module with the generated code in the lang directory. If you don't provide --package it generates in the root of the module; if you don't provide --module it generates in the root of the current directory (assuming there's a go.mod in it). That seems better than the one-or-the-other pattern.

Copy link
Copy Markdown
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the churn

No worries - I also think that the latest iteration on package/module handling makes more sense!

Comment thread internal/scaffold/templates/vscode-extension/src/tsc-stub.ts
Comment thread .vscode/launch.json Outdated
Comment thread internal/scaffold/scaffold_test.go
Copy link
Copy Markdown
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works great! Thanks a lot for the effort, much appreciated :)

@msujew msujew merged commit f093e3e into TypeFox:main Apr 8, 2026
4 checks passed
Comment thread cmd/fastbelt/main.go
return runScaffoldCLI(args[1:])
}
}
return runLegacyGenerate(args)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put this behind a generate command arg.

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.

3 participants