platform icon indicating copy to clipboard operation
platform copied to clipboard

@hcengineering/* 0.7.423 still missing TypeScript declarations despite PR #10768

Open dugynoo opened this issue 6 months ago • 6 comments

Problem

Published tarballs of @hcengineering/* packages at version 0.7.423 (published 2026-05-10) still ship without types/*.d.ts files, despite PR #10768 having been merged on 2026-04-15.

Evidence

$ npm pack @hcengineering/[email protected]
$ tar -tzf hcengineering-core-0.7.423.tgz | grep -c "\.d\.ts$"
0   # zero .d.ts files

$ npm pack @hcengineering/[email protected]
$ tar -tzf hcengineering-core-0.7.19.tgz | grep -c "\.d\.ts$"
20+ # types/ directory present in older release
Version Files in tarball .d.ts files
@hcengineering/[email protected] 230 yes
@hcengineering/[email protected] 157 none

package.json in 0.7.423 still declares "types": "types/index.d.ts", but the file is not in the tarball, so TypeScript consumers get TS7016: Could not find a declaration file for module '@hcengineering/core'.

Context

  • PR #10768 added the Emit TypeScript declarations step (rush validate) to publish-npm.yml and was merged into develop (commit cc9c8b87).
  • The gitHead of 0.7.423 is a00c0135 (commit "Bump version" on 2026-05-10), which is 426 commits ahead of the PR #10768 merge commit — so the fix is in the publishing source tree.
  • The current publish-npm.yml on develop still has the Emit TypeScript declarations step. So either:
    • rush validate is silently failing inside that step (no error surfaced); or
    • safe-publish.js is invoking npm publish from a stage where types/ has been cleaned/not yet generated; or
    • The 0.7.423 publish was kicked off through a different path that bypasses the workflow.

Affected packages (all 0.7.411+, sampled):

  • @hcengineering/core
  • @hcengineering/account-client
  • @hcengineering/api-client
  • @hcengineering/tracker
  • @hcengineering/task
  • @hcengineering/card
  • @hcengineering/contact
  • @hcengineering/calendar
  • @hcengineering/text, @hcengineering/text-markdown
  • (probably all @hcengineering/* packages published from this monorepo)

Impact

Downstream TypeScript consumers (Huly MCP servers, custom integrations, the official huly-examples repo) cannot consume any @hcengineering/* version newer than 0.7.382 without manually shimming declarations. This blocks adoption of cards processes, associations, automation, user statuses, time service, and every other feature added since 0.7.382.

Suggested fix

  1. Trigger the publish-npm.yml workflow again and verify Emit TypeScript declarations actually produces types/index.d.ts for at least @hcengineering/core before safe-publish.js runs.
  2. If a silent failure is suspected, add ls -la <package>/types/index.d.ts || (echo "::error::types/ missing" && exit 1) between validate and publish to fail loudly.
  3. Re-publish as 0.7.424 with declarations intact.

Happy to verify the result by re-installing in our consumer project once a new version is up.

dugynoo avatar May 24 '26 17:05 dugynoo

Connected to Huly®: UBERF-16471

huly-github-staging avatar May 24 '26 17:05 huly-github-staging

Confirming this is still broken as of today, and adding a correction: 0.7.382 is not usable either, so the actual last consumable versions are the 0.7.19-era packages from before the huly.core migration.

0.7.382 was published with unsubstituted workspace: protocol dependencies, which npm/pnpm cannot resolve outside the monorepo:

$ npm view @hcengineering/[email protected] dependencies
{ '@hcengineering/core': 'workspace:^0.7.382',
  '@hcengineering/platform': 'workspace:^0.7.382' }
$ pnpm add @hcengineering/[email protected]
ERR_PNPM_WORKSPACE_PKG_NOT_FOUND ... "@hcengineering/core@workspace:^0.7.382" is in the dependencies but no package named "@hcengineering/core" is present in the workspace

Same for api-client and core at 0.7.382. Combined with the missing .d.ts in 0.7.411/0.7.413/0.7.423, TypeScript consumers are effectively stuck on the October 2025 releases ([email protected], [email protected]). Also note @hcengineering/document was never republished past 0.7.0 at all.

The JS itself is fine — a downstream project builds and bundles successfully against 0.7.423 — so a re-publish of the existing code with the types/ directory included (and a tarball-content check in safe-publish.js) would unblock everyone.

This is a blocking issue for add the new functionalities to custom integrations like the MCPs and custom clients.

spatialy avatar Jul 08 '26 01:07 spatialy

The latest code already have those fixes in it, both types and builds are generating properly as well. The only thing I noticed was the github actions are failing to publish because of an npm auth. Maybe someone with the proper access can configure it on the actions to push a newer version.

this was the last failed one.

CdTgr avatar Aug 27 '26 13:08 CdTgr

Can confirm independently — hit this while extending a third-party MCP server (huly-mcp-sdk) that pins @hcengineering/core@^0.7.0. Adding any newer @hcengineering/* dependency (even unrelated ones like attachment or drive) drags core up via peer resolution and breaks strict type-checking for the entire consuming project, not just the new import.

Confirmed via tarball inspection (not npm install, to rule out local resolution weirdness):

$ for v in 0.7.26 0.7.382 0.7.411 0.7.413 0.7.423; do
    echo "$v: $(curl -s "https://registry.npmjs.org/@hcengineering/core/-/core-$v.tgz" | tar tz 2>/dev/null | grep -c '^package/types/')"
  done
0.7.26: 88
0.7.382: 88
0.7.411: 0
0.7.413: 0
0.7.423: 0

Matches your finding exactly — good through 0.7.382, broken from 0.7.411 onward.

Additional packages confirmed affected (only version available is 0.7.423, all pull the broken core):

  • @hcengineering/attachment (0.7.382+; 0.7.0 still has types and works as a pin)
  • @hcengineering/drive (only 0.7.423 published — no older version to fall back to)
  • @hcengineering/hr, @hcengineering/recruit, @hcengineering/board (only 0.7.411+ published)

For anyone hitting this in the meantime: pinning affected deps to their last pre-0.7.411 published version (where one exists) works around it without forcing core up. No workaround exists for packages that only ever published 0.7.411+.

JoKeks2023 avatar Aug 29 '26 13:08 JoKeks2023

Checked against the current code: in addition to #10768, the alternate tag workflow now emits declarations as well (#10842, .github/workflows/main.yml), so future published packages ship types/*.d.ts. The already-published 0.7.423 tarballs cannot change; a new release is needed. If maintainers agree, please consider closing once such a release exists.

MichaelUray avatar Oct 20 '26 12:10 MichaelUray

@dugynoo — based on the check described above, this looks resolved in the current code. Could you please close this issue if you agree? If you think it is not fixed yet, please describe what still goes wrong (steps, expected vs. actual behaviour), so it can be looked at again.

MichaelUray avatar Oct 20 '26 21:10 MichaelUray