From 842560a4ea180039711474cd51d29fa943294540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Hern=C3=A1ndez=20Serrano?= Date: Fri, 6 Aug 2021 17:29:23 +0200 Subject: [PATCH] clean types dir before emmitting again --- README.md | 1 + build/rollup.config.js | 8 ++++---- docs/API.md | 16 ++++++++-------- package.json | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5359e7d..89666ba 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ import * as bigintCryptoUtils from 'bigint-crypto-utils' The appropriate version for browser or node is automatically exported. > `bigint-crypto-utils` uses [ES2020 BigInt](https://tc39.es/ecma262/#sec-bigint-objects), so take into account that: +> > 1. If you experience issues using webpack/babel to create your production bundles, you may edit the supported browsers list and leave only [supported browsers and versions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#Browser_compatibility). The browsers list is usually located in your project's `package.json` or the `.browserslistrc` file. > 2. In order to use `bigint-crypto-utils` with TypeScript you need to set `target`, and `lib` and `module` if in use, to `ES2020` in your project's `tsconfig.json`. diff --git a/build/rollup.config.js b/build/rollup.config.js index f80345f..11d3317 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -7,8 +7,7 @@ import typescriptPlugin from '@rollup/plugin-typescript' import commonjs from '@rollup/plugin-commonjs' import { dirname, join } from 'path' -import { existsSync } from 'fs' -import { move } from 'fs-extra' +import { existsSync, moveSync, removeSync } from 'fs-extra' import { directories, name as _name, dependencies, peerDependencies, exports, types } from '../package.json' const rootDir = join(__dirname, '..') @@ -45,8 +44,9 @@ const sourcemapOutputOptions = { function moveDirPlugin (srcDir, dstDir) { return { name: 'move-dir', - async closeBundle () { - move(srcDir, dstDir, { overwrite: true }) + closeBundle () { + removeSync(dstDir) + moveSync(srcDir, dstDir, { overwrite: true }) } } } diff --git a/docs/API.md b/docs/API.md index d746862..9d44507 100644 --- a/docs/API.md +++ b/docs/API.md @@ -153,7 +153,7 @@ A promise that resolves to a boolean that is either true (a probably prime numbe #### Defined in -[src/ts/isProbablyPrime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/isProbablyPrime.ts#L21) +[src/ts/isProbablyPrime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/isProbablyPrime.ts#L21) ___ @@ -317,7 +317,7 @@ A promise that resolves to a bigint probable prime of bitLength bits. #### Defined in -[src/ts/prime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/prime.ts#L21) +[src/ts/prime.ts:21](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/prime.ts#L21) ___ @@ -346,7 +346,7 @@ A bigint probable prime of bitLength bits. #### Defined in -[src/ts/prime.ts:100](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/prime.ts#L100) +[src/ts/prime.ts:100](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/prime.ts#L100) ___ @@ -374,7 +374,7 @@ A cryptographically secure random bigint between [min,max] #### Defined in -[src/ts/randBetween.ts:15](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/randBetween.ts#L15) +[src/ts/randBetween.ts:15](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/randBetween.ts#L15) ___ @@ -402,7 +402,7 @@ A Promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cry #### Defined in -[src/ts/randBits.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/randBits.ts#L14) +[src/ts/randBits.ts:14](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/randBits.ts#L14) ___ @@ -430,7 +430,7 @@ A Uint8Array/Buffer (Browser/Node.js) filled with cryptographically secure rando #### Defined in -[src/ts/randBits.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/randBits.ts#L45) +[src/ts/randBits.ts:45](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/randBits.ts#L45) ___ @@ -458,7 +458,7 @@ A promise that resolves to a UInt8Array/Buffer (Browser/Node.js) filled with cry #### Defined in -[src/ts/randBytes.ts:12](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/randBytes.ts#L12) +[src/ts/randBytes.ts:12](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/randBytes.ts#L12) ___ @@ -486,7 +486,7 @@ A UInt8Array/Buffer (Browser/Node.js) filled with cryptographically secure rando #### Defined in -[src/ts/randBytes.ts:46](https://github.com/juanelas/bigint-crypto-utils/blob/519dcbc/src/ts/randBytes.ts#L46) +[src/ts/randBytes.ts:46](https://github.com/juanelas/bigint-crypto-utils/blob/cf5ddfb/src/ts/randBytes.ts#L46) ___ diff --git a/package.json b/package.json index 848da7e..4ed58f7 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,8 @@ "project": "./tsconfig.json", "ignore": [ "dist/**/*", - "examples/**/*" + "examples/**/*", + "types/**/*" ] }, "devDependencies": {