Skip to content

Commit

Permalink
fix: Exporting default types properly so it matches the javascript file.
Browse files Browse the repository at this point in the history
  • Loading branch information
LuchoTurtle committed Jun 6, 2024
1 parent 11bb83a commit eff923b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 eff923b

Please sign in to comment.