Repository navigation
@onlyworlds/sdk 4.178.1
Fixed
- Installing the package into a plain JavaScript project no longer installs TypeScript. TypeScript was a required peer, so npm placed the newest compiler beside the package in every project, used or not: two of the four packages a first
npm install @onlyworlds/sdkadded. It is an optional peer now: a TypeScript project brings its own (4.5 or later, as before) and a JavaScript project gets the package andfflate, nothing else. @onlyworlds/sdk/waymarkhas types in a project on the older module resolution. WithmoduleResolutionset tonode(ornode10), which does not read a package'sexports, the import answered TS2307, "Cannot find module", while the package root's types were found. The package now carries atypesVersionsentry for the subpath. Projects onnode16,nodenextorbundlerwere not affected and read the same files as before. Read with TypeScript 4.5, 4.7, 5.0, 5.9, 6.0 and 7.0 against the packed build.
Tests
-
What a TypeScript project is handed is compiled, under each module resolution. A new test type-checks a consumer of the built package's root and
/waymarksubpath onnode,node16andbundler, and holds every typed subpath ofexportsto itstypesVersionsentry and the peer to optional. -
Node 18 is tested.
package.jsonadmits Node 18 and later, and the suite ran on 20 and 22 only. It now runs on 18 as well, with one flag: Sign in with OnlyWorlds needs Web Crypto as a global, which Node has from 19 on and Node 18 only when started with--experimental-global-webcrypto. Without itsignInWithOnlyWorldsandpkceChallengerefuse with aTypeErrorthat names Web Crypto, storing and opening nothing (a new test holds that on every Node), and the rest of the package runs. -
Node 24 is tested, beside 18, 20 and 22.
-
The build and the tests install from a committed lockfile.
package-lock.jsonwas ignored, so every CI run and every release installed whatever the version ranges resolved to that day, andnpm ci || npm installhid that there was no lockfile to install from. It is committed now and CI and the release runnpm ci. Nothing changes for a project that installs the package: a lockfile is not published. -
happy-dom 21.0.4, which only the tests use (the Waymark's DOM), past a published advisory on 21.0.3 and earlier (GHSA-834v-8h66-3h79). It is a development dependency and never part of the published package.