@sfmc-bds/sfmc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/bin/sfmc.mjs +29 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @sfmc-bds/sfmc
|
|
2
|
+
|
|
3
|
+
SFMC 聚合包:一条命令安装 CLI + db-server + qq-bridge + bds-tools + tools,装完即可在工作目录里初始化并管理全部服务。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @sfmc-bds/sfmc
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
或在项目目录本地安装:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
mkdir my-server && cd my-server
|
|
15
|
+
npm init -y
|
|
16
|
+
npm install @sfmc-bds/sfmc
|
|
17
|
+
npx sfmc
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 首次使用
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
mkdir my-server && cd my-server
|
|
24
|
+
sfmc
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- 工作根 = **当前目录**(`SFMC_ROOT`,可用环境变量覆盖)
|
|
28
|
+
- 未初始化时自动进入向导:播种 `configs/`、`modules/`,填写 BDS / 端口等
|
|
29
|
+
- 之后在 REPL 中:`start -all`、`module install <id>`、`behavior-pack build` …
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
sfmc status
|
|
33
|
+
sfmc init # 重跑向导
|
|
34
|
+
sfmc start -all
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 包含依赖
|
|
38
|
+
|
|
39
|
+
| 包 | 作用 |
|
|
40
|
+
|----|------|
|
|
41
|
+
| `@sfmc-bds/cli` | `sfmc` 管理 CLI / REPL |
|
|
42
|
+
| `@sfmc-bds/db-server` | SQLite HTTP 后端 |
|
|
43
|
+
| `@sfmc-bds/qq-bridge` | QQ 桥 |
|
|
44
|
+
| `@sfmc-bds/bds-tools` | BDS 更新与行为包装配 |
|
|
45
|
+
| `@sfmc-bds/tools` | `fetch-module` 等工具 |
|
|
46
|
+
| `@sfmc-bds/sdk` | 共享 SDK |
|
|
47
|
+
|
|
48
|
+
## 环境变量
|
|
49
|
+
|
|
50
|
+
| 变量 | 说明 |
|
|
51
|
+
|------|------|
|
|
52
|
+
| `SFMC_ROOT` | 配置与数据根(默认 cwd) |
|
|
53
|
+
| `SFMC_SERVICE_*_ENTRY` | 覆盖各服务入口脚本(一般由本包 bin 自动注入) |
|
|
54
|
+
| `SFMC_FETCH_MODULE` | `fetch-module.mjs` 路径 |
|
|
55
|
+
| `SFMC_DEFAULTS_DIR` | 首次初始化用的默认配置模板目录 |
|
|
56
|
+
|
|
57
|
+
## 仓库
|
|
58
|
+
|
|
59
|
+
<https://github.com/DogeLakeDev/ScriptsForMinecraftServer/tree/main/sfmc-meta>
|
package/bin/sfmc.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @sfmc-bds/sfmc entry — resolve platform packages from this meta-package's
|
|
4
|
+
* dependency tree, set SFMC_ROOT to cwd, then hand off to @sfmc-bds/cli.
|
|
5
|
+
*/
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
function resolved(specifier) {
|
|
12
|
+
return fileURLToPath(import.meta.resolve(specifier));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Data/config root = cwd unless caller already set SFMC_ROOT (SEA / isolation). */
|
|
16
|
+
if (!process.env.SFMC_ROOT) {
|
|
17
|
+
process.env.SFMC_ROOT = process.cwd();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Inject absolute service entry paths so CLI does not need monorepo layout. */
|
|
21
|
+
process.env.SFMC_SERVICE_DB_ENTRY ??= resolved("@sfmc-bds/db-server");
|
|
22
|
+
process.env.SFMC_SERVICE_QQ_ENTRY ??= resolved("@sfmc-bds/qq-bridge");
|
|
23
|
+
process.env.SFMC_SERVICE_UPDATE_ENTRY ??= resolved("@sfmc-bds/bds-tools/check-update");
|
|
24
|
+
process.env.SFMC_SERVICE_MANAGER_ENTRY ??= resolved("@sfmc-bds/bds-tools/bds-manager");
|
|
25
|
+
process.env.SFMC_SERVICE_PACK_MANAGER_ENTRY ??= resolved("@sfmc-bds/bds-tools/pack-manager");
|
|
26
|
+
process.env.SFMC_FETCH_MODULE ??= resolved("@sfmc-bds/tools/fetch-module.mjs");
|
|
27
|
+
process.env.SFMC_DEFAULTS_DIR ??= path.join(here, "..", "defaults");
|
|
28
|
+
|
|
29
|
+
await import(import.meta.resolve("@sfmc-bds/cli/cli"));
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sfmc-bds/sfmc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SFMC all-in-one meta package — CLI + db-server + qq-bridge + bds-tools. One install, then `sfmc` to init and run.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "GPL-3.0-only",
|
|
7
|
+
"author": "Shiroha7z",
|
|
8
|
+
"homepage": "https://github.com/DogeLakeDev/ScriptsForMinecraftServer/tree/main/sfmc-meta#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/DogeLakeDev/ScriptsForMinecraftServer.git",
|
|
12
|
+
"directory": "sfmc-meta"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/DogeLakeDev/ScriptsForMinecraftServer/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"minecraft-bedrock",
|
|
19
|
+
"sfmc",
|
|
20
|
+
"scriptsforminecraftserver",
|
|
21
|
+
"cli",
|
|
22
|
+
"bds"
|
|
23
|
+
],
|
|
24
|
+
"bin": {
|
|
25
|
+
"sfmc": "./bin/sfmc.mjs"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"bin",
|
|
29
|
+
"defaults",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "node -e \"process.exit(0)\"",
|
|
34
|
+
"prepublishOnly": "node -e \"process.exit(0)\""
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@sfmc-bds/bds-tools": "^0.1.0",
|
|
38
|
+
"@sfmc-bds/cli": "^0.1.0",
|
|
39
|
+
"@sfmc-bds/db-server": "^0.1.0",
|
|
40
|
+
"@sfmc-bds/qq-bridge": "^0.1.0",
|
|
41
|
+
"@sfmc-bds/sdk": "^0.1.0",
|
|
42
|
+
"@sfmc-bds/tools": "^0.1.0"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22.13.0"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
}
|
|
51
|
+
}
|