-
Notifications
You must be signed in to change notification settings - Fork 0
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
dev: Add Keystone embed with Bookmark and Collection #213
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9412b6e
Add Keystone embed with Bookmark and Collection
f937693
Update package versions, Jest module dirs
517aef4
Move schema to separate file, write tests
90cab25
Resolve conflicts
67e82d3
Add stores to Jest mapper config
7f2b92f
Update packages
8581090
Update lint/format ignore files, remove warnings
a4ebb6d
Merge branch 'main' into 78-setup-keystone
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Dependency directories | ||
node_modules/ | ||
|
||
.awcache | ||
.DS_Store | ||
|
||
# Build output | ||
.next | ||
out/ | ||
|
||
# Keystone output | ||
.keystone | ||
|
||
# Storybook build output | ||
storybook-static | ||
|
||
# Copied by yarn postinstall | ||
public/vendor/fonts | ||
public/vendor/img | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Cypress artifacts | ||
cypress/screenshots | ||
cypress/videos | ||
cypress/reports | ||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.envrc.local | ||
|
||
# Public assets | ||
public/ |
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 |
---|---|---|
|
@@ -8,6 +8,9 @@ node_modules/ | |
.next | ||
out/ | ||
|
||
# Keystone output | ||
.keystone | ||
|
||
# Storybook build output | ||
storybook-static | ||
|
||
|
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
Binary file not shown.
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,12 @@ | ||
import { config } from '@keystone-next/keystone' | ||
|
||
import schema from './src/cms/schema' | ||
|
||
export default config({ | ||
db: { provider: 'sqlite', url: 'file:./cms.db' }, | ||
experimental: { | ||
generateNextGraphqlAPI: true, | ||
generateNodeAPI: true, | ||
}, | ||
lists: schema, | ||
}) |
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,57 +1,61 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const withBundleAnalyzer = require('@next/bundle-analyzer')({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}) | ||
|
||
module.exports = withBundleAnalyzer({ | ||
async rewrites() { | ||
return { | ||
beforeFiles: [ | ||
{ | ||
source: '/:path', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/:path', | ||
}, | ||
{ | ||
source: '/training-and-education/:path*', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/training-and-education/:path*', | ||
}, | ||
{ | ||
source: '/about-us/:path*', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/about-us/:path*', | ||
}, | ||
{ | ||
source: '/', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta', | ||
}, | ||
], | ||
} | ||
}, | ||
}) | ||
const { withKeystone } = require('@keystone-next/keystone/next') | ||
|
||
module.exports = withKeystone( | ||
withBundleAnalyzer({ | ||
async rewrites() { | ||
return { | ||
beforeFiles: [ | ||
{ | ||
source: '/:path', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/:path', | ||
}, | ||
{ | ||
source: '/training-and-education/:path*', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/training-and-education/:path*', | ||
}, | ||
{ | ||
source: '/about-us/:path*', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta/about-us/:path*', | ||
}, | ||
{ | ||
source: '/', | ||
has: [ | ||
{ | ||
type: 'cookie', | ||
key: 'betaOptIn', | ||
value: 'true', | ||
}, | ||
], | ||
destination: '/beta', | ||
}, | ||
], | ||
} | ||
}, | ||
}) | ||
) |
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 |
---|---|---|
|
@@ -22,13 +22,15 @@ | |
"lint": "tsc --noEmit && eslint .", | ||
"prepare": "husky install", | ||
"pre-commit": "lint-staged", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test": "jest --runInBand --testTimeout=60000", | ||
"test:watch": "jest --watch --runInBand --testTimeout=60000", | ||
"cypress:dev": "cypress open", | ||
"postinstall": "sh ./scripts/copy_uswds_assets.sh", | ||
"postinstall": "sh ./scripts/copy_uswds_assets.sh && keystone-next postinstall", | ||
"release": "standard-version -t ''" | ||
}, | ||
"dependencies": { | ||
"@keystone-next/fields": "15.0.0", | ||
"@keystone-next/keystone": "25.0.1", | ||
"@next/bundle-analyzer": "11.1.2", | ||
"@trussworks/react-uswds": "2.0.0", | ||
"classnames": "2.3.1", | ||
|
@@ -40,23 +42,23 @@ | |
"uswds": "2.10.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.15.0", | ||
"@babel/core": "7.15.5", | ||
"@fortawesome/fontawesome-svg-core": "1.2.36", | ||
"@fortawesome/free-solid-svg-icons": "5.15.4", | ||
"@fortawesome/react-fontawesome": "0.1.15", | ||
"@storybook/addon-a11y": "6.3.7", | ||
"@storybook/addon-actions": "6.3.7", | ||
"@storybook/addon-essentials": "6.3.7", | ||
"@storybook/addon-links": "6.3.7", | ||
"@storybook/react": "6.3.7", | ||
"@storybook/addon-a11y": "6.3.8", | ||
"@storybook/addon-actions": "6.3.8", | ||
"@storybook/addon-essentials": "6.3.8", | ||
"@storybook/addon-links": "6.3.8", | ||
"@storybook/react": "6.3.8", | ||
"@testing-library/jest-dom": "5.14.1", | ||
"@testing-library/react": "12.0.0", | ||
"@testing-library/user-event": "13.2.1", | ||
"@types/jest-axe": "3.5.2", | ||
"@types/react": "17.0.19", | ||
"@types/react": "17.0.20", | ||
"@types/react-fontawesome": "1.6.5", | ||
"@typescript-eslint/eslint-plugin": "4.30.0", | ||
"@typescript-eslint/parser": "4.30.0", | ||
"@typescript-eslint/eslint-plugin": "4.31.0", | ||
"@typescript-eslint/parser": "4.31.0", | ||
"axe-core": "4.3.3", | ||
"babel-loader": "8.2.2", | ||
"css-loader": "5.2.7", | ||
|
@@ -73,7 +75,7 @@ | |
"eslint-plugin-security": "1.4.0", | ||
"husky": "7.0.2", | ||
"identity-obj-proxy": "3.0.0", | ||
"jest": "27.1.0", | ||
"jest": "27.1.1", | ||
"jest-axe": "5.0.1", | ||
"lint-staged": "11.1.2", | ||
"mkdirp": "1.0.4", | ||
|
@@ -82,11 +84,14 @@ | |
"sass-loader": "10.2.0", | ||
"serve": "12.0.0", | ||
"standard-version": "9.3.1", | ||
"storybook-addon-next-router": "3.0.7", | ||
"storybook-addon-next-router": "3.0.8", | ||
"storybook-css-modules-preset": "1.1.1", | ||
"style-loader": "2.0.0", | ||
"typescript": "4.4.2" | ||
}, | ||
"resolutions": { | ||
"@babel/runtime": "7.15.4" | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ended up updating a bunch of packages because there were some incompatibilities causing Storybook to not run. |
||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,json}": [ | ||
"prettier --write", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing babel transform errors when trying to test Keystone 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this change (if anything) moving forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add directories under
src/
that we want to be able to import from using absolute paths, they'll need to be added to this file so Jest can resolve the imports correctly