Giter Club home page Giter Club logo

generator-node-typescript's People

Contributors

adstep avatar artokai avatar calidion avatar chilijung avatar dkelosky avatar erikelkins avatar garyb432 avatar hypescript avatar kamranasif avatar miloss avatar ospatil avatar valtersantosmatos avatar vladdu avatar yangdonglai 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

generator-node-typescript's Issues

use mocha nyc instead of jest

jest is not mature and tend to get rid of debug info which will make it very hard for debugging and maintenance

Currently we are struggling for debug info get killed by jest.

watch:test not running tests on file change

I just refreshed my generator and watch:test is hanging.

  • npm run watch:test
  • see 2 tests passed
  • change and save greeter-spec.ts to ... new Greeter("tester");
  • no change in test window
  • press CTRL+c in test window
  • coverage stuff shows in test window
  • press CTRL+c in test window again
  • back to command prompt

this is one of my favorite generators!

VS Code Debug

Thank you for this generator. Do you use VS Code to debug? Mind sharing your .vscode files?

Test script regex

Hi,

I've generated a project lately and experienced some issues when running the package.json test script. I had to add single quotes ' around the regex in order to make mocha work and dive recursively into deeper directories:

"test": "npm run build && mocha --compilers ts:ts-node/register --recursive 'src/**/*.spec.ts'"

So, basically src/**/*.spec.ts becomes 'src/**/*.spec.ts'.

Just saying in case anybody experiences this too!

Jasmine Tests in Typescript

Is it possible to write the jasmine tests in typescript as well? Currently, only a javascript sample is given?

Change output directory from lib to dist

It bugs me that output directory is called lib when I'm not building a library.
lib stand for library
dist stand for distribution
I'm ready to PR if you're sharing my thoughts. I need #39 to be done first though.

npm `prepublish` is deprecated in npm 5

Seeing this in the console, can replace with prepare instead I think. Thanks!

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

Add .npmignore

A .npmignore file would remove unnecessary files from npm:

src/
__test__/

And some other ones too :)

Install via yarn?

After generating all the files, use yarn for installing dependencies, instead of npm.
If no yarn found, let's fallback to npm.

Node Definitions

Hey, the command for the node def changed.
From typings install node --ambient --save to typings install dt~node --global --save

Running nyc command results in empty line coverage

I am running
nyc --reporter=text --reporter=html node_modules/.bin/_mocha --compilers ts:ts-node/register
and the result is

------------|----------|----------|----------|----------|----------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
------------|----------|----------|----------|----------|----------------|
All files   |        0 |      100 |        0 |        0 |                |
 greeter.js |        0 |      100 |        0 |        0 |2,3,5,7,8,10,12 |
 index.js   |        0 |      100 |      100 |        0 |          2,3,4 |
------------|----------|----------|----------|----------|----------------|

thoughts?

RunKit fails trying to run this package...

Your package looks very useful. I especially like that you claim to be integrated into VS Code.

There is a link on your NPM page that takes me to RunKit. When I then try to run the sample code in RunKit, it throws an exception stating it can't find the module.

Invokes wrong 'tsc' on windows with multiple tsc versions

On my windows, i have several TypeScript installations manually or automatically(by Visual Studio) installed. I have also installed nodejs global module 'tsc' (typescript).

Problem is when you have tsc.exe in "c:\Program Files (x86)\Microsoft SDKs\TypeScript\1.5\tsc.exe" together with nodejs global module 'tsc' your gulp task _build will invoke tsc.exe (from program files) not nodejs version 'tsc'.

For fix, change: exec('tsc') to exec('tsc.cmd') within file gulpfile.js.

Travis and Coveralls / Codecov

Hi there,
First of all really nice module.

This is not a real issue, I just recently used this generator to kickstart a small node module and I quickly added a Travis config and Coveralls to it. If you think that it is a good ideia I will be happy to make a PR with the changes, let me know which code coverage tool you would like to add (Coveralls/Codecov/etc...).

Ty

Readme `Jasmine` typo

In readme.md it says:

test   Runs the Jasmine test specs [build]

But it is not actually Jasmine, it is mocha, isn't it.

Importing the generated node-typescript module

Hello,

I am trying to import the module built by the "gulp build" command but it fails.
My Typescript version is 1.8.10.

This is what I have done :

  1. Create the module :
    mkdir my-new-project \
    && cd $_ \
    && yo node-typescript \
    && gulp build \
    && cd ..
  2. Create the project that will use the module :
    mkdir my-requiring-project \
    && cd $_ \
    && mkdir node_modules \
    && cp -r ../my-new-project ./node_modules \
    && echo "import MyNewProject = require('my-new-project')" >> index.ts
  3. Compile the project :
    tsc index.ts

This is the error :
index.ts(1,31): error TS2656: Exported external package typings file '~/dev/nodejs/projects/my-requiring-project/node_modules/my-new-project/lib/my-new-project.d.ts' is not a module. Please contact the package author to update the package definition.

Could you help me to find a way to import the created module into a new project? Any help would be greatly appreciated.

Intellisense does not work correctly in VS Code for TypeScript 2.0

When external typings are installed using npm i @types/xxx --save , the intellisense in Visual Studio Code does not find the declaration files and therefore intellisense does not work correctly.

This can be fixed by creating a new file .vscode/settings.json and specifying the setting typescript.tsdk with the value node_modules/typescript/lib/.

It would be nice if this settings file and the required setting would be generated automatically by the yeoman generator.

Contents of the .vscode/settings.json should be:

{
    "typescript.tsdk": "node_modules/typescript/lib/"
}

See microsoft/vscode#9972 for more information.

Debug TypeScript test files - no breakpoints hit (win 10, ts 2.4.2, node 8.2.1, vs code latest)

First off - awesome generator, thanks for all of your efforts.
Everything works perfectly, except the ability to debug the test file(s).

Here is what I saw when I launch test 'Debug test' with the greeter-spec.ts file open in the editor:

Cannot launch program 'd:\VSTS-DevOps\genSample\node_modules\.bin\jest'; setting the 'outDir' or 'outFiles' attribute might help.

So after several iterations & looking around at similar issues, this is the launch.json section that's working for me:

 {
      "type": "node",
      "request": "launch",
      "name": "Debug test-v4 works-single-selected file",
      "runtimeArgs": [
        "--inspect-brk",
        "${workspaceRoot}/node_modules/jest/bin/jest.js",
        "--findRelatedTests",
        "${relativeFile}",
        "--env",
        "jest-environment-node-debug",
        "--runInBand"
      ],
      "console": "integratedTerminal"
    }

I tried various combinations of program = .../.bin/jest.cmd, .../jest/bin/jest.js yada yada- but did not hit on anything until the runtimeArgs vs program & args options setup.

Interested in your take, or if anyone else ran into something similar...

working env: Windows 10, TS 2.4.2, node 8.2.1, vs code latest.

Suggestion: Use prepublishOnly instead of prepare for running build script?

As per the npm docs, prepare runs both after install and before npm publish. I personally can't think of any situations I'd want to build the module after each install, but if that's intentional then that's cool, it's not much effort when generating a new project to change. However, if this is not the intended behavior then it would be nice to have the default be to use the prepublishOnly npm script instead to only run builds before npm publish, and not after installs.

test task fails to find specs

I just ran the standard you generator with all defaults. when I run the test task in vs code it does not find any tests

Using TypeScript
Version 2.2.1
Warning: Could not find any test files matching pattern: 'test/**/*-spec.ts'
No test files found

I just tool the "'" out of npm run build && mocha --compilers ts:ts-node/register --recursive test/**/*-spec.ts lline and it works.

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.