Compare commits

..

49 Commits

Author SHA1 Message Date
Szilárd Dóró
ce3ece1ad7 Merge pull request #1714 from nhost/changeset-release/main
chore: update versions
2023-03-08 09:21:29 +01:00
github-actions[bot]
c81002622c chore: update versions 2023-03-07 16:27:40 +00:00
Szilárd Dóró
35fa6bb043 Merge pull request #1712 from nhost/fix/functions
fix(nhost-js): correct return type in functions
2023-03-07 17:24:07 +01:00
Szilárd Dóró
b8f11a13d7 fix: add missing type 2023-03-07 15:09:35 +01:00
Szilárd Dóró
1d1555593f fix: correct return type in functions 2023-03-07 15:03:28 +01:00
Szilárd Dóró
99fcc36250 Merge pull request #1695 from nhost/changeset-release/main
chore: update versions
2023-03-07 10:22:13 +01:00
github-actions[bot]
7e4a756cfe chore: update versions 2023-03-06 07:49:58 +00:00
Szilárd Dóró
5bf61583e0 Merge pull request #1699 from nhost/renovate/xstate-inspect-0.x
chore(deps): update dependency @xstate/inspect to ^0.8.0
2023-03-06 08:48:24 +01:00
Szilárd Dóró
7eac17a1cb chore: add changeset 2023-03-06 08:48:02 +01:00
Szilárd Dóró
a41aeeb9ef Merge pull request #1697 from nhost/fix/deployment-glitch
fix(dashboard): show correct deployment status on the main page
2023-03-03 15:37:22 +01:00
Johan Eliasson
e33df513ff Merge pull request #1698 from nhost/chatgpt-b9asdasd
tests: hasura-storage-js
2023-03-03 15:20:27 +01:00
Johan Eliasson
323fd5cbe3 Update packages/hasura-storage-js/src/utils/index.ts
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2023-03-03 13:30:36 +01:00
renovate[bot]
ffb3c426d3 chore(deps): update dependency @xstate/inspect to ^0.8.0 2023-03-03 00:17:57 +00:00
Johan Eliasson
889ee6589e added tests 2023-03-02 23:13:03 +01:00
Szilárd Dóró
5223ee9353 fix(dashboard): don't show weird deployment dates 2023-03-02 14:08:59 +01:00
Szilárd Dóró
c8c5ace7cc Merge pull request #1500 from nhost/renovate/turbo-1.x
chore(deps): update dependency turbo to v1.8.3
2023-03-02 13:05:29 +01:00
Johan Eliasson
c6a4c28579 Merge pull request #1694 from nhost/renovate-changesets
chore: create changesest from Renovate bumps
2023-03-02 12:36:10 +01:00
szilarddoro
850a049ca2 chore(deps): update docker/build-push-action action to v4 2023-03-02 11:36:03 +00:00
Szilárd Dóró
eff3f0aefd Merge pull request #1641 from nhost/renovate/docker-build-push-action-4.x
chore(deps): update docker/build-push-action action to v4
2023-03-02 12:34:35 +01:00
Szilárd Dóró
2b1338f716 chore(deps): bump turbo for the dashboard 2023-03-02 11:50:48 +01:00
Szilárd Dóró
2b58c60747 Merge remote-tracking branch 'origin/main' into renovate/turbo-1.x 2023-03-02 11:44:21 +01:00
Szilárd Dóró
1b2e3fbd1d Merge pull request #1689 from nhost/changeset-release/main
chore: update versions
2023-03-02 11:39:55 +01:00
github-actions[bot]
6f4fdcf73f chore: update versions 2023-03-02 09:58:26 +00:00
Szilárd Dóró
cb529dc60c Merge pull request #1557 from nhost/renovate/vitest-monorepo
chore(deps): update vitest monorepo to ^0.29.0
2023-03-02 10:56:23 +01:00
Szilárd Dóró
68a449dbfc Merge remote-tracking branch 'origin/main' into renovate/vitest-monorepo 2023-03-02 10:33:42 +01:00
Szilárd Dóró
7d0c6d083a Merge pull request #1680 from nhost/renovate/glob-9.x
fix(deps): update dependency glob to v9
2023-03-02 10:28:58 +01:00
Szilárd Dóró
1353477da1 fix: lint error 2023-03-02 10:22:49 +01:00
Szilárd Dóró
549c7cb7eb chore(deps): bump glob to v9 2023-03-02 10:17:39 +01:00
Szilárd Dóró
e131c12d5d Merge branch 'renovate/vitest-monorepo' of https://github.com/nhost/nhost into renovate/vitest-monorepo 2023-03-02 10:03:45 +01:00
Szilárd Dóró
8bb097c9a7 chore(deps): bump vitest 2023-03-02 10:01:27 +01:00
renovate[bot]
ea31e64a71 chore(deps): update vitest monorepo to ^0.29.0 2023-03-02 08:58:06 +00:00
renovate[bot]
369b931689 chore(deps): update dependency turbo to v1.8.3 2023-03-02 08:56:38 +00:00
Szilárd Dóró
e1ec5c1be2 Merge remote-tracking branch 'origin/main' into renovate/vitest-monorepo 2023-03-02 09:51:23 +01:00
Szilárd Dóró
9822a160d4 Merge remote-tracking branch 'origin/main' into renovate/glob-9.x 2023-03-02 09:50:28 +01:00
Szilárd Dóró
7c67a2c437 chore(sync-versions): bump glob to v9 2023-03-02 09:50:11 +01:00
Szilárd Dóró
8e8884f4e1 Merge pull request #1629 from nhost/renovate/typescript-4.x
chore(deps): update dependency typescript to v4.9.5
2023-03-02 09:49:23 +01:00
Szilárd Dóró
9923be41ce Merge pull request #1675 from nhost/fix/isomorphic-unfetch
chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
2023-03-02 09:29:49 +01:00
Szilárd Dóró
bd6b55868a Merge remote-tracking branch 'origin/main' into renovate/typescript-4.x 2023-02-28 17:04:20 +01:00
renovate[bot]
cb7c8c6398 fix(deps): update dependency glob to v9 2023-02-28 11:06:48 +00:00
Szilárd Dóró
4bf40995b5 chore(deps): add changeset 2023-02-28 12:02:28 +01:00
Szilárd Dóró
ab5f704280 chore(deps): remove direct typescript dependency 2023-02-28 11:59:38 +01:00
Szilárd Dóró
7e0e4d05aa Merge remote-tracking branch 'origin/main' into renovate/typescript-4.x 2023-02-28 11:45:49 +01:00
Szilárd Dóró
0954a44f84 Merge remote-tracking branch 'origin/main' into fix/isomorphic-unfetch 2023-02-28 11:38:25 +01:00
Szilárd Dóró
5a91c477f0 fix(dashboard): fix tests 2023-02-27 11:45:22 +01:00
Szilárd Dóró
66f73d06a8 fix(hasura-storage-js): fix build error 2023-02-27 11:17:53 +01:00
Szilárd Dóró
35d52aab87 chore(deps): replace cross-fetch with isomorphic-unfetch 2023-02-27 10:57:37 +01:00
renovate[bot]
832210d8ad chore(deps): update vitest monorepo to ^0.29.0 2023-02-25 11:09:59 +00:00
renovate[bot]
6999562b59 chore(deps): update dependency typescript to v4.9.5 2023-02-21 17:03:56 +00:00
renovate[bot]
7d577a68b7 chore(deps): update docker/build-push-action action to v4 2023-02-20 10:08:41 +00:00
62 changed files with 1450 additions and 972 deletions

View File

@@ -98,7 +98,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
timeout-minutes: 60
with:
context: .

View File

@@ -20,7 +20,9 @@ export default defineConfig({
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
entryRoot: 'src',
// Was defaulting to true until version 1.7
skipDiagnostics: true
skipDiagnostics: true,
// Was defaulting to true until version 2.0
copyDtsFiles: true
})
],
test: {

View File

@@ -1,5 +1,36 @@
# @nhost/dashboard
## 0.12.4
### Patch Changes
- @nhost/react-apollo@5.0.9
- @nhost/nextjs@1.13.14
## 0.12.3
### Patch Changes
- 2b1338f7: chore(dashboard): bump `turbo` to 1.8.3
- 5223ee93: fix(dashboard): show correct deployment status on the main page
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/nextjs@1.13.13
- @nhost/react-apollo@5.0.8
## 0.12.2
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/react-apollo@5.0.7
- @nhost/nextjs@1.13.12
## 0.12.1
### 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.6.3
RUN yarn global add turbo@1.8.3
COPY . .
RUN turbo prune --scope="@nhost/dashboard" --docker

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.12.1",
"version": "0.12.4",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -46,7 +46,6 @@
"analytics-node": "^6.2.0",
"bcryptjs": "^2.4.3",
"clsx": "^1.2.1",
"cross-fetch": "^3.1.5",
"date-fns": "^2.29.3",
"generate-password": "^1.7.0",
"graphiql": "^2.2.0",
@@ -112,11 +111,12 @@
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@vitejs/plugin-react": "^3.0.0",
"@vitest/coverage-c8": "^0.27.0",
"@vitest/coverage-c8": "^0.29.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^8.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"csstype": "^3.0.10",
"encoding": "^0.1.13",
"eslint": "^8.28.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
@@ -130,6 +130,7 @@
"lint-staged": ">=13",
"msw": "^1.0.1",
"msw-storybook-addon": "^1.6.3",
"node-fetch": "^3.3.0",
"postcss": "^8.4.19",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.2.0",
@@ -140,10 +141,9 @@
"tailwindcss": "^3.1.2",
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "^4.8.4",
"vite": "^4.0.2",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.27.0",
"vitest": "^0.29.0",
"webpack": "^5.75.0"
},
"browserslist": {

View File

@@ -1,4 +1,7 @@
import { useDeleteApplicationMutation } from '@/generated/graphql';
import {
GetOneUserDocument,
useDeleteApplicationMutation,
} from '@/generated/graphql';
import { useCurrentWorkspaceAndApplication } from '@/hooks/useCurrentWorkspaceAndApplication';
import Button from '@/ui/v2/Button';
import ArrowRightIcon from '@/ui/v2/icons/ArrowRightIcon';
@@ -12,7 +15,9 @@ import { useRouter } from 'next/router';
export default function ApplicationInfo() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const [deleteApplication, { client }] = useDeleteApplicationMutation();
const [deleteApplication, { client }] = useDeleteApplicationMutation({
refetchQueries: [GetOneUserDocument],
});
const router = useRouter();
async function handleClickRemove() {

View File

@@ -1,8 +1,8 @@
import DeploymentStatusMessage from '@/components/deployments/DeploymentStatusMessage';
import { FindOldApps } from '@/components/home';
import type { UserData } from '@/hooks/useGetAllUserWorkspacesAndApplications';
import type { ApplicationState } from '@/types/application';
import { ApplicationStatus } from '@/types/application';
import { Avatar } from '@/ui/Avatar';
import StateBadge from '@/ui/StateBadge';
import type { DeploymentStatus } from '@/ui/StatusCircle';
import { StatusCircle } from '@/ui/StatusCircle';
@@ -10,59 +10,11 @@ import Divider from '@/ui/v2/Divider';
import Link from '@/ui/v2/Link';
import List from '@/ui/v2/List';
import { ListItem } from '@/ui/v2/ListItem';
import Text from '@/ui/v2/Text';
import { getApplicationStatusString } from '@/utils/helpers';
import { formatDistance } from 'date-fns';
import Image from 'next/image';
import NavLink from 'next/link';
import { Fragment } from 'react';
function ApplicationCreatedAt({ createdAt }: any) {
return (
<Text component="span" className="text-sm">
created{' '}
{formatDistance(new Date(createdAt), new Date(), {
addSuffix: true,
})}
</Text>
);
}
function LastSuccessfulDeployment({ deployment }: any) {
return (
<span className="flex flex-row">
<Avatar
component="span"
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="mr-1 h-4 w-4 self-center"
/>
<Text component="span" className="self-center text-sm">
{deployment.commitUserName} deployed{' '}
{formatDistance(new Date(deployment.deploymentEndedAt), new Date(), {
addSuffix: true,
})}
</Text>
</span>
);
}
function CurrentDeployment({ deployment }: any) {
return (
<span className="flex flex-row">
<Avatar
component="span"
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="mr-1 h-4 w-4 self-center"
/>
<Text component="span" className="self-center text-sm">
{deployment.commitUserName} updated just now
</Text>
</span>
);
}
export function checkStatusOfTheApplication(
stateHistory: ApplicationState[] | [],
) {
@@ -141,27 +93,23 @@ export function RenderWorkspacesWithApps({
</NavLink>
<List className="grid grid-flow-row border-y">
{workspaceProjects.map((app, index) => {
const isDeployingToProduction = app.deployments[0]
? ['SCHEDULED', 'PENDING', 'DEPLOYING'].includes(
app.deployments[0].deploymentStatus,
)
: false;
const [latestDeployment] = app.deployments;
return (
<Fragment key={app.slug}>
<ListItem.Root
secondaryAction={
<div className="grid grid-flow-col gap-px">
{app.deployments[0] && (
{latestDeployment && (
<div className="mr-2 flex self-center align-middle">
<StatusCircle
status={
app.deployments[0]
.deploymentStatus as DeploymentStatus
latestDeployment.deploymentStatus as DeploymentStatus
}
/>
</div>
)}
<StateBadge
status={checkStatusOfTheApplication(
app.appStates,
@@ -192,27 +140,10 @@ export function RenderWorkspacesWithApps({
<ListItem.Text
primary={app.name}
secondary={
<>
{isDeployingToProduction && (
<CurrentDeployment
deployment={app.deployments[0]}
/>
)}
{!isDeployingToProduction &&
app.deployments[0] && (
<LastSuccessfulDeployment
deployment={app.deployments[0]}
/>
)}
{!isDeployingToProduction &&
!app.deployments[0] && (
<ApplicationCreatedAt
createdAt={app.createdAt}
/>
)}
</>
<DeploymentStatusMessage
appCreatedAt={app.createdAt}
deployment={latestDeployment}
/>
}
/>
</ListItem.Button>

View File

@@ -0,0 +1,94 @@
import type { Deployment } from '@/types/application';
import { render, screen } from '@/utils/testUtils';
import { test, vi } from 'vitest';
import DeploymentStatusMessage from './DeploymentStatusMessage';
const defaultDeployment: Deployment = {
id: 'de305d54-75b4-431b-adb2-eb6b9e546013',
commitUserName: 'john.doe',
commitUserAvatarUrl: 'https://example.com/avatar.png',
deploymentStartedAt: '2023-02-24T12:00:00.000Z',
deploymentEndedAt: null,
deploymentStatus: 'SCHEDULED',
commitSHA: '1234567890',
commitMessage: 'Update README.md',
};
beforeAll(() => {
vi.useFakeTimers();
});
afterAll(() => {
vi.useRealTimers();
});
test('should render the avatar of the user who deployed the application', () => {
render(
<DeploymentStatusMessage
deployment={defaultDeployment}
appCreatedAt="2023-02-24"
/>,
);
expect(
screen.getByRole('img', {
name: `Avatar of ${defaultDeployment.commitUserName}`,
}),
).toHaveAttribute(
'style',
`background-image: url(${defaultDeployment.commitUserAvatarUrl});`,
);
});
test('should render "updated just now" when the deployment is in progress and has not ended', () => {
render(
<DeploymentStatusMessage
deployment={defaultDeployment}
appCreatedAt="2023-02-24"
/>,
);
expect(screen.getByText(/updated just now/i)).toBeInTheDocument();
});
test('should render "updated just now" when the deployment\'s status is DEPLOYED, but it doesn\'t have an end date for some reason', () => {
render(
<DeploymentStatusMessage
deployment={{
...defaultDeployment,
deploymentStatus: 'DEPLOYED',
deploymentEndedAt: null,
}}
appCreatedAt="2023-02-24"
/>,
);
expect(screen.getByText(/updated just now/i)).toBeInTheDocument();
});
test('should render "deployed 1 day ago" when the deployment has ended', () => {
vi.setSystemTime(new Date('2023-02-25T12:25:00.000Z'));
render(
<DeploymentStatusMessage
deployment={{
...defaultDeployment,
deploymentStatus: 'DEPLOYED',
deploymentEndedAt: '2023-02-24T12:15:00.000Z',
}}
appCreatedAt="2023-02-24"
/>,
);
expect(screen.getByText(/deployed 1 day ago/i)).toBeInTheDocument();
});
test('should render "created 1 day ago" if the application does not have a deployment', () => {
vi.setSystemTime(new Date('2023-02-25T12:25:00.000Z'));
render(
<DeploymentStatusMessage deployment={null} appCreatedAt="2023-02-24" />,
);
expect(screen.getByText(/created 1 day ago/i)).toBeInTheDocument();
});

View File

@@ -0,0 +1,73 @@
import type { Deployment } from '@/types/application';
import { Avatar } from '@/ui/Avatar';
import Text from '@/ui/v2/Text';
import formatDistance from 'date-fns/formatDistance';
export interface DeploymentStatusMessageProps {
/**
* The deployment to render the status message for.
*/
deployment: Partial<Deployment>;
/**
* The date the application was created.
*/
appCreatedAt: string;
}
export default function DeploymentStatusMessage({
deployment,
appCreatedAt,
}: DeploymentStatusMessageProps) {
const isDeployingToProduction = [
'SCHEDULED',
'PENDING',
'DEPLOYING',
].includes(deployment?.deploymentStatus);
if (
isDeployingToProduction ||
(deployment && !deployment.deploymentEndedAt)
) {
return (
<span className="flex flex-row">
<Avatar
component="span"
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="mr-1 h-4 w-4 self-center"
/>
<Text component="span" className="self-center text-sm">
{deployment.commitUserName} updated just now
</Text>
</span>
);
}
if (!isDeployingToProduction && deployment?.deploymentEndedAt) {
return (
<span className="flex flex-row">
<Avatar
component="span"
name={deployment.commitUserName}
avatarUrl={deployment.commitUserAvatarUrl}
className="mr-1 h-4 w-4 self-center"
/>
<Text component="span" className="self-center text-sm">
{deployment.commitUserName} deployed{' '}
{formatDistance(new Date(deployment.deploymentEndedAt), new Date(), {
addSuffix: true,
})}
</Text>
</span>
);
}
return (
<Text component="span" className="text-sm">
created{' '}
{formatDistance(new Date(appCreatedAt), new Date(), {
addSuffix: true,
})}
</Text>
);
}

View File

@@ -0,0 +1,2 @@
export * from './DeploymentStatusMessage';
export { default } from './DeploymentStatusMessage';

View File

@@ -59,7 +59,8 @@ export function Avatar({
<Box
style={Object.assign(style, { backgroundImage: `url(${avatarUrl})` })}
className={classes}
aria-label="Avatar"
aria-label={name ? `Avatar of ${name}` : 'Avatar'}
role="img"
{...rest}
/>
);

View File

@@ -9,7 +9,6 @@ import generateAppServiceUrl from '@/utils/common/generateAppServiceUrl';
import getServerError from '@/utils/settings/getServerError';
import { getToastStyleProps } from '@/utils/settings/settingsConstants';
import { yupResolver } from '@hookform/resolvers/yup';
import fetch from 'cross-fetch';
import { useEffect, useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast';

View File

@@ -1,11 +1,8 @@
import fetch from 'cross-fetch';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import type { ManagePermissionOptions } from './managePermission';
import managePermission from './managePermission';
global.fetch = fetch;
const defaultParameters: ManagePermissionOptions = {
dataSource: 'default',
schema: 'public',

View File

@@ -4,7 +4,6 @@ import type {
MutationOrQueryBaseOptions,
QueryError,
} from '@/types/dataBrowser';
import fetch from 'cross-fetch';
export interface FetchMetadataOptions
extends Omit<MutationOrQueryBaseOptions, 'schema' | 'table'> {}

View File

@@ -9,7 +9,6 @@ import type {
import extractForeignKeyRelation from '@/utils/dataBrowser/extractForeignKeyRelation';
import { getPreparedReadOnlyHasuraQuery } from '@/utils/dataBrowser/hasuraQueryHelpers';
import { POSTGRESQL_ERROR_CODES } from '@/utils/dataBrowser/postgresqlConstants';
import fetch from 'cross-fetch';
import { formatWithArray } from 'node-pg-format';
export interface FetchTableOptions extends MutationOrQueryBaseOptions {

View File

@@ -1,6 +1,9 @@
import '@testing-library/jest-dom/extend-expect';
import matchers from '@testing-library/jest-dom/matchers';
import fetch from 'node-fetch';
import { expect } from 'vitest';
// @ts-ignore
global.fetch = fetch;
expect.extend(matchers);

View File

@@ -13,7 +13,6 @@ import { NhostApolloProvider } from '@nhost/react-apollo';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { queries, Queries, RenderOptions } from '@testing-library/react';
import { render as rtlRender } from '@testing-library/react';
import fetch from 'cross-fetch';
import { RouterContext } from 'next/dist/shared/lib/router-context';
import type { NextRouter } from 'next/router';
import type { PropsWithChildren, ReactElement } from 'react';
@@ -32,8 +31,6 @@ const queryClient = new QueryClient({
},
});
global.fetch = fetch;
export const mockRouter: NextRouter = {
basePath: '',
pathname: '/',

View File

@@ -1,5 +1,25 @@
# @nhost-examples/vue-quickstart
## 0.0.8
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [7eac17a1]
- Updated dependencies [850a049c]
- @nhost/vue@1.13.13
- @nhost/apollo@5.0.7
## 0.0.7
### Patch Changes
- 8bb097c9: chore(deps): bump `vitest`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- @nhost/apollo@5.0.6
- @nhost/vue@1.13.12
## 0.0.6
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/vue-quickstart",
"version": "0.0.6",
"version": "0.0.8",
"private": true,
"scripts": {
"build": "vite build",
@@ -37,7 +37,6 @@
"unplugin-vue-components": "^0.19.9",
"vite": "^4.0.2",
"vite-plugin-pages": "^0.28.0",
"vitest": "^0.12.4",
"vue-tsc": "^0.38.9"
}
}

View File

@@ -1,5 +1,30 @@
# @nhost/apollo
## 5.0.8
### Patch Changes
- Updated dependencies [1d155559]
- @nhost/nhost-js@2.0.8
## 5.0.7
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/nhost-js@2.0.7
## 5.0.6
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/nhost-js@2.0.6
## 5.0.5
### Patch Changes

View File

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

View File

@@ -1,5 +1,32 @@
# @nhost/react-apollo
## 5.0.9
### Patch Changes
- @nhost/apollo@5.0.8
- @nhost/react@2.0.8
## 5.0.8
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/apollo@5.0.7
- @nhost/react@2.0.7
## 5.0.7
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- @nhost/apollo@5.0.6
- @nhost/react@2.0.6
## 5.0.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,29 @@
# @nhost/react-urql
## 2.0.8
### Patch Changes
- @nhost/react@2.0.8
## 2.0.7
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/react@2.0.7
## 2.0.6
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- @nhost/react@2.0.6
## 2.0.5
### Patch Changes

View File

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

View File

@@ -61,7 +61,7 @@
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"@vitejs/plugin-react": "^3.0.0",
"@vitest/coverage-c8": "^0.27.0",
"@vitest/coverage-c8": "^0.29.0",
"eslint": "^8.26.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-cypress": "^2.12.1",
@@ -76,13 +76,13 @@
"husky": "^8.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"turbo": "1.6.3",
"turbo": "1.8.3",
"typedoc": "^0.22.18",
"typescript": "4.9.4",
"typescript": "4.9.5",
"vite": "^4.0.2",
"vite-plugin-dts": "^1.7.1",
"vite-plugin-dts": "^2.0.0",
"vite-tsconfig-paths": "^4.0.3",
"vitest": "^0.27.0"
"vitest": "^0.29.0"
},
"resolutions": {
"graphql": "16.6.0"

View File

@@ -1,5 +1,17 @@
# @nhost/docgen
## 0.1.8
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
## 0.1.7
### Patch Changes
- 8bb097c9: chore(deps): bump `vitest`
## 0.1.6
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost/graphql-js
## 0.0.5
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
## 0.0.4
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
## 0.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/graphql-js",
"version": "0.0.3",
"version": "0.0.5",
"description": "Nhost GraphQL client",
"license": "MIT",
"keywords": [
@@ -53,7 +53,7 @@
},
"dependencies": {
"@graphql-typed-document-node/core": "^3.1.1",
"cross-fetch": "^3.1.5"
"isomorphic-unfetch": "^3.1.0"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"

View File

@@ -1,5 +1,5 @@
import { TypedDocumentNode } from '@graphql-typed-document-node/core'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { parseRequestArgs } from './parse-args'
import { resolveRequestDocument } from './resolve-request-document'
import {

View File

@@ -1,5 +1,19 @@
# @nhost/hasura-auth-js
## 2.0.2
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
## 2.0.1
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
## 2.0.0
### Major Changes

View File

@@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { afterEach, describe, expect, it } from 'vitest'
import { auth, getHtmlLink, mailhog } from './helpers'

View File

@@ -1,5 +1,5 @@
import { load } from 'cheerio'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import createMailhogClient from 'mailhog'
import { expect } from 'vitest'
import { HasuraAuthClient, SignUpParams } from '../src'

View File

@@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { afterEach, describe, expect, it } from 'vitest'
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'

View File

@@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { afterEach, describe, expect, it } from 'vitest'
import { USER_ALREADY_SIGNED_IN } from '../src'
import { auth, getHtmlLink, signUpAndInUser, signUpAndVerifyUser } from './helpers'

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "2.0.0",
"version": "2.0.2",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [
@@ -63,7 +63,7 @@
},
"dependencies": {
"@simplewebauthn/browser": "^6.0.0",
"cross-fetch": "^3.1.5",
"isomorphic-unfetch": "^3.1.0",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"xstate": "^4.33.5"

View File

@@ -1,4 +1,4 @@
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { NETWORK_ERROR_CODE } from '../errors'
import { NullableErrorResponse } from '../types'

View File

@@ -1,5 +1,20 @@
# @nhost/hasura-storage-js
## 2.0.3
### Patch Changes
- 889ee658: added tests
- 850a049c: chore(deps): update docker/build-push-action action to v4
## 2.0.2
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
## 2.0.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-storage-js",
"version": "2.0.1",
"version": "2.0.3",
"description": "Hasura-storage client",
"license": "MIT",
"keywords": [
@@ -60,11 +60,11 @@
},
"dependencies": {
"form-data": "^4.0.0",
"isomorphic-unfetch": "^3.1.0",
"xstate": "^4.33.5"
},
"devDependencies": {
"@nhost/docgen": "workspace:*",
"cross-fetch": "^3.1.5",
"jpeg-js": "^0.4.4",
"pixelmatch": "^5.3.0",
"start-server-and-test": "^1.15.2",

View File

@@ -1,5 +1,4 @@
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import {
ApiDeleteParams,
ApiDeleteResponse,

View File

@@ -131,7 +131,7 @@ export const createMultipleFilesUploadMachine = () => {
const additions = files
? Array.isArray(files)
? files // File[]
: 'length' in files // FileList
: 'item' in files // FileList
? Array.from(files)
: [files] // File
: [] // No file

View File

@@ -7,7 +7,7 @@ export const appendImageTransformationParameters = (
params: StorageImageTransformationParams
): string => {
const queryParameters = Object.entries(params)
.map(([key, value]) => `${Array.from(key)[0]}=${value}`)
.map(([key, value]) => `${key.charAt(0)}=${value}`)
.join('&')
return queryParameters ? `${url}?${queryParameters}` : url
}

View File

@@ -1,6 +1,5 @@
import fetch from 'cross-fetch'
import FormData from 'form-data'
import fetch from 'isomorphic-unfetch'
import { ErrorPayload, StorageUploadResponse } from './types'
/** Convert any string into ISO-8859-1 */

View File

@@ -1,10 +1,9 @@
import fs from 'fs'
import { describe, expect, it } from 'vitest'
import fetch from 'cross-fetch'
import { v4 as uuidv4 } from 'uuid'
import { storage } from './utils/helpers'
import FormData from 'form-data'
import fs from 'fs'
import fetch from 'isomorphic-unfetch'
import { v4 as uuidv4 } from 'uuid'
import { describe, expect, it } from 'vitest'
import { storage } from './utils/helpers'
describe('test get file', () => {
it('should be able to get uploaded file', async () => {

View File

@@ -1,6 +1,6 @@
import fetch from 'cross-fetch'
import FormData from 'form-data'
import fs from 'fs'
import fetch from 'isomorphic-unfetch'
import jpeg from 'jpeg-js'
import pixelmatch from 'pixelmatch'
import { beforeAll, describe, expect, it } from 'vitest'

View File

@@ -1,9 +1,8 @@
import fetch from 'cross-fetch'
import FormData from 'form-data'
import fs from 'fs'
import fetch from 'isomorphic-unfetch'
import { v4 as uuidv4 } from 'uuid'
import { describe, expect, it } from 'vitest'
import { storage } from './utils/helpers'
describe('test upload', () => {

View File

@@ -0,0 +1,23 @@
import { describe, expect, it } from 'vitest'
import { appendImageTransformationParameters, StorageImageTransformationParams } from '../src/utils'
describe('appendImageTransformationParameters', () => {
it('appends image transformation parameters to the url', () => {
const url = 'https://example.com/image.jpg'
const params: StorageImageTransformationParams = {
width: 200,
height: 300,
quality: 80,
blur: 10
}
const result = appendImageTransformationParameters(url, params)
expect(result).toBe('https://example.com/image.jpg?w=200&h=300&q=80&b=10')
})
it('returns the original url when no parameters are provided', () => {
const url = 'https://example.com/image.jpg'
const params: StorageImageTransformationParams = {}
const result = appendImageTransformationParameters(url, params)
expect(result).toBe('https://example.com/image.jpg')
})
})

View File

@@ -1,5 +1,30 @@
# @nhost/nextjs
## 1.13.14
### Patch Changes
- @nhost/react@2.0.8
## 1.13.13
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/react@2.0.7
## 1.13.12
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- @nhost/react@2.0.6
## 1.13.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "1.13.11",
"version": "1.13.14",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [
@@ -64,7 +64,7 @@
},
"dependencies": {
"@nhost/react": "workspace:*",
"cross-fetch": "^3.1.5",
"isomorphic-unfetch": "^3.1.0",
"js-cookie": "^3.0.1",
"xstate": "^4.33.5"
},

View File

@@ -1,5 +1,5 @@
import { NhostClient, NhostSession } from '@nhost/react'
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import Cookies from 'js-cookie'
export const refresh = async (nhostUrl: string, refreshToken: string): Promise<NhostSession> => {

View File

@@ -1,5 +1,36 @@
# @nhost/nhost-js
## 2.0.8
### Patch Changes
- 1d155559: fix(nhost-js): allow `null` as body and return JSON when `content-type` is `application/json`
## 2.0.7
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [889ee658]
- Updated dependencies [850a049c]
- @nhost/hasura-storage-js@2.0.3
- @nhost/graphql-js@0.0.5
- @nhost/hasura-auth-js@2.0.2
## 2.0.6
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- 35d52aab: chore(deps): replace `cross-fetch` with `isomorphic-unfetch`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/graphql-js@0.0.4
- @nhost/hasura-auth-js@2.0.1
- @nhost/hasura-storage-js@2.0.2
## 2.0.5
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "2.0.5",
"version": "2.0.8",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [
@@ -61,7 +61,7 @@
"@nhost/graphql-js": "workspace:*",
"@nhost/hasura-auth-js": "workspace:*",
"@nhost/hasura-storage-js": "workspace:*",
"cross-fetch": "^3.1.5"
"isomorphic-unfetch": "^3.1.0"
},
"devDependencies": {
"graphql": "16.6.0"

View File

@@ -1,4 +1,4 @@
import fetch from 'cross-fetch'
import fetch from 'isomorphic-unfetch'
import { buildUrl, urlFromSubdomain } from '../../utils/helpers'
import { NhostClientConstructorParams } from '../../utils/types'
import {
@@ -40,7 +40,7 @@ export class NhostFunctionsClient {
async call<T = unknown, D = any>(
url: string,
data: D,
data: D | null,
config?: NhostFunctionCallConfig
): Promise<NhostFunctionCallResponse<T>>
@@ -56,7 +56,7 @@ export class NhostFunctionsClient {
*/
async call<T = unknown, D = any>(
url: string,
body: D,
body: D | null,
config?: NhostFunctionCallConfig
): Promise<NhostFunctionCallResponse<T>> {
const headers: HeadersInit = {
@@ -69,7 +69,7 @@ export class NhostFunctionsClient {
try {
const result = await fetch(fullUrl, {
body: JSON.stringify(body),
body: body ? JSON.stringify(body) : null,
headers,
method: 'POST'
})
@@ -80,7 +80,7 @@ export class NhostFunctionsClient {
let data: T
if (result.headers.get('content-type') === 'application/json') {
if (result.headers.get('content-type')?.includes('application/json')) {
data = await result.json()
} else {
data = (await result.text()) as unknown as T

View File

@@ -1,5 +1,31 @@
# @nhost/react
## 2.0.8
### Patch Changes
- Updated dependencies [1d155559]
- @nhost/nhost-js@2.0.8
## 2.0.7
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/nhost-js@2.0.7
## 2.0.6
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/nhost-js@2.0.6
## 2.0.5
### Patch Changes

View File

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

View File

@@ -1,5 +1,17 @@
# @nhost/sync-versions
## 0.0.6
### Patch Changes
- 850a049c: chore(deps): update docker/build-push-action action to v4
## 0.0.5
### Patch Changes
- 549c7cb7: chore(deps): bump `glob` to v9
## 0.0.4
### Patch Changes

View File

@@ -2,7 +2,7 @@
"name": "@nhost/sync-versions",
"description": "Sync the versions of Nhost services in each of the packages of a pnpm workspace",
"private": true,
"version": "0.0.4",
"version": "0.0.6",
"license": "MIT",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
@@ -27,14 +27,14 @@
"devDependencies": {
"@swc-node/register": "^1.5.4",
"@swc/core": "^1.3.11",
"@types/glob": "^8.0.0",
"@types/glob": "^8.1.0",
"@types/node": "^16.11.7",
"@types/object-path": "^0.11.1",
"typescript": "^4.8.4"
},
"dependencies": {
"@pnpm/find-workspace-dir": "^5.0.0",
"glob": "^8.0.3",
"glob": "^9.0.0",
"object-path": "^0.11.8",
"yaml": "^2.1.1"
}

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { findWorkspaceDir } from '@pnpm/find-workspace-dir'
import fs from 'fs'
import glob from 'glob'
import { globSync } from 'glob'
import { set } from 'object-path'
import path from 'path'
import yaml from 'yaml'
@@ -19,7 +19,7 @@ const main = async () => {
fs.readFileSync(path.join(root!, 'nhost-cloud.yaml'), 'utf-8')
)
const nhostConfigs = glob.sync('**/nhost/config.yaml', {
const nhostConfigs = globSync('**/nhost/config.yaml', {
cwd: root,
absolute: true,
realpath: true

View File

@@ -1,5 +1,32 @@
# @nhost/vue
## 1.13.14
### Patch Changes
- Updated dependencies [1d155559]
- @nhost/nhost-js@2.0.8
## 1.13.13
### Patch Changes
- 7eac17a1: chore(deps): bump `@xstate/inspect` to 0.8.0
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/nhost-js@2.0.7
## 1.13.12
### Patch Changes
- 4bf40995: chore(deps): bump `typescript` to `4.9.5`
- 8bb097c9: chore(deps): bump `vitest`
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/nhost-js@2.0.6
## 1.13.11
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "1.13.11",
"version": "1.13.14",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [
@@ -72,7 +72,7 @@
"devDependencies": {
"@nhost/docgen": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"@xstate/inspect": "^0.7.0",
"@xstate/inspect": "^0.8.0",
"vue": "^3.2.41",
"vue-router": "^4.1.6",
"ws": "^8.10.0",

1689
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff