@picloom/theme-sdk 0.1.0 → 0.1.2
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 +15 -6
- package/index.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @picloom/theme-sdk
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Create a project with `bun create @picloom/theme@0.1.
|
|
5
|
-
the types with `bun add --dev @picloom/theme-sdk@0.1.
|
|
3
|
+
TypeScript contracts for trusted Picloom home and login themes.
|
|
4
|
+
Create a project with `bun create @picloom/theme@0.1.2 ./my-theme`, or install
|
|
5
|
+
the types with `bun add --dev @picloom/theme-sdk@0.1.2`.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
import type { ThemeContext } from "@picloom/theme-sdk";
|
|
@@ -20,8 +20,8 @@ The host injects runtime capabilities; do not import application-internal module
|
|
|
20
20
|
Theme configuration and package assets are public. Theme code is trusted and login
|
|
21
21
|
themes can read entered credentials; install reviewed packages only.
|
|
22
22
|
|
|
23
|
-
Use `@picloom/create-theme` for a standalone Vue project
|
|
24
|
-
|
|
23
|
+
Use `@picloom/create-theme` for a standalone Vue project using the independently maintained
|
|
24
|
+
template in `tools/create-theme/template/`. Horizon in the separate `picloom-extensions/themes/horizon` project is the advanced example.
|
|
25
25
|
|
|
26
26
|
SDK snapshots and helpers are framework-independent. In Vue themes, assign each `subscribe()` snapshot to a local ref and derive computed values from that ref. Calls such as `t()`, `localized()` and `links.format()` do not establish reactive dependencies in the theme's bundled Vue runtime: do not cache their results in a computed value without explicitly depending on the relevant snapshot fields (`locale` or `copy.format`). The examples call these helpers during rendering, which is triggered by their snapshot subscription. Configuration is fixed for a mount; draft changes are picked up when a new preview is loaded.
|
|
27
27
|
|
|
@@ -33,4 +33,13 @@ Core errors and notifications in snapshots are translated at display time and up
|
|
|
33
33
|
- [Theme protocol and localized configuration](https://llleixx.github.io/picloom/development/themes.html)
|
|
34
34
|
- [Schema reference](https://llleixx.github.io/picloom/development/schema.html)
|
|
35
35
|
- [Messages and form hints](https://llleixx.github.io/picloom/development/package-localization.html)
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
## Development tools / 开发工具
|
|
38
|
+
|
|
39
|
+
This package exports types only. `@picloom/theme-tools` provides the `picloom-theme`
|
|
40
|
+
CLI for simulated preview, Vite builds and ZIP packaging. `@picloom/create-theme`
|
|
41
|
+
generates a project using both packages. Framework plugins remain in the theme's
|
|
42
|
+
Vite configuration; no development tools are bundled into the theme.
|
|
43
|
+
|
|
44
|
+
SDK 仅维护主题与宿主之间的公共类型协议。模拟预览、构建和 ZIP 打包由
|
|
45
|
+
`@picloom/theme-tools` 统一维护,脚手架负责生成项目。消费项目使用 `@picloom/theme-sdk@0.1.2`,无需引用本地源码或压缩包。
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picloom/theme-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"description": "Browser-only public contracts for Picloom themes",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/llleixx/picloom.git",
|
|
20
|
+
"url": "git+https://github.com/llleixx/picloom-tooling.git",
|
|
21
21
|
"directory": "theme-sdk"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|