From 83648936af020293accffad4179f6e31ceab2ada Mon Sep 17 00:00:00 2001 From: OlegDokuka Date: Fri, 27 Sep 2024 22:02:53 +0300 Subject: [PATCH] Fix modules resolution --- openrewrite/jest.config.js | 3 +-- openrewrite/package.json | 3 ++- openrewrite/test/javascript/testHarness.ts | 2 +- openrewrite/tsconfig.json | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openrewrite/jest.config.js b/openrewrite/jest.config.js index dd8ae12b..968667db 100644 --- a/openrewrite/jest.config.js +++ b/openrewrite/jest.config.js @@ -4,8 +4,7 @@ module.exports = { testPathIgnorePatterns: ['/node_modules/', '/dist/'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], moduleNameMapper: { - '^@openrewrite/rewrite/(.*)$': '/dist/$1', - '^@openrewrite/rewrite-remote(.*)$': '/node_modules/@openrewrite/rewrite-remote$1' + '^@openrewrite/rewrite/(.*)$': '/dist/$1' }, transform: { '^.+\\.tsx?$': ['ts-jest', { diff --git a/openrewrite/package.json b/openrewrite/package.json index 7829db71..739e1392 100644 --- a/openrewrite/package.json +++ b/openrewrite/package.json @@ -36,6 +36,7 @@ "jest": "^29.7.0", "ts-jest": "^29.2.5", "ts-node": "^10.9.2", - "typescript": "^5.6.2" + "typescript": "^5.6.2", + "@openrewrite/rewrite-remote": "^1.0.0" } } diff --git a/openrewrite/test/javascript/testHarness.ts b/openrewrite/test/javascript/testHarness.ts index 9519d105..f751345a 100644 --- a/openrewrite/test/javascript/testHarness.ts +++ b/openrewrite/test/javascript/testHarness.ts @@ -13,7 +13,7 @@ import * as J from "../../dist/java/tree"; import * as JS from "../../dist/javascript/tree"; import dedent from "dedent"; import {ReceiverContext, RemotePrinterFactory, RemotingContext, SenderContext} from "@openrewrite/rewrite-remote"; -import * as deser from "@openrewrite/rewrite-remote/java/serializers"; +import * as deser from "@openrewrite/rewrite-remote/java"; import {JavaScriptReceiver, JavaScriptSender} from "@openrewrite/rewrite-remote/javascript"; import net from "net"; import {JavaScriptParser, JavaScriptVisitor} from "../../dist/javascript"; diff --git a/openrewrite/tsconfig.json b/openrewrite/tsconfig.json index 470d5629..7c33f8aa 100644 --- a/openrewrite/tsconfig.json +++ b/openrewrite/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es2016", - "module": "commonjs", + "module": "Node16", "sourceMap": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, @@ -9,7 +9,8 @@ "skipLibCheck": true, "rootDir": "./src", "outDir": "./dist", - "experimentalDecorators": true + "experimentalDecorators": true, + "moduleResolution": "node16" }, "include": ["src/**/*"], }