Skip to content

Commit

Permalink
Update legacy package names (keystonejs#5010)
Browse files Browse the repository at this point in the history
* Update package names and mark some as private.

* Update @keystonejs-next namespace to @keystone-next.

* More package updates.

* Further fleshing out namespace updates.

* Update package.json

* Update package.json

* Update package.json

* Further fleshing out namespace updates.

* Reverting some changelogs.

* Update package.json

* Formatting.

* Tweaking module paths.

* Update .changeset/config.json

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

* Adding some required TS ignores so checks pass for redundant errors.

* Update docs-next/pages/apis/access-control.mdx

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

* Update docs-next/pages/apis/access-control.mdx

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>

Co-authored-by: Tim Leslie <timl@thinkmill.com.au>
  • Loading branch information
bladey and timleslie authored Mar 4, 2021
1 parent 1c7a123 commit 4484f3e
Show file tree
Hide file tree
Showing 471 changed files with 1,365 additions and 1,194 deletions.
2 changes: 1 addition & 1 deletion .changeset/brown-bikes-destroy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/test-utils': patch
'@keystone-next/test-utils-legacy': patch
---

Updated `multiAdapterRunners().before()` to return a `context` object when using `setupFromConfig()`.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"commit": false,
"linked": [],
"access": "public"
}
}
2 changes: 1 addition & 1 deletion .changeset/dry-laws-trade.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@keystonejs/adapter-prisma": patch
"@keystone-next/adapter-prisma-legacy": patch
---

Fixed errors when using a schema path containing a space character.
2 changes: 1 addition & 1 deletion .changeset/dull-keys-tan.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/test-utils': major
'@keystone-next/test-utils-legacy': major
---

Updated `setupFromConfig` to support running tests with `networkedGraphqlRequest`.
2 changes: 1 addition & 1 deletion .changeset/gentle-bobcats-accept.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/access-control': patch
'@keystone-next/access-control-legacy': patch
---

Updated types to be parameterised by imperative argument type.
2 changes: 1 addition & 1 deletion .changeset/healthy-spiders-march.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/benchmarks': minor
'@keystone-next/benchmarks-legacy': minor
---

Updated benchmark scripts to use the new keystone interfaces.
4 changes: 2 additions & 2 deletions .changeset/large-dots-attack.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@keystonejs/access-control': major
'@keystonejs/keystone': patch
'@keystone-next/access-control-legacy': major
'@keystone-next/keystone-legacy': patch
---

The functions `validate*AccessControl` no longer set default values for the `authentication` value. If you are calling these functions directly you will need to make sure you pass in a value for `authentication`. If you are not directly calling these functions then there are no changes required.
4 changes: 2 additions & 2 deletions .changeset/late-nails-tease.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@keystonejs/access-control': major
'@keystonejs/keystone': patch
'@keystone-next/access-control-legacy': major
'@keystone-next/keystone-legacy': patch
---

Updated `validateAuthAccessControl` to now require an explicit `operation` argument.
2 changes: 1 addition & 1 deletion .changeset/lazy-jeans-sell.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/fields': patch
'@keystone-next/fields-legacy': patch
---

Pinned dependency `react-day-picker` to `8.0.0-beta.3`.
4 changes: 2 additions & 2 deletions .changeset/plenty-goats-end.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@keystonejs/access-control': major
'@keystonejs/keystone': patch
'@keystone-next/access-control-legacy': major
'@keystone-next/keystone-legacy': patch
---

Updated the `validate*AccessControl` functions to take `{ access, args: ... }`. Unless you are directly calling these functions no code changes are required.
6 changes: 3 additions & 3 deletions .changeset/shiny-ways-grin.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
'@keystonejs/adapter-knex': minor
'@keystonejs/adapter-mongoose': minor
'@keystonejs/adapter-prisma': minor
'@keystone-next/adapter-knex-legacy': minor
'@keystone-next/adapter-mongoose-legacy': minor
'@keystone-next/adapter-prisma-legacy': minor
---

Added support for configuring the field to use for `search` filtering via the `searchField` list adapter config option.
2 changes: 1 addition & 1 deletion .changeset/sixty-terms-exercise.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/adapter-prisma': patch
'@keystone-next/adapter-prisma': patch
---

Fixed a schema generation issue when two one-sided many-to-many relationships shared the same name.
2 changes: 1 addition & 1 deletion .changeset/thick-roses-argue.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/adapter-knex': patch
'@keystone-next/adapter-knex-legacy': patch
---

Fixed a query generation issue when two relationship fields shared the same name.
2 changes: 1 addition & 1 deletion .changeset/wet-nails-move.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@keystonejs/adapter-prisma': patch
'@keystone-next/adapter-prisma-legacy': patch
---

Fixed crash if the prisma client directory exists but the prisma schema doesn't.
8 changes: 4 additions & 4 deletions .changeset/yellow-hornets-lay.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
'@keystone-next/website': minor
'@keystone-next/keystone': minor
'@keystone-next/types': minor
'@keystonejs/api-tests': minor
'@keystone-next/website-legacy': minor
'@keystone-next/keystone-legacy': minor
'@keystone-next/types-legacy': minor
'@keystone-next/api-tests-legacy': minor
---

Added support for configuring the field to use for `search` filtering via the `db: { searchField }` list config option.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ An example, if you generate a changeset that includes `adapter-mongoose` as a pa

```md
---
'@keystonejs/adapter-mongoose': patch
'@keystonejs/keystone': minor
'@keystone-next/adapter-mongoose-legacy': patch
'@keystone-next/keystone-legacy': minor
---

A very useful description of the changes should be here.
Expand Down
48 changes: 36 additions & 12 deletions docs-next/pages/apis/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,36 @@ The `keystone-next` CLI expects to find a module named `keystone.ts` with a defa
```typescript filename=keystone.ts
import { config } from '@keystone-next/keystone/schema';

export default config({ /* ... */ });
export default config({
/* ... */
});
```

The `config` function accepts an object representing all the configurable parts of the system:

```typescript
export default config({
lists: { /* ... */ },
db: { /* ... */ },
ui: { /* ... */ },
server: { /* ... */ },
session: () => { /* ... */ },
graphql: { /* ... */ },
extendGraphqlSchema: { /* ... */ },
lists: {
/* ... */
},
db: {
/* ... */
},
ui: {
/* ... */
},
server: {
/* ... */
},
session: () => {
/* ... */
},
graphql: {
/* ... */
},
extendGraphqlSchema: {
/* ... */
},
});
```

Expand Down Expand Up @@ -81,7 +97,9 @@ export default config({
db: {
adapter: 'prisma_postgresql',
url: 'postgres://dbuser:dbpass@localhost:5432/keystone',
onConnect: async context => { /* ... */ },
onConnect: async context => {
/* ... */
},
// Optional advanced configuration
enableLogging: true,
getPrismaPath: ({ prismaSchema }) => '.prisma',
Expand All @@ -103,7 +121,9 @@ export default config({
db: {
adapter: 'knex',
url: 'postgres://dbuser:dbpass@localhost:5432/keystone',
onConnect: async context => { /* ... */ },
onConnect: async context => {
/* ... */
},
// Optional advanced configuration
schemaName: 'public',
dropDatabase: false,
Expand Down Expand Up @@ -208,8 +228,12 @@ import { statelessSessions, withItemData } from '@keystone-next/keystone/session

export default config({
session: withItemData(
statelessSessions({ /* ... */ }),
{ /* ... */ }
statelessSessions({
/* ... */
}),
{
/* ... */
}
),
/* ... */
});
Expand Down
56 changes: 42 additions & 14 deletions docs-next/pages/apis/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,57 @@ export default config({
ListName: list({
hooks: {
// Hooks for create and update operations
resolveInput: async args => { /* ... */ },
validateInput: async args => { /* ... */ },
beforeChange: async args => { /* ... */ },
afterChange: async args => { /* ... */ },
resolveInput: async args => {
/* ... */
},
validateInput: async args => {
/* ... */
},
beforeChange: async args => {
/* ... */
},
afterChange: async args => {
/* ... */
},

// Hooks for delete operations
validateDelete: async args => { /* ... */ },
beforeDelete: async args => { /* ... */ },
afterDelete: async args => { /* ... */ },
validateDelete: async args => {
/* ... */
},
beforeDelete: async args => {
/* ... */
},
afterDelete: async args => {
/* ... */
},
},
fields: {
fieldName: text({
hooks: {
// Hooks for create and update operations
resolveInput: async args => { /* ... */ },
validateInput: async args => { /* ... */ },
beforeChange: async args => { /* ... */ },
afterChange: async args => { /* ... */ },
resolveInput: async args => {
/* ... */
},
validateInput: async args => {
/* ... */
},
beforeChange: async args => {
/* ... */
},
afterChange: async args => {
/* ... */
},

// Hooks for delete operations
validateDelete: async args => { /* ... */ },
beforeDelete: async args => { /* ... */ },
afterDelete: async args => { /* ... */ },
validateDelete: async args => {
/* ... */
},
beforeDelete: async args => {
/* ... */
},
afterDelete: async args => {
/* ... */
},
},
}),
},
Expand Down
32 changes: 24 additions & 8 deletions docs-next/pages/apis/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,27 @@ import { config, createSchema, list } from '@keystone-next/keystone/schema';
export default config({
lists: createSchema({
ListName: list({
fields: { /* ... */ },
idField: { /* ... */ },
access: { /* ... */ },
ui: { /* ... */ },
hooks: { /* ... */ },
graphql: { /* ... */ },
db: { /* ... */ },
fields: {
/* ... */
},
idField: {
/* ... */
},
access: {
/* ... */
},
ui: {
/* ... */
},
hooks: {
/* ... */
},
graphql: {
/* ... */
},
db: {
/* ... */
},
description: '...',
}),
/* ... */
Expand Down Expand Up @@ -69,7 +83,9 @@ import { autoincrement, mongoId } from '@keystone-next/fields';
export default config({
lists: createSchema({
ListName: list({
fields: { /* ... */ },
fields: {
/* ... */
},
// prisma_postgresql and knex adapters
idField: autoincrement({
ui: {
Expand Down
8 changes: 6 additions & 2 deletions docs-next/pages/apis/session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default config({
session: withItemData(
statelessSessions({
secret: 'ABCDEFGH1234567887654321HGFEDCBA',
ironOptions: { /* ... */ },
ironOptions: {
/* ... */
},
maxAge: 60 * 60 * 24,
secure: true,
path: '/',
Expand Down Expand Up @@ -149,7 +151,9 @@ import { statelessSessions, withItemData } from '@keystone-next/keystone/session

export default config({
session: withItemData(
statelessSessions({ /* ... */ }),
statelessSessions({
/* ... */
}),
{ User: 'name isAdmin' }
),
/* ... */
Expand Down
4 changes: 2 additions & 2 deletions examples-next/ecommerce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@keystone-next/cloudinary": "^3.0.0",
"@keystone-next/fields": "^5.0.0",
"@keystone-next/keystone": "^10.0.0",
"@keystone-next/server-side-graphql-client-legacy": "^2.0.0",
"@keystone-next/types": "^13.0.0",
"@keystonejs/server-side-graphql-client": "^2.0.0",
"@types/nodemailer": "^6.4.0",
"dotenv": "^8.2.0",
"next": "10.0.7",
Expand All @@ -32,7 +32,7 @@
"stripe": "^8.134.0"
},
"devDependencies": {
"@keystonejs/test-utils": "^12.0.0",
"@keystone-next/test-utils-legacy": "^12.0.0",
"typescript": "^4.1.5"
},
"engines": {
Expand Down
6 changes: 5 additions & 1 deletion examples-next/ecommerce/tests/mutations.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { KeystoneContext } from '@keystone-next/types';
import { multiAdapterRunners, setupFromConfig, AdapterName } from '@keystonejs/test-utils';
import {
multiAdapterRunners,
setupFromConfig,
AdapterName,
} from '@keystone-next/test-utils-legacy';
import config from '../keystone';

function setupKeystone(adapterName: AdapterName) {
Expand Down
Loading

0 comments on commit 4484f3e

Please sign in to comment.