-
Notifications
You must be signed in to change notification settings - Fork 354
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
Generate TypeScript typings from Stone specification for NPM distribution #96
Conversation
Let me know if you require additional modifications, such as the addition of some type of unit tests. Unit testing would best be accomplished by compiling sample code against the generated typings. I have two ideas for this:
|
51a3363
to
fc302aa
Compare
Thanks for putting this together John! |
Let me know if you have any questions or need any help. |
Hey @jvilk. First off, thanks a lot for the thorough work! A few requests when you can find the time. Could you rebase this commit on top of master. I would like to merge this Pull request instead of doing it myself. I tested that things work (using your other example repo). After rebasing, you might want to generate the bindings again to accommodate some routes we added (I can do that myself too; I kept you waiting for a while, so you might have lost context. You did add in the right changes needed to our generator scripts). I would like to move the example repo into this one. I made a change to make the js examples live in a subfolder(examples/js), but started seeing issues when trying to run the ts examples when they live in a subfolder (instead of a separate repo). So I decided to come back to it later. This branch is my attempt to do all of the above, it works in the trivial sense, ie, merges and builds correctly. I'll fix the examples-not-working problem, this PR doesn't have to wait for that. |
fc302aa
to
63bd635
Compare
Just successfully rebased. Going to update specifications, add in examples, and squash commits together next. |
…tion Future publications of the dropbox NPM module will now include TypeScript typings generated using the new TypeScript stone generator. Typings contain TSDoc annotations for better IDE integration. Includes TypeScript versions of each JavaScript SDK example.
63bd635
to
5eab745
Compare
@pran1990 all done! To avoid cluttering up your I had to remove the rewrite rule in the express server, since it rewrote URLs like If the examples ever need to be changed, make sure you run Let me know if you have any trouble with the examples. I encourage you to independently test them in case I missed something important. |
🎉 thanks for merging! |
Future publications of the dropbox NPM module will now include TypeScript typings
generated using the new TypeScript stone generator. Typings contain TSDoc annotations
for better IDE integration.
This PR contains the following changes:
generate_routes.py
to generate TypeScript typings from stone specifications.actAsUser
, constructors, ...).package.json
with a pointer to the TypeScript definition file describing the entry module (src/index.d.ts
).The typings should work for people using Dropbox in a variety of settings:
src/index.d.ts
, which points to files indist
).d.ts
files indist
)dropbox.js
anddropboxteam.js
Fixes #65.
Please see the following Stone pull request for information on how you can test these typings yourself. I have also applied the typings to some SDK example code to verify that they work. :)