Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "2.3.1",
"description": "A React Compiler violation tracker to help migrations and prevent regressions",
"type": "module",
"main": "dist/index.mjs",
"main": "dist/index.js",
"bin": {
"react-compiler-tracker": "dist/index.mjs"
"react-compiler-tracker": "dist/index.js"
},
"scripts": {
"check": "run-p check:* -c -l",
Expand Down Expand Up @@ -44,7 +44,7 @@
"CHANGELOG.md"
],
"lint-staged": {
"*.{js,ts,mjs,mts,json,md}": "biome check --write --no-errors-on-unmatched"
"*.{js,ts,json,md}": "biome check --write --no-errors-on-unmatched"
},
"devDependencies": {
"rimraf": "6.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/args.test.mts → src/args.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest'
import { parseArgs } from './args.mjs'
import { parseArgs } from './args.js'

describe('parseArgs', () => {
it('parses --check-files with files', () => {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/config.test.mts → src/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync } from 'node:fs'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { DEFAULT_CONFIG, loadConfig } from './config.mjs'
import { DEFAULT_CONFIG, loadConfig } from './config.js'

vi.mock('node:fs', () => ({
existsSync: vi.fn(),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const recordsPath = join(fixtureDir, '.react-compiler.rec.json')
const configPath = join(fixtureDir, '.react-compiler-tracker.config.json')

function runCLI(args: string[] = [], cwd = fixtureDir): string {
const cliPath = join(__dirname, 'index.mts')
const cliPath = join(__dirname, 'index.ts')
try {
return execSync(`npx tsx ${cliPath} ${args.join(' ')} 2>&1`, {
cwd,
Expand Down
14 changes: 7 additions & 7 deletions src/index.mts → src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { join, relative } from 'node:path'
import type { Logger as ReactCompilerLogger } from 'babel-plugin-react-compiler'
import { parseArgs } from './args.mjs'
import * as babel from './babel.mjs'
import { loadConfig } from './config.mjs'
import type { FileErrors } from './records-file.mjs'
import * as recordsFile from './records-file.mjs'
import * as sourceFiles from './source-files.mjs'
import { pluralize } from './utils.mjs'
import { parseArgs } from './args.js'
import * as babel from './babel.js'
import { loadConfig } from './config.js'
import type { FileErrors } from './records-file.js'
import * as recordsFile from './records-file.js'
import * as sourceFiles from './source-files.js'
import { pluralize } from './utils.js'

const compilerErrors: Map<string, FileErrors> = new Map()

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/records-file.test.mts → src/records-file.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { getErrorChanges, load, save } from './records-file.mjs'
import { getErrorChanges, load, save } from './records-file.js'

vi.mock('node:fs', () => ({
existsSync: vi.fn(),
readFileSync: vi.fn(),
writeFileSync: vi.fn(),
}))

vi.mock('./react-compiler.mjs', () => ({
vi.mock('./react-compiler.js', () => ({
getVersion: vi.fn(() => '1.0.0'),
}))

Expand Down
2 changes: 1 addition & 1 deletion src/records-file.mts → src/records-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { execSync } from 'node:child_process'
import { existsSync, readFileSync, writeFileSync } from 'node:fs'

import * as reactCompiler from './react-compiler.mjs'
import * as reactCompiler from './react-compiler.js'

const RECORD_VERSION = 1

Expand Down
2 changes: 1 addition & 1 deletion src/source-files.test.mts → src/source-files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
normalizeFilePaths,
partitionByExistence,
validateFilesExist,
} from './source-files.mjs'
} from './source-files.js'

vi.mock('node:child_process', () => ({
execSync: vi.fn(),
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
include: ['src/**/*.test.{ts,mts}'],
include: ['src/**/*.test.ts'],
},
server: {
watch: {
Expand Down