build

package
v1.0.0-RC.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Consts = &ConstTemplateData{
	DoNotEdit: "This is auto-generated by Datastar. DO NOT EDIT.",
	SDKLanguages: []Language{
		{
			Handle: "clojure",
			Name:   "Clojure",
			Icon:   "vscode-icons:file-type-clojure",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/clojure",
		},
		{
			Handle: "csharp",
			Name:   "C#",
			Icon:   "vscode-icons:file-type-csharp2",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/dotnet",
		},
		{
			Handle: "go",
			Name:   "Go",
			Icon:   "vscode-icons:file-type-go-gopher",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/go",
		},
		{
			Handle: "haskell",
			Name:   "Haskell",
			Icon:   "vscode-icons:file-type-haskell",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/haskell",
		},
		{
			Handle: "java",
			Name:   "Java",
			Icon:   "vscode-icons:file-type-java",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/java",
		},
		{
			Handle: "php",
			Name:   "PHP",
			Icon:   "vscode-icons:file-type-php",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/php",
		},
		{
			Handle: "python",
			Name:   "Python",
			Icon:   "vscode-icons:file-type-python",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/python",
		},
		{
			Handle: "rust",
			Name:   "Rust",
			Icon:   "vscode-icons:file-type-rust",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/rust",
		},
		{
			Handle: "ruby",
			Name:   "Ruby",
			Icon:   "vscode-icons:file-type-ruby",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/ruby",
		},
		{
			Handle: "typescript",
			Name:   "TypeScript",
			Icon:   "vscode-icons:file-type-typescript-official",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/typescript",
		},
		{
			Handle: "zig",
			Name:   "Zig",
			Icon:   "vscode-icons:file-type-zig",
			SdkUrl: "https://github.com/starfederation/datastar/tree/main/sdk/zig",
		},
	},
	DatastarKey: "datastar",
	DefaultBools: []*DefaultBool{
		{
			Name:        toolbelt.ToCasedString("elementsUseViewTransitions"),
			Description: "Should elements be patched using the ViewTransition API?",
			Value:       false,
		},
		{
			Name:        toolbelt.ToCasedString("patchSignalsOnlyIfMissing"),
			Description: "Should a given set of signals patch if they are missing?",
			Value:       false,
		},
	},
	DefaultDurations: []*DefaultDuration{
		{
			Name:        toolbelt.ToCasedString("sseRetryDuration"),
			Description: "The default duration for retrying SSE on connection reset. This is part of the underlying retry mechanism of SSE.",
			Duration:    1 * time.Second,
		},
	},
	DefaultStrings: []*DefaultString{},
	DatalineLiterals: []toolbelt.CasedString{

		toolbelt.ToCasedString("selector"),

		toolbelt.ToCasedString("mode"),
		toolbelt.ToCasedString("elements"),
		toolbelt.ToCasedString("useViewTransition"),

		toolbelt.ToCasedString("signals"),
		toolbelt.ToCasedString("onlyIfMissing"),
	},
	Enums: []*EnumDefinition{
		{
			Name:         toolbelt.ToCasedString("ElementPatchMode"),
			Description:  "The mode in which an element is patched into the DOM.",
			DefaultIndex: 0,
			Values: []*EnumValueDefinition{
				{
					Value:       "outer",
					Description: "Morphs the element into the existing element.",
				},
				{
					Value:       "inner",
					Description: "Replaces the inner HTML of the existing element.",
				},
				{
					Value:       "remove",
					Description: "Removes the existing element.",
				},
				{
					Value:       "replace",
					Description: "Replaces the existing element with the new element.",
				},
				{
					Value:       "prepend",
					Description: "Prepends the element inside to the existing element.",
				},
				{
					Value:       "append",
					Description: "Appends the element inside the existing element.",
				},
				{
					Value:       "before",
					Description: "Inserts the element before the existing element.",
				},
				{
					Value:       "after",
					Description: "Inserts the element after the existing element.",
				},
			},
		},

		{
			Name:         toolbelt.ToCasedString("EventType"),
			Description:  "The type protocol on top of SSE which allows for core pushed based communication between the server and the client.",
			DefaultIndex: -1,
			Values: []*EnumValueDefinition{
				{
					Name:        toolbelt.ToCasedString("PatchElements"),
					Description: "An event for patching HTML elements into the DOM.",
					Value:       "datastar-patch-elements",
				},
				{
					Name:        toolbelt.ToCasedString("PatchSignals"),
					Description: "An event for patching signals.",
					Value:       "datastar-patch-signals",
				},
			},
		},
	},
}

Functions

func Build

func Build() error

Types

type ConstTemplateData

type ConstTemplateData struct {
	DoNotEdit                   string
	SDKLanguages                []Language
	Version                     string
	VersionClientByteSize       int
	VersionClientByteSizeBrotli int
	DatastarKey                 string
	DatalineLiterals            []toolbelt.CasedString
	DefaultBools                []*DefaultBool
	DefaultDurations            []*DefaultDuration
	DefaultStrings              []*DefaultString
	Enums                       []*EnumDefinition
}

type DefaultBool

type DefaultBool struct {
	Name        toolbelt.CasedString
	Description string
	Value       bool
}

type DefaultDuration

type DefaultDuration struct {
	Name        toolbelt.CasedString
	Description string
	Duration    time.Duration
}

type DefaultString

type DefaultString struct {
	Name        toolbelt.CasedString
	Description string
	Value       string
}

type EnumDefinition

type EnumDefinition struct {
	Name         toolbelt.CasedString
	Description  string
	Values       []*EnumValueDefinition
	DefaultIndex int
	Default      *EnumValueDefinition
}

type EnumValueDefinition

type EnumValueDefinition struct {
	Name        toolbelt.CasedString
	Description string
	Value       string
}

type Language

type Language struct {
	Handle string
	Name   string
	Icon   string
	SdkUrl string
}

Directories

Path Synopsis
cmd
build command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL