RiotTS icon indicating copy to clipboard operation
RiotTS copied to clipboard

No npm ?

Open howesteve opened this issue 9 years ago • 14 comments

Hello,

I wonder why this nice package isn't published on npm ? It surely is more standard then bower nowadays. Anyway, it wouldn't hurt.

Thanks, Howe

howesteve avatar Apr 22 '16 22:04 howesteve

agree 100%, I am just waiting for Typescript 2.0 because UMD Module Loaders will make it more easy to publish a package as a module or in the global namespace (without manually writing definition files).

nippur72 avatar Apr 23 '16 10:04 nippur72

Typescript 2.0 just came out. See: https://blogs.msdn.microsoft.com/typescript/2016/09/22/announcing-typescript-2-0/

Will RiotTS be published as a npm package in the near future?

tromantic avatar Sep 22 '16 17:09 tromantic

@pcssi See riot-typescript. /cc @howesteve

sandrokeil avatar Oct 02 '16 20:10 sandrokeil

@sandrokeil Thank you!

tromantic avatar Oct 03 '16 14:10 tromantic

@pcssi You're welcome. Have you used the npm version? I've some problems see #36 I'm not sure how to use it correclty. Have you tried the Timer example or can you give me a hint?

sandrokeil avatar Oct 03 '16 17:10 sandrokeil

I'm trying to make a npm package out of RiotTS right now but there are several issue because it seems that there is no easy way to publish a library as a module and as a script at the same time. I'm experimenting with UMD modules...

nippur72 avatar Oct 03 '16 17:10 nippur72

@nippur72 Thanks for the info and your work! :+1:

sandrokeil avatar Oct 03 '16 18:10 sandrokeil

I've migrated the whole package to npm and TypeScript 2.0, please check the documentation again as there are some small breaking changes. I did my best to make it work in both scenarios (global and module) but I'm not sure of the result. Suggestions are welcome.

nippur72 avatar Oct 04 '16 13:10 nippur72

@nippur72 Thank you very much for your work. :+1: Hope I can try it soon. Is it possible to avoid the any type, because otherwise you must use "noImplicitAny": false. But I don't know, if it's really needed to avoid any.

sandrokeil avatar Oct 04 '16 15:10 sandrokeil

@sandrokeil what do you mean with avoiding the any type?

nippur72 avatar Oct 04 '16 16:10 nippur72

@nippur72 If you use "noImplicitAny": true the error occurs: error TS7006: Parameter 'opts' implicitly has an 'any' type.. I've this config from the webpack/react tutorial.

noImplicitAny: true = Raise error on expressions and declarations with an implied ‘any’ type.

sandrokeil avatar Oct 04 '16 20:10 sandrokeil

@sandrokeil that's quite correct, you are telling typescript that you don't allow implicit any types, so you can't write:

constructor(opts) { }

you have to make it explicit, e.g.:

constructor(opts: any) { }

or better:

interface HelloTagOpts {
   greet: string;
}
class HelloTag extends Riot.Tag {
   constructor(opts: HelloTagOpts) { }
}

nippur72 avatar Oct 05 '16 07:10 nippur72

btw, forgot to tell I've updated also the helloworld examples, you might want to check example-global and example-module.

nippur72 avatar Oct 05 '16 07:10 nippur72

update: I've fixed some any signatures, so please use the latest 1.0.10

nippur72 avatar Oct 05 '16 08:10 nippur72