Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turned on type script definitions #206

Merged
merged 2 commits into from
Sep 3, 2017
Merged

Conversation

dolanmiu
Copy link
Contributor

You guys are using Typescript already, so you just need to turn it on and allow it to be published

If this does not work, then I will think of other solutions :)

@chenguoguo
Copy link
Collaborator

Awesome! We will take a look!

@chenguoguo
Copy link
Collaborator

I'm trying this on my Mac and I got the following error, ideas?

npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/guoguo/.nvm/versions/node/v4.0.0/bin/node" "/Users/guoguo/.nvm/versions/node/v4.0.0/bin/npm" "install"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] prepublish: `tsc --listFiles`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepublish script 'tsc --listFiles'.
npm ERR! This is most likely a problem with the snowboy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc --listFiles
npm ERR! You can get their info via:
npm ERR!     npm owner ls snowboy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/guoguo/snowboy-release/npm-debug.log

@dolanmiu
Copy link
Contributor Author

dolanmiu commented Jun 1, 2017

Is there more logs? That log doesn't explain anything apart from:

tsc --listFiles is bad

@chenguoguo
Copy link
Collaborator

chenguoguo commented Jun 1, 2017

Here was the log before the error (I was simply doing npm install under the root directory):

> [email protected] preinstall /Users/guoguo/snowboy-release
> npm install node-pre-gyp

[email protected] node_modules/node-pre-gyp
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
npm WARN engine [email protected]: wanted: {"node":">=4.2.0"} (current: {"node":"4.0.0","npm":"2.14.2"})
\
> [email protected] install /Users/guoguo/snowboy-release
> node-pre-gyp install --fallback-to-build

[snowboy] Success: "/Users/guoguo/snowboy-release/lib/node/binding/Release/node-v46-darwin-x64/snowboy.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] prepublish /Users/guoguo/snowboy-release
> tsc --listFiles

lib/node/index.ts(55,14): error TS4073: Parameter 'model' of public method from exported class has or is using private name 'HotwordModel'.
lib/node/index.ts(100,63): error TS4019: Implements clause of exported class 'SnowboyDetect' has or is using private name 'SnowboyDetectInterface'.
lib/node/index.ts(104,24): error TS4063: Parameter 'options' of constructor from exported class has or is using private name 'DetectorOptions'.
/Users/guoguo/snowboy-release/node_modules/typescript/lib/lib.es6.d.ts
/Users/guoguo/snowboy-release/lib/node/index.ts
/Users/guoguo/snowboy-release/lib/node/node-pre-gyp.d.ts
/Users/guoguo/snowboy-release/lib/node/SnowboyDetectNative.d.ts
/Users/guoguo/snowboy-release/node_modules/@types/node/index.d.ts

@dolanmiu
Copy link
Contributor Author

dolanmiu commented Jun 1, 2017

And there is no error on the master branch?

Damn, I have no idea then :(

@chenguoguo
Copy link
Collaborator

Correct, the master branch is able to build...

Were you able to reproduce the error on your side?

@dolanmiu
Copy link
Contributor Author

dolanmiu commented Jun 1, 2017

Ok, I am able to reproduce it, and found a solution here:

microsoft/TypeScript#6307

To fix, HotwordModel, SnowboyDetectInterface and DetectorOptions need to be exported

@Pajn
Copy link

Pajn commented Jul 16, 2017

Yeah, just add an export keyword for them. You need for TypeScript users to be able to import them otherwise the compiler have no possibility to know what the type names refer to.

@chenguoguo
Copy link
Collaborator

@dolanmiu is exporting it enough? if yes could you update this pull request?

@dolanmiu
Copy link
Contributor Author

dolanmiu commented Aug 29, 2017

I have not updated it to export yet, I can do that in a sec

@dolanmiu
Copy link
Contributor Author

dolanmiu commented Aug 29, 2017

Done, can you check?

I ran npm run prepublish, and it gave no errors

@chenguoguo
Copy link
Collaborator

Merging it, thanks!

@chenguoguo chenguoguo merged commit e3456da into Kitt-AI:master Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants