@picloom/create-theme 0.1.1 → 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 +7 -22
- package/dist/template/README.md +36 -46
- package/dist/template/package.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
# @picloom/create-theme
|
|
2
2
|
|
|
3
|
-
Create a standalone Vue 3
|
|
4
|
-
component/style HMR and ZIP packaging. No application checkout, Node/npm CLI or
|
|
5
|
-
system `zip` is required.
|
|
6
|
-
|
|
7
|
-
Create a project:
|
|
3
|
+
Create a standalone Picloom Vue 3 theme with Bun 1.4.3+.
|
|
8
4
|
|
|
9
5
|
```sh
|
|
10
|
-
bun create @picloom/theme@0.1.
|
|
6
|
+
bun create @picloom/theme@0.1.2 ./my-theme
|
|
11
7
|
cd my-theme
|
|
12
8
|
bun install
|
|
13
9
|
bun run dev
|
|
10
|
+
bun run typecheck
|
|
14
11
|
bun run build
|
|
15
|
-
bun run preview
|
|
16
12
|
```
|
|
17
13
|
|
|
18
|
-
The target must not exist
|
|
19
|
-
it does not install dependencies, initialize Git or publish. Both home and login
|
|
20
|
-
pages start from the template maintained in this package.
|
|
21
|
-
`--help` prints usage.
|
|
14
|
+
The target directory must not exist and its parent must exist. Follow the generated README to edit and install the ZIP. The dev server provides a simulated preview. Type checking and building are separate commands.
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
[theme tooling](https://llleixx.github.io/picloom/development/theme-tooling.html).
|
|
25
|
-
Maintainers run `bun run build:create-theme` before `bun pm pack --ignore-scripts`.
|
|
26
|
-
The build copies `template/` into `dist/template/` without reading the host repository. Preview and ZIP builds are provided
|
|
27
|
-
by `@picloom/theme-tools`; generated projects do not contain a copy of the preview host.
|
|
28
|
-
Do not edit `dist/template/`. Use exact npm version 0.1.1.
|
|
16
|
+
[Theme tutorial](https://llleixx.github.io/picloom/development/theme-tooling.html)
|
|
29
17
|
|
|
30
18
|
## 中文
|
|
31
19
|
|
|
32
|
-
|
|
33
|
-
创建工具只复制文件,不覆盖已有目录、不安装依赖、不初始化 Git、不发布。
|
|
34
|
-
模拟预览不连接真实服务;上传、登录与权限必须在隔离测试实例安装后验证。
|
|
35
|
-
通过 npm 创建项目,也可按文档使用本地 `.tgz` 验证开发版本。编辑 `template/` 维护模板,构建时复制到 `dist/template/`,不依赖主仓库默认主题源码。
|
|
20
|
+
使用 Bun 1.4.3+ 创建独立 Vue 3 主题。按上方命令创建工程、安装依赖、检查类型并构建。目标目录必须不存在,父目录必须存在。
|
|
36
21
|
|
|
37
|
-
|
|
22
|
+
开发服务器提供模拟预览。类型检查与构建分别执行;修改文件和安装 ZIP 的步骤见生成项目中的 README。
|
package/dist/template/README.md
CHANGED
|
@@ -1,60 +1,50 @@
|
|
|
1
1
|
# Picloom theme / 主题开发
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A Vue 3 theme for Picloom home and login pages. Requires Bun 1.4.3+.
|
|
4
|
+
|
|
5
|
+
## Develop
|
|
5
6
|
|
|
6
7
|
```sh
|
|
7
8
|
bun install
|
|
8
9
|
bun run dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open `http://127.0.0.1:5173/`; use `bun run dev --port 5174` to change the port. The preview panel simulates pages, languages, appearance, login and upload states.
|
|
13
|
+
|
|
14
|
+
- `theme.json`: theme ID, version, localized text and configuration schema.
|
|
15
|
+
- `src/Page.vue`, `src/style.css`: pages and styles, with hot updates.
|
|
16
|
+
- `src/entry.ts`: mounts the theme and disposes it on unmount.
|
|
17
|
+
- `public/assets/`: package resources, read with `context.asset("assets/...")`.
|
|
18
|
+
- `dev/config.json`: created on first preview from schema defaults; edit it to try configuration values. New defaults do not replace existing values.
|
|
19
|
+
|
|
20
|
+
Keep `style.css` in the manifest's global `styles`; it contains CSS imported by the entry. Configuration and packaged resources are public.
|
|
21
|
+
|
|
22
|
+
## Build and install
|
|
23
|
+
|
|
24
|
+
```sh
|
|
9
25
|
bun run typecheck
|
|
10
26
|
bun run build
|
|
11
27
|
bun run preview
|
|
12
28
|
```
|
|
13
29
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Edit `src/Page.vue`, `src/style.css` and `theme.json`. All pages use `src/entry.ts`
|
|
20
|
-
(`entry.js` in the package). Put static package resources in `public/assets/` and
|
|
21
|
-
resolve them with `context.asset("assets/...")`. Imported image/CSS resources are
|
|
22
|
-
also processed by Vite. Keep `style.css` in the manifest's global `styles`: it
|
|
23
|
-
contains all CSS imported by the source entry. Additional page-only styles belong
|
|
24
|
-
in `public/assets/` and the corresponding page's `styles`; preview loads and
|
|
25
|
-
unloads them when changing pages. Arbitrary files outside these inputs are not packaged.
|
|
26
|
-
|
|
27
|
-
Vue components and CSS support HMR. Entry changes reload the preview. Manifest
|
|
28
|
-
and `dev/config.json` changes reload and remount the theme. Invalid JSON shows a
|
|
29
|
-
development error and is never overwritten. The first preview initializes a
|
|
30
|
-
missing config from schema defaults; later edits never restore removed values.
|
|
31
|
-
There is initially no custom config schema, so the generated config is `{}`.
|
|
32
|
-
|
|
33
|
-
`preview` loads the existing `dist/package/` JavaScript and styles through the
|
|
34
|
-
same simulated host, without theme source HMR. Build first; source edits are not
|
|
35
|
-
visible until you rebuild. The preview toolbar itself is still a local tool.
|
|
36
|
-
|
|
37
|
-
The distributable is `dist/<theme-id>-<version>.zip`. Upload it to Picloom's Themes
|
|
38
|
-
page, confirm trust, preview and apply. Test real uploads, login and permissions
|
|
39
|
-
there. Increase `theme.json.version` before distributing changed content; package
|
|
40
|
-
versions are immutable on the host. The package builder checks structure and
|
|
41
|
-
resources; full configuration/manifest validation still runs on installation.
|
|
42
|
-
|
|
43
|
-
SDK and tool dependencies use exact versions after publication. During local validation, install the matching local tarballs; the current development versions are not yet published.
|
|
44
|
-
Commit your generated `bun.lock` to your own repository after installation.
|
|
30
|
+
Type checking is separate. `preview` displays the existing `dist/package/` through the simulated host; rebuild to see source changes.
|
|
31
|
+
|
|
32
|
+
Install `dist/<theme-id>-<version>.zip` as Owner in Picloom's Themes page, configure, preview and apply. Check uploads and login there. Increment `theme.json.version` before installing changed content; an installed ID/version cannot be overwritten.
|
|
33
|
+
|
|
34
|
+
[Theme tutorial](https://llleixx.github.io/picloom/development/theme-tooling.html) · [Theme protocol](https://llleixx.github.io/picloom/development/themes.html)
|
|
45
35
|
|
|
46
36
|
## 中文
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- `
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
使用 Bun 1.4.3+。运行 `bun install` 和 `bun run dev`,打开 `http://127.0.0.1:5173/`;可用 `--port 5174` 更换端口。面板模拟页面、语言、外观、登录与上传状态。
|
|
39
|
+
|
|
40
|
+
- `theme.json`:主题 ID、版本、多语言文案与配置 Schema。
|
|
41
|
+
- `src/Page.vue`、`src/style.css`:页面与样式,支持热更新。
|
|
42
|
+
- `src/entry.ts`:挂载主题并在卸载时清理资源。
|
|
43
|
+
- `public/assets/`:包内资源,通过 `context.asset("assets/...")` 读取。
|
|
44
|
+
- `dev/config.json`:首次预览按 Schema 默认值创建,之后手动修改;新默认值不会覆盖已有配置。
|
|
45
|
+
|
|
46
|
+
入口导入的 CSS 合并到 `style.css`,需保留清单中的全局样式声明。主题配置与包内资源可公开访问。
|
|
47
|
+
|
|
48
|
+
分别执行 `bun run typecheck`、`bun run build`。`bun run preview` 模拟预览已有构建产物,修改源码后需重新构建。
|
|
49
|
+
|
|
50
|
+
以 Owner 在 Picloom 主题管理中安装 `dist/<主题ID>-<版本>.zip`,配置、预览并应用,再检查上传和登录。更新时增加 `theme.json.version`;同 ID、同版本不能覆盖。
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"preview": "bun --bun picloom-theme preview"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@picloom/theme-sdk": "0.1.
|
|
16
|
+
"@picloom/theme-sdk": "0.1.2",
|
|
17
17
|
"@tailwindcss/vite": "4.3.3",
|
|
18
18
|
"@types/bun": "1.3.10",
|
|
19
19
|
"@vitejs/plugin-vue": "6.0.10",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"vite": "8.3.4",
|
|
23
23
|
"vue": "3.5.44",
|
|
24
24
|
"vue-tsc": "3.3.13",
|
|
25
|
-
"@picloom/theme-tools": "0.1.
|
|
25
|
+
"@picloom/theme-tools": "0.1.1"
|
|
26
26
|
}
|
|
27
27
|
}
|