build

package
v1.0.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 11 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("fragmentsUseViewTransitions"),
			Description: "Should fragments be merged using the ViewTransition API?",
			Value:       false,
		},
		{
			Name:        toolbelt.ToCasedString("mergeSignalsOnlyIfMissing"),
			Description: "Should a given set of signals merge if they are missing?",
			Value:       false,
		},
		{
			Name:        toolbelt.ToCasedString("executeScriptAutoRemove"),
			Description: "Should script element remove itself after execution?",
			Value:       true,
		},
	},
	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{
		{
			Name:        toolbelt.ToCasedString("executeScriptAttributes"),
			Description: `The default attributes for <script/> element use when executing scripts. It is a set of key-value pairs delimited by a newline \\n character.`,
			Value:       "type module",
		},
	},
	DatalineLiterals: []toolbelt.CasedString{

		toolbelt.ToCasedString("selector"),

		toolbelt.ToCasedString("mergeMode"),
		toolbelt.ToCasedString("fragments"),
		toolbelt.ToCasedString("useViewTransition"),

		toolbelt.ToCasedString("signals"),
		toolbelt.ToCasedString("onlyIfMissing"),

		toolbelt.ToCasedString("paths"),

		toolbelt.ToCasedString("script"),
		toolbelt.ToCasedString("attributes"),
		toolbelt.ToCasedString("autoRemove"),
	},
	Enums: []*EnumDefinition{
		{
			Name:         toolbelt.ToCasedString("FragmentMergeMode"),
			Description:  "The mode in which a fragment is merged into the DOM.",
			DefaultIndex: 0,
			Values: []*EnumValueDefinition{
				{
					Value:       "morph",
					Description: "Morphs the fragment into the existing element using idiomorph.",
				},
				{
					Value:       "inner",
					Description: "Replaces the inner HTML of the existing element.",
				},
				{
					Value:       "outer",
					Description: "Replaces the outer HTML of the existing element.",
				},
				{
					Value:       "prepend",
					Description: "Prepends the fragment to the existing element.",
				},
				{
					Value:       "append",
					Description: "Appends the fragment to the existing element.",
				},
				{
					Value:       "before",
					Description: "Inserts the fragment before the existing element.",
				},
				{
					Value:       "after",
					Description: "Inserts the fragment after the existing element.",
				},
				{
					Value:       "upsertAttributes",
					Description: "Upserts the attributes of 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("MergeFragments"),
					Description: "An event for merging HTML fragments into the DOM.",
					Value:       "datastar-merge-fragments",
				},
				{
					Name:        toolbelt.ToCasedString("MergeSignals"),
					Description: "An event for merging signals.",
					Value:       "datastar-merge-signals",
				},
				{
					Name:        toolbelt.ToCasedString("RemoveFragments"),
					Description: "An event for removing HTML fragments from the DOM.",
					Value:       "datastar-remove-fragments",
				},
				{
					Name:        toolbelt.ToCasedString("RemoveSignals"),
					Description: "An event for removing signals.",
					Value:       "datastar-remove-signals",
				},
				{
					Name:        toolbelt.ToCasedString("ExecuteScript"),
					Description: "An event for executing <script/> elements in the browser.",
					Value:       "datastar-execute-script",
				},
			},
		},
	},
}

Functions

func Build

func Build() error

Types

type ConstTemplateData

type ConstTemplateData struct {
	DoNotEdit                 string
	SDKLanguages              []Language
	Version                   string
	VersionClientByteSize     int
	VersionClientByteSizeGzip 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