Skip to content

Commit

Permalink
Upgraded to v0.38
Browse files Browse the repository at this point in the history
  • Loading branch information
dthyresson committed Oct 28, 2021
1 parent 479900c commit cb4a59f
Show file tree
Hide file tree
Showing 6 changed files with 1,944 additions and 3,091 deletions.
6 changes: 3 additions & 3 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "^0.37.0",
"@redwoodjs/graphql-server": "0.37.0"
"@redwoodjs/api": "^0.38.0",
"@redwoodjs/graphql-server": "^0.38.0"
}
}
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
"packages/*"
],
"devDependencies": {
"@redwoodjs/core": "^0.37.0"
"@redwoodjs/core": "^0.38.0"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config"
},
"engines": {
"node": ">=14",
"node": ">=14.x <=16.x",
"yarn": ">=1.15"
},
"prisma": {
"seed": "yarn rw exec seed"
}
}
2 changes: 1 addition & 1 deletion redwood.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[web]
port = 8910
apiProxyPath = "/.netlify/functions"
apiUrl = "/.netlify/functions"
title = "Redwood Example ToDo App"
[api]
port = 8911
Expand Down
42 changes: 42 additions & 0 deletions scripts/seed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { db } from '$api/src/lib/db'

export default async () => {
try {
//
// Manually seed via `yarn rw prisma db seed`
// Seeds automatically with `yarn rw prisma migrate dev` and `yarn rw prisma migrate reset`
//
// Update "const data = []" to match your data model and seeding needs
//
const data = [
// To try this example data with the UserExample model in schema.prisma,
// uncomment the lines below and run 'yarn rw prisma migrate dev'
//
// { name: 'alice', email: 'alice@example.com' },
// { name: 'mark', email: 'mark@example.com' },
// { name: 'jackie', email: 'jackie@example.com' },
// { name: 'bob', email: 'bob@example.com' },
]
console.log(
"\nUsing the default './scripts/seed.js' template\nEdit the file to add seed data\n"
)

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
//
// Change to match your data model and seeding needs
//
data.map(async (userExample) => {
const record = await db.userExample.create({
data: { name: userExample.name, email: userExample.email },
})

console.log(record)
})
)
} catch (error) {
console.warn('Please define your seed data.')
console.error(error)
}
}
8 changes: 4 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
]
},
"dependencies": {
"@redwoodjs/auth": "^0.37.0",
"@redwoodjs/forms": "^0.37.0",
"@redwoodjs/router": "^0.37.0",
"@redwoodjs/web": "^0.37.0",
"@redwoodjs/auth": "^0.38.0",
"@redwoodjs/forms": "^0.38.0",
"@redwoodjs/router": "^0.38.0",
"@redwoodjs/web": "^0.38.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
Loading

0 comments on commit cb4a59f

Please sign in to comment.