From 7a1aca395ed260ad77bd764e160eda48a66c54f9 Mon Sep 17 00:00:00 2001 From: Douglas Duteil Date: Thu, 12 Dec 2024 16:56:21 +0100 Subject: [PATCH] fix(core): force node next module compatibility (#879) --- .changeset/selfish-apes-push.md | 5 +++++ .../src/services/suggestion/did-you-mean.test.ts | 2 +- .../core/src/services/suggestion/did-you-mean.ts | 4 ++-- packages/core/tsconfig.json | 12 ++++-------- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 .changeset/selfish-apes-push.md diff --git a/.changeset/selfish-apes-push.md b/.changeset/selfish-apes-push.md new file mode 100644 index 00000000..c9700ad2 --- /dev/null +++ b/.changeset/selfish-apes-push.md @@ -0,0 +1,5 @@ +--- +"@gouvfr-lasuite/proconnect.core": patch +--- + +:recycle: force la compatibilité avec Node.js diff --git a/packages/core/src/services/suggestion/did-you-mean.test.ts b/packages/core/src/services/suggestion/did-you-mean.test.ts index e51b487d..357f4b47 100644 --- a/packages/core/src/services/suggestion/did-you-mean.test.ts +++ b/packages/core/src/services/suggestion/did-you-mean.test.ts @@ -1,5 +1,5 @@ import { assert } from "chai"; -import { getDidYouMeanSuggestion } from "./did-you-mean"; +import { getDidYouMeanSuggestion } from "./did-you-mean.js"; describe("getDidYouMeanSuggestion", () => { const emailAddresses = [ diff --git a/packages/core/src/services/suggestion/did-you-mean.ts b/packages/core/src/services/suggestion/did-you-mean.ts index 01304dcd..b27644f1 100644 --- a/packages/core/src/services/suggestion/did-you-mean.ts +++ b/packages/core/src/services/suggestion/did-you-mean.ts @@ -1,6 +1,6 @@ -import gouvfrDomains from "#src/data/gouvfr-domains"; +import gouvfrDomains from "#src/data/gouvfr-domains.js"; import mostUsedFreeEmailDomains from "#src/data/most-used-free-email-domains.js"; -import otherGouvDomains from "#src/data/other-gouv-domains"; +import otherGouvDomains from "#src/data/other-gouv-domains.js"; import { run as spellCheckEmail } from "@zootools/email-spell-checker"; // Display an email suggestion for most used public domains diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index af9f4625..1c2a9acc 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -5,16 +5,12 @@ "declarationMap": true, "outDir": "./dist", "rootDir": "src", - "types": [ - "./types" - ], - "module": "Preserve", - "moduleResolution": "Bundler", + "types": ["./types"], + "module": "NodeNext", + "moduleResolution": "nodenext", "verbatimModuleSyntax": true, "paths": { - "#src/*": [ - "./src/*" - ] + "#src/*": ["./src/*"] } }, "extends": "@tsconfig/node22/tsconfig.json",