Compare commits

...

32 Commits

Author SHA1 Message Date
Szilárd Dóró
958dec5dfe Merge pull request #2060 from nhost/changeset-release/main
chore: update versions
2023-06-25 13:50:55 +02:00
github-actions[bot]
61e3497a13 chore: update versions 2023-06-24 17:12:27 +00:00
Szilárd Dóró
a7b4e5606d Merge pull request #2069 from nhost/fix/security-keys
fix(webauthn): don't break webauthn form on save
2023-06-24 19:11:12 +02:00
Szilárd Dóró
34d77c9db1 fix(webauthn): don't break webauthn form on save 2023-06-24 18:54:06 +02:00
Szilárd Dóró
4f1efd28a6 Merge pull request #2058 from nhost/renovate/graphql-16.x
chore(deps): update dependency graphql to v16.7.1
2023-06-23 16:00:02 +02:00
Szilárd Dóró
07a45fde0e chore: add changeset 2023-06-23 14:30:07 +02:00
renovate[bot]
9d0380eef3 chore(deps): update dependency graphql to v16.7.1 2023-06-23 12:12:53 +00:00
Szilárd Dóró
ce3ec36b0a Merge pull request #2059 from nhost/fix/404
fix(dashboard): don't redirect to 404 page
2023-06-23 14:10:21 +02:00
Szilárd Dóró
b62a9d19b5 chore(dashboard): improve verbosity of variables 2023-06-23 13:02:32 +02:00
Szilárd Dóró
c1472079c5 Merge pull request #2057 from nhost/renovate/turbo-monorepo
chore(deps): update dependency turbo to v1.10.5
2023-06-23 12:23:29 +02:00
Szilárd Dóró
dd36971798 chore(pnpm): revert pnpm-lock file 2023-06-23 12:17:08 +02:00
Szilárd Dóró
6199c1c555 fix(dashboard): don't redirect to 404 page 2023-06-23 12:11:22 +02:00
Szilárd Dóró
f41fdc12af chore: bump turbo in the Dockerfile, add changeset 2023-06-23 10:23:43 +02:00
renovate[bot]
fc419ffa4d chore(deps): update dependency turbo to v1.10.5 2023-06-22 19:20:02 +00:00
Szilárd Dóró
b7c102e876 Merge pull request #2056 from nhost/changeset-release/main
chore: update versions
2023-06-21 16:01:32 +02:00
github-actions[bot]
873fc36e61 chore: update versions 2023-06-21 13:29:42 +00:00
Szilárd Dóró
29743f0b71 Merge pull request #2053 from nhost/renovate/react-monorepo
chore(deps): update react monorepo and `@storybook/testing-library`
2023-06-21 15:28:22 +02:00
Szilárd Dóró
d904ca2bbf Merge branch 'renovate/react-monorepo' of https://github.com/nhost/nhost into renovate/react-monorepo 2023-06-21 10:29:52 +02:00
Szilárd Dóró
80b22724de chore(deps): bump @storybook/testing-library 2023-06-21 10:29:38 +02:00
renovate[bot]
80e49f4459 chore(deps): update react monorepo 2023-06-21 07:58:56 +00:00
David Barroso
b3d5ead508 chore(docs): fix stripe reference to env vars (#2054) 2023-06-21 09:55:45 +02:00
renovate[bot]
77dcb8c964 chore(deps): update react monorepo 2023-06-19 16:30:54 +00:00
Szilárd Dóró
3488da9dfd Merge pull request #2052 from nhost/changeset-release/main
chore: update versions
2023-06-19 10:13:57 +02:00
github-actions[bot]
0e68a1fdfd chore: update versions 2023-06-16 12:39:47 +00:00
Szilárd Dóró
8797b2bd17 Merge pull request #2051 from nhost/renovate/commander-11.x
fix(deps): update dependency commander to v11
2023-06-16 14:38:37 +02:00
Szilárd Dóró
5ef0b31573 chore: add changeset 2023-06-16 11:20:58 +02:00
renovate[bot]
86e5e0fb50 fix(deps): update dependency commander to v11 2023-06-16 01:45:29 +00:00
Szilárd Dóró
c2d589dd29 Merge pull request #2049 from nhost/changeset-release/main
chore: update versions
2023-06-15 11:34:48 +02:00
github-actions[bot]
4b807d8134 chore: update versions 2023-06-15 09:16:08 +00:00
Szilárd Dóró
ccdabb707f Merge pull request #2048 from nhost/fix/system-env-var-copy
chore(docs): update environment variable docs
2023-06-15 11:14:40 +02:00
Szilárd Dóró
364bc87fd3 docs: update custom env vars section 2023-06-15 10:48:43 +02:00
Szilárd Dóró
cc02902cbb chore: docs: update env var docs 2023-06-15 10:42:00 +02:00
32 changed files with 1422 additions and 844 deletions

View File

@@ -1,5 +1,27 @@
# @nhost/dashboard
## 0.17.15
### Patch Changes
- f41fdc12a: chore(deps): bump `turbo` to `1.10.5`
- 6199c1c55: fix(projects): don't redirect to 404 page
- Updated dependencies [07a45fde0]
- @nhost/react-apollo@5.0.28
- @nhost/nextjs@1.13.30
## 0.17.14
### Patch Changes
- 80b22724d: chore(deps): bump `@types/react` to `v18.2.13`, `@types/react-dom` to `v18.2.6` and `@storybook/testing-library` to `v0.2.0`
## 0.17.13
### Patch Changes
- cc02902cb: chore(docs): update environment variable documentation
## 0.17.12
### Patch Changes

View File

@@ -3,7 +3,7 @@ RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
RUN yarn global add turbo@1.10.3
RUN yarn global add turbo@1.10.5
COPY . .
RUN turbo prune --scope="@nhost/dashboard" --docker

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.17.12",
"version": "0.17.15",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -96,7 +96,7 @@
"@storybook/builder-webpack5": "^6.5.14",
"@storybook/manager-webpack5": "^6.5.14",
"@storybook/react": "^6.5.14",
"@storybook/testing-library": "^0.0.13",
"@storybook/testing-library": "^0.2.0",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",

View File

@@ -66,7 +66,10 @@ export default function WebAuthnSettings() {
config: {
auth: {
method: {
webauthn: values,
webauthn: {...values,
relyingParty: {
name: currentProject.name,
}},
},
},
},

View File

@@ -3,7 +3,7 @@ import type { Project, Workspace } from '@/types/application';
import { ApplicationStatus } from '@/types/application';
import { getHasuraAdminSecret } from '@/utils/env';
import { GetWorkspaceAndProjectDocument } from '@/utils/__generated__/graphql';
import { useNhostClient, useUserData } from '@nhost/nextjs';
import { useAuthenticationStatus, useNhostClient } from '@nhost/nextjs';
import type { RefetchOptions } from '@tanstack/react-query';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
@@ -34,14 +34,24 @@ export interface UseCurrentWorkspaceAndProjectReturnType {
export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndProjectReturnType {
const client = useNhostClient();
const user = useUserData();
const isPlatform = useIsPlatform();
const { isAuthenticated, isLoading: isAuthLoading } =
useAuthenticationStatus();
const {
query: { workspaceSlug, appSlug },
isReady,
isReady: isRouterReady,
} = useRouter();
const isWorkspaceSlugAvailable = Boolean(workspaceSlug);
const shouldFetchWorkspaceAndProject =
isPlatform &&
isRouterReady &&
isWorkspaceSlugAvailable &&
isAuthenticated &&
!isAuthLoading;
// We can't use the hook exported by the codegen here because there are cases
// where it doesn't target the Nhost backend, but the currently active project
// instead.
@@ -59,7 +69,7 @@ export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndP
}),
{
keepPreviousData: true,
enabled: isPlatform && isReady && !!workspaceSlug && !!user,
enabled: shouldFetchWorkspaceAndProject,
// multiple components are relying on this query, so we don't want to
// refetch it too often - kind of a hack, should be improved later
staleTime: 1000,
@@ -142,7 +152,7 @@ export default function useCurrentWorkspaceAndProject(): UseCurrentWorkspaceAndP
return {
currentWorkspace,
currentProject,
loading: response ? false : isFetching,
loading: response ? false : isFetching || isAuthLoading,
error: response?.error
? new Error(error?.message || 'Unknown error occurred.')
: null,

View File

@@ -123,7 +123,7 @@ export default function SystemEnvironmentVariableSettings() {
return (
<SettingsContainer
title="System Environment Variables"
description="Environment Variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys."
description="System environment variables are automatically generated from the configuration file and your project's subdomain and region."
docsLink="https://docs.nhost.io/platform/environment-variables#system-environment-variables"
rootClassName="gap-0"
className="mt-2 mb-2.5 px-0"

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 0.3.3
### Patch Changes
- cc02902cb: chore(docs): update environment variable documentation
## 0.3.2
### Patch Changes

View File

@@ -138,13 +138,21 @@ export default server
Add `STRIPE_SECRET_KEY` as an environment variable.
If you're using Nhost, add `STRIPE_SECRET_KEY` to `.env.development` like this:
If you're using Nhost, add `STRIPE_SECRET_KEY` to `nhost.toml` like this:
```
[[ global.environment ]]
name=STRIPE_SECRET_KEY
value='{{ secrets.STRIPE_SECRET_KEY }}'
```
And then add to your `.secrets` file:
```
STRIPE_SECRET_KEY=sk_test_***
```
And add the production key (`sk_live_***`) to [environment variables](/platform/environment-variables) in the Nhost dashboard.
In production set your secret with your stripe production key (`sk_live_***`) in the Nhost dashboard.
Learn more about [Stripe API keys](https://stripe.com/docs/keys#obtain-api-keys).

View File

@@ -6,10 +6,6 @@ image: /img/og/platform/environment-variables.png
Environment Variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys.
You can manage your project's Environment Variables in Nhost Dashboard under **Variables**. When you define a new variable, you can set one value for **production** and one for **development**.
![Environment Variables](/img/platform/environment-variables/environment-variables.png)
Environment Variables are available for:
- [Hasura GraphQL Engine](/graphql)
@@ -17,13 +13,44 @@ Environment Variables are available for:
When an Environment Variable has updated the changes happen immediately for Hasura GraphQL Engine. For Serverless Functions, a new deployment via [Git](/platform/git) is required.
## Custom Environment Variables
You can manage your project's Environment Variables in the Nhost Dashboard or by using the configuration file.
### Dashboard
![Environment Variables](/img/platform/environment-variables/environment-variables.png)
Environment Variables can be managed in the Nhost Dashboard under **Settings** &rarr; **Environment Variables**.
### Configuration File
Environment Variables can also be managed by adding new `[[global.environment]]` sections to the `nhost.toml` file.
```toml
[global]
[[global.environment]]
name = 'MY_ENV_VAR'
value = '<first-value>'
[[global.environment]]
name = 'MY_OTHER_ENV_VAR'
value = '<second-value>'
# ... omitted for brevity
```
These environment variables will also be available on the Nhost Dashboard after committing and pushing the changes to your Git repository.
## System Environment Variables
System Environment Variables are automatically available in production and during local development. The following system Environment Variables are available:
System environment variables are automatically generated from the configuration file and your project's subdomain and region.
The following system environment variables are available:
- `NHOST_ADMIN_SECRET`
- `NHOST_WEBHOOK_SECRET`
- `NHOST_BACKEND_URL` ([deprecated](https://github.com/nhost/nhost/discussions/1319))
- ~~`NHOST_BACKEND_URL`~~ ([deprecated](https://github.com/nhost/nhost/discussions/1319))
- `NHOST_SUBDOMAIN`
- `NHOST_REGION`
- `NHOST_HASURA_URL`
@@ -33,7 +60,9 @@ System Environment Variables are automatically available in production and durin
- `NHOST_FUNCTIONS_URL`
- `NHOST_JWT_SECRET`
Example values:
`NHOST_ADMIN_SECRET`, `NHOST_WEBHOOK_SECRET` and `NHOST_JWT_SECRET` are populated with values from the configuration file. The rest of the system environment variables are populated with values from your project's subdomain and region.
**Example values**:
```text
NHOST_ADMIN_SECRET=e7w36ag287qn5qry795f6ymm57qgvqup
@@ -58,10 +87,3 @@ NHOST_FUNCTIONS_URL=https://abc123abc.functions.eu-central-1.nhost.run/v1
NHOST_JWT_SECRET={"type": "HS256", "key": "vumpbe2w2mgaqj5yqfp7dvxu6kywtvsgb68ejpdaqxerea8jwrsszdp2dhkjxsh4df69pzm3ja6ukedx8ja43zdt6q9kgbgg2w9vh2sedeppukud9a2qzy29v3afdn7m"}
```
## Development Environment Variables
When developing locally using the [CLI](/cli), Environment Variables set in `.env.development` are available in your local environment. There are two ways to manage them:
1. Edit the `.env.development` file manually.
2. Add development Environment Variables in the Nhost Dashboard and use `nhost env pull` to sync them. This way, your team members will also have access to the same Environment Variables.

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"scripts": {
"docusaurus": "docusaurus",

View File

@@ -1,5 +1,13 @@
# @nhost/apollo
## 5.2.12
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
- Updated dependencies [07a45fde0]
- @nhost/nhost-js@2.2.10
## 5.2.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "5.2.11",
"version": "5.2.12",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [
@@ -64,7 +64,7 @@
"@nhost/nhost-js": "workspace:*"
},
"dependencies": {
"graphql": "16.6.0",
"graphql": "16.7.1",
"graphql-ws": "^5.10.1"
},
"devDependencies": {

View File

@@ -1,5 +1,14 @@
# @nhost/react-apollo
## 5.0.28
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
- Updated dependencies [07a45fde0]
- @nhost/apollo@5.2.12
- @nhost/react@2.0.24
## 5.0.27
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "5.0.27",
"version": "5.0.28",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [
@@ -74,7 +74,7 @@
"@apollo/client": "^3.7.10",
"@nhost/react": "workspace:*",
"@types/react": "^18.0.34",
"graphql": "16.6.0",
"graphql": "16.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}

View File

@@ -1,5 +1,12 @@
# @nhost/react-urql
## 2.0.25
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
- @nhost/react@2.0.24
## 2.0.24
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-urql",
"version": "2.0.24",
"version": "2.0.25",
"description": "Nhost React URQL client",
"license": "MIT",
"keywords": [
@@ -73,7 +73,7 @@
"devDependencies": {
"@nhost/react": "workspace:*",
"@types/react": "^18.0.34",
"graphql": "16.6.0",
"graphql": "16.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"urql": "^4.0.0"

View File

@@ -1,5 +1,11 @@
# @nhost/stripe-graphql-js
## 1.0.4
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
## 1.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/stripe-graphql-js",
"version": "1.0.3",
"version": "1.0.4",
"description": "Stripe GraphQL API",
"license": "MIT",
"keywords": [
@@ -41,7 +41,7 @@
},
"dependencies": {
"@pothos/core": "^3.21.0",
"graphql": "16.6.0",
"graphql": "16.7.1",
"graphql-scalars": "^1.18.0",
"graphql-yoga": "^3.4.0",
"jsonwebtoken": "^9.0.0",

View File

@@ -76,7 +76,7 @@
"husky": "^8.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"turbo": "1.10.3",
"turbo": "1.10.5",
"typedoc": "^0.22.18",
"typescript": "4.9.5",
"vite": "^4.3.8",
@@ -85,7 +85,7 @@
"vitest": "^0.32.0"
},
"resolutions": {
"graphql": "16.6.0"
"graphql": "16.7.1"
},
"packageManager": "pnpm@8.6.2",
"engines": {

View File

@@ -1,5 +1,11 @@
# @nhost/docgen
## 0.1.11
### Patch Changes
- 5ef0b3157: chore(deps): bump `commander` to `v11`
## 0.1.10
### Patch Changes

View File

@@ -2,7 +2,7 @@
"name": "@nhost/docgen",
"description": "Documentation generator for classes and functions",
"private": true,
"version": "0.1.10",
"version": "0.1.11",
"license": "MIT",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
@@ -40,7 +40,7 @@
},
"dependencies": {
"chalk": "4",
"commander": "^10.0.0",
"commander": "^11.0.0",
"just-kebab-case": "^4.1.1",
"prettier": "^2.7.1",
"valtio": "^1.6.4"

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js
## 0.1.4
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
## 0.1.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/graphql-js",
"version": "0.1.3",
"version": "0.1.4",
"description": "Nhost GraphQL client",
"license": "MIT",
"keywords": [
@@ -61,6 +61,6 @@
},
"devDependencies": {
"@nhost/docgen": "workspace:*",
"graphql": "16.6.0"
"graphql": "16.7.1"
}
}

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 1.13.30
### Patch Changes
- @nhost/react@2.0.24
## 1.13.29
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.13.29",
"version": "1.13.30",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,13 @@
# @nhost/nhost-js
## 2.2.10
### Patch Changes
- 07a45fde0: chore(deps): bump `graphql` to `v16.7.1`
- Updated dependencies [07a45fde0]
- @nhost/graphql-js@0.1.4
## 2.2.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "2.2.9",
"version": "2.2.10",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [
@@ -69,7 +69,7 @@
},
"devDependencies": {
"@nhost/docgen": "workspace:*",
"graphql": "16.6.0"
"graphql": "16.7.1"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"

View File

@@ -1,5 +1,12 @@
# @nhost/react
## 2.0.24
### Patch Changes
- Updated dependencies [07a45fde0]
- @nhost/nhost-js@2.2.10
## 2.0.23
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "2.0.23",
"version": "2.0.24",
"description": "Nhost React library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/vue
## 1.13.30
### Patch Changes
- Updated dependencies [07a45fde0]
- @nhost/nhost-js@2.2.10
## 1.13.29
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "1.13.29",
"version": "1.13.30",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [

2033
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff