Skip to content

Commit

Permalink
Update vite configuration files to use module extension
Browse files Browse the repository at this point in the history
  • Loading branch information
timkendrick committed Mar 19, 2024
1 parent 771a157 commit f86a5ae
Show file tree
Hide file tree
Showing 40 changed files with 113 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules/
/packages/*/node_modules/
/packages/*/vitest.config.mts.timestamp-*.mjs
/coverage/
/docs/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test": "vitest run",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage",
"coverage:report": "vitest run --coverage --config ./report.vitest.config.ts",
"coverage:report": "vitest run --coverage --config ./report.vitest.config.mts",
"clean": "rm -rf docs coverages packages/*/dist",
"version": "pnpm --filter @ag-grid-community/cli exec -- pnpm run --silent version",
"publish": "pnpm run --filter @ag-grid-community/cli publish"
Expand Down
2 changes: 1 addition & 1 deletion packages/ast/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": ["src", "lib.ts", "lib.test.ts", "*.config.ts", "package.json"]
"include": ["src", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config';
import base from './vite.config.mts';

export default mergeConfig(
base,
Expand Down
2 changes: 1 addition & 1 deletion packages/build-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lint": "eslint --ext js,cjs,mjs,ts ."
},
"dependencies": {
"@types/node": "20.5.9",
"@types/node": "20.11.29",
"@types/react": "18.2.21",
"@typescript-eslint/eslint-plugin": "6.6.0",
"@typescript-eslint/parser": "6.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/build-config/templates/vite/lib.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default mergeConfig(
defineConfig({
plugins: [
dts({
exclude: ['node_modules/**', '*.config.ts', '**/*.test.ts'],
exclude: ['node_modules/**', '*.config.mts', '**/*.test.ts'],
}),
],
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from '../codemods/vite.config';
import base from '../codemods/vite.config.mts';

import pkg from '../codemods/package.json' assert { type: 'json' };

Expand Down
4 changes: 3 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build:readme": "cp README.md dist/README.md",
"build:pkg": "pnpm run --filter build-tools pkg $PWD $PWD/dist/package.json",
"build:codemods": "pnpm run build:codemods:lib && pnpm run build:codemods:pkg",
"build:codemods:lib": "vite build --config codemods.vite.config.js",
"build:codemods:lib": "vite build --config codemods.vite.config.mts",
"build:codemods:pkg": "pnpm run --filter build-tools pkg $PWD/../codemods $PWD/dist/node_modules/@ag-grid-community/codemods/package.json",
"lint": "pnpm run '/^lint:.*/'",
"lint:eslint": "eslint --ext js,cjs,mjs,ts .",
Expand All @@ -43,11 +43,13 @@
},
"devDependencies": {
"@ag-grid-devtools/build-config": "workspace:*",
"@ag-grid-devtools/codemod-utils": "workspace:*",
"@ag-grid-devtools/types": "workspace:*",
"@ag-grid-devtools/utils": "workspace:*",
"@ag-grid-devtools/worker-utils": "workspace:*",
"@types/diff": "5.0.8",
"@types/graceful-fs": "4.1.9",
"@types/node": "20.11.29",
"@types/semver": "7.5.6",
"diff": "5.1.0",
"graceful-fs": "4.2.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/migrate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import codemods from '@ag-grid-community/codemods';
import { createCodemodTask } from '@ag-grid-devtools/codemod-utils';
import {
Codemod,
CodemodTaskInput,
Expand All @@ -22,7 +23,6 @@ import { getCliCommand } from '../utils/pkg';
import { green, indentErrorMessage, log } from '../utils/stdio';
import { Worker, WorkerTaskQueue } from '../utils/worker';
import { requireDynamicModule, resolveDynamicModule } from '../utils/module';
import { createCodemodTask } from '../../../codemod-utils/src/taskHelpers';

const { versions } = codemods;

Expand Down
8 changes: 1 addition & 7 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": [
"src",
"index.ts",
"*.config.ts",
"package.json",
"../codemod-utils/src/taskHelpers.ts"
]
"include": ["src", "index.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config';
import base from './vite.config.mts';

export default mergeConfig(
base,
Expand Down
10 changes: 1 addition & 9 deletions packages/codemod-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": [
"src",
"lib.ts",
"lib.test.ts",
"*.config.ts",
"package.json",
"lib.test.ts",
"lib.ts"
]
"include": ["src", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config';
import base from './vite.config.mts';

export default mergeConfig(
base,
Expand Down
2 changes: 1 addition & 1 deletion packages/codemods/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": ["src", "tasks", "lib.ts", "lib.test.ts", "*.config.ts", "package.json"],
"include": ["src", "tasks", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"],
"exclude": ["templates"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';
import { configDefaults } from 'vitest/config';

import base from './vite.config';
import base from './vite.config.mts';

export default mergeConfig(
base,
Expand Down
2 changes: 1 addition & 1 deletion packages/systemjs-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../build-config/templates/tsc/browser.tsconfig.json",
"include": ["src", "index.ts", "*.config.ts", "package.json"]
"include": ["src", "index.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
10 changes: 1 addition & 9 deletions packages/test-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": [
"src",
"lib.ts",
"lib.test.ts",
"*.config.ts",
"package.json",
"lib.test.ts",
"lib.ts"
]
"include": ["src", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config';
import base from './vite.config.mts';

export default mergeConfig(
base,
Expand Down
2 changes: 1 addition & 1 deletion packages/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": ["src", "lib.ts", "*.config.ts", "package.json"]
"include": ["src", "lib.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": ["src", "lib.ts", "lib.test.ts", "*.config.ts", "package.json"]
"include": ["src", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
15 changes: 15 additions & 0 deletions packages/utils/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference types="vitest" />
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config.mts';

export default mergeConfig(
base,
defineConfig({
test: {
root: resolve(__dirname, '..', '..'),
include: [join(__dirname, '**/*.{test,spec}.?(c|m)[jt]s?(x)')],
},
}),
);
15 changes: 0 additions & 15 deletions packages/utils/vitest.config.ts

This file was deleted.

10 changes: 1 addition & 9 deletions packages/worker-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"extends": "../build-config/templates/tsc/tsconfig.json",
"include": [
"src",
"lib.ts",
"lib.test.ts",
"*.config.ts",
"package.json",
"lib.test.ts",
"lib.ts"
]
"include": ["src", "lib.ts", "lib.test.ts", "*.config.mts", "package.json"]
}
File renamed without changes.
15 changes: 15 additions & 0 deletions packages/worker-utils/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference types="vitest" />
import { join, resolve } from 'path';
import { defineConfig, mergeConfig } from 'vite';

import base from './vite.config.mts';

export default mergeConfig(
base,
defineConfig({
test: {
root: resolve(__dirname, '..', '..'),
include: [join(__dirname, '**/*.{test,spec}.?(c|m)[jt]s?(x)')],
},
}),
);
15 changes: 0 additions & 15 deletions packages/worker-utils/vitest.config.ts

This file was deleted.

Loading

0 comments on commit f86a5ae

Please sign in to comment.