Compare commits

..

9 Commits

Author SHA1 Message Date
Szilárd Dóró
6cc7704555 Merge pull request #1931 from nhost/changeset-release/main
chore: update versions
2023-05-15 15:47:22 +02:00
github-actions[bot]
c0954dec09 chore: update versions 2023-05-15 13:30:42 +00:00
Szilárd Dóró
6c25480a7a Merge pull request #1929 from nhost/fix/build-targets
chore: change build target to ES2019
2023-05-15 15:29:32 +02:00
Szilárd Dóró
da03bf390c chore: change build target to ES2019 2023-05-15 11:09:00 +02:00
Szilárd Dóró
3b513be9f2 Merge pull request #1926 from nhost/changeset-release/main
chore: update versions
2023-05-12 16:55:46 +02:00
github-actions[bot]
e450e9d636 chore: update versions 2023-05-12 14:27:16 +00:00
Szilárd Dóró
ed1ee10879 Merge pull request #1925 from nhost/fix/postgres-connection-string
fix(dashboard): show correct postgres connection string
2023-05-12 16:25:51 +02:00
Szilárd Dóró
349aac369e chore: add changeset 2023-05-12 14:23:54 +02:00
Szilárd Dóró
5a84362c80 fix: construct postgres connection string 2023-05-12 14:23:05 +02:00
33 changed files with 158 additions and 19 deletions

View File

@@ -36,6 +36,7 @@ export default defineConfig({
} }
}, },
build: { build: {
target: 'es2019',
sourcemap: true, sourcemap: true,
lib: { lib: {
entry, entry,

View File

@@ -1,5 +1,19 @@
# @nhost/dashboard # @nhost/dashboard
## 0.16.10
### Patch Changes
- Updated dependencies [da03bf39]
- @nhost/react-apollo@5.0.21
- @nhost/nextjs@1.13.23
## 0.16.9
### Patch Changes
- 349aac36: fix(settings): use region domain when constructing the postgres connection string
## 0.16.8 ## 0.16.8
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/dashboard", "name": "@nhost/dashboard",
"version": "0.16.8", "version": "0.16.10",
"private": true, "private": true,
"scripts": { "scripts": {
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",

View File

@@ -3,7 +3,6 @@ import SettingsLayout from '@/components/settings/SettingsLayout';
import { useGetDatabaseConnectionInfoQuery } from '@/generated/graphql'; import { useGetDatabaseConnectionInfoQuery } from '@/generated/graphql';
import ActivityIndicator from '@/ui/v2/ActivityIndicator'; import ActivityIndicator from '@/ui/v2/ActivityIndicator';
import { isDevOrStaging } from '@/utils/helpers';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
import SettingsContainer from '@/components/settings/SettingsContainer'; import SettingsContainer from '@/components/settings/SettingsContainer';
@@ -15,14 +14,17 @@ import type { InputProps } from '@/ui/v2/Input';
import Input from '@/ui/v2/Input'; import Input from '@/ui/v2/Input';
import InputAdornment from '@/ui/v2/InputAdornment'; import InputAdornment from '@/ui/v2/InputAdornment';
import CopyIcon from '@/ui/v2/icons/CopyIcon'; import CopyIcon from '@/ui/v2/icons/CopyIcon';
import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl/generateAppServiceUrl';
import { copy } from '@/utils/copy'; import { copy } from '@/utils/copy';
export default function DatabaseSettingsPage() { export default function DatabaseSettingsPage() {
const { currentProject } = useCurrentWorkspaceAndProject(); const { currentProject } = useCurrentWorkspaceAndProject();
const postgresHost = `${currentProject.subdomain}.db.${ const postgresHost = generateAppServiceUrl(
currentProject.region.awsName currentProject.subdomain,
}.${isDevOrStaging() ? 'staging.nhost' : 'nhost'}.run`; currentProject.region,
'db',
).replace('https://', '');
const { data, loading, error } = useGetDatabaseConnectionInfoQuery({ const { data, loading, error } = useGetDatabaseConnectionInfoQuery({
variables: { variables: {

View File

@@ -48,6 +48,10 @@ test('should generate a per service subdomain in remote mode', () => {
'https://test.auth.eu-west-1.nhost.run/v1', 'https://test.auth.eu-west-1.nhost.run/v1',
); );
expect(generateAppServiceUrl('test', region, 'db')).toBe(
'https://test.db.eu-west-1.nhost.run',
);
expect(generateAppServiceUrl('test', region, 'functions')).toBe( expect(generateAppServiceUrl('test', region, 'functions')).toBe(
'https://test.functions.eu-west-1.nhost.run/v1', 'https://test.functions.eu-west-1.nhost.run/v1',
); );
@@ -77,6 +81,10 @@ test('should generate staging subdomains in staging environment', () => {
'https://test.auth.eu-west-1.staging.nhost.run/v1', 'https://test.auth.eu-west-1.staging.nhost.run/v1',
); );
expect(generateAppServiceUrl('test', stagingRegion, 'db')).toBe(
'https://test.db.eu-west-1.staging.nhost.run',
);
expect(generateAppServiceUrl('test', stagingRegion, 'functions')).toBe( expect(generateAppServiceUrl('test', stagingRegion, 'functions')).toBe(
'https://test.functions.eu-west-1.staging.nhost.run/v1', 'https://test.functions.eu-west-1.staging.nhost.run/v1',
); );
@@ -151,6 +159,13 @@ test('should construct service URLs based on environment variables', () => {
`https://localdev1.nhost.run/v1/auth`, `https://localdev1.nhost.run/v1/auth`,
); );
process.env.NEXT_PUBLIC_NHOST_DATABASE_URL =
'https://localdev2.nhost.run/v1/db';
expect(generateAppServiceUrl('test', region, 'db')).toBe(
`https://localdev2.nhost.run/v1/db`,
);
process.env.NEXT_PUBLIC_NHOST_STORAGE_URL = process.env.NEXT_PUBLIC_NHOST_STORAGE_URL =
'https://localdev2.nhost.run/v1/storage'; 'https://localdev2.nhost.run/v1/storage';

View File

@@ -1,6 +1,7 @@
import type { ProjectFragment } from '@/utils/__generated__/graphql'; import type { ProjectFragment } from '@/utils/__generated__/graphql';
import { import {
getAuthServiceUrl, getAuthServiceUrl,
getDatabaseServiceUrl,
getFunctionsServiceUrl, getFunctionsServiceUrl,
getGraphqlServiceUrl, getGraphqlServiceUrl,
getHasuraApiUrl, getHasuraApiUrl,
@@ -10,6 +11,7 @@ import {
export type NhostService = export type NhostService =
| 'auth' | 'auth'
| 'db'
| 'graphql' | 'graphql'
| 'functions' | 'functions'
| 'storage' | 'storage'
@@ -23,6 +25,7 @@ export type NhostService =
*/ */
export const defaultLocalBackendSlugs: Record<NhostService, string> = { export const defaultLocalBackendSlugs: Record<NhostService, string> = {
auth: '/v1/auth', auth: '/v1/auth',
db: '',
graphql: '/v1/graphql', graphql: '/v1/graphql',
functions: '/v1/functions', functions: '/v1/functions',
storage: '/v1/files', storage: '/v1/files',
@@ -36,6 +39,7 @@ export const defaultLocalBackendSlugs: Record<NhostService, string> = {
*/ */
export const defaultRemoteBackendSlugs: Record<NhostService, string> = { export const defaultRemoteBackendSlugs: Record<NhostService, string> = {
auth: '/v1', auth: '/v1',
db: '',
graphql: '/v1', graphql: '/v1',
functions: '/v1', functions: '/v1',
storage: '/v1', storage: '/v1',
@@ -57,7 +61,7 @@ export const defaultRemoteBackendSlugs: Record<NhostService, string> = {
export default function generateAppServiceUrl( export default function generateAppServiceUrl(
subdomain: string, subdomain: string,
region: ProjectFragment['region'], region: ProjectFragment['region'],
service: 'auth' | 'graphql' | 'functions' | 'storage' | 'hasura' | 'grafana', service: NhostService,
localBackendSlugs = defaultLocalBackendSlugs, localBackendSlugs = defaultLocalBackendSlugs,
remoteBackendSlugs = defaultRemoteBackendSlugs, remoteBackendSlugs = defaultRemoteBackendSlugs,
) { ) {
@@ -66,6 +70,7 @@ export default function generateAppServiceUrl(
if (!IS_PLATFORM) { if (!IS_PLATFORM) {
const serviceUrls: Record<typeof service, string> = { const serviceUrls: Record<typeof service, string> = {
auth: getAuthServiceUrl(), auth: getAuthServiceUrl(),
db: getDatabaseServiceUrl(),
graphql: getGraphqlServiceUrl(), graphql: getGraphqlServiceUrl(),
storage: getStorageServiceUrl(), storage: getStorageServiceUrl(),
functions: getFunctionsServiceUrl(), functions: getFunctionsServiceUrl(),

View File

@@ -31,6 +31,13 @@ export function getAuthServiceUrl() {
); );
} }
/**
* Custom URL of the Database service.
*/
export function getDatabaseServiceUrl() {
return process.env.NEXT_PUBLIC_NHOST_DATABASE_URL || 'local.db.nhost.run';
}
/** /**
* Custom URL of the GraphQL service. * Custom URL of the GraphQL service.
*/ */

View File

@@ -1,5 +1,13 @@
# @nhost/apollo # @nhost/apollo
## 5.2.5
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/nhost-js@2.2.3
## 5.2.4 ## 5.2.4
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/apollo", "name": "@nhost/apollo",
"version": "5.2.4", "version": "5.2.5",
"description": "Nhost Apollo Client library", "description": "Nhost Apollo Client library",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/google-translation # @nhost/google-translation
## 0.0.5
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 0.0.4 ## 0.0.4
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/google-translation", "name": "@nhost/google-translation",
"version": "0.0.4", "version": "0.0.5",
"description": "Google Translation GraphQL API", "description": "Google Translation GraphQL API",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,14 @@
# @nhost/react-apollo # @nhost/react-apollo
## 5.0.21
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/apollo@5.2.5
- @nhost/react@2.0.17
## 5.0.20 ## 5.0.20
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/react-apollo", "name": "@nhost/react-apollo",
"version": "5.0.20", "version": "5.0.21",
"description": "Nhost React Apollo client", "description": "Nhost React Apollo client",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,13 @@
# @nhost/react-urql # @nhost/react-urql
## 2.0.18
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/react@2.0.17
## 2.0.17 ## 2.0.17
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/react-urql", "name": "@nhost/react-urql",
"version": "2.0.17", "version": "2.0.18",
"description": "Nhost React URQL client", "description": "Nhost React URQL client",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/stripe-graphql-js # @nhost/stripe-graphql-js
## 1.0.3
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 1.0.2 ## 1.0.2
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/stripe-graphql-js", "name": "@nhost/stripe-graphql-js",
"version": "1.0.2", "version": "1.0.3",
"description": "Stripe GraphQL API", "description": "Stripe GraphQL API",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/docgen # @nhost/docgen
## 0.1.10
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 0.1.9 ## 0.1.9
### Patch Changes ### Patch Changes

View File

@@ -2,7 +2,7 @@
"name": "@nhost/docgen", "name": "@nhost/docgen",
"description": "Documentation generator for classes and functions", "description": "Documentation generator for classes and functions",
"private": true, "private": true,
"version": "0.1.9", "version": "0.1.10",
"license": "MIT", "license": "MIT",
"main": "dist/index.cjs.js", "main": "dist/index.cjs.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js # @nhost/graphql-js
## 0.1.2
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 0.1.1 ## 0.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/graphql-js", "name": "@nhost/graphql-js",
"version": "0.1.1", "version": "0.1.2",
"description": "Nhost GraphQL client", "description": "Nhost GraphQL client",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-auth-js # @nhost/hasura-auth-js
## 2.1.2
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 2.1.1 ## 2.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/hasura-auth-js", "name": "@nhost/hasura-auth-js",
"version": "2.1.1", "version": "2.1.2",
"description": "Hasura-auth client", "description": "Hasura-auth client",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-storage-js # @nhost/hasura-storage-js
## 2.1.2
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
## 2.1.1 ## 2.1.1
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/hasura-storage-js", "name": "@nhost/hasura-storage-js",
"version": "2.1.1", "version": "2.1.2",
"description": "Hasura-storage client", "description": "Hasura-storage client",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,13 @@
# @nhost/nextjs # @nhost/nextjs
## 1.13.23
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/react@2.0.17
## 1.13.22 ## 1.13.22
### Patch Changes ### Patch Changes

View File

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

View File

@@ -1,5 +1,15 @@
# @nhost/nhost-js # @nhost/nhost-js
## 2.2.3
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/graphql-js@0.1.2
- @nhost/hasura-auth-js@2.1.2
- @nhost/hasura-storage-js@2.1.2
## 2.2.2 ## 2.2.2
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@nhost/nhost-js", "name": "@nhost/nhost-js",
"version": "2.2.2", "version": "2.2.3",
"description": "Nhost JavaScript SDK", "description": "Nhost JavaScript SDK",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@@ -1,5 +1,13 @@
# @nhost/react # @nhost/react
## 2.0.17
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/nhost-js@2.2.3
## 2.0.16 ## 2.0.16
### Patch Changes ### Patch Changes

View File

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

View File

@@ -1,5 +1,13 @@
# @nhost/vue # @nhost/vue
## 1.13.23
### Patch Changes
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/nhost-js@2.2.3
## 1.13.22 ## 1.13.22
### Patch Changes ### Patch Changes

View File

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