From 5bac2b2a53faf444c32cd84b1a7eec9298407641 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Thu, 12 Dec 2024 17:35:57 +0100 Subject: [PATCH 1/2] Fixed types declaration extractor from Volto core, re-enable it on release. --- packages/volto/.release-it.json | 2 +- packages/volto/tsconfig.declarations.json | 4 +++- .../manage/Contents/ContentsDeleteModal.d.ts | 10 ++++++++++ packages/volto/types/config/Blocks.d.ts | 1 + packages/volto/types/config/Views.d.ts | 1 + packages/volto/types/config/Widgets.d.ts | 1 + packages/volto/types/reducers/index.d.ts | 2 ++ .../types/reducers/linkIntegrity/linkIntegrity.d.ts | 8 ++++++++ .../reducers/linkIntegrity/linkIntegrity.test.d.ts | 1 + 9 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 packages/volto/types/components/manage/Contents/ContentsDeleteModal.d.ts create mode 100644 packages/volto/types/reducers/linkIntegrity/linkIntegrity.d.ts create mode 100644 packages/volto/types/reducers/linkIntegrity/linkIntegrity.test.d.ts diff --git a/packages/volto/.release-it.json b/packages/volto/.release-it.json index ecce30528b..0395373591 100644 --- a/packages/volto/.release-it.json +++ b/packages/volto/.release-it.json @@ -3,7 +3,7 @@ "../scripts/prepublish.js": {} }, "hooks": { - "before:bump": ["pnpm i18n"], + "before:bump": ["pnpm i18n", "pnpm build:types", "git add types"], "after:bump": [ "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", "pipx run towncrier build --yes --version ${version}", diff --git a/packages/volto/tsconfig.declarations.json b/packages/volto/tsconfig.declarations.json index 7cf969f638..943471a087 100644 --- a/packages/volto/tsconfig.declarations.json +++ b/packages/volto/tsconfig.declarations.json @@ -11,7 +11,9 @@ "preserveSymlinks": true, "downlevelIteration": true, "paths": { - "@plone/volto/*": ["./src/*"] + "@plone/volto/*": ["./src/*"], + "react": ["./node_modules/@types/react"], + "react-dom": ["./node_modules/@types/react-dom"] } }, "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.tsx"] diff --git a/packages/volto/types/components/manage/Contents/ContentsDeleteModal.d.ts b/packages/volto/types/components/manage/Contents/ContentsDeleteModal.d.ts new file mode 100644 index 0000000000..c960549811 --- /dev/null +++ b/packages/volto/types/components/manage/Contents/ContentsDeleteModal.d.ts @@ -0,0 +1,10 @@ +export default ContentsDeleteModal; +declare function ContentsDeleteModal(props: any): import("react/jsx-runtime").JSX.Element; +declare namespace ContentsDeleteModal { + namespace propTypes { + let itemsToDelete: any; + let open: any; + let onOk: any; + let onCancel: any; + } +} diff --git a/packages/volto/types/config/Blocks.d.ts b/packages/volto/types/config/Blocks.d.ts index ea647b1484..64362f66f0 100644 --- a/packages/volto/types/config/Blocks.d.ts +++ b/packages/volto/types/config/Blocks.d.ts @@ -1,3 +1,4 @@ +export function installDefaultBlocks(config: any): void; export const groupBlocksOrder: { id: string; title: string; diff --git a/packages/volto/types/config/Views.d.ts b/packages/volto/types/config/Views.d.ts index cd54b405af..33b31de20a 100644 --- a/packages/volto/types/config/Views.d.ts +++ b/packages/volto/types/config/Views.d.ts @@ -1,3 +1,4 @@ +export function installDefaultViews(config: any): any; export namespace layoutViews { export { DefaultView as document_view }; export { SummaryView as summary_view }; diff --git a/packages/volto/types/config/Widgets.d.ts b/packages/volto/types/config/Widgets.d.ts index 07ad442ae9..132b2003ba 100644 --- a/packages/volto/types/config/Widgets.d.ts +++ b/packages/volto/types/config/Widgets.d.ts @@ -1,3 +1,4 @@ +export function installDefaultWidgets(config: any): void; export namespace widgetMapping { export namespace id { export { TokenWidget as subjects }; diff --git a/packages/volto/types/reducers/index.d.ts b/packages/volto/types/reducers/index.d.ts index 7ffcdb1786..f0aa5864d8 100644 --- a/packages/volto/types/reducers/index.d.ts +++ b/packages/volto/types/reducers/index.d.ts @@ -18,6 +18,7 @@ declare namespace reducers { export { form }; export { groups }; export { history }; + export { linkIntegrity }; export { messages }; export { navigation }; export { querystring }; @@ -66,6 +67,7 @@ import emailSend from '@plone/volto/reducers/emailSend/emailSend'; import form from '@plone/volto/reducers/form/form'; import groups from '@plone/volto/reducers/groups/groups'; import history from '@plone/volto/reducers/history/history'; +import linkIntegrity from '@plone/volto/reducers/linkIntegrity/linkIntegrity'; import messages from '@plone/volto/reducers/messages/messages'; import navigation from '@plone/volto/reducers/navigation/navigation'; import querystring from '@plone/volto/reducers/querystring/querystring'; diff --git a/packages/volto/types/reducers/linkIntegrity/linkIntegrity.d.ts b/packages/volto/types/reducers/linkIntegrity/linkIntegrity.d.ts new file mode 100644 index 0000000000..e2e7495d91 --- /dev/null +++ b/packages/volto/types/reducers/linkIntegrity/linkIntegrity.d.ts @@ -0,0 +1,8 @@ +/** + * History reducer. + * @function linkIntegrity + * @param {Object} state Current state. + * @param {Object} action Action to be handled. + * @returns {Object} New state. + */ +export default function linkIntegrity(state?: any, action?: any): any; diff --git a/packages/volto/types/reducers/linkIntegrity/linkIntegrity.test.d.ts b/packages/volto/types/reducers/linkIntegrity/linkIntegrity.test.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/volto/types/reducers/linkIntegrity/linkIntegrity.test.d.ts @@ -0,0 +1 @@ +export {}; From 622eab56b8a1400cd63f11c637d137b87dbf1ff9 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Thu, 12 Dec 2024 17:47:33 +0100 Subject: [PATCH 2/2] Changelog --- packages/volto/news/6534.internal | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/volto/news/6534.internal diff --git a/packages/volto/news/6534.internal b/packages/volto/news/6534.internal new file mode 100644 index 0000000000..3aea67dbc9 --- /dev/null +++ b/packages/volto/news/6534.internal @@ -0,0 +1 @@ +Fixed and re-enabled the types declaration extractor from core Volto. @sneridagh