-
-
Notifications
You must be signed in to change notification settings - Fork 139
feat(console): add ability to publish vendor files #513
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
Conversation
|
I'm distracted for half an hour and you already have a PR in place??? How cool is that! Lemme give it a look!
Maybe the default should simply be the app/src folder? Since Tempest doesn't really impose a project structure, I figure the project root makes most sense, people can drag it from there to wherever they want. |
I felt inspired 😎
Absolutely! There's no util for me to determine easily whether the user uses Another thing, it seems that the |
27fd101 to
26d409d
Compare
Could be, I'm fine if you want to fix it right within this branch, otherwise we can take it in a separate PR if you don't feel like it. |
|
Merged both :) |
957fe14 to
48a1126
Compare
|
@brendt This is now ready for review 👍 I didn't write tests because the interactive parts of the console that are used in I'll also PR some changes to the migration manager because it forces the creation of the migration table—which makes me wonder if this should be a publishable class, or not (but we should discuss that in the other PR) |
|
Am I right in understanding we'd have no way to publish views, static assets (js, css, img), etc.? If so, to me it seems like we might be better off developing some form of package manifest that can be discovered. |
In this state, absolutely. It only supports PHP classes with valid syntax.
We'd still need to manipulate extracted PHP classes, at least for their namespace. If we do that, we fall back to the stub approach... I'm thinking I should move |
Yes, I think I like this approach. I think it'll need to be part of this PR though, because publishing view files will be an important one |
|
Marking this pull request as draft until we resolve the publishing story for all files: https://discord.com/channels/1236153076688359495/1292767408158933032 |
48a1126 to
66333aa
Compare
|
Just added support for publishing files. Here's how this all works now:
CleanShot.2024-10-11.at.15.49.49.mp4The CLI is a bit clunky though. 😵💫 |
Do you mean the cancel line that's overwritten partially? Yeah I need to look into that… Made an issue for it: #574 Apart from that: one thing I think we need is an optional search bar for the question component 😁 Actually, there already is a search component but it only supports a single option. I think adding a search flag to PS: I'm not expecting you to do those things, just noting them here for reference :) Maybe we should also add an option just keep all selected files in their default location, so that you don't have to run through them one by one if you plan to keep everything in the default location. On top of that (haven't looked at the code yet): did you provide a way to only show files in this list that weren't published yet? Ideally we keep track of which files were published, even if they were moved to another location. I don't know how we'd do that though… Cache? But caches can be cleared. Some kind of local mapping in a file somewhere? But then you'd run into problems if you want to republish a file (although that could be fixed with some kind of Just thinking out loud :) This will be a great feature when finished though! |
|
@innocenzi I made a bugfix for the line clearing issue, could you try it out? #576 It's in main |
Honestly, if I was good enough with terminal inputs, I'd already have PR'd a few things—I'd personally love to see features of
I like the idea. I'll add a flag. Speaking of which, when I wanted to write tests, I realized we don't have a
I thought about it, but couldn't find any solution that was good enough in my book:
So, out of ideas for this one :( |
66333aa to
26dd519
Compare
|
Unsure why these Rector changes don't appear locally—they seem unrelated to this pull request @brendt aside from the lack of tests, I feel like this is ready for review |
|
Couple of questions:
|
My understanding was that we should use both—the attribute for PHP classes, and the "package" interface for other files that can't have attributes. If you'd rather have everything go through that package interface, I'm not sure what that would look like for Tempest core |
|
I remember talking about this on Discord somewhere? But that was before I got sick 😅 I remember I was on the fence about it for a while, but eventually concluded that one consistent approach is more important than two ways of doing the same. That being said, I'm fine taking it from here if that's ok for you, I think you've done most of the work, and it'll be just a matter of introducing a |
|
@brendt sure, go ahead! I'm totally fine with that |
Pull Request Test Coverage Report for Build 11474462544Details
💛 - Coveralls |
|
I gave it a lot more thought: I argued that But here's the thing… all of those edge cases can be solved even with attributes. Let's look at it from a package author's perspective (because that's where these two attributes would be used).
On top of that, I was looking into this special Package interface, and realised it would have to be yet another exception within discovery (probably a separate kernel boot step), because we'd need to discover all packages to determine which paths should be skipped. This complexity, together with the fact that we might not even really need it, makes me think I favor the attribute approach a lot more now… |
|
As discussed on Discord: we're going to take another approach. Sorry again @innocenzi for all the work you've put into it, but know I really appreciate it, even though we're not merging it! |
This pull request adds the ability to interactively publish vendor files to the user's codebase.
This works by adding a new
CanBePublishedattribute, which gets discovered by a newPublishDiscovery. The newpublish:installcommands then enables the user to chose which files they want published.Things to do:
Composerutil #519)ClassManipulator#531)CanBePublishedandDoNotDiscoverattributes upon publishing (depends on feat(generation): addClassManipulator#531)Related to #509