Direct naar hoofdinhoud

Aan de slag

Onofficiële Beta-vertaling

Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden →

Haal de broncode op

De broncode staat op GitHub. Als je wilt bijdragen, maak dan een fork aan zodat je wijzigingen kunt maken in je eigen repository en een pull request kunt aanmaken in de officiële Oh My Posh-repository.

Om je fork van Oh My Posh lokaal te clonen, open je de terminal en vervang je <user> door je GitHub-gebruikersnaam.

git clone git@github.com:<user>/oh-my-posh.git

Installeer de vereisten

go

The codebase is in go, meaning we need a working go setup before we can do anything else. Have a look at the go guide to get up and running with go in no time!

let op

Oh My Posh needs at least go 1.25.5

golangci-lint

To make sure we keep on writing quality code, golang-ci lint is used to validate the changes. Have a look at the local installation guide to make sure you can validate this yourself as well.

nodejs

The documentation is written in markdown and uses Docusaurus to generate the website. To validate your changes, you'll need to have nodejs installed so you can run the website locally.

Visual Studio Code

If you're not using Visual Studio Code yet, it's a great editor to work with go and the project has the configuration built-in. You can download it here.

Configureer Visual Studio Code

Er staat een standaardconfiguratie (.vscode map) voor Visual Studio Code klaar in de repository:

  • golangci-lint is ingesteld als de standaard linter.

  • aanbevolen extensies voor soepele onboarding.

  • standaard run- en debugconfiguraties beschikbaar.

Na installatie van de extensies:

  • start debuggen met F5.

  • voer alle tests uit via de Test Explorer.

Tests uitvoeren

De Go-broncode vind je in de src/ map, navigeer hier eerst naartoe.

Unit tests

go test -v ./...

golangci-lint

golangci-lint run

Bouw de applicatie

De makkelijkste manier om wijzigingen te testen is via unit tests. Omdat het een visuele tool is, wil je wijzigingen ook valideren door de prompt in je shell te testen.

Als Oh My Posh al in je PATH staat, moet je deze ofwel als uitvoerparameter gebruiken, of zorgen dat de $GOPATH/bin/ map vóór het Oh My Posh-binary in je PATH staat.

go build -o (Get-Command oh-my-posh.exe).Source

Alternatief:

$env:PATH = "$env:GOPATH\bin;$env:PATH"
go build -o $GOPATH/bin/oh-my-posh

Start de website lokaal

Open je terminal, navigeer naar de website map in de repository. Installeer de vereisten en start de website:

npm install
npm start

Dit start een lokale server op http://localhost:3000 waar je je wijzigingen kunt bekijken.

Extra tips

Configureer Delve in VS Code

De Delve-configuratie is standaard restrictief (met name stringlimiet). Je kunt limieten aanpassen in VS Code (via settings.json of direct in launch.json):

"go.delveConfig": {

"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 3,
"maxStringLen": 400,
"maxArrayValues": 400,
"maxStructFields": -1
},
"apiVersion": 2,
"showGlobalVariables": false
}

Volgende stap

Alles is klaar! Je kunt nu wijzigingen maken en je eerste PR aanmaken!