diff --git a/package-lock.json b/package-lock.json index ba71b2f..1d1be9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aws-sdk-mock", - "version": "6.0.2", + "version": "6.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "aws-sdk-mock", - "version": "6.0.2", + "version": "6.0.3", "license": "Apache-2.0", "dependencies": { "aws-sdk": "^2.1231.0", diff --git a/package.json b/package.json index 0fe2c9c..df1a8ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-sdk-mock", - "version": "6.0.2", + "version": "6.0.3", "description": "Functions to mock the JavaScript aws-sdk", "main": "dist/index.js", "module": "dist/index.mjs", @@ -15,7 +15,7 @@ "nocov": "ts-mocha test/**/*.spec.ts", "test": "nyc ts-mocha test/**/*.spec.ts && tsd", "coverage": "nyc --report html ts-mocha test/**/*.spec.ts && open coverage/index.html", - "build": "tsup src/index.ts --format esm,cjs --dts" + "build": "tsup" }, "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index 4f9737b..a3b93bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,11 +11,10 @@ import type { SinonExpectation, SinonSpy, SinonStubbedInstance } from 'sinon'; import sinon from 'sinon'; import traverse from 'traverse'; +import { Readable } from 'stream'; import AWS_SDK from 'aws-sdk'; -import { Readable } from 'stream'; - import { type ReplaceFn, type ClientName, @@ -531,4 +530,4 @@ function restoreMethod>(service: C } })(); -export default AWS; +export = AWS; diff --git a/src/types.ts b/src/types.ts index a3eb315..c5bf14a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ import { type Request, type AWSError } from 'aws-sdk/lib/core.js'; -import AWS = require('aws-sdk/clients/all'); +import AWS from 'aws-sdk/clients/all'; import {type SinonStub } from 'sinon'; /* diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..c0721fa --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + format: ['cjs', 'esm'], + entry: ['src/index.ts'], + dts: true, + shims: true, + skipNodeModulesBundle: true, + clean: true, +}) \ No newline at end of file