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

Migrate aws-sdk from 2 to 3. Update rewrites, gatsby 5 optimisation #457

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
add8640
feat: process all npm dependency upgrades
tractorcow Jul 17, 2023
5954b45
chore: bump dep
tractorcow Jul 17, 2023
7f8b12b
chore: update lock
tractorcow Jul 18, 2023
73c77a0
fix: update repo install instructions
tractorcow Jul 18, 2023
6cee425
feat: update bin.ts for aws-sdk v3
tractorcow Jul 18, 2023
aaa39ac
fix: imports, code style, and linting
tractorcow Jul 18, 2023
c3eed46
fix: remove redundant option
tractorcow Jul 18, 2023
3a71606
fix: update proxy logic to support http / https
tractorcow Jul 18, 2023
47e0cc3
fix: upgrade tests
tractorcow Jul 18, 2023
9e63afc
fix: linting in example
tractorcow Jul 18, 2023
208340b
fix: adjust dependencies and build errors
tractorcow Jul 19, 2023
dd18aab
fix: cleanup remaining issues with leftover aws-sdk references
tractorcow Jul 19, 2023
57800cb
chore: remove upgrade notes
tractorcow Jul 19, 2023
ba6df92
fix: e2e test and terraform
tractorcow Jul 19, 2023
e707ef0
fix: correct check for no such bucket
tractorcow Jul 19, 2023
acb140e
chore: ignore env from source control
tractorcow Jul 19, 2023
9ef8278
fix: client only paths
tractorcow Jul 19, 2023
4fe4380
fix: prevent infinite redirects
tractorcow Jul 19, 2023
6c8dcb6
fix: linting
tractorcow Jul 20, 2023
9b455a0
fix: serverless deployments
tractorcow Jul 20, 2023
22ccf2e
fix: create bucket policy behaviour
tractorcow Jul 24, 2023
b30d275
fix: use better solution for home page redirects
tractorcow Jul 24, 2023
3210b86
fix: terraform permissions for creating buckets
tractorcow Jul 24, 2023
2b9f266
fix: resolve infinite redirects, and document s3 limitations
tractorcow Jul 24, 2023
35b0e43
fix: update unit tests
tractorcow Jul 25, 2023
f95d6d2
fix: missing permissions
tractorcow Jul 25, 2023
9d1cb9c
fix: correct policy for tests
tractorcow Jul 25, 2023
fb97120
fix: sync package-lock.json with package.json
tractorcow Jul 31, 2023
af6fb03
fix: typescript errors
tractorcow Jul 31, 2023
fc0b2fa
fix: remove redundant policy
tractorcow Jul 31, 2023
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
reports
reports
.env
**/.env
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Monorepo tooling

gatsby-plugin-s3 uses a Lerna-based monorepo. After cloning the repository, please use `npx lerna bootstrap` to install
gatsby-plugin-s3 uses a Lerna-based monorepo. After cloning the repository, please use `npm install` to install
dependencies and symlink the different projects together.

You can use `npx lerna run build` to automatically build all of the projects in the correct order.
Expand All @@ -12,4 +12,4 @@ please be patient.

## Test setup

Running our e2e tests requires some setup, please see [TESTING.md](./TESTING.md) for more details.
Running our e2e tests requires some setup, please see [TESTING.md](./TESTING.md) for more details.
61 changes: 35 additions & 26 deletions README.md

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions examples/with-redirects/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@ module.exports = {
options: {
bucketName: process.env.GATSBY_S3_TARGET_BUCKET || 'test',
bucketPrefix: process.env.GATSBY_S3_BUCKET_PREFIX ? process.env.GATSBY_S3_BUCKET_PREFIX : null,
region: 'eu-west-1',
generateRedirectObjectsForPermanentRedirects: !process.env.GATSBY_S3_LEGACY_REDIRECTS,
region: process.env.AWS_REGION || 'us-east-1',
...(process.env.GATSBY_S3_ACL
? {
acl: process.env.ACL != 'NULL' ? process.env.ACL : null,
}
acl: process.env.ACL !== 'NULL' ? process.env.ACL : null,
}
: {}),
removeNonexistentObjects: true,
retainObjectsPatterns: ['**/*.retain.js', '**/retain-folder/*'],
},
},
{
resolve: `gatsby-plugin-create-client-paths`,
options: { prefixes: [`/client-only/*`] },
},
'gatsby-plugin-offline',
],
};
23 changes: 16 additions & 7 deletions examples/with-redirects/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,39 @@ exports.createPages = ({ actions }) => {
// create some test redirects
actions.createRedirect({
fromPath: '/',
toPath: '/page-2',
toPath: '/page-2/',
});

actions.createRedirect({
fromPath: '/blog',
toPath: '/blog/1',
toPath: '/blog/1/',
isPermanent: true
});

actions.createRedirect({
fromPath: '/hello-there',
toPath: '/client-only',
toPath: '/client-only/',
isPermanent: false
});

actions.createRedirect({
fromPath: '/asdf123.-~_!$&\'()*+,;=:@%',
toPath: '/special-characters',
toPath: '/special-characters/',
isPermanent: true
});

actions.createRedirect({
fromPath: '/trailing-slash/',
toPath: '/trailing-slash/1',
toPath: '/trailing-slash/1/',
isPermanent: true
});
};
};

// Required for client only paths to work
exports.onCreatePage = async ({ page, actions }) => {
const {createPage} = actions
if (page.path.match(/^\/client-only/)) {
page.matchPath = "/client-only/*"
createPage(page)
}
}
Loading