helpers

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Copyright © 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Copyright © 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Copyright © 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Copyright © 2021 Mirco Veltri <github@mircoveltri.me>

Use of this source code is governed by Apache 2.0 license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecSveltinTpl

func ExecSveltinTpl(embedFS *embed.FS, tplConfig *config.TplConfig) []byte

func ExecuteCommandC

func ExecuteCommandC(root *cobra.Command, args ...string) (c *cobra.Command, err error)

func GetAllPublicPages

func GetAllPublicPages(fs afero.Fs, path string) []string

func GetAllResources

func GetAllResources(fs afero.Fs, path string) []string

func GetAllResourcesWithContentName

func GetAllResourcesWithContentName(fs afero.Fs, path string, children bool) []*config.ResourceItem

func GetResourceContentMap

func GetResourceContentMap(fs afero.Fs, resources []string, path string) map[string][]string

func GetResourceMetadataMap

func GetResourceMetadataMap(fs afero.Fs, resources []string, path string) map[string][]string

func GetResourceRouteFilename

func GetResourceRouteFilename(txt string, c *config.SveltinConfig) string

func InitAppTemplatesMap

func InitAppTemplatesMap() map[string]config.AppTemplate

func IsValidFileForContent

func IsValidFileForContent(f fs.FileInfo) bool

func MakeFileContent

func MakeFileContent(efs *embed.FS, content builder.Content) []byte

func NewNoPageItems

func NewNoPageItems(resources []string, content map[string][]string, metadata map[string][]string, pages []string) *config.NoPageItems

func NewSveltinSettings added in v0.2.0

func NewSveltinSettings(npmClientName string) config.SveltinSettings

func NewTplConfig

func NewTplConfig(tplPath string, funcs template.FuncMap, data config.TemplateData) *config.TplConfig

func PrepareContent

func PrepareContent(name string, resources map[string]string, templateId string, data *config.TemplateData) builder.Content

func PublicPageFilename

func PublicPageFilename(name string, pageType string) string

func ResourceExists

func ResourceExists(fs afero.Fs, name string, c *config.SveltinConfig) error

func RunPMCommand

func RunPMCommand(pmName string, pmCmd string, mode string, packages []string, silentMode bool) error

Execute package manager (npm, pnpm, yarn) commands

func WriteContentToDisk

func WriteContentToDisk(fs afero.Fs, saveAs string, fileContent []byte) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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