Closed AlbertZheng closed 4 years ago
Hello @AlbertZheng. Thanks for you work! This seems like a nice and awaited enhancement. I want to merge your PR but it seems that when updating to Babel 6 you broke the test command requiring babel's register hook. Can you fix it so I can merge please?
If you don't know how, just tell me & I'll merge then fix the issue plus one another concerning ES6 exports and backward compatibility with CommonJS.
but it seems that when updating to Babel 6 you broke the test command requiring babel's register hook. Can you fix it so I can merge please?
If you don't know how, just tell me & I'll merge then fix the issue plus one another concerning ES6 exports and backward compatibility with CommonJS.
@Yomguithereal Sorry, I checked the CI errors, but I amn't familiar with babel hook. Could you please merge the PR then fix this issue? Thanks in advance.
Update the README.md for TypeScript usage.
@Yomguithereal I added a new commit for updating the README.md
for TypeScript usage.
Thanks @AlbertZheng. I'll need to find some time to merge the PR and publish a release however. It should be done soon, don't worry.
Also, don't you need to indicate the typings
in the package.json file?
Also, don't you need to indicate the typings in the package.json file?
It doesn't need the typings
indication in the package.json
of Baobab user's project, and also doesn't need an individual typings.json
in user's project. Just npm install baobab
like before, then the compiler of TypeScript will search the node_modules/baobab
and find out the index.d.ts
according to the indication of "main": "./index.js"
in the package.json
of Baobab package.
BTW, the typings has been deprecated by the newest TypeScript 2.x, instead using such as npm install @types/react
which will install the TypeScript Definitely Typed File into node_modules/@types/react
if this package doesn't distribute the official .d.ts files together with its npm publication.
Not forgetting you. Just trying to find someone knowledgeable in TypeScript to help me review the code.
@Yomguithereal I had added a section to describe the TypeScript usage in README.md of this PR commit.
The first step for using this TypeScript supporting PR is to use node
module resolution option in the TypeScript compiler config file tsconfig.json
of user's project, and most users are using this option.
- Checking the
tsconfig.json
of your TypeScript project, and make sure thecompilerOptions
is usingnode
module resolution."compilerOptions": { ... "moduleResolution": "node", ... }
Hi,
I am not a TypeScript user, but I did some changes so that :
babel-register
, since there is no more monorepo babel
monkey
in import Baobab, {monkey} from '../../src/baobab'
from test/suites/baobab.js
was undefined since importing/exporting changed its wayIt is available in this commit. You can either update this PR or push one I create
Sorry everyone for lagging on this PR. But the upside is the lib now has type declaration (some years later) :)
In order to support TypeScript, I changed below. Please review.
index.d.ts
.index.js
for working in withindex.d.ts
package.json
correspondingly.BTW, I fixed a bug in
watcher.js
which emitted a event without carrying the event object.