These are chat archives for TypeStrong/atom-typescript

20th
Apr 2015
Basarat Ali Syed
@basarat
Apr 20 2015 09:32
Mike Graham
@cmichaelgraham
Apr 20 2015 13:28
Greetings :) I would like to learn more about dts-generator integration
Matt Traynham
@mtraynham
Apr 20 2015 16:18
What do you want to know, I've been using it pretty heavily
Vitalii Daniuk
@vdaniuk
Apr 20 2015 16:41
@basarat got it, thx
Mike Graham
@cmichaelgraham
Apr 20 2015 16:44
@mtraynham i'm trying to port the aurelia repos to typescript and then automatically generate the .d.ts files
i'm on windows
each repo has an index.ts that exports the public interface for the repo
i've had great success using atom-typescript and dts-generator separately
just not sure how to combine them
or the best way to organize a series of repos like that
i broke them up into rings to manage the inter-dependencies
here is the work so far
these are generated by dts-generator
Matt Traynham
@mtraynham
Apr 20 2015 16:49
What do you mean by "combine them"?
As an example of the way I do things:
Mike Graham
@cmichaelgraham
Apr 20 2015 16:50
oh, atom-typescript and dts-generator, right now i have a folder with all of the repos under it. its all together.
listening... :)
Matt Traynham
@mtraynham
Apr 20 2015 16:50
well I think those are pretty distinct... but here's what I do with multiple projects
when I distribute a project, I attach my d.ts dependencies as part of the bower file
tsd can fix the references for you doing it this way
so when you distribute a project, you distribute not only the bundled javascript, but also the type definition
Mike Graham
@cmichaelgraham
Apr 20 2015 16:53
that's cool
Matt Traynham
@mtraynham
Apr 20 2015 16:53
when you pull in a project using tsd link will automatically link the references for you from the bower dependency
is this kind of answering your question?
Mike Graham
@cmichaelgraham
Apr 20 2015 16:54
so my original question was based on this comment
but what you are describing is of great interest
Matt Traynham
@mtraynham
Apr 20 2015 16:55
ahh I see, my guess is you are concerned with atom-typescript doing the first part for you... I thought you were curious about how to handle them after they have been created (i.e. referencing from other projects)
Mike Graham
@cmichaelgraham
Apr 20 2015 16:56
actually all of that :)
the aurelia repos are independent parts, so what you describe is an import part of the use case
Matt Traynham
@mtraynham
Apr 20 2015 16:57
yeah tsd does all that stuff :)
although, they havn't released in a while so it's on their tsd@next branch
actually what @basarat is describing in Microsoft/TypeScript#2829 looks similar
almost exactly similar
it looks like the tsconfig will handle that part for you if you specify where the package.json file is: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#package
Mike Graham
@cmichaelgraham
Apr 20 2015 17:02
it is going to take me a little while to digest that ;)
Matt Traynham
@mtraynham
Apr 20 2015 17:03
well so, my guess is
update your tsconfig.json file with a pointer to your package.json
Mike Graham
@cmichaelgraham
Apr 20 2015 17:04
so would i open up atom for each repo? or open up a folder that has all the repos?
Matt Traynham
@mtraynham
Apr 20 2015 17:04
my assumption is, atom-typescript will use the files from tsconfig.json and generate a bundle .d.ts file for you
Mike Graham
@cmichaelgraham
Apr 20 2015 17:04
gotcha
Matt Traynham
@mtraynham
Apr 20 2015 17:05
right, it'd be for each repo
Mike Graham
@cmichaelgraham
Apr 20 2015 17:05
so maybe a tsconfig in each repo?
Matt Traynham
@mtraynham
Apr 20 2015 17:05
or every instance of tsconfig
Mike Graham
@cmichaelgraham
Apr 20 2015 17:05
but can i open it at the top?
and how do i make sure it builds in the right order?
Matt Traynham
@mtraynham
Apr 20 2015 17:05
well, I'm thinking you should have a single tsconfig.json for every package.json
that's the way I do it
Mike Graham
@cmichaelgraham
Apr 20 2015 17:06
makes sense
i think i'd have a tsconfig.json and package.json for each repo
but there are 20 repos
i'm hoping i can open them all up somehow
vs visiting each one
Matt Traynham
@mtraynham
Apr 20 2015 17:08
mmm, copy-paste a tsconfig.json
are you trying to get all 20 repos to create a .d.ts dts-generator file?
Mike Graham
@cmichaelgraham
Apr 20 2015 17:08
i don't mind creating them manually
i think one .d.ts per repo
Matt Traynham
@mtraynham
Apr 20 2015 17:09
right, that's what I mean, you're trying to get all 20 to have their own generated
Mike Graham
@cmichaelgraham
Apr 20 2015 17:09
yeah, exactly :)
Matt Traynham
@mtraynham
Apr 20 2015 17:09
what are you using as a build system, if one at all?
grunt/gulp?
Mike Graham
@cmichaelgraham
Apr 20 2015 17:10
gulp
Matt Traynham
@mtraynham
Apr 20 2015 17:11
might be easier to just add a build step honestly
Mike Graham
@cmichaelgraham
Apr 20 2015 17:11
gotcha
Matt Traynham
@mtraynham
Apr 20 2015 17:11
instead of atom doing it for you
Mike Graham
@cmichaelgraham
Apr 20 2015 17:11
i used node to run this
for the dts-generator part
pretty cool, imho :)
Matt Traynham
@mtraynham
Apr 20 2015 17:12
that is pretty cool
Mike Graham
@cmichaelgraham
Apr 20 2015 17:13
it has a couple of issues still. one is that on windows, it puts \ sometimes where it should be /
Matt Traynham
@mtraynham
Apr 20 2015 17:13
yeah, I think the atom-typescript dts-generator stuff is a nice to have, but doing the .d.ts reference in your package.json is not only good for atom-ts, but also tsd if you want to link outside of atom
Mike Graham
@cmichaelgraham
Apr 20 2015 17:13
another is that if there is a compile error it silently excludes the file
that took awhile to figure out, but now i'm onto its little game :)
Matt Traynham
@mtraynham
Apr 20 2015 17:14
haha
so did I answer your question, I feel like I didn't fully...
Mike Graham
@cmichaelgraham
Apr 20 2015 17:14
you gave me some great ideas
once i have the .d.ts for each repo, i need to figure out the distribution model
which is what you were describing
i captured the links and ideas
Matt Traynham
@mtraynham
Apr 20 2015 17:15
right, it's nice that I think @basarat was concluding with the same thing by putting the reference in the package.json file :)
Mike Graham
@cmichaelgraham
Apr 20 2015 17:15
i think for now, i can make sure the repos build in atom-typescript
then run that node process
this real-time collaborative development is still new to me, but i'm amazed how fast it moves