Skip to content

Commit

Permalink
chore(packages): re-export from migrated packages (#4929)
Browse files Browse the repository at this point in the history
  • Loading branch information
srchase committed Jul 20, 2023
1 parent b2c6522 commit bb2232f
Show file tree
Hide file tree
Showing 580 changed files with 556 additions and 28,503 deletions.
5 changes: 0 additions & 5 deletions packages/abort-controller/jest.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/abort-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"test": "jest"
"test": "exit 0"
},
"author": {
"name": "AWS SDK for JavaScript Team",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/types": "*",
"@smithy/abort-controller": "^1.0.1",
"tslib": "^2.5.0"
},
"engines": {
Expand Down
16 changes: 0 additions & 16 deletions packages/abort-controller/src/AbortController.spec.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/abort-controller/src/AbortController.ts

This file was deleted.

34 changes: 0 additions & 34 deletions packages/abort-controller/src/AbortSignal.spec.ts

This file was deleted.

36 changes: 0 additions & 36 deletions packages/abort-controller/src/AbortSignal.ts

This file was deleted.

10 changes: 1 addition & 9 deletions packages/abort-controller/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
/**
* This implementation was added as Node.js didn't support AbortController prior to 15.x
* Use native implementation in browsers or Node.js \>=15.4.0.
*
* @deprecated Use standard implementations in [Browsers](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) and [Node.js](https://nodejs.org/docs/latest/api/globals.html#class-abortcontroller)
* @packageDocumentation
*/
export * from "./AbortController";
export * from "./AbortSignal";
export * from "@smithy/abort-controller";
6 changes: 0 additions & 6 deletions packages/chunked-blob-reader-native/jest.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/chunked-blob-reader-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest"
"test": "exit 0"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand All @@ -20,7 +20,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/util-base64": "*",
"@smithy/chunked-blob-reader-native": "^1.0.1",
"tslib": "^2.5.0"
},
"typesVersions": {
Expand Down
46 changes: 0 additions & 46 deletions packages/chunked-blob-reader-native/src/index.spec.ts

This file was deleted.

44 changes: 1 addition & 43 deletions packages/chunked-blob-reader-native/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1 @@
import { fromBase64 } from "@aws-sdk/util-base64";
/**
* @internal
*/
export function blobReader(
blob: Blob,
onChunk: (chunk: Uint8Array) => void,
chunkSize: number = 1024 * 1024
): Promise<void> {
return new Promise((resolve, reject) => {
const fileReader = new FileReader();

fileReader.onerror = reject;
fileReader.onabort = reject;

const size = blob.size;
let totalBytesRead = 0;

const read = () => {
if (totalBytesRead >= size) {
resolve();
return;
}
fileReader.readAsDataURL(blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize)));
};

fileReader.onload = (event) => {
const result = (event.target as any).result;
// reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL
// response from readAsDataURL is always prepended with "data:*/*;base64,"
const dataOffset = result.indexOf(",") + 1;
const data = result.substring(dataOffset);
const decoded = fromBase64(data);
onChunk(decoded);
totalBytesRead += decoded.byteLength;
// read the next block
read();
};

// kick off the read
read();
});
}
export * from "@smithy/chunked-blob-reader-native";
6 changes: 0 additions & 6 deletions packages/chunked-blob-reader/jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion packages/chunked-blob-reader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest"
"test": "exit 0"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand All @@ -20,6 +20,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@smithy/chunked-blob-reader": "^1.0.1",
"tslib": "^2.5.0"
},
"typesVersions": {
Expand Down
46 changes: 0 additions & 46 deletions packages/chunked-blob-reader/src/index.spec.ts

This file was deleted.

38 changes: 1 addition & 37 deletions packages/chunked-blob-reader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1 @@
/**
* @internal
*/
export function blobReader(
blob: Blob,
onChunk: (chunk: Uint8Array) => void,
chunkSize: number = 1024 * 1024
): Promise<void> {
return new Promise((resolve, reject) => {
const fileReader = new FileReader();

fileReader.addEventListener("error", reject);
fileReader.addEventListener("abort", reject);

const size = blob.size;
let totalBytesRead = 0;

function read() {
if (totalBytesRead >= size) {
resolve();
return;
}
fileReader.readAsArrayBuffer(blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize)));
}

fileReader.addEventListener("load", (event) => {
const result = <ArrayBuffer>(event.target as any).result;
onChunk(new Uint8Array(result));
totalBytesRead += result.byteLength;
// read the next block
read();
});

// kick off the read
read();
});
}
export * from "@smithy/chunked-blob-reader";
5 changes: 0 additions & 5 deletions packages/config-resolver/jest.config.js

This file was deleted.

6 changes: 2 additions & 4 deletions packages/config-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest"
"test": "exit 0"
},
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
Expand All @@ -20,9 +20,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/types": "*",
"@aws-sdk/util-config-provider": "*",
"@aws-sdk/util-middleware": "*",
"@smithy/config-resolver": "^1.0.1",
"tslib": "^2.5.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit bb2232f

Please sign in to comment.