Skip to content

Commit

Permalink
refactor(core): only export index.ts files (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Jan 6, 2025
1 parent 4e4f74e commit eaa069d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .changeset/fast-peas-sin.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/services/email/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//

export * from "./isAFreeDomain.js";
3 changes: 3 additions & 0 deletions packages/core/src/services/suggestion/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//

export * from "./did-you-mean.js";
2 changes: 1 addition & 1 deletion src/managers/user.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getDidYouMeanSuggestion } from "@gouvfr-lasuite/proconnect.core/services/suggestion";
import {
Add2fa,
AddAccessKey,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/services/email.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit eaa069d

Please sign in to comment.