Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: serve fake manifest file #63

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/libs/cloudfront/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.7.0-alpha.26](https://github.com/serverless-nextjs/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/serverless-nextjs/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/serverless-nextjs/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/serverless-nextjs/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/serverless-nextjs/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- modify content equals ([#54](https://github.com/serverless-nextjs/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/serverless-nextjs/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/serverless-nextjs/serverless-next.js/issues/58)) ([f09b346](https://github.com/serverless-nextjs/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- Modify SN to support A/B Test ([#51](https://github.com/serverless-nextjs/serverless-next.js/issues/51)) ([a801469](https://github.com/serverless-nextjs/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/serverless-nextjs/serverless-next.js/issues/62)) ([6acb468](https://github.com/serverless-nextjs/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/serverless-nextjs/serverless-next.js/issues/57)) ([b751580](https://github.com/serverless-nextjs/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [2.7.0-alpha.25](https://github.com/serverless-nextjs/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/libs/cloudfront/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/cloudfront",
"version": "2.7.0-alpha.25",
"version": "2.7.0-alpha.26",
"description": "Handles CloudFront invalidation",
"publishConfig": {
"access": "public"
36 changes: 36 additions & 0 deletions packages/libs/lambda-at-edge/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,42 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.20.0-alpha.107](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-19)

**Note:** Version bump only for package @getjerry/lambda-at-edge

# [1.20.0-alpha.106](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-18)

**Note:** Version bump only for package @getjerry/lambda-at-edge

# [1.20.0-alpha.105](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-18)

**Note:** Version bump only for package @getjerry/lambda-at-edge

# [1.20.0-alpha.104](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-18)

**Note:** Version bump only for package @getjerry/lambda-at-edge

# [1.20.0-alpha.103](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-18)

**Note:** Version bump only for package @getjerry/lambda-at-edge

# [1.20.0-alpha.102](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/getjerry/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/getjerry/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- html string ([#45](https://github.com/getjerry/serverless-next.js/issues/45)) ([6920106](https://github.com/getjerry/serverless-next.js/commit/6920106340aeb42d00b97107313b18e42f5da385))
- modify content equals ([#54](https://github.com/getjerry/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/getjerry/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/getjerry/serverless-next.js/issues/58)) ([f09b346](https://github.com/getjerry/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- Modify SN to support A/B Test ([#51](https://github.com/getjerry/serverless-next.js/issues/51)) ([a801469](https://github.com/getjerry/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/getjerry/serverless-next.js/issues/57)) ([b751580](https://github.com/getjerry/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [1.20.0-alpha.101](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
4 changes: 2 additions & 2 deletions packages/libs/lambda-at-edge/package.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.20.0-alpha.101",
"version": "1.20.0-alpha.107",
"description": "Provides handlers that can be used in CloudFront Lambda@Edge to deploy next.js applications to the edge.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -87,5 +87,5 @@
"send": "^0.17.1",
"zen-observable": "0.8.15"
},
"gitHead": "ff6891ab42e8df4add318d6c67af062c15b067cd"
"gitHead": "8729c3fabe24349c1d097f1a56055c20162c595b"
}
32 changes: 32 additions & 0 deletions packages/libs/s3-static-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.8.0-alpha.29](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-19)

### Features

- no cache fake manifest file ([f31d8ec](https://github.com/getjerry/serverless-next.js/commit/f31d8ecdf2a2ad6a9e4a65c82aa6fe04f1da61c3))

# [1.8.0-alpha.28](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-19)

### Features

- update cache header ([a88d51a](https://github.com/getjerry/serverless-next.js/commit/a88d51a3963d2b31b940db4bc9bc91a2295121f9))

# [1.8.0-alpha.27](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-18)

**Note:** Version bump only for package @getjerry/s3-static-assets

# [1.8.0-alpha.26](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/getjerry/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/getjerry/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- modify content equals ([#54](https://github.com/getjerry/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/getjerry/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/getjerry/serverless-next.js/issues/58)) ([f09b346](https://github.com/getjerry/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- clear manifest file ([5c7ab33](https://github.com/getjerry/serverless-next.js/commit/5c7ab333f5d87f02b44999e82159a1e126a8f8a7))
- Modify SN to support A/B Test ([#51](https://github.com/getjerry/serverless-next.js/issues/51)) ([a801469](https://github.com/getjerry/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/getjerry/serverless-next.js/issues/57)) ([b751580](https://github.com/getjerry/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [1.8.0-alpha.25](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/libs/s3-static-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/s3-static-assets",
"version": "1.8.0-alpha.25",
"version": "1.8.0-alpha.29",
"description": "Handles upload to S3 of next.js static assets",
"publishConfig": {
"access": "public"
19 changes: 18 additions & 1 deletion packages/libs/s3-static-assets/src/index.ts
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ type UploadStaticAssetsOptions = {
credentials: Credentials;
publicDirectoryCache?: PublicDirectoryCache;
abTestPaths?: string[];
serveFakeManifest?: boolean;
};

/**
@@ -38,7 +39,8 @@ const uploadStaticAssetsFromBuild = async (
credentials,
basePath,
publicDirectoryCache,
nextConfigDir
nextConfigDir,
serveFakeManifest
} = options;
const s3 = await S3ClientFactory({
bucketName,
@@ -73,6 +75,21 @@ const uploadStaticAssetsFromBuild = async (
const nextStaticFilesUploads = nextStaticFiles
.filter(filterOutDirectories)
.map(async (fileItem) => {
if (serveFakeManifest && fileItem.path.endsWith("_buildManifest.js")) {
console.info("[uploadStaticAssetsFromBuild] clear _buildManifest.js");
fse.writeFileSync(fileItem.path, "");
const s3Key = pathToPosix(
path.relative(assetsOutputDirectory, fileItem.path)
);

// not using cache in case we encounter any bugs and need to recover the file
return s3.uploadFile({
s3Key,
filePath: fileItem.path,
cacheControl: SERVER_NO_CACHE_CACHE_CONTROL_HEADER
});
}

const s3Key = pathToPosix(
path.relative(assetsOutputDirectory, fileItem.path)
);
15 changes: 15 additions & 0 deletions packages/serverless-components/aws-cloudfront/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.8.0-alpha.26](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/getjerry/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/getjerry/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- modify content equals ([#54](https://github.com/getjerry/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/getjerry/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/getjerry/serverless-next.js/issues/58)) ([f09b346](https://github.com/getjerry/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- Modify SN to support A/B Test ([#51](https://github.com/getjerry/serverless-next.js/issues/51)) ([a801469](https://github.com/getjerry/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/getjerry/serverless-next.js/issues/57)) ([b751580](https://github.com/getjerry/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [1.8.0-alpha.25](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/serverless-components/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/aws-cloudfront",
"version": "1.8.0-alpha.25",
"version": "1.8.0-alpha.26",
"main": "./serverless.js",
"publishConfig": {
"access": "public"
10 changes: 10 additions & 0 deletions packages/serverless-components/aws-iam-role/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.2.0-alpha.12](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))

### Features

- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))

# [1.2.0-alpha.11](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/serverless-components/aws-iam-role/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/aws-iam-role",
"version": "1.2.0-alpha.11",
"version": "1.2.0-alpha.12",
"description": "Custom IAM role component",
"author": "Denis Grankin <[email protected]>",
"homepage": "https://github.com/danielcondemarin/serverless-next.js/tree/master/packages/serverless-components/aws-iam-role#readme",
15 changes: 15 additions & 0 deletions packages/serverless-components/aws-lambda/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.10.0-alpha.39](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/getjerry/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/getjerry/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- modify content equals ([#54](https://github.com/getjerry/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/getjerry/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/getjerry/serverless-next.js/issues/58)) ([f09b346](https://github.com/getjerry/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- Modify SN to support A/B Test ([#51](https://github.com/getjerry/serverless-next.js/issues/51)) ([a801469](https://github.com/getjerry/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/getjerry/serverless-next.js/issues/57)) ([b751580](https://github.com/getjerry/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [1.10.0-alpha.38](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/serverless-components/aws-lambda/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/aws-lambda",
"version": "1.10.0-alpha.38",
"version": "1.10.0-alpha.39",
"main": "serverless.js",
"publishConfig": {
"access": "public"
15 changes: 15 additions & 0 deletions packages/serverless-components/domain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.7.0-alpha.26](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-15)

### Bug Fixes

- redirect props got stored ([#59](https://github.com/getjerry/serverless-next.js/issues/59)) ([12b5c0f](https://github.com/getjerry/serverless-next.js/commit/12b5c0fa214ee2193de2a665c9236e272f75489b))
- **default-handler:** add logic to handle not found from getStaticProps ([#55](https://github.com/getjerry/serverless-next.js/issues/55)) ([ba08d6e](https://github.com/getjerry/serverless-next.js/commit/ba08d6ef85b4b1f20674f815a6e6694e8bdf1bde))
- modify content equals ([#54](https://github.com/getjerry/serverless-next.js/issues/54)) ([73c1a4a](https://github.com/getjerry/serverless-next.js/commit/73c1a4a92b1f3ed8b221739294bcf5827b48ac1c))

### Features

- ab test enhancement ([#58](https://github.com/getjerry/serverless-next.js/issues/58)) ([f09b346](https://github.com/getjerry/serverless-next.js/commit/f09b34614ede134fec890ee0a3ab480dd8bd96fd))
- Modify SN to support A/B Test ([#51](https://github.com/getjerry/serverless-next.js/issues/51)) ([a801469](https://github.com/getjerry/serverless-next.js/commit/a8014698303611844d8dc5de0e4bd9b030472a4b))
- support ab test base on region ([#62](https://github.com/getjerry/serverless-next.js/issues/62)) ([6acb468](https://github.com/getjerry/serverless-next.js/commit/6acb4685b51f804c3498c940d2b139121cdd0785))
- support rewrite has field ([#57](https://github.com/getjerry/serverless-next.js/issues/57)) ([b751580](https://github.com/getjerry/serverless-next.js/commit/b751580ecf92be7825a9e74dce7c92a4c4fa71fd))

# [1.7.0-alpha.25](https://github.com/getjerry/serverless-next.js/compare/@getjerry/[email protected]...@getjerry/[email protected]) (2023-09-12)

### Bug Fixes
2 changes: 1 addition & 1 deletion packages/serverless-components/domain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getjerry/domain",
"version": "1.7.0-alpha.25",
"version": "1.7.0-alpha.26",
"main": "serverless.js",
"publishConfig": {
"access": "public"
Loading