Skip to content

hvigor-plugin 0.1.5: fix task registration, build-dir resolution, and three review findings - #37

Merged
Fiona2016 merged 7 commits into
mainfrom
feat/hvigor-plugin-0.2.0
Aug 28, 2026
Merged

hvigor-plugin 0.1.5: fix task registration, build-dir resolution, and three review findings#37
Fiona2016 merged 7 commits into
mainfrom
feat/hvigor-plugin-0.2.0

Conversation

@Fiona2016

@Fiona2016 Fiona2016 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

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.3 should
pick this up.

Do not publish yet — holding for acceptance.

Fixes

  • A disabled task now says so. enabled: false returned without a word, which in a
    build 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.
  • An empty buildDir no longer resolves to the module root. An unassigned
    FLASHCAT_BUILD_DIR= reaches the option as ''. The sourcemap search walks
    recursively, so scanning the module root 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 another
    door. Covered by a regression test.
  • The demo uploads under the keys it actually reports. It was wired as
    fc-sdk-harmony-demo@0.1.0, but reports RUM as flashcat-harmony-demo (DemoConfig's
    default, and what demo_config.json ships) at 0.1.1 (AppScope versionName).
    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.
  • The plugin build gate can now fail. It ran the task and asserted nothing. With
    -p product=default the context 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, which only the probe path emits.
  • HvigorNode.registerTask describes hvigor's API again. The optional
    dependencies/postDependencies fields were dropped because this plugin stopped
    using them, but the interface models hvigor, not this plugin's usage of it.

Also: the skip warning names the apiKey option rather than only the environment
variable and points at --no-daemon; entry/README.md documents that
hvigor-plugin/dist must be built before opening the project, since
entry/hvigorfile.ts imports 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.tsFlashcatPluginOptions has the same fields; the only type-level
    changes are additions (getParentNode?, getContext?, resolveBuildDir). Nothing
    was removed.
  • A consumer file written against the 0.1.3 documented API — flashcatSymbolUploadPlugin
    with enabled and buildDir, plus a direct uploadAll call — type-checks against
    0.1.5 under --strict with no edits.

Verification

  • npm test in hvigor-plugin: 30 passing, tsc -b clean
  • SDK unit tests: 148 passing
  • The build-gate assertion was exercised against stubbed task output: it passes on the
    probe line, and fails both on the fallback line and on no output at all.

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.
@Fiona2016 Fiona2016 changed the title hvigor-plugin 0.2.0: correct the version, and close three gaps found reviewing 0.1.4 hvigor-plugin 0.2.0: remove the enabled option, and close three gaps Aug 28, 2026
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.
@Fiona2016 Fiona2016 changed the title hvigor-plugin 0.2.0: remove the enabled option, and close three gaps hvigor-plugin 0.1.5: fix task registration, build-dir resolution, and three review findings Aug 28, 2026
@Fiona2016
Fiona2016 merged commit de2f229 into main Aug 28, 2026
6 checks 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