Documentation ¶
Index ¶
Constants ¶
const Name = "TypescriptPlugin"
Name the name of the plugin, is "TypescriptPlugin"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompilerOptions ¶
type CompilerOptions struct { Declaration bool `json:"declaration"` Module string `json:"module"` Target string `json:"target"` Watch bool `json:"watch"` Charset string `json:"charset"` Diagnostics bool `json:"diagnostics"` EmitBOM bool `json:"emitBOM"` EmitDecoratorMetadata bool `json:"emitDecoratorMetadata"` ExperimentalDecorators bool `json:"experimentalDecorators"` InlineSourceMap bool `json:"inlineSourceMap"` InlineSources bool `json:"inlineSources"` IsolatedModules bool `json:"isolatedModules"` Jsx string `json:"jsx"` ReactNamespace string `json:"reactNamespace"` ListFiles bool `json:"listFiles"` Locale string `json:"locale"` MapRoot string `json:"mapRoot"` ModuleResolution string `json:"moduleResolution"` NewLine string `json:"newLine"` NoEmit bool `json:"noEmit"` NoEmitOnError bool `json:"noEmitOnError"` NoEmitHelpers bool `json:"noEmitHelpers"` NoImplicitAny bool `json:"noImplicitAny"` NoLib bool `json:"noLib"` NoResolve bool `json:"noResolve"` SkipDefaultLibCheck bool `json:"skipDefaultLibCheck"` OutDir string `json:"outDir"` OutFile string `json:"outFile"` PreserveConstEnums bool `json:"preserveConstEnums"` Pretty bool `json:"pretty"` RemoveComments bool `json:"removeComments"` RootDir string `json:"rootDir"` SourceMap bool `json:"sourceMap"` SourceRoot string `json:"sourceRoot"` StripInternal bool `json:"stripInternal"` SuppressExcessPropertyErrors bool `json:"suppressExcessPropertyErrors"` SuppressImplicitAnyIndexErrors bool `json:"suppressImplicitAnyIndexErrors"` AllowUnusedLabels bool `json:"allowUnusedLabels"` NoImplicitReturns bool `json:"noImplicitReturns"` NoFallthroughCasesInSwitch bool `json:"noFallthroughCasesInSwitch"` AllowUnreachableCode bool `json:"allowUnreachableCode"` ForceConsistentCasingInFileNames bool `json:"forceConsistentCasingInFileNames"` AllowSyntheticDefaultImports bool `json:"allowSyntheticDefaultImports"` AllowJs bool `json:"allowJs"` NoImplicitUseStrict bool `json:"noImplicitUseStrict"` }
CompilerOptions contains all the compiler options used by the tsc (typescript compiler)
type Options ¶
type Options struct { Bin string Dir string Ignore string Tsconfig *Tsconfig Editor *editor.Plugin // the editor is just a plugin also }
Options the struct which holds the TypescriptPlugin options Has five (5) fields
1. Bin: string, the typescript installation directory/typescript/lib/tsc.js, if empty it will search inside global npm modules 2. Dir: string, Dir set the root, where to search for typescript files/project. Default "./" 3. Ignore: string, comma separated ignore typescript files/project from these directories. Default "" (node_modules are always ignored) 4. Tsconfig: &typescript.Tsconfig{}, here you can set all compilerOptions if no tsconfig.json exists inside the 'Dir' 5. Editor: typescript.Editor("username","password"), if setted then alm-tools browser-based typescript IDE will be available. Defailt is nil
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the default Options of the Plugin
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin the struct of the Typescript Plugin, holds all necessary fields & methods
func (*Plugin) Activate ¶
func (t *Plugin) Activate(container iris.IPluginContainer) error
Activate ...
func (*Plugin) GetDescription ¶
GetDescription TypescriptPlugin scans and compile typescript files with ease
type Tsconfig ¶
type Tsconfig struct { CompilerOptions CompilerOptions `json:"compilerOptions"` Exclude []string `json:"exclude"` }
Tsconfig the struct for tsconfig.json
func DefaultTsconfig ¶
func DefaultTsconfig() *Tsconfig
DefaultTsconfig returns the default Tsconfig, with CompilerOptions module: commonjs, target: es5 and ignore the node_modules
func (*Tsconfig) CompilerArgs ¶
CompilerArgs returns the CompilerOptions' contents of the Tsconfig it reads the json tags, add '--' at the start of each one and returns an array of strings