Skip to content

Commit 033d8ed

Browse files
authored
Upgrade to v4-canary and new Netlify Auth Packages (#36)
1 parent 9a751c6 commit 033d8ed

File tree

41 files changed

+25809
-18531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+25809
-18531
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"**/.git/objects/**": true,
1313
"**/.git/subtree-cache/**": true,
1414
"**/.hg/store/**": true
15-
}
15+
},
16+
"dotenv.enableAutocloaking": false
1617
}

.yarn/install-state.gz

2.73 MB
Binary file not shown.

.yarn/releases/yarn-3.2.3.cjs

Lines changed: 783 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Yarn's manifest file. You can configure yarn here.
2+
# See https://yarnpkg.com/configuration/yarnrc.
3+
4+
# For `node_modules` (see `nodeLinker` below), this is almost always the preferred option.
5+
compressionLevel: 0
6+
7+
enableGlobalCache: true
8+
9+
# Lets yarn use hardlinks inside `node_modules` to dedupe packages.
10+
# For a more pnpm-like experience, consider `hardlinks-global` where hardlinks point to a global store.
11+
nmMode: hardlinks-local
12+
13+
# How to install Node packages.
14+
# Heads up: right now, Redwood expects this to be `node-modules`.
15+
nodeLinker: node-modules
16+
17+
yarnPath: .yarn/releases/yarn-3.2.3.cjs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Note: This app does not store any User information in a database, but rather int
2020

2121
You can access a demo at [https://redwoodblog-with-identity.netlify.app/](https://redwoodblog-with-identity.netlify.app/).
2222

23-
***Important:*** This app currently uses [RedwoodJS v1.3.2](https://github.com/redwoodjs/redwood/releases/tag/v1.3.2). While we endeavor to keep this up-to-date with the latest version, there may be a short delay after a [new release](https://github.com/redwoodjs/redwood/releases).
23+
***Important:*** This app currently uses [RedwoodJS v4-canary](https://github.com/redwoodjs/redwood/releases/tag/v4.0.0). While we endeavor to keep this up-to-date with the latest version, there may be a short delay after a [new release](https://github.com/redwoodjs/redwood/releases).
2424

2525
### Roles
2626

api/db/migrations/20210319033435_/migration.sql

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
-- CreateTable
2+
CREATE TABLE "Post" (
3+
"id" SERIAL NOT NULL,
4+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
5+
"title" TEXT NOT NULL,
6+
"body" TEXT NOT NULL,
7+
"authorId" TEXT,
8+
"editorId" TEXT,
9+
"publisherId" TEXT,
10+
"publishedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
11+
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12+
13+
CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
14+
);
15+
16+
-- CreateTable
17+
CREATE TABLE "Contact" (
18+
"id" SERIAL NOT NULL,
19+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20+
"name" TEXT NOT NULL,
21+
"email" TEXT NOT NULL,
22+
"message" TEXT NOT NULL,
23+
"userId" TEXT,
24+
25+
CONSTRAINT "Contact_pkey" PRIMARY KEY ("id")
26+
);
27+
28+
-- CreateTable
29+
CREATE TABLE "UserProfile" (
30+
"id" SERIAL NOT NULL,
31+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
32+
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
33+
"uuid" TEXT NOT NULL,
34+
35+
CONSTRAINT "UserProfile_pkey" PRIMARY KEY ("id")
36+
);
37+
38+
-- CreateTable
39+
CREATE TABLE "UserRole" (
40+
"id" SERIAL NOT NULL,
41+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
42+
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
43+
"name" TEXT NOT NULL,
44+
"userProfileId" INTEGER,
45+
46+
CONSTRAINT "UserRole_pkey" PRIMARY KEY ("id")
47+
);
48+
49+
-- CreateIndex
50+
CREATE UNIQUE INDEX "UserProfile_uuid_key" ON "UserProfile"("uuid");
51+
52+
-- CreateIndex
53+
CREATE UNIQUE INDEX "UserRole_name_userProfileId_key" ON "UserRole"("name", "userProfileId");
54+
55+
-- AddForeignKey
56+
ALTER TABLE "UserRole" ADD CONSTRAINT "UserRole_userProfileId_fkey" FOREIGN KEY ("userProfileId") REFERENCES "UserProfile"("id") ON DELETE SET NULL ON UPDATE CASCADE;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Please do not edit this file manually
22
# It should be added in your version-control system (i.e. Git)
3-
provider = "postgresql"
3+
provider = "postgresql"

api/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
6-
"@redwoodjs/api": "^1.3.2",
7-
"@redwoodjs/graphql-server": "^1.3.2",
6+
"@redwoodjs/api": "4.0.0-canary.230",
7+
"@redwoodjs/auth-providers-api": "^0.0.1",
8+
"@redwoodjs/graphql-server": "4.0.0-canary.230",
89
"date-fns": "2.28.0",
910
"got": "11.8.3"
1011
}
11-
}
12+
}

api/server.config.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* This file allows you to configure the Fastify Server settings
3+
* used by the RedwoodJS dev server.
4+
*
5+
* It also applies when running RedwoodJS with `yarn rw serve`.
6+
*
7+
* For the Fastify server options that you can set, see:
8+
* https://www.fastify.io/docs/latest/Reference/Server/#factory
9+
*
10+
* Examples include: logger settings, timeouts, maximum payload limits, and more.
11+
*
12+
* Note: This configuration does not apply in a serverless deploy.
13+
*/
14+
15+
/** @type {import('fastify').FastifyServerOptions} */
16+
const config = {
17+
requestTimeout: 15_000,
18+
logger: {
19+
// Note: If running locally using `yarn rw serve` you may want to adust
20+
// the default non-development level to `info`
21+
level: process.env.NODE_ENV === 'development' ? 'debug' : 'warn',
22+
},
23+
}
24+
25+
/**
26+
* You can also register Fastify plugins and additional routes for the API and Web sides
27+
* in the configureFastify function.
28+
*
29+
* This function has access to the Fastify instance and options, such as the side
30+
* (web, api, or proxy) that is being configured and other settings like the apiRootPath
31+
* of the functions endpoint.
32+
*
33+
* Note: This configuration does not apply in a serverless deploy.
34+
*/
35+
36+
/** @type {import('@redwoodjs/api-server/dist/fastify').FastifySideConfigFn} */
37+
const configureFastify = async (fastify, options) => {
38+
if (options.side === 'api') {
39+
fastify.log.info({ custom: { options } }, 'Configuring api side')
40+
}
41+
42+
if (options.side === 'web') {
43+
fastify.log.info({ custom: { options } }, 'Configuring web side')
44+
}
45+
46+
return fastify
47+
}
48+
49+
module.exports = {
50+
config,
51+
configureFastify,
52+
}

0 commit comments

Comments
 (0)