Git Product home page Git Product logo

ntypescript's People

Contributors

basarat avatar guncha avatar mkusher avatar

Stargazers

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

Watchers

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

ntypescript's Issues

Make it easier to hack on the npm import

I often need to work locally on ntypescript inside another project. Currently you need to work on the generated .js which is slow and messy and a bit out of context

Always shows the message like this:

Using [email protected]. This version may or may not be compatible with ts-loader.

The message always shows when I running my webpack.
Well, I use this compiler because the tsconfig.json is too complicated and I would get the 10082 error message so I chose this compiler, but shows the message above, please show me a way to correct the configurations, thanks.

alwaysStrict support

ntsc seems to be missing the --alwaysStrict flag. Was this intentional or has it not been updated yet?

What is the update frequency of the package?

@basarat Hello, thanks for the great package!

I have one question. The latest build was 6 days ago. I thought the idea was to publish 'nightly' builds periodically using Travis or something like that. Something is broken?

compiler don't insert tsx compilation result to project common build out file.

@basarat Hello, thanks for the great package! It's very convinient tool!

I have issue which don't face before. I start new ts project on another PC. (install npm, ntypescript, tsd)
added tsx, ts files to project. setted out compiler option. In result of compilation I see that compiled file contains only definitions from *.ts files. but tsx compiled to the same directory as tsx file.
atteched screen https://www.dropbox.com/s/90c3r4a1vjikz4j/ntypescriptIssue.png?dl=0.
Maybe a'm not correct?
Thank you!

No minify output option?

I'm not seeing any option that would make the compiled js code be minified. Is there an option for that that I'm just missing?

es6 promise dublicate identifier

Hello @basarat !
I have question. In my project i use es6-promise library;
i installed d.ts for it.
in tsconfig added es6-promise
and in my main.ts expression

    import {Promise} from "es6-promise";

is available.
But compiler say that 'Promise' contains in es6.lib,
we have conflict between 2 files es6.lib and es6-promise.d.ts.
do you have any idea how to resolve it?
i use latest ntypescript atom-typescript and ts-loader for webpack
Thank you!

minor: README / packacke.json example

see README : "Install"
or in your package.json
npm install ntypescript@latest --save --save-exact

Shouldn't it mention the package.json json member here ?
The npm install could become an extra line.

Just think it might be misleading for newbies...

tsconfig.json exclude disregarded

It seems to totatly ignore the exclude configuration in the tsconfig.json and compiles as well the ignore files.
For instance I have the following configuration:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"node_modules"
]
}

And it still compiles everything in the node_modules folder.
I am running it via node : npm run ntsc -w

Support tsserver

AFAIK there are 3 files that need to be included: tsserver.js, tsserverlibrary.d.ts and tsserverlibrary.js.

For example let's say I want to use a newer TypeScript compiler than the one bundled with Jetbrains:
ntypescript error

I understand that this is listed in your "Design incompatibilities" section of your README.md.

What is your reasoning for excluding it? - File size? - Any chance of convincing you to include it?

tsx file compilation fail on optional properties

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "amd",
    "jsx": "react"
  },
  "compileOnSave": false,
  "files": [
    "./main.tsx",
    "./typings/tsd.d.ts"
  ]
}

tsd:

tsd install react-global react-bootstrap --save 

main.tsx:

import * as React from 'react';
import { render } from 'react-dom';
import { Button } from 'react-bootstrap';

class App extends React.Component<{}, {}> {
  render() {
    return <Button bsSize="large" bsStyle="danger" > {"Button Text"} </Button>;
  }
}

render(<App />, document.getElementsByTagName("entrypoint")[0] );

ntsc 1.201512090606.1 fails with these error messages

main.tsx(8,12): error TS2324: Property 'key' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ButtonProps, any>> & ButtonProps'.
main.tsx(8,12): error TS2324: Property 'ref' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ButtonProps, any>> & ButtonProps'.

The error message says that 'key' and 'props' property must be given, but they are defined as optional on IntrinsicAttributes and IntrinsicClassicAttributes like this.

in react.d.ts, line 2119~2125

    interface IntrinsicAttributes {
        key?: string | number;
    }

    interface IntrinsicClassAttributes<T> {
        ref?: string | ((classInstance: T) => void);
    }

tsc compiles main.tsx without problem.

This bug makes atom-typescript plugin glitchy while writing react apps with typescript.

PropertyKey conflicting definition in lib.d.ts and es6-shim

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "javascript"
  },
  "files": [
    "./typescript/main.ts",
    "./typed/sha.js.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}

main.ts:

/// <reference path="../typings/browser.d.ts"/>

import "angular2/bundles/angular2-polyfills";

import {bootstrap} from "angular2/platform/browser";
import {AppComponent} from "./app.component";
import {ROUTER_PROVIDERS} from "angular2/router";

bootstrap(AppComponent, [ROUTER_PROVIDERS]);

outcome from ntsc:

node_modules/ntypescript/bin/lib.d.ts(1266,14): error TS2300: Duplicate identifier 'PropertyKey'.
typings/browser/ambient/es6-shim/index.d.ts(8,14): error TS2300: Duplicate identifier 'PropertyKey'.

Is es2015 not included?

When I look at TypeScript's ES2015.core.d.ts I see ObjectConstructor's assign. I don't see it in the latest version of Atom's lib.d.ts though and get an error

Definition file compile error

[08:06:22] gulp-notify: [Compile Error] TypeScript error: node_modules/ntypescript/bin/ntypescript.d.ts(6602,13): Error TS2403: Subsequent variable declarations must have the same type. Variable 'global' must be of type 'Global', but here has type 'any'.

--worked around the compile error by removing the declaration of global variable.

version: 1.201508070004.1

Typings for ntypescript?

Trying typescript-book/docs/compiler/parser.md#sample-usage:

import * as ts from "ntypescript";

function printAllChildren(node: ts.Node, depth = 0) {
    console.log(new Array(depth + 1).join('----'),
                ts.syntaxKindToName(node.kind), node.pos, node.end);
    depth++;
    node.getChildren().forEach(c=> printAllChildren(c, depth));
}

var sourceCode = `
var foo = 123;
`.trim();

var sourceFile = ts.createSourceFile('foo.ts', sourceCode, ts.ScriptTarget.ES5, true);
printAllChildren(sourceFile);

Even after running npm install ntypescript@latest --save --save-exact, my IDE (Atom) complains with: Cannot find module 'ntypescript'.

Looking around for a *.d.t.s file, and couldn't find it :. How shall I proceed?

Thanks for all suggestions

Fails to use @types/react

I use ntypescript in webpack, mostly for 3rd party libraries. Recently I have added react to my project and started to get errors for @types/react:

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(171,34): error TS1005: ',' expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(172,34): error TS1005: ',' expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2636,43): error TS1005: ']' expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2636,44): error TS1005: ';' expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2636,45): error TS1128: Declaration or statement expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2636,46): error TS1128: Declaration or statement expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2636,61): error TS1005: '(' expected.

ERROR in /Users/korya/dev/superapp/node_modules/@types/react/index.d.ts
(2695,1): error TS1128: Declaration or statement expected.

The problematic source code lines (causing the first error) are:

    // Base component for plain JS classes
    class Component<P, S> implements ComponentLifecycle<P, S> {
        constructor(props?: P, context?: any);
        setState<K extends keyof S>(f: (prevState: S, props: P) => Pick<S, K>, callback?: () => any): void;
                                  The error points here
        setState<K extends keyof S>(state: Pick<S, K>, callback?: () => any): void;
                                  ... and here
        forceUpdate(callBack?: () => any): void;
        render(): JSX.Element | null;

Is it caused by the fact that the type definition uses some syntax/features introduced in Typescript 2.2? Is there a workaround?

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.