@freelog-cli/cli2 0.5.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 +79 -0
- package/compat/template-compat.json +44 -0
- package/dist/bin/index.d.ts +1 -0
- package/dist/bin/index.js +16471 -0
- package/dist/bin/index.js.map +1 -0
- package/dist/compat-Ba3r5ie_.js +23634 -0
- package/dist/compat-Ba3r5ie_.js.map +1 -0
- package/dist/index.d.ts +145 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/package.json +88 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @freelog-cli/cli2
|
|
2
|
+
|
|
3
|
+
Freelog 资源脚手架与发行 CLI。目标态只使用 `freelog.manifest.json` + `.freelog/state.json`,平台接口从 `@freelog-cli/tools-lib2/node` 进入。
|
|
4
|
+
|
|
5
|
+
`@freelog-cli/cli2` 是当前隔离测试包名,用于避免覆盖已有线上包 `@freelog-cli/cli`;最终正式包名尚未裁决。
|
|
6
|
+
|
|
7
|
+
**身份凭据:** 自 `--cwd` 向上查找 `.freelog-auth`,未命中则回退 `~/.freelog-auth`;`login` 默认写工作区,`login -g` 写全局。**写入时加密 token/authorization/cookie,读取时解密**(AES-256-GCM;默认密钥 `~/.freelog-cli/auth.key`)。详见 [DESIGN.md](../../DESIGN.md)「本地加密」与 [全局参数与登录](../../docs/新方案/使用/全局参数与登录.md)。
|
|
8
|
+
|
|
9
|
+
**当前 production / prod 硬禁用。** 联调 `devfreelog.com` 使用 `--env dev`;以下省略重复环境参数的
|
|
10
|
+
示例,执行前应在对应工程运行 `freelog-cli config init --default-env dev`。CLI 不会把 production
|
|
11
|
+
请求静默改到 dev/test。
|
|
12
|
+
|
|
13
|
+
完整使用说明见 [CLI 使用文档目录](../../docs/新方案/使用/README.md)(建议从 [快速上手](../../docs/新方案/使用/快速上手.md) 开始)。源码依赖方向见 [ARCHITECTURE.md](./src/ARCHITECTURE.md)。
|
|
14
|
+
|
|
15
|
+
## 命令面
|
|
16
|
+
|
|
17
|
+
| 类型 | 命令 |
|
|
18
|
+
|---|---|
|
|
19
|
+
| 全局 | `login` `logout` `status` `bind` `pull` |
|
|
20
|
+
| 类型 | `type list` `type search` `type info` |
|
|
21
|
+
| 初始化 | `init` |
|
|
22
|
+
| 独立资源 | `create` `update` `version set` `publish` `draft *` `dep *` `policy *` `online` `offline` `version edit` |
|
|
23
|
+
| 多资源 | `resource import-dir` |
|
|
24
|
+
| 合集 | `collection create` `collection item *` `collection version set` `collection publish` `collection collect-rules *` `collection rss *` |
|
|
25
|
+
| 交互壳 | `session`(11 · 全临时 TTY) `studio`(10 · 多账号工作区 TTY) |
|
|
26
|
+
|
|
27
|
+
四模式 10/11 说明见 [交互会话与多账号工作区](../../docs/新方案/使用/交互会话与多账号工作区.md)。
|
|
28
|
+
|
|
29
|
+
## 示例
|
|
30
|
+
|
|
31
|
+
已有主题 / 插件项目接入:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
freelog-cli type search 主题
|
|
35
|
+
freelog-cli init . --scaffold none --resource-type <themeCode> --artifact-mode directory-zip --runtime 0.5 --yes
|
|
36
|
+
pnpm build
|
|
37
|
+
freelog-cli create
|
|
38
|
+
freelog-cli version set --version 1.0.0 --file dist --runtime 0.5
|
|
39
|
+
freelog-cli publish
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
通过模板新建主题 / 插件项目:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
freelog-cli init theme my-theme --template vite-react-ts --runtime 0.5 --yes
|
|
46
|
+
cd my-theme
|
|
47
|
+
pnpm build
|
|
48
|
+
freelog-cli create
|
|
49
|
+
freelog-cli version set --version 1.0.0 --file dist --runtime 0.5
|
|
50
|
+
freelog-cli publish
|
|
51
|
+
freelog-cli policy apply --from-file ./policy.json --yes
|
|
52
|
+
freelog-cli online --yes
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
图片文件夹作为多个独立资源:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
freelog-cli resource import-dir ./photos --resource-type <imageCode> --title-prefix "照片" --yes
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
图片文件夹作为合集:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
freelog-cli init album --scaffold collection --resource-type <collectionCode> --yes
|
|
65
|
+
cd album
|
|
66
|
+
freelog-cli collection create
|
|
67
|
+
freelog-cli collection item import-dir ../photos --resource-type <imageCode> --yes
|
|
68
|
+
freelog-cli collection version set --version 1.0.0 --description "first album"
|
|
69
|
+
freelog-cli collection publish --yes
|
|
70
|
+
freelog-cli policy apply --from-file ./policy.json --yes
|
|
71
|
+
freelog-cli online --yes
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 本地文件
|
|
75
|
+
|
|
76
|
+
- `freelog.manifest.json`:用户意图,提交 git。
|
|
77
|
+
- `.freelog/state.json`:CLI 平台状态,不提交 git。
|
|
78
|
+
|
|
79
|
+
CLI 不读取旧配置文件,不执行用户 JS/TS 配置。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"cliVersion": "0.5.0",
|
|
4
|
+
"defaultRuntime": "0.5",
|
|
5
|
+
"runtimes": {
|
|
6
|
+
"0.5": {
|
|
7
|
+
"freelogRuntimeRange": "^5.0.7",
|
|
8
|
+
"templates": {
|
|
9
|
+
"vite-vue-ts": {
|
|
10
|
+
"npmName": "@freelog-cli/template-vite-vue-ts",
|
|
11
|
+
"version": "latest"
|
|
12
|
+
},
|
|
13
|
+
"vite-vue": {
|
|
14
|
+
"npmName": "@freelog-cli/template-vite-vue",
|
|
15
|
+
"version": "latest"
|
|
16
|
+
},
|
|
17
|
+
"vite-react-ts": {
|
|
18
|
+
"npmName": "@freelog-cli/template-vite-react-ts",
|
|
19
|
+
"version": "latest"
|
|
20
|
+
},
|
|
21
|
+
"vite-react": {
|
|
22
|
+
"npmName": "@freelog-cli/template-vite-react",
|
|
23
|
+
"version": "latest"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"noRuntime": {
|
|
29
|
+
"templates": {
|
|
30
|
+
"package-js": {
|
|
31
|
+
"npmName": "@freelog-cli/template-package-js",
|
|
32
|
+
"version": "0.5.0"
|
|
33
|
+
},
|
|
34
|
+
"package-react": {
|
|
35
|
+
"npmName": "@freelog-cli/template-package-react",
|
|
36
|
+
"version": "0.5.0"
|
|
37
|
+
},
|
|
38
|
+
"package-vue": {
|
|
39
|
+
"npmName": "@freelog-cli/template-package-vue",
|
|
40
|
+
"version": "0.5.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|