-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
91 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
* | ||
|
||
!package.json | ||
!yarn.lock | ||
!tsconfig.json | ||
!lib/package.json | ||
!scripts/* | ||
!lib/*.json | ||
!lib/**/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
dist | ||
dist.zip | ||
|
||
# Temporary license files | ||
third-party-licenses.txt | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Creates a bundled zip file with all dependencies for AWS Lambda | ||
*/ | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
const { nodeFileTrace } = require('@vercel/nft'); | ||
const glob = require('glob'); | ||
const archiver = require('archiver'); | ||
|
||
const workspaceRoot = path.resolve(__dirname, '..'); | ||
const buildDir = path.resolve(workspaceRoot, 'lib/dist'); | ||
|
||
async function main() { | ||
// Get all files from build dir | ||
const buildFiles = glob.sync('**/*.js', { cwd: buildDir, absolute: true }); | ||
|
||
console.log('buildFiles', buildFiles); | ||
|
||
const { fileList } = await nodeFileTrace(buildFiles, { | ||
base: workspaceRoot, | ||
processCwd: process.cwd(), | ||
// aws-sdk is already provided in Lambda images | ||
ignore: ['**/aws-sdk/**/*'], | ||
}); | ||
|
||
// Create zip file | ||
await new Promise((resolve, reject) => { | ||
const outputFile = fs.createWriteStream( | ||
path.resolve(workspaceRoot, 'lib/dist.zip') | ||
); | ||
|
||
outputFile.on('close', () => resolve()); | ||
outputFile.on('error', (error) => reject(error)); | ||
|
||
const archive = archiver('zip', { | ||
zlib: { level: 5 }, // Optimal compression | ||
}); | ||
archive.pipe(outputFile); | ||
|
||
for (const file of fileList) { | ||
// Remove lib/ and lib/dist/ prefix | ||
const fileName = file.replace(/^lib\/(dist\/)?/, ''); | ||
|
||
archive.append(fs.createReadStream(path.join(workspaceRoot, file)), { | ||
name: fileName, | ||
mode: 0o666, | ||
}); | ||
} | ||
archive.finalize(); | ||
}); | ||
} | ||
|
||
main(); |
Binary file removed
BIN
-625 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_bmp_test.bmp.bmp
Binary file not shown.
Binary file removed
BIN
-2.57 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_gif_test.gif.gif
Binary file not shown.
Binary file removed
BIN
-2.91 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_jpeg_test.jpg.jpeg
Binary file not shown.
Binary file removed
BIN
-2.39 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_png_test.png.png
Binary file not shown.
11 changes: 0 additions & 11 deletions
11
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_svg_test.svg.svg
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-4.21 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_tiff_test.tiff.tiff
Binary file not shown.
Binary file removed
BIN
-36.5 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_webp_animated.webp.webp
Binary file not shown.
Binary file removed
BIN
-1.26 KB
test/__snapshots__/e2e/external_accept_all_w-2048_q-75_webp_test.webp.webp
Binary file not shown.
Binary file removed
BIN
-625 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_bmp_test.bmp.bmp
Binary file not shown.
Binary file removed
BIN
-2.57 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_gif_test.gif.gif
Binary file not shown.
Binary file removed
BIN
-2.91 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_jpeg_test.jpg.jpeg
Binary file not shown.
Binary file removed
BIN
-2.39 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_png_test.png.png
Binary file not shown.
11 changes: 0 additions & 11 deletions
11
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_svg_test.svg.svg
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-4.21 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_tiff_test.tiff.tiff
Binary file not shown.
Binary file removed
BIN
-36.5 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_webp_animated.webp.webp
Binary file not shown.
Binary file removed
BIN
-1.26 KB
test/__snapshots__/e2e/internal_accept_all_w-2048_q-75_webp_test.webp.webp
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.57 KB
test/__snapshots__/external_accept_all_w-2048_q-75_gif_test.gif.gif
Binary file not shown.
Binary file removed
BIN
-2.91 KB
test/__snapshots__/external_accept_all_w-2048_q-75_jpeg_test.jpg.jpeg
Binary file not shown.
Binary file removed
BIN
-2.39 KB
test/__snapshots__/external_accept_all_w-2048_q-75_png_test.png.png
Binary file not shown.
Oops, something went wrong.