-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TypeScript compiler support (#784)
- Loading branch information
Showing
9 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pipeline.compilers import SubProcessCompiler | ||
from pipeline.conf import settings | ||
|
||
|
||
class TypeScriptCompiler(SubProcessCompiler): | ||
output_extension = 'js' | ||
|
||
def match_file(self, path): | ||
return path.endswith('.ts') | ||
|
||
def compile_file(self, infile, outfile, outdated=False, force=False): | ||
if not outdated and not force: | ||
return | ||
command = ( | ||
settings.TYPE_SCRIPT_BINARY, | ||
settings.TYPE_SCRIPT_ARGUMENTS, | ||
infile, | ||
'--outFile', | ||
outfile, | ||
) | ||
return self.execute_command(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function getName(u) { | ||
return "".concat(u.firstName, " ").concat(u.lastName); | ||
} | ||
var userName = getName({ firstName: "Django", lastName: "Pipeline" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type FullName = string; | ||
|
||
interface User { | ||
firstName: string; | ||
lastName: string; | ||
} | ||
|
||
|
||
function getName(u: User): FullName { | ||
return `${u.firstName} ${u.lastName}`; | ||
} | ||
|
||
let userName: FullName = getName({firstName: "Django", lastName: "Pipeline"}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters