Skip to content

Commit

Permalink
Merge upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sync Fork committed Nov 16, 2023
1 parent f47fec7 commit deda09e
Show file tree
Hide file tree
Showing 22 changed files with 1,323 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { useUI } from '@/components/common/UIProvider';
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Alert } from '@/components/ui/v2/Alert';
import { Box } from '@/components/ui/v2/Box';
import { Input } from '@/components/ui/v2/Input';
import { Text } from '@/components/ui/v2/Text';
import { Alert } from '@/components/ui/v2/Alert';
import { UpgradeNotification } from '@/features/projects/common/components/UpgradeNotification';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import {
Expand Down Expand Up @@ -145,9 +144,11 @@ export default function AuthDomain() {
/>
</Box>
{!currentProject.plan.isFree && (
<Alert severity="info" className="col-span-6 text-left">
Note that volumes can only be increased (not decreased). Also, due to an AWS limitation, the same volume can only be increased once every 6 hours.
</Alert>
<Alert severity="info" className="col-span-6 text-left">
Note that volumes can only be increased (not decreased). Also, due
to an AWS limitation, the same volume can only be increased once
every 6 hours.
</Alert>
)}
</SettingsContainer>
</Form>
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstarts/nextjs-server-components/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['../../config/.eslintrc.js', 'plugin:@next/next/recommended'],
extends: ['../../../config/.eslintrc.js', 'plugin:@next/next/recommended'],
rules: {
'react/react-in-jsx-scope': 'off'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getNhost } from '@utils/nhost'
import Head from 'next/head'
import Link from 'next/link'

const PAT = async ({
const PATs = async ({
params
}: {
params: {
Expand Down Expand Up @@ -100,4 +100,4 @@ const PAT = async ({
)
}

export default withAuthAsync(PAT)
export default withAuthAsync(PATs)
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const TodoItem = ({ todo }: { todo: Todo }) => {
<Link
className="w-6 h-6"
target="_blank"
passHref
href={nhost.storage.getPublicUrl({ fileId: todo.attachment.id })}
>
<svg
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { manageAuthSession } from '@utils/nhost'

// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server'

export async function middleware(request: NextRequest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { AuthErrorPayload, NhostClient, NhostSession } from '@nhost/nhost-js'
import { cookies } from 'next/headers'

// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server'
import { type StateFrom } from 'xstate/lib/types'
import { waitFor } from 'xstate/lib/waitFor'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
table:
name: virus
schema: storage
configuration:
column_config:
created_at:
custom_name: createdAt
file_id:
custom_name: fileId
filename:
custom_name: filename
id:
custom_name: id
updated_at:
custom_name: updatedAt
user_session:
custom_name: userSession
virus:
custom_name: virus
custom_column_names:
created_at: createdAt
file_id: fileId
filename: filename
id: id
updated_at: updatedAt
user_session: userSession
virus: virus
custom_name: virus
custom_root_fields:
delete: deleteViruses
delete_by_pk: deleteVirus
insert: insertViruses
insert_one: insertVirus
select: viruses
select_aggregate: virusesAggregate
select_by_pk: virus
update: updateViruses
update_by_pk: updateVirus
object_relationships:
- name: file
using:
foreign_key_constraint_on: file_id
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
- "!include public_todos.yaml"
- "!include storage_buckets.yaml"
- "!include storage_files.yaml"
- "!include storage_virus.yaml"
3 changes: 2 additions & 1 deletion examples/quickstarts/nhost-backend/nhost/nhost.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ httpPoolSize = 100
version = 18

[auth]
version = '0.21.3'
version = '0.22.1'

[auth.redirections]
clientUrl = 'http://localhost:3000'
allowedUrls = ['https://example-nextjs-server-components.nhost.io', 'https://example-sveltekit.nhost.io']

[auth.signUp]
enabled = true
Expand Down
1 change: 0 additions & 1 deletion examples/quickstarts/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"type": "module",
"dependencies": {
"@apollo/client": "^3.8.1",
"graphql": "^16.7.1",
"graphql-tag": "^2.12.6",
"js-cookie": "^3.0.5",
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstarts/sveltekit/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:5173',
baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry'
Expand All @@ -51,7 +51,7 @@ export default defineConfig({

webServer: {
command: 'pnpm dev',
url: 'http://localhost:5173',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI
}
})
8 changes: 4 additions & 4 deletions examples/quickstarts/sveltekit/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import { redirect } from '@sveltejs/kit'

/** @type {import('./$types').Actions} */
export const actions = {
default: async ({ cookies }) => {
default: async ({ request, cookies }) => {
const nhost = await getNhost(cookies)

const { providerUrl } = await nhost.auth.signIn({ provider: 'google' })
const { providerUrl } = await nhost.auth.signIn({
provider: 'google',
options: {
redirectTo: new URL(request.url).origin
}
})

if (providerUrl) {
throw redirect(307, providerUrl)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getNhost } from '$lib/nhost'
import { gql } from '@apollo/client'
import gql from 'graphql-tag'

/** @type {import('./$types').PageServerLoad} */
export const load = async ({ url, cookies }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getNhost } from '$lib/nhost.js'
import { gql } from '@apollo/client'
import { json, redirect } from '@sveltejs/kit'
import gql from 'graphql-tag'

export const DELETE = async ({ cookies, params }) => {
const nhost = await getNhost(cookies)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getNhost } from '$lib/nhost'
import { gql } from '@apollo/client'
import gql from 'graphql-tag'

/** @type {import('./$types').PageServerLoad} */
export const load = async ({ url, cookies }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getNhost } from '$lib/nhost'
import { gql } from '@apollo/client'
import { redirect } from '@sveltejs/kit'
import gql from 'graphql-tag'

/** @type {import('./$types').Actions} */
export const actions = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getNhost } from '$lib/nhost'
import { gql } from '@apollo/client'
import { redirect } from '@sveltejs/kit'
import gql from 'graphql-tag'

/** @type {import('./$types').Actions} */
export const actions = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getNhost } from '$lib/nhost'
import { gql } from '@apollo/client'
import { json } from '@sveltejs/kit'
import gql from 'graphql-tag'

/** @type {import('./$types').RequestHandler} */
export async function POST({ request, cookies }) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"build:docs": "turbo run build --filter=@nhost/docs",
"build:all": "turbo run build --include-dependencies",
"dev": "turbo run dev --filter=!@nhost/dashboard --filter=!@nhost/docs --filter=!@nhost-examples/* --filter=!@nhost/docgen --no-deps --include-dependencies",
"clean:all": "pnpm clean && rm -rf ./{{packages,examples}/*,docs,dashboard}/{.nhost,node_modules} node_modules",
"clean": "rm -rf ./{{packages,examples}/*,docs,dashboard}/{dist,umd,.next,.turbo,coverage}",
"clean:all": "pnpm clean && rm -rf ./{{packages,examples/**}/*,docs,dashboard}/{.nhost,node_modules} node_modules",
"clean": "rm -rf ./{{packages,examples/**}/*,docs,dashboard}/{dist,umd,.next,.turbo,coverage}",
"ci:version": "changeset version && pnpm install --frozen-lockfile false",
"coverage": "pnpm run test -- --coverage",
"prettier": "prettier --check .",
Expand Down
Loading

0 comments on commit deda09e

Please sign in to comment.