signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.42k stars 398 forks source link

Move package.json inside the node/ directory + other NPM cleanups #418

Closed jrose-signal closed 2 years ago

jrose-signal commented 2 years ago

Previously all APIs were available through the top-level index.ts, but now the zkgroup APIs are in their own module. To access that in the old packaging required writing

import * from '@signalapp/signal-client/node/dist/zkgroup'

This commit moves the package root into the node/ directory to eliminate the 'node/' component, then adds a top-level, precompiled zkgroup.js/.d.ts so that clients can use

import * from '@signalapp/signal-client/zkgroup'

In addition, this PR improves the source tree by collapsing Native.d.ts and NativeImpl.ts, by turning the latter into Native.js instead. Finally, it moves the TypeScript sources that need compilation into a subdirectory ts/ so that relative paths to the root directory are consistent between the source and the compiled code.