Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from 'oxfmt';

export default defineConfig({
printWidth: 100,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'oxlint';

export default defineConfig({
rules: {
eqeqeq: 'error',
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "migration-dynamic-oxc-configs",
"scripts": {
"lint": "oxlint",
"format": "oxfmt --write"
},
"devDependencies": {
"oxfmt": "^0.1.0",
"oxlint": "^1.0.0",
"vite": "^7.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[case]]
name = "migration_dynamic_oxc_configs"
vp = "global"
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "migration should import dynamic Oxc configs into Vite+", continue-on-failure = true },
{ argv = ["vpt", "print-file", "oxlint.config.ts"], comment = "check oxlint config and helper import", continue-on-failure = true },
{ argv = ["vpt", "print-file", "oxfmt.config.mts"], comment = "check oxfmt config and helper import", continue-on-failure = true },
{ argv = ["vpt", "print-file", "vite.config.ts"], comment = "check dynamic configs imported into vite config", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "check bundled Oxc dependencies removed", continue-on-failure = true },
{ argv = ["vp", "migrate", "--no-interactive"], comment = "run migration again to check idempotency", continue-on-failure = true },
{ argv = ["vpt", "print-file", "vite.config.ts"], comment = "check vite config remains unchanged", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# migration_dynamic_oxc_configs

## `vp migrate --no-interactive`

migration should import dynamic Oxc configs into Vite+

```
VITE+ - The Unified Toolchain for the Web

◇ Migrated . to Vite+ <version>
• Node <version> pnpm <version>
• 4 config updates applied, 2 files had imports rewritten
```

## `vpt print-file oxlint.config.ts`

check oxlint config and helper import

```
import { defineConfig } from 'vite-plus/lint';

export default defineConfig({
rules: {
eqeqeq: 'error',
},
});
```

## `vpt print-file oxfmt.config.mts`

check oxfmt config and helper import

```
import { defineConfig } from 'vite-plus/fmt';

export default defineConfig({
printWidth: 100,
});
```

## `vpt print-file vite.config.ts`

check dynamic configs imported into vite config

```
import oxfmtConfig from './oxfmt.config.mjs';

import oxlintConfig from './oxlint.config.js';

import { defineConfig } from 'vite-plus';

export default defineConfig({
staged: {
"*": "vp check --fix"
},
fmt: oxfmtConfig,
lint: oxlintConfig,
});
```

## `vpt print-file package.json`

check bundled Oxc dependencies removed

```
{
"name": "migration-dynamic-oxc-configs",
"scripts": {
"lint": "vp lint",
"format": "vp fmt --write",
"prepare": "vp config"
},
"devDependencies": {
"vite": "catalog:",
"vite-plus": "catalog:"
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "<version>",
"onFail": "download"
}
}
}
```

## `vp migrate --no-interactive`

run migration again to check idempotency

```
VITE+ - The Unified Toolchain for the Web

This project is already using Vite+! Happy coding!
```

## `vpt print-file vite.config.ts`

check vite config remains unchanged

```
import oxfmtConfig from './oxfmt.config.mjs';

import oxlintConfig from './oxlint.config.js';

import { defineConfig } from 'vite-plus';

export default defineConfig({
staged: {
"*": "vp check --fix"
},
fmt: oxfmtConfig,
lint: oxlintConfig,
});
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-console": "error"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'oxlint';

export default defineConfig({
rules: {
eqeqeq: 'error',
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "migration-oxc-config-conflict",
"scripts": {
"lint": "oxlint"
},
"devDependencies": {
"oxlint": "^1.0.0",
"vite": "^7.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[case]]
name = "migration_oxc_config_conflict"
vp = "global"
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "migration should refuse to start on conflicting Oxc configs", continue-on-failure = true },
{ argv = ["vpt", "stat-file", ".oxlintrc.json", "--assert", "file"], comment = "both configs left untouched by the interrupt", continue-on-failure = true },
{ argv = ["vpt", "stat-file", "oxlint.config.ts", "--assert", "file"], continue-on-failure = true },
{ argv = ["vpt", "stat-file", "vite.config.ts", "--assert", "missing"], comment = "no file was written before the interrupt", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "package.json unchanged", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# migration_oxc_config_conflict

## `vp migrate --no-interactive`

migration should refuse to start on conflicting Oxc configs

**Exit code:** 1

```
VITE+ - The Unified Toolchain for the Web

✘ Conflicting Oxc configs:
- the project root has `.oxlintrc.json` and `oxlint.config.ts` — oxlint allows only one config per directory.
Keep a single config per directory, then run `vp migrate` again.
```

## `vpt stat-file .oxlintrc.json --assert file`

both configs left untouched by the interrupt

```
.oxlintrc.json: file
```

## `vpt stat-file oxlint.config.ts --assert file`

```
oxlint.config.ts: file
```

## `vpt stat-file vite.config.ts --assert missing`

no file was written before the interrupt

```
vite.config.ts: missing
```

## `vpt print-file package.json`

package.json unchanged

```
{
"name": "migration-oxc-config-conflict",
"scripts": {
"lint": "oxlint"
},
"devDependencies": {
"oxlint": "^1.0.0",
"vite": "^7.0.0"
}
}
```
Loading
Loading