tag:support.appharbor.com,2010-11-23:/discussions/problems/81805-appharbor-only-supports-typescript-15AppHarbor: Discussion 2016-08-11T00:39:02Ztag:support.appharbor.com,2010-11-23:Comment/396820162016-04-20T08:13:01Z2016-04-20T08:13:01ZAppharbor only supports TypeScript 1.5?<div><p>Hi,</p>
<p>Yep, currently only TypeScript versions up to 1.5 are installed
on the build servers -- more recent versions can likely be
installed shortly, but I think there's a better and more elegant
solution to this issue -- since <a href="https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript">
TypeScript version 1.8</a> the TypeScript team has been providing
official NuGet packages. This means you can simply install those
packages and let AppHarbor restore them prior to building your
project. This way you loose the dependency on the build environment
you use, and the compiler version will be exactly the same locally
and on AppHarbor.</p>
<p>If you'd like to try this you'll just need to installed the
<a href="https://www.nuget.org/packages/Microsoft.TypeScript.Compiler/">Microsoft.TypeScript.Compiler</a>
and <a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/">Microsoft.TypeScript.MSBuild</a>
packages -- make sure to commit the changes to your project files
and <code>packages.config</code> files (the actual packages in the
<code>packages</code> folder can be omitted as they'll be restored
prior to the build.</p>
<p>Best,<br>
Rune</p></div>runetag:support.appharbor.com,2010-11-23:Comment/396820162016-04-29T14:27:36Z2016-04-29T14:27:36ZAppharbor only supports TypeScript 1.5?<div><p>I converted my HoppeUAT application to a vs2015 html app with
TypeScript, and added these two packages.</p>
<p>Should it work with html apps with ts? AppHarbor isn't
transpiling the TypeScript files to JavaScript. I.e., if I download
the build, there is no app\mocks.js.</p>
<p>Here is my tsconfig:<br>
{ "compilerOptions": { "module": "amd", "rootDir": "src",
"sourceMap": true, "target": "es5" }, "compileOnSave": true,
"exclude": [ "node_modules", "typings/main", "typings/main.d.ts",
"typings2" ] }</p>
<p>Here is my packages.config:<br>
<?xml version="1.0" encoding="utf-8"?><br>
<br></p>
<p>Build: c6801576</p>
<p>Build succeeded.<br>
0 Warning(s) 0 Error(s)</p>
<p>Time Elapsed 00:00:00.45</p></div>jhoppetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-03T02:04:01Z2016-05-03T02:04:01ZAppharbor only supports TypeScript 1.5?<div><p>Hi,</p>
<p>There could be a couple of reasons why the build output doesn't
contain the transpiled javascript files. Perhaps the transpiling is
occuring in the input folder (i.e. instead of the output folder
that is used when deploying the app), or there isn't a task in your
project file which automates and runs typescript against it.</p>
<p>I suspect this is related to the later issue as the most recent
build doesn't seem to have any typescript related tasks judging
from the logs. I'd assume that this is something it makes sense to
run as a post build event of sorts -- do you have something like
that configured already? Otherwise, how do you transpile the
typescript files to javascript when you're running your application
locally?</p>
<p>Best,<br>
Rune</p></div>runetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-03T02:50:15Z2016-05-03T02:50:15ZAppharbor only supports TypeScript 1.5?<div><p>Hi again,</p>
<p>I went ahead and tried this myself and didn't experience any
issues with TypeScript compilation after installing the NuGet
packages. It sounds like you've already installed both packages, so
I think the issue is related to a missing MsBuild task in the web
project file.</p>
<p>The task is added automatically when you install the package.
However the file sometimes needs to be saved before it shows up in
Git and can be committed. Perhaps that's what is missing here? Take
a <a href="https://github.com/runesoerensen/typescript-sample/commit/29a2b2cbe1511c70d71d5373b2c18db7aab23658">
look at this commit</a> to see the tasks added when installing the
MsBuild task package.</p>
<p>I also tried applying the relevant settings from your
<code>tsconfig.json</code> file and this didn't affect the result
either, so I'm fairly certain the absence of the relevant task in
your project file is the reason it's not being compiled as
expected.</p>
<p>This <a href="https://github.com/runesoerensen/typescript-sample">sample
project</a> is just a basic template VS2015 HTML app with
TypeScript. The commits show installation of each of the packages,
adding a <code>tsconfig.json</code> file and updating the compiler
settings to match yours -- might be helpful to use/check this out
while debugging this issue.</p>
<p>I hope this helps and let me know how it works out for you!</p>
<p>Best,<br>
Rune</p></div>runetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-06T18:26:02Z2016-05-06T18:26:02ZAppharbor only supports TypeScript 1.5?<div><p>Hi Rune,</p>
<p>I confirmed that your commit (csproj, packages.config) are both
in my project. Do you have access to my codebase? A second pair of
eyes would definitely be appreciated.</p>
<p>I am targeting .NET 4.6.1 - shouldn't make a difference, right?
I am a bit stumped!</p>
<p>Thanks,<br>
Joe</p></div>jhoppetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-06T19:36:28Z2016-05-06T19:36:28ZAppharbor only supports TypeScript 1.5?<div><p>Hi Rune,</p>
<p>I created a new app HoppePOC and started with your code as a
baseline. TypeScript works as you suggested. I've been copying my
changes into the project and comparing the project settings, and
that site seems to be working fine.</p>
<p>Do you see any difference between the two?</p>
<p>I'm wondering if this is something on the AppHarbor end...?</p>
<p>This is just my UAT site... Anything you can do on your end,
like wipe the workspace, or start a rebuild? It is my UAT site, so
I am OK with outages.</p>
<p>Thanks,<br>
Joe</p></div>jhoppetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-06T20:21:06Z2016-05-06T20:21:06ZAppharbor only supports TypeScript 1.5?<div><p>I compared the build logs and my site is missing the steps
'PreComputeCompileTypeScriptWithTSConfig' and
'CompileTypeScriptWithTSConfig'. Any idea how I can get them to
kick off?</p>
<p>2>PrepareForBuild:<br>
Creating directory "obj\Release\".
PreComputeCompileTypeScriptWithTSConfig:
D:\temp\uzxdac4l.zvr\input\packages\Microsoft.TypeScript.MSBuild.1.8.11\tools\tsc\tsc.exe
--project "D:\temp\uzxdac4l.zvr\input\TsSampleApp\tsconfig.json"
CompileTypeScriptWithTSConfig:
D:\temp\uzxdac4l.zvr\input\packages\Microsoft.TypeScript.MSBuild.1.8.11\tools\tsc\tsc.exe
--project "D:\temp\uzxdac4l.zvr\input\TsSampleApp\tsconfig.json"
CoreCompile:</p></div>jhoppetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-06T22:45:44Z2016-05-06T22:45:44ZAppharbor only supports TypeScript 1.5?<div><p>Hi,</p>
<p>I think the issue is that the build targets added by the MsBuild
package doesn't exist in the location referenced by your project
file. For instance, from the NuGet restore logs it seems that the
packages are restored in the root input directory
(<code>D:\temp\3ct3wirf.hnc\input\packages</code>), which is also
where both the solution and project files are located. However, the
references in your project files point to a different location
(<code>..\packages\Microsoft.TypeScript.MSBuild.1.8.11</code>).</p>
<p>I suspect the reason you're hitting this issue is because the
solution/project layout is a bit unusual. Usually when creating a
new solution Visual Studio will create the solution file in the
root directory and projects in a nested directory. NuGet relies on
this in the sense that the <code>packages</code> folder is usually
in the same directory as the solution so multiple projects can
share the same restored packages.</p>
<p>You might want to either nest the project file in a separate
folder below the solution file, or just updated the project
references in your project file.</p>
<p>Best,<br>
Rune</p></div>runetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-09T12:46:40Z2016-05-09T12:46:40ZAppharbor only supports TypeScript 1.5?<div><p>Rune,</p>
<p>For development, I use a different solution file (not
appharbor.sln). Because I used to have multiple web projects in the
solution, I created appharbor.sln so that I could have a single web
project, so that appharbor knew which to deploy. Since this
solution was used solely for Blog.FrontEnd.sln, I put the solution
file in that folder.</p>
<p>As per your recommendation, I moved appharbor.sln up a folder,
next to my other solution file. It seems to have resolved the
issue.</p>
<p>Thank you - great learning experience!</p>
<p>Joe</p></div>jhoppetag:support.appharbor.com,2010-11-23:Comment/396820162016-05-09T22:10:31Z2016-05-09T22:10:31ZAppharbor only supports TypeScript 1.5?<div><p>Hi Joe,</p>
<p>OK great, glad it worked out and thanks for the follow-up! Let
me know if there's anything else I can help with.</p>
<p>Best,<br>
Rune</p></div>rune