Skip to content

Commit

Permalink
Use '.' as rootDir
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Sep 28, 2024
1 parent e9de42c commit 3b9e679
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion openrewrite/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^@openrewrite/rewrite/(.*)$': '<rootDir>/dist/$1',
'^@openrewrite/rewrite/(.*)$': '<rootDir>/dist/src/$1',
'^@openrewrite/rewrite-remote(.*)$': '<rootDir>/node_modules/@openrewrite/rewrite-remote/dist$1'
},
transform: {
Expand Down
22 changes: 11 additions & 11 deletions openrewrite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
"license": "Apache-2.0",
"description": "OpenRewrite implementation for JavaScript.",
"homepage": "https://github.com/openrewrite/rewrite-javascript",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"exports": {
".": "./dist/index.js",
"./core": "./dist/core/index.js",
"./java": "./dist/java/index.js",
"./java/tree": "./dist/java/tree/index.js",
"./javascript": "./dist/javascript/index.js",
"./javascript/tree": "./dist/javascript/tree/index.js",
"./json": "./dist/json/index.js",
"./yaml": "./dist/yaml/index.js",
"./yaml/tree": "./dist/yaml/tree/index.js"
".": "./dist/src/index.js",
"./core": "./dist/src/core/index.js",
"./java": "./dist/src/java/index.js",
"./java/tree": "./dist/src/java/tree/index.js",
"./javascript": "./dist/src/javascript/index.js",
"./javascript/tree": "./dist/src/javascript/tree/index.js",
"./json": "./dist/src/json/index.js",
"./yaml": "./dist/src/yaml/index.js",
"./yaml/tree": "./dist/src/yaml/tree/index.js"
},
"scripts": {
"build": "tsc --build tsconfig.build.json",
Expand Down
6 changes: 3 additions & 3 deletions openrewrite/test/javascript/parser/literal.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as J from "../../../dist/java/tree";
import {JavaType} from "../../../dist/java/tree";
import * as JS from "../../../dist/javascript/tree";
import * as J from "../../../dist/src/java/tree";
import {JavaType} from "../../../dist/src/java";
import * as JS from "../../../dist/src/javascript";
import {connect, disconnect, rewriteRunWithOptions, typeScript} from '../testHarness';

describe('identifier mapping', () => {
Expand Down
1 change: 0 additions & 1 deletion openrewrite/test/javascript/parser/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ describe('object literal mapping', () => {
typeScript('const c = { foo: 1, bar: 2 }')
);
});

test('trailing comma', () => {
rewriteRun(
//language=typescript
Expand Down
6 changes: 3 additions & 3 deletions openrewrite/test/javascript/parser/parser.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {InMemoryExecutionContext, ParserInput} from '../../../dist/core';
import {JavaScriptParser} from "../../../dist/javascript";
import * as JS from "../../../dist/javascript/tree";
import {InMemoryExecutionContext, ParserInput} from '../../../dist/src/core';
import {JavaScriptParser} from "../../../dist/src/javascript";
import * as JS from "../../../dist/src/javascript";

describe('Parser API', () => {
const parser = JavaScriptParser.builder().build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as J from "../../../dist/java/tree";
import * as J from "../../../dist/src/java";
import {connect, disconnect, rewriteRun, typeScript} from '../testHarness';

describe('variable declaration mapping', () => {
Expand Down
4 changes: 2 additions & 2 deletions openrewrite/test/javascript/parser/void.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {connect, disconnect, rewriteRun, typeScript} from '../testHarness';
import * as JS from '../../../dist/javascript/tree';
import {JavaType} from "../../../dist/java/tree";
import * as JS from '../../../dist/src/javascript';
import {JavaType} from "../../../dist/src/java";

describe('void operator mapping', () => {
beforeAll(() => connect());
Expand Down
8 changes: 4 additions & 4 deletions openrewrite/test/javascript/testHarness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
PrintOutputCapture,
RecipeRunException,
SourceFile
} from '../../dist/core';
import * as J from "../../dist/java/tree";
import * as JS from "../../dist/javascript/tree";
} from '../../dist/src/core';
import * as J from "../../dist/src/java/tree";
import * as JS from "../../dist/src/javascript/tree";
import dedent from "dedent";
import {RemotePrinterFactory, RemotingContext} from "@openrewrite/rewrite-remote";
import net from "net";
import {JavaScriptParser, JavaScriptVisitor} from "../../dist/javascript";
import {JavaScriptParser, JavaScriptVisitor} from "../../dist/src/javascript";

export interface RewriteTestOptions {
normalizeIndent?: boolean
Expand Down
4 changes: 2 additions & 2 deletions openrewrite/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"rootDir": "./src",
"rootDir": ".",
"outDir": "./dist",
"experimentalDecorators": true,
"moduleResolution": "node16"
},
"include": ["src/**/*"],
"include": ["src/**/*", "test/**/*"],
}
3 changes: 0 additions & 3 deletions openrewrite/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./test"
},
"include": ["test/**/*.ts"],
}

0 comments on commit 3b9e679

Please sign in to comment.