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

Gulp task to create declaration file #27

Merged
merged 3 commits into from
Mar 15, 2016

Conversation

Ledragon
Copy link
Contributor

A new gulp task was created to allow for the generation of a bundled declaration file output in the bundles folder.

Also, some (apparently) missing packages were added to the package.json file.

@Ledragon Ledragon mentioned this pull request Mar 12, 2016

return merge(streams);
});

gulp.task('declarations', () => {
var project = ts.createProject('tsconfig.json', { outFile: 'angular2-polyfill.js' });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const project

@SamVerschueren
Copy link
Owner

Nice! I think this is what I am looking for! Have to reconfirm tomorrow but looks promising. Just added a few remarks.

Also, some (apparently) missing packages were added to the package.json file.

Good catch, something went wrong with my latest push :)

@Ledragon
Copy link
Contributor Author

I made the corrections according to your comments. Would you like a linter to be added? If so, which one (jslint/eslint)? What about TypeScript linting? Maybe those questions should be adressed in another issue...

@SamVerschueren
Copy link
Owner

Just tested the type definition. It works but the module names should be prefixed with angular2-polyfill. This was an issue I had with systemjs as well and not sure how I can resolve this easily, so feedback is more then welcome.

Angular2 actually has one repository for all the angular core stuff if I'm not mistaken. (angular2, angular2-dart). Every project has it's own package.json file and at the root of the angular repository there is also a package.json. The root package contains all the dependencies regarding building and gulpfile stuff. The angular package.json files contain only the dependencies necessary for that piece. This makes it possible to actually build my bundle without copying everything to a subdirectory and would make generating a bundle d.ts file a lot easier as well.

package.json
gulpfile.js
angular2-polyfill
    - core.ts
    - router.ts
    - src
        ...

When releasing, the angular2-polyfill directory should be published to npm and not the root. @Ledragon any experience with this? Does it looks reasonable?

@Ledragon
Copy link
Contributor Author

@SamVerschueren That would solve the problem of relative paths at least, and it would make sense to only deploy the angular2-polyfill directory. I don't really have any experience about it, but it sounds ok. Plus, if the angular team does it, why not? :p
I researched, but could not find a better way of doing it as of now.

SamVerschueren added a commit that referenced this pull request Mar 15, 2016
Gulp task to create declaration file
@SamVerschueren SamVerschueren merged commit cc2ecaa into SamVerschueren:master Mar 15, 2016
@SamVerschueren
Copy link
Owner

Might have to revert the merge. Can't seem to figure out how I can prefix the modules with angular2-polyfill. It always compiles to core instead of angular2-polyfill/core.

@SamVerschueren
Copy link
Owner

@Ledragon I created a separate branch with a refactored code structure called typedefs. I managed to get things working regarding the bundling but the type definitions were still not correct. Can't seem to figure out how I have to configure them properly. Care to take a look?

@Ledragon
Copy link
Contributor Author

Ok, just got to merge your updated project in my fork (not exactly a GitHub expert), then I'm on it!

@SamVerschueren
Copy link
Owner

Thanks for looking into this! Really appreciate it.

This might help: https://help.github.com/articles/syncing-a-fork/

@Ledragon
Copy link
Contributor Author

Yep, managed to get it with the new branch. Time to start on the actual stuff!

@Ledragon
Copy link
Contributor Author

Man... That was hot! I will submit a new pull request on the branch with something that works (hopefully) as expected.

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.

2 participants