Fix the HarmonyOS symbol-upload instructions - #320
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-pluginin the project root. A HarmonyOS project root has nopackage.json, andnpm installwalks 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.json5is now the documented path. The npm route is kept as an alternative, withnpm init -ycalled 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-codedbuild/default. Any other product silently scanned the wrong directory, and thebuildDiroption 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 keepbuildDiras 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
enabledoptionPlugin 0.1.4 drops the
enabledoption: 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 theFLASHCAT_UPLOADvariable 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.