Skip to content

Commit

Permalink
build(deps): bump next from 11.0.1 to 11.1.0 (#54)
Browse files Browse the repository at this point in the history
* build(deps): bump next from 11.0.1 to 11.1.0

Bumps [next](https://github.com/vercel/next.js) from 11.0.1 to 11.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v11.0.1...v11.1.0)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Adapt next-server refactoring

See: vercel/next.js#26756

* Prettier

* Fixes test

Add upstream max-age to optimized image
vercel/next.js#26739

* Fixes bundle

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Haus <[email protected]>
  • Loading branch information
dependabot[bot] and ofhouse authored Aug 22, 2021
1 parent ea01f80 commit a40ad13
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 111 deletions.
5 changes: 1 addition & 4 deletions lib/handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ImageConfig,
imageConfigDefault,
} from 'next/dist/next-server/server/image-config';
import { ImageConfig, imageConfigDefault } from 'next/dist/server/image-config';
import { parse as parseUrl } from 'url';
import {
APIGatewayProxyEventV2,
Expand Down
8 changes: 4 additions & 4 deletions lib/image-optimizer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IncomingMessage, ServerResponse } from 'http';
import { ImageConfig } from 'next/dist/next-server/server/image-config';
import { NextConfig } from 'next/dist/next-server/server/config';
import { imageOptimizer as nextImageOptimizer } from 'next/dist/next-server/server/image-optimizer';
import Server from 'next/dist/next-server/server/next-server';
import { ImageConfig } from 'next/dist/server/image-config';
import { NextConfig } from 'next/dist/server/config';
import { imageOptimizer as nextImageOptimizer } from 'next/dist/server/image-optimizer';
import Server from 'next/dist/server/next-server';
import nodeFetch, { RequestInfo, RequestInit } from 'node-fetch';
import { UrlWithParsedQuery } from 'url';
import S3 from 'aws-sdk/clients/s3';
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"aws-sdk": "*",
"next": "11.0.1",
"next": "11.1.0",
"node-fetch": "2.6.1"
},
"devDependencies": {
Expand Down
20 changes: 10 additions & 10 deletions scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ async function main() {
// Get all files from build dir
const buildFiles = glob.sync('**/*.js', { cwd: buildDir, absolute: true });

const { fileList } = await nodeFileTrace(buildFiles, {
// Squoosh files
const squooshFiles = glob.sync(
'node_modules/next/dist/server/lib/squoosh/**/*.js',
{
cwd: workspaceRoot,
absolute: true,
}
);

const { fileList } = await nodeFileTrace([...buildFiles, ...squooshFiles], {
base: workspaceRoot,
processCwd: process.cwd(),
// aws-sdk is already provided in Lambda images
Expand All @@ -29,15 +38,6 @@ async function main() {
'node_modules/next/node_modules/jest-worker/build/workers/threadChild.js'
);

fileList.push(
...glob.sync(
'node_modules/next/dist/next-server/server/lib/squoosh/**/*.{js,wasm}',
{
cwd: workspaceRoot,
}
)
);

// Create zip file
await new Promise((resolve, reject) => {
const outputFile = fs.createWriteStream(
Expand Down
7 changes: 2 additions & 5 deletions test/image-optimizer.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/// <reference types="jest-file-snapshot" />

import {
ImageConfig,
imageConfigDefault,
} from 'next/dist/next-server/server/image-config';
import { ImageConfig, imageConfigDefault } from 'next/dist/server/image-config';
import S3 from 'aws-sdk/clients/s3';
import * as path from 'path';

Expand Down Expand Up @@ -219,7 +216,7 @@ describe('unit', () => {
expect(headers['content-type']).toBe(fixtureResponse['content-type']);
expect(headers['etag']).toBeDefined();
expect(headers['cache-control']).toBe(
'public, max-age=0, must-revalidate'
'public, max-age=123456, must-revalidate'
);

const optimizerPrefix = `external_accept_webp_w-${optimizerParams.w}_q-${optimizerParams.q}_`;
Expand Down
2 changes: 1 addition & 1 deletion test/utils/run-optimizer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fork } from 'child_process';
import getPort from 'get-port';
import { ImageConfig } from 'next/dist/next-server/server/image-config';
import { ImageConfig } from 'next/dist/server/image-config';
import fetch from 'node-fetch';
import { createRequest, createResponse } from 'node-mocks-http';
import { EventEmitter } from 'events';
Expand Down
Loading

0 comments on commit a40ad13

Please sign in to comment.