Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit 7b5851a

Browse files
authored
Remove aws-sdk dependency (#374)
Co-authored-by: Daniel Cousens <[email protected]>
1 parent e22df2f commit 7b5851a

File tree

8 files changed

+140
-190
lines changed

8 files changed

+140
-190
lines changed

.changeset/made-by-monsters.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-keystone-app': patch
3+
---
4+
5+
Removes `@aws-sdk/util-endpoints` from dependencies as https://github.com/keystonejs/keystone/issues/8023 is resolved
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'CI setup'
2+
runs:
3+
using: 'composite'
4+
steps:
5+
- name: Setup Node.js LTS
6+
uses: actions/setup-node@v3
7+
with:
8+
# preferably lts/*, but we hit API limits when querying that
9+
node-version: 16
10+
registry-url: 'https://registry.npmjs.org'
11+
12+
- name: Get yarn cache directory path
13+
id: yarn-cache-dir-path
14+
run: echo "::set-output name=dir::$(yarn cache dir)"
15+
shell: bash
16+
17+
- uses: actions/cache@main
18+
id: yarn-cache
19+
with:
20+
path: |
21+
${{ steps.yarn-cache-dir-path.outputs.dir }}
22+
node_modules
23+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-yarn-
26+
27+
- name: Install Dependencies
28+
run: yarn --frozen-lockfile
29+
shell: bash

.github/workflows/tests.yml

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,31 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
createProject: ['create project', 'from repo']
23+
createProject: ['cka', 'cli']
2424
steps:
25-
- name: Checkout Repo
26-
uses: actions/checkout@v3
27-
28-
- name: Setup Node.js 14.x
29-
uses: actions/setup-node@main
30-
with:
31-
node-version: 14.x
32-
33-
- name: Get yarn cache directory path
34-
id: yarn-cache-dir-path
35-
run: echo "::set-output name=dir::$(yarn cache dir)"
36-
37-
- uses: actions/cache@v3
38-
id: yarn-cache
39-
with:
40-
path: |
41-
${{ steps.yarn-cache-dir-path.outputs.dir }}
42-
node_modules
43-
key: ${{ runner.os }}-yarn-v5-${{ hashFiles('yarn.lock') }}
44-
restore-keys: |
45-
${{ runner.os }}-yarn-v5-
46-
47-
- name: Install Dependencies
48-
run: yarn
25+
- uses: actions/checkout@main
26+
- uses: ./.github/actions/ci-setup
4927

5028
- uses: microsoft/playwright-github-action@v1
5129
- run: node ./node_modules/playwright/install.js
5230
- name: Tests
5331
run: yarn jest
5432
timeout-minutes: 10
5533
env:
56-
CREATE_PROJECT: ${{ matrix.createProject }}
34+
TEST_MATRIX_NAME: ${{ matrix.createProject }}
5735

5836
linting:
5937
name: Linting
6038
runs-on: ubuntu-latest
6139
steps:
62-
- name: Checkout Repo
63-
uses: actions/checkout@v3
64-
65-
- name: Setup Node.js 14.x
66-
uses: actions/setup-node@main
67-
with:
68-
node-version: 14.x
40+
- uses: actions/checkout@main
41+
- uses: ./.github/actions/ci-setup
6942

70-
- name: Get yarn cache directory path
71-
id: yarn-cache-dir-path
72-
run: echo "::set-output name=dir::$(yarn cache dir)"
73-
74-
- uses: actions/cache@v3
75-
id: yarn-cache
76-
with:
77-
path: |
78-
${{ steps.yarn-cache-dir-path.outputs.dir }}
79-
node_modules
80-
key: ${{ runner.os }}-yarn-v5-${{ hashFiles('yarn.lock') }}
81-
restore-keys: |
82-
${{ runner.os }}-yarn-v5-
83-
84-
- name: Install Dependencies
85-
run: yarn
8643
- name: Prettier
8744
run: yarn lint:prettier
45+
8846
- name: TypeScript
8947
run: yarn lint:types
48+
9049
- name: Preconstruct
9150
run: yarn build

create-keystone-app/starter/auth.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,17 @@ const { withAuth } = createAuth({
3939
sessionData: 'name createdAt',
4040
secretField: 'password',
4141

42-
// dont support initFirstItem functionality in production
42+
// WARNING: remove initFirstItem functionality in production
4343
// see https://keystonejs.com/docs/config/auth#init-first-item for more
44-
initFirstItem:
45-
process.env.NODE_ENV === 'production'
46-
? undefined
47-
: {
48-
// if there are no items in the database, by configuring this field
49-
// you are asking the Keystone AdminUI to create a new user
50-
// providing inputs for these fields
51-
fields: ['name', 'email', 'password'],
44+
initFirstItem: {
45+
// if there are no items in the database, by configuring this field
46+
// you are asking the Keystone AdminUI to create a new user
47+
// providing inputs for these fields
48+
fields: ['name', 'email', 'password'],
5249

53-
// it uses context.sudo() to do this, which bypasses any access control you might have
54-
// you shouldn't use this in production
55-
},
50+
// it uses context.sudo() to do this, which bypasses any access control you might have
51+
// you shouldn't use this in production
52+
},
5653
});
5754

5855
// statelessSessions uses cookies for session tracking

create-keystone-app/starter/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
"build": "keystone build",
99
"postinstall": "keystone postinstall"
1010
},
11-
"// @aws-sdk": "temporary dependency until https://github.com/keystonejs/keystone/issues/8023 is resolved",
1211
"dependencies": {
13-
"@aws-sdk/util-endpoints": "^3.192.0",
1412
"@keystone-6/auth": "^5.0.0",
1513
"@keystone-6/core": "^3.0.1",
1614
"@keystone-6/fields-document": "^5.0.0",

0 commit comments

Comments
 (0)