发布
这是一个塔程序包的最小结构:
warriorjs-tower-got
├── index.js
└── package.json
其中 index. js
将包含我们通过本指南编写的代码, 以及 package. json
-npm 软件包信息:
{
"name": "warriorjs-tower-got",
"version": "0.1.0",
"description": "There is only one war that matters: the Great War. And it is here.",
"main": "index.js",
"keywords": ["warriorjs-tower"],
"dependencies": {
"@warriorjs/geography": "^0.4.0"
}
}
一些特殊注意事项
- 包名必须从
warriorjs-tower-
开始, 以便 WarriorJS 自动加载该塔。 warriorjs-tower
应该在 "keywords" 域中, 以便你的塔具有更好的可检索性.
When working on a tower, you can use npm pack
to create a tarball for it, and then install it where you installed @warriorjs/cli
by doing:
npm install <path/to/tarball>
After doing that, running warriorjs
should load your tower automatically.
Once you've tested and adjusted your tower, you're ready to publish it to npm for others to play it. Follow this guide to learn how to publish a package to npm.