vite-plus 0.3.3 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +35 -146
- package/README.md +6 -4
- package/binding/index.cjs +58 -54
- package/binding/index.d.cts +36 -4
- package/dist/{agent-Cu6-tXIP.js → agent-DIwEez_1.js} +6 -5
- package/dist/bin.js +75 -35
- package/dist/config/bin.js +3 -3
- package/dist/constants-BAsBfS1J.js +356 -0
- package/dist/create/bin.js +19 -13
- package/dist/{define-config-IgzmnvvV.js → define-config-Bz6dc3fm.js} +165 -43
- package/dist/{define-config-D0mevyb3.cjs → define-config-CAeeMTvb.cjs} +179 -44
- package/dist/{define-config-DPNEJxPz.d.ts → define-config-Cf_5GHmY.d.ts} +71 -25
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/dist-BWiANxFS.js +8052 -0
- package/dist/{dist-BDYZP12R.js → dist-BsAzy8OW.js} +109 -105
- package/dist/documentation-DqcZSthV.js +11 -0
- package/dist/{editor-4sjlHmUh.js → editor-DWgrWTbN.js} +246 -159
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +3127 -18
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BVqEe9KY.js → oxlint-plugin-config-B-P1a_0g.js} +1 -1
- package/dist/oxlint-plugin.js +9 -7
- package/dist/pack-bin.js +1 -1
- package/dist/{package-CHH8jWan.js → package-BrupPpWA.js} +6 -2
- package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
- package/dist/{prompts-k14KgthC.js → prompts-BW7_fDGJ.js} +3 -4
- package/dist/{report-CK5TnTsr.js → report-NhQk8VHb.js} +1 -0
- package/dist/{resolve-vite-config-CTOTuqTi.js → resolve-vite-config-D3XIVT6s.js} +1 -1
- package/dist/{resolve-vite-config-BqvS2P98.js → resolve-vite-config-DcsMQaYy.js} +2 -2
- package/dist/staged/bin.js +1206 -3318
- package/dist/sync-versions/bin.js +4 -4
- package/dist/sync-versions/bin.mjs +17 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.js +1 -1
- package/dist/test/browser/providers/preview/context.js +1 -1
- package/dist/test/browser-playwright/context.js +1 -1
- package/dist/test/browser-preview/context.js +1 -1
- package/dist/test/context.d.ts +2 -942
- package/dist/test/context.js +1 -1
- package/dist/test/internal/traces.js +1 -0
- package/dist/test/locators.d.ts +2 -294
- package/dist/test/matchers.d.ts +2 -29
- package/dist/test/mocker.d.ts +2 -0
- package/dist/test/mocker.js +1 -0
- package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.d.ts +2 -0
- package/dist/test/plugins/browser-playwright.d.ts +2 -0
- package/dist/test/plugins/browser-preview.d.ts +2 -0
- package/dist/test/plugins/browser.d.ts +2 -0
- package/dist/test/plugins/mocker-automock.d.ts +2 -0
- package/dist/test/plugins/mocker-browser.d.ts +2 -0
- package/dist/test/plugins/mocker-node.d.ts +2 -0
- package/dist/test/plugins/mocker-redirect.d.ts +2 -0
- package/dist/test/plugins/mocker-register.d.ts +2 -0
- package/dist/test/plugins/mocker-transforms.d.ts +2 -0
- package/dist/test/plugins/mocker.d.ts +2 -0
- package/dist/test/plugins/pretty-format.d.ts +2 -0
- package/dist/test/plugins/snapshot-environment.d.ts +2 -0
- package/dist/test/plugins/snapshot-manager.d.ts +2 -0
- package/dist/test/plugins/snapshot.d.ts +2 -0
- package/dist/test/plugins/spy.d.ts +2 -0
- package/dist/test/plugins/utils-constants.d.ts +2 -0
- package/dist/test/plugins/utils-diff.d.ts +2 -0
- package/dist/test/plugins/utils-display.d.ts +2 -0
- package/dist/test/plugins/utils-error.d.ts +2 -0
- package/dist/test/plugins/utils-helpers.d.ts +2 -0
- package/dist/test/plugins/utils-offset.d.ts +2 -0
- package/dist/test/plugins/utils-resolver.d.ts +2 -0
- package/dist/test/plugins/utils-serialize.d.ts +2 -0
- package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
- package/dist/test/plugins/utils-source-map.d.ts +2 -0
- package/dist/test/plugins/utils-timers.d.ts +2 -0
- package/dist/test/plugins/utils.d.ts +2 -0
- package/dist/toolchain.js +11 -11
- package/dist/toolchain.json +11 -11
- package/dist/{tsconfig-euB-GmIE.js → tsconfig-DESFDzWP.js} +1 -1
- package/dist/{tsconfig-C3h9CVTA.js → tsconfig-piorpNV7.js} +8 -4
- package/dist/version.js +5 -3
- package/dist/versions.js +6 -6
- package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
- package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
- package/docs/config/fmt.md +4 -2
- package/docs/config/lint.md +4 -2
- package/docs/config/run.md +62 -26
- package/docs/guide/automatic-data-tracking.md +20 -15
- package/docs/guide/cache.md +12 -8
- package/docs/guide/check.md +2 -0
- package/docs/guide/commit-hooks.md +8 -1
- package/docs/guide/env.md +18 -13
- package/docs/guide/fmt.md +6 -2
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +1 -1
- package/docs/guide/lint.md +5 -1
- package/docs/guide/local-cli.md +3 -3
- package/docs/guide/migrate-rules.md +58 -12
- package/docs/guide/migrate.md +86 -20
- package/docs/guide/monorepo.md +7 -1
- package/docs/guide/run.md +3 -1
- package/docs/guide/test.md +2 -0
- package/docs/guide/troubleshooting.md +3 -3
- package/docs/guide/vitest-v5.md +221 -0
- package/package.json +64 -87
- package/bin/oxfmt +0 -33
- package/bin/oxlint +0 -38
- package/dist/cli-truncate-Bg3RDXpi.js +0 -865
- package/dist/constants-C2dTOTe-.js +0 -80
- package/dist/dist-Dqv1-Clg.js +0 -3
- package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
- package/dist/log-update-CoW8Z4Dl.js +0 -491
- package/dist/semver-CaDAb8vV.js +0 -1400
- package/dist/strip-ansi-C3wrWz9t.js +0 -853
- package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
- package/dist/test/browser/providers/webdriverio/context.js +0 -1
- package/dist/test/browser/providers/webdriverio.d.ts +0 -77
- package/dist/test/browser/providers/webdriverio.js +0 -1
- package/dist/test/browser-webdriverio/context.d.ts +0 -1
- package/dist/test/browser-webdriverio.d.ts +0 -77
- package/dist/test/browser-webdriverio.js +0 -1
- package/dist/test/coverage.d.ts +0 -2
- package/dist/test/coverage.js +0 -1
- package/dist/test/environments.d.ts +0 -2
- package/dist/test/environments.js +0 -1
- package/dist/test/plugins/browser-webdriverio.js +0 -1
- package/dist/test/plugins/expect.js +0 -1
- package/dist/test/plugins/runner-types.js +0 -1
- package/dist/test/plugins/runner-utils.js +0 -1
- package/dist/test/plugins/runner.js +0 -1
- package/dist/test/reporters.d.ts +0 -2
- package/dist/test/reporters.js +0 -1
- package/dist/test/runners.d.ts +0 -2
- package/dist/test/runners.js +0 -1
- package/dist/test/snapshot.d.ts +0 -2
- package/dist/test/snapshot.js +0 -1
- package/dist/test/suite.d.ts +0 -2
- package/dist/test/suite.js +0 -1
- package/dist/tsgolint-path-CbDReEOx.js +0 -34
- package/dist/tsgolint-path.d.ts +0 -7
- package/dist/tsgolint-path.js +0 -2
- package/dist/wrap-ansi-DNjkuBEp.js +0 -157
- package/dist/wrap-ansi-DUi52C6W.js +0 -2
package/dist/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { t as documentationUrl$1 } from "./documentation-DqcZSthV.js";
|
|
1
2
|
import { t as renderCliDoc } from "./help-BmKpeOP9.js";
|
|
2
3
|
import { c as warnMsg, i as log, n as errorMsg, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-
|
|
4
|
-
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
5
|
-
import {
|
|
6
|
-
import { a as readNearestPackageJson } from "./package-CHH8jWan.js";
|
|
4
|
+
import { g as resolveBundled, h as resolve$1, i as DEFAULT_ENVS, l as VITE_CONFIG_FILES, n as BASEURL_TSCONFIG_WARNING, r as CONFIG_METADATA_ENV, u as VITE_PLUS_NAME } from "./constants-BAsBfS1J.js";
|
|
5
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-B-P1a_0g.js";
|
|
6
|
+
import { a as readNearestPackageJson } from "./package-BrupPpWA.js";
|
|
7
7
|
import { t as cac } from "./dist-DfmT__Aw.js";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import path, { dirname, join, resolve } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { ensureBlockingStdio, hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
12
|
-
import fs, { existsSync, readFileSync } from "node:fs";
|
|
12
|
+
import fs, { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
13
13
|
//#region src/help.ts
|
|
14
14
|
const commandHelpDocs = {
|
|
15
15
|
dev: {
|
|
@@ -93,7 +93,7 @@ const commandHelpDocs = {
|
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
|
-
documentationUrl: "
|
|
96
|
+
documentationUrl: documentationUrl$1("/guide/dev")
|
|
97
97
|
},
|
|
98
98
|
build: {
|
|
99
99
|
usage: "vp build [ROOT] [OPTIONS]",
|
|
@@ -196,7 +196,7 @@ const commandHelpDocs = {
|
|
|
196
196
|
]
|
|
197
197
|
}
|
|
198
198
|
],
|
|
199
|
-
documentationUrl: "
|
|
199
|
+
documentationUrl: documentationUrl$1("/guide/build")
|
|
200
200
|
},
|
|
201
201
|
preview: {
|
|
202
202
|
usage: "vp preview [ROOT] [OPTIONS]",
|
|
@@ -267,7 +267,7 @@ const commandHelpDocs = {
|
|
|
267
267
|
lines: [" vp preview", " vp preview --port 4173"]
|
|
268
268
|
}
|
|
269
269
|
],
|
|
270
|
-
documentationUrl: "
|
|
270
|
+
documentationUrl: documentationUrl$1("/guide/build")
|
|
271
271
|
},
|
|
272
272
|
test: {
|
|
273
273
|
usage: "vp test [COMMAND] [FILTERS]... [OPTIONS]",
|
|
@@ -342,7 +342,7 @@ const commandHelpDocs = {
|
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
344
|
label: "--api [port]",
|
|
345
|
-
description: "Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. If true will be set to 51204. Use '--help --api' for more info."
|
|
345
|
+
description: "Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. If true will be set to 51204 or 63315 in browser mode. Use '--help --api' for more info."
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
label: "--silent [value]",
|
|
@@ -366,7 +366,7 @@ const commandHelpDocs = {
|
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
label: "--mode <name>",
|
|
369
|
-
description: "Override Vite mode (default: test
|
|
369
|
+
description: "Override Vite mode (default: test)"
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
label: "--isolate",
|
|
@@ -376,6 +376,10 @@ const commandHelpDocs = {
|
|
|
376
376
|
label: "--globals",
|
|
377
377
|
description: "Inject apis globally"
|
|
378
378
|
},
|
|
379
|
+
{
|
|
380
|
+
label: "--injectCjsGlobals",
|
|
381
|
+
description: "Inject CommonJS variables (module, exports, require, __filename, __dirname) into every test module. To disable, use --no-inject-cjs-globals (default: true)"
|
|
382
|
+
},
|
|
379
383
|
{
|
|
380
384
|
label: "--dom",
|
|
381
385
|
description: "Mock browser API with happy-dom"
|
|
@@ -464,6 +468,10 @@ const commandHelpDocs = {
|
|
|
464
468
|
label: "--retry <times>",
|
|
465
469
|
description: "Retry the test specific number of times if it fails (default: 0). Use '--help --retry' for more info."
|
|
466
470
|
},
|
|
471
|
+
{
|
|
472
|
+
label: "--repeats <number>",
|
|
473
|
+
description: "Repeat every test a specific number of times regardless of the result (default: 0)"
|
|
474
|
+
},
|
|
467
475
|
{
|
|
468
476
|
label: "--diff <path>",
|
|
469
477
|
description: "DiffOptions object or a path to a module which exports DiffOptions object. Use '--help --diff' for more info."
|
|
@@ -485,8 +493,8 @@ const commandHelpDocs = {
|
|
|
485
493
|
description: "Enable typechecking alongside tests (default: false). Use '--help --typecheck' for more info."
|
|
486
494
|
},
|
|
487
495
|
{
|
|
488
|
-
label: "--project <name>",
|
|
489
|
-
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2. You can also filter projects using wildcards like --project=packages*, and exclude projects with --project=!pattern."
|
|
496
|
+
label: "-p, --project <name>",
|
|
497
|
+
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2. You can also filter projects using wildcards like --project=packages*, and exclude projects with --project=!pattern. A project runs if it matches no negated pattern and, when regular patterns are also given, matches at least one of them."
|
|
490
498
|
},
|
|
491
499
|
{
|
|
492
500
|
label: "--slowTestThreshold <threshold>",
|
|
@@ -504,6 +512,14 @@ const commandHelpDocs = {
|
|
|
504
512
|
label: "--maxConcurrency <number>",
|
|
505
513
|
description: "Maximum number of concurrent tests and suites during test file execution (default: 5)"
|
|
506
514
|
},
|
|
515
|
+
{
|
|
516
|
+
label: "--fsModuleCache",
|
|
517
|
+
description: "Cache transformed modules on the file system and reuse them between reruns (default: false)"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
label: "--fsModuleCachePath <path>",
|
|
521
|
+
description: "Directory where the fsModuleCache is stored (default: node_modules/.vitest-cache)"
|
|
522
|
+
},
|
|
507
523
|
{
|
|
508
524
|
label: "--expect",
|
|
509
525
|
description: "Configuration options for expect() matches. Use '--help --expect' for more info."
|
|
@@ -518,7 +534,7 @@ const commandHelpDocs = {
|
|
|
518
534
|
},
|
|
519
535
|
{
|
|
520
536
|
label: "--attachmentsDir <dir>",
|
|
521
|
-
description: "The directory where attachments from context.annotate are stored in (default: .vitest
|
|
537
|
+
description: "The directory where attachments from context.annotate are stored in (default: .vitest/attachments)"
|
|
522
538
|
},
|
|
523
539
|
{
|
|
524
540
|
label: "--run",
|
|
@@ -546,7 +562,7 @@ const commandHelpDocs = {
|
|
|
546
562
|
},
|
|
547
563
|
{
|
|
548
564
|
label: "--clearCache",
|
|
549
|
-
description: "Delete all Vitest caches, including
|
|
565
|
+
description: "Delete all Vitest caches, including the fsModuleCache, without running any tests. This will reduce the performance in the subsequent test run."
|
|
550
566
|
},
|
|
551
567
|
{
|
|
552
568
|
label: "--tagsFilter <expression>",
|
|
@@ -556,6 +572,10 @@ const commandHelpDocs = {
|
|
|
556
572
|
label: "--strictTags",
|
|
557
573
|
description: "Should Vitest throw an error if test has a tag that is not defined in the config. (default: true)"
|
|
558
574
|
},
|
|
575
|
+
{
|
|
576
|
+
label: "--sharedViteServer",
|
|
577
|
+
description: "Let inline projects that don't modify the Vite config reuse the Vite server of the config that declares them. (default: true)"
|
|
578
|
+
},
|
|
559
579
|
{
|
|
560
580
|
label: "--experimental <features>",
|
|
561
581
|
description: "Experimental features.. Use '--help --experimental' for more info."
|
|
@@ -566,16 +586,6 @@ const commandHelpDocs = {
|
|
|
566
586
|
}
|
|
567
587
|
]
|
|
568
588
|
},
|
|
569
|
-
{
|
|
570
|
-
title: "Bench Options",
|
|
571
|
-
rows: [{
|
|
572
|
-
label: "--compare <filename>",
|
|
573
|
-
description: "Benchmark output file to compare against"
|
|
574
|
-
}, {
|
|
575
|
-
label: "--outputJson <filename>",
|
|
576
|
-
description: "Benchmark output file"
|
|
577
|
-
}]
|
|
578
|
-
},
|
|
579
589
|
{
|
|
580
590
|
title: "List Options",
|
|
581
591
|
rows: [
|
|
@@ -589,7 +599,7 @@ const commandHelpDocs = {
|
|
|
589
599
|
},
|
|
590
600
|
{
|
|
591
601
|
label: "--staticParse",
|
|
592
|
-
description: "Parse files statically instead of running them to collect tests (default:
|
|
602
|
+
description: "Parse files statically instead of running them to collect tests (default: true)"
|
|
593
603
|
},
|
|
594
604
|
{
|
|
595
605
|
label: "--staticParseConcurrency <limit>",
|
|
@@ -606,7 +616,7 @@ const commandHelpDocs = {
|
|
|
606
616
|
]
|
|
607
617
|
}
|
|
608
618
|
],
|
|
609
|
-
documentationUrl: "
|
|
619
|
+
documentationUrl: documentationUrl$1("/guide/test")
|
|
610
620
|
},
|
|
611
621
|
lint: {
|
|
612
622
|
usage: "vp lint [PATH]... [OPTIONS]",
|
|
@@ -843,7 +853,7 @@ const commandHelpDocs = {
|
|
|
843
853
|
]
|
|
844
854
|
}
|
|
845
855
|
],
|
|
846
|
-
documentationUrl: "
|
|
856
|
+
documentationUrl: documentationUrl$1("/guide/lint")
|
|
847
857
|
},
|
|
848
858
|
fmt: {
|
|
849
859
|
usage: "vp fmt [PATH]... [OPTIONS]",
|
|
@@ -916,7 +926,7 @@ const commandHelpDocs = {
|
|
|
916
926
|
]
|
|
917
927
|
}
|
|
918
928
|
],
|
|
919
|
-
documentationUrl: "
|
|
929
|
+
documentationUrl: documentationUrl$1("/guide/fmt")
|
|
920
930
|
},
|
|
921
931
|
check: {
|
|
922
932
|
usage: "vp check [OPTIONS] [PATHS]...",
|
|
@@ -967,7 +977,7 @@ const commandHelpDocs = {
|
|
|
967
977
|
]
|
|
968
978
|
}
|
|
969
979
|
],
|
|
970
|
-
documentationUrl: "
|
|
980
|
+
documentationUrl: documentationUrl$1("/guide/check")
|
|
971
981
|
},
|
|
972
982
|
pack: {
|
|
973
983
|
usage: "vp pack [...files] [OPTIONS]",
|
|
@@ -1146,7 +1156,7 @@ const commandHelpDocs = {
|
|
|
1146
1156
|
]
|
|
1147
1157
|
}
|
|
1148
1158
|
],
|
|
1149
|
-
documentationUrl: "
|
|
1159
|
+
documentationUrl: documentationUrl$1("/guide/pack")
|
|
1150
1160
|
},
|
|
1151
1161
|
run: {
|
|
1152
1162
|
usage: "vp run [OPTIONS] [TASK_SPECIFIER] [ADDITIONAL_ARGS]...",
|
|
@@ -1236,7 +1246,7 @@ const commandHelpDocs = {
|
|
|
1236
1246
|
]
|
|
1237
1247
|
}
|
|
1238
1248
|
],
|
|
1239
|
-
documentationUrl: "
|
|
1249
|
+
documentationUrl: documentationUrl$1("/guide/run")
|
|
1240
1250
|
},
|
|
1241
1251
|
exec: {
|
|
1242
1252
|
usage: "vp exec [OPTIONS] [COMMAND]...",
|
|
@@ -1321,7 +1331,7 @@ const commandHelpDocs = {
|
|
|
1321
1331
|
]
|
|
1322
1332
|
}
|
|
1323
1333
|
],
|
|
1324
|
-
documentationUrl: "
|
|
1334
|
+
documentationUrl: documentationUrl$1("/guide/vpx")
|
|
1325
1335
|
},
|
|
1326
1336
|
cache: {
|
|
1327
1337
|
usage: "vp cache <COMMAND>",
|
|
@@ -1339,7 +1349,7 @@ const commandHelpDocs = {
|
|
|
1339
1349
|
description: "Print help"
|
|
1340
1350
|
}]
|
|
1341
1351
|
}],
|
|
1342
|
-
documentationUrl: "
|
|
1352
|
+
documentationUrl: documentationUrl$1("/guide/cache")
|
|
1343
1353
|
}
|
|
1344
1354
|
};
|
|
1345
1355
|
function maybePrintCommandHelp(args) {
|
|
@@ -1517,7 +1527,7 @@ async function applyToolInitConfigToViteConfig(command, args, projectPath = proc
|
|
|
1517
1527
|
}
|
|
1518
1528
|
if (spec.configKey === "lint" && hasTriggerFlag(args, ["--init"])) {
|
|
1519
1529
|
const lintInitConfigPath = path.join(projectPath, ".vite-plus-lint-init.oxlintrc.json");
|
|
1520
|
-
const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-
|
|
1530
|
+
const { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig } = await import("./tsconfig-DESFDzWP.js");
|
|
1521
1531
|
await fixBaseUrlInTsconfig(projectPath);
|
|
1522
1532
|
const hasBaseUrl = hasBaseUrlInTsconfig(projectPath);
|
|
1523
1533
|
const initConfig = createDefaultVitePlusLintConfig({ includeTypeAwareDefaults: !hasBaseUrl });
|
|
@@ -1582,6 +1592,36 @@ async function doc() {
|
|
|
1582
1592
|
};
|
|
1583
1593
|
}
|
|
1584
1594
|
//#endregion
|
|
1595
|
+
//#region src/utils/tsgolint-path.ts
|
|
1596
|
+
function resolveWindowsTsgolintExecutable(pathCandidates, options) {
|
|
1597
|
+
let oxlintTsgolintPath = pathCandidates.find((p) => options.exists(p)) ?? "";
|
|
1598
|
+
if (!oxlintTsgolintPath && options.getRealpathCandidates) try {
|
|
1599
|
+
oxlintTsgolintPath = options.getRealpathCandidates().find((p) => options.exists(p)) ?? "";
|
|
1600
|
+
} catch {}
|
|
1601
|
+
if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, tried:\n" + pathCandidates.map((path) => `- ${path}`).join("\n"));
|
|
1602
|
+
return oxlintTsgolintPath;
|
|
1603
|
+
}
|
|
1604
|
+
function resolveTsgolintExecutable(tsgolintBinPath, scriptUrl) {
|
|
1605
|
+
if (process.platform !== "win32") return tsgolintBinPath;
|
|
1606
|
+
const scriptDir = dirname(fileURLToPath(scriptUrl));
|
|
1607
|
+
const localBinDir = join(scriptDir, "..", "node_modules", ".bin");
|
|
1608
|
+
const oxlintTsgolintPackagePath = dirname(dirname(tsgolintBinPath));
|
|
1609
|
+
const projectBinDir = join(oxlintTsgolintPackagePath, "..", ".bin");
|
|
1610
|
+
return resolveWindowsTsgolintExecutable([
|
|
1611
|
+
join(localBinDir, "tsgolint.exe"),
|
|
1612
|
+
join(localBinDir, "tsgolint.cmd"),
|
|
1613
|
+
join(projectBinDir, "tsgolint.exe"),
|
|
1614
|
+
join(projectBinDir, "tsgolint.cmd")
|
|
1615
|
+
], {
|
|
1616
|
+
exists: existsSync,
|
|
1617
|
+
getRealpathCandidates: () => {
|
|
1618
|
+
const realPkgDir = realpathSync(join(scriptDir, ".."));
|
|
1619
|
+
const realBinDir = join(dirname(realPkgDir), ".bin");
|
|
1620
|
+
return [join(realBinDir, "tsgolint.exe"), join(realBinDir, "tsgolint.cmd")];
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
//#endregion
|
|
1585
1625
|
//#region src/resolve-lint.ts
|
|
1586
1626
|
/**
|
|
1587
1627
|
* Oxlint tool resolver for the vite-plus CLI.
|
|
@@ -1817,7 +1857,7 @@ else if (command === "hooks") await import("./hooks/bin.js");
|
|
|
1817
1857
|
else if (command === "--version" || command === "-V") await import("./version.js");
|
|
1818
1858
|
else if (command === "staged") await import("./staged/bin.js");
|
|
1819
1859
|
else try {
|
|
1820
|
-
const { resolveUniversalViteConfig } = await import("./resolve-vite-config-
|
|
1860
|
+
const { resolveUniversalViteConfig } = await import("./resolve-vite-config-D3XIVT6s.js");
|
|
1821
1861
|
const initInspection = inspectInitCommand(command, args.slice(1));
|
|
1822
1862
|
if (initInspection.handled && initInspection.configKey && initInspection.hasExistingConfigKey && initInspection.existingViteConfigPath) {
|
|
1823
1863
|
log(`Skipped initialization: '${accent(initInspection.configKey)}' already exists in '${accent(path.basename(initInspection.existingViteConfigPath))}'.`);
|
package/dist/config/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as log, n as errorMsg } from "../terminal-MKGAuy-p.js";
|
|
2
|
-
import { i as promptGitHooks, n as defaultInteractive } from "../prompts-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { i as promptGitHooks, n as defaultInteractive } from "../prompts-BW7_fDGJ.js";
|
|
3
|
+
import { t as require_dist } from "../dist-BWiANxFS.js";
|
|
4
|
+
import { o as updateExistingAgentInstructions } from "../agent-DIwEez_1.js";
|
|
5
5
|
import { a as install, c as resolveHooksLocation, o as isGitHooksEnvDisabled, s as isHooksUserDisabled } from "../hooks-C-4gykWR.js";
|
|
6
6
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
7
7
|
import path, { join, relative } from "node:path";
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region package.json
|
|
3
|
+
var version = "1.0.0-rc.1";
|
|
4
|
+
var exports = {
|
|
5
|
+
".": {
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"require": "./dist/index.cjs"
|
|
9
|
+
},
|
|
10
|
+
"./client": { "types": "./dist/client.d.ts" },
|
|
11
|
+
"./module-runner": {
|
|
12
|
+
"types": "./dist/module-runner.d.ts",
|
|
13
|
+
"default": "./dist/module-runner.js"
|
|
14
|
+
},
|
|
15
|
+
"./internal": {
|
|
16
|
+
"types": "./dist/internal.d.ts",
|
|
17
|
+
"default": "./dist/internal.js"
|
|
18
|
+
},
|
|
19
|
+
"./dist/client/*": "./dist/client/*",
|
|
20
|
+
"./types/internal/*": null,
|
|
21
|
+
"./types/*": { "types": "./dist/types/*" },
|
|
22
|
+
"./bin": { "import": "./dist/bin.js" },
|
|
23
|
+
"./fmt": {
|
|
24
|
+
"types": "./dist/fmt.d.ts",
|
|
25
|
+
"import": "./dist/fmt.js"
|
|
26
|
+
},
|
|
27
|
+
"./lint": {
|
|
28
|
+
"types": "./dist/lint.d.ts",
|
|
29
|
+
"import": "./dist/lint.js"
|
|
30
|
+
},
|
|
31
|
+
"./lint/plugins": {
|
|
32
|
+
"types": "./dist/lint-plugins.d.ts",
|
|
33
|
+
"import": "./dist/lint-plugins.js",
|
|
34
|
+
"require": "./dist/lint-plugins.cjs"
|
|
35
|
+
},
|
|
36
|
+
"./lint/plugins-dev": {
|
|
37
|
+
"types": "./dist/lint-plugins-dev.d.ts",
|
|
38
|
+
"default": "./dist/lint-plugins-dev.js"
|
|
39
|
+
},
|
|
40
|
+
"./oxlint-plugin": {
|
|
41
|
+
"module-sync": "./dist/oxlint-plugin.js",
|
|
42
|
+
"node": "./dist/oxlint-plugin.js",
|
|
43
|
+
"import": "./dist/oxlint-plugin.js",
|
|
44
|
+
"default": "./dist/oxlint-plugin.js",
|
|
45
|
+
"types": "./dist/oxlint-plugin.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json",
|
|
48
|
+
"./pack": {
|
|
49
|
+
"types": "./dist/pack.d.ts",
|
|
50
|
+
"import": "./dist/pack.js"
|
|
51
|
+
},
|
|
52
|
+
"./pack/client": { "types": "./dist/pack-client.d.ts" },
|
|
53
|
+
"./toolchain": {
|
|
54
|
+
"types": "./dist/toolchain.d.ts",
|
|
55
|
+
"default": "./dist/toolchain.js"
|
|
56
|
+
},
|
|
57
|
+
"./versions": {
|
|
58
|
+
"types": "./dist/versions.d.ts",
|
|
59
|
+
"default": "./dist/versions.js"
|
|
60
|
+
},
|
|
61
|
+
"./test": {
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./dist/test/index.d.ts",
|
|
64
|
+
"default": "./dist/test/index.js"
|
|
65
|
+
},
|
|
66
|
+
"require": {
|
|
67
|
+
"types": "./dist/test/index.d.cts",
|
|
68
|
+
"default": "./dist/test/index.cjs"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"./test/browser": {
|
|
72
|
+
"types": "./dist/test/browser.d.ts",
|
|
73
|
+
"default": "./dist/test/browser.js"
|
|
74
|
+
},
|
|
75
|
+
"./test/optional-types.js": { "types": "./dist/test/optional-types.js.d.ts" },
|
|
76
|
+
"./test/optional-runtime-types.js": { "types": "./dist/test/optional-runtime-types.js.d.ts" },
|
|
77
|
+
"./test/globals": { "types": "./dist/test/globals.d.ts" },
|
|
78
|
+
"./test/jsdom": { "types": "./dist/test/jsdom.d.ts" },
|
|
79
|
+
"./test/importMeta": { "types": "./dist/test/importMeta.d.ts" },
|
|
80
|
+
"./test/import-meta": { "types": "./dist/test/import-meta.d.ts" },
|
|
81
|
+
"./test/node": {
|
|
82
|
+
"types": "./dist/test/node.d.ts",
|
|
83
|
+
"default": "./dist/test/node.js"
|
|
84
|
+
},
|
|
85
|
+
"./test/internal/browser": {
|
|
86
|
+
"types": "./dist/test/internal/browser.d.ts",
|
|
87
|
+
"default": "./dist/test/internal/browser.js"
|
|
88
|
+
},
|
|
89
|
+
"./test/internal/traces": { "default": "./dist/test/internal/traces.js" },
|
|
90
|
+
"./test/config": {
|
|
91
|
+
"types": "./dist/test/config.d.ts",
|
|
92
|
+
"require": "./dist/test/config.cjs",
|
|
93
|
+
"default": "./dist/test/config.js"
|
|
94
|
+
},
|
|
95
|
+
"./test/runtime": {
|
|
96
|
+
"types": "./dist/test/runtime.d.ts",
|
|
97
|
+
"default": "./dist/test/runtime.js"
|
|
98
|
+
},
|
|
99
|
+
"./test/worker": {
|
|
100
|
+
"types": "./dist/test/worker.d.ts",
|
|
101
|
+
"default": "./dist/test/worker.js"
|
|
102
|
+
},
|
|
103
|
+
"./test/mocker": {
|
|
104
|
+
"types": "./dist/test/mocker.d.ts",
|
|
105
|
+
"default": "./dist/test/mocker.js"
|
|
106
|
+
},
|
|
107
|
+
"./test/browser-playwright": {
|
|
108
|
+
"types": "./dist/test/browser-playwright.d.ts",
|
|
109
|
+
"default": "./dist/test/browser-playwright.js"
|
|
110
|
+
},
|
|
111
|
+
"./test/browser/providers/playwright": {
|
|
112
|
+
"types": "./dist/test/browser/providers/playwright.d.ts",
|
|
113
|
+
"default": "./dist/test/browser/providers/playwright.js"
|
|
114
|
+
},
|
|
115
|
+
"./test/browser-playwright/context": {
|
|
116
|
+
"types": "./dist/test/browser-playwright/context.d.ts",
|
|
117
|
+
"default": "./dist/test/browser-playwright/context.js"
|
|
118
|
+
},
|
|
119
|
+
"./test/browser/providers/playwright/context": {
|
|
120
|
+
"types": "./dist/test/browser/providers/playwright/context.d.ts",
|
|
121
|
+
"default": "./dist/test/browser/providers/playwright/context.js"
|
|
122
|
+
},
|
|
123
|
+
"./test/browser-preview": {
|
|
124
|
+
"types": "./dist/test/browser-preview.d.ts",
|
|
125
|
+
"default": "./dist/test/browser-preview.js"
|
|
126
|
+
},
|
|
127
|
+
"./test/browser/providers/preview": {
|
|
128
|
+
"types": "./dist/test/browser/providers/preview.d.ts",
|
|
129
|
+
"default": "./dist/test/browser/providers/preview.js"
|
|
130
|
+
},
|
|
131
|
+
"./test/browser-preview/context": {
|
|
132
|
+
"types": "./dist/test/browser-preview/context.d.ts",
|
|
133
|
+
"default": "./dist/test/browser-preview/context.js"
|
|
134
|
+
},
|
|
135
|
+
"./test/browser/providers/preview/context": {
|
|
136
|
+
"types": "./dist/test/browser/providers/preview/context.d.ts",
|
|
137
|
+
"default": "./dist/test/browser/providers/preview/context.js"
|
|
138
|
+
},
|
|
139
|
+
"./test/browser/context": {
|
|
140
|
+
"types": "./dist/test/browser/context.d.ts",
|
|
141
|
+
"default": "./dist/test/browser/context.js"
|
|
142
|
+
},
|
|
143
|
+
"./test/client": { "default": "./dist/test/client.js" },
|
|
144
|
+
"./test/context": {
|
|
145
|
+
"types": "./dist/test/context.d.ts",
|
|
146
|
+
"default": "./dist/test/context.js"
|
|
147
|
+
},
|
|
148
|
+
"./test/locators": {
|
|
149
|
+
"types": "./dist/test/locators.d.ts",
|
|
150
|
+
"default": "./dist/test/locators.js"
|
|
151
|
+
},
|
|
152
|
+
"./test/matchers": {
|
|
153
|
+
"types": "./dist/test/matchers.d.ts",
|
|
154
|
+
"default": "./dist/test/matchers.js"
|
|
155
|
+
},
|
|
156
|
+
"./test/utils": { "default": "./dist/test/utils.js" },
|
|
157
|
+
"./test/browser-compat": {
|
|
158
|
+
"types": "./dist/test/browser-compat.d.ts",
|
|
159
|
+
"default": "./dist/test/browser-compat.js"
|
|
160
|
+
},
|
|
161
|
+
"./test/plugins/utils": {
|
|
162
|
+
"types": "./dist/test/plugins/utils.d.ts",
|
|
163
|
+
"default": "./dist/test/plugins/utils.js"
|
|
164
|
+
},
|
|
165
|
+
"./test/plugins/utils-source-map": {
|
|
166
|
+
"types": "./dist/test/plugins/utils-source-map.d.ts",
|
|
167
|
+
"default": "./dist/test/plugins/utils-source-map.js"
|
|
168
|
+
},
|
|
169
|
+
"./test/plugins/utils-source-map-node": {
|
|
170
|
+
"types": "./dist/test/plugins/utils-source-map-node.d.ts",
|
|
171
|
+
"default": "./dist/test/plugins/utils-source-map-node.js"
|
|
172
|
+
},
|
|
173
|
+
"./test/plugins/utils-error": {
|
|
174
|
+
"types": "./dist/test/plugins/utils-error.d.ts",
|
|
175
|
+
"default": "./dist/test/plugins/utils-error.js"
|
|
176
|
+
},
|
|
177
|
+
"./test/plugins/utils-helpers": {
|
|
178
|
+
"types": "./dist/test/plugins/utils-helpers.d.ts",
|
|
179
|
+
"default": "./dist/test/plugins/utils-helpers.js"
|
|
180
|
+
},
|
|
181
|
+
"./test/plugins/utils-display": {
|
|
182
|
+
"types": "./dist/test/plugins/utils-display.d.ts",
|
|
183
|
+
"default": "./dist/test/plugins/utils-display.js"
|
|
184
|
+
},
|
|
185
|
+
"./test/plugins/utils-timers": {
|
|
186
|
+
"types": "./dist/test/plugins/utils-timers.d.ts",
|
|
187
|
+
"default": "./dist/test/plugins/utils-timers.js"
|
|
188
|
+
},
|
|
189
|
+
"./test/plugins/utils-offset": {
|
|
190
|
+
"types": "./dist/test/plugins/utils-offset.d.ts",
|
|
191
|
+
"default": "./dist/test/plugins/utils-offset.js"
|
|
192
|
+
},
|
|
193
|
+
"./test/plugins/utils-resolver": {
|
|
194
|
+
"types": "./dist/test/plugins/utils-resolver.d.ts",
|
|
195
|
+
"default": "./dist/test/plugins/utils-resolver.js"
|
|
196
|
+
},
|
|
197
|
+
"./test/plugins/utils-serialize": {
|
|
198
|
+
"types": "./dist/test/plugins/utils-serialize.d.ts",
|
|
199
|
+
"default": "./dist/test/plugins/utils-serialize.js"
|
|
200
|
+
},
|
|
201
|
+
"./test/plugins/utils-constants": {
|
|
202
|
+
"types": "./dist/test/plugins/utils-constants.d.ts",
|
|
203
|
+
"default": "./dist/test/plugins/utils-constants.js"
|
|
204
|
+
},
|
|
205
|
+
"./test/plugins/utils-diff": {
|
|
206
|
+
"types": "./dist/test/plugins/utils-diff.d.ts",
|
|
207
|
+
"default": "./dist/test/plugins/utils-diff.js"
|
|
208
|
+
},
|
|
209
|
+
"./test/plugins/spy": {
|
|
210
|
+
"types": "./dist/test/plugins/spy.d.ts",
|
|
211
|
+
"default": "./dist/test/plugins/spy.js"
|
|
212
|
+
},
|
|
213
|
+
"./test/plugins/snapshot": {
|
|
214
|
+
"types": "./dist/test/plugins/snapshot.d.ts",
|
|
215
|
+
"default": "./dist/test/plugins/snapshot.js"
|
|
216
|
+
},
|
|
217
|
+
"./test/plugins/snapshot-environment": {
|
|
218
|
+
"types": "./dist/test/plugins/snapshot-environment.d.ts",
|
|
219
|
+
"default": "./dist/test/plugins/snapshot-environment.js"
|
|
220
|
+
},
|
|
221
|
+
"./test/plugins/snapshot-manager": {
|
|
222
|
+
"types": "./dist/test/plugins/snapshot-manager.d.ts",
|
|
223
|
+
"default": "./dist/test/plugins/snapshot-manager.js"
|
|
224
|
+
},
|
|
225
|
+
"./test/plugins/mocker": {
|
|
226
|
+
"types": "./dist/test/plugins/mocker.d.ts",
|
|
227
|
+
"default": "./dist/test/plugins/mocker.js"
|
|
228
|
+
},
|
|
229
|
+
"./test/plugins/mocker-node": {
|
|
230
|
+
"types": "./dist/test/plugins/mocker-node.d.ts",
|
|
231
|
+
"default": "./dist/test/plugins/mocker-node.js"
|
|
232
|
+
},
|
|
233
|
+
"./test/plugins/mocker-browser": {
|
|
234
|
+
"types": "./dist/test/plugins/mocker-browser.d.ts",
|
|
235
|
+
"default": "./dist/test/plugins/mocker-browser.js"
|
|
236
|
+
},
|
|
237
|
+
"./test/plugins/mocker-redirect": {
|
|
238
|
+
"types": "./dist/test/plugins/mocker-redirect.d.ts",
|
|
239
|
+
"default": "./dist/test/plugins/mocker-redirect.js"
|
|
240
|
+
},
|
|
241
|
+
"./test/plugins/mocker-transforms": {
|
|
242
|
+
"types": "./dist/test/plugins/mocker-transforms.d.ts",
|
|
243
|
+
"default": "./dist/test/plugins/mocker-transforms.js"
|
|
244
|
+
},
|
|
245
|
+
"./test/plugins/mocker-automock": {
|
|
246
|
+
"types": "./dist/test/plugins/mocker-automock.d.ts",
|
|
247
|
+
"default": "./dist/test/plugins/mocker-automock.js"
|
|
248
|
+
},
|
|
249
|
+
"./test/plugins/mocker-register": {
|
|
250
|
+
"types": "./dist/test/plugins/mocker-register.d.ts",
|
|
251
|
+
"default": "./dist/test/plugins/mocker-register.js"
|
|
252
|
+
},
|
|
253
|
+
"./test/plugins/pretty-format": {
|
|
254
|
+
"types": "./dist/test/plugins/pretty-format.d.ts",
|
|
255
|
+
"default": "./dist/test/plugins/pretty-format.js"
|
|
256
|
+
},
|
|
257
|
+
"./test/plugins/browser": {
|
|
258
|
+
"types": "./dist/test/plugins/browser.d.ts",
|
|
259
|
+
"default": "./dist/test/plugins/browser.js"
|
|
260
|
+
},
|
|
261
|
+
"./test/plugins/browser-context": {
|
|
262
|
+
"types": "./dist/test/plugins/browser-context.d.ts",
|
|
263
|
+
"default": "./dist/test/plugins/browser-context.js"
|
|
264
|
+
},
|
|
265
|
+
"./test/plugins/browser-client": { "default": "./dist/test/plugins/browser-client.js" },
|
|
266
|
+
"./test/plugins/browser-locators": {
|
|
267
|
+
"types": "./dist/test/plugins/browser-locators.d.ts",
|
|
268
|
+
"default": "./dist/test/plugins/browser-locators.js"
|
|
269
|
+
},
|
|
270
|
+
"./test/plugins/browser-playwright": {
|
|
271
|
+
"types": "./dist/test/plugins/browser-playwright.d.ts",
|
|
272
|
+
"default": "./dist/test/plugins/browser-playwright.js"
|
|
273
|
+
},
|
|
274
|
+
"./test/plugins/browser-preview": {
|
|
275
|
+
"types": "./dist/test/plugins/browser-preview.d.ts",
|
|
276
|
+
"default": "./dist/test/plugins/browser-preview.js"
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var engines = { "node": "^22.18.0 || ^24.11.0 || >=26.0.0" };
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/utils/constants.ts
|
|
282
|
+
const VITE_PLUS_NAME = "vite-plus";
|
|
283
|
+
const VITE_PLUS_VERSION = process.env.VP_VERSION || version;
|
|
284
|
+
const VITE_CONFIG_FILES = [
|
|
285
|
+
"vite.config.js",
|
|
286
|
+
"vite.config.mjs",
|
|
287
|
+
"vite.config.ts",
|
|
288
|
+
"vite.config.cjs",
|
|
289
|
+
"vite.config.mts",
|
|
290
|
+
"vite.config.cts"
|
|
291
|
+
];
|
|
292
|
+
const VITEST_VERSION = "5.0.1";
|
|
293
|
+
const SETUP_VP_VERSION = "v1.21.1";
|
|
294
|
+
const TSDOWN_MIGRATION_SKILL_URL = "https://github.com/rolldown/tsdown/blob/main/skills/tsdown-migrate/SKILL.md";
|
|
295
|
+
const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
|
|
296
|
+
vite: `npm:@voidzero-dev/vite-plus-core@${VITE_PLUS_VERSION}`,
|
|
297
|
+
vitest: VITEST_VERSION
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Package-name patterns the migrator exempts from a package manager's
|
|
301
|
+
* "minimum release age" gate (pnpm `minimumReleaseAgeExclude` / Yarn
|
|
302
|
+
* `npmPreapprovedPackages`).
|
|
303
|
+
*
|
|
304
|
+
* Vite+ pins `vitest` to an exact, sometimes freshly published version, and the
|
|
305
|
+
* in-tree `@vitest/*` siblings install transitively at that same version, so an
|
|
306
|
+
* age gate would otherwise quarantine the Vite+-managed family and break
|
|
307
|
+
* `vp install`. The `@vitest/*` glob also covers the optional `@vitest/browser-*`
|
|
308
|
+
* peers the migrator pins for browser projects. This does NOT pin or manage any
|
|
309
|
+
* package — it only lets the chosen versions through the user's gate, including
|
|
310
|
+
* the `@vitest/coverage-*` version the coverage guard asks the user to align to
|
|
311
|
+
* the bundled vitest.
|
|
312
|
+
*/
|
|
313
|
+
const VITEST_AGE_GATE_EXEMPT_PACKAGES = ["vitest", "@vitest/*"];
|
|
314
|
+
/**
|
|
315
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
316
|
+
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
317
|
+
* override dependencies with locally built tgz packages.
|
|
318
|
+
*/
|
|
319
|
+
function isForceOverrideMode() {
|
|
320
|
+
return process.env.VP_FORCE_MIGRATE === "1";
|
|
321
|
+
}
|
|
322
|
+
const require = createRequire(import.meta.url);
|
|
323
|
+
function resolve(path) {
|
|
324
|
+
return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Like {@link resolve}, but prefers the copy shipped with the CLI
|
|
328
|
+
* (`import.meta.dirname`) over the project's (`process.cwd()`).
|
|
329
|
+
*
|
|
330
|
+
* Use this for runtime modules that MUST match what `vite-plus/test*`
|
|
331
|
+
* imports resolve to — chiefly the Vitest runner binary. The `vite-plus/test`
|
|
332
|
+
* shims `export * from 'vitest'`, which Node resolves to vite-plus's own
|
|
333
|
+
* bundled (pinned) Vitest. If `vp test` instead spawned a project-local
|
|
334
|
+
* Vitest (a different physical copy/version), the runner and the imported
|
|
335
|
+
* `vi`/`expect`/runner internals would come from two distinct Vitest
|
|
336
|
+
* modules — a classic source of Vitest internal-state and mock-hoisting
|
|
337
|
+
* mismatches. `process.cwd()` stays as a fallback for layouts where the
|
|
338
|
+
* bundled copy is somehow unreachable, so this is never worse than {@link resolve}.
|
|
339
|
+
*/
|
|
340
|
+
function resolveBundled(path) {
|
|
341
|
+
return require.resolve(path, { paths: [import.meta.dirname, process.cwd()] });
|
|
342
|
+
}
|
|
343
|
+
const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: a tsconfig file contains baseUrl which is not yet supported by the oxlint type checker.\n Run `vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>` to remove baseUrl from your tsconfig.";
|
|
344
|
+
const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
|
|
345
|
+
const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
|
|
346
|
+
function createBaseUrlTsconfigFixArgs(target = ".") {
|
|
347
|
+
return [BASEURL_TSCONFIG_FIX_FLAG, target];
|
|
348
|
+
}
|
|
349
|
+
const DEFAULT_ENVS = {
|
|
350
|
+
JS_RUNTIME_VERSION: process.versions.node,
|
|
351
|
+
JS_RUNTIME_NAME: process.release.name,
|
|
352
|
+
NODE_PACKAGE_MANAGER: "vite-plus"
|
|
353
|
+
};
|
|
354
|
+
const CONFIG_METADATA_ENV = "VP_RESOLVING_CONFIG_METADATA";
|
|
355
|
+
//#endregion
|
|
356
|
+
export { engines as _, SETUP_VP_VERSION as a, VITEST_VERSION as c, VITE_PLUS_OVERRIDE_PACKAGES as d, VITE_PLUS_VERSION as f, resolveBundled as g, resolve as h, DEFAULT_ENVS as i, VITE_CONFIG_FILES as l, isForceOverrideMode as m, BASEURL_TSCONFIG_WARNING as n, TSDOWN_MIGRATION_SKILL_URL as o, createBaseUrlTsconfigFixArgs as p, CONFIG_METADATA_ENV as r, VITEST_AGE_GATE_EXEMPT_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, VITE_PLUS_NAME as u, exports as v, version as y };
|