From 9fb19eb1c8b06d2e8879698b87f153f13fe29a07 Mon Sep 17 00:00:00 2001 From: Crash-- Date: Wed, 11 Jan 2023 08:54:15 +0100 Subject: [PATCH] feat: Remove the export from models/index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to enhance the cozy-client tree shaking, we should avoind importing * and exporting. We had an issue with this PR https://github.com/cozy/cozy-client/pull/1274 because this PR adds date-fns v2 as dep, but even if the consuming app doesn't use the concerned model it was imported. BREAKING CHANGE: You can not use import { models } from cozy-client ... models.files.func() You have to change it to: import { func } from cozy-client/dist/models/files --- packages/cozy-client/src/models/index.js | 41 ------------------------ 1 file changed, 41 deletions(-) delete mode 100644 packages/cozy-client/src/models/index.js diff --git a/packages/cozy-client/src/models/index.js b/packages/cozy-client/src/models/index.js deleted file mode 100644 index 5ced92a25f..0000000000 --- a/packages/cozy-client/src/models/index.js +++ /dev/null @@ -1,41 +0,0 @@ -import * as trigger from './trigger' -import * as instance from './instance' -import * as applications from './applications' -import * as file from './file' -import * as folder from './folder' -import * as account from './account' -import * as note from './note' -import * as permission from './permission' -import * as utils from './utils' -import * as contact from './contact' -import * as document from './document' -import * as timeseries from './timeseries' -import * as sharing from './sharing' -import * as dacc from './dacc' -import * as doctypes from './doctypes' -import * as paper from './paper' - -// For backward compatibility before 9.0.0 -const triggers = trigger -const accounts = account - -export { - triggers, - trigger, - instance, - applications, - file, - folder, - note, - account, - accounts, - permission, - utils, - contact, - document, - timeseries, - sharing, - dacc, - doctypes, - paper -}