Skip to content

Add assets/src-directories to .gitattributes-files for each component #601

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

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

daFish
Copy link
Contributor

@daFish daFish commented Dec 8, 2022

Q A
Bug fix? no
New feature? yes/no
Tickets Fix #597 (mentioned)
License MIT

This change prevents the export of the source files from assets when installing a component.

@daFish daFish marked this pull request as ready for review December 8, 2022 18:15
@1ed
Copy link
Contributor

1ed commented Dec 9, 2022

If we do this please add types to dist. Currently I do this to have proper types:

import type Component from "@symfony/ux-live-component/src/Component"

@weaverryan
Copy link
Member

Good call @1ed - I've got a PR locally to do this. I'm currently exporting only the controller.d.ts file (or whatever it is called in each library), as I'm thinking I want to avoid making the entire API available as types. But, perhaps that's silly for me to think about. If we do only export controller.d.ts, then, for your example, we would need to make sure that live_controller.ts exports all the "public" items.

@1ed
Copy link
Contributor

1ed commented Dec 10, 2022

Thanks, it sounds great. Export only the minimal public API, like public controller properties and functions and event arguments are enough, I think, and later we can add more if needed.

@daFish
Copy link
Contributor Author

daFish commented Dec 12, 2022

I also like this idea. Would you want to add your local changes to this branch, @weaverryan? Otherwise a seperate PR would be better to have a clear scope.

@weaverryan
Copy link
Member

I'll open a separate PR - hopefully today if my schedule stay's together :)

weaverryan added a commit that referenced this pull request Dec 15, 2022
This PR was merged into the 2.x branch.

Discussion
----------

Outputting Typescript types

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Tickets       | Helps with #601
| License       | MIT

Hi!

This outputs proper TypeScript type files. As a bonus, I found the bug in our build system that was making `yarn build` WAY too slow. The GH action that checks for out-of-date build files is now reactivated ⭐

I decided to output all `.d.ts` files, even for modules that are considered "internal". I thought about only exporting types from the "main" file... but libraries like Stimulus seem to export everything. Mostly, I'd like to follow whatever is "most normal".

Cheers!

Commits
-------

715c289 Fixing TypeScript build system and making it output types
@weaverryan weaverryan force-pushed the feat/gitattributes-support branch from 5396e3f to 807e0ea Compare December 15, 2022 18:51
@weaverryan
Copy link
Member

Thank you Marcus!

@weaverryan weaverryan merged commit 8e3c70c into symfony:2.x Dec 15, 2022
@daFish daFish deleted the feat/gitattributes-support branch December 16, 2022 07:05
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.

[ux-turbo] Multiple typescript errors after upgrade to 6.2
3 participants