typescript

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TsConfigFile        = "tsconfig.json"
	TsFileExt           = ".ts"
	GitIgnoreFile       = ".gitignore"
	PackageJsonFile     = "package.json"
	PackageJsonLockFile = "package-lock.json"

	NodeModulesDir = "node_modules"

	DefaultBuildScriptName   = "build"
	DefaultBuildScript       = "tsc"
	DefaultTypescriptVersion = "^4.3.5"
)

Variables

This section is empty.

Functions

func SavePackageJson

func SavePackageJson(directory string, config *PackageJson) error

func SaveTsConfig

func SaveTsConfig(directory string, config *TsConfig) error

Types

type CompilerOptions

type CompilerOptions struct {
	Target            *string `json:"target,omitempty"`
	Module            *string `json:"module,omitempty"`
	OutDir            *string `json:"outDir,omitempty"`
	SourceMap         *bool   `json:"sourceMap,omitempty"`
	Strict            *bool   `json:"strict,omitempty"`
	NoImplicitReturns *bool   `json:"noImplicitReturns,omitempty"`
	NoUnusedLocals    *bool   `json:"noUnusedLocals,omitempty"`
}

type Npm

type Npm interface {
	Build() error
}

func NewNpm

func NewNpm(directory string, packageJson *PackageJson) Npm

type PackageJson

type PackageJson struct {
	Name            string            `json:"name,omitempty"`
	Scripts         map[string]string `json:"scripts,omitempty"`
	DevDependencies map[string]string `json:"devDependencies,omitempty"`
	Dependencies    map[string]string `json:"dependencies,omitempty"`
	Private         bool              `json:"private,omitempty"`
}

func DefaultPackageJson

func DefaultPackageJson(name string) *PackageJson

func LoadPackageJson

func LoadPackageJson(directory string) (*PackageJson, error)

type TsConfig

type TsConfig struct {
	CompilerOptions CompilerOptions        `json:"compilerOptions,omitempty"`
	CompileOnSave   *bool                  `json:"compileOnSave,omitempty"`
	Include         []string               `json:"include,omitempty"`
	Exclude         []string               `json:"exclude,omitempty"`
	Detailed        map[string]interface{} `json:"-"` // Rest of the fields should go here.
}

func DefaultTsConfig

func DefaultTsConfig() *TsConfig

func LoadTsConfig

func LoadTsConfig(directory string) (*TsConfig, error)

Jump to

Keyboard shortcuts

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