gabriel
(Gabriel Grubba)
2024 年 7 月 4 日午後 1:53
1
このプラグインはDiscourseコアにバンドルされるようになりました 。このgemを使用する必要はありません。
新しいプラグインを作成するには、次を使用してください。
rake plugin:create[plugin-name]
Discourseプラグインの開発を始めてから、全体的なセットアップをより簡単にできると感じていました。プラグイン作成時の全体的な開発者エクスペリエンスを向上させるべきです。
その精神で、私は自由時間にcreate-discourse-plugin というgemを作成しました。
何をするのか?
選択したオプションに基づいて、discourse-plugin-skeletonのコピーをユーザー名または組織にクローンして作成します。その後、すべてのプレースホルダーをプラグインの名前に更新します。これにより、開発を開始する準備が整います。
使い方?
npx create-next-appやnpx meteorと同じ精神で
gem exec create-discourse-plugin <plugin-name>
要件
貢献
Contribute to Grubba27/create-discourse-plugin development by creating an account on GitHub.
「いいね!」 16
pfaffman
(Jay Pfaffman)
2024 年 7 月 4 日午後 3:05
2
ありがとうございます!過去数年間、新しいプラグインを作成するたびにこれを考えてきました!私が自分でやるよりもずっとうまくやっているようですね。試すのが待ちきれません!
「いいね!」 6
pfaffman
(Jay Pfaffman)
2024 年 7 月 30 日午後 6:46
3
これは素晴らしいですね。いつになったらうんざりして、
gem exec create-discourse-theme <theme-name>
を作成するつもりですか?
「いいね!」 6
david
(David Taylor)
2024 年 7 月 31 日午前 8:51
4
それは discourse_theme new です
The [discourse] Discourse Theme CLI is a ruby gem that allows you to use your editor of choice when developing Discourse themes and theme components. As you save files the CLI will update the remote theme or component and changes to it will appear live!
Installing
To play with it, make sure you have Ruby 2.5 or up installed.
[image]
If you are on Windows, you have 2 options:
Option 1: Windows Subsystem for Linux .
Windows 10 has access to a full Linux environment, you can use it to install …
@grubba これをコアにRakeタスクとして組み込むことについて、どう思われますか?例えば
bin/rake plugin:create
プラグインの開発には、動作するコア開発環境が必要なので、良い選択肢だと思いませんか?また、より「公式」になり、チーム全体での保守も容易になります。
gitに100%依存するのではなく、人々がGitHub(とgh CLI)を使用することに依存しないようにした方が良いでしょうか?他のサービスでプラグインをホストしている人もいますし、すぐに公開したくない場合もあります。
discourse_theme では、テーマのスケルトンのローカルキャッシュ を維持しているので、オフラインでも動作します!
「いいね!」 6
pfaffman
(Jay Pfaffman)
2024 年 7 月 31 日午後 12:30
5
しまった!私はいつも watch しか使っていませんでした!そして昔試したときも、どうだったか覚えていません。
「いいね!」 2
gabriel
(Gabriel Grubba)
2024 年 8 月 12 日午後 8:22
6
確かに理にかなっていると思います!人々がテストしてくれ、いくつかの苦情やフィードバックを受け取り、調整も行いました。公式にするにはかなり良い状態だと思います。数日中にコアに追加する作業を行います。
gh を使用するのが理想的ではないことにも同意します。解決策を見つけます。おそらく discourse_theme new が探していたものかもしれません…
「いいね!」 5
gabriel
(Gabriel Grubba)
2024 年 8 月 14 日午後 3:01
7
素晴らしいニュースがあります!この新しいrakeタスクをコアにマージ しました。
rake plugin:create[name]
これはgemと同様に機能しますが、GitHubにプッシュしないため、何をすべきかを選択できます。これはまさにdiscourse_theme newのようなものです。
これはgemを非推奨としてタグ付けします。より「公式な」ソリューションがあるためです。
「いいね!」 10
pfaffman
(Jay Pfaffman)
2024 年 8 月 27 日午後 6:26
8
編集:指示通り .gitignore から Gemfile.lock を削除しました。これで動作するはずです。
Gemfile.lock は .gitignore に含めることはできません
david:
bin/rake plugin:create
'https://github.com/discourse/discourse-plugin-skeleton' を '/home/pfaffman/src/discourse-repos/discourse/plugins/discourse-public-bookmark-timers' にクローン中...
Git リポジトリを初期化中...
/home/pfaffman/src/discourse-repos/discourse/plugins/discourse-public-bookmark-timers/.git/ に空の Git リポジトリを初期化しました。
以下のパスは、.gitignore ファイルのいずれかによって無視されています:
Gemfile.lock
hint: 本当に追加したい場合は -f を使用してください。
hint: このメッセージをオフにするには実行してください
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
( --trace を付けてタスクを実行すると、完全なトレースが表示されます)
git config advice.addIgnoredFile false を実行した後、再度試しましたが、結果は同じでした。
そして、これも
$ 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
「いいね!」 1