-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Support for creating plugins #658
Comments
@AshleyGrant we spoke about this, right? Could we maybe add support for yeoman so that we can define skeletons outside of the CLI? |
Yeah, I believe we talked about this last week at the Aurelia Amsterdam meetup. I'm not sure we necessarily need to use yeoman. We could have a new repo that includes folders for different types of skeletons maybe. But that being said, I'm not sure we currently want to move the CLI toward creating skeletons. Currently it creates a barebones application, versus the skeletons which have sample code and more dependencies. Maybe the initial implementation could be a barebones plugin. |
I think support for a barebone plugin through some variation of As for creating skeletons, I'm still in favour of my previous |
The intention was not to create a skeleton with sample code, but just a minimal setup for creating a plugin. The only source that would likely be included would be something like //index.js
export function configure(config) {
//config.globalResources('');
} but the build pipeline and dependencies would all be setup and ready for dev. The issue discussed on gitter was that for some one who is not familiar or comfortable with gulp, taking the pieces from an I don't know the nitty gritty of yeoman but it could be one option, although the output would still need to be useable with |
We should definitely enable |
@EisenbergEffect what were those pieces specifically if I had time to help out here? |
Mainly, we need to get the Webpack support merged in, enable asp.net, switch our defaults to webpack and implement the "eject" capability probably. After that we can add the plugin generate support and then move on to Electron and Cordova. |
I'd be interested in contributing on this feature, so let me know how I can help. Also, I created an empty TypeScript plugin skeleton. It looks pretty much like the official skeleton-plugin, but it's written in TypeScript instead of ES2017. It is based on both Dwayne Charrington's aurelia-typescript-plugin and the official validation plugin. I created it mostly because Dwayne's version uses Jest instead of Jasmine. Maybe it could be useful as a model for the TypeScript version of this feature. |
@EisenbergEffect See above comment. What are your thoughts on this feature? I can help @manuel-guilbault in implementing it. |
I'd love to be able to do |
Coming from Ember, I can't think of another feature that would build the Aurelia community faster than having a cli command for generating a plugin! Especially if it's like the current |
@manuel-guilbault @JeroenVinke how is plugin project going? |
@manuel-guilbault is making some great progress. We're currently working on getting the unit testing setup right |
@xdvarpunen @JeroenVinke hopefully I'll be able to get it done in the upcoming weeks |
Any update on this @manuel-guilbault? No pressure, just super excited! :D |
@cottrellio I have a hard time freeing up my schedule to work on this, it's super hot at work right now :( |
Thanks for great work @manuel-guilbault! I used your skeleton successfully. Do you have any update on the status of CLI generation? |
@jmdavid I submitted a pull request which was reviewed; now I need to do some refactoring to reduce code duplication as per Rob's feedback. I'll get to it as soon as I have a couple of free days :) |
for all those seeking |
Any news on this? |
@huochunpeng had a fantastic way of using the aurelia-cli for both the plugin and a Dev sample at the same time. Once he's back from vacation I'd definitely like to review that and make it part of the cli |
My way is documented here https://github.com/aurelia-contrib/aurelia-getting-started/blob/master/guides/how-to-use-cli-to-develop-plugin.md It is different from any plugin skeletons you saw before, but I think my way is intuitive and specially great on writing test. I wound love to gather some feedbacks, and whether it makes sense to be included in cli. |
@huochunpeng I'd love to have built-in support for creating and building plugins from our CLI. It's a long-time feature request from the community. If you look in the |
I think we can continue with #793 |
Good call @JeroenVinke I forgot about that PR. |
After visiting this issue every couple months for over a year I think it is time to give this a shot myself. #793 goes a long way towards implementing this but as discussed in the PR there is a significant amount of duplication present. I think that duplication could be significantly reduced by using the approach outlined by @huochunpeng since it would then be practical to keep most of the existing setup the same. All that said I get the feeling that the team has probably discussed this feature at great length outside of this thread and I would like to nail down some concrete requirements based on consensus rather than my own personal bias. I will be the first to jump down the rabbit hole with a few questions: What is the ideal workflow? Any convention for project structure? Output? Reservations for vNext? I look forward to hearing what everyone thinks. |
@CuddleBunny Thanks for writing this up. A few things come to mind when I read your comment:
I don't think there is any. There are vastly different needs and what is ideal for one is the worst possible thing for the other. Thinking about this from a normal API point of view, and then later translating it to a CLI interface could make things easier. I believe a relatively future proof approach would be to think about which loose parts you can let the cli scaffold/generate, and they wouldn't necessarily need to be tied to being an app or a plugin. Then you can also use the tool to generate additional common pieces of boilerplate in an already ongoing project, with various "strategies" to pick from on how to deal with "merge conflicts". What's needed to start with that is either a long list of commonly desired building blocks, or to simply build a plugin from scratch and then trying to reproduce each step of that in an automated manner, then adding it as a feature to the cli. Just an idea.
Also see this comment: aurelia/aurelia#328 (comment) TLDR: there is the feature-based separation and the layer/type-based separation. They can also be combined (nested) for larger projects. Sometimes one makes more sense, sometimes the other. Having 2x2=4 variants to pick from seems like something that could cover most needs.
I think esm, umd and systemjs cover most if not all. Fortunately it's trivial to have these various outputs as it's just a small aspect of configuration.
vNext is also going to need CLI and this is why I think the modular approach would be important to try, as it allows for a lot of pieces to be reusable between both versions of Aurelia. |
@CuddleBunny thank you very much for your thoughts on this. For vCurrent, in addition to @fkleuver's response: Any convention for project structure? |
Thanks @fkleuver and @huochunpeng. I guess this bit on structure needs broken out into a few different areas: generated project structure, plugin structure, and CLI project structure. On Project Structure
vs.
Option 1 has clear separation but decouples the On Plugin Structure https://gist.github.com/CuddleBunny/a4a51c6f02a27f0219eda3ba4310e307 On CLI Project Structure |
Yes, option2 is what's in my original tutorial as it requires the least change. |
I think option 2 is very intuitive. having a new command for packaging the plugin is a big PLUS in my opinion. |
Good idea. |
The PR #1075 uses option1, it has dedicated folder Please help to play the PR. If the option1 (separate dev app and src folder) is confusing, we can revert to option2 ( |
After a brief Gitter discussion I thought it might be worth starting a discussion here. The idea is to support something like
au new --plugin
orau new-plugin
which would output something like https://github.com/aurelia/skeleton-plugin.Has this already been discussed? Is there interest in adding a feature like this? I could probably start looking at it if there is.
The text was updated successfully, but these errors were encountered: