Skip to content

Fix the HarmonyOS symbol-upload instructions - #320

Merged
Fiona2016 merged 2 commits into
mainfrom
docs/hvigor-plugin-0.1.4
Aug 27, 2026
Merged

Fix the HarmonyOS symbol-upload instructions#320
Fiona2016 merged 2 commits into
mainfrom
docs/hvigor-plugin-0.1.4

Conversation

@Fiona2016

Copy link
Copy Markdown
Contributor

Three things in the HarmonyOS symbol-upload docs did not work, plus one that stopped working with plugin 0.1.4.

Installation

The docs said to run npm install -D @flashcatcloud/hvigor-plugin in the project root. A HarmonyOS project root has no package.json, and npm install walks up the directory tree looking for one — so the install lands in whatever unrelated project it finds in a parent directory, commonly the user's home directory, and fails on that project's dependencies.

Declaring the plugin in hvigor/hvigor-config.json5 is now the documented path. The npm route is kept as an alternative, with npm init -y called out as the prerequisite.

Build directory

The sample command used -p product=default, where the build output happens to coincide with the plugin's hard-coded build/default. Any other product silently scanned the wrong directory, and the buildDir option that fixes it was never mentioned. Plugin 0.1.4 derives the directory from the product being built, so the docs now say so and keep buildDir as an override.

The hvigor daemon

hvigor builds through a long-lived daemon that copies the environment once when it is created and afterwards refreshes only a fixed allowlist. A reused daemon therefore hands the plugin the environment of whoever started it — an IDE build, or an earlier command — not the one the user just typed, and the resulting failure is silent. The upload command now carries --no-daemon, with the reason spelled out.

The removed enabled option

Plugin 0.1.4 drops the enabled option: the upload task declares no build dependencies, so naming it on the command line is already the switch. The samples carried both the option and the FLASHCAT_UPLOAD variable that fed it, which would be a hard error in the sample and dead weight in the command.

Also requires 0.1.4 or later, since 0.1.3 registered the task with a dependency on assembleHar — a task HAP modules do not have — which fails the build outright.

Pairs with flashcatcloud/fc-sdk-harmony#34. Merge only after 0.1.4 is published to npm, otherwise the new instructions point at a version that does not exist.

Three corrections to the hvigor-plugin integration steps:

Installation. A HarmonyOS project root has no package.json, so the documented
`npm install -D` walks up the directory tree and installs into whatever unrelated
project it finds in a parent directory. Declaring the plugin in
hvigor/hvigor-config.json5 is now the documented path, with `npm init -y` called
out as the prerequisite for the npm route.

Build directory. The sample command used `-p product=default`, where the build
output happens to coincide with the plugin's hard-coded `build/default`. Any
other product silently scanned the wrong directory, and the `buildDir` option
that fixes it was never mentioned. Plugin 0.1.4 derives the directory from the
product being built; the docs now say so and keep `buildDir` as an override.

Daemon. hvigor builds through a long-lived daemon that copies the environment
once when it is created and refreshes only a fixed allowlist afterwards, so a
reused daemon hands the plugin stale or empty values — silently skipping the
upload, or uploading under the previous version number. The upload command now
carries --no-daemon, with the reason spelled out.

Also require 0.1.4 or later: 0.1.3 registered the task with a dependency on
assembleHar, which a HAP module does not have, failing the build.
The plugin no longer takes an enabled flag: the upload task declares no build
dependencies, so naming it on the command line is already the switch. The samples
and the run commands carried both, which would now be a hard error in the sample
and a meaningless variable in the command.

FLASHCAT_API_KEY is the only value the documented setup still reads from the
environment, so the daemon warning now uses it as the example of a silent skip.
@Fiona2016
Fiona2016 merged commit 4182f80 into main Aug 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant