create-payload-app 0.3.34 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/lib/create-project.js +33 -87
  2. package/dist/lib/create-project.test.js +37 -52
  3. package/dist/lib/templates.js +38 -71
  4. package/dist/lib/write-env-file.js +27 -20
  5. package/dist/main.js +14 -2
  6. package/dist/utils/messages.js +2 -1
  7. package/package.json +1 -1
  8. package/dist/lib/common-files/Dockerfile.template +0 -26
  9. package/dist/lib/common-files/README.template.md +0 -19
  10. package/dist/lib/common-files/docker-compose.template.yml +0 -35
  11. package/dist/lib/common-files/gitignore.template +0 -166
  12. package/dist/lib/common-files/nodemon.json +0 -4
  13. package/dist/lib/common-files/package.template.json +0 -30
  14. package/dist/lib/common-files/tsconfig.json +0 -34
  15. package/dist/lib/write-common-files.js +0 -124
  16. package/dist/templates/blank/src/collections/Examples.ts +0 -17
  17. package/dist/templates/blank/src/collections/Users.ts +0 -15
  18. package/dist/templates/blank/src/payload.config.ts +0 -22
  19. package/dist/templates/blank/src/server.ts +0 -28
  20. package/dist/templates/blog/src/collections/Categories.ts +0 -20
  21. package/dist/templates/blog/src/collections/Media.ts +0 -28
  22. package/dist/templates/blog/src/collections/Posts.ts +0 -62
  23. package/dist/templates/blog/src/collections/Tags.ts +0 -20
  24. package/dist/templates/blog/src/collections/Users.ts +0 -18
  25. package/dist/templates/blog/src/payload.config.ts +0 -21
  26. package/dist/templates/blog/src/server.ts +0 -28
  27. package/dist/templates/todo/src/collections/TodoLists.ts +0 -38
  28. package/dist/templates/todo/src/collections/Users.ts +0 -15
  29. package/dist/templates/todo/src/payload.config.ts +0 -18
  30. package/dist/templates/todo/src/server.ts +0 -28
@@ -1,38 +0,0 @@
1
- import { CollectionConfig } from 'payload/types';
2
-
3
- const Todo: CollectionConfig = {
4
- slug: 'todos',
5
- admin: {
6
- defaultColumns: ['listName', 'tasks', 'updatedAt'],
7
- useAsTitle: 'listName',
8
- },
9
- access: {
10
- create: () => true,
11
- read: () => true,
12
- update: () => true,
13
- delete: () => true,
14
- },
15
- fields: [
16
- {
17
- name: 'listName',
18
- type: 'text',
19
- },
20
- {
21
- name: 'tasks',
22
- type: 'array',
23
- fields: [
24
- {
25
- name: 'name',
26
- type: 'text',
27
- },
28
- {
29
- name: 'complete',
30
- type: 'checkbox',
31
- defaultValue: false,
32
- }
33
- ]
34
- },
35
- ],
36
- }
37
-
38
- export default Todo;
@@ -1,15 +0,0 @@
1
- import { CollectionConfig } from 'payload/types';
2
-
3
- const Users: CollectionConfig = {
4
- slug: 'users',
5
- auth: true,
6
- admin: {
7
- useAsTitle: 'email',
8
- },
9
- fields: [
10
- // Email added by default
11
- // Add more fields as needed
12
- ],
13
- };
14
-
15
- export default Users;
@@ -1,18 +0,0 @@
1
- import { buildConfig } from 'payload/config';
2
- import path from 'path';
3
- import TodoLists from './collections/TodoLists';
4
- import Users from './collections/Users';
5
-
6
- export default buildConfig({
7
- serverURL: 'http://localhost:3000',
8
- admin: {
9
- user: Users.slug,
10
- },
11
- collections: [TodoLists, Users],
12
- typescript: {
13
- outputFile: path.resolve(__dirname, 'payload-types.ts'),
14
- },
15
- graphQL: {
16
- schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
17
- },
18
- })
@@ -1,28 +0,0 @@
1
- import express from 'express';
2
- import payload from 'payload';
3
-
4
- require('dotenv').config();
5
- const app = express();
6
-
7
- // Redirect root to Admin panel
8
- app.get('/', (_, res) => {
9
- res.redirect('/admin');
10
- });
11
-
12
- const start = async () => {
13
- // Initialize Payload
14
- await payload.init({
15
- secret: process.env.PAYLOAD_SECRET,
16
- mongoURL: process.env.MONGODB_URI,
17
- express: app,
18
- onInit: async () => {
19
- payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
20
- },
21
- })
22
-
23
- // Add your own express routes here
24
-
25
- app.listen(3000);
26
- }
27
-
28
- start();