Skip to content

Commit e4200c3

Browse files
authored
feat: migration cli (#12)
* feat: migration cli concept * feat: migration schema mappings * feat: updated component mappings * feat: migration script enhancements * feat: updated newsletter CTA form * refactor: build fixes
1 parent 9eebbe8 commit e4200c3

File tree

93 files changed

+21183
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+21183
-235
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Source code for the [strapi.io](https://strapi.io/) website. Monorepo with Strap
2323

2424
```sh
2525
git clone <repo-url>
26-
cd strapi-website
26+
cd website
2727
```
2828

2929
2. Install dependencies
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "authors",
4+
"info": {
5+
"singularName": "author",
6+
"pluralName": "authors",
7+
"displayName": "Author",
8+
"description": "Blog post authors"
9+
},
10+
"options": {
11+
"draftAndPublish": false
12+
},
13+
"pluginOptions": {
14+
"i18n": {
15+
"localized": true
16+
}
17+
},
18+
"attributes": {
19+
"name": {
20+
"type": "string",
21+
"pluginOptions": {
22+
"i18n": {
23+
"localized": false
24+
}
25+
},
26+
"required": true
27+
},
28+
"slug": {
29+
"type": "string",
30+
"pluginOptions": {
31+
"i18n": {
32+
"localized": false
33+
}
34+
},
35+
"required": true,
36+
"unique": true,
37+
"regex": "^[a-z0-9-]+$"
38+
},
39+
"bio": {
40+
"type": "text",
41+
"pluginOptions": {
42+
"i18n": {
43+
"localized": true
44+
}
45+
}
46+
},
47+
"avatar": {
48+
"type": "component",
49+
"pluginOptions": {
50+
"i18n": {
51+
"localized": false
52+
}
53+
},
54+
"component": "media.image",
55+
"repeatable": false
56+
},
57+
"website": {
58+
"type": "string",
59+
"pluginOptions": {
60+
"i18n": {
61+
"localized": false
62+
}
63+
}
64+
},
65+
"twitter": {
66+
"type": "string",
67+
"pluginOptions": {
68+
"i18n": {
69+
"localized": false
70+
}
71+
}
72+
},
73+
"github": {
74+
"type": "string",
75+
"pluginOptions": {
76+
"i18n": {
77+
"localized": false
78+
}
79+
}
80+
},
81+
"blogPosts": {
82+
"type": "relation",
83+
"relation": "oneToMany",
84+
"target": "api::blog-post.blog-post",
85+
"mappedBy": "author"
86+
}
87+
}
88+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreController("api::author.author")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreRouter("api::author.author")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreService("api::author.author")
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "blog_categories",
4+
"info": {
5+
"singularName": "blog-category",
6+
"pluralName": "blog-categories",
7+
"displayName": "Blog Category",
8+
"description": "Blog post categories"
9+
},
10+
"options": {
11+
"draftAndPublish": false
12+
},
13+
"pluginOptions": {
14+
"i18n": {
15+
"localized": true
16+
}
17+
},
18+
"attributes": {
19+
"name": {
20+
"type": "string",
21+
"pluginOptions": {
22+
"i18n": {
23+
"localized": true
24+
}
25+
},
26+
"required": true
27+
},
28+
"slug": {
29+
"type": "string",
30+
"pluginOptions": {
31+
"i18n": {
32+
"localized": false
33+
}
34+
},
35+
"required": true,
36+
"unique": true,
37+
"regex": "^[a-z0-9-]+$"
38+
},
39+
"description": {
40+
"type": "text",
41+
"pluginOptions": {
42+
"i18n": {
43+
"localized": true
44+
}
45+
}
46+
}
47+
}
48+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreController(
4+
"api::blog-category.blog-category"
5+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreRouter("api::blog-category.blog-category")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { factories } from "@strapi/strapi"
2+
3+
export default factories.createCoreService("api::blog-category.blog-category")

apps/strapi/src/api/blog-post/content-types/blog-post/schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
"testimonials.quote",
7878
"blog.author-banner",
7979
"forms.newsletter",
80-
"forms.hubspot-form"
80+
"forms.hubspot-form",
81+
"migration.data-sink"
8182
]
8283
}
8384
}

0 commit comments

Comments
 (0)