Skip to content

Commit

Permalink
Move admin-ui-utils into main package (#6367)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Aug 19, 2021
1 parent d97cfa0 commit 4f36a81
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 43 deletions.
8 changes: 8 additions & 0 deletions .changeset/empty-rockets-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@keystone-next/admin-ui-utils': major
'@keystone-next/auth': major
'@keystone-next/keystone': minor
'@keystone-next/fields-document': patch
---

Moved `@keystone-next/admin-ui-utils` to `@keystone-next/keystone/admin-ui/utils`
15 changes: 0 additions & 15 deletions packages/admin-ui-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@
"main": "dist/admin-ui-utils.cjs.js",
"module": "dist/admin-ui-utils.esm.js",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.15.3",
"@emotion/weak-memoize": "^0.2.5",
"@keystone-next/types": "^24.0.0",
"@keystone-ui/core": "^3.1.1",
"@types/react": "^17.0.18",
"fast-deep-equal": "^3.1.3",
"graphql": "^15.5.1"
},
"peerDependencies": {
"react": "^17.0.2"
},
"devDependencies": {
"react": "^17.0.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
},
Expand Down
11 changes: 5 additions & 6 deletions packages/admin-ui-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './dataGetter';
export * from './Fields';
export * from './getRootGraphQLFieldsFromFieldController';
export * from './item-form';
export * from './serialization';
export * from './useInvalidFields';
throw new Error(
'`@keystone-next/admin-ui-utils` has been moved to `@keystone-next/keystone/admin-ui/utils`, please import from there instead.'
);

export {};
1 change: 0 additions & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"dependencies": {
"@babel/runtime": "^7.15.3",
"@graphql-tools/schema": "^8.1.1",
"@keystone-next/admin-ui-utils": "^5.0.6",
"@keystone-next/types": "^24.0.0",
"@keystone-ui/button": "^5.0.0",
"@keystone-ui/core": "^3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/pages/InitPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Fields,
serializeValueToObjByFieldKey,
useInvalidFields,
} from '@keystone-next/admin-ui-utils';
} from '@keystone-next/keystone/admin-ui/utils';
import { guessEmailFromValue, validEmail } from '../lib/emailHeuristics';
import { IconTwitter, IconGithub } from '../components/Icons';
import { SigninContainer } from '../components/SigninContainer';
Expand Down
1 change: 0 additions & 1 deletion packages/fields-document/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@babel/runtime": "^7.15.3",
"@braintree/sanitize-url": "^5.0.2",
"@emotion/weak-memoize": "^0.2.5",
"@keystone-next/admin-ui-utils": "^5.0.6",
"@keystone-next/keystone": "^24.0.0",
"@keystone-next/types": "^24.0.0",
"@keystone-ui/button": "^5.0.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/keystone/admin-ui/utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "dist/keystone.cjs.js",
"module": "dist/keystone.esm.js"
}
3 changes: 2 additions & 1 deletion packages/keystone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@babel/plugin-transform-modules-commonjs": "^7.15.0",
"@babel/runtime": "^7.15.3",
"@emotion/hash": "^0.8.0",
"@emotion/weak-memoize": "^0.2.5",
"@graphql-tools/schema": "^8.1.1",
"@hapi/iron": "^6.0.0",
"@keystone-next/admin-ui-utils": "^5.0.6",
"@keystone-next/types": "^24.0.0",
"@keystone-next/utils": "^1.0.4",
"@keystone-ui/button": "^5.0.0",
Expand Down Expand Up @@ -151,6 +151,7 @@
"admin-ui/context.tsx",
"admin-ui/router.tsx",
"admin-ui/image.tsx",
"admin-ui/utils/index.ts",
"fields/index.ts",
"fields/types/*/views/index.tsx",
"fields/types/relationship/views/RelationshipSelect.tsx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { ButtonHTMLAttributes, useMemo, useState } from 'react';

import { Center, Inline, Heading, VisuallyHidden, jsx, useTheme } from '@keystone-ui/core';
import { makeDataGetter } from '@keystone-next/admin-ui-utils';
import { PlusIcon } from '@keystone-ui/icons/icons/PlusIcon';
import { DrawerController } from '@keystone-ui/modals';
import { LoadingDots } from '@keystone-ui/loading';

import { makeDataGetter } from '../../../../admin-ui/utils';
import { CreateItemDrawer } from '../../../../admin-ui/components/CreateItemDrawer';
import { PageContainer, HEADER_HEIGHT } from '../../../../admin-ui/components/PageContainer';
import { gql, useQuery } from '../../../../admin-ui/apollo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
useInvalidFields,
Fields,
useChangedFieldsAndDataForUpdate,
} from '@keystone-next/admin-ui-utils';
} from '../../../../admin-ui/utils';

import { gql, useMutation, useQuery } from '../../../../admin-ui/apollo';
import { useList } from '../../../../admin-ui/context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
DataGetter,
DeepNullable,
makeDataGetter,
} from '@keystone-next/admin-ui-utils';
} from '../../../../admin-ui/utils';
import { gql, TypedDocumentNode, useMutation, useQuery } from '../../../../admin-ui/apollo';
import { CellLink } from '../../../../admin-ui/components';
import { CreateItemDrawer } from '../../../../admin-ui/components/CreateItemDrawer';
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/keystone/src/admin-ui/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './dataGetter';
export * from './Fields';
export * from './getRootGraphQLFieldsFromFieldController';
export * from './item-form';
export * from './serialization';
export * from './useInvalidFields';
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/keystone/src/admin-ui/utils/useLazyMetadata.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GraphQLError } from 'graphql';
import type { AuthenticatedItem, VisibleLists, CreateViewFieldModes } from '@keystone-next/types';
import { useMemo } from 'react';
import { DeepNullable, makeDataGetter } from '@keystone-next/admin-ui-utils';
import { DocumentNode, useQuery, QueryResult, ServerError, ServerParseError } from '../apollo';
import { DeepNullable, makeDataGetter } from './dataGetter';

export type { AuthenticatedItem, VisibleLists, CreateViewFieldModes } from '@keystone-next/types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { useState } from 'react';
import { jsx, Stack } from '@keystone-ui/core';
import isDeepEqual from 'fast-deep-equal';
import { useToasts } from '@keystone-ui/toast';
import { Button } from '@keystone-ui/button';
import { ListMeta } from '@keystone-next/types';
import {
ItemData,
makeDataGetter,
DataGetter,
Value,
useInvalidFields,
serializeValueToObjByFieldKey,
} from '@keystone-next/admin-ui-utils';
import { Button } from '@keystone-ui/button';
import { ListMeta } from '@keystone-next/types';
import { Fields } from '@keystone-next/admin-ui-utils';
Fields,
} from '../../../../../admin-ui/utils';
import { gql, useMutation } from '../../../../../admin-ui/apollo';
import { GraphQLErrorNotice } from '../../../../../admin-ui/components';
import { useFieldsObj } from './useItemState';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/** @jsx jsx */

import { ListMeta } from '@keystone-next/types';
import { Button } from '@keystone-ui/button';
import { jsx, Stack } from '@keystone-ui/core';
import { useToasts } from '@keystone-ui/toast';
import { useCallback, useState } from 'react';
import { Tooltip } from '@keystone-ui/tooltip';
import {
deserializeValue,
ItemData,
Expand All @@ -8,13 +14,7 @@ import {
useChangedFieldsAndDataForUpdate,
makeDataGetter,
DataGetter,
} from '@keystone-next/admin-ui-utils';
import { ListMeta } from '@keystone-next/types';
import { Button } from '@keystone-ui/button';
import { jsx, Stack } from '@keystone-ui/core';
import { useToasts } from '@keystone-ui/toast';
import { useCallback, useState } from 'react';
import { Tooltip } from '@keystone-ui/tooltip';
} from '../../../../../admin-ui/utils';
import { gql, useMutation } from '../../../../../admin-ui/apollo';
import { GraphQLErrorNotice } from '../../../../../admin-ui/components';
import { useFieldsObj } from './useItemState';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import { FieldProps, ListMeta } from '@keystone-next/types';
import { Button } from '@keystone-ui/button';
import { Tooltip } from '@keystone-ui/tooltip';
import { LoadingDots } from '@keystone-ui/loading';
import { useEffect, useRef, useState } from 'react';
import {
getRootGraphQLFieldsFromFieldController,
makeDataGetter,
} from '@keystone-next/admin-ui-utils';
import { useEffect, useRef, useState } from 'react';
} from '../../../../../admin-ui/utils';
import { Link } from '../../../../../admin-ui/router';
import { gql, useApolloClient } from '../../../../../admin-ui/apollo';
import { controller } from '../index';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FieldMeta, ListMeta } from '@keystone-next/types';
import { useCallback, useMemo, useState } from 'react';
import { DataGetter, makeDataGetter } from '@keystone-next/admin-ui-utils';
import { DataGetter, makeDataGetter } from '../../../../../admin-ui/utils';
import { gql, useQuery } from '../../../../../admin-ui/apollo';
import { controller } from '../index';

Expand Down

0 comments on commit 4f36a81

Please sign in to comment.