From 3008c5110a0ebc524eb3609bd8ba901f664f83d3 Mon Sep 17 00:00:00 2001 From: Mitchell Hamilton Date: Fri, 20 Aug 2021 14:06:43 +1000 Subject: [PATCH] Move the exports of `@keystone-next/keystone` to `@keystone-next/keystone/system` (#6377) --- .changeset/afraid-masks-dress.md | 5 +++++ packages/keystone/package.json | 5 +++-- packages/keystone/src/admin-ui/templates/api.ts | 2 +- .../fields/types/relationship/tests/implementation.test.ts | 2 +- packages/keystone/src/next.ts | 2 +- packages/keystone/src/{index.ts => system.ts} | 0 packages/keystone/src/testing.ts | 2 +- packages/keystone/system/package.json | 4 ++++ 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changeset/afraid-masks-dress.md rename packages/keystone/src/{index.ts => system.ts} (100%) create mode 100644 packages/keystone/system/package.json diff --git a/.changeset/afraid-masks-dress.md b/.changeset/afraid-masks-dress.md new file mode 100644 index 00000000000..44c2143b567 --- /dev/null +++ b/.changeset/afraid-masks-dress.md @@ -0,0 +1,5 @@ +--- +'@keystone-next/keystone': major +--- + +Moved exports of `@keystone-next/keystone` to `@keystone-next/keystone/system` diff --git a/packages/keystone/package.json b/packages/keystone/package.json index 6969e088f1b..f4cda51aca8 100644 --- a/packages/keystone/package.json +++ b/packages/keystone/package.json @@ -19,7 +19,8 @@ "admin-ui", "testing", "fields", - "types" + "types", + "system" ], "bin": { "keystone-next": "bin/cli.js" @@ -136,7 +137,7 @@ }, "preconstruct": { "entrypoints": [ - "index.ts", + "system.ts", "next.ts", "___internal-do-not-use-will-break-in-patch/{node-api,next-graphql}.ts", "___internal-do-not-use-will-break-in-patch/admin-ui/pages/*/index.tsx", diff --git a/packages/keystone/src/admin-ui/templates/api.ts b/packages/keystone/src/admin-ui/templates/api.ts index c779651e582..47e014bc370 100644 --- a/packages/keystone/src/admin-ui/templates/api.ts +++ b/packages/keystone/src/admin-ui/templates/api.ts @@ -1,6 +1,6 @@ export const apiTemplate = ` import keystoneConfig from '../../../../keystone'; -import { initConfig, createSystem, createApolloServerMicro } from '@keystone-next/keystone'; +import { initConfig, createSystem, createApolloServerMicro } from '@keystone-next/keystone/system'; import { PrismaClient } from '.prisma/client'; const initializedKeystoneConfig = initConfig(keystoneConfig); diff --git a/packages/keystone/src/fields/types/relationship/tests/implementation.test.ts b/packages/keystone/src/fields/types/relationship/tests/implementation.test.ts index d7dffaacdfb..1725a0a90b5 100644 --- a/packages/keystone/src/fields/types/relationship/tests/implementation.test.ts +++ b/packages/keystone/src/fields/types/relationship/tests/implementation.test.ts @@ -1,5 +1,5 @@ import { assertInputObjectType, printType, assertObjectType, parse } from 'graphql'; -import { createSystem, initConfig } from '../../../../.'; +import { createSystem, initConfig } from '../../../../system'; import { config, list } from '../../../../schema'; import { relationship } from '..'; import { text } from '../../text'; diff --git a/packages/keystone/src/next.ts b/packages/keystone/src/next.ts index 13ae7c288e9..701814afbb3 100644 --- a/packages/keystone/src/next.ts +++ b/packages/keystone/src/next.ts @@ -47,7 +47,7 @@ export const withKeystone = '@keystone-next/keystone/___internal-do-not-use-will-break-in-patch/api', '@keystone-next/keystone/___internal-do-not-use-will-break-in-patch/next-graphql', '@keystone-next/keystone/next', - '@keystone-next/keystone', + '@keystone-next/keystone/system', '.prisma/client', ]; } diff --git a/packages/keystone/src/index.ts b/packages/keystone/src/system.ts similarity index 100% rename from packages/keystone/src/index.ts rename to packages/keystone/src/system.ts diff --git a/packages/keystone/src/testing.ts b/packages/keystone/src/testing.ts index 691df2eb622..506680a98b8 100644 --- a/packages/keystone/src/testing.ts +++ b/packages/keystone/src/testing.ts @@ -12,7 +12,7 @@ import { generateNodeModulesArtifacts, } from './artifacts'; import { pushPrismaSchemaToDatabase } from './migrations'; -import { initConfig, createSystem, createExpressServer } from '.'; +import { initConfig, createSystem, createExpressServer } from './system'; export type GraphQLRequest = (arg: { query: string; diff --git a/packages/keystone/system/package.json b/packages/keystone/system/package.json new file mode 100644 index 00000000000..6cbbe144d0c --- /dev/null +++ b/packages/keystone/system/package.json @@ -0,0 +1,4 @@ +{ + "main": "dist/keystone.cjs.js", + "module": "dist/keystone.esm.js" +}