expo-harmony-toolkit 1.5.0 → 1.5.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.en.md CHANGED
@@ -7,9 +7,9 @@
7
7
  <a href="./README.en.md">English</a>
8
8
  </p>
9
9
  <p>
10
- <a href="https://github.com/BlackishGreen33/Expo-Harmony-Plugin/actions/workflows/ci.yml"><img alt="Checks" src="https://img.shields.io/badge/checks-passing-16a34a?style=flat-square&logo=githubactions&logoColor=white"></a>
10
+ <a href="https://github.com/BlackishGreen33/Expo-Harmony-Toolkit/actions/workflows/ci.yml"><img alt="Checks" src="https://img.shields.io/badge/checks-passing-16a34a?style=flat-square&logo=githubactions&logoColor=white"></a>
11
11
  <a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-0f766e?style=flat-square"></a>
12
- <a href="https://github.com/BlackishGreen33/Expo-Harmony-Plugin/releases"><img alt="Version" src="https://img.shields.io/badge/version-v1.5.0-111827?style=flat-square"></a>
12
+ <a href="https://github.com/BlackishGreen33/Expo-Harmony-Toolkit/releases"><img alt="Version" src="https://img.shields.io/badge/version-v1.5.2-111827?style=flat-square"></a>
13
13
  <a href="./docs/support-matrix.md"><img alt="Matrix" src="https://img.shields.io/badge/matrix-expo55--rnoh082--ui--stack-2563eb?style=flat-square"></a>
14
14
  <img alt="Input" src="https://img.shields.io/badge/input-Managed%2FCNG-059669?style=flat-square">
15
15
  </p>
@@ -23,10 +23,10 @@
23
23
  </div>
24
24
 
25
25
  > [!IMPORTANT]
26
- > `v1.5.0` makes one formal public promise only: `expo55-rnoh082-ui-stack`. This is not a claim that arbitrary Expo applications can be published to HarmonyOS unchanged.
26
+ > `v1.5.2` continues to make one formal public promise only: `expo55-rnoh082-ui-stack`. This is not a claim that arbitrary Expo applications can be published to HarmonyOS unchanged.
27
27
 
28
28
  > [!TIP]
29
- > The three validated `@react-native-oh-tpl/*` adapters are currently consumed via exact Git URLs and commits. For repository development and the official UI-stack sample, prefer `pnpm install --ignore-scripts` so adapter prepare hooks do not fail on private upstream resources.
29
+ > The two validated `@react-native-oh-tpl/*` adapters in the public matrix are currently consumed via exact Git URLs and commits. For repository development and the official UI-stack sample, prefer `pnpm install --ignore-scripts` so adapter prepare hooks do not fail on private upstream resources.
30
30
 
31
31
  ## Overview
32
32
 
@@ -46,10 +46,10 @@
46
46
 
47
47
  | Item | Status |
48
48
  | --- | --- |
49
- | Current version | `v1.5.0` |
49
+ | Current version | `v1.5.2` |
50
50
  | Public matrix | `expo55-rnoh082-ui-stack` |
51
51
  | Supported input | Managed/CNG Expo projects |
52
- | Validated JS/UI capabilities | `expo-router`, `expo-linking`, `expo-constants`, `react-native-reanimated`, `react-native-svg`, `react-native-gesture-handler` |
52
+ | Validated JS/UI capabilities | `expo-router`, `expo-linking`, `expo-constants`, `react-native-reanimated`, `react-native-svg` |
53
53
  | Build path | `doctor -> init -> bundle -> build-hap` |
54
54
  | Primary sample | `examples/official-ui-stack-sample` |
55
55
  | Regression baselines | `examples/official-app-shell-sample`, `examples/official-minimal-sample` |
@@ -67,58 +67,121 @@
67
67
 
68
68
  </details>
69
69
 
70
- ## Quick Start
70
+ ## Installation
71
71
 
72
- For this repository:
72
+ Published npm package:
73
73
 
74
74
  ```bash
75
- pnpm install --ignore-scripts
76
- pnpm build
77
- pnpm test
75
+ pnpm add -D expo-harmony-toolkit
76
+ # or
77
+ npm install -D expo-harmony-toolkit
78
+ ```
79
+
80
+ After installation, prefer invoking the CLI through the local project dependency:
81
+
82
+ ```bash
83
+ pnpm exec expo-harmony doctor --project-root .
84
+ # or
85
+ npx expo-harmony doctor --project-root .
78
86
  ```
79
87
 
80
- For any Expo project:
88
+ If you are developing inside this repository or running the official UI-stack sample directly, still prefer:
81
89
 
82
90
  ```bash
83
- expo-harmony doctor --project-root /path/to/app
84
- expo-harmony doctor --project-root /path/to/app --strict
85
- expo-harmony init --project-root /path/to/app
86
- expo-harmony sync-template --project-root /path/to/app
91
+ pnpm install --ignore-scripts
87
92
  ```
88
93
 
89
- Inside the project root:
94
+ This avoids adapter prepare hooks failing on private upstream resources.
95
+
96
+ ## Recommended Plugin Wiring
97
+
98
+ Add the config plugin to your Expo config so prebuild metadata and CLI-derived Harmony identifiers stay aligned:
99
+
100
+ ```json
101
+ {
102
+ "expo": {
103
+ "android": {
104
+ "package": "com.example.app"
105
+ },
106
+ "plugins": [
107
+ "expo-router",
108
+ [
109
+ "expo-harmony-toolkit",
110
+ {
111
+ "entryModuleName": "entry"
112
+ }
113
+ ]
114
+ ]
115
+ }
116
+ }
117
+ ```
118
+
119
+ Notes:
120
+
121
+ - If `android.package` or `ios.bundleIdentifier` is already set, you usually do not need to pass `bundleName`
122
+ - `entryModuleName` defaults to `entry`; only pin it explicitly when you want to make that choice obvious
123
+ - the toolkit does not auto-install validated UI-stack dependencies; use `doctor --strict` as the real admission gate
124
+
125
+ ## Usage
126
+
127
+ 1. Run the admission check first:
90
128
 
91
129
  ```bash
92
130
  cd /path/to/app
93
- expo-harmony env --strict
94
- expo-harmony build-hap --mode debug
131
+ pnpm exec expo-harmony doctor --project-root .
132
+ pnpm exec expo-harmony doctor --project-root . --strict
95
133
  ```
96
134
 
97
- If you only need the JavaScript artifact:
135
+ 2. Generate or refresh the managed Harmony sidecar:
98
136
 
99
137
  ```bash
100
- expo-harmony bundle
138
+ pnpm exec expo-harmony init --project-root .
139
+ pnpm exec expo-harmony sync-template --project-root .
101
140
  ```
102
141
 
142
+ 3. Generate the JavaScript bundle, or continue into Harmony build steps:
143
+
144
+ ```bash
145
+ pnpm exec expo-harmony bundle --project-root .
146
+ pnpm exec expo-harmony env --strict
147
+ pnpm exec expo-harmony build-hap --mode debug
148
+ ```
149
+
150
+ 4. For a release build, verify signing first and then run:
151
+
152
+ ```bash
153
+ pnpm exec expo-harmony env
154
+ pnpm exec expo-harmony build-hap --mode release
155
+ ```
156
+
157
+ Common decision points:
158
+
159
+ - Want to know whether the current project still matches the public matrix: run `doctor --strict`
160
+ - Changed dependencies, Expo config, or plugin wiring: run `sync-template`
161
+ - Only want to verify JavaScript/UI portability: run `bundle`
162
+ - About to open DevEco Studio or build a HAP locally: run `env` first
163
+
103
164
  ## Support Matrix
104
165
 
105
- `v1.5.0` stays on one public matrix: `expo55-rnoh082-ui-stack`.
166
+ `v1.5.2` stays on one public matrix: `expo55-rnoh082-ui-stack`.
106
167
 
107
168
  - Expo SDK: `55`
108
- - React: `19.2.x`
109
- - React Native: `0.83.x`
169
+ - React: `19.1.1`
170
+ - React Native: `0.82.1`
110
171
  - RNOH and `@react-native-oh/react-native-harmony-cli`: `0.82.18`
111
172
  - App Shell packages: `expo-router`, `expo-linking`, `expo-constants`
112
- - UI stack packages: `react-native-reanimated`, `react-native-svg`, `react-native-gesture-handler`
173
+ - UI stack packages: `react-native-reanimated`, `react-native-svg`
113
174
  - Harmony adapters: the matching `@react-native-oh-tpl/*` exact Git specifiers
114
175
  - Native identifier: at least `android.package` or `ios.bundleIdentifier`
115
176
 
177
+ `react-native-gesture-handler` is no longer part of the public matrix. It remains a manual exploration path until the current `@react-native-oh-tpl/react-native-gesture-handler` and `@react-native-oh/react-native-harmony@0.82.18` runtime pairing passes on-device validation.
178
+
116
179
  See [docs/support-matrix.md](./docs/support-matrix.md) for the full allowlist, pairing rules, exact specifiers, issue codes, and release gates.
117
180
 
118
181
  ## Official Samples
119
182
 
120
183
  - `examples/official-ui-stack-sample`
121
- The primary public sample for `v1.5.0`, covering router, linking, constants, SVG, gesture, reanimated, and Harmony sidecar build flow.
184
+ The primary public sample for `v1.5.0`, covering router, linking, constants, SVG, reanimated, and Harmony sidecar build flow.
122
185
  - `examples/official-app-shell-sample`
123
186
  The `v1.1` App Shell regression baseline that protects router behavior while UI-stack support is finalized.
124
187
  - `examples/official-minimal-sample`
@@ -169,13 +232,14 @@ Automatic publishing defaults to hosted CI only:
169
232
 
170
233
  - GitHub workflow runs `build/test/pack/tarball smoke`
171
234
  - `build-hap --mode debug` does not block npm publish
172
- - npm publish uses the `latest` dist-tag and provenance
235
+ - GitHub auto-publish uses the `latest` dist-tag and provenance
236
+ - local manual publishing uses the `latest` dist-tag
173
237
 
174
238
  Manual Harmony acceptance still requires:
175
239
 
176
240
  - `official-ui-stack-sample` launches successfully
177
241
  - SVG renders correctly
178
- - the gesture triggers visible animation
242
+ - pressing the home-screen motion rail triggers visible animation
179
243
  - routing still works after the animation completes
180
244
  - `Build Debug Hap(s)` succeeds
181
245
 
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  <a href="./README.en.md">English</a>
8
8
  </p>
9
9
  <p>
10
- <a href="https://github.com/BlackishGreen33/Expo-Harmony-Plugin/actions/workflows/ci.yml"><img alt="Checks" src="https://img.shields.io/badge/checks-passing-16a34a?style=flat-square&logo=githubactions&logoColor=white"></a>
10
+ <a href="https://github.com/BlackishGreen33/Expo-Harmony-Toolkit/actions/workflows/ci.yml"><img alt="Checks" src="https://img.shields.io/badge/checks-passing-16a34a?style=flat-square&logo=githubactions&logoColor=white"></a>
11
11
  <a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-0f766e?style=flat-square"></a>
12
- <a href="https://github.com/BlackishGreen33/Expo-Harmony-Plugin/releases"><img alt="Version" src="https://img.shields.io/badge/version-v1.5.0-111827?style=flat-square"></a>
12
+ <a href="https://github.com/BlackishGreen33/Expo-Harmony-Toolkit/releases"><img alt="Version" src="https://img.shields.io/badge/version-v1.5.2-111827?style=flat-square"></a>
13
13
  <a href="./docs/support-matrix.md"><img alt="Matrix" src="https://img.shields.io/badge/matrix-expo55--rnoh082--ui--stack-2563eb?style=flat-square"></a>
14
14
  <img alt="Input" src="https://img.shields.io/badge/input-Managed%2FCNG-059669?style=flat-square">
15
15
  </p>
@@ -23,10 +23,10 @@
23
23
  </div>
24
24
 
25
25
  > [!IMPORTANT]
26
- > `v1.5.0` 只对 `expo55-rnoh082-ui-stack` 做正式公开承诺。这不是“任意 Expo 项目都能原样发布到 HarmonyOS”的声明,而是对一条受限、可验证矩阵的稳定承诺。
26
+ > `v1.5.2` 继续只对 `expo55-rnoh082-ui-stack` 做正式公开承诺。这不是“任意 Expo 项目都能原样发布到 HarmonyOS”的声明,而是对一条受限、可验证矩阵的稳定承诺。
27
27
 
28
28
  > [!TIP]
29
- > 由于当前三套 `@react-native-oh-tpl/*` adapter 依赖以 Git URL + exact commit 形式接入,仓库开发和官方 UI-stack sample 推荐使用 `pnpm install --ignore-scripts`,避免 Git adapter 在 prepare 阶段拉取私有资源而中断安装。
29
+ > 由于当前公开矩阵内的两套 `@react-native-oh-tpl/*` adapter 依赖以 Git URL + exact commit 形式接入,仓库开发和官方 UI-stack sample 推荐使用 `pnpm install --ignore-scripts`,避免 Git adapter 在 prepare 阶段拉取私有资源而中断安装。
30
30
 
31
31
  ## 概览
32
32
 
@@ -46,10 +46,10 @@
46
46
 
47
47
  | 项目 | 说明 |
48
48
  | --- | --- |
49
- | 当前版本 | `v1.5.0` |
49
+ | 当前版本 | `v1.5.2` |
50
50
  | 唯一公开矩阵 | `expo55-rnoh082-ui-stack` |
51
51
  | 输入范围 | Managed/CNG Expo 项目 |
52
- | 已验证 JS/UI 能力 | `expo-router`、`expo-linking`、`expo-constants`、`react-native-reanimated`、`react-native-svg`、`react-native-gesture-handler` |
52
+ | 已验证 JS/UI 能力 | `expo-router`、`expo-linking`、`expo-constants`、`react-native-reanimated`、`react-native-svg` |
53
53
  | 构建链 | `doctor -> init -> bundle -> build-hap` |
54
54
  | 主 sample | `examples/official-ui-stack-sample` |
55
55
  | 回归基线 | `examples/official-app-shell-sample`、`examples/official-minimal-sample` |
@@ -67,58 +67,121 @@
67
67
 
68
68
  </details>
69
69
 
70
- ## 快速开始
70
+ ## 安装方式
71
71
 
72
- 仓库自身:
72
+ 已发布 npm 包:
73
73
 
74
74
  ```bash
75
- pnpm install --ignore-scripts
76
- pnpm build
77
- pnpm test
75
+ pnpm add -D expo-harmony-toolkit
76
+ #
77
+ npm install -D expo-harmony-toolkit
78
+ ```
79
+
80
+ 安装完成后,推荐通过本地项目依赖调用 CLI:
81
+
82
+ ```bash
83
+ pnpm exec expo-harmony doctor --project-root .
84
+ # 或
85
+ npx expo-harmony doctor --project-root .
78
86
  ```
79
87
 
80
- 任意 Expo 项目:
88
+ 如果你是在这个仓库里开发,或直接运行官方 UI-stack sample,仍推荐:
81
89
 
82
90
  ```bash
83
- expo-harmony doctor --project-root /path/to/app
84
- expo-harmony doctor --project-root /path/to/app --strict
85
- expo-harmony init --project-root /path/to/app
86
- expo-harmony sync-template --project-root /path/to/app
91
+ pnpm install --ignore-scripts
87
92
  ```
88
93
 
89
- 进入项目根目录后的 CLI 构建链:
94
+ 因为当前公开矩阵内的两套 `@react-native-oh-tpl/*` adapter 在 prepare 阶段可能访问私有上游资源。
95
+
96
+ ## 推荐接入方式
97
+
98
+ 建议把 config plugin 写进 Expo 配置,这样 `prebuild` 元数据和 CLI 读取的 Harmony 标识会保持一致:
99
+
100
+ ```json
101
+ {
102
+ "expo": {
103
+ "android": {
104
+ "package": "com.example.app"
105
+ },
106
+ "plugins": [
107
+ "expo-router",
108
+ [
109
+ "expo-harmony-toolkit",
110
+ {
111
+ "entryModuleName": "entry"
112
+ }
113
+ ]
114
+ ]
115
+ }
116
+ }
117
+ ```
118
+
119
+ 说明:
120
+
121
+ - 如果已经配置了 `android.package` 或 `ios.bundleIdentifier`,通常不需要额外传 `bundleName`
122
+ - `entryModuleName` 默认就是 `entry`,只有你需要显式固定时才需要写出来
123
+ - toolkit 不会替你自动补齐 UI-stack 依赖;依赖是否落入公开矩阵,以 `doctor --strict` 结果为准
124
+
125
+ ## 使用方法
126
+
127
+ 1. 先做准入检查:
90
128
 
91
129
  ```bash
92
130
  cd /path/to/app
93
- expo-harmony env --strict
94
- expo-harmony build-hap --mode debug
131
+ pnpm exec expo-harmony doctor --project-root .
132
+ pnpm exec expo-harmony doctor --project-root . --strict
95
133
  ```
96
134
 
97
- 如果你只想单独生成 JS bundle
135
+ 2. 生成或刷新受管 Harmony sidecar
98
136
 
99
137
  ```bash
100
- expo-harmony bundle
138
+ pnpm exec expo-harmony init --project-root .
139
+ pnpm exec expo-harmony sync-template --project-root .
101
140
  ```
102
141
 
142
+ 3. 生成 JS bundle,或继续发起 Harmony 构建:
143
+
144
+ ```bash
145
+ pnpm exec expo-harmony bundle --project-root .
146
+ pnpm exec expo-harmony env --strict
147
+ pnpm exec expo-harmony build-hap --mode debug
148
+ ```
149
+
150
+ 4. 如果需要 release 构建,先确认签名环境已就绪,再执行:
151
+
152
+ ```bash
153
+ pnpm exec expo-harmony env
154
+ pnpm exec expo-harmony build-hap --mode release
155
+ ```
156
+
157
+ 常见使用判断:
158
+
159
+ - 想知道当前项目是否还在公开矩阵里:跑 `doctor --strict`
160
+ - 刚改过依赖、Expo 配置或插件:先跑 `sync-template`
161
+ - 只想验证 JS/UI 侧是否能打包:跑 `bundle`
162
+ - 准备进 DevEco Studio 或本机构建 HAP:先跑 `env`
163
+
103
164
  ## 支持矩阵
104
165
 
105
- `v1.5.0` 继续坚持单矩阵路线:`expo55-rnoh082-ui-stack`。
166
+ `v1.5.2` 继续坚持单矩阵路线:`expo55-rnoh082-ui-stack`。
106
167
 
107
168
  - Expo SDK:`55`
108
- - React:`19.2.x`
109
- - React Native:`0.83.x`
169
+ - React:`19.1.1`
170
+ - React Native:`0.82.1`
110
171
  - RNOH / `@react-native-oh/react-native-harmony-cli`:`0.82.18`
111
172
  - App Shell 依赖:`expo-router`、`expo-linking`、`expo-constants`
112
- - UI stack 依赖:`react-native-reanimated`、`react-native-svg`、`react-native-gesture-handler`
113
- - Harmony adapter:对应三项 `@react-native-oh-tpl/*` exact Git specifier
173
+ - UI stack 依赖:`react-native-reanimated`、`react-native-svg`
174
+ - Harmony adapter:对应两项 `@react-native-oh-tpl/*` exact Git specifier
114
175
  - 原生标识:至少配置 `android.package` 或 `ios.bundleIdentifier`
115
176
 
177
+ 当前不再把 `react-native-gesture-handler` 放进公开矩阵。它仍可作为手动探索项,但当前 `@react-native-oh-tpl/react-native-gesture-handler` 与 `@react-native-oh/react-native-harmony@0.82.18` 的设备侧 runtime 组合还没有通过正式验收。
178
+
116
179
  完整白名单、配对规则、exact specifier、issue code 与 release gate 见 [docs/support-matrix.md](./docs/support-matrix.md)。
117
180
 
118
181
  ## 官方 Samples
119
182
 
120
183
  - `examples/official-ui-stack-sample`
121
- 当前唯一对外主 sample,同时覆盖 router、linking、constants、SVG、gesture、reanimated 和 Harmony sidecar 构建链。
184
+ 当前唯一对外主 sample,同时覆盖 router、linking、constants、SVG、reanimated 和 Harmony sidecar 构建链。
122
185
  - `examples/official-app-shell-sample`
123
186
  `v1.1` App Shell 回归基线,用来防止 UI-stack 收口引入 router 退化。
124
187
  - `examples/official-minimal-sample`
@@ -169,13 +232,14 @@ expo-harmony bundle
169
232
 
170
233
  - GitHub workflow 跑 `build/test/pack/tarball smoke`
171
234
  - `build-hap --mode debug` 不阻塞 npm publish
172
- - npm 发布使用 `latest` dist-tag 和 provenance
235
+ - GitHub 自动发布使用 `latest` dist-tag 和 provenance
236
+ - 本地手动发布使用 `latest` dist-tag
173
237
 
174
238
  手动 Harmony 验收继续要求:
175
239
 
176
240
  - `official-ui-stack-sample` 成功启动
177
241
  - SVG 正常渲染
178
- - gesture 能触发可见动画
242
+ - 点击首页 motion rail 后能触发可见动画
179
243
  - 动画完成后路由跳转仍正常
180
244
  - `Build Debug Hap(s)` 成功
181
245