Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into feature/prer…
Browse files Browse the repository at this point in the history
…ender-p1

* 'main' of github.com:redwoodjs/redwood:
  v0.23.0
  GH Action PR Comment: Formatting
  add learn.rwjs.com repo to contributors (redwoodjs#1634)
  update PR Package Action formatting
  Updated All-Contributors Data (redwoodjs#1621)
  sync yarn.lock (redwoodjs#1632)
  Resolve promises in the console (redwoodjs#1619)
  Replace prisma deprecated fineOne() -> findUnique() (redwoodjs#1629)
  • Loading branch information
dac09 committed Jan 14, 2021
2 parents 26dcd77 + d427179 commit 64723f1
Show file tree
Hide file tree
Showing 39 changed files with 334 additions and 65 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish_pr_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ jobs:
pr_number=${{ steps.pr_number.outputs.pr_number }}
cd pr-packages/$pr_number
v_sha=$(ls | grep "\.tgz$" | sed 's/\.tgz$//' | head -n1 | awk -F"-" '{ print $(NF-1)"-"$NF }')
msg="📦 Packages for this PR can be downloaded from%0A"
msg="### 📦 PR Packages%0A"
msg+="%0A"
msg+="<details><summary>Click to Show Package Download Links</summary>%0A"
msg+="%0A"
for p in *; do
msg+="https://rw-pr-redwoodjs-com.s3.amazonaws.com/$pr_number/$p%0A"
done
msg+="%0AInstall this PR by running \`yarn rw upgrade --pr $pr_number:$v_sha\`"
msg+="</details>%0A"
msg+="%0A"
msg+="Install this PR by running \`yarn rw upgrade --pr $pr_number:$v_sha\`"
echo "::set-output name=msg::$msg"
- name: Find Comment
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ And there you have it.
<tr>
<td align="center"><a href="https://github.com/Chuloo"><img src="https://avatars3.githubusercontent.com/u/22301208?v=4" width="100px;" alt=""/><br /><sub><b>William</b></sub></a></td>
<td align="center"><a href="https://github.com/dcgoodwin2112"><img src="https://avatars1.githubusercontent.com/u/4554388?v=4" width="100px;" alt=""/><br /><sub><b>dcgoodwin2112</b></sub></a></td>
<td align="center"><a href="https://github.com/bennettrogers"><img src="https://avatars1.githubusercontent.com/u/933251?v=4" width="100px;" alt=""/><br /><sub><b>Bennett Rogers</b></sub></a></td>
<td align="center"><a href="https://github.com/byudaniel"><img src="https://avatars0.githubusercontent.com/u/7226285?v=4" width="100px;" alt=""/><br /><sub><b>Daniel O'Neill</b></sub></a></td>
<td align="center"><a href="https://github.com/noobling"><img src="https://avatars2.githubusercontent.com/u/23206864?v=4" width="100px;" alt=""/><br /><sub><b>David Yu</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/adithyasunil26"><img src="https://avatars0.githubusercontent.com/u/51863389?v=4" width="100px;" alt=""/><br /><sub><b>Adithya Sunil</b></sub></a></td>
<td align="center"><a href="https://edjiang.com/"><img src="https://avatars1.githubusercontent.com/u/918770?v=4" width="100px;" alt=""/><br /><sub><b>Edward Jiang</b></sub></a></td>
<td align="center"><a href="http://manukall.de/"><img src="https://avatars0.githubusercontent.com/u/117418?v=4" width="100px;" alt=""/><br /><sub><b>Manuel Kallenbach</b></sub></a></td>
<td align="center"><a href="https://github.com/NickSchmitt"><img src="https://avatars3.githubusercontent.com/u/23244885?v=4" width="100px;" alt=""/><br /><sub><b>Nick Schmitt</b></sub></a></td>
<td align="center"><a href="https://monoglot.dev/"><img src="https://avatars0.githubusercontent.com/u/13792200?v=4" width="100px;" alt=""/><br /><sub><b>Jon Meyers</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/mbush92"><img src="https://avatars0.githubusercontent.com/u/15862774?v=4" width="100px;" alt=""/><br /><sub><b>Matthew Bush</b></sub></a></td>
</tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.22.1",
"version": "0.23.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@redwoodjs/api-server",
"description": "Redwood's HTTP server for Serverless Functions",
"version": "0.22.1",
"version": "0.23.0",
"bin": {
"api-server": "./dist/index.js"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/api",
"version": "0.22.1",
"version": "0.23.0",
"files": [
"dist"
],
Expand All @@ -9,7 +9,7 @@
"license": "MIT",
"dependencies": {
"@prisma/client": "2.12.1",
"@redwoodjs/internal": "^0.22.1",
"@redwoodjs/internal": "^0.23.0",
"apollo-server-lambda": "2.18.2",
"core-js": "3.6.5",
"graphql": "^15.3.0",
Expand All @@ -22,8 +22,8 @@
"merge-graphql-schemas": "^1.7.6"
},
"devDependencies": {
"@redwoodjs/auth": "^0.22.1",
"@redwoodjs/dev-server": "^0.22.1",
"@redwoodjs/auth": "^0.23.0",
"@redwoodjs/dev-server": "^0.23.0",
"@types/jsonwebtoken": "^8.3.9",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.omitby": "^4.6.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/auth",
"version": "0.22.1",
"version": "0.23.0",
"files": [
"dist"
],
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@redwoodjs/cli",
"description": "The Redwood Command Line",
"version": "0.22.1",
"version": "0.23.0",
"license": "MIT",
"bin": {
"redwood": "./dist/index.js",
Expand All @@ -14,9 +14,9 @@
],
"dependencies": {
"@prisma/sdk": "2.12.1",
"@redwoodjs/internal": "^0.22.1",
"@redwoodjs/structure": "^0.22.1",
"@redwoodjs/prerender": "^0.22.1",
"@redwoodjs/internal": "^0.23.0",
"@redwoodjs/structure": "^0.23.0",
"@redwoodjs/prerender": "^0.23.0",
"boxen": "^4.2.0",
"camelcase": "^6.0.0",
"chalk": "^4.1.0",
Expand Down
19 changes: 19 additions & 0 deletions packages/cli/src/commands/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ export const handler = () => {

const r = repl.start()

// always await promises.
// source: https://github.com/nodejs/node/issues/13209#issuecomment-619526317
const defaultEval = r.eval;
r.eval = (cmd, context, filename, callback) => {
defaultEval(cmd, context, filename, async (err, result) => {
if (err) {
// propagate errors.
callback(err);
} else {
// await the promise and either return the result or error.
try {
callback(null, await Promise.resolve(result));
} catch (err) {
callback(err);
}
}
});
};

// Make the project's db (i.e. Prisma Client) available
mapDBToContext(r.context)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// to return a real user from your database, you could do something like:
//
// export const getCurrentUser = async ({ email }) => {
// return await db.user.findOne({ where: { email } })
// return await db.user.findUnique({ where: { email } })
// }
//
// If you want to enforce role-based access ...
Expand Down Expand Up @@ -67,7 +67,7 @@ import { AuthenticationError, ForbiddenError, parseJWT } from '@redwoodjs/api'
* @example - No role-based access control.
*
* export const getCurrentUser = async (decoded) => {
* return await db.user.findOne({ where: { decoded.email } })
* return await db.user.findUnique({ where: { decoded.email } })
* }
*
* @example - User info is contained in the decoded token and roles extracted
Expand All @@ -79,7 +79,7 @@ import { AuthenticationError, ForbiddenError, parseJWT } from '@redwoodjs/api'
* @example - User record query by email with namespaced app_metadata roles
*
* export const getCurrentUser = async (decoded) => {
* const currentUser = await db.user.findOne({ where: { email: decoded.email } })
* const currentUser = await db.user.findUnique({ where: { email: decoded.email } })
*
* return {
* ...currentUser,
Expand All @@ -90,7 +90,7 @@ import { AuthenticationError, ForbiddenError, parseJWT } from '@redwoodjs/api'
* @example - User record query by an identity with app_metadata roles
*
* const getCurrentUser = async (decoded) => {
* const currentUser = await db.user.findOne({ where: { userIdentity: decoded.sub } })
* const currentUser = await db.user.findUnique({ where: { userIdentity: decoded.sub } })
* return {
* ...currentUser,
* roles: parseJWT({ decoded: decoded }).roles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// to return a real user from your database, you could do something like:
//
// export const getCurrentUser = async ({ email }) => {
// return await db.user.findOne({ where: { email } })
// return await db.user.findUnique({ where: { email } })
// }

import { AuthenticationError, ForbiddenError, parseJWT } from '@redwoodjs/api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// to return a real user from your database, you could do something like:
//
// export const getCurrentUser = async ({ email }) => {
// return await db.user.findOne({ where: { email } })
// return await db.user.findUnique({ where: { email } })
// }

import { AuthenticationError } from '@redwoodjs/api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const userProfiles = () => {
}

export const userProfile = ({ id }) => {
return db.userProfile.findOne({
return db.userProfile.findUnique({
where: { id },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const userProfiles = () => {
}

export const userProfile = ({ id }: UserProfileWhereUniqueInput) => {
return db.userProfile.findOne({
return db.userProfile.findUnique({
where: { id },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const users = () => {

export const User = {
identity: (_obj, { root }) =>
db.user.findOne({ where: { id: root.id } }).identity(),
db.user.findUnique({ where: { id: root.id } }).identity(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const users = () => {

export const User = {
identity: (_obj, { root }: ResolverArgs<UserWhereUniqueInput>) =>
db.user.findOne({ where: { id: root.id } }).identity(),
db.user.findUnique({ where: { id: root.id } }).identity(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const posts = () => {
}

export const post = ({ id }) => {
return db.post.findOne({
return db.post.findUnique({
where: { id },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const posts = () => {
}

export const post = ({ id }: PostWhereUniqueInput) => {
return db.post.findOne({
return db.post.findUnique({
where: { id },
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const users = () => {

export const User = {
userProfiles: (_obj, { root }) =>
db.user.findOne({ where: { id: root.id } }).userProfiles(),
db.user.findUnique({ where: { id: root.id } }).userProfiles(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const users = () => {

export const User = {
userProfiles: (_obj, { root }: ResolverArgs<UserWhereUniqueInput>) =>
db.user.findOne({ where: { id: root.id } }).userProfiles(),
db.user.findUnique({ where: { id: root.id } }).userProfiles(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const users = () => {

export const User = {
userProfiles: (_obj, { root }) =>
db.user.findOne({ where: { id: root.id } }).userProfiles(),
db.user.findUnique({ where: { id: root.id } }).userProfiles(),
identity: (_obj, { root }) =>
db.user.findOne({ where: { id: root.id } }).identity(),
db.user.findUnique({ where: { id: root.id } }).identity(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const users = () => {

export const User = {
userProfiles: (_obj, { root }: ResolverArgs<UserWhereUniqueInput>) =>
db.user.findOne({ where: { id: root.id } }).userProfiles(),
db.user.findUnique({ where: { id: root.id } }).userProfiles(),
identity: (_obj, { root }: ResolverArgs<UserWhereUniqueInput>) =>
db.user.findOne({ where: { id: root.id } }).identity(),
db.user.findUnique({ where: { id: root.id } }).identity(),
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const ${pluralCamelName} = () => {
}<% if (crud) { %>

export const ${singularCamelName} = ({ id }: ${singularPascalName}WhereUniqueInput) => {
return db.${singularCamelName}.findOne({
return db.${singularCamelName}.findUnique({
where: { id },
})
}
Expand Down Expand Up @@ -45,5 +45,5 @@ export const delete${singularPascalName} = ({ id }: ${singularPascalName}WhereUn
}<% } %><% if (relations.length) { %>

export const ${singularPascalName} = {<% relations.forEach(relation => { %>
${relation}: (_obj, { root }: ResolverArgs<${singularPascalName}WhereUniqueInput>) => db.${singularCamelName}.findOne({ where: { id: root.id } }).${relation}(),<% }) %>
${relation}: (_obj, { root }: ResolverArgs<${singularPascalName}WhereUniqueInput>) => db.${singularCamelName}.findUnique({ where: { id: root.id } }).${relation}(),<% }) %>
}<% } %>
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/core",
"version": "0.22.1",
"version": "0.23.0",
"license": "MIT",
"files": [
"config",
Expand All @@ -20,11 +20,11 @@
"@babel/runtime-corejs3": "^7.11.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@prisma/cli": "2.12.1",
"@redwoodjs/cli": "^0.22.1",
"@redwoodjs/dev-server": "^0.22.1",
"@redwoodjs/eslint-config": "^0.22.1",
"@redwoodjs/internal": "^0.22.1",
"@redwoodjs/testing": "^0.22.1",
"@redwoodjs/cli": "^0.23.0",
"@redwoodjs/dev-server": "^0.23.0",
"@redwoodjs/eslint-config": "^0.23.0",
"@redwoodjs/internal": "^0.23.0",
"@redwoodjs/testing": "^0.23.0",
"@storybook/react": "^5.3.19",
"@testing-library/jest-dom": "5.11.6",
"@types/jest": "^26.0.10",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-redwood-app/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "create-redwood-app",
"version": "0.22.1",
"version": "0.23.0",
"license": "MIT",
"bin": "./dist/create-redwood-app.js",
"files": [
"dist"
],
"dependencies": {
"@babel/runtime-corejs3": "^7.9.2",
"@redwoodjs/internal": "^0.22.1",
"@redwoodjs/internal": "^0.23.0",
"axios": "^0.20.0",
"chalk": "^4.1.0",
"check-node-version": "^4.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/dev-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@redwoodjs/dev-server",
"description": "Redwood's HTTP server for serverless Functions",
"version": "0.22.1",
"version": "0.23.0",
"bin": {
"dev-server": "./dist/main.js"
},
Expand All @@ -11,7 +11,7 @@
"license": "MIT",
"dependencies": {
"@babel/register": "^7.9.0",
"@redwoodjs/internal": "^0.22.1",
"@redwoodjs/internal": "^0.23.0",
"body-parser": "^1.19.0",
"chokidar": "^3.4.3",
"express": "^4.17.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@redwoodjs/eslint-config",
"version": "0.22.1",
"version": "0.23.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@redwoodjs/eslint-plugin-redwood": "^0.22.1",
"@redwoodjs/eslint-plugin-redwood": "^0.23.0",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"babel-eslint": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-redwood/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/eslint-plugin-redwood",
"version": "0.22.1",
"version": "0.23.0",
"description": "eslint plugin for Redwood rules.",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/forms",
"version": "0.22.1",
"version": "0.23.0",
"files": [
"dist",
"src/index.d.ts"
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redwoodjs/internal",
"version": "0.22.1",
"version": "0.23.0",
"files": [
"dist"
],
Expand Down
Loading

0 comments on commit 64723f1

Please sign in to comment.