指南
- 介绍
- Contribute
- 部署
- 管理
- 高级
内部文档
扩展
- Main 核心概念
- 参考指南
- 进阶指南
- 更新指南
Distribution
You've written a great extension — and now you want the whole world to be able to use it. This document will take you through the process of distribution, from setting up a Git repository for your extension, to publishing it on Packagist.
Setting Up Git
The first thing you'll need to do is set up a version control system (VCS). The most popular VCS is Git. In this guide we'll be using Git, so make sure you have it installed before continuing. If you don't have much Git knowledge, you may want to check out these learning resources.
After you have installed Git, you'll need to initialize your repository. You can use git init
on the command line if you're comfortable, or use a GUI tool like SourceTree or GitKraken.
Then, you'll need an account in a Git hosting server, the most popular being GitHub and GitLab. These will instruct you on how to hook up your local repository with the online "remote" repository.
Tagging a Release
As you are going to be publishing this extension, you'll want to make sure that the information is up to date. Take a minute to revisit composer.json
and make sure package name, description, and Flarum extension information are all correct. It is recommended to have a README.md
file in your repository to explain what the extension is, so create one if you haven't already.
When you're ready to release, commit your extension's files to the repo and tag your first version:
git tag v0.1.0
git push && git push --tags
Publishing on Packagist
Composer packages are published to a Composer repository, usually Packagist. You will need an account to proceed.
If this is the first release you are publishing of your extension, you will need to submit your package using its public repository URL. If your extension is located on GitHub, this URL will look something like https://github.com/AUTHOR/NAME.git
.
Future Releases
You can set up Packagist to auto-update packages. Then for future releases, all you will need to do with Git is commit, tag, and push it to the remote server.
Promoting Your Extension
You will most likely want to create a discussion on the Flarum Community in the Extensions tag. Other people can install your extension using the following command:
composer require vendor/package
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论