ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

update release and publish type bindings #17

Closed mitchcapper closed 7 years ago

mitchcapper commented 7 years ago

Would be great if you could update the node npm package and publish an @types/skype-http package as well.

I tried doing things like:

"dependencies": {
        "skype-http": "git+https://github.com/ocilo/skype-http",

and then:

import { Api as SkypeApi } from "./node_modules/skype-http/src/lib/api";
import * as skypeHttp from "./node_modules/skype-http/src/lib/connect";
import * as events from "./node_modules/skype-http/src/lib/interfaces/api/events";

however ts-node doesn't support import so that fails (for the sub modules).

Could not get typings to install from repo using something like: typings install --save github:ocilo/skype-http

These work:

npm install --save skype-http
typings install --save npm:skype-http

but are out of date I would assume.

demurgos commented 7 years ago

I released the version 0.0.11 (current master) to npm. It defines a types entry in its package.json so Typescript should detect the type definitions automatically. Could you check if it works?

I started to move away from typings in favor of @types but I am not quite done.

mitchcapper commented 7 years ago

neither using ts-node, VS 2017, nor tsc seem to be able to automatically pickup the bindings:

tsc -p .

2 import * as skypeHttp from "skype-http";
                             ~~~~~~~~~~~~

test.ts(2,28): error TS7016: Could not find a declaration file for module 'skype-http'. 'C:/temp/skytest/node_modules/skype-http/dist/lib-es2015/lib/skype-http.js' implicitly has an 'any' type.
C:\temp\skytest>ts-node test.ts
npm\node_modules\ts-node\src\index.ts:312
        throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
              ^
TSError: ⨯ Unable to compile TypeScript
test.ts (2,28): Could not find a declaration file for module 'skype-http'. 'C:/temp/skytest/node_modules/skype-http/dist/lib-es2015/lib/skype-http.js' implicitly has an 'any' type. (7016)
7016)

Granted those are with "noImplicitAny": true, but generally if it can't get the type then you are not going to get the auto complete / typings / etc support (which VS confirms).

demurgos commented 7 years ago

I just publshed the version 0.0.12. It fixes an issue with the type declarations and removes the dependency on typings (everything is installed from @types). I was able to use this version in an other project without any issues. Could you check if this works now ?

mitchcapper commented 7 years ago

working well:)