diff --git a/.changeset/fast-peas-sin.md b/.changeset/fast-peas-sin.md new file mode 100644 index 000000000..581a4e4b6 --- /dev/null +++ b/.changeset/fast-peas-sin.md @@ -0,0 +1,7 @@ +--- +"@gouvfr-lasuite/proconnect.core": patch +--- + +♻️ restriction des exports de fichier + +Seul les index peuvent être importé. Cela permet de réduire les confusions d'auto-import dans la majorité des IDEs. diff --git a/packages/core/package.json b/packages/core/package.json index e953d5d71..b63f59a76 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -20,15 +20,15 @@ "exports": { "./*": { "require": { - "types": "./dist/*", - "default": "./dist/*" + "types": "./dist/*/index.d.ts", + "default": "./dist/*/index.js" }, "import": { - "types": "./dist/*", - "default": "./dist/*" + "types": "./dist/*/index.d.ts", + "default": "./dist/*/index.js" }, - "types": "./dist/*", - "default": "./dist/*" + "types": "./dist/*/index.d.ts", + "default": "./dist/*/index.js" } }, "scripts": { diff --git a/packages/core/src/services/email/index.ts b/packages/core/src/services/email/index.ts new file mode 100644 index 000000000..da7061c2d --- /dev/null +++ b/packages/core/src/services/email/index.ts @@ -0,0 +1,3 @@ +// + +export * from "./isAFreeDomain.js"; diff --git a/packages/core/src/services/suggestion/index.ts b/packages/core/src/services/suggestion/index.ts new file mode 100644 index 000000000..1352d1885 --- /dev/null +++ b/packages/core/src/services/suggestion/index.ts @@ -0,0 +1,3 @@ +// + +export * from "./did-you-mean.js"; diff --git a/src/managers/user.ts b/src/managers/user.ts index f26d107ee..1a4a93025 100644 --- a/src/managers/user.ts +++ b/src/managers/user.ts @@ -1,3 +1,4 @@ +import { getDidYouMeanSuggestion } from "@gouvfr-lasuite/proconnect.core/services/suggestion"; import { Add2fa, AddAccessKey, @@ -27,7 +28,6 @@ import { import { isEmailSafeToSendTransactional } from "../connectors/debounce"; import { sendMail } from "../connectors/mail"; -import { getDidYouMeanSuggestion } from "@gouvfr-lasuite/proconnect.core/services/suggestion/did-you-mean.js"; import { HOST, MAGIC_LINK_TOKEN_EXPIRATION_DURATION_IN_MINUTES, diff --git a/src/services/email.ts b/src/services/email.ts index dfd01b9ec..140939893 100644 --- a/src/services/email.ts +++ b/src/services/email.ts @@ -1,6 +1,6 @@ // -import { isAFreeDomain } from "@gouvfr-lasuite/proconnect.core/services/email/isAFreeDomain.js"; +import { isAFreeDomain } from "@gouvfr-lasuite/proconnect.core/services/email"; import { parse_host } from "tld-extract"; import { FEATURE_CONSIDER_ALL_EMAIL_DOMAINS_AS_FREE,