Skip to content

Commit

Permalink
Upgrade to v5 and run codemods (#165)
Browse files Browse the repository at this point in the history
* Upgrade to v5 and run codemods

* Update pw reset user setup to store hash token

* Pretty stuff up

* Update to 5.3
  • Loading branch information
Erik Guzman authored Jun 9, 2023
1 parent acba9ae commit b6c86a7
Show file tree
Hide file tree
Showing 9 changed files with 4,113 additions and 3,770 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ yarn test:watch # <api|web>
# see ./scripts/playwright.ts for more info
yarn test:e2e <--init|--debug|--reset|--playwright>

# run a individual test
yarn test:e2e --debug --playwright test reset-password.spec.ts -c web/playwright.config.ts
```

---
Expand Down
8 changes: 4 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "4.1.2",
"@redwoodjs/api-server": "4.1.2",
"@redwoodjs/auth-dbauth-api": "4.1.2",
"@redwoodjs/graphql-server": "4.1.2",
"@redwoodjs/api": "5.3.0",
"@redwoodjs/api-server": "5.3.0",
"@redwoodjs/auth-dbauth-api": "5.3.0",
"@redwoodjs/graphql-server": "5.3.0",
"nodemailer": "^6.8.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion documentation/schema/ERD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@mermaid-js/mermaid-cli": "^9.3.0",
"@redwoodjs/auth-dbauth-setup": "4.1.2",
"@redwoodjs/auth-dbauth-setup": "5.3.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.1",
"prisma-erd-generator": "^1.2.4",
Expand All @@ -22,7 +22,7 @@
"root": true
},
"engines": {
"node": ">=14.19 <=16.x",
"node": "=18.x",
"yarn": ">=1.15"
},
"prisma": {
Expand Down Expand Up @@ -60,7 +60,7 @@
"schema:format": "npx prisma format"
},
"dependencies": {
"@redwoodjs/core": "4.1.2",
"@redwoodjs/core": "5.3.0",
"pm2": "^5.2.2",
"react-use": "^17.4.0"
}
Expand Down
16 changes: 8 additions & 8 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
]
},
"dependencies": {
"@redwoodjs/auth": "4.1.2",
"@redwoodjs/auth-dbauth-web": "4.1.2",
"@redwoodjs/forms": "4.1.2",
"@redwoodjs/router": "4.1.2",
"@redwoodjs/vite": "4.1.2",
"@redwoodjs/web": "4.1.2",
"@redwoodjs/auth": "5.3.0",
"@redwoodjs/auth-dbauth-web": "5.3.0",
"@redwoodjs/forms": "5.3.0",
"@redwoodjs/router": "5.3.0",
"@redwoodjs/vite": "5.3.0",
"@redwoodjs/web": "5.3.0",
"@simplewebauthn/browser": "^7.0.0",
"date-fns": "^2.29.3",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@playwright/test": "^1.28.1",
Expand Down
13 changes: 7 additions & 6 deletions web/src/entry-client.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import ReactDOM from 'react-dom'
import { hydrateRoot, createRoot } from 'react-dom/client'

import App from './App'
/**
* When `#redwood-app` isn't empty then it's very likely that you're using
* prerendering. So React attaches event listeners to the existing markup
* rather than replacing it.
* https://reactjs.org/docs/react-dom.html#hydrate
* https://reactjs.org/docs/react-dom-client.html#hydrateroot
*/
const rootElement = document.getElementById('redwood-app')
const redwoodAppElement = document.getElementById('redwood-app')

if (rootElement.children?.length > 0) {
ReactDOM.hydrate(<App />, rootElement)
if (redwoodAppElement.children?.length > 0) {
hydrateRoot(redwoodAppElement, <App />)
} else {
ReactDOM.render(<App />, rootElement)
const root = createRoot(redwoodAppElement)
root.render(<App />)
}
5 changes: 1 addition & 4 deletions web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
</head>

<body>
<div id="redwood-app">
<!-- Please keep the line below for prerender support. -->
<%= prerenderPlaceholder %>
</div>
<div id="redwood-app"></div>
</body>
</html>
5 changes: 3 additions & 2 deletions web/tests/reset-password.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { MockUserEntity } from './entities/user.entity'
test.beforeAll(async () => {
await MockUserEntity.upsert({
email: 'snap@crackle.pop',
resetToken: 'waffleCrisp',
resetToken:
'013ce53f5abe360066909e76d37ef32111da99e13591db3ac4aa3857f5a20abf',
resetTokenExpiresAt: new Date(new Date().getTime() + 24 * 60 * 60 * 1000),
verifyToken: 'cheerios',
verifyToken: 'waffleCrisp',
})
})

Expand Down
Loading

0 comments on commit b6c86a7

Please sign in to comment.