オリジナルのドキュメント
最終同期リビジョン: 106833a
ドキュメントはAGPLv3でライセンスされています。
Wiki.js is fully modular, which allows any developer to write their own module or theme.
There are 2 methods to develop for Wiki.js. You can either use the dockerized development environment (recommended) or install all dependencies manually on your machine.
Developing on Docker for Windows
The instructions and commands below are made using
make
and unix-based commands. They will not work on Windows. While you can port these commands to their Windows equivalent, they will not be provided here. It's recommended that you use the Windows Subsystem for Linux (WSL) if you wish to use the commands below. It provides a native GNU/Linux environment without the overhead of a virtual machine.Otherwise, consider using the non-docker instructions.
make docker-dev-up
# You may need to start the above command with `sudo` depending on your OS configuration.
作業が完了して開発環境が不要になったら以下のコマンドでコンテナを停止し、削除できます。
make docker-dev-down
# OSの構成によってはコマンドに `sudo` を付ける必要がある場合があります。
コマンド | 説明 |
---|---|
docker-dev-up | Starts the development environment. |
docker-dev-down | Stops and remove the development environment. |
docker-dev-clean | Flush DB and cache. (Must run docker-dev-up first!) |
docker-dev-rebuild | Rebuilds the wiki container image. (Must run docker-dev-down first!) |
docker-build | Builds the client assets files using a temporary environment. |
The default docker environment is using PostgreSQL as the database engine. However it's sometimes useful to debug using other database engines. You can switch to any of the supported engines (mariadb
, mssql
, mysql
, postgres
, sqlite
) by adding the DEVDB
variable at the end of any of commands above, e.g.:
make docker-dev-up DEVDB=mariadb
make docker-dev-rebuild DEVDB=mssql
Make sure to shutdown any running instances BEFORE switching engines and then REBUILD the wiki image using
make docker-dev-rebuild
. Otherwise Wiki.js will still use the old configuration file and connect to the previous database configuration.
The MS SQL image does not allow for a default database to be created by default. To create the database, you must:
make docker-dev-up DEVDB=mssql
make docker-dev-clean DEVDB=mssql
make docker-dev-up DEVDB=mssql
againAlternatively, you can also use Microsoft SQL Management Studio to connect to the container and create the initial database.
Production docker images can be built using the following command:
docker build -t requarks/wiki -f dev/build/Dockerfile .
Multi-architecture images for arm64 and arm/v7 can be built using the Docker experimental buildx plugin and QEMU. You can read more about how it works in this article.
docker buildx build --platform linux/arm64,linux/arm/v7 -t requarks/wiki --push -f dev/build/Dockerfile .
npm i -g yarn
)apt-get install build-essential
npm i -g --production windows-build-tools
dev
branch).yarn
config.sample.yml
to config.yml
.config.yml
with your local dev machine settings (db, redis, etc.)From the project folder, simply run yarn dev
This will start Wiki.js in dev mode. Client assets are compiled first (using Webpack), then the server will start automatically. Wait for this process to complete before loading the app!
Browse to the site, using the configuration you defined in config.yml
. For example, if using port 3000 on your local machine, you would browse to http://localhost:3000/.
The first time you load the wiki, you'll get greeted with the setup wizard. Complete all the steps to finish the installation.
Once you're ready to deploy your changes, you need to build the client assets into a production optimized bundle:
yarn build
Wiki.js は Visual Studio Code と定義された推奨拡張機能、プロジェクト設定、デバッグ構成を使用して開発されています。任意のIDEを使用できますが、Visual Studio Codeを強く推奨します。
クライアントのファイルを変更すると自動的にビルドが行われ、サイトが自動的に最新に更新されます。もし変更がインラインで変更できない場合は自動的にリロードが行われます。
サーバーのファイルに変更を加えた場合は自動的にサーバーが再起動します。ターミナルに rs
と入力して Enter を押すと強制的に再起動できます。
開発サーバーを停止するには、プロセスが終了するまで CTRL-C を入力します。
To stop the development server, use CTRL-C until the process exits.