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

Created plugin boilerplate and new-plugin script #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kael-shipman
Copy link

  • 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
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.

Copy link
Owner

@shockey shockey left a comment

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 🙂

scripts/new-plugin.sh Outdated Show resolved Hide resolved
scripts/new-plugin.sh Outdated Show resolved Hide resolved
@@ -8,5 +8,8 @@
"@babel/preset-env": "^7.1.0",
"babel-plugin-add-module-exports": "^1.0.0",
"lerna": "^3.4.3"
},
"scripts": {
"new-plugin": "./scripts/new-plugin.sh"
Copy link
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
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
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
Copy link

mristin commented Feb 22, 2021

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
Copy link

mristin commented Feb 23, 2021

@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
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
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