This plugin is now bundled with Discourse core. There is no need to use this gem.
To create a new plugin, use: rake plugin:create[plugin-name]
Since I started developing discourse plugins, I felt the overall setup could be more straightforward. We should have a better overall developer experience when creating a plugin.
It clones and creates a copy of the discourse-plugin-skeleton under your username or org based on your chosen option. After doing that, it updates all placeholders with the name of your plugin. Making it ready to start development.
How to use?
In the same spirit as npx create-next-app or npx meteor
Thank you! I’ve thought about doing this every time I’ve made a new plugin for the past couple of years! It looks like you have don’t a much better job than I would have. I can’t wait to try it!
@grubba how would you feel about rolling this into core as a rake task? Like
bin/rake plugin:create
People need to have a working core dev environment to work on plugins anyway, so it seems like a good fit? It would also make more ‘official’, and easier for the whole team to maintain.
I wonder if it would be better to make it 100% git, instead of relying on people using github (and having the gh cli)? Some people use other services to host their plugins, and also may not want them to immediately be made public.
In discourse_theme we maintain a local cache of the theme-skeleton, so it even works offline!
I guess it makes sense! People have tested it, and I’ve received a few complaints and feedback and made some adjustments. I think it is in pretty good shape to make it official. I’ll work within the next few days on adding it to the core.
I agree that using gh is not ideal, and I’ll figure out a solution. Maybe what discourse_theme new does is what I was looking for…
EDIT: I removed Gemfile.lock from .gitignore, like it said. And now it works.
No Gemfile.lock allowed in .gitignore
Cloning 'https://github.com/discourse/discourse-plugin-skeleton' to '/home/pfaffman/src/discourse-repos/discourse/plugins/discourse-public-bookmark-timers'...
Initializing git repository...
Initialized empty Git repository in /home/pfaffman/src/discourse-repos/discourse/plugins/discourse-public-bookmark-timers/.git/
The following paths are ignored by one of your .gitignore files:
Gemfile.lock
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
rake aborted!
Command failed with exit 1: git
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/plugin.rake:352:in `system'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/plugin.rake:352:in `block (2 levels) in <main>'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/plugin.rake:344:in `chdir'
/home/pfaffman/src/discourse-repos/discourse/lib/tasks/plugin.rake:344:in `block in <main>'
Tasks: TOP => plugin:create
(See full trace by running task with --trace)
I tried again after running git config advice.addIgnoredFile false with the same result.
And also
$ gem exec create-discourse-theme discourse-public-bookmark-timers
ERROR: Could not find a valid gem 'create-discourse-theme' (>= 0) in any repository
ERROR: Possible alternatives: create-discourse-plugin, discourse_theme, askclass-course-theme, date_discreter, opensource-theme