Skip to content

Template for tdl extensions to help you develop, test and publish a custom extension

License

Notifications You must be signed in to change notification settings

iyear/tdl-extension-template

Repository files navigation

tdl Extension Template

Introduction

This template provides instructions on how to use the tdl extension template. The template helps you create, build, and publish extensions for the tdl.

Warning

tdl Extensions are in the beta stage. The API may change in the future.

Prerequisites

  • Go programming language installed (version 1.21 or higher)
  • Git installed
  • tdl command-line tool installed

Getting Started

  1. Create a New Repository

    Click on the "Use this template" button to create a new repository based on this template.

Important

GitHub repository name should be in the format tdl-<extension-name>

Tip

Add tdl-extension topic to the repository for better discoverability.

  1. Clone the Repository

    Clone the template repository to your local machine:

    git clone https://github.com/<username>/<repository>.git
    cd <repository>
  2. Update the go.mod File

    Update the go.mod file with the correct module name:

    module github.com/<username>/<repository>
  3. Install Dependencies

    Navigate to the project directory and install the required dependencies:

    go mod tidy

Develop

To develop the extension more effectively, consider using tdl/core, a Go library that exposes core functionality of tdl for use with less third-party dependencies.

Run the following command to install the library:

go get -u github.com/iyear/tdl/core

Build

To build the extension, run the following command:

go build

This will create an executable in the project directory.

Test

To test the extension, run the following commands:

tdl extension install --force ./tdl-extension
tdl <global-config-flags> <extension-name> <extension-flags>

This will install the extension in the tdl extension directory as local extension.

Publish

To publish your extension, follow these steps:

  1. Create a New Tag

    Create a new semver tag and push it to the repository:

    git tag v0.1.0
    git push origin v0.1.0
  2. Wait for the GitHub Action to Complete

    The GitHub Action release will build and publish the extension to a new release.

  3. Edit the draft release

    Edit the draft release and publish it.

About

Template for tdl extensions to help you develop, test and publish a custom extension

Topics

Resources

License

Stars

Watchers

Forks

Languages