Update to Mocha v10 in tests, declare lib as module and add exports to package.json

Mocha v10 requires the lib to be esm compliant.
ESM mandates the use of file extensions in imports, so to minimize the
changes (for now), we rely on the flag `experimental-specifier-resolution=node`
and on `ts-node` (needed only for Node 20).

Breaking changes:
downstream bundlers might be affected by the package.json changes depending on
how they load the library.
NB: legacy package.json entrypoints are still available.
This commit is contained in:
larabr
2023-05-09 18:45:46 +02:00
parent 3520a357f5
commit d49d92e5cb
66 changed files with 1710 additions and 1373 deletions

View File

@@ -16,7 +16,7 @@ import {
generateSessionKey, encryptSessionKey, decryptSessionKeys,
LiteralDataPacket, PacketList, CompressedDataPacket, PublicKeyPacket, PublicSubkeyPacket, SecretKeyPacket, SecretSubkeyPacket, CleartextMessage,
WebStream, NodeStream,
} from '../..';
} from 'openpgp';
(async () => {