Skip to content

Commit

Permalink
Merge pull request #418 from dwyl/not-defined-fix#411-2
Browse files Browse the repository at this point in the history
[PR] Exporting default types properly so it matches the javascript file.
  • Loading branch information
LuchoTurtle authored Jun 6, 2024
2 parents 11bb83a + 814b03a commit 2b1adfb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -531,4 +530,4 @@ function restoreMethod<C extends ClientName, M extends MethodName<C>>(service: C
}
})();

export default AWS;
export = AWS;
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -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';

/*
Expand Down
10 changes: 10 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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,
})

0 comments on commit 2b1adfb

Please sign in to comment.