diff --git a/playground/config/plugins.js b/playground/config/plugins.js index ed733d3..e321c68 100644 --- a/playground/config/plugins.js +++ b/playground/config/plugins.js @@ -3,18 +3,7 @@ module.exports = { enabled: true, config: { importOnBootstrap: false, - minify: false, - customTypes: [ - { - configName: "home", - queryString: "api::home.home", - uid: ["slug"], - components: [ - "Profile", - "Profile.ContactInfo", - ], - } - ] + minify: true, }, }, }; diff --git a/playground/src/api/home/content-types/home/schema.json b/playground/src/api/home/content-types/home/schema.json index 4f55a03..1946402 100644 --- a/playground/src/api/home/content-types/home/schema.json +++ b/playground/src/api/home/content-types/home/schema.json @@ -15,11 +15,6 @@ "title": { "type": "string" }, - "Profile": { - "type": "component", - "repeatable": false, - "component": "core.profile" - }, "slug": { "type": "uid", "targetField": "title" diff --git a/playground/src/components/core/contact-info.json b/playground/src/components/core/contact-info.json deleted file mode 100644 index ba435db..0000000 --- a/playground/src/components/core/contact-info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "collectionName": "components_core_contact_infos", - "info": { - "displayName": "ContactInfo" - }, - "options": {}, - "attributes": { - "Phonenumber": { - "type": "string" - }, - "Email": { - "type": "string" - } - } -} diff --git a/playground/src/components/core/profile.json b/playground/src/components/core/profile.json deleted file mode 100644 index 18848ef..0000000 --- a/playground/src/components/core/profile.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "collectionName": "components_core_profiles", - "info": { - "displayName": "Profile", - "description": "" - }, - "options": {}, - "attributes": { - "title": { - "type": "string" - }, - "ContactInfo": { - "type": "component", - "repeatable": true, - "component": "core.contact-info" - } - } -} diff --git a/playground/types/generated/components.d.ts b/playground/types/generated/components.d.ts index 7fb9838..0cd76b4 100644 --- a/playground/types/generated/components.d.ts +++ b/playground/types/generated/components.d.ts @@ -1,33 +1,5 @@ import type { Schema, Attribute } from '@strapi/strapi'; -export interface CoreProfile extends Schema.Component { - collectionName: 'components_core_profiles'; - info: { - displayName: 'Profile'; - description: ''; - }; - attributes: { - title: Attribute.String; - ContactInfo: Attribute.Component<'core.contact-info', true>; - }; -} - -export interface CoreContactInfo extends Schema.Component { - collectionName: 'components_core_contact_infos'; - info: { - displayName: 'ContactInfo'; - }; - attributes: { - Phonenumber: Attribute.String; - Email: Attribute.String; - }; -} - declare module '@strapi/types' { - export module Shared { - export interface Components { - 'core.profile': CoreProfile; - 'core.contact-info': CoreContactInfo; - } - } + export module Shared {} } diff --git a/playground/types/generated/contentTypes.d.ts b/playground/types/generated/contentTypes.d.ts index 64d1520..44b1b72 100644 --- a/playground/types/generated/contentTypes.d.ts +++ b/playground/types/generated/contentTypes.d.ts @@ -362,6 +362,50 @@ export interface AdminTransferTokenPermission extends Schema.CollectionType { }; } +export interface ApiHomeHome extends Schema.SingleType { + collectionName: 'homes'; + info: { + singularName: 'home'; + pluralName: 'homes'; + displayName: 'Home'; + description: ''; + }; + options: { + draftAndPublish: false; + }; + attributes: { + title: Attribute.String; + slug: Attribute.UID<'api::home.home', 'title'>; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + createdBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & + Attribute.Private; + updatedBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & + Attribute.Private; + }; +} + +export interface ApiPagePage extends Schema.CollectionType { + collectionName: 'pages'; + info: { + singularName: 'page'; + pluralName: 'pages'; + displayName: 'Page'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + title: Attribute.String & Attribute.Required; + createdAt: Attribute.DateTime; + updatedAt: Attribute.DateTime; + createdBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & + Attribute.Private; + updatedBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & + Attribute.Private; + }; +} + export interface PluginUploadFile extends Schema.CollectionType { collectionName: 'files'; info: { @@ -788,51 +832,6 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType { }; } -export interface ApiHomeHome extends Schema.SingleType { - collectionName: 'homes'; - info: { - singularName: 'home'; - pluralName: 'homes'; - displayName: 'Home'; - description: ''; - }; - options: { - draftAndPublish: false; - }; - attributes: { - title: Attribute.String; - Profile: Attribute.Component<'core.profile'>; - slug: Attribute.UID<'api::home.home', 'title'>; - createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & - Attribute.Private; - updatedBy: Attribute.Relation<'api::home.home', 'oneToOne', 'admin::user'> & - Attribute.Private; - }; -} - -export interface ApiPagePage extends Schema.CollectionType { - collectionName: 'pages'; - info: { - singularName: 'page'; - pluralName: 'pages'; - displayName: 'Page'; - }; - options: { - draftAndPublish: false; - }; - attributes: { - title: Attribute.String & Attribute.Required; - createdAt: Attribute.DateTime; - updatedAt: Attribute.DateTime; - createdBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & - Attribute.Private; - updatedBy: Attribute.Relation<'api::page.page', 'oneToOne', 'admin::user'> & - Attribute.Private; - }; -} - declare module '@strapi/types' { export module Shared { export interface ContentTypes { @@ -843,6 +842,8 @@ declare module '@strapi/types' { 'admin::api-token-permission': AdminApiTokenPermission; 'admin::transfer-token': AdminTransferToken; 'admin::transfer-token-permission': AdminTransferTokenPermission; + 'api::home.home': ApiHomeHome; + 'api::page.page': ApiPagePage; 'plugin::upload.file': PluginUploadFile; 'plugin::upload.folder': PluginUploadFolder; 'plugin::content-releases.release': PluginContentReleasesRelease; @@ -851,8 +852,6 @@ declare module '@strapi/types' { 'plugin::users-permissions.permission': PluginUsersPermissionsPermission; 'plugin::users-permissions.role': PluginUsersPermissionsRole; 'plugin::users-permissions.user': PluginUsersPermissionsUser; - 'api::home.home': ApiHomeHome; - 'api::page.page': ApiPagePage; } } }