Skip to content

Created plugin boilerplate and new-plugin script#4

Open
kael-shipman wants to merge 7 commits into
shockey:masterfrom
kael-shipman:boilerplate
Open

Created plugin boilerplate and new-plugin script#4
kael-shipman wants to merge 7 commits into
shockey:masterfrom
kael-shipman:boilerplate

Conversation

@kael-shipman

Copy link
Copy Markdown
  • Adds plugin boilerplate
  • Adds interactive npm run new-plugin script to make it simple to create new plugins in a project-compatible way
  • Updates readme with instructions for use

@kael-shipman

Copy link
Copy Markdown
Author

@shockey it looked like you had a good start on a swagger-ui plugin library, so I just added this boilerplate to make it a bit easier to spin up new plugins. I'm going to port a few of the easy ones over from here over the next few days, but I figured I'd submit this boilerplate as a separate thing.

Merge if you like it, or lemme know if you have issues with it.

@shockey shockey left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

great addition! I have a couple things that need to be addressed, but I don't think we're far off from a merge 🙂

Comment thread scripts/new-plugin.sh
Comment thread scripts/new-plugin.sh Outdated
Comment thread package.json
"lerna": "^3.4.3"
},
"scripts": {
"new-plugin": "./scripts/new-plugin.sh"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

running this locally shows a couple of weird behaviors (shown is two runs, with names Kyle Plugin and Test Plugin):

  1. my plugin's name seems to be mangled at the first character
  2. a runaway file copy seems to be creating copies with trailing singlequotes

image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok, looks like this was a bad sed line. Frustratingly, mac sed requires you to supply a backup prefix. I tried to get around that by just supplying an empty string, which I think would normally work, but I did it in a weird way.

Anyway, I believe it's now fixed. Grab a look and see what you think.

@kael-shipman

Copy link
Copy Markdown
Author

Ah, thanks for the comments! I'll grab a look over the next few days and see if I can fix this stuff. I'll ping you when there's something new to look at.

Co-authored-by: kyle shockey <kyleshockey@gmail.com>
@mristin

mristin commented Feb 22, 2021

Copy link
Copy Markdown

Perhaps while you are at it -- is there a way to make this platform-independent, so that the users can run the script also on Windows?

@mristin

mristin commented Feb 23, 2021

Copy link
Copy Markdown

@kael-shipman maybe you can also consider including @babel/preset-react in the boilerplate as you almost certainly have to use it in the pluging, don't you?

@kael-shipman

Copy link
Copy Markdown
Author

@mristin ah, good call! You're right about the react preset. Thanks for the suggestions.

As for Windows, unfortunately I have no idea where to start with that. I don't have a windows machine, so that might have to go in another PR authored by someone who's more in the windows world. Certainly a good and valid consideration though.

Honestly, i kinda forgot about this! And I'm not gonna have time this week to pick it back up, but now I'm excited to get started on it again and get it over the finish line, so I'll see if I can pull some hours together this weekend :).

Thanks, all!

@kael-shipman

Copy link
Copy Markdown
Author

Ok @shockey , back to you. Lemme know if you see anything else that needs fixing/changing.

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.

3 participants