Giter Club home page Giter Club logo

buffalo-plugins's Introduction

Buffalo Documentation

gobuffalo.io

This is the repository for https://www.gobuffalo.io, the official website of the Buffalo ecosystem.

This documentation contains:

Contributing

Contributing to this documentation site is a great, and easy, way to help make Buffalo better!

Note that this repository is only about Buffalo ecosystem documentation. If you want to contribute to the ecosystem itself, please refer to the concerned repository:

See the contribution guide for more info about how to contribute.

buffalo-plugins's People

Contributors

dnnrly avatar markbates avatar stanislas-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buffalo-plugins's Issues

Proposal: Configuration file

Plugins should adopt a configuration file. buffalo-plugin.toml.

This file can be given to the plugins system and can contain information such:

The plug-in name
Description
Installation command
Available sub commands
Events listened for
Events thrown
Generator steps to override, etc...
Etc...

buffalo plugins install http://example.com(optional path to file | /buffalo-plug-in.toml) - if a plug-in config is found on the server the command will follow the instructions in the file.

This information will be placed into the applications ./config/buffalo-plugins.toml file for later use with other plug-in commands.

This file can also be used by the toolkit.gobuffalo.io site.

Please update github.com/gobuffalo/release dependency

The go.mod file still refers to an older version, which pulls in an older version of golang.org/x/tools which ends up breaking upgrades due to a go-diff rename. AFAIU this is something that should be fixed in go, but until it is, it can be worked around by not having any (indirect) references to renamed or otherwise problematic packages.

Updating the github.com/gobuffalo/release dependency to the latest version should fix (part of) this problem.

To reproduce the problem, try:

(This uses gotip for a clearer error message, but it also happens with regular go 1.11 or 1.12).

matthijs@grubby:~/bar$ gotip mod init bar
go: creating new go.mod: module bar
matthijs@grubby:~/bar$ gotip get -d github.com/gobuffalo/buffalo-plugins
[snip output]
matthijs@grubby:~/bar$ gotip get -u -m
[snip output]
go get: github.com/gobuffalo/[email protected] ->
        github.com/gobuffalo/[email protected] ->
        github.com/gobuffalo/[email protected] ->
        golang.org/x/[email protected] ->
        cloud.google.com/[email protected] ->
        golang.org/x/[email protected] ->
        sourcegraph.com/sourcegraph/[email protected] ->
        sourcegraph.com/sourcegraph/[email protected]: parsing go.mod: unexpected module path "github.com/sourcegraph/go-diff"

New buffalo plugin does not build

Here's the log of what I did:

➜  dnnrly buffalo generate plugin github.com/dnnrly/problematic --with-gen
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/cmd/version.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/main.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/problematic/version.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/README.md
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/cmd/available.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/cmd/root.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/cmd/generate.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/genny/problematic/problematic.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/genny/problematic/options.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/genny/problematic/templates/example.txt
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/cmd/available.go
INFO[0000] /go/src/github.com/dnnrly/buffalo-problematic/LICENSE
INFO[0000] gofmt -w buffalo-problematic/cmd/available.go buffalo-problematic/cmd/generate.go buffalo-problematic/cmd/root.go buffalo-problematic/cmd/version.go buffalo-problematic/genny/problematic/options.go buffalo-problematic/genny/problematic/problematic.go buffalo-problematic/main.go buffalo-problematic/problematic/version.go
➜  dnnrly cd buffalo-problematic
➜  buffalo-problematic go get ./...
# github.com/dnnrly/buffalo-problematic/cmd
cmd/generate.go:5:2: imported and not used: "path/filepath"
cmd/generate.go:8:2: imported and not used: "github.com/gobuffalo/envy"
cmd/version.go:4:2: imported and not used: "encoding/json"
cmd/version.go:5:2: imported and not used: "os"
cmd/version.go:8:2: imported and not used: "github.com/gobuffalo/buffalo-plugins/plugins"
cmd/version.go:17:3: undefined: fmt

Unlimited buffalo spawn with buffalo-no-sqlite

When you have the buffalo-no-sqlite binary in your path (that's the default name of the buffalo binary provided in the releases page), any buffalo command takes a long time (at least ~2s).

It seems buffalo-plugins considers it as a plugin (due to the buffalo- prefix), so it calls it with available arg. This leads to infinite recursion, since buffalo-no-sqlite scans for plugins, then calls buffalo-no-sqlite available and so on.

I found it when running some tests on my Linux machine, and the CPU was working hard even without many apps started.
Running just buffalo (without any arg) takes a few seconds in this case, and spawns a lot of short-living-processes, always renewed:

ps ax | grep buffalo
  449 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  464 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  492 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  507 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  533 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  550 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  571 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  588 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  604 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  625 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  643 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  667 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  685 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  710 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  727 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  751 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  766 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  793 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  811 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  834 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  850 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  871 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  893 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  915 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  932 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  954 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  971 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
  988 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1013 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1035 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1056 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1071 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1095 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1113 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1139 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1156 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1204 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1249 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1276 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1296 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1333 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1346 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1374 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1392 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1414 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1429 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1449 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1470 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1493 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1509 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1529 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1551 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1566 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1589 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1604 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1628 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1642 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1668 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1694 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1707 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1733 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1756 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1774 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1798 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1817 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1835 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1855 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available
 1889 pts/2    Sl     0:00 /home/michalakst/go/bin/buffalo-no-sqlite available

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.