vito / booklit

a pretty lit content authoring system
https://booklit.page
MIT License
175 stars 55 forks source link

better handling of --plugin and go.mod #44

Open vito opened 3 years ago

vito commented 3 years ago

getting errors like this when adding --plugin github.com/vito/booklit/chroma/plugin:

❯ ./scripts/build -s 3001
INFO[0000] plugin registered                             plugin=baselit
../../../go/pkg/mod/github.com/vito/booklit@v0.12.0/chroma/booklit_lexer.go:4:2: missing go.sum entry for module providing package github.com/alecthomas/chroma; to add:
        go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/booklit@v0.12.0/chroma/plugin.go:26:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/formatters/html; to add:
        go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/booklit@v0.12.0/chroma/booklit_lexer.go:5:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/lexers; to add:
        go mod download github.com/alecthomas/chroma
../../../go/pkg/mod/github.com/vito/booklit@v0.12.0/chroma/plugin.go:28:2: missing go.sum entry for module providing package github.com/alecthomas/chroma/styles; to add:
        go mod download github.com/alecthomas/chroma
build failed: exit status 1

maybe --plugin can automatically add things to go.mod? unfortunately go mod tidy will clean that out. maybe there's some way to flag it? 🤔

maybe plugins should be enabled with a .go file that underscore-imports them?

jtarchie commented 1 year ago

The later is the only way we were able to do it here.