Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 983291f5c691f861157d83fec7f7f9a1e1be29e2 @basarat basarat committed Jun 17, 2013
@@ -0,0 +1,4 @@
+node_modules
+npm-debug.log
+test/tmp
+/.idea
@@ -0,0 +1,4 @@
+node_modules
+npm-debug.log
+test/tmp
+/.idea
@@ -0,0 +1,103 @@
+module.exports = function (grunt) {
+ "use strict";
+
+ grunt.initConfig({
+ clean:{
+ test:[
+ "test/fixtures/**/*.js",
+ "test/fixtures/**/*.js.map",
+ "test/fixtures/**/*.d.ts",
+ "test/temp/**/*.*",
+ "test/temp"
+ ]
+ },
+ ts:{
+ simple:{
+ src:["test/fixtures/simple.ts"]
+ },
+ declaration:{
+ src:"test/fixtures/declaration.ts",
+ options:{
+ declaration:true
+ }
+ },
+ sourcemap:{
+ src:"test/fixtures/sourcemap.ts",
+ dest:"test/fixtures/sourcemap/",
+ options:{
+ base_path: "test/fixtures/",
+ sourcemap:true
+ }
+ },
+ "sourcemap-fullpath":{
+ src:"test/fixtures/sourcemap-fullpath.ts",
+ dest:"test/fixtures/sourcemap/",
+ options:{
+ base_path: "test/fixtures/",
+ sourcemap:true,
+ fullSourceMapPath:true
+ }
+ },
+ es5:{
+ src:"test/fixtures/es5.ts",
+ options:{
+ target:"ES5"
+ }
+ },
+ "no-module":{
+ src:"test/fixtures/no-module.ts"
+ },
+ amd:{
+ src:"test/fixtures/amd.ts",
+ options:{
+ module:"amd"
+ }
+ },
+ commonjs:{
+ src:"test/fixtures/commonjs.ts",
+ options:{
+ module:"commonjs"
+ }
+ },
+ single:{
+ src:"test/fixtures/single/**/*.ts",
+ dest: "test/temp/single.js"
+ },
+ multi:{
+ src:"test/fixtures/multi/**/*.ts",
+ dest:"test/temp/multi"
+ },
+ basePath:{
+ src:"test/fixtures/multi/**/*.ts",
+ dest:"test/temp/basePath",
+ options: {
+ base_path: "test/fixtures/multi"
+ }
+ },
+ "utf8-with-bom":{
+ src:"test/fixtures/utf8-with-bom.ts"
+ },
+ "no-output":{
+ src:"text/fixtures/no-output.ts",
+ dest:"test/temp/no-output.js"
+ },
+ comments:{
+ src:"test/fixtures/comments.ts",
+ options:{
+ comments:true
+ }
+ }
+ },
+ nodeunit:{
+ tests:["test/test.js"]
+ }
+ });
+
+ grunt.loadTasks("tasks");
+ grunt.loadNpmTasks("grunt-contrib-nodeunit");
+ grunt.loadNpmTasks("grunt-contrib-clean");
+ //grunt.registerTask("test", ["clean", "ts", "nodeunit"]);
+ grunt.registerTask("test", ["clean", "ts"]);
+ grunt.registerTask("default", ["test"]);
+
+};
20 LICENSE
@@ -0,0 +1,20 @@
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
+grunt-typescript================Compile TypeScript## DocumentationYou'll need to install `grunt-typescript` first: npm install grunt-typescriptThen modify your `grunt.js` file by adding the following line: grunt.loadNpmTasks('grunt-typescript');Then add some configuration for the plugin like so: grunt.initConfig({ ... typescript: { base: { src: ['path/to/typescript/files/**/*.ts'], dest: 'where/you/want/your/js/files', options: { module: 'amd', //or commonjs target: 'es5', //or es3 base_path: 'path/to/typescript/files', sourcemap: true, fullSourceMapPath: true, declaration: true, } } }, ... }); If you want to create a js file that is a concatenation of all the ts file (like -out option from tsc), you should specify the name of the file with the '.js' extension to dest option. grunt.initConfig({ ... typescript: { base: { src: ['path/to/typescript/files/**/*.ts'], dest: 'where/you/want/your/js/file.js', options: { module: 'amd', //or commonjs } } }, ... });※I'm sorry for poor English
@@ -0,0 +1,40 @@
+{
+ "author": "basarat",
+ "name": "grunt-ts",
+ "description": "compile typescript to javascript using computer installed typescript",
+ "version": "0.2.0",
+ "homepage": "https://github.com/basarat/grunt-ts",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:basarat/grunt-ts.git"
+ },
+ "bugs": {
+ "url": "https://github.com/basarat/grunt-ts/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/basarat/grunt-ts/blob/master/LICENSE"
+ }
+ ],
+ "main": "grunt.js",
+ "engines": {
+ "node": ">= 0.8.0"
+ },
+ "dependencies": {
+ "grunt": "~0.4.0",
+ "typescript": "0.8.3",
+ "grunt-lib-contrib": "~0.5.2"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.0",
+ "typescript": "0.8.3",
+ "grunt-contrib-clean": "~0.4.0",
+ "grunt-contrib-nodeunit": "~0.1.2"
+ },
+ "optionalDependencies": {},
+ "keywords": [
+ "gruntplugin",
+ "typescript"
+ ]
+}
Oops, something went wrong.

0 comments on commit 983291f

Please sign in to comment.