Skip to content

Commit 062c75d

Browse files
authored
chore: fix standalone docs build, update exports maps (#11394)
1 parent caf2887 commit 062c75d

9 files changed

Lines changed: 49 additions & 18 deletions

File tree

‎docs/.vitepress/config.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ export default ({ mode }: { mode: string }) => {
116116
: [
117117
transformerNotationWordHighlight(),
118118
transformerTwoslash({
119+
// resolve types from source, so the docs don't need built packages
120+
twoslashOptions: {
121+
compilerOptions: {
122+
moduleResolution: 100 /* Bundler */,
123+
customConditions: ['__vitest_source__'],
124+
},
125+
},
119126
processHoverInfo: (info) => {
120127
if (info.includes(process.cwd())) {
121128
return info.replace(new RegExp(process.cwd(), 'g'), '')

‎packages/browser-playwright/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"sideEffects": false,
2626
"exports": {
2727
".": {
28+
"__vitest_source__": "./src/index.ts",
2829
"types": "./dist/index.d.ts",
2930
"default": "./dist/index.js"
3031
},

‎packages/browser/src/node/commands/screenshotMatcher/utils.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SerializedLocator } from '@vitest/browser'
2-
// Note: this augments `screenshotOptions` types
3-
import type {} from '@vitest/browser-playwright'
42
import type { BrowserCommandContext, BrowserConfigOptions } from 'vitest/node'
3+
// Note: this augments `screenshotOptions` types
4+
import type {} from '../../../../../browser-playwright'
55
import type { ScreenshotMatcherOptions } from '../../../../context'
66
import type { ScreenshotMatcherArguments } from '../../../shared/screenshotMatcher/types'
77
import type { AnyCodec } from './codecs'

‎packages/pretty-format/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@
2323
"sideEffects": false,
2424
"exports": {
2525
".": {
26+
"__vitest_source__": "./src/index.ts",
2627
"types": "./dist/index.d.ts",
2728
"default": "./dist/index.js"
2829
},
29-
"./*": "./*"
30+
"./package.json": "./package.json"
3031
},
3132
"main": "./dist/index.js",
3233
"module": "./dist/index.js",

‎packages/spy/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"sideEffects": false,
2525
"exports": {
2626
".": {
27+
"__vitest_source__": "./src/index.ts",
2728
"types": "./dist/index.d.ts",
2829
"default": "./dist/index.js"
2930
},

‎packages/ui/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@
2222
"sideEffects": false,
2323
"exports": {
2424
".": {
25+
"__vitest_source__": "./node/index.ts",
2526
"types": "./dist/index.d.ts",
2627
"default": "./dist/index.js"
2728
},
2829
"./reporter": {
30+
"__vitest_source__": "./node/reporter.ts",
2931
"types": "./reporter.d.ts",
3032
"default": "./dist/reporter.js"
3133
},
32-
"./*": "./*"
34+
"./package.json": "./package.json"
3335
},
3436
"main": "./dist/index.js",
3537
"module": "./dist/index.js",

‎packages/vitest/LICENSE.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,34 @@ Repository: git+https://github.com/quansync-dev/quansync.git
713713
714714
---------------------------------------
715715

716+
## react-is
717+
License: MIT
718+
Repository: https://github.com/react/react.git
719+
720+
> MIT License
721+
>
722+
> Copyright (c) Meta Platforms, Inc. and affiliates.
723+
>
724+
> Permission is hereby granted, free of charge, to any person obtaining a copy
725+
> of this software and associated documentation files (the "Software"), to deal
726+
> in the Software without restriction, including without limitation the rights
727+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
728+
> copies of the Software, and to permit persons to whom the Software is
729+
> furnished to do so, subject to the following conditions:
730+
>
731+
> The above copyright notice and this permission notice shall be included in all
732+
> copies or substantial portions of the Software.
733+
>
734+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
735+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
736+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
737+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
738+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
739+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
740+
> SOFTWARE.
741+
742+
---------------------------------------
743+
716744
## sisteransi
717745
License: MIT
718746
By: Terkel Gjervig

‎packages/vitest/package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"exports": {
3434
".": {
35+
"__vitest_source__": "./src/public/index.ts",
3536
"import": {
3637
"types": "./dist/index.d.ts",
3738
"default": "./dist/index.js"
@@ -65,6 +66,7 @@
6566
"types": "./import-meta.d.ts"
6667
},
6768
"./node": {
69+
"__vitest_source__": "./src/public/node.ts",
6870
"types": "./dist/node.d.ts",
6971
"default": "./dist/node.js"
7072
},
@@ -78,15 +80,18 @@
7880
"default": "./dist/traces.js"
7981
},
8082
"./config": {
83+
"__vitest_source__": "./src/public/config.ts",
8184
"types": "./config.d.ts",
8285
"require": "./dist/config.cjs",
8386
"default": "./dist/config.js"
8487
},
8588
"./runtime": {
89+
"__vitest_source__": "./src/public/runtime.ts",
8690
"types": "./dist/runtime.d.ts",
8791
"default": "./dist/runtime.js"
8892
},
8993
"./worker": {
94+
"__vitest_source__": "./src/public/worker.ts",
9095
"types": "./worker.d.ts",
9196
"default": "./dist/worker.js"
9297
}

‎tsconfig.base.json‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,7 @@
66
"module": "ESNext",
77
"moduleResolution": "Bundler",
88
"paths": {
9-
"@vitest/ui": ["./packages/ui/node/index.ts"],
10-
"@vitest/pretty-format": ["./packages/pretty-format/src/index.ts"],
11-
"@vitest/utils": ["./packages/utils/src/index.ts"],
12-
"@vitest/utils/*": ["./packages/utils/src/*"],
13-
"@vitest/spy": ["./packages/spy/src/index.ts"],
14-
"@vitest/mocker": ["./packages/mocker/src/index.ts"],
15-
"@vitest/mocker/node": ["./packages/mocker/src/node/index.ts"],
16-
"@vitest/mocker/browser": ["./packages/mocker/src/browser/index.ts"],
17-
"@vitest/mocker/transforms": ["./packages/mocker/src/node/transforms.ts"],
18-
"@vitest/browser-playwright": ["./packages/browser-playwright/src/index.ts"],
199
"~/*": ["./packages/ui/client/*"],
20-
"vitest": ["./packages/vitest/src/public/index.ts"],
21-
"vitest/globals": ["./packages/vitest/globals.d.ts"],
22-
"vitest/browser": ["./packages/vitest/browser/context.d.ts"],
23-
"vitest/*": ["./packages/vitest/src/public/*"],
2410
"#test-utils": ["./test/test-utils/index.ts"]
2511
},
2612
"allowImportingTsExtensions": true,

0 commit comments

Comments
 (0)