hvigor-plugin 0.1.5: fix task registration, build-dir resolution, and three review findings - #37
Merged
Merged
Conversation
An unassigned FLASHCAT_BUILD_DIR= in a pipeline reaches the option as '', which resolved to the module root. The sourcemap search walks recursively, so that collects every product's sourceMaps.map and uploads an arbitrary one under the current version — the same wrong-directory failure the product-aware default was added to prevent, reached through a different door. The warning for an empty key now names the apiKey option rather than only the environment variable, and points at --no-daemon, which is the likeliest reason the value arrived empty.
The demo wired symbol upload as fc-sdk-harmony-demo@0.1.0, but it reports RUM under flashcat-harmony-demo (DemoConfig's default, and what demo_config.json ships) at version 0.1.1 (AppScope versionName). ArkTS symbolication matches on service and version, so both keys were wrong and the demo could never validate symbolication end to end. Also document that hvigor-plugin/dist must be built before opening the project: entry/hvigorfile.ts imports it, hvigor evaluates that file on every invocation including DevEco project sync, and dist is not checked in.
The gate ran the upload task and asserted nothing. With -p product=default the probe's success and its fallback both resolve to build/default, and an upload failure never fails the build, so the step stayed green even if reading the product from the hvigor context was broken outright. It now requires the "(product 'default')" suffix in the scan line, which only the probe path emits.
Removing the enabled option is a breaking change, and 0.1.3 documented the dependency as ^0.1.3 — a range that picks up 0.1.4 automatically. Shipping it as a patch would have changed behaviour under everyone already on 0.1.x without them asking for it. 0.2.0 leaves that range where it is and makes the upgrade a deliberate step.
Removing it assumed that naming the task on the command line is an equivalent switch. It is not: in a pipeline, flipping a variable and editing the build command are not the same cost, and the second may need review. Consumers who want the upload off for one run reach for a variable, and hand-roll this gate when the plugin does not offer it. The defect was never that the option existed — it was that `enabled: false` returned without a word, which in a build log is indistinguishable from a successful upload. It now logs why it skipped.
With the enabled option kept, nothing here is breaking: the public type surface is a superset of 0.1.3 and every behaviour change is a fix to something that could not have worked. A patch release is the honest label, and consumers on ^0.1.3 pick it up as they should.
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.
Follow-up to #34. A patch release: the public type surface is a superset of 0.1.3 and
every behaviour change fixes something that could not have worked, so
^0.1.3shouldpick this up.
Do not publish yet — holding for acceptance.
Fixes
enabled: falsereturned without a word, which in abuild log is indistinguishable from a successful upload. The option stays: in a
pipeline, flipping a variable and editing the build command are not the same cost,
and consumers hand-roll this gate when the plugin does not offer it.
buildDirno longer resolves to the module root. An unassignedFLASHCAT_BUILD_DIR=reaches the option as''. The sourcemap search walksrecursively, so scanning the module root collects every product's
sourceMaps.mapand uploads an arbitrary one under the current version — the same wrong-directory
failure the product-aware default was added to prevent, reached through another
door. Covered by a regression test.
fc-sdk-harmony-demo@0.1.0, but reports RUM asflashcat-harmony-demo(DemoConfig'sdefault, and what
demo_config.jsonships) at0.1.1(AppScopeversionName).ArkTS symbolication matches on service + version, so both keys were wrong and the
demo — the only end-to-end surface here — could never validate symbolication.
-p product=defaultthe context probe's success and its fallback both resolve tobuild/default, and an upload failure never fails the build, so the step stayedgreen even if reading the product from the hvigor context was broken outright. It
now requires the
(product 'default')suffix, which only the probe path emits.HvigorNode.registerTaskdescribes hvigor's API again. The optionaldependencies/postDependenciesfields were dropped because this plugin stoppedusing them, but the interface models hvigor, not this plugin's usage of it.
Also: the skip warning names the
apiKeyoption rather than only the environmentvariable and points at
--no-daemon;entry/README.mddocuments thathvigor-plugin/distmust be built before opening the project, sinceentry/hvigorfile.tsimports it and hvigor evaluates that file on every invocation,DevEco project sync included.
Compatibility with 0.1.3
Checked against the published 0.1.3 tarball, not by inspection:
index.d.ts— the package's root exports are byte-identical.upload.d.ts,collect.d.ts,elf.d.ts— byte-identical.plugin.d.ts—FlashcatPluginOptionshas the same fields; the only type-levelchanges are additions (
getParentNode?,getContext?,resolveBuildDir). Nothingwas removed.
flashcatSymbolUploadPluginwith
enabledandbuildDir, plus a directuploadAllcall — type-checks against0.1.5 under
--strictwith no edits.Verification
npm testinhvigor-plugin: 30 passing,tsc -bcleanprobe line, and fails both on the fallback line and on no output at all.