v0.38.0 with code mods

This commit is contained in:
David Price
2021-10-27 19:34:59 -07:00
parent 2f27984806
commit 1ce41a4260
8 changed files with 1950 additions and 3512 deletions

View File

@@ -1,43 +0,0 @@
/* eslint-disable no-console */
const { PrismaClient } = require('@prisma/client')
const dotenv = require('dotenv')
dotenv.config()
const db = new PrismaClient()
const POSTS = [
{
title: 'Welcome to the blog!',
body:
"I'm baby single- origin coffee kickstarter lo - fi paleo skateboard.Tumblr hashtag austin whatever DIY plaid knausgaard fanny pack messenger bag blog next level woke.Ethical bitters fixie freegan,helvetica pitchfork 90's tbh chillwave mustache godard subway tile ramps art party. Hammock sustainable twee yr bushwick disrupt unicorn, before they sold out direct trade chicharrones etsy polaroid hoodie. Gentrify offal hoodie fingerstache.",
},
{
title: 'A little more about me',
body:
"Raclette shoreditch before they sold out lyft. Ethical bicycle rights meh prism twee. Tote bag ennui vice, slow-carb taiyaki crucifix whatever you probably haven't heard of them jianbing raw denim DIY hot chicken. Chillwave blog succulents freegan synth af ramps poutine wayfarers yr seitan roof party squid. Jianbing flexitarian gentrify hexagon portland single-origin coffee raclette gluten-free. Coloring book cloud bread street art kitsch lumbersexual af distillery ethical ugh thundercats roof party poke chillwave. 90's palo santo green juice subway tile, prism viral butcher selvage etsy pitchfork sriracha tumeric bushwick.",
},
{
title: 'What is the meaning of life?',
body:
'Meh waistcoat succulents umami asymmetrical, hoodie post-ironic paleo chillwave tote bag. Trust fund kitsch waistcoat vape, cray offal gochujang food truck cloud bread enamel pin forage. Roof party chambray ugh occupy fam stumptown. Dreamcatcher tousled snackwave, typewriter lyft unicorn pabst portland blue bottle locavore squid PBR&B tattooed.',
},
]
async function main() {
const existing = await db.post.findMany()
for (let i = 0; i < POSTS.length; i++) {
const post = POSTS[i]
// only inserts a post if one with the exact same title doesn't already exist
if (!existing.find((ex) => ex.title === post.title)) {
await db.post.create({ data: post })
}
}
}
main()
.catch((e) => console.error(e))
.finally(async () => {
await db.$disconnect()
})

View File

@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@redwoodjs/api": "^0.37.4", "@redwoodjs/api": "^0.38.0",
"@redwoodjs/graphql-server": "^0.37.4" "@redwoodjs/graphql-server": "^0.38.0"
} }
} }

View File

@@ -7,16 +7,16 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@redwoodjs/core": "^0.37.4" "@redwoodjs/core": "^0.38.0"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "@redwoodjs/eslint-config" "extends": "@redwoodjs/eslint-config"
}, },
"engines": { "engines": {
"node": ">=14", "node": ">=14.x <=16.x",
"yarn": ">=1.15" "yarn": ">=1.15"
}, },
"resolutions": { "prisma": {
"@webpack-cli/serve": "1.5.2" "seed": "yarn rw exec seed"
} }
} }

View File

@@ -7,7 +7,7 @@
[web] [web]
port = 8910 port = 8910
apiProxyPath = "/.netlify/functions" apiUrl = "/.netlify/functions"
title = "Redwood Tutorial Blog" title = "Redwood Tutorial Blog"
[api] [api]
port = 8911 port = 8911

44
scripts/seed.js Normal file
View File

@@ -0,0 +1,44 @@
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 POSTS = [
{
title: 'Welcome to the blog!',
body: "I'm baby single- origin coffee kickstarter lo - fi paleo skateboard.Tumblr hashtag austin whatever DIY plaid knausgaard fanny pack messenger bag blog next level woke.Ethical bitters fixie freegan,helvetica pitchfork 90's tbh chillwave mustache godard subway tile ramps art party. Hammock sustainable twee yr bushwick disrupt unicorn, before they sold out direct trade chicharrones etsy polaroid hoodie. Gentrify offal hoodie fingerstache.",
},
{
title: 'A little more about me',
body: "Raclette shoreditch before they sold out lyft. Ethical bicycle rights meh prism twee. Tote bag ennui vice, slow-carb taiyaki crucifix whatever you probably haven't heard of them jianbing raw denim DIY hot chicken. Chillwave blog succulents freegan synth af ramps poutine wayfarers yr seitan roof party squid. Jianbing flexitarian gentrify hexagon portland single-origin coffee raclette gluten-free. Coloring book cloud bread street art kitsch lumbersexual af distillery ethical ugh thundercats roof party poke chillwave. 90's palo santo green juice subway tile, prism viral butcher selvage etsy pitchfork sriracha tumeric bushwick.",
},
{
title: 'What is the meaning of life?',
body: 'Meh waistcoat succulents umami asymmetrical, hoodie post-ironic paleo chillwave tote bag. Trust fund kitsch waistcoat vape, cray offal gochujang food truck cloud bread enamel pin forage. Roof party chambray ugh occupy fam stumptown. Dreamcatcher tousled snackwave, typewriter lyft unicorn pabst portland blue bottle locavore squid PBR&B tattooed.',
},
]
// 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
//
POSTS.map(async (post) => {
const record = await db.post.create({
data: { title: post.title, body: post.body },
})
console.log(record)
})
)
} catch (error) {
console.warn('Please define your seed data.')
console.error(error)
}
}

View File

@@ -13,10 +13,10 @@
] ]
}, },
"dependencies": { "dependencies": {
"@redwoodjs/auth": "^0.37.4", "@redwoodjs/auth": "^0.38.0",
"@redwoodjs/forms": "^0.37.4", "@redwoodjs/forms": "^0.38.0",
"@redwoodjs/router": "^0.37.4", "@redwoodjs/router": "^0.38.0",
"@redwoodjs/web": "^0.37.4", "@redwoodjs/web": "^0.38.0",
"netlify-identity-widget": "^1.9.2", "netlify-identity-widget": "^1.9.2",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^17.0.2", "react": "^17.0.2",

View File

@@ -313,3 +313,9 @@
padding-bottom: 0; padding-bottom: 0;
} }
} }
.rw-input-error:focus {
outline: none;
border-color: #c53030;
box-shadow: 0 0 5px #c53030;
}

5343
yarn.lock

File diff suppressed because it is too large Load Diff