Summary
The package build script does not clean generated output portably or sequentially, and a second consecutive build fails on Windows.
Affected version
@larksuiteoapi/node-sdk 1.73.0
main at f54b49f3566c52b54c598194b7ed3015e3e24224
Current script
package.json defines:
"build": "rm -r lib es types & rollup -c"
Reproduction
On Windows 10 with Node 24.14.1 and Yarn 1.22.22:
- Remove
lib, es, and types so the first run is clean.
- Run
corepack yarn build: it exits 0 and produces all three outputs.
- Run the same command again: it exits 1 with
TS5055 because types/index.d.ts is treated as an input that would be overwritten.
The shell also reports that rm is not recognized, so existing output is never removed. A sentinel placed in lib survives the cleanup step.
On POSIX shells, the single & backgrounds rm; it does not sequence cleanup before Rollup, so cleanup and build can race.
Expected behavior
yarn build should remove lib, es, and types synchronously using a cross-platform command, then run Rollup. Repeating the build should succeed without relying on manually cleaned output.
Impact
Local and release builds can fail or consume stale generated declarations/artifacts depending on platform and timing. Because npm pack publishes the existing lib, es, and types directories and there is no prepack, stale output can also reach a package assembled from an uncleared workspace.
Summary
The package build script does not clean generated output portably or sequentially, and a second consecutive build fails on Windows.
Affected version
@larksuiteoapi/node-sdk1.73.0mainatf54b49f3566c52b54c598194b7ed3015e3e24224Current script
package.jsondefines:Reproduction
On Windows 10 with Node 24.14.1 and Yarn 1.22.22:
lib,es, andtypesso the first run is clean.corepack yarn build: it exits 0 and produces all three outputs.TS5055becausetypes/index.d.tsis treated as an input that would be overwritten.The shell also reports that
rmis not recognized, so existing output is never removed. A sentinel placed inlibsurvives the cleanup step.On POSIX shells, the single
&backgroundsrm; it does not sequence cleanup before Rollup, so cleanup and build can race.Expected behavior
yarn buildshould removelib,es, andtypessynchronously using a cross-platform command, then run Rollup. Repeating the build should succeed without relying on manually cleaned output.Impact
Local and release builds can fail or consume stale generated declarations/artifacts depending on platform and timing. Because
npm packpublishes the existinglib,es, andtypesdirectories and there is noprepack, stale output can also reach a package assembled from an uncleared workspace.