Skip to content

Contributing

This document describes the full process of setting up a fully working local development environment and submitting your first contribution.

Clone frizzante.

git clone https://github.com/razshare/frizzante

Clone frizzante-starter.

git clone https://github.com/razshare/frizzante-starter

Install the frizzante cli using the go cli

go install github.com/razshare/frizzante@latest

Or by downloading the binaries directly from GitHub.

One way or another, make sure the frizzante cli is on your path.

If you’re installing it using the go cli, make sure that go binaries are on your path

Terminal window
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

If you’re using a precompiled binary, make sure that’s on your path

Terminal window
export PATH=$PATH:/path/to/frizzante

Navigate to your frizzante local repository and configure the project with make.

Terminal window
make configure

This will install bun and air in .gen.

Navigate to your frizzante-starter local repository and configure the project with make.

Terminal window
make configure

This will install bun and air in .gen.

You most likely will want to try out your frizzante changes locally.

By default, your local frizzante-starter will pull the frizzante package from the public remote repository.
You can link your local frizzante-starter to your local version of frizzante instead, in order to have immediate feedback.

Navigate to your frizzante-starter repository and modify your go.mod file to replace the remote frizzante dependency with the local one using replace syntax.

go.mod
module main
go 1.24
// ...
replace github.com/razshare/frizzante => /home/user1/path/to/frizzante
require github.com/razshare/frizzante v1.14.29
// ...

This will make it so that changes to your local frizzante project are immediately picked up when building your local frizzante-starter.

Create a new branch and give it a name that describes your changes.

Terminal window
git checkout -b feature/some-feature

Submitted code must follow a few rules.

Each package must contain a functions.go file and/or a types.go file. Functions must be placed in functions.go and types must be placed in types.go.

  • Directorypackage1
    • functions.go
    • types.go

Packages must not be nested deeper than 1 level.

  • Directorypackage1
    • functions.go
    • types.go
  • Directorypackage2
    • functions.go
    • types.go
  • Directorypackage3
    • functions.go
    • types.go
  • Directorypackage4
    • functions.go
    • types.go

Tests must be located at the root of the repository and must reflect the name of the package.

  • Directorypackage1
    • functions.go
    • types.go
  • test_package1.go

Do not start multiple instances of *servers.Server when testing server features.

The whole test suite makes use of one single server instance, which is initialized in init_test.go.

Whenever you need to add more server related tests, make use of the same server instance.

This helps keeping the test suite execution time low.

Structures and packages must not declare private members.

All package functions, variables and structure properties must always be public.

package1/types.go
type MyStruct struct {
Property1 string
Property2 int
Property3 bool
Property4 any
}
package1/functions.go
func (str *MyStruct) MyFunction1() {}
func (str *MyStruct) MyFunction2() {}

When you’re done with your changes you can submit a pull request in order to implement them into frizzante (or frizzante-starter).

Tests will automatically run through GitHub actions when pushing into main or when pull requests are opened into main.

That being said, if you don’t want to wait for GitHub actions to make sure tests pass, you can also run them locally using the provided git hooks, see next section.

You can apply pre-commit git hooks to you local repository by running

Terminal window
make hooks