diff --git a/ast/ast.ts b/ast/ast.ts index 375e3244..17ac639c 100644 --- a/ast/ast.ts +++ b/ast/ast.ts @@ -2067,6 +2067,7 @@ module TDev.AST { public diffRemovedThings:Decl[]; public npmModules: StringMap = {}; public bowerModules: StringMap = {}; + public clientScripts: StringMap = {}; public cordovaPlugins: StringMap = {}; public pipPackages: StringMap = {}; public touchDevelopPlugins: StringMap = {}; diff --git a/ast/typeChecker.ts b/ast/typeChecker.ts index 825080bb..c1813468 100644 --- a/ast/typeChecker.ts +++ b/ast/typeChecker.ts @@ -1632,6 +1632,8 @@ module TDev.AST this.importCordova(t, plugin, v); break; case "bower": this.importBower(t, plugin, v); break; + case "client": + this.importClientScript(t, plugin, v); break; case "pip": if (!this.topApp.canUseCapability(PlatformCapability.Npm)) this.unsupportedCapability(plugin, PlatformCapability.Npm); @@ -1685,6 +1687,13 @@ module TDev.AST } } + private importClientScript(t: Call, mod: string, v: string) { + if (mod && v != null) { + var imports = this.topApp.clientScripts; + imports[mod] = v; + } + } + private importBower(t: Call, mod: string, v: string) { if (mod && v != null) { var imports = this.topApp.bowerModules diff --git a/lib/App.ts b/lib/App.ts index 3c7da856..dda2733d 100644 --- a/lib/App.ts +++ b/lib/App.ts @@ -616,8 +616,8 @@ module TDev.RT { r.resume() } - //? Imports a dependent package which may be versioned. Package managers may be Node.JS npm, Bower, Apache cordova, Python Pip and TouchDevelop plugins. Bower packages are not available within the touchdevelop.com domain. - //@ name("import") [manager].deflStrings("npm", "cordova", "bower", "touchdevelop", "pip") [version].defl("*") + //? Imports a dependent package which may be versioned. Package managers may be Node.JS npm, Bower, Apache cordova, Python Pip and TouchDevelop plugins. ``bower`` and ``client`` imports are not available within the touchdevelop.com domain. + //@ name("import") [manager].deflStrings("npm", "cordova", "bower", "client", "touchdevelop", "pip") [version].defl("*") export function import_(manager : string, module: string, version: string): void { }