create-keystone-app 5.0.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/create-keystone-app.cjs.dev.js +26 -32
  2. package/dist/create-keystone-app.cjs.prod.js +26 -32
  3. package/package.json +2 -2
  4. package/starter/.keystone/admin/.next/build-manifest.json +30 -0
  5. package/starter/.keystone/admin/.next/cache/webpack/client-development/0.pack +0 -0
  6. package/starter/.keystone/admin/.next/cache/webpack/client-development/index.pack +0 -0
  7. package/starter/.keystone/admin/.next/cache/webpack/server-development/0.pack +0 -0
  8. package/starter/.keystone/admin/.next/cache/webpack/server-development/index.pack +0 -0
  9. package/starter/.keystone/admin/.next/react-loadable-manifest.json +1 -0
  10. package/starter/.keystone/admin/.next/server/middleware-manifest.json +6 -0
  11. package/starter/.keystone/admin/.next/server/pages/_app.js +1534 -0
  12. package/starter/.keystone/admin/.next/server/pages/_document.js +156 -0
  13. package/starter/.keystone/admin/.next/server/pages/_error.js +56 -0
  14. package/starter/.keystone/admin/.next/server/pages/api/__keystone_api_build.js +123 -0
  15. package/starter/.keystone/admin/.next/server/pages-manifest.json +6 -0
  16. package/starter/.keystone/admin/.next/server/webpack-api-runtime.js +168 -0
  17. package/starter/.keystone/admin/.next/server/webpack-runtime.js +168 -0
  18. package/starter/.keystone/admin/.next/static/chunks/amp.js +366 -0
  19. package/starter/.keystone/admin/.next/static/chunks/main.js +1251 -0
  20. package/starter/.keystone/admin/.next/static/chunks/pages/_app.js +10481 -0
  21. package/starter/.keystone/admin/.next/static/chunks/pages/_error.js +28 -0
  22. package/starter/.keystone/admin/.next/static/chunks/polyfills.js +1 -0
  23. package/starter/.keystone/admin/.next/static/chunks/react-refresh.js +62 -0
  24. package/starter/.keystone/admin/.next/static/chunks/webpack.js +1202 -0
  25. package/starter/.keystone/admin/.next/static/development/_buildManifest.js +1 -0
  26. package/starter/.keystone/admin/.next/static/development/_middlewareManifest.js +1 -0
  27. package/starter/.keystone/admin/.next/static/development/_ssgManifest.js +1 -0
  28. package/starter/.keystone/admin/.next/trace +26 -0
  29. package/starter/.keystone/admin/next-env.d.ts +6 -0
  30. package/starter/.keystone/admin/next.config.js +4 -0
  31. package/starter/.keystone/admin/pages/_app.js +19 -0
  32. package/starter/.keystone/admin/pages/api/__keystone_api_build.js +3 -0
  33. package/starter/.keystone/admin/pages/index.js +1 -0
  34. package/starter/.keystone/admin/pages/init.js +5 -0
  35. package/starter/.keystone/admin/pages/no-access.js +3 -0
  36. package/starter/.keystone/admin/pages/posts/[id].js +3 -0
  37. package/starter/.keystone/admin/pages/posts/index.js +3 -0
  38. package/starter/.keystone/admin/pages/signin.js +3 -0
  39. package/starter/.keystone/admin/pages/tags/[id].js +3 -0
  40. package/starter/.keystone/admin/pages/tags/index.js +3 -0
  41. package/starter/.keystone/admin/pages/users/[id].js +3 -0
  42. package/starter/.keystone/admin/pages/users/index.js +3 -0
  43. package/starter/.keystone/admin/tsconfig.json +22 -0
  44. package/starter/CHANGELOG.md +32 -0
  45. package/starter/README.md +7 -7
  46. package/starter/auth.ts +32 -3
  47. package/starter/keystone.db +0 -0
  48. package/starter/keystone.ts +16 -9
  49. package/starter/package.json +12 -9
  50. package/starter/schema.graphql +132 -72
  51. package/starter/schema.prisma +12 -12
  52. package/starter/schema.ts +63 -17
  53. package/CHANGELOG.md +0 -151
@@ -12,28 +12,28 @@ generator client {
12
12
  }
13
13
 
14
14
  model User {
15
- id String @id @default(cuid())
16
- name String?
17
- email String? @unique
18
- password String?
19
- posts Post[] @relation("Post_author")
15
+ id String @id @default(cuid())
16
+ name String @default("")
17
+ email String @unique @default("")
18
+ password String
19
+ posts Post[] @relation("Post_author")
20
20
  }
21
21
 
22
22
  model Post {
23
23
  id String @id @default(cuid())
24
- title String?
25
- status String?
26
- content String?
24
+ title String @default("")
25
+ status String? @default("draft")
26
+ content String @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")
27
27
  publishDate DateTime?
28
28
  author User? @relation("Post_author", fields: [authorId], references: [id])
29
29
  authorId String? @map("author")
30
- tags Tag[] @relation("Post_tags_Tag_posts")
30
+ tags Tag[] @relation("Post_tags")
31
31
 
32
32
  @@index([authorId])
33
33
  }
34
34
 
35
35
  model Tag {
36
- id String @id @default(cuid())
37
- name String?
38
- posts Post[] @relation("Post_tags_Tag_posts")
36
+ id String @id @default(cuid())
37
+ name String @default("")
38
+ posts Post[] @relation("Post_tags")
39
39
  }
package/starter/schema.ts CHANGED
@@ -1,43 +1,88 @@
1
- import { createSchema, list } from '@keystone-next/keystone';
1
+ /*
2
+ Welcome to the schema! The schema is the heart of Keystone.
3
+
4
+ Here we define our 'lists', which will then be used both for the GraphQL
5
+ API definition, our database tables, and our Admin UI layout.
6
+
7
+ Some quick definitions to help out:
8
+ A list: A definition of a collection of fields with a name. For the starter
9
+ we have `User`, `Post`, and `Tag` lists.
10
+ A field: The individual bits of data on your list, each with its own type.
11
+ you can see some of the lists in what we use below.
12
+
13
+ */
14
+
15
+ // Like the `config` function we use in keystone.ts, we use functions
16
+ // for putting in our config so we get useful errors. With typescript,
17
+ // we get these even before code runs.
18
+ import { list } from '@keystone-6/core';
19
+
20
+ // We're using some common fields in the starter. Check out https://keystonejs.com/docs/apis/fields#fields-api
21
+ // for the full list of fields.
2
22
  import {
3
23
  text,
4
24
  relationship,
5
25
  password,
6
26
  timestamp,
7
27
  select,
8
- } from '@keystone-next/keystone/fields';
9
- import { document } from '@keystone-next/fields-document';
28
+ } from '@keystone-6/core/fields';
29
+ // The document field is a more complicated field, so it's in its own package
30
+ // Keystone aims to have all the base field types, but you can make your own
31
+ // custom ones.
32
+ import { document } from '@keystone-6/fields-document';
10
33
 
11
- export const lists = createSchema({
34
+ // We have a users list, a blogs list, and tags for blog posts, so they can be filtered.
35
+ // Each property on the exported object will become the name of a list (a.k.a. the `listKey`),
36
+ // with the value being the definition of the list, including the fields.
37
+ export const lists = {
38
+ // Here we define the user list.
12
39
  User: list({
13
- ui: {
14
- listView: {
15
- initialColumns: ['name', 'posts'],
16
- },
17
- },
40
+ // Here are the fields that `User` will have. We want an email and password so they can log in
41
+ // a name so we can refer to them, and a way to connect users to posts.
18
42
  fields: {
19
- name: text({ isRequired: true }),
43
+ name: text({ validation: { isRequired: true } }),
20
44
  email: text({
21
- isRequired: true,
45
+ validation: { isRequired: true },
22
46
  isIndexed: 'unique',
23
47
  isFilterable: true,
24
48
  }),
25
- password: password({ isRequired: true }),
49
+ // The password field takes care of hiding details and hashing values
50
+ password: password({ validation: { isRequired: true } }),
51
+ // Relationships allow us to reference other lists. In this case,
52
+ // we want a user to have many posts, and we are saying that the user
53
+ // should be referencable by the 'author' field of posts.
54
+ // Make sure you read the docs to understand how they work: https://keystonejs.com/docs/guides/relationships#understanding-relationships
26
55
  posts: relationship({ ref: 'Post.author', many: true }),
27
56
  },
57
+ // Here we can configure the Admin UI. We want to show a user's name and posts in the Admin UI
58
+ ui: {
59
+ listView: {
60
+ initialColumns: ['name', 'posts'],
61
+ },
62
+ },
28
63
  }),
64
+ // Our second list is the Posts list. We've got a few more fields here
65
+ // so we have all the info we need for displaying posts.
29
66
  Post: list({
30
67
  fields: {
31
68
  title: text(),
69
+ // Having the status here will make it easy for us to choose whether to display
70
+ // posts on a live site.
32
71
  status: select({
33
72
  options: [
34
73
  { label: 'Published', value: 'published' },
35
74
  { label: 'Draft', value: 'draft' },
36
75
  ],
76
+ // We want to make sure new posts start off as a draft when they are created
77
+ defaultValue: 'draft',
78
+ // fields also have the ability to configure their appearance in the Admin UI
37
79
  ui: {
38
80
  displayMode: 'segmented-control',
39
81
  },
40
82
  }),
83
+ // The document field can be used for making highly editable content. Check out our
84
+ // guide on the document field https://keystonejs.com/docs/guides/document-fields#how-to-use-document-fields
85
+ // for more information
41
86
  content: document({
42
87
  formatting: true,
43
88
  layouts: [
@@ -51,6 +96,8 @@ export const lists = createSchema({
51
96
  dividers: true,
52
97
  }),
53
98
  publishDate: timestamp(),
99
+ // Here is the link from post => author.
100
+ // We've configured its UI display quite a lot to make the experience of editing posts better.
54
101
  author: relationship({
55
102
  ref: 'User.posts',
56
103
  ui: {
@@ -61,6 +108,7 @@ export const lists = createSchema({
61
108
  inlineCreate: { fields: ['name', 'email'] },
62
109
  },
63
110
  }),
111
+ // We also link posts to tags. This is a many <=> many linking.
64
112
  tags: relationship({
65
113
  ref: 'Tag.posts',
66
114
  ui: {
@@ -75,16 +123,14 @@ export const lists = createSchema({
75
123
  }),
76
124
  },
77
125
  }),
126
+ // Our final list is the tag list. This field is just a name and a relationship to posts
78
127
  Tag: list({
79
128
  ui: {
80
129
  isHidden: true,
81
130
  },
82
131
  fields: {
83
132
  name: text(),
84
- posts: relationship({
85
- ref: 'Post.tags',
86
- many: true,
87
- }),
133
+ posts: relationship({ ref: 'Post.tags', many: true }),
88
134
  },
89
135
  }),
90
- });
136
+ };
package/CHANGELOG.md DELETED
@@ -1,151 +0,0 @@
1
- # create-keystone-app
2
-
3
- ## 5.0.0
4
-
5
- ### Major Changes
6
-
7
- - [#201](https://github.com/keystonejs/create-keystone-app/pull/201) [`ee98fdb`](https://github.com/keystonejs/create-keystone-app/commit/ee98fdba87ee303e47790aa146575316de299fb6) Thanks [@Noviny](https://github.com/Noviny)! - Switch to use sqlite as the default database
8
-
9
- ## 4.0.15
10
-
11
- ### Patch Changes
12
-
13
- - [#199](https://github.com/keystonejs/create-keystone-app/pull/199) [`fe7523d`](https://github.com/keystonejs/create-keystone-app/commit/fe7523dc1ee04d46a7d506554418fd3812729b46) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
14
-
15
- ## 4.0.14
16
-
17
- ### Patch Changes
18
-
19
- - [#194](https://github.com/keystonejs/create-keystone-app/pull/194) [`16614e1`](https://github.com/keystonejs/create-keystone-app/commit/16614e10160b2b0899ec0fe7cad5e3eeff129b3c) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
20
-
21
- ## 4.0.13
22
-
23
- ### Patch Changes
24
-
25
- - [#188](https://github.com/keystonejs/create-keystone-app/pull/188) [`621adbe`](https://github.com/keystonejs/create-keystone-app/commit/621adbe62de80a79b0759d3e806816b4097bb2a7) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
26
-
27
- ## 4.0.12
28
-
29
- ### Patch Changes
30
-
31
- - [#173](https://github.com/keystonejs/create-keystone-app/pull/173) [`b8cf267`](https://github.com/keystonejs/create-keystone-app/commit/b8cf26719456a0c88788f6d6ea3fec05af2b57a6) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
32
-
33
- ## 4.0.11
34
-
35
- ### Patch Changes
36
-
37
- - [#166](https://github.com/keystonejs/create-keystone-app/pull/166) [`c853425`](https://github.com/keystonejs/create-keystone-app/commit/c8534250489c33e40323a69c41e644d7199f7329) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
38
-
39
- ## 4.0.10
40
-
41
- ### Patch Changes
42
-
43
- - [#157](https://github.com/keystonejs/create-keystone-app/pull/157) [`437237f`](https://github.com/keystonejs/create-keystone-app/commit/437237f671ae40fdbd1bed19ebc272cbb31cbfe6) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
44
-
45
- ## 4.0.9
46
-
47
- ### Patch Changes
48
-
49
- - [#150](https://github.com/keystonejs/create-keystone-app/pull/150) [`2af99bf`](https://github.com/keystonejs/create-keystone-app/commit/2af99bf669114eb3cd562abb707729a24aee533e) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
50
-
51
- ## 4.0.8
52
-
53
- ### Patch Changes
54
-
55
- - [#143](https://github.com/keystonejs/create-keystone-app/pull/143) [`4aa566a`](https://github.com/keystonejs/create-keystone-app/commit/4aa566a8c2dccfab1264518f90d62899b467f15d) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
56
-
57
- Updated README with getting starting instructions.
58
-
59
- ## 4.0.7
60
-
61
- ### Patch Changes
62
-
63
- - [#137](https://github.com/keystonejs/create-keystone-app/pull/137) [`a779d69`](https://github.com/keystonejs/create-keystone-app/commit/a779d691f385d152478d49a5f01ceb1bc0cc69ac) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
64
-
65
- ## 4.0.6
66
-
67
- ### Patch Changes
68
-
69
- - [#122](https://github.com/keystonejs/create-keystone-app/pull/122) [`60f1454`](https://github.com/keystonejs/create-keystone-app/commit/60f1454e354f37a587a75d7cb54c165862fc392d) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
70
-
71
- ## 4.0.5
72
-
73
- ### Patch Changes
74
-
75
- - [#116](https://github.com/keystonejs/create-keystone-app/pull/116) [`d532c8f`](https://github.com/keystonejs/create-keystone-app/commit/d532c8fcc243fd4d37d45a47eb4a1c7698fca494) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
76
-
77
- ## 4.0.4
78
-
79
- ### Patch Changes
80
-
81
- - [#101](https://github.com/keystonejs/create-keystone-app/pull/101) [`446bf0e`](https://github.com/keystonejs/create-keystone-app/commit/446bf0e745e30d814a438c81eb8f7dd275174ff9) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
82
-
83
- ## 4.0.3
84
-
85
- ### Patch Changes
86
-
87
- - [#97](https://github.com/keystonejs/create-keystone-app/pull/97) [`4e47f27`](https://github.com/keystonejs/create-keystone-app/commit/4e47f27aa9f5925b6346960ee080758c8bfe34df) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies to latest version.
88
-
89
- ## 4.0.2
90
-
91
- ### Patch Changes
92
-
93
- - [#94](https://github.com/keystonejs/create-keystone-app/pull/94) [`be83fa6`](https://github.com/keystonejs/create-keystone-app/commit/be83fa60e004a2f11e65a0bc553312732912a828) Thanks [@bladey](https://github.com/bladey)! - Updated Keystone dependencies to latest version.
94
-
95
- ## 4.0.1
96
-
97
- ### Patch Changes
98
-
99
- - [#74](https://github.com/keystonejs/create-keystone-app/pull/74) [`79f19f5`](https://github.com/keystonejs/create-keystone-app/commit/79f19f51a6648941c15ac4f03bc0807a5670cb55) Thanks [@timleslie](https://github.com/timleslie)! - Updated `password` field in starter project to be `{ isRequired: true }`.
100
-
101
- ## 4.0.0
102
-
103
- ### Major Changes
104
-
105
- - [#65](https://github.com/keystonejs/create-keystone-next-app/pull/65) [`49c5ff2`](https://github.com/keystonejs/create-keystone-next-app/commit/49c5ff2d9892de0692a05a1f1dc01501f2979bc8) Thanks [@bladey](https://github.com/bladey)! - Updated to use Keystone Next packages instead of Keystone 5.
106
-
107
- ## 1.2.2
108
-
109
- ### Patch Changes
110
-
111
- - [#66](https://github.com/keystonejs/create-keystone-next-app/pull/66) [`f44867a`](https://github.com/keystonejs/create-keystone-next-app/commit/f44867a56626824e96a2135b2ec1eee07da9fde5) Thanks [@bladey](https://github.com/bladey)! - Added notice to advise users to use `create-keystone-app` instead of `create-keystone-next-app`.
112
-
113
- ## 1.2.1
114
-
115
- ### Patch Changes
116
-
117
- - [#52](https://github.com/keystonejs/create-keystone-next-app/pull/52) [`1b363c4`](https://github.com/keystonejs/create-keystone-next-app/commit/1b363c41cd96299e68cd3d9db3be94b13a7844e5) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies.
118
-
119
- ## 1.2.0
120
-
121
- ### Minor Changes
122
-
123
- - [#30](https://github.com/keystonejs/create-keystone-next-app/pull/30) [`fb45d53`](https://github.com/keystonejs/create-keystone-next-app/commit/fb45d53445ba2ec1fb30680e90c293d40c293d00) Thanks [@jesstelford](https://github.com/jesstelford)! - Updated script to show a loading spinner instead of the raw yarn or npm output.
124
-
125
- ### Patch Changes
126
-
127
- - [#36](https://github.com/keystonejs/create-keystone-next-app/pull/36) [`94f9f26`](https://github.com/keystonejs/create-keystone-next-app/commit/94f9f267eea6862605ca443a83997062eeeb6b92) Thanks [@renovate](https://github.com/apps/renovate)! - Updated Keystone dependencies.
128
-
129
- * [#46](https://github.com/keystonejs/create-keystone-next-app/pull/46) [`9cbc860`](https://github.com/keystonejs/create-keystone-next-app/commit/9cbc8608c42c4406e574dad12e2f871754ff5450) Thanks [@dominikwilkowski](https://github.com/dominikwilkowski)! - Fixed a windows issue where the package would not run via npx or npm init
130
-
131
- - [#50](https://github.com/keystonejs/create-keystone-next-app/pull/50) [`ceca306`](https://github.com/keystonejs/create-keystone-next-app/commit/ceca306853469eda199dc3d7b1c8ee411f414e9b) Thanks [@dominikwilkowski](https://github.com/dominikwilkowski)! - Updated keystone-next dependencies
132
-
133
- * [#28](https://github.com/keystonejs/create-keystone-next-app/pull/28) [`b52d27e`](https://github.com/keystonejs/create-keystone-next-app/commit/b52d27e4d2ad447cf4a5a268c6ccda65723d8d2f) Thanks [@dominikwilkowski](https://github.com/dominikwilkowski)! - Removed a single trailing space in tsconfig.json
134
-
135
- ## 1.1.0
136
-
137
- ### Minor Changes
138
-
139
- - [#24](https://github.com/keystonejs/create-keystone-next-app/pull/24) [`736c845`](https://github.com/keystonejs/create-keystone-next-app/commit/736c845d677e8520cb2263b5ae9122c1cc1590bf) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Updated Keystone
140
-
141
- ## 1.0.0
142
-
143
- ### Major Changes
144
-
145
- - [`4f63ae3`](https://github.com/keystonejs/create-keystone-next-app/commit/4f63ae383f1995ba7494390717f628bed135d7b0) [#15](https://github.com/keystonejs/create-keystone-next-app/pull/15) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Updated to the latest version of Keystone Next
146
-
147
- ## 0.0.1
148
-
149
- ### Patch Changes
150
-
151
- - [`201af8b`](https://github.com/keystonejs/create-keystone-next-app/commit/201af8b9b96edf5f63cf36c1540393f34fe06848) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Improved output after creating project