chore: switch to module ESNext + moduleResolution bundler (#2095)
This commit is contained in:
parent
c59dc3aa1a
commit
ee732d64b6
15 changed files with 668 additions and 863 deletions
|
|
@ -3,9 +3,9 @@ import { tmpdir } from 'node:os';
|
|||
import path from 'node:path';
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
|
||||
import { getMigration } from '../src/migrations/index.js';
|
||||
import { run } from '../src/runner.js';
|
||||
import { DiagnosticLevel } from '../src/types.js';
|
||||
import { getMigration } from '../src/migrations/index';
|
||||
import { run } from '../src/runner';
|
||||
import { DiagnosticLevel } from '../src/types';
|
||||
|
||||
const migration = getMigration('v1-to-v2')!;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { tmpdir } from 'node:os';
|
|||
import path from 'node:path';
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { getMigration } from '../src/migrations/index.js';
|
||||
import { run } from '../src/runner.js';
|
||||
import { CODEMOD_ERROR_PREFIX } from '../src/utils/diagnostics.js';
|
||||
import { getMigration } from '../src/migrations/index';
|
||||
import { run } from '../src/runner';
|
||||
import { CODEMOD_ERROR_PREFIX } from '../src/utils/diagnostics';
|
||||
|
||||
const migration = getMigration('v1-to-v2')!;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ import { tmpdir } from 'node:os';
|
|||
import path from 'node:path';
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
|
||||
import { getMigration } from '../src/migrations/index.js';
|
||||
import { run } from '../src/runner.js';
|
||||
import { DiagnosticLevel } from '../src/types.js';
|
||||
import type { Migration, Transform } from '../src/types.js';
|
||||
import { getMigration } from '../src/migrations/index';
|
||||
import { run } from '../src/runner';
|
||||
import { DiagnosticLevel } from '../src/types';
|
||||
import type { Migration, Transform } from '../src/types';
|
||||
|
||||
const migration = getMigration('v1-to-v2')!;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { tmpdir } from 'node:os';
|
|||
import path from 'node:path';
|
||||
import { afterEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { updatePackageJson } from '../src/utils/packageJsonUpdater.js';
|
||||
import { updatePackageJson } from '../src/utils/packageJsonUpdater';
|
||||
|
||||
let tempDir: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { tmpdir } from 'node:os';
|
|||
import path from 'node:path';
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
|
||||
import { analyzeProject } from '../src/utils/projectAnalyzer.js';
|
||||
import { analyzeProject } from '../src/utils/projectAnalyzer';
|
||||
|
||||
let tempDir: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { contextTypesTransform } from '../../../src/migrations/v1-to-v2/transforms/contextTypes.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { contextTypesTransform } from '../../../src/migrations/v1-to-v2/transforms/contextTypes';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { expressMiddlewareTransform } from '../../../src/migrations/v1-to-v2/transforms/expressMiddleware.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { expressMiddlewareTransform } from '../../../src/migrations/v1-to-v2/transforms/expressMiddleware';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { handlerRegistrationTransform } from '../../../src/migrations/v1-to-v2/transforms/handlerRegistration.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { handlerRegistrationTransform } from '../../../src/migrations/v1-to-v2/transforms/handlerRegistration';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { importPathsTransform } from '../../../src/migrations/v1-to-v2/transforms/importPaths.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { importPathsTransform } from '../../../src/migrations/v1-to-v2/transforms/importPaths';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
function applyTransform(code: string, context: TransformContext = { projectType: 'both' }): string {
|
||||
const project = new Project({ useInMemoryFileSystem: true });
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { mcpServerApiTransform } from '../../../src/migrations/v1-to-v2/transforms/mcpServerApi.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { mcpServerApiTransform } from '../../../src/migrations/v1-to-v2/transforms/mcpServerApi';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
const MCP_IMPORT = `import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n`;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { mockPathsTransform } from '../../../src/migrations/v1-to-v2/transforms/mockPaths.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { mockPathsTransform } from '../../../src/migrations/v1-to-v2/transforms/mockPaths';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { removedApisTransform } from '../../../src/migrations/v1-to-v2/transforms/removedApis.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { DiagnosticLevel } from '../../../src/types.js';
|
||||
import { removedApisTransform } from '../../../src/migrations/v1-to-v2/transforms/removedApis';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
import { DiagnosticLevel } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { schemaParamRemovalTransform } from '../../../src/migrations/v1-to-v2/transforms/schemaParamRemoval.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { schemaParamRemovalTransform } from '../../../src/migrations/v1-to-v2/transforms/schemaParamRemoval';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'client' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { specSchemaAccessTransform } from '../../../src/migrations/v1-to-v2/transforms/specSchemaAccess.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { specSchemaAccessTransform } from '../../../src/migrations/v1-to-v2/transforms/specSchemaAccess';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { Project } from 'ts-morph';
|
||||
|
||||
import { symbolRenamesTransform } from '../../../src/migrations/v1-to-v2/transforms/symbolRenames.js';
|
||||
import type { TransformContext } from '../../../src/types.js';
|
||||
import { symbolRenamesTransform } from '../../../src/migrations/v1-to-v2/transforms/symbolRenames';
|
||||
import type { TransformContext } from '../../../src/types';
|
||||
|
||||
const ctx: TransformContext = { projectType: 'server' };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue