-
-
Notifications
You must be signed in to change notification settings - Fork 109
d2m #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
d2m #1021
Changes from all commits
Commits
Show all changes
500 commits
Select commit
Hold shift + click to select a range
97be22a
[autofix.ci] apply automated fixes
autofix-ci[bot] f286921
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ a141f9d4 (#955)
NoiseFan e421bb5
docs(en): merging all conflicts
docschina-bot a0f73c7
docs(cn): dissolve the conflict
NoiseFan c42cdf2
Merge pull request #959 from vitest-dev/sync-5755951b-1
NoiseFan 1df9a43
docs: expand test filtering and parallelism docs (#10116)
sheremet-va 50be918
docs(en): merging all conflicts
docschina-bot 2cd65cc
docs(cn): dissolve the conflict
NoiseFan 70ac233
Merge pull request #960 from vitest-dev/sync-1df9a43d-1
NoiseFan 2c317bd
docs: improve learning section (#10140)
sheremet-va e29b046
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot e7c76de
docs: fix trace-view.md hallucination (#10149)
hi-ogawa 01b64e5
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 12702e8
docs: mention `vi.resetModules` doesn't work with `viteModuleRunner: …
sheremet-va d8fd2c0
docs(en): merging all conflicts
docschina-bot 6ff7972
fix: alias `agent` reporter to `minimal` (#10157)
sheremet-va 2aae193
feat(coverage): istanbul to support `instrumenter` option (#10119)
BartWaardenburg 132bb5f
docs(cn): dissolve the conflict
NoiseFan a981f33
Merge pull request #961 from vitest-dev/sync-12702e85-1
NoiseFan 7d62aac
docs: update custom snapshot matcher example (#10169)
hi-ogawa 30df941
docs(typo): fix doucment's some typo (#10083)
NoiseFan bceb252
refactor!: replace `loupe.inspect` with pretty-format (#9609)
hi-ogawa 1f86109
feat: add `createReport` and `.vitest` report directory convention (#…
AriPerkkio d221c48
feat(browser): export aria tree utils (#10171)
hi-ogawa ec964f3
feat(browser): support dom snapshot trace view (#10102)
hi-ogawa 6ec637b
docs(en): merging all conflicts
docschina-bot 484c532
docs(cn): dissolve the conflict
NoiseFan e79cdf6
Merge pull request #965 from vitest-dev/sync-ec964f36-1
NoiseFan bf7524b
fix: global `sequence.concurrent: true` with top-level `test(..., { c…
hi-ogawa 759296d
docs(cn): complement the missing translation (#958)
NoiseFan 8241fd0
docs: document v5 migration changes for #9609 and #10170 (#10200)
hi-ogawa 853e1c2
fix!: default `attachmentsDir` from `.vitest-attachements/` to `.vite…
MdSadiqMd f28efd4
refactor!: remove `sequential` test/suite options in favor of `concur…
hi-ogawa 7daeb00
feat(browser): provide project reference in `ToMatchScreenshotResolve…
macarie 00c87ce
feat(coverage): v8 to track `node:child_process` and `node:worker_thr…
AriPerkkio 6c3732e
refactor: inline snapshot package (#10210)
sheremet-va d959548
feat: expose default reporters through `configDefaults.reporters` (#1…
hi-ogawa a623a2f
fix!: represent locator as an object instead of a string (#10212)
sheremet-va 56e853e
fix!: remove deprecated entry points (#10222)
sheremet-va ad185a8
feat(junit-reporter): add jest-junit-compatible naming options (#10189)
neumaennl facf198
docs: clarify order of `before*` hooks cleanup functions (#10230)
AriPerkkio 40c66e8
docs(en): merging all conflicts
docschina-bot 1959b05
feat: support merge reports for non-sharded multi-environment runs (t…
hi-ogawa 829251f
fix(reporters)!: `blob` reporter and `--merge-reports` default to `.v…
AriPerkkio 39eca16
docs(cn): dissolve the conflict
NoiseFan 535bba2
Merge pull request #967 from vitest-dev/sync-facf1987-1
NoiseFan 8f02296
docs(en): merging all conflicts
docschina-bot 4b40403
docs(cn): dissolve the conflict
NoiseFan 61f1377
Merge pull request #969 from vitest-dev/sync-829251fd-1
NoiseFan c199740
docs: add raul to the team, update order, fix patak avatar (#10273)
sheremet-va 28847da
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 9dac0cd
feat(api): expose logs recorded during the test (#10277)
sheremet-va 7176033
docs(en): merging all conflicts
docschina-bot 8a09f2e
docs: fix `mock.instances` docs example to use a constructible mock i…
Copilot 349422d
feat!: require Node.js 22 and Vite 6.4 (#10178)
sheremet-va b2af5d5
fix!: fail `expect.poll` when function didn't resolve in time (#10233)
hi-ogawa 93d506c
docs: document how to workaround bad packages that fail to load as ex…
hi-ogawa c41c5d2
docs(cn): dissolve the conflict
NoiseFan 4393761
Merge pull request #970 from vitest-dev/sync-9dac0cd8-1
NoiseFan 86eec75
feat(browser): show aria tree on locator element error (#10257)
hi-ogawa 1a64d60
docs: `frameLocator` and cross-origin iframes caveat (#10298)
AriPerkkio e2268ef
docs(en): merging all conflicts
docschina-bot f0f99d3
docs(cn): dissolve the conflict
NoiseFan 3530b69
Merge pull request #972 from vitest-dev/sync-1a64d60c-1
NoiseFan 93797be
feat(browser): support custom `kind` in `page.mark` (#10302)
AriPerkkio 72e981b
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 1fad5fa
feat(browser): live update trace view on watch UI (#10296)
hi-ogawa 7df7a65
feat(browser): add `context.mark` for custom command tracing (#10329)
AriPerkkio ea5391c
fix: make `attachmentsDir` root only config (#10334)
hi-ogawa 9b9d74f
docs(en): merging all conflicts
docschina-bot 4853352
docs(cn): dissolve the conflict
NoiseFan 0f69d34
Merge pull request #974 from vitest-dev/sync-ea5391c0-1
NoiseFan 4213bb0
docs(cn): update home page translate (#977)
NoiseFan c163fc2
docs(cn): update guide (#976)
NoiseFan 95a2125
docs(cn): update guide/browser/aria-snapshots.md (#979)
NoiseFan a5e03a6
docs(cn): update home page translate (#978)
NoiseFan ac4f240
docs(cn): update /guide (#980)
NoiseFan d6c4d52
feat: support typescript build mode (#9870)
lishaduck ed7a02e
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 23f950c
docs: use unified `<Experimental>` label (#10372)
NoiseFan 899ff05
docs: mention xvfb for headful WebdriverIO Chrome (#10358)
MukundaKatta da84e09
docs(cn): update guide/browser/playwright-traces.md (#981)
NoiseFan ff03f13
fix(deps): update fake-timers to 15.3.2. support `toNotFake` (#10043)
BPScott 0a829fd
ci: update node-version to 24 by default (#10379)
sheremet-va 3a51312
docs: update guide sidebar, add more recipes (#10226)
sheremet-va 0468f40
docs(en): merging all conflicts
docschina-bot 1f8967a
docs(cn): dissolve the conflict
NoiseFan 9ba19bb
Merge pull request #982 from vitest-dev/sync-3a513123-1
NoiseFan 8a0f551
docs: fix the file extension glob pattern (#10366)
ghazi-git 8564192
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 14077ca
feat(reporter): support html reporter single file output (#10235)
hi-ogawa bac7cfd
fix: respect `disableConsoleIntercept` in browser mode (#10391)
Copilot 68b5e1d
docs(en): merging all conflicts
docschina-bot b636e4f
docs: add releases page (#10432)
sheremet-va 6ddec48
feat(browser)!: enable `locators.exact` by default (#10430)
sheremet-va 74a1921
docs(cn): dissolve the conflict
NoiseFan 6ee832c
Merge pull request #984 from vitest-dev/sync-bac7cfdc-1
NoiseFan da7ec28
docs(cn): update config/disableconsoleintercept.md (#985)
NoiseFan 988854f
fix: forceRerunTriggers uses directory globs against files (fix #1042…
Patrick-Clausen b845806
docs: update vitest-browser-vue/svelte async render (#10441)
hi-ogawa a9a776d
docs(en): merging all conflicts
docschina-bot b03beab
docs: add custom browser command example to show how to validate inpu…
hi-ogawa 57422b2
docs(cn): dissolve the conflict
NoiseFan 7e55c44
fix: lint error
NoiseFan 06927ea
[autofix.ci] apply automated fixes
autofix-ci[bot] 1216d23
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ b8458066 (#987)
NoiseFan c59e171
docs: update sponsors (#10462)
sheremet-va fb3dfb6
fix(browser): disable client `cdp` API when `allowWrite/allowExec: fa…
hi-ogawa a520cb5
feat(benchmark)!: rewrite the public API (#10113)
sheremet-va f5fcf27
feat!: `toHaveTextContent` is strict, add `toMatchTextContent` as alt…
sheremet-va 43546c5
docs: fix grammar & sentence fragments in intro (#10487)
BonaventureCJ 95a42b8
feat(coverage): `thresholds.autoUpdate` to receive previous threshold…
wouterkroes a91f689
docs(en): merging all conflicts
docschina-bot 1b4986d
docs: clarify placeholder usage (#10496)
BonaventureCJ 936ed6d
docs(cn): dissolve the conflict
NoiseFan f399b31
[autofix.ci] apply automated fixes
autofix-ci[bot] a405655
fix!: don't lookup config file from ancestor directories (#10428)
hi-ogawa 78ee299
docs(browser): re-word browser mode development status (#10509)
matthewbordas 98b087e
Merge pull request #988 from vitest-dev/sync-95a42b87-1
NoiseFan fa7b917
feat!: inline `@vitest/runner` package, do not publish it anymore (#1…
sheremet-va e7f7953
fix!: allow mutating happy-dom/jsdom window object (#10373)
hi-ogawa dcc6047
docs(en): merging all conflicts
docschina-bot 55cfbb7
docs(cn): dissolve the conflict
NoiseFan b5bad7d
docs(cn): fix translation in guide/index.md
dogledogle 3857759
Merge pull request #992 from vitest-dev/sync-e7f79533-1
NoiseFan 1772c68
feat: add custom containers type localization translation (#993)
NoiseFan 3afc010
feat!: expose `concurrencyId`/`workerId` on TestModule's diagnostics,…
sheremet-va 156801c
Merge branch 'sync-docs' of https://github.com/vitest-dev/docs-cn int…
docschina-bot 4fa791b
docs: document the assertion function limitation in in-source testing…
koutaro-masaki 2faf0d3
feat(cli): add `--repeats` CLI option (#10504)
todor-a 835ab3b
fix(browser)!: require `sessionId` for orchestrator html request (#10…
hi-ogawa 8430ac3
docs(guide): clarify beforeEach state isolation (#10512)
BonaventureCJ 03a8845
docs(en): merging all conflicts
docschina-bot 1567992
docs(cn): dissolve the conflict
NoiseFan 287d45f
Merge pull request #995 from vitest-dev/sync-8430ac3c-1
NoiseFan 89a0dbd
feat(coverage)!: allow `thresholds.perFile` to accept an object (#10190)
vladlenskiy 9e4ac7b
docs(en): merging all conflicts
docschina-bot 371e030
docs(cn): dissolve the conflict
NoiseFan bcf195a
Merge pull request #996 from vitest-dev/sync-89a0dbd2-1
NoiseFan 0790508
docs: update Visual Regression Testing guide (#10514)
macarie 356d1f6
docs(en): merging all conflicts
docschina-bot ec0ec2c
docs(cn): dissolve the conflict
NoiseFan 1c03603
Merge pull request #997 from vitest-dev/sync-07905088-1
NoiseFan 941b14f
docs: prefer test.for over test.each (#10588)
BonaventureCJ bbf1f06
docs(en): merging all conflicts
docschina-bot 44e1b52
docs(cn): dissolve the conflict
NoiseFan a29ea1b
Merge pull request #998 from vitest-dev/sync-941b14f8-1
NoiseFan 1889065
feat(vitest): create `vi.when()` (#10174)
macarie 390a1bd
docs: add Deno to install instructions (#10614)
bartlomieju d2a96ea
fix(ui)!: harden UI API access (#10583)
hi-ogawa 83c20df
feat(ui)!: change html reporter default output to `.vitest` (#10620)
hi-ogawa f784aae
docs(en): merging all conflicts
docschina-bot ddd2178
docs(cn): dissolve the conflict
NoiseFan b202296
Merge pull request #1000 from vitest-dev/sync-83c20df0-1
NoiseFan 368baa8
docs(cn): translate /guide (#1001)
NoiseFan 47d8acd
fix(types): allow `changed` in configuration options (#10651)
AriPerkkio c03658b
chore(deps): bump playwright to 1.61 (#10624)
hi-ogawa 7ce3b2b
chore(deps): update eslint packages (#9825)
renovate[bot] c1236c2
feat!: add `screenshotDirectory` config to `browser.expect.toMatchScr…
macarie 72cdde3
feat(reporters)!: write json and junit reporter output files to `.vit…
hi-ogawa cd258b0
docs(uninstall): remove fathom (#10660)
mdong1909 e3aa022
fix: fix per-project `sequence` config (#10659)
hi-ogawa 0e7b40f
feat!: update `@sinonjs/fake-timers` and support mocking `Temporal` (…
hi-ogawa 713f80c
docs: clarify how istanbul coverage works (#10652)
ghostdevv c197701
docs(cn): update /guide/recipes (#1002)
NoiseFan 69ca8a4
refactor!: remove webdriverio package (#10675)
sheremet-va 86f66d5
feat!: clear mocks by default before each test (#10613)
sheremet-va 7ddec74
docs: update migration guide (#10682)
sheremet-va 9ddfb46
fix: don't print column in test names when `includeTaskLocation` is e…
sheremet-va 41871de
fix!: don't emit localStorage warnings on Node 26, fail gracefully wh…
sheremet-va dc33d64
docs: remove vite+ alpha banner (#10703)
mdong1909 a6366b8
docs(en): merging all conflicts
docschina-bot e31ddef
refactor!: separate config resolution from the server creation (#10554)
sheremet-va 06a3ac9
feat: add toggable `injectCjsGlobals` option (#10709)
sheremet-va 494f678
perf: make the Node compile cache opt-in, persist worker caches on te…
sheremet-va fbeaae0
docs(cn): dissolve the conflict
NoiseFan 12faebf
docs(cn): dissolve the conflict
NoiseFan 60996c4
Merge pull request #1004 from vitest-dev/sync-dc33d649-1
NoiseFan 591f4db
perf(browser): stop serving framework sourcemaps in headless runs (#1…
sheremet-va 813b6be
docs: add latitude to sponsors (#10771)
sheremet-va 614cdaa
feat: promote fsModuleCache to a top-level option (#10734)
sheremet-va d3cf098
docs: update latitude logo (#10802)
sheremet-va 6f468ba
docs: fix styling of logos (#10806)
sheremet-va 7eeb95c
feat(benchmark): add pluggable benchmark provider API (#10799)
GuillaumeLagrange b417e1f
fix(browser): mock window.print to avoid hanging (fix #7375) (#10798)
aaravjaichand 05d82ab
feat(cli): support -p shorthand for --project (#10826)
sheremet-va dee42cd
refactor: deduplicate run-level option propagation and document the r…
sheremet-va 3987c94
feat!: inline projects extend the root config by default (#10750)
sheremet-va 22d6e3f
fix(deps): update all non-major dependencies (#9958)
renovate[bot] ad3a423
chore: add Knip checks (#10847)
sheremet-va 7b67107
chore(deps): update shiki monorepo to v4 (#10625)
renovate[bot] 0098755
feat!: enable mocking Temporal without fake timers (#10757)
fabon-f eecf58f
feat(types)!: add better promise support in expects and matchers (#8266)
samchungy af8ee5a
feat!: support nested projects (#10846)
sheremet-va 4b5a646
docs(en): merging all conflicts
docschina-bot 814b631
docs(cn): dissolve the conflict
NoiseFan 637c76e
chore: update dependencies
NoiseFan 41c2534
[autofix.ci] apply automated fixes
autofix-ci[bot] 26e9dc4
Merge pull request #1007 from vitest-dev/sync-af8ee5a7-1
NoiseFan c18a924
fix(deps): update all non-major dependencies (#10861)
renovate[bot] 4ec3766
fix!: use `>` as separator in `-t`, calculate `only` once (#10686)
sheremet-va 8bd62ec
docs: explain vm pool worker recycling cost (#10855)
sheremet-va 8359171
docs(en): merging all conflicts
docschina-bot 7863e54
feat!: fail the test when an asynchronous assertion is not awaited (#…
sheremet-va 039ef71
docs(cn): dissolve the conflict
NoiseFan 2b789cc
Merge pull request #1009 from vitest-dev/sync-8bd62ec3-1
NoiseFan 2e1be0c
feat(vm): support `require(esm)` in vm pools (#10829)
sheremet-va e512e7c
feat: report the duration breakdown as percentages (#10820)
sheremet-va 0eb7ed8
docs(cn): update /config document (#1010)
NoiseFan a8ea434
docs(cn): update /guide (#1011)
NoiseFan 9a58eea
docs(cn): update /guide/recipes (#1012)
NoiseFan 3e063df
chore(deps): update dependency @antfu/ni to v30 (#10900)
renovate[bot] 5ae4afd
docs: add TestMu AI to sponsors (#10904)
sheremet-va c890a47
feat!: share the Vite server between inline projects (#10848)
sheremet-va c6f5073
docs(browser): clarify special keys supported by userEvent.keyboard (…
shoaibyazdani 7b607b0
fix(deps): update all non-major dependencies (#10898)
renovate[bot] 726132d
fix(spy)!: preserve class mock prototype methods on instances (#10910)
sheremet-va fd768f0
docs: normalize ordered list number (#10895)
NoiseFan fe2fbfe
fix(snapshot): support no-unsafe-eval CSP by evaluating snapshot file…
hi-ogawa fedaf1b
feat(reporter): add custom GitHub Actions summary title (#10891)
heyJonBray d3697b6
docs: update migration guide (#10930)
sheremet-va 79532d4
refactor(projects): cleanup comments, add more `debug` statements (#1…
sheremet-va 4511691
fix(browser): disallow filter-only options in getBy* locators (fix #1…
2ded62f
fix(deps): update all non-major dependencies (#10966)
renovate[bot] 5d198e2
chore: update agents file (#10952)
sheremet-va 250585b
fix(reporters): display `test.name` in GitHub Actions reporter summar…
macarie 253cea0
fix(snapshot): reject when `toMatchFileSnapshot` uses same snapshot f…
hi-ogawa 1c2d55e
fix: combine multiple --project filters correctly (#10988)
sheremet-va 2329ad4
docs: document expect.fail method (#11003)
AbhiPra24 0fce92b
docs: add cjs support status in common errors (#11002)
hi-ogawa b1ac9a6
feat(coverage): switch to `@vitest/istanbuljs` packages (#11053)
AriPerkkio 8eea09d
fix(deps): update all non-major dependencies (#11043)
renovate[bot] caeb505
perf(vm): let environments opt out of the module graph prewarm (#11078)
sheremet-va 10cf95d
feat: promote parseSpecifications out of experimental (#11087)
sheremet-va e885753
docs: document TZ limitation in thread pools (#11098)
sheremet-va e7065fe
feat: promote clearCache out of experimental (#11086)
sheremet-va a41164c
feat!: parse files statically in vitest list by default (#11088)
sheremet-va 2793529
docs(en): merging all conflicts
docschina-bot 3db6bc6
docs(cn): dissolve the conflict
NoiseFan 7b5aede
Merge pull request #1015 from vitest-dev/sync-a41164ca-1
NoiseFan a1e8cf5
perf(spy): avoid scanning cleared mocks (#11092)
scttcper a0460f7
docs: split migration into multiple pages, add a button to copy the p…
sheremet-va b7bd706
docs: add blog post for Vitest 5 (#11076)
sheremet-va d3f2018
docs: fix migration links (#11133)
sheremet-va 7645a4e
docs: mention vitest doctor in the blog post (#11134)
sheremet-va 752f075
docs: mention default diagnostics (#11135)
sheremet-va 7c2b2ae
docs(en): merging all conflicts
docschina-bot 750da1b
docs(cn): dissolve the conflict
NoiseFan c77881d
Merge pull request #1017 from vitest-dev/sync-752f075b-1
NoiseFan 1848df3
docs(cn): update /guide (#1019)
NoiseFan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| <!-- 感谢你的贡献! --> | ||
|
|
||
| ### 在提交PR之前,请确保您执行以下操作: | ||
| ### 在提交PR之前,请确保你执行以下操作: | ||
| - [ ] 曾阅读过[翻译须知](https://github.com/vitest-dev/docs-cn/issues/391)。 | ||
| - [ ] 检查是否已经有PR以同样的方式解决问题,以避免创建重复。 | ||
| - [ ] 在此PR中描述正在解决的问题,或引用它解决的问题(例如:`fixes #123`)。 | ||
|
|
||
| --- | ||
|
|
||
| ### 描述 | ||
| <!-- 请在此处插入您的描述,并提供有关此PR正在解决的 “内容” 的特别信息 --> | ||
| <!-- 请在此处插入你的描述,并提供有关此PR正在解决的 “内容” 的特别信息 --> | ||
|
|
||
| ### 附加上下文 | ||
| <!-- 例如,你有什么想让代码审核的人重点关注的内容。 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| <script setup lang="ts"> | ||
| import { Icon } from '@iconify/vue' | ||
|
|
||
| defineProps<{ | ||
| href: string | ||
| }>() | ||
| </script> | ||
|
|
||
| <template> | ||
| <a :href="href" class="changelog-button" target="_blank" rel="noopener noreferrer"> | ||
| <Icon icon="carbon:document" aria-hidden="true" /> | ||
| <span>Changelog</span> | ||
| <Icon icon="carbon:arrow-up-right" class="external-icon" aria-hidden="true" /> | ||
| </a> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .changelog-button { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 0.5rem; | ||
| padding: 0.625rem 0.875rem; | ||
| border: 1px solid var(--vp-c-divider); | ||
| border-radius: 0.5rem; | ||
| background: var(--vp-c-bg-soft); | ||
| color: var(--vp-c-text-1); | ||
| font-size: 0.875rem; | ||
| font-weight: 600; | ||
| line-height: 1.25rem; | ||
| text-decoration: none; | ||
| transition: background-color 150ms, border-color 150ms, transform 150ms; | ||
| } | ||
|
|
||
| .changelog-button:hover { | ||
| border-color: color-mix(in srgb, var(--color-brand) 55%, transparent); | ||
| background: color-mix(in srgb, var(--color-brand) 8%, var(--vp-c-bg-soft)); | ||
| color: var(--vp-c-text-1); | ||
| transform: translateY(-1px); | ||
| } | ||
|
|
||
| .changelog-button:focus-visible { | ||
| outline: 2px solid var(--color-brand); | ||
| outline-offset: 3px; | ||
| } | ||
|
|
||
| .changelog-button svg { | ||
| width: 1rem; | ||
| height: 1rem; | ||
| } | ||
|
|
||
| .changelog-button .external-icon { | ||
| width: 0.75rem; | ||
| height: 0.75rem; | ||
| color: var(--vp-c-text-2); | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| <script setup lang="ts"> | ||
| import { Icon } from '@iconify/vue' | ||
| import { computed, ref } from 'vue' | ||
|
|
||
| const props = defineProps<{ | ||
| prompt: string | ||
| }>() | ||
|
|
||
| const state = ref<'idle' | 'copied' | 'error'>('idle') | ||
| const label = computed(() => state.value === 'copied' ? 'Copied' : 'Copy prompt') | ||
|
|
||
| async function copyPrompt() { | ||
| try { | ||
| await navigator.clipboard.writeText(props.prompt) | ||
| state.value = 'copied' | ||
| } | ||
| catch { | ||
| state.value = 'error' | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <button type="button" class="copy-prompt" @click="copyPrompt"> | ||
| <Icon :icon="state === 'copied' ? 'carbon:checkmark' : 'carbon:copy'" aria-hidden="true" /> | ||
| <span>{{ label }}</span> | ||
| </button> | ||
| <span class="sr-only" role="status" aria-live="polite"> | ||
| {{ state === 'copied' ? 'Prompt copied to clipboard.' : state === 'error' ? 'Could not copy prompt.' : '' }} | ||
| </span> | ||
| </template> | ||
|
|
||
| <style scoped> | ||
| .copy-prompt { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 0.5rem; | ||
| padding: 0.625rem 0.875rem; | ||
| border: 1px solid color-mix(in srgb, var(--color-brand) 45%, transparent); | ||
| border-radius: 0.5rem; | ||
| background: color-mix(in srgb, var(--color-brand) 10%, transparent); | ||
| color: var(--vp-c-text-1); | ||
| font-size: 0.875rem; | ||
| font-weight: 600; | ||
| line-height: 1.25rem; | ||
| cursor: pointer; | ||
| transition: background-color 150ms, border-color 150ms, transform 150ms; | ||
| } | ||
|
|
||
| .copy-prompt:hover { | ||
| border-color: var(--color-brand); | ||
| background: color-mix(in srgb, var(--color-brand) 16%, transparent); | ||
| transform: translateY(-1px); | ||
| } | ||
|
|
||
| .copy-prompt:focus-visible { | ||
| outline: 2px solid var(--color-brand); | ||
| outline-offset: 3px; | ||
| } | ||
|
|
||
| .copy-prompt svg { | ||
| width: 1rem; | ||
| height: 1rem; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <template> | ||
| <Badge type="danger"> | ||
| deprecated | ||
| 弃用 | ||
| </Badge> | ||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <script setup lang="ts"> | ||
| const phases = [ | ||
| { emoji: '🌑', alt: 'new moon' }, | ||
| { emoji: '🌒', alt: 'waxing crescent moon' }, | ||
| { emoji: '🌓', alt: 'first quarter moon' }, | ||
| { emoji: '🌔', alt: 'waxing gibbous moon' }, | ||
| { emoji: '🌕', alt: 'full moon' }, | ||
| { emoji: '🌖', alt: 'waning gibbous moon' }, | ||
| { emoji: '🌗', alt: 'last quarter moon' }, | ||
| { emoji: '🌘', alt: 'waning crescent moon' }, | ||
| ] | ||
|
|
||
| const phase = phases[ | ||
| Math.floor(Math.random() * phases.length) | ||
| ] | ||
| </script> | ||
|
|
||
| <template> | ||
| <span :aria-label="phase.alt">{{ phase.emoji }}</span> | ||
| </template> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When VitePress renders this component on the server, the server and browser independently call
Math.random(), so they choose different phases in roughly seven out of eight hydrations. This produces a Vue hydration mismatch and can visibly replace the emoji after load; derive the value deterministically or select it only after mounting.Useful? React with 👍 / 👎.