Giter Site home page Giter Site logo

gulp-tsc's People

Contributors

ccll avatar chrisxue815 avatar codependent avatar computmaxer avatar czambran avatar ellisthion avatar ertwroc avatar florianrappl avatar jeremieca avatar kant2002 avatar kotas avatar misumirize avatar ryanflowers avatar watilde avatar youpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-tsc's Issues

Support for suppressImplicitAnyIndexErrors

Hi
In the documentation you claim support for: suppressImplicitAnyIndexErrors but it is being ignored. Looking in your code, I could not see it either. Is this feature supported?

Thanks!

Support for the option "isolatedModules"

In my environment I need the opiton "isolatedModules". Unfortunately this option is not available in the current version of gulp-tsc. Is there a way to set the option on a other way? Or could you tell me, when the option would be supported by gulp-tsc.

Thanks!!

--lib option is not working properly

If I put this in my gulpfile.js

gulp.task("build", function () { gulp.src(paths.ts) .pipe(typescript({ target: "es5", sourceMap: true, experimentalDecorators: true, lib: ["es2015", "dom"], noImplicitAny: true })) .pipe(gulp.dest('temp/')) });

This gets put into the file passed to tsc.

"--lib"
"dom"
"--lib"
"es2015"

Passing in two --lib options is not good. Only the last one get processed.

I changed the code to this to get it working.

if (this.options.lib && versionCompare(version, "1.8") >= 0) { var param = ""; for (let libName of this.options.lib) { param += libName + ", "; } if(param.length > 0){ param = param.substring(0, param.length - 2); args.push('--lib', param); } }

Now I get this in the file and tsc likes it.

"--lib"
"dom, es2015"

Gulp-tsc runs in infinite loop

I guess i did something wrong, but I don't understand why starting with :

image

I end up with : (I had to stop the script from running, otherwise it never stops adding files and folders)

image

While the file is correctly compiled...

Here is my script :

var gulp = require('gulp');
var typescript = require('gulp-tsc');

gulp.task('compileTS', function() {
    gulp.src(['**/*.ts', '!node_modules/**'])
    .pipe(typescript({
        target: 'ES5'
    }))
    .pipe(gulp.dest('.'));
});

gulp.task('watch:ts', function() {
    gulp.watch(['**/*.ts', '!node_modules/**'], ['compileTS']);
});

I just ran the gulp watch:ts command.

please transition away from the gulp-util

following this https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5:

please remove gulp-util using the following API replacements:
gutil.File => https://www.npmjs.com/package/vinyl
gutil.replaceExtension => The .extname property on Vinyl objects or https://www.npmjs.com/package/replace-ext
gutil.colors => https://www.npmjs.com/package/ansi-colors
gutil.date => https://www.npmjs.com/package/date-format
gutil.log => https://www.npmjs.com/package/fancy-log
gutil.template => https://www.npmjs.com/package/lodash.template
gutil.env => https://www.npmjs.com/package/minimist
gutil.beep => https://www.npmjs.com/package/beeper
gutil.noop => https://www.npmjs.com/package/through2
gutil.isStream => Use the .isStream() method on Vinyl objects
gutil.isBuffer => Use the .isBuffer() method on Vinyl objects
gutil.isNull => Use the .isNull() method on Vinyl objects
gutil.linefeed => Use the string '\n' in your code
gutil.combine => https://www.npmjs.com/package/multipipe
gutil.buffer => https://www.npmjs.com/package/list-stream
gutil.PluginError => https://www.npmjs.com/package/plugin-error

Using tsconfig

Is it possible to use an existing tsconfig to setup the gulp-tsc? Because with the gulp-tsc options I could not configure moduleResolution or the exclude section.

Thx

Regards

When passing only 'project', the build incorrectly assumes 'target' = ES3

typescript({
        project: "tsconfig.json",
}

Results in:

--module commonjs --target ES3 --project tsconfig.json

Expected:

--project tsconfig.json

Workaround:

typescript({
        project: "tsconfig.json",
        target: "ES5",
}

Results in:

--module commonjs --target ES5 --project tsconfig.json

It messes up my code as tsconfig.json can define another module and target, and I don't want to duplicate the options.

Failed to compile TypeScript: Error: tsc command has exited with code:2

Hello, how fix this?

image

gulpfile.js

const gulp = require('gulp');
const nodemon = require('gulp-nodemon');
const ts = require('gulp-tsc');

//-------------------------------------

gulp.task('start', ()=> {
  nodemon({
    script: 'index.js'
  , ext: 'js html'
  , env: { 'NODE_ENV': 'development' }
  })
});
//-------------------------------------
//gulp.watch('client/src/**/*.ts',['script']);
//-------------------------------------
gulp.task('script', ()=>{
    gulp.src('client/src/**/*.ts')
    .pipe(ts({
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "lib": [ "es2015", "dom" ],
        "noImplicitAny": false,
        "suppressImplicitAnyIndexErrors": true,
        "emitError": false
    }));
});
//-------------------------------------
gulp.task('default',['start','script']);

Problem with '&' character.

Hello,

I have a problem with '&' character in project folder path. How can I fix it ?

Thanks !

 Failed to compile TypeScript: Error: Command failed: /bin/sh -c /usr/local/bin/node      /Volumes/DataHD/R&D/Personnel/JJ/Developpement/project/node_modules/typescript/bin/tsc -v
 /bin/sh: D/Personnel/Jobware/Developpement/project/node_modules/typescript/bin/tsc: No such file or      directory
 module.js:338
     throw err;
           ^
 Error: Cannot find module '/Volumes/DataHD/R'

Redirect users to gulp-typescript in the README

It does say "up to 1.6.3" near the bottom but preferably you would just redirect folks doing new development to gulp-typescript at the top -- assuming continuing development for this module is terminating.

Blacklisted, duplicate of gulp-typescript

This plugin has been blacklisted in the official gulp plugins repository, with the reason operates directly on file paths. does too much. Besides that, it looks like similar behavior can be achieved with gulp-typescript (which uses the TypeScript compiler api instead of the tsc command). Following the gulp guidelines, can you instead of creating & maintaining your own plugin, consolidate your work into gulp-typescript? Are there features missing in gulp-typescript that are present in gulp-tsc? If so, we can take a look at how these can be implemented in gulp-typescript.

option project

When using it, I get [tsc] > error TS5042: Option 'project' cannot be mixed with source files on a command line..
If I don't pass anything to gulp.src gulp will error, if I do, tsc will error.

Unable to install gulp-tsc

Hi, I tried to install gulp-tsc into my environment, and it faild with typescript dependecy anyway as you can see on my terminal output I have installed [email protected] before trying to install gulp-tsc

root@nas:/srv/dev-disk-by-label-SGBarracuda/node/mypvrworker# npm install -g typescript
/opt/node/bin/tsc -> /opt/node/lib/node_modules/typescript/bin/tsc
/opt/node/bin/tsserver -> /opt/node/lib/node_modules/typescript/bin/tsserver
/opt/node/lib
└── [email protected]

root@nas:/srv/dev-disk-by-label-SGBarracuda/node/mypvrworker# npm install -g gulp-tsc
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
/opt/node/lib
├── [email protected]
└── UNMET PEER DEPENDENCY typescript@>=1.0.1 || 2.x


root@nas:/srv/dev-disk-by-label-SGBarracuda/node/mypvrworker# node -v
v6.11.2
root@nas:/srv/dev-disk-by-label-SGBarracuda/node/mypvrworker# npm -v
3.10.10
root@nas:/srv/dev-disk-by-label-SGBarracuda/node/mypvrworker#

Getting errors even though it compiles

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/app.ts(2,5): error TS2304: Cannot find name 'angular'.

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/app.ts(18,5): error TS2304: Cannot find name 'angular'.

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/app.ts(19,17): error TS2339: Property '$inject' does not exist on type '($routeProvider: any, $mdThemeingProvider: any) => void'.

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/app.ts(21,42): error TS2503: Cannot find namespace 'ng'.

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/app.ts(22,30): error TS2503: Cannot find namespace 'ng'.

[16:09:14] [tsc] > C:/Sandbox/Master-Template/src/app/home/homeCtrl.ts(15,5): error TS2304: Cannot find name 'angular'.

[16:09:14] Failed to compile TypeScript: Error: tsc command has exited with code:2

[16:09:14] Plumber found unhandled error:

Error in plugin 'gulp-tsc'

All these errors yet it works fine. I also have emitError set to true in the options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.