diff --git a/biome.json b/biome.json index b6aec6bb..2f270648 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.2.0/schema.json", + "$schema": "https://biomejs.dev/schemas/2.2.2/schema.json", "assist": { "actions": { "source": { "organizeImports": "on" } } }, "vcs": { "enabled": true, @@ -9,7 +9,13 @@ }, "files": { "ignoreUnknown": true, - "includes": ["**", "!**/*.vue", "!**/dist", "!**/dist-types"] + "includes": [ + "**", + "!**/*.vue", + "!**/dist/", + "!**/dist-types/", + "!tests/mock/tests/mockHoist.test.ts" + ] }, "formatter": { "indentStyle": "space" @@ -64,5 +70,17 @@ "useHookAtTopLevel": "off" } } - } + }, + "overrides": [ + { + "includes": ["e2e/__mocks__/**/*"], + "linter": { + "rules": { + "style": { + "useFilenamingConvention": "off" + } + } + } + } + ] } diff --git a/e2e/__mocks__/is-url.js b/e2e/__mocks__/is-url.js new file mode 100644 index 00000000..4551826e --- /dev/null +++ b/e2e/__mocks__/is-url.js @@ -0,0 +1,4 @@ +const { rs } = require('@rstest/core'); + +module.exports = () => 'is-url mock'; +module.exports.fn = rs.fn(); diff --git a/e2e/__mocks__/redux-cjs.ts b/e2e/__mocks__/redux-cjs.ts new file mode 100644 index 00000000..26e9d7a3 --- /dev/null +++ b/e2e/__mocks__/redux-cjs.ts @@ -0,0 +1,4 @@ +module.exports = { + isAction: rs.fn(), + mocked: 'redux_yes', +}; diff --git a/e2e/basic/test/index.test.ts b/e2e/basic/test/index.test.ts index acc0c215..5bc257eb 100644 --- a/e2e/basic/test/index.test.ts +++ b/e2e/basic/test/index.test.ts @@ -24,8 +24,7 @@ describe('Index', () => { }); it('should use require.resolve correctly', async () => { - expect( - require.resolve('../src/index.ts').endsWith('index.ts'), - ).toBeTruthy(); + const resolved = require.resolve('../src/index.ts'); + expect(resolved.endsWith('index.ts')).toBeTruthy(); }); }); diff --git a/e2e/dom/fixtures/package.json b/e2e/dom/fixtures/package.json index 0f95c46a..6904bc4f 100644 --- a/e2e/dom/fixtures/package.json +++ b/e2e/dom/fixtures/package.json @@ -12,7 +12,7 @@ "react-dom": "^19.1.1" }, "devDependencies": { - "@rsbuild/core": "1.5.0", + "@rsbuild/core": "1.5.6", "@rsbuild/plugin-react": "^1.3.5", "@testing-library/jest-dom": "^6.8.0", "@testing-library/dom": "^10.4.1", diff --git a/e2e/lifecycle/timeout.test.ts b/e2e/lifecycle/timeout.test.ts index 5a50fad1..03dd0b1e 100644 --- a/e2e/lifecycle/timeout.test.ts +++ b/e2e/lifecycle/timeout.test.ts @@ -34,7 +34,7 @@ describe('test timeout', () => { ), ).toBeTruthy(); expect( - logs.find((log) => log.includes('timeout.test.ts:4:10')), + logs.find((log) => log.includes('timeout.test.ts:4:1')), ).toBeTruthy(); expect( logs.find((log) => log.includes('Test Files 1 failed')), diff --git a/e2e/mock/fixtures/unmock/rstest.setup.ts b/e2e/mock/fixtures/unmock/rstest.setup.ts index 1e7706e1..42ad4b6a 100644 --- a/e2e/mock/fixtures/unmock/rstest.setup.ts +++ b/e2e/mock/fixtures/unmock/rstest.setup.ts @@ -1,4 +1,4 @@ -import { rs } from '@rstest/core'; +// import { rs } from '@rstest/core'; process.env.NODE_ENV = 'rstest:production'; diff --git a/e2e/mock/src/bar.ts b/e2e/mock/src/bar.ts new file mode 100644 index 00000000..9f173868 --- /dev/null +++ b/e2e/mock/src/bar.ts @@ -0,0 +1 @@ +export const bar = 'bar'; diff --git a/e2e/mock/src/foo.ts b/e2e/mock/src/foo.ts new file mode 100644 index 00000000..3329a7d9 --- /dev/null +++ b/e2e/mock/src/foo.ts @@ -0,0 +1 @@ +export const foo = 'foo'; diff --git a/e2e/mock/src/readSomeFile.ts b/e2e/mock/src/readSomeFile.ts index 8a2f737a..332357c7 100644 --- a/e2e/mock/src/readSomeFile.ts +++ b/e2e/mock/src/readSomeFile.ts @@ -1,5 +1,5 @@ -import { readFileSync } from 'node:fs'; +import * as fs from 'node:fs'; export function readSomeFile(path: string) { - return readFileSync(path, 'utf-8'); + return fs?.readFileSync?.(path, 'utf-8'); } diff --git a/e2e/mock/src/sum.ts b/e2e/mock/src/sum.ts new file mode 100644 index 00000000..bc2926a6 --- /dev/null +++ b/e2e/mock/src/sum.ts @@ -0,0 +1,3 @@ +import * as fooMod from './foo.js'; + +export const sum = fooMod?.foo + '1'; diff --git a/e2e/mock/tests/barrel.test.ts b/e2e/mock/tests/barrel.test.ts new file mode 100644 index 00000000..3dcf602f --- /dev/null +++ b/e2e/mock/tests/barrel.test.ts @@ -0,0 +1,11 @@ +import { expect, it, rs } from '@rstest/core'; +import * as barMod from '../src/bar'; +import { sum } from '../src/sum'; + +rs.mock('../src/foo', async () => { + return { foo: barMod.bar }; +}); + +it('sum', () => { + expect(sum).toBe('bar1'); +}); diff --git a/e2e/mock/tests/doMock.test.ts b/e2e/mock/tests/doMock.test.ts index 15951786..9b3d7876 100644 --- a/e2e/mock/tests/doMock.test.ts +++ b/e2e/mock/tests/doMock.test.ts @@ -9,6 +9,8 @@ test('doMock works', async () => { increment: (num: number) => num + 10, })); + rs.requireActual('../src/increment'); // Ensure the module is re-evaluated + const { increment: incrementWith10 } = await import('../src/increment'); expect(incrementWith10(1)).toBe(11); }); diff --git a/e2e/mock/tests/doMockRequire.test.ts b/e2e/mock/tests/doMockRequire.test.ts index f17feee4..3b4254af 100644 --- a/e2e/mock/tests/doMockRequire.test.ts +++ b/e2e/mock/tests/doMockRequire.test.ts @@ -1,6 +1,6 @@ import { expect, rs, test } from '@rstest/core'; -test('doMockRequire works', () => { +test('doMockRequire works', async () => { const { increment: incrementWith1 } = require('../src/increment'); expect(incrementWith1(1)).toBe(2); @@ -8,12 +8,13 @@ test('doMockRequire works', () => { increment: (num: number) => num + 10, })); - const { increment: incrementWith10 } = require('../src/increment'); + rs.requireActual('../src/increment'); // Ensure the module is re-evaluated + const { increment: incrementWith10 } = require('../src/increment'); expect(incrementWith10(1)).toBe(11); }); -test('the second doMockRequire can override the first doMockRequire', () => { +test('the second doMockRequire can override the first doMockRequire', async () => { rs.doMockRequire('../src/increment', () => ({ increment: (num: number) => num + 10, })); @@ -30,3 +31,25 @@ test('the second doMockRequire can override the first doMockRequire', () => { expect(incrementWith20(1)).toBe(21); }); + +test('the third doMockRequire can override the second doMockRequire', async () => { + rs.doMockRequire('../src/increment', () => { + return { + increment: (num: number) => num + 100, + }; + }); + + const { increment: incrementWith1 } = require('../src/increment'); + + expect(incrementWith1(1)).toBe(101); + + rs.doMockRequire('../src/increment', () => { + return { + increment: (num: number) => num + 200, + }; + }); + + const { increment: incrementWith20 } = require('../src/increment'); + + expect(incrementWith20(1)).toBe(201); +}); diff --git a/e2e/mock/tests/importMock.test.ts b/e2e/mock/tests/importMock.test.ts new file mode 100644 index 00000000..ff15dfce --- /dev/null +++ b/e2e/mock/tests/importMock.test.ts @@ -0,0 +1,12 @@ +import { expect, rs, test } from '@rstest/core'; +import * as redux from 'redux'; + +test('importMock works', async () => { + const { default: redux } = await rs.importMock('redux'); + await redux.isAction('string'); + expect(redux.isAction).toHaveBeenCalledWith('string'); +}); + +test('actual redux is not mocked (ESM)', async () => { + expect(rs.isMockFunction(redux.isAction)).toBe(false); +}); diff --git a/e2e/mock/tests/loadMock.test.ts b/e2e/mock/tests/loadMock.test.ts deleted file mode 100644 index 60cbc46f..00000000 --- a/e2e/mock/tests/loadMock.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect, rs, test } from '@rstest/core'; -import * as redux from 'redux'; - -test('importMock works', async () => { - const { default: rx } = await rs.importMock('redux'); - await rx.isAction('string'); - expect(rx.isAction).toHaveBeenCalledWith('string'); -}); - -test('actual redux is not mocked (ESM)', async () => { - expect(rs.isMockFunction(redux.isAction)).toBe(false); -}); - -test('requireMock works', async () => { - const rx = rs.requireMock('redux').default; - await rx.isAction('string'); - expect(rx.isAction).toHaveBeenCalledWith('string'); -}); - -test('actual redux is not mocked (CJS)', async () => { - const rx = require('redux'); - expect(rs.isMockFunction(rx.isAction)).toBe(false); -}); diff --git a/e2e/mock/tests/mockHoist.test.ts b/e2e/mock/tests/mockHoist.test.ts index fa62baa1..1f649690 100644 --- a/e2e/mock/tests/mockHoist.test.ts +++ b/e2e/mock/tests/mockHoist.test.ts @@ -1,17 +1,20 @@ +/** biome-ignore-all assist/source/organizeImports: ../src/c should come after ../src/d */ + import { expect, it, rs } from '@rstest/core'; -import { c } from '../src/c'; import { d } from '../src/d'; +// @ts-expect-error it's has been mocked +import { c, dd } from '../src/c'; rs.mock('../src/c', () => { return { c: rs.fn(), - d, + dd: d, }; }); it('mocked c', async () => { - // @ts-expect-error: It has been mocked. + // @ts-expect-error it's has been mocked c('c'); expect(c).toHaveBeenCalledWith('c'); - expect(d).toBe(4); + expect(dd).toBe(4); }); diff --git a/e2e/mock/tests/mockRequire.test.ts b/e2e/mock/tests/mockRequire.test.ts index eb43fca3..6d8c6740 100644 --- a/e2e/mock/tests/mockRequire.test.ts +++ b/e2e/mock/tests/mockRequire.test.ts @@ -1,10 +1,10 @@ import { expect, it, rs } from '@rstest/core'; -rs.mockRequire('redux'); +rs.mockRequire('is-url'); -it('mocked redux', () => { - const redux = require('redux').default; - redux.isAction('string'); - expect(redux.isAction).toHaveBeenCalledWith('string'); - expect(redux.mocked).toBe('redux_yes'); +it('mocked is-url', () => { + const isUrl = require('is-url'); + isUrl.fn('string'); + expect(isUrl.fn).toHaveBeenCalledWith('string'); + expect(isUrl()).toBe('is-url mock'); }); diff --git a/e2e/mock/tests/reduxMocked.test.ts b/e2e/mock/tests/reduxMocked.test.ts index f370735e..95fb20b3 100644 --- a/e2e/mock/tests/reduxMocked.test.ts +++ b/e2e/mock/tests/reduxMocked.test.ts @@ -17,12 +17,8 @@ it('importActual works', async () => { }); it('requireActual and importActual works together', async () => { - // const rxEsm = await rs.importActual('redux'); const rxCjs = rs.requireActual('redux'); expect(rs.isMockFunction(rxCjs.isAction)).toBe(false); expect(typeof rxCjs.applyMiddleware).toBe('function'); - - // TODO: https://github.com/web-infra-dev/rspack/pull/11111 breaks resolved module in external function, - // which will be fixed in the near future. - // expect(rxEsm.compose).not.toBe(rxCjs.compose); + expect(redux.compose).not.toBe(rxCjs.compose); }); diff --git a/e2e/mock/tests/requireActual.test.ts b/e2e/mock/tests/requireActual.test.ts deleted file mode 100644 index 3487e601..00000000 --- a/e2e/mock/tests/requireActual.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { expect, it, rs } from '@rstest/core'; - -const axios = require('axios').default; - -rs.mockRequire('axios'); - -it('mocked axios (axios is externalized)', async () => { - await axios.get('string'); - expect(axios.get).toHaveBeenCalledWith('string'); - expect(axios.mocked).toBe('axios_mocked'); - expect(axios.post).toBeUndefined(); -}); - -it('use `requireActual` to require actual axios', async () => { - const originalAxios = await rs.requireActual('axios'); - expect(rs.isMockFunction(originalAxios.get)).toBe(false); - expect(originalAxios.mocked).toBeUndefined(); - expect(typeof originalAxios.AxiosHeaders).toBe('function'); -}); diff --git a/e2e/mock/tests/requireMock.test.ts b/e2e/mock/tests/requireMock.test.ts new file mode 100644 index 00000000..fa1ddb66 --- /dev/null +++ b/e2e/mock/tests/requireMock.test.ts @@ -0,0 +1,12 @@ +import { expect, rs, test } from '@rstest/core'; + +test('requireMock works', async () => { + const redux = rs.requireMock('redux-cjs'); + await redux.isAction('string'); + expect(redux.isAction).toHaveBeenCalledWith('string'); +}); + +test('actual redux is not mocked (CJS)', async () => { + const redux = require('redux'); + expect(rs.isMockFunction(redux.isAction)).toBe(false); +}); diff --git a/e2e/package.json b/e2e/package.json index 3ffab577..e0c9cccc 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -7,12 +7,14 @@ "typecheck": "tsc --noEmit" }, "devDependencies": { - "@rsbuild/core": "1.5.0", - "@rslib/core": "0.12.2", + "@rsbuild/core": "1.5.6", + "@rslib/core": "0.13.2", "@rstest/core": "workspace:*", "@rstest/tsconfig": "workspace:*", "@types/jest-image-snapshot": "^6.4.0", "axios": "^1.11.0", + "is-url": "^1.2.4", + "@types/is-url": "^1.2.32", "jest-image-snapshot": "^6.5.1", "memfs": "^4.38.2", "pathe": "^2.0.3", @@ -21,5 +23,8 @@ "strip-ansi": "^7.1.0", "tinyexec": "^1.0.1", "typescript": "^5.9.2" + }, + "dependencies": { + "@types/is-url": "^1.2.32" } } diff --git a/e2e/projects/fixtures/packages/client/package.json b/e2e/projects/fixtures/packages/client/package.json index f36c4a50..478ffb13 100644 --- a/e2e/projects/fixtures/packages/client/package.json +++ b/e2e/projects/fixtures/packages/client/package.json @@ -12,7 +12,7 @@ "react-dom": "^19.1.1" }, "devDependencies": { - "@rsbuild/core": "1.5.0", + "@rsbuild/core": "1.5.6", "@rsbuild/plugin-react": "^1.3.5", "@testing-library/jest-dom": "^6.8.0", "@testing-library/dom": "^10.4.1", diff --git a/e2e/rstest.config.ts b/e2e/rstest.config.ts index 6c24f98d..11472480 100644 --- a/e2e/rstest.config.ts +++ b/e2e/rstest.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from '@rstest/core'; export default defineConfig({ setupFiles: ['../scripts/rstest.setup.ts'], testTimeout: process.env.CI ? 10_000 : 5_000, + globals: true, slowTestThreshold: 2_000, output: { externals: { diff --git a/e2e/test-api/fixtures/moduleNotFound.test.ts b/e2e/test-api/fixtures/moduleNotFound.test.ts index 93ea66ad..4dc46cc9 100644 --- a/e2e/test-api/fixtures/moduleNotFound.test.ts +++ b/e2e/test-api/fixtures/moduleNotFound.test.ts @@ -21,6 +21,6 @@ it('test expectNotFound error', async () => { it('test expectNotFound error', async () => { await expect(unexpectNotFound()).rejects.toThrowError( - /Cannot find module 'aaa'/, + '[Rstest] Cannot find module "aaa"', ); }); diff --git a/e2e/test-api/timeout.test.ts b/e2e/test-api/timeout.test.ts index 4d36d146..56af60e2 100644 --- a/e2e/test-api/timeout.test.ts +++ b/e2e/test-api/timeout.test.ts @@ -21,13 +21,13 @@ describe('Test timeout', () => { logs.find((log) => log.includes('Error: test timed out in 50ms')), ).toBeTruthy(); expect( - logs.find((log) => log.includes('timeout.test.ts:5:5')), + logs.find((log) => log.includes('timeout.test.ts:5:3')), ).toBeTruthy(); expect( logs.find((log) => log.includes('Error: test timed out in 5000ms')), ).toBeTruthy(); expect( - logs.find((log) => log.includes('timeout.test.ts:10:5')), + logs.find((log) => log.includes('timeout.test.ts:10:3')), ).toBeTruthy(); expect(logs.find((log) => log.includes('Tests 2 failed'))).toBeTruthy(); }, 10000); diff --git a/e2e/test-api/timeoutConfig.test.ts b/e2e/test-api/timeoutConfig.test.ts index 9f3f004f..6087ea50 100644 --- a/e2e/test-api/timeoutConfig.test.ts +++ b/e2e/test-api/timeoutConfig.test.ts @@ -22,7 +22,7 @@ describe('Test timeout configuration', () => { logs.find((log) => log.includes('Error: test timed out in 50ms')), ).toBeTruthy(); expect( - logs.find((log) => log.includes('timeout.test.ts:5:5')), + logs.find((log) => log.includes('timeout.test.ts:5:3')), ).toBeTruthy(); expect( diff --git a/e2e/vue/fixtures/package.json b/e2e/vue/fixtures/package.json index 716d7392..d56830d7 100644 --- a/e2e/vue/fixtures/package.json +++ b/e2e/vue/fixtures/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@rstest/core": "workspace:*", - "@rsbuild/core": "1.5.0", + "@rsbuild/core": "1.5.6", "@rsbuild/plugin-babel": "^1.0.6", "@rsbuild/plugin-vue": "^1.1.2", "@rsbuild/plugin-vue-jsx": "^1.1.1", diff --git a/e2e/watch/index.test.ts b/e2e/watch/index.test.ts index 161c9028..0d7097ff 100644 --- a/e2e/watch/index.test.ts +++ b/e2e/watch/index.test.ts @@ -48,7 +48,10 @@ describe('watch', () => { await cli.waitForStdout('Duration'); expect(cli.stdout).toMatch('Tests 2 passed'); - expect(cli.stdout).toMatch(/Test files to re-run.*:\n.*bar\.test\.ts\n\n/); + // Updated as the shared module `src/index.ts` is extracted into another chunk. + expect(cli.stdout).toMatch( + /Test files to re-run.*:\n.*bar\.test\.ts\n.*index\.test\.ts\n\n/, + ); // update cli.resetStd(); @@ -65,8 +68,11 @@ describe('watch', () => { cli.resetStd(); fs.delete('./fixtures-test-0/bar.test.ts'); await cli.waitForStdout('Duration'); - expect(cli.stdout).toMatch('No test files need re-run.'); expect(cli.stdout).toMatch('Test Files 1 passed'); + // Updated as extracting the shared module `src/index.ts` is into another chunk in reverted. + expect(cli.stdout).toMatch( + /Test files to re-run.*:\n.*index\.test\.ts\n\n/, + ); cli.exec.kill(); }); diff --git a/examples/react/package.json b/examples/react/package.json index 4b979974..a9c14852 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -13,7 +13,7 @@ "react-dom": "^19.1.1" }, "devDependencies": { - "@rsbuild/core": "1.5.0", + "@rsbuild/core": "1.5.6", "@rsbuild/plugin-react": "^1.3.5", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.8.0", diff --git a/examples/react/src/App.tsx b/examples/react/src/App.tsx index dff17512..61b021d7 100644 --- a/examples/react/src/App.tsx +++ b/examples/react/src/App.tsx @@ -1,9 +1,11 @@ import './App.css'; +import { h2Title } from './module'; const App = () => { return (

Rsbuild with React

+

{h2Title()}

Start building amazing things with Rsbuild.

); diff --git a/examples/react/src/module.ts b/examples/react/src/module.ts new file mode 100644 index 00000000..85df6d9a --- /dev/null +++ b/examples/react/src/module.ts @@ -0,0 +1 @@ +export const h2Title = () => 'example'; diff --git a/examples/react/test/App.test.tsx b/examples/react/test/App.test.tsx index 965fb3af..d263d39a 100644 --- a/examples/react/test/App.test.tsx +++ b/examples/react/test/App.test.tsx @@ -1,12 +1,19 @@ -import { expect, test } from '@rstest/core'; +import { expect, rs, test } from '@rstest/core'; import { render, screen } from '@testing-library/react'; import App from '../src/App'; +rs.mock('../src/module', async () => ({ + h2Title: () => 'mocked', +})); + test('should render App correctly', async () => { render(); - const element = screen.getByText('Rsbuild with React'); + const h1 = screen.getByText('Rsbuild with React'); + expect(h1.tagName).toBe('H1'); + expect(h1).toBeInTheDocument(); - expect(element.tagName).toBe('H1'); - expect(element).toBeInTheDocument(); + const h2 = screen.getByText('mocked'); + expect(h2.tagName).toBe('H2'); + expect(h2).toBeInTheDocument(); }); diff --git a/packages/core/LICENSE.md b/packages/core/LICENSE.md index d87a0bf1..4c5f28bd 100644 --- a/packages/core/LICENSE.md +++ b/packages/core/LICENSE.md @@ -656,18 +656,6 @@ Licensed under MIT license in the repository at git@github.com:colorjs/color-nam > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -### fdir - -Licensed under MIT license in the repository at git+https://github.com/thecodrr/fdir.git. - -> Copyright 2023 Abdullah Atta -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ### has-flag Licensed under MIT license. @@ -737,7 +725,7 @@ Licensed under MIT license. ### magic-string -Licensed under MIT license. +Licensed under MIT license in the repository at https://github.com/rich-harris/magic-string.git. > Copyright 2018 Rich Harris > diff --git a/packages/core/package.json b/packages/core/package.json index 4966adf9..2c4ca39b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -52,8 +52,9 @@ "dependencies": { "chai": "^5.3.3", "@types/chai": "^5.2.2", - "@rsbuild/core": "1.5.0", + "@rsbuild/core": "1.5.6", "birpc": "2.5.0", + "es-module-lexer": "^1.7.0", "pathe": "^2.0.3", "std-env": "^3.9.0", "tinypool": "^1.1.1" @@ -64,7 +65,7 @@ "@babel/code-frame": "^7.27.1", "@jridgewell/trace-mapping": "0.3.30", "@microsoft/api-extractor": "^7.52.11", - "@rslib/core": "0.12.2", + "@rslib/core": "0.13.2", "@rstest/tsconfig": "workspace:*", "@sinonjs/fake-timers": "^14.0.0", "@types/babel__code-frame": "^7.0.6", @@ -79,6 +80,7 @@ "jest-diff": "^30.0.5", "jsdom": "^26.1.0", "license-webpack-plugin": "^4.0.2", + "magic-string": "^0.30.17", "picocolors": "^1.1.1", "rslog": "^1.2.11", "source-map-support": "^0.5.21", diff --git a/packages/core/rslib.config.ts b/packages/core/rslib.config.ts index 0565dda8..45329486 100644 --- a/packages/core/rslib.config.ts +++ b/packages/core/rslib.config.ts @@ -36,6 +36,16 @@ export default defineConfig({ util: 'node:util', path: 'node:path', }, + copy: [ + { + from: 'src/core/plugins/mockRuntimeCode.js', + to: 'mockRuntimeCode.js', + }, + { + from: 'src/core/plugins/mockLoader.mjs', + to: 'mockLoader.mjs', + }, + ], minify: { jsOptions: { minimizerOptions: { @@ -75,7 +85,7 @@ export default defineConfig({ tools: { rspack: { // fix licensePlugin watch error: ResourceData has been dropped by Rust. - plugins: isBuildWatch ? [] : [licensePlugin()], + plugins: [isBuildWatch ? null : licensePlugin()].filter(Boolean), }, }, }, diff --git a/packages/core/src/core/plugins/external.ts b/packages/core/src/core/plugins/external.ts index 883058ea..2cae0221 100644 --- a/packages/core/src/core/plugins/external.ts +++ b/packages/core/src/core/plugins/external.ts @@ -71,7 +71,7 @@ function autoExternalNodeBuiltin( callback( undefined, request, - dependencyType === 'commonjs' ? 'commonjs' : 'module-import', + dependencyType === 'commonjs' ? 'commonjs' : 'import', ); } else { callback(); diff --git a/packages/core/src/core/plugins/mock.ts b/packages/core/src/core/plugins/mock.ts new file mode 100644 index 00000000..c91ab684 --- /dev/null +++ b/packages/core/src/core/plugins/mock.ts @@ -0,0 +1,65 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import type { RsbuildPlugin, Rspack } from '@rsbuild/core'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +class MockRuntimeRspackPlugin { + apply(compiler: Rspack.Compiler) { + const { RuntimeModule } = compiler.webpack; + + class RetestImportRuntimeModule extends RuntimeModule { + constructor() { + super('rstest runtime'); + } + + override generate() { + const code = fs.readFileSync( + path.join(__dirname, './mockRuntimeCode.js'), + 'utf8', + ); + + return code; + } + } + + compiler.hooks.thisCompilation.tap('CustomPlugin', (compilation) => { + compilation.hooks.additionalTreeRuntimeRequirements.tap( + 'CustomPlugin', + (chunk) => { + compilation.addRuntimeModule(chunk, new RetestImportRuntimeModule()); + }, + ); + }); + } +} + +export const pluginMock: RsbuildPlugin = { + name: 'rstest:mock-runtime', + setup: (api) => { + api.modifyRspackConfig((rspackConfig) => { + rspackConfig.output.asyncChunks = false; + // TODO: remove this line after https://github.com/web-infra-dev/rspack/issues/11247 is resolved. + rspackConfig.experiments!.incremental = false; + }); + + api.modifyBundlerChain((chain, utils) => { + chain + .plugin('RemoveDuplicateModulesPlugin') + .use(utils.rspack.experiments.RemoveDuplicateModulesPlugin); + // add mock-loader to this rule + chain.module + .rule(utils.CHAIN_ID.RULE.JS) + .use('mock-loader') + .loader(path.resolve(__dirname, './mockLoader.mjs')) + // Right after SWC to only handle JS/TS files. + .before(utils.CHAIN_ID.USE.SWC) + .end(); + }); + + api.modifyRspackConfig(async (config) => { + config.plugins.push(new MockRuntimeRspackPlugin()); + }); + }, +}; diff --git a/packages/core/src/core/plugins/mockLoader.mjs b/packages/core/src/core/plugins/mockLoader.mjs new file mode 100644 index 00000000..52a3f28f --- /dev/null +++ b/packages/core/src/core/plugins/mockLoader.mjs @@ -0,0 +1,185 @@ +import { init, parse } from 'es-module-lexer'; +import MagicString from 'magic-string'; + +/** + * A webpack/rspack loader that transforms static imports to top-level await dynamic imports + * Example: import x from 'b' -> const x = await import('b') + */ +export default async function mockLoader(source, map) { + const callback = this.async(); + + try { + // Initialize es-module-lexer + await init; + + // Parse the source to find static imports + const [imports] = parse(source); + + const magicString = new MagicString(source); + + const transformations = []; + const isPureCjs = source.includes('module.exports = '); + const flag = isPureCjs ? '; export {};' : '; export {};'; + + // Collect transformations so we can hoist them later while keeping order + for (let i = 0; i < imports.length; i++) { + const importInfo = imports[i]; + const { ss: start, se: end, d: dynamicStart } = importInfo; + + // Skip dynamic imports (they already have d >= 0) + if (dynamicStart >= 0) continue; + + // Extract the import statement + const importStatement = source.slice(start, end); + + // Parse different import patterns + let transformedImport = ''; + + // Match: import defaultImport from 'module' + const defaultImportMatch = importStatement.match( + /import\s+(\w+)\s+from\s+['"`]([^'"`]+)['"`]/, + ); + if (defaultImportMatch) { + const [, defaultName, moduleName] = defaultImportMatch; + transformedImport = `const ${defaultName} = (await import('${moduleName}')).default`; + } + + // Match: import * as namespace from 'module' + const namespaceImportMatch = importStatement.match( + /import\s+\*\s+as\s+(\w+)\s+from\s+['"`]([^'"`]+)['"`]/, + ); + if (namespaceImportMatch) { + const [, namespaceName, moduleName] = namespaceImportMatch; + transformedImport = `const ${namespaceName} = await import('${moduleName}')`; + } + + // Match: import { named1, named2 } from 'module' + const namedImportMatch = importStatement.match( + /import\s+\{([^}]+)\}\s+from\s+['"`]([^'"`]+)['"`]/, + ); + if (namedImportMatch) { + const [, namedImports, moduleName] = namedImportMatch; + const imports = namedImports + .split(',') + .map((imp) => { + const trimmed = imp.trim(); + // Handle 'as' aliases: import { foo as bar } from 'module' + const aliasMatch = trimmed.match(/(\w+)\s+as\s+(\w+)/); + if (aliasMatch) { + return `${aliasMatch[1]}: ${aliasMatch[2]}`; + } + return trimmed; + }) + .join(', '); + + transformedImport = `const { ${imports} } = await import('${moduleName}')`; + } + + // Match: import 'module' (side-effect import) + const sideEffectImportMatch = importStatement.match( + /import\s+['"`]([^'"`]+)['"`]/, + ); + if ( + sideEffectImportMatch && + !defaultImportMatch && + !namespaceImportMatch && + !namedImportMatch + ) { + const [, moduleName] = sideEffectImportMatch; + transformedImport = `await import('${moduleName}')`; + } + + // Match: import defaultImport, { named1, named2 } from 'module' + const mixedImportMatch = importStatement.match( + /import\s+(\w+)\s*,\s*\{([^}]+)\}\s+from\s+['"`]([^'"`]+)['"`]/, + ); + if (mixedImportMatch) { + const [, defaultName, namedImports, moduleName] = mixedImportMatch; + const imports = namedImports + .split(',') + .map((imp) => { + const trimmed = imp.trim(); + const aliasMatch = trimmed.match(/(\w+)\s+as\s+(\w+)/); + if (aliasMatch) { + return `${aliasMatch[2]}: ${aliasMatch[1]}`; + } + return trimmed; + }) + .join(', '); + const safeModuleName = moduleName.replace(/[^a-zA-Z0-9_]/g, '_'); + transformedImport = `const __rstest_import_${safeModuleName} = await import('${moduleName}'); +const ${defaultName} = __rstest_import_${safeModuleName}.default; +const { ${imports} } = __rstest_import_${safeModuleName}`; + } + + // Match: import defaultImport, * as namespace from 'module' + const mixedNamespaceImportMatch = importStatement.match( + /import\s+(\w+)\s*,\s*\*\s+as\s+(\w+)\s+from\s+['"`]([^'"`]+)['"`]/, + ); + if (mixedNamespaceImportMatch) { + const [, defaultName, namespaceName, moduleName] = + mixedNamespaceImportMatch; + const safeModuleName = moduleName.replace(/[^a-zA-Z0-9_]/g, '_'); + transformedImport = `const __rstest_import_${safeModuleName} = await import('${moduleName}');\nconst ${defaultName} = __rstest_import_${safeModuleName}.default;\nconst ${namespaceName} = __rstest_import_${safeModuleName}`; + } + + // Apply the transformation + if (transformedImport) { + transformations.push({ + start, + end, + code: transformedImport + flag, + }); + } + } + + // Remove the original import statements from bottom to top + for (let i = transformations.length - 1; i >= 0; i--) { + const { start, end } = transformations[i]; + let removalEnd = end; + + while ( + removalEnd < source.length && + source[removalEnd] !== '\n' && + source.slice(removalEnd, removalEnd + 2) !== '\r\n' + ) { + removalEnd += 1; + } + + if (source.slice(removalEnd, removalEnd + 2) === '\r\n') { + removalEnd += 2; + } else if (source[removalEnd] === '\n') { + removalEnd += 1; + } + + magicString.remove(start, removalEnd); + } + + if (transformations.length > 0) { + const hoistedCode = transformations.map(({ code }) => code).join('\n'); + + const shebangEnd = source.startsWith('#!') + ? source.indexOf('\n') + 1 || source.length + : 0; + + let insertion = `${hoistedCode}\n`; + if (shebangEnd > 0 && source[shebangEnd - 1] !== '\n') { + insertion = `\n${insertion}`; + } + + magicString.prependLeft(shebangEnd, insertion); + } + + const result = magicString.toString(); + const newMap = magicString.generateMap({ + source: this.resourcePath, + includeContent: true, + hires: true, + }); + newMap.names = map?.names ?? newMap.names; + + callback(null, result, map ?? newMap); + } catch (error) { + callback(error); + } +} diff --git a/packages/core/src/core/plugins/mockRuntime.ts b/packages/core/src/core/plugins/mockRuntime.ts deleted file mode 100644 index 47214aa7..00000000 --- a/packages/core/src/core/plugins/mockRuntime.ts +++ /dev/null @@ -1,133 +0,0 @@ -import type { RsbuildPlugin, Rspack } from '@rsbuild/core'; - -class MockRuntimeRspackPlugin { - apply(compiler: Rspack.Compiler) { - const { RuntimeModule } = compiler.webpack; - class RetestImportRuntimeModule extends RuntimeModule { - constructor() { - super('rstest runtime'); - } - - override generate() { - // Rstest runtime code should be prefixed with `rstest_` to avoid conflicts with other runtimes. - return ` -if (typeof __webpack_require__ === 'undefined') { - return; -} - -const originalRequire = __webpack_require__; -__webpack_require__ = function(...args) { - try { - return originalRequire(...args); - } catch (e) { - const errMsg = e.message ?? e.toString(); - if (errMsg.includes('__webpack_modules__[moduleId] is not a function')) { - throw new Error(\`Cannot find module '\${args[0]}'\`) - } - throw e; - } -}; - -Object.keys(originalRequire).forEach(key => { - __webpack_require__[key] = originalRequire[key]; -}); - -__webpack_require__.rstest_original_modules = {}; - -__webpack_require__.rstest_reset_modules = () => { - const mockedIds = Object.keys(__webpack_require__.rstest_original_modules) - Object.keys(__webpack_module_cache__).forEach(id => { - // Do not reset mocks registry. - if (!mockedIds.includes(id)) { - delete __webpack_module_cache__[id]; - } - }); -} - -__webpack_require__.rstest_unmock = (id) => { - delete __webpack_module_cache__[id] -} - -__webpack_require__.rstest_require_actual = __webpack_require__.rstest_import_actual = (id) => { - const originalModule = __webpack_require__.rstest_original_modules[id]; - // Use fallback module if the module is not mocked. - const fallbackMod = __webpack_require__(id); - return originalModule ? originalModule : fallbackMod; -} - -__webpack_require__.rstest_exec = async (id, modFactory) => { - if (__webpack_module_cache__) { - let asyncFactory = __webpack_module_cache__[id]; - if (asyncFactory && asyncFactory.constructor.name === 'AsyncFunction') { - await asyncFactory(); - } - } -}; - -__webpack_require__.rstest_mock = (id, modFactory) => { - let requiredModule = undefined - try { - requiredModule = __webpack_require__(id); - } catch { - // TODO: non-resolved module - } finally { - __webpack_require__.rstest_original_modules[id] = requiredModule; - } - if (typeof modFactory === 'string' || typeof modFactory === 'number') { - __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; - } else if (typeof modFactory === 'function') { - if (modFactory.constructor.name === 'AsyncFunction') { - __webpack_module_cache__[id] = async () => { - const exports = await modFactory(); - __webpack_require__.r(exports); - __webpack_module_cache__[id] = { exports, id, loaded: true }; - } - } else { - const exports = modFactory(); - __webpack_require__.r(exports); - __webpack_module_cache__[id] = { exports, id, loaded: true }; - } - } -}; - -__webpack_require__.rstest_do_mock = (id, modFactory) => { - let requiredModule = undefined - try { - requiredModule = __webpack_require__(id); - } catch { - // TODO: non-resolved module - } finally { - __webpack_require__.rstest_original_modules[id] = requiredModule; - } - if (typeof modFactory === 'string' || typeof modFactory === 'number') { - __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; - } else if (typeof modFactory === 'function') { - const exports = modFactory(); - __webpack_require__.r(exports); - __webpack_module_cache__[id] = { exports, id, loaded: true }; - } -}; - -`; - } - } - - compiler.hooks.thisCompilation.tap('CustomPlugin', (compilation) => { - compilation.hooks.additionalTreeRuntimeRequirements.tap( - 'CustomPlugin', - (chunk) => { - compilation.addRuntimeModule(chunk, new RetestImportRuntimeModule()); - }, - ); - }); - } -} - -export const pluginMockRuntime: RsbuildPlugin = { - name: 'rstest:mock-runtime', - setup: (api) => { - api.modifyRspackConfig(async (config) => { - config.plugins.push(new MockRuntimeRspackPlugin()); - }); - }, -}; diff --git a/packages/core/src/core/plugins/mockRuntimeCode.js b/packages/core/src/core/plugins/mockRuntimeCode.js new file mode 100644 index 00000000..2f0440c4 --- /dev/null +++ b/packages/core/src/core/plugins/mockRuntimeCode.js @@ -0,0 +1,219 @@ +/** biome-ignore-all lint/complexity/useArrowFunction: */ +// Rstest runtime code should be prefixed with `rstest_` to avoid conflicts with other runtimes. + +const originalRequire = __webpack_require__; +const utils = require('node:util'); + +__webpack_require__ = function (...args) { + try { + const moduleId = args[0]; + const cached = __webpack_module_cache__[moduleId]; + const exports = cached?.exports; + + const isNotResolved = + exports instanceof Promise && + utils.inspect(exports).startsWith('Promise {\n ,'); + + if (isNotResolved && cached && cached.exports) { + // TODO: support circular dependency ;) + // Currently, without the error throwing below, circular dependency will raise dead lock of interdependent promises. + // To resolve the issue, we need: + // 1. get the exports inside the Promise and return it directly + // 2. change all named import to namespace import and evaluate the real value in runtime instead of when init the module. + // const originalExports = cached?._rstest_exports?.(); // _rstest_exports and escape for real export inside promise + // if (originalExports) { + // return originalExports; + // } + console.warn( + `[Rstest] Circular dependency of module "${moduleId}" is detected, please consider resolve the circular dependency.`, + ); + } + const result = originalRequire(...args); + return result; + } catch (e) { + const errMsg = e.message ?? e.toString(); + if (errMsg.includes('__webpack_modules__[moduleId] is not a function')) { + throw new Error(`[Rstest] Cannot find module "${args[0]}"`); + } + throw e; + } +}; + +Object.keys(originalRequire).forEach((key) => { + __webpack_require__[key] = originalRequire[key]; +}); + +__webpack_require__.rstest_original_modules = {}; +__webpack_require__.rstest_original_module_factories = {}; + +//#region rs.unmock +__webpack_require__.rstest_unmock = (id) => { + const originalModuleFactory = + __webpack_require__.rstest_original_module_factories[id]; + + if (originalModuleFactory) { + __webpack_modules__[id] = originalModuleFactory; + } + + delete __webpack_module_cache__[id]; +}; +//#endregion + +//#region rs.doUnmock +__webpack_require__.rstest_do_unmock = __webpack_require__.rstest_unmock; +//#endregion + +//#region rs.requireActual +__webpack_require__.rstest_require_actual = + __webpack_require__.rstest_import_actual = (id) => { + const originalModule = __webpack_require__.rstest_original_modules[id]; + // Use fallback module if the module is not mocked. + const fallbackMod = __webpack_require__(id); + return originalModule ? originalModule : fallbackMod; + }; +//#endregion + +// #region rs.mock +__webpack_require__.rstest_mock = (id, modFactory) => { + let requiredModule = undefined; + try { + requiredModule = __webpack_require__(id); + } catch { + // TODO: non-resolved module + } finally { + __webpack_require__.rstest_original_modules[id] = requiredModule; + __webpack_require__.rstest_original_module_factories[id] = + __webpack_modules__[id]; + } + if (typeof modFactory === 'string' || typeof modFactory === 'number') { + __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; + } else if (typeof modFactory === 'function') { + const isAsync = modFactory.constructor.name === 'AsyncFunction'; + if (isAsync) { + const finalModFactory = function ( + module, + __webpack_exports__, + __webpack_require__, + ) { + __webpack_require__.a( + module, + async function ( + __webpack_handle_async_dependencies__, + __webpack_async_result__, + ) { + try { + const res = await modFactory(); + for (const key in res) { + __webpack_require__.d(__webpack_exports__, { + [key]: () => res[key], + }); + } + + __webpack_require__.r(__webpack_exports__); + __webpack_async_result__(); + } catch (e) { + __webpack_async_result__(e); + } + }, + ); + }; + + __webpack_modules__[id] = finalModFactory; + delete __webpack_module_cache__[id]; + } else { + const finalModFactory = function ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__, + ) { + __webpack_require__.r(__webpack_exports__); + const res = modFactory(); + for (const key in res) { + __webpack_require__.d(__webpack_exports__, { + [key]: () => res[key], + }); + } + }; + + __webpack_modules__[id] = finalModFactory; + delete __webpack_module_cache__[id]; + } + } +}; +// #endregion + +// #region rs.mockRequire +__webpack_require__.rstest_mock_require = (id, modFactory) => { + let requiredModule = undefined; + try { + requiredModule = __webpack_require__(id); + } catch { + // TODO: non-resolved module + } finally { + __webpack_require__.rstest_original_modules[id] = requiredModule; + __webpack_require__.rstest_original_module_factories[id] = + __webpack_modules__[id]; + } + if (typeof modFactory === 'string' || typeof modFactory === 'number') { + __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; + } else if (typeof modFactory === 'function') { + const exports = modFactory(); + __webpack_require__.r(exports); + __webpack_module_cache__[id] = { exports, id, loaded: true }; + } +}; +// #endregion + +// #region rs.doMock +__webpack_require__.rstest_do_mock = (id, modFactory) => { + let requiredModule = undefined; + try { + requiredModule = __webpack_require__(id); + } catch { + // TODO: non-resolved module + } finally { + __webpack_require__.rstest_original_modules[id] = requiredModule; + __webpack_require__.rstest_original_module_factories[id] = + __webpack_modules__[id]; + } + if (typeof modFactory === 'string' || typeof modFactory === 'number') { + __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; + } else if (typeof modFactory === 'function') { + const exports = modFactory(); + __webpack_require__.r(exports); + __webpack_module_cache__[id] = { exports, id, loaded: true }; + } +}; + +// #region rs.doMockRequire +__webpack_require__.rstest_do_mock_require = (id, modFactory) => { + let requiredModule = undefined; + try { + requiredModule = __webpack_require__(id); + } catch { + // TODO: non-resolved module + } finally { + __webpack_require__.rstest_original_modules[id] = requiredModule; + __webpack_require__.rstest_original_module_factories[id] = + __webpack_modules__[id]; + } + if (typeof modFactory === 'string' || typeof modFactory === 'number') { + __webpack_module_cache__[id] = { exports: __webpack_require__(modFactory) }; + } else if (typeof modFactory === 'function') { + const exports = modFactory(); + __webpack_require__.r(exports); + __webpack_module_cache__[id] = { exports, id, loaded: true }; + } +}; + +//#region rs.reset_modules +__webpack_require__.rstest_reset_modules = () => { + const mockedIds = Object.keys(__webpack_require__.rstest_original_modules); + Object.keys(__webpack_module_cache__).forEach((id) => { + // Do not reset mocks registry. + if (!mockedIds.includes(id)) { + delete __webpack_module_cache__[id]; + } + }); +}; +//#endregion diff --git a/packages/core/src/core/rsbuild.ts b/packages/core/src/core/rsbuild.ts index 9329b385..9f66e0e2 100644 --- a/packages/core/src/core/rsbuild.ts +++ b/packages/core/src/core/rsbuild.ts @@ -20,7 +20,7 @@ import { pluginEntryWatch } from './plugins/entry'; import { pluginExternal } from './plugins/external'; import { pluginIgnoreResolveError } from './plugins/ignoreResolveError'; import { pluginInspect } from './plugins/inspect'; -import { pluginMockRuntime } from './plugins/mockRuntime'; +import { pluginMock } from './plugins/mock'; import { pluginCacheControl } from './plugins/moduleCacheControl'; type TestEntryToChunkHashes = { @@ -103,7 +103,7 @@ export const prepareRsbuild = async ( plugins: [ pluginBasic(context), pluginIgnoreResolveError, - pluginMockRuntime, + pluginMock, pluginCSSFilter(), pluginEntryWatch({ globTestSourceEntries, diff --git a/packages/core/tests/core/__snapshots__/rsbuild.test.ts.snap b/packages/core/tests/core/__snapshots__/rsbuild.test.ts.snap index 3d0d24c4..9d3e7ba7 100644 --- a/packages/core/tests/core/__snapshots__/rsbuild.test.ts.snap +++ b/packages/core/tests/core/__snapshots__/rsbuild.test.ts.snap @@ -7,7 +7,9 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = "entry": {}, "experiments": { "asyncWebAssembly": true, - "inlineEnum": true, + "incremental": false, + "inlineConst": false, + "inlineEnum": false, "lazyBarrel": true, "rspackFuture": { "bundlerInfo": { @@ -37,6 +39,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = "javascript": { "exportsPresence": "error", "importDynamic": false, + "inlineConst": false, "requireAsExpression": false, "requireDynamic": false, "requireResolve": false, @@ -141,6 +144,9 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "type": "javascript/auto", "use": [ + { + "loader": "/packages/core/src/core/plugins/mockLoader.mjs", + }, { "loader": "builtin:swc-loader", "options": { @@ -171,7 +177,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -225,7 +231,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -404,6 +410,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = }, "output": { "assetModuleFilename": "static/assets/[name].[contenthash:8][ext]", + "asyncChunks": false, "chunkFilename": "[name].js", "devtoolModuleFilenameTemplate": "[absolute-resource-path]", "filename": "[name].js", @@ -428,11 +435,13 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = DefinePlugin { "_args": [ { - "import.meta.env.ASSET_PREFIX": """", - "import.meta.env.BASE_URL": ""/"", - "import.meta.env.DEV": false, - "import.meta.env.MODE": ""none"", - "import.meta.env.PROD": false, + "import.meta.env": { + "ASSET_PREFIX": """", + "BASE_URL": ""/"", + "DEV": false, + "MODE": ""none"", + "PROD": false, + }, "import.meta.rstest": "global['@rstest/core']", "process.env.ASSET_PREFIX": """", "process.env.BASE_URL": ""/"", @@ -460,6 +469,11 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] = "writeToFileEmit": false, }, }, + RemoveDuplicateModulesPlugin { + "_args": [], + "affectedHooks": undefined, + "name": "RemoveDuplicateModulesPlugin", + }, IgnoreModuleNotFoundErrorPlugin {}, MockRuntimeRspackPlugin {}, RstestCacheControlPlugin {}, @@ -529,7 +543,9 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` "entry": {}, "experiments": { "asyncWebAssembly": true, - "inlineEnum": true, + "incremental": false, + "inlineConst": false, + "inlineEnum": false, "lazyBarrel": true, "rspackFuture": { "bundlerInfo": { @@ -560,6 +576,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` "javascript": { "exportsPresence": "error", "importDynamic": false, + "inlineConst": false, "requireAsExpression": false, "requireDynamic": false, "requireResolve": false, @@ -664,6 +681,9 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "type": "javascript/auto", "use": [ + { + "loader": "/packages/core/src/core/plugins/mockLoader.mjs", + }, { "loader": "builtin:swc-loader", "options": { @@ -694,7 +714,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -748,7 +768,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -916,6 +936,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` }, "output": { "assetModuleFilename": "static/assets/[name].[contenthash:8][ext]", + "asyncChunks": false, "chunkFilename": "[name].js", "devtoolModuleFilenameTemplate": "[absolute-resource-path]", "filename": "[name].js", @@ -940,11 +961,13 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` DefinePlugin { "_args": [ { - "import.meta.env.ASSET_PREFIX": """", - "import.meta.env.BASE_URL": ""/"", - "import.meta.env.DEV": false, - "import.meta.env.MODE": ""none"", - "import.meta.env.PROD": false, + "import.meta.env": { + "ASSET_PREFIX": """", + "BASE_URL": ""/"", + "DEV": false, + "MODE": ""none"", + "PROD": false, + }, "import.meta.rstest": "global['@rstest/core']", "process.env.ASSET_PREFIX": """", "process.env.BASE_URL": ""/"", @@ -972,6 +995,11 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = ` "writeToFileEmit": false, }, }, + RemoveDuplicateModulesPlugin { + "_args": [], + "affectedHooks": undefined, + "name": "RemoveDuplicateModulesPlugin", + }, IgnoreModuleNotFoundErrorPlugin {}, MockRuntimeRspackPlugin {}, RstestPlugin { @@ -1043,7 +1071,9 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "entry": {}, "experiments": { "asyncWebAssembly": true, - "inlineEnum": true, + "incremental": false, + "inlineConst": false, + "inlineEnum": false, "lazyBarrel": true, "rspackFuture": { "bundlerInfo": { @@ -1073,6 +1103,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "javascript": { "exportsPresence": "error", "importDynamic": false, + "inlineConst": false, "requireAsExpression": false, "requireDynamic": false, "requireResolve": false, @@ -1177,6 +1208,9 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "type": "javascript/auto", "use": [ + { + "loader": "/packages/core/src/core/plugins/mockLoader.mjs", + }, { "loader": "builtin:swc-loader", "options": { @@ -1207,7 +1241,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -1261,7 +1295,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -1440,6 +1474,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "output": { "assetModuleFilename": "static/assets/[name].[contenthash:8][ext]", + "asyncChunks": false, "chunkFilename": "[name].js", "devtoolModuleFilenameTemplate": "[absolute-resource-path]", "filename": "[name].js", @@ -1464,11 +1499,13 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects DefinePlugin { "_args": [ { - "import.meta.env.ASSET_PREFIX": """", - "import.meta.env.BASE_URL": ""/"", - "import.meta.env.DEV": false, - "import.meta.env.MODE": ""none"", - "import.meta.env.PROD": false, + "import.meta.env": { + "ASSET_PREFIX": """", + "BASE_URL": ""/"", + "DEV": false, + "MODE": ""none"", + "PROD": false, + }, "import.meta.rstest": "global['@rstest/core']", "process.env.ASSET_PREFIX": """", "process.env.BASE_URL": ""/"", @@ -1496,6 +1533,11 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "writeToFileEmit": false, }, }, + RemoveDuplicateModulesPlugin { + "_args": [], + "affectedHooks": undefined, + "name": "RemoveDuplicateModulesPlugin", + }, IgnoreModuleNotFoundErrorPlugin {}, MockRuntimeRspackPlugin {}, RstestCacheControlPlugin {}, @@ -1565,7 +1607,9 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "entry": {}, "experiments": { "asyncWebAssembly": true, - "inlineEnum": true, + "incremental": false, + "inlineConst": false, + "inlineEnum": false, "lazyBarrel": true, "rspackFuture": { "bundlerInfo": { @@ -1596,6 +1640,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "javascript": { "exportsPresence": "error", "importDynamic": false, + "inlineConst": false, "requireAsExpression": false, "requireDynamic": false, "requireResolve": false, @@ -1700,6 +1745,9 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "type": "javascript/auto", "use": [ + { + "loader": "/packages/core/src/core/plugins/mockLoader.mjs", + }, { "loader": "builtin:swc-loader", "options": { @@ -1730,7 +1778,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -1784,7 +1832,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, @@ -1963,6 +2011,7 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects }, "output": { "assetModuleFilename": "static/assets/[name].[contenthash:8][ext]", + "asyncChunks": false, "chunkFilename": "[name].js", "devtoolModuleFilenameTemplate": "[absolute-resource-path]", "filename": "[name].js", @@ -1987,11 +2036,13 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects DefinePlugin { "_args": [ { - "import.meta.env.ASSET_PREFIX": """", - "import.meta.env.BASE_URL": ""/"", - "import.meta.env.DEV": false, - "import.meta.env.MODE": ""none"", - "import.meta.env.PROD": false, + "import.meta.env": { + "ASSET_PREFIX": """", + "BASE_URL": ""/"", + "DEV": false, + "MODE": ""none"", + "PROD": false, + }, "import.meta.rstest": "global['@rstest/core']", "process.env.ASSET_PREFIX": """", "process.env.BASE_URL": ""/"", @@ -2019,6 +2070,11 @@ exports[`prepareRsbuild > should generate rspack config correctly with projects "writeToFileEmit": false, }, }, + RemoveDuplicateModulesPlugin { + "_args": [], + "affectedHooks": undefined, + "name": "RemoveDuplicateModulesPlugin", + }, IgnoreModuleNotFoundErrorPlugin {}, MockRuntimeRspackPlugin {}, RstestCacheControlPlugin {}, @@ -2109,6 +2165,9 @@ exports[`prepareRsbuild > should generate swc config correctly with user customi "test": /\\\\\\.\\(\\?:js\\|jsx\\|mjs\\|cjs\\|ts\\|tsx\\|mts\\|cts\\)\\$/, "type": "javascript/auto", "use": [ + { + "loader": "/packages/core/src/core/plugins/mockLoader.mjs", + }, { "loader": "builtin:swc-loader", "options": { @@ -2140,7 +2199,7 @@ exports[`prepareRsbuild > should generate swc config correctly with user customi }, "rspackExperiments": { "collectTypeScriptInfo": { - "exportedEnum": true, + "exportedEnum": false, "typeExports": true, }, }, diff --git a/packages/core/tests/core/mockLoader.test.ts b/packages/core/tests/core/mockLoader.test.ts new file mode 100644 index 00000000..5581e300 --- /dev/null +++ b/packages/core/tests/core/mockLoader.test.ts @@ -0,0 +1,214 @@ +import { beforeEach, describe, expect, it, rs } from '@rstest/core'; +import mockLoader from '../../src/core/plugins/mockLoader.mjs'; + +describe('mockLoader', () => { + let mockContext: { + resourcePath: string; + async: () => (error: Error | null, result?: string, map?: any) => void; + }; + let callback: ReturnType; + + beforeEach(() => { + callback = rs.fn(); + mockContext = { + resourcePath: '/path/to/test.js', + async: () => callback, + }; + }); + + async function runLoader(source: string) { + await mockLoader.call(mockContext, source, {}); + expect(callback).toHaveBeenCalled(); + const [error, result] = callback.mock.calls[0]; + expect(error).toBeNull(); + return result; + } + + it('should transform default imports', async () => { + const source = `import React from 'react'; +console.log(React);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const React = (await import('react')).default; export {}; + console.log(React);" + `); + }); + + it('should transform namespace imports', async () => { + const source = `import * as React from 'react'; +console.log(React);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const React = await import('react'); export {}; + console.log(React);" + `); + }); + + it('should transform named imports', async () => { + const source = `import { useState, useEffect } from 'react'; +console.log(useState);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const { useState, useEffect } = await import('react'); export {}; + console.log(useState);" + `); + }); + + it('should transform named imports with aliases', async () => { + const source = `import { useState as useStateAlias, useEffect } from 'react'; +console.log(useStateAlias);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const { useState: useStateAlias, useEffect } = await import('react'); export {}; + console.log(useStateAlias);" + `); + }); + + it('should transform side-effect imports', async () => { + const source = `import 'styles.css'; +console.log('loaded');`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "await import('styles.css'); export {}; + console.log('loaded');" + `); + }); + + it('should transform mixed imports (default and named)', async () => { + const source = `import React, { useState, useEffect } from 'react'; +console.log(React, useState);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const __rstest_import_react = await import('react'); + const React = __rstest_import_react.default; + const { useState, useEffect } = __rstest_import_react; export {}; + console.log(React, useState);" + `); + }); + + it('should transform mixed imports with namespace', async () => { + const source = `import React, * as ReactAll from 'react'; +import ReactDom, * as ReactDomAll from 'react-dom'; +console.log(React, ReactAll); +console.log(ReactDom, ReactDomAll); +`; + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const __rstest_import_react = await import('react'); + const React = __rstest_import_react.default; + const ReactAll = __rstest_import_react; export {}; + const __rstest_import_react_dom = await import('react-dom'); + const ReactDom = __rstest_import_react_dom.default; + const ReactDomAll = __rstest_import_react_dom; export {}; + console.log(React, ReactAll); + console.log(ReactDom, ReactDomAll); + " + `); + }); + + it('should skip dynamic imports', async () => { + const source = `const React = import('react'); +console.log(React);`; + + const result = await runLoader(source); + + expect(result).toEqual(source); + }); + + it('should handle multiple imports', async () => { + const source = `import React from 'react'; +import { useState } from 'react'; +import * as ReactDOM from 'react-dom'; +console.log(React, useState, ReactDOM);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const React = (await import('react')).default; export {}; + const { useState } = await import('react'); export {}; + const ReactDOM = await import('react-dom'); export {}; + console.log(React, useState, ReactDOM);" + `); + }); + + it('should hoist transformed imports while preserving order', async () => { + const source = `// header comment +console.log('test'); +await import('./a.mjs'); +console.log('test1'); +import './b.mjs'; +console.log('test2'); +import something from './c.mjs'; +`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "await import('./b.mjs'); export {}; + const something = (await import('./c.mjs')).default; export {}; + // header comment + console.log('test'); + await import('./a.mjs'); + console.log('test1'); + console.log('test2'); + " + `); + }); + + it('should add export {} flag for ESM modules', async () => { + const source = `import React from 'react'; +console.log(React);`; + + const result = await runLoader(source); + + expect(result).toMatchInlineSnapshot(` + "const React = (await import('react')).default; export {}; + console.log(React);" + `); + }); + + it('should handle errors gracefully', async () => { + const errorCallback = rs.fn(); + const errorContext = { + ...mockContext, + async: () => errorCallback, + }; + + // Cause an error by passing null instead of a string + await mockLoader.call(errorContext, null as any, {}); + + expect(errorCallback).toHaveBeenCalled(); + const [error] = errorCallback.mock.calls[0]; + expect(error).toBeInstanceOf(Error); + }); + + it('should preserve source maps', async () => { + const source = `import React from 'react';`; + const inputMap = { + version: 3, + sources: ['original.js'], + names: ['React'], + mappings: 'AAAA', + }; + + await mockLoader.call(mockContext, source, inputMap); + + const [error, , outputMap] = callback.mock.calls[0]; + expect(error).toBeNull(); + expect(outputMap).toBeDefined(); + expect(outputMap.names).toEqual(inputMap.names); + }); +}); diff --git a/packages/coverage-istanbul/package.json b/packages/coverage-istanbul/package.json index 40e84150..b9312aa0 100644 --- a/packages/coverage-istanbul/package.json +++ b/packages/coverage-istanbul/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@rstest/tsconfig": "workspace:*", "@rstest/core": "workspace:*", - "@rslib/core": "0.12.2", + "@rslib/core": "0.13.2", "@types/node": "^22.16.5", "typescript": "^5.9.2", "@types/istanbul-lib-coverage": "^2.0.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d245c2a..b6e13cbb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,10 +15,10 @@ importers: version: 2.2.2 '@changesets/cli': specifier: ^2.29.6 - version: 2.29.6(@types/node@22.16.5) + version: 2.29.6(@types/node@22.18.1) '@rsdoctor/rspack-plugin': specifier: ^1.2.3 - version: 1.2.3(@rsbuild/core@1.5.3)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + version: 1.2.3(@rsbuild/core@1.5.6)(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) '@rslint/core': specifier: ^0.1.12 version: 0.1.12 @@ -33,7 +33,7 @@ importers: version: 11.0.4 '@types/node': specifier: ^22.16.5 - version: 22.16.5 + version: 22.18.1 check-dependency-version-consistency: specifier: ^5.0.1 version: 5.0.1 @@ -72,13 +72,17 @@ importers: version: 5.9.2 e2e: + dependencies: + '@types/is-url': + specifier: ^1.2.32 + version: 1.2.32 devDependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@rslib/core': - specifier: 0.12.2 - version: 0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(typescript@5.9.2) + specifier: 0.13.2 + version: 0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(typescript@5.9.2) '@rstest/core': specifier: workspace:* version: link:../packages/core @@ -91,6 +95,9 @@ importers: axios: specifier: ^1.11.0 version: 1.12.0 + is-url: + specifier: ^1.2.4 + version: 1.2.4 jest-image-snapshot: specifier: ^6.5.1 version: 6.5.1 @@ -136,11 +143,11 @@ importers: version: 19.1.1(react@19.1.1) devDependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@rsbuild/plugin-react': specifier: ^1.3.5 - version: 1.4.0(@rsbuild/core@1.5.0) + version: 1.4.0(@rsbuild/core@1.5.6) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -238,11 +245,11 @@ importers: version: 19.1.1(react@19.1.1) devDependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@rsbuild/plugin-react': specifier: ^1.3.5 - version: 1.4.0(@rsbuild/core@1.5.0) + version: 1.4.0(@rsbuild/core@1.5.6) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -296,7 +303,7 @@ importers: devDependencies: '@rsbuild/plugin-react': specifier: ^1.3.5 - version: 1.4.0(@rsbuild/core@1.5.3) + version: 1.4.0(@rsbuild/core@1.5.6) '@types/react': specifier: ^19.1.11 version: 19.1.11 @@ -323,17 +330,17 @@ importers: version: 3.5.20(typescript@5.9.2) devDependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@rsbuild/plugin-babel': specifier: ^1.0.6 - version: 1.0.6(@rsbuild/core@1.5.0) + version: 1.0.6(@rsbuild/core@1.5.6) '@rsbuild/plugin-vue': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@1.5.0)(vue@3.5.20(typescript@5.9.2)) + version: 1.1.2(@rsbuild/core@1.5.6)(vue@3.5.20(typescript@5.9.2)) '@rsbuild/plugin-vue-jsx': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.28.3)(@rsbuild/core@1.5.0) + version: 1.1.1(@babel/core@7.28.3)(@rsbuild/core@1.5.6) '@rstest/core': specifier: workspace:* version: link:../../../packages/core @@ -363,7 +370,7 @@ importers: version: link:../../packages/coverage-istanbul '@types/node': specifier: ^22.16.5 - version: 22.16.5 + version: 22.18.1 typescript: specifier: ^5.9.2 version: 5.9.2 @@ -378,11 +385,11 @@ importers: version: 19.1.1(react@19.1.1) devDependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@rsbuild/plugin-react': specifier: ^1.3.5 - version: 1.4.0(@rsbuild/core@1.5.0) + version: 1.4.0(@rsbuild/core@1.5.6) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -408,8 +415,8 @@ importers: packages/core: dependencies: '@rsbuild/core': - specifier: 1.5.0 - version: 1.5.0 + specifier: 1.5.6 + version: 1.5.6 '@types/chai': specifier: ^5.2.2 version: 5.2.2 @@ -419,6 +426,9 @@ importers: chai: specifier: ^5.3.3 version: 5.3.3 + es-module-lexer: + specifier: ^1.7.0 + version: 1.7.0 pathe: specifier: ^2.0.3 version: 2.0.3 @@ -437,10 +447,10 @@ importers: version: 0.3.30 '@microsoft/api-extractor': specifier: ^7.52.11 - version: 7.52.11(@types/node@22.16.5) + version: 7.52.11(@types/node@22.18.1) '@rslib/core': - specifier: 0.12.2 - version: 0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(typescript@5.9.2) + specifier: 0.13.2 + version: 0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(typescript@5.9.2) '@rstest/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -489,6 +499,9 @@ importers: license-webpack-plugin: specifier: ^4.0.2 version: 4.0.2(webpack@5.101.2) + magic-string: + specifier: ^0.30.17 + version: 0.30.19 picocolors: specifier: ^1.1.1 version: 1.1.1 @@ -506,7 +519,7 @@ importers: version: 7.1.0 tinyglobby: specifier: ^0.2.14 - version: 0.2.14 + version: 0.2.15 tinyspy: specifier: ^4.0.3 version: 4.0.3 @@ -521,14 +534,14 @@ importers: version: 3.0.1 istanbul-reports: specifier: ^3.1.7 - version: 3.1.7 + version: 3.2.0 swc-plugin-coverage-instrument: specifier: ^0.0.31 version: 0.0.31 devDependencies: '@rslib/core': - specifier: 0.12.2 - version: 0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(typescript@5.9.2) + specifier: 0.13.2 + version: 0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(typescript@5.9.2) '@rstest/core': specifier: workspace:* version: link:../core @@ -546,7 +559,7 @@ importers: version: 3.0.4 '@types/node': specifier: ^22.16.5 - version: 22.16.5 + version: 22.18.1 typescript: specifier: ^5.9.2 version: 5.9.2 @@ -557,7 +570,7 @@ importers: devDependencies: '@rsbuild/plugin-sass': specifier: ^1.4.0 - version: 1.4.0(@rsbuild/core@1.5.3) + version: 1.4.0(@rsbuild/core@1.5.6) '@rspress/core': specifier: ^2.0.0-beta.31 version: 2.0.0-beta.31(@types/react@19.1.11) @@ -575,7 +588,7 @@ importers: version: link:../scripts/tsconfig '@types/node': specifier: ^22.16.5 - version: 22.16.5 + version: 22.18.1 '@types/react': specifier: ^19.1.11 version: 19.1.11 @@ -590,10 +603,10 @@ importers: version: 19.1.1(react@19.1.1) rsbuild-plugin-google-analytics: specifier: ^1.0.4 - version: 1.0.4(@rsbuild/core@1.5.3) + version: 1.0.4(@rsbuild/core@1.5.6) rsbuild-plugin-open-graph: specifier: ^1.1.0 - version: 1.1.0(@rsbuild/core@1.5.3) + version: 1.1.0(@rsbuild/core@1.5.6) rspress-plugin-font-open-sans: specifier: ^1.0.3 version: 1.0.3(@rspress/core@2.0.0-beta.31(@types/react@19.1.11)) @@ -1131,8 +1144,8 @@ packages: '@jridgewell/source-map@0.3.11': resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} - '@jridgewell/sourcemap-codec@1.5.0': - resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} '@jridgewell/trace-mapping@0.3.30': resolution: {integrity: sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==} @@ -1392,18 +1405,13 @@ packages: resolution: {integrity: sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==} engines: {node: '>=14.0.0'} - '@rsbuild/core@1.5.0': - resolution: {integrity: sha512-C4TNndcgIQTDbBvdlSLbfuMGH9i66SJlsWkA6AVElwF7RI39lwZ5gIbP+v+l3W8HwcZ78a6iIu88ZEm1FuTSvA==} + '@rsbuild/core@1.5.4': + resolution: {integrity: sha512-iRzq4hEXawL4MVkPKhfGMJxS45XIfwkweAZXEHeaboq6vxbpg0dLRgkbaIuuFyF9hCwI0y3ant/xVXOqDghJNw==} engines: {node: '>=18.12.0'} hasBin: true - '@rsbuild/core@1.5.0-beta.4': - resolution: {integrity: sha512-h1jqpjZunalsdxTcJCbY8DovLu6F4MQgsYdZyxDjUp0xuggQayi1tpcE6MhLs3WWa077g+LZ2Am4gKt/pl/W9Q==} - engines: {node: '>=18.12.0'} - hasBin: true - - '@rsbuild/core@1.5.3': - resolution: {integrity: sha512-asJYYmpMmYVEPgqR2hoPlW5pFtMYf7+dq9/u8vP0uY+Xbi9aUoguskc783qSi1yu9KvZwDbwpbfCuoBAt8anIA==} + '@rsbuild/core@1.5.6': + resolution: {integrity: sha512-EbJ9HlkI2Y2C59pAv877rHz3qS+5dy9anXxagOOXEHt4u3/uqSj7pcz3cD+UWkFQ4XOGJ3mMwkPfR7EE24t12A==} engines: {node: '>=18.12.0'} hasBin: true @@ -1477,8 +1485,8 @@ packages: '@rsdoctor/utils@1.2.3': resolution: {integrity: sha512-HawWrcqXeqdhj4dKhdjJg4BXvstcQauYSRx0cnYH78f7z9PW60Smr6vYpByXC87rK3JKpa6CNiZi+qhI5yTAog==} - '@rslib/core@0.12.2': - resolution: {integrity: sha512-5DPVxmzzyoQlLqSt8Y/8kbYNtbJ0AEVUXd1hDFQ0Iq5Eb5XA4363PDeLdfeKJ1h93YqT7M9WZ3Cyhvosx1EimQ==} + '@rslib/core@0.13.2': + resolution: {integrity: sha512-Npb27X+kjh4fJoCVMvemfgS1F/gBW4VwHndYlQSmP5pdtqbfOLEj66YNIk0thu/1Z4dh0m2KppM7O3cFiJpqMQ==} engines: {node: '>=18.12.0'} hasBin: true peerDependencies: @@ -1524,29 +1532,14 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-darwin-arm64@1.5.0': - resolution: {integrity: sha512-7909YLNnKf0BYxiCpCWOk13WyWS4493Kxk1NQwy9KPLY9ydQExk84KVsix2NuNBaI8Pnk3aVLBPJiSNXtHLjnA==} - cpu: [arm64] - os: [darwin] - - '@rspack/binding-darwin-arm64@1.5.0-beta.1': - resolution: {integrity: sha512-aXSbz9Bo480xNDK6v64SZ19I/bmMuxaOuex6V9q0S+v3qx/ZsUWL+5aUd71scq7EfAb3KkvQFsYACpt5PMZ9DQ==} - cpu: [arm64] - os: [darwin] - '@rspack/binding-darwin-arm64@1.5.2': resolution: {integrity: sha512-aO76T6VQvAFt1LJNRA5aPOJ+szeTLlzC5wubsnxgWWjG53goP+Te35kFjDIDe+9VhKE/XqRId6iNAymaEsN+Uw==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.5.0': - resolution: {integrity: sha512-poGuQsGKCMQqSswgrz8X+frqMVTdmtzUDyvi/p9BLwW+2DwWgmywU8jwE+BYtjfWp1tErBSTlLxmEPQTdcIQgQ==} - cpu: [x64] - os: [darwin] - - '@rspack/binding-darwin-x64@1.5.0-beta.1': - resolution: {integrity: sha512-addeCT0bXtfOfvJZdVuHWBl20Cd8RmweOX03OiEH4AmQc9EgUEP/oCGpOmakBXxUCl3x/RnlrXx2nD1uDyuyLA==} - cpu: [x64] + '@rspack/binding-darwin-arm64@1.5.3': + resolution: {integrity: sha512-8R1uqr5E2CzRZjsA1QLXkD4xwcsiHmLJTIzCNj9QJ4+lCw6XgtPqpHZuk3zNROLayijEKwotGXJFHJIbgv1clA==} + cpu: [arm64] os: [darwin] '@rspack/binding-darwin-x64@1.5.2': @@ -1554,28 +1547,18 @@ packages: cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@1.5.0': - resolution: {integrity: sha512-Bvmk8h3tRhN9UgOtH+vK0SgFM3qEO36eJz7oddOl4lJQxBf2GNA87bGtkMtX+AVPz/PUn7r82uWxrlVNQHAbFg==} - cpu: [arm64] - os: [linux] - - '@rspack/binding-linux-arm64-gnu@1.5.0-beta.1': - resolution: {integrity: sha512-fYgOfSsA0J0rUA40ZEexrMRKyIVAUo4m0KShTm6yVaAzQHWVZ0xjjcoLFNxCVE7EvAPI7wl9fDOyr7Y8EylVfQ==} - cpu: [arm64] - os: [linux] + '@rspack/binding-darwin-x64@1.5.3': + resolution: {integrity: sha512-R4sb+scZbaBasyS+TQ6dRvv+f/2ZaZ0nXgY7t/ehcuGRvUz3S7FTJF/Mr/Ocxj5oVfb06thDAm+zaAVg+hsM9A==} + cpu: [x64] + os: [darwin] '@rspack/binding-linux-arm64-gnu@1.5.2': resolution: {integrity: sha512-rNxRfgC5khlrhyEP6y93+45uQ4TI7CdtWqh5PKsaR6lPepG1rH4L8VE+etejSdhzXH6wQ76Rw4wzb96Hx+5vuQ==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.5.0': - resolution: {integrity: sha512-bH7UwkbACDYT37YnN9kkhaF9niFFK9ndcdNvYFFr1oUT4W9Ie3V9b41EXijqp3pyh0mDSeeLPFY0aEx1t3e7Pw==} - cpu: [arm64] - os: [linux] - - '@rspack/binding-linux-arm64-musl@1.5.0-beta.1': - resolution: {integrity: sha512-wWlOzsoJU2HJyPxoCDScW4zt3+5WO6NI8B7jSmhVA9dfmvCYUKktt/YZpskcgMsvCgtzXTE62wDc+VTQ5ucp9A==} + '@rspack/binding-linux-arm64-gnu@1.5.3': + resolution: {integrity: sha512-NeDJJRNTLx8wOQT+si90th7cdt04I2F697Mp5w0a3Jf3XHAmsraBMn0phdLGWJoUWrrfVGthjgZDl5lcc1UHEA==} cpu: [arm64] os: [linux] @@ -1584,14 +1567,9 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.5.0': - resolution: {integrity: sha512-xZ5dwNrE5KtpQyMd9israpJTcTQ3UYUUq23fTcNc79xE5aspkGixDFAYoql4YkhO0O+JWRmdSaFAn6jD+IQWQA==} - cpu: [x64] - os: [linux] - - '@rspack/binding-linux-x64-gnu@1.5.0-beta.1': - resolution: {integrity: sha512-OlgQIQLDLDDXvbUYBEfZmofO3uTDi0rGfIr58PXz/wTF87KdwqlU0HyjIeaeDUaQlV+lNXNysuCwvI0hl/o2tw==} - cpu: [x64] + '@rspack/binding-linux-arm64-musl@1.5.3': + resolution: {integrity: sha512-M9utPq9s7zJkKapUlyfwwYT/rjZ+XM56NHQMUH9MVYgMJIl+66QURgWUXCAbuogxf1XWayUGQaZsgypoOrTG9A==} + cpu: [arm64] os: [linux] '@rspack/binding-linux-x64-gnu@1.5.2': @@ -1599,13 +1577,8 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.5.0': - resolution: {integrity: sha512-mv65jYvcyYPkPZJ9kjSvTAcH0o7C5jfICWCQcMmN1tCGD3b8gmf9GqSZ8e+W/JkuvrJ05qTo/PvEq9nhu+pNIg==} - cpu: [x64] - os: [linux] - - '@rspack/binding-linux-x64-musl@1.5.0-beta.1': - resolution: {integrity: sha512-LkQSyfyf5Jy0UGD0tvm2Gz+0VjboawtRrYd+qYHE0Pm4h7tTJWyqnh02LRTROxOl3GrssC1VGn6J8XYTxOAWug==} + '@rspack/binding-linux-x64-gnu@1.5.3': + resolution: {integrity: sha512-AsKqU4pIg0yYg1VvSEU0NspIwCexqXD2AYE0wujAAwBo0hOfbt5dl1JCK7idiZdIQvoFg86HbfGwdHIVcFLI0w==} cpu: [x64] os: [linux] @@ -1614,41 +1587,27 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-wasm32-wasi@1.5.0': - resolution: {integrity: sha512-8rVpl6xfaAFJgo1wCd+emksfl+/8nlehrtkmjY9bj79Ou+kp07L9e1B+UU0jfs8e7aLPntQuF68kzLHwYLzWIQ==} - cpu: [wasm32] - - '@rspack/binding-wasm32-wasi@1.5.0-beta.1': - resolution: {integrity: sha512-ysnuVnqC9byoYfoAi/TsV0U5ZUxU0snnVPa/SvQEO6ew3J2GaNDq1vS1zWo0SOA4eLmwkop0/UcH8n3VXOy7NA==} - cpu: [wasm32] + '@rspack/binding-linux-x64-musl@1.5.3': + resolution: {integrity: sha512-0aHuvDef92pFZaHhk8Mp8RP9TfTzhQ+Pjqrc2ixRS/FeJA+jVB2CSaYlAPP4QrgXdmW7tewSxEw8hYhF9CNv/A==} + cpu: [x64] + os: [linux] '@rspack/binding-wasm32-wasi@1.5.2': resolution: {integrity: sha512-cuVbGr1b4q0Z6AtEraI3becZraPMMgZtZPRaIsVLeDXCmxup/maSAR3T6UaGf4Q2SNcFfjw4neGz5UJxPK8uvA==} cpu: [wasm32] - '@rspack/binding-win32-arm64-msvc@1.5.0': - resolution: {integrity: sha512-dWSmNm+GR6WSkOwbhlUcot4Oqwyon+1PRZ9E0vIMFHKGvESf9CQjgHAX0QE9G0kJmRM5x3I16J4x44Kw3W/98Q==} - cpu: [arm64] - os: [win32] - - '@rspack/binding-win32-arm64-msvc@1.5.0-beta.1': - resolution: {integrity: sha512-vcMXybMchQomBODyi6aIMCur8/oQktw+iVv0dH3hiiWy0v2g8xS9VLMjWXfGZAhonhRe7YWTP12dxCPbWmQyZw==} - cpu: [arm64] - os: [win32] + '@rspack/binding-wasm32-wasi@1.5.3': + resolution: {integrity: sha512-Y7KN/ZRuWcFdjCzuZE0JsPwTqJAz1aipJsEOI3whBUj9Va2RwbR9r3vbW6OscS0Wm3rTJAfqH0xwx9x3GksnAw==} + cpu: [wasm32] '@rspack/binding-win32-arm64-msvc@1.5.2': resolution: {integrity: sha512-4vJQdzRTSuvmvL3vrOPuiA7f9v9frNc2RFWDxqg+GYt0YAjDStssp+lkVbRYyXnTYVJkARSuO6N+BOiI+kLdsQ==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.5.0': - resolution: {integrity: sha512-YtOrFEkwhO3Y3sY6Jq0OOYPY7NBTNYuwJ6epTgzPEDGs2cBnwZfzhq0jmD/koWtv1L9+twX95vKosBdauF0tNA==} - cpu: [ia32] - os: [win32] - - '@rspack/binding-win32-ia32-msvc@1.5.0-beta.1': - resolution: {integrity: sha512-fCj904xjc5iKOdUS0VLUE/LbAQZWlub/TF0ZKhzq2UK8WWwrfhA5U8ZHximU0A0LVDoMVZCM5M12rO12P0uHKw==} - cpu: [ia32] + '@rspack/binding-win32-arm64-msvc@1.5.3': + resolution: {integrity: sha512-I9SqobDwFwcIUNzr+VwvR2lUGqfarOpFDp7mZmA6+qO/V0yJxS0aqBIwNoZB/UFPbUh71OdmFavBzcTYE9vPSg==} + cpu: [arm64] os: [win32] '@rspack/binding-win32-ia32-msvc@1.5.2': @@ -1656,14 +1615,9 @@ packages: cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.5.0': - resolution: {integrity: sha512-V4fcPVYWJgDkIkSsFwmUdwC9lkL8+1dzDOwyTWe6KW2MYHF2D148WPHNyVVE6gum12TShpbIsh0j4NiiMhkMtw==} - cpu: [x64] - os: [win32] - - '@rspack/binding-win32-x64-msvc@1.5.0-beta.1': - resolution: {integrity: sha512-iWCoFMwP2aUea1mIp2+mTE7IKj6wp9hxMuZgOcEGWQidE7pUss5/Zp3wrOSWnnyovIeQLmK9wsQEA/W3i3MiAQ==} - cpu: [x64] + '@rspack/binding-win32-ia32-msvc@1.5.3': + resolution: {integrity: sha512-pPSzSycfK03lLNxzwEkrRUfqETB7y0KEEbO0HcGX63EC9Ne4SILJfkkH55G0PO4aT/dfAosAlkf6V64ATgrHGA==} + cpu: [ia32] os: [win32] '@rspack/binding-win32-x64-msvc@1.5.2': @@ -1671,26 +1625,19 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding@1.5.0': - resolution: {integrity: sha512-UGXQmwEu2gdO+tnGv2q4rOWJdWioy6dlLXeZOLYAZVh3mrfKJhZWtDEygX9hCdE5thWNRTlEvx30QQchJAszIQ==} - - '@rspack/binding@1.5.0-beta.1': - resolution: {integrity: sha512-qZ+cxvsNvXBOPX0NEP+KfxQlJI7TDZR2XLS8Jl+zHl2kgulEOBWsBa7Q1Dcw73YQgz2owxP3OWl3f8LWXnnC1Q==} + '@rspack/binding-win32-x64-msvc@1.5.3': + resolution: {integrity: sha512-He/GrFVrCZ4gBrHSxGd7mnwk9A9BDkAeZZEBnfK4n/HfXxU32WX5jiAGacFoJQYFLDOWTAcmxFad37TSs61zXw==} + cpu: [x64] + os: [win32] '@rspack/binding@1.5.2': resolution: {integrity: sha512-NKiBcsxmAzFDYRnK2ZHWbTtDFVT5/704eK4OfpgsDXPMkaMnBKijMKNgP5pbe18X4rUlz+8HnGm4+Xllo9EESw==} - '@rspack/core@1.5.0': - resolution: {integrity: sha512-eEtiKV+CUcAtnt1K+eiHDzmBXQcNM8CfCXOzr0+gHGp4w4Zks2B8RF36sYD03MM2bg8VRXXsf0MicQ8FvRMCOg==} - engines: {node: '>=18.12.0'} - peerDependencies: - '@swc/helpers': '>=0.5.1' - peerDependenciesMeta: - '@swc/helpers': - optional: true + '@rspack/binding@1.5.3': + resolution: {integrity: sha512-bWAKligHxelx3XxOgFmK6k1vR+ANxjBXLXTmgOiZxsJNScHJap3HYViXWJHKj5jvdXEvg9sC8TE7WNctCfa8iQ==} - '@rspack/core@1.5.0-beta.1': - resolution: {integrity: sha512-o3yQreNKldm0k96wPMpXBI9p0B03LpeK3XyV4vhk24RfLIa2p6C2LPF4xn6U2M28CFQkSbeu1vwlMHnfW4xHNg==} + '@rspack/core@1.5.2': + resolution: {integrity: sha512-ifjHqLczC81d1xjXPXCzxTFKNOFsEzuuLN44cMnyzQ/GWi4B48fyX7JHndWE7Lxd54cW1O9Ik7AdBN3Gq891EA==} engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -1698,8 +1645,8 @@ packages: '@swc/helpers': optional: true - '@rspack/core@1.5.2': - resolution: {integrity: sha512-ifjHqLczC81d1xjXPXCzxTFKNOFsEzuuLN44cMnyzQ/GWi4B48fyX7JHndWE7Lxd54cW1O9Ik7AdBN3Gq891EA==} + '@rspack/core@1.5.3': + resolution: {integrity: sha512-EMNXysJyqsfd2aVys5C7GDZKaLEcoN5qgs7ZFhWOWJGKgBqjdKTljyRTd4RRZV4fV6iAko/WrxnAxmzZNk8mjA==} engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -1957,6 +1904,9 @@ packages: '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/is-url@1.2.32': + resolution: {integrity: sha512-46VLdbWI8Sc+hPexQ6NLNR2YpoDyDZIpASHkJQ2Yr+Kf9Giw6LdCTkwOdsnHKPQeh7xTjTmSnxbE8qpxYuCiHA==} + '@types/istanbul-lib-coverage@2.0.6': resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} @@ -1999,8 +1949,8 @@ packages: '@types/node@20.19.4': resolution: {integrity: sha512-OP+We5WV8Xnbuvw0zC2m4qfB/BJvjyCwtNjhHdJxV1639SGSKrLmJkc3fMnp2Qy8nJyHp8RO6umxELN/dS1/EA==} - '@types/node@22.16.5': - resolution: {integrity: sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==} + '@types/node@22.18.1': + resolution: {integrity: sha512-rzSDyhn4cYznVG+PCzGe1lwuMYJrcBS1fc3JqSa2PvtABwWo+dZ1ij5OVok3tqfpEBCBoaR4d7upFJk73HRJDw==} '@types/pixelmatch@5.2.6': resolution: {integrity: sha512-wC83uexE5KGuUODn6zkm9gMzTwdY5L0chiK+VrKcDfEjzxh1uadlWTvOmAbCpnM9zx/Ww3f8uKlYQVnO/TrqVg==} @@ -2361,8 +2311,8 @@ packages: browserslist-to-es-version@1.0.0: resolution: {integrity: sha512-i6dR03ClGy9ti97FSa4s0dpv01zW/t5VbvGjFfTLsrRQFsPgSeyGkCrlU7BTJuI5XDHVY5S2JgDnDsvQXifJ8w==} - browserslist@4.25.1: - resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==} + browserslist@4.24.5: + resolution: {integrity: sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -2391,8 +2341,8 @@ packages: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - caniuse-lite@1.0.30001727: - resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==} + caniuse-lite@1.0.30001718: + resolution: {integrity: sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -2461,6 +2411,10 @@ packages: resolution: {integrity: sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==} engines: {node: '>=6'} + cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2693,8 +2647,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - electron-to-chromium@1.5.187: - resolution: {integrity: sha512-cl5Jc9I0KGUoOoSbxvTywTa40uspGJt/BDBoDLoxJRSBpWh4FFXBsjNRHfQrONsV/OoEjDfHUmZQa2d6Ze4YgA==} + electron-to-chromium@1.5.150: + resolution: {integrity: sha512-rOOkP2ZUMx1yL4fCxXQKDHQ8ZXwisb2OycOQVKHgvB3ZI4CvehOd4y2tfnnLDieJ3Zs1RL1Dlp3cMkyIn7nnXA==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2873,8 +2827,9 @@ packages: fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.4.4: - resolution: {integrity: sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -3261,6 +3216,9 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} + is-url@1.2.4: + resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} + is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} @@ -3284,8 +3242,8 @@ packages: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} iterate-object@1.3.5: @@ -3473,8 +3431,8 @@ packages: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + magic-string@0.30.19: + resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==} make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} @@ -3907,8 +3865,8 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - picomatch@4.0.2: - resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} engines: {node: '>=12'} pify@4.0.1: @@ -4134,16 +4092,19 @@ packages: rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} - rsbuild-plugin-dts@0.12.2: - resolution: {integrity: sha512-qI7wwT7R6T5LzuwcBWt6dZYaS1Fv5Tg2D3OHbAX9MXYn2oJ3eJjdwXU2LcLALd1CpXUPaQCjOTHRMJzHT0++JQ==} + rsbuild-plugin-dts@0.13.2: + resolution: {integrity: sha512-Tw88Jl6eqhUcI9JLFXGCaw4Oiqe1IfD7rbLWvV9OPJwsRdV129WJ4ccnI0x7tDpnLDV0xhW/+b/9wGyK28jSgg==} engines: {node: '>=18.12.0'} peerDependencies: '@microsoft/api-extractor': ^7 '@rsbuild/core': 1.x + '@typescript/native-preview': 7.x typescript: ^5 peerDependenciesMeta: '@microsoft/api-extractor': optional: true + '@typescript/native-preview': + optional: true typescript: optional: true @@ -4588,8 +4549,8 @@ packages: tinyexec@1.0.1: resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} - tinyglobby@0.2.14: - resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} tinypool@1.1.1: @@ -4878,8 +4839,8 @@ packages: utf-8-validate: optional: true - ws@8.18.2: - resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} + ws@8.18.3: + resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -5140,7 +5101,7 @@ snapshots: dependencies: '@babel/compat-data': 7.28.0 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.25.1 + browserslist: 4.24.5 lru-cache: 5.1.1 semver: 6.3.1 @@ -5374,7 +5335,7 @@ snapshots: dependencies: '@changesets/types': 6.1.0 - '@changesets/cli@2.29.6(@types/node@22.16.5)': + '@changesets/cli@2.29.6(@types/node@22.18.1)': dependencies: '@changesets/apply-release-plan': 7.0.12 '@changesets/assemble-release-plan': 6.0.9 @@ -5390,7 +5351,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.1(@types/node@22.16.5) + '@inquirer/external-editor': 1.0.1(@types/node@22.18.1) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 @@ -5539,12 +5500,12 @@ snapshots: '@epic-web/invariant@1.0.0': {} - '@inquirer/external-editor@1.0.1(@types/node@22.16.5)': + '@inquirer/external-editor@1.0.1(@types/node@22.18.1)': dependencies: chardet: 2.1.0 iconv-lite: 0.6.3 optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@isaacs/balanced-match@4.0.1': {} @@ -5571,7 +5532,7 @@ snapshots: '@jest/pattern@30.0.1': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 jest-regex-util: 30.0.1 '@jest/schemas@30.0.5': @@ -5584,13 +5545,13 @@ snapshots: '@jest/schemas': 30.0.5 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/yargs': 17.0.33 chalk: 4.1.2 '@jridgewell/gen-mapping@0.3.13': dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.30 '@jridgewell/resolve-uri@3.1.2': {} @@ -5600,12 +5561,12 @@ snapshots: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.30 - '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/sourcemap-codec@1.5.5': {} '@jridgewell/trace-mapping@0.3.30': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@jsonjoy.com/base64@1.1.2(tslib@2.8.1)': dependencies: @@ -5699,23 +5660,23 @@ snapshots: '@types/react': 19.1.11 react: 19.1.1 - '@microsoft/api-extractor-model@7.30.7(@types/node@22.16.5)': + '@microsoft/api-extractor-model@7.30.7(@types/node@22.18.1)': dependencies: '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.14.0(@types/node@22.16.5) + '@rushstack/node-core-library': 5.14.0(@types/node@22.18.1) transitivePeerDependencies: - '@types/node' - '@microsoft/api-extractor@7.52.11(@types/node@22.16.5)': + '@microsoft/api-extractor@7.52.11(@types/node@22.18.1)': dependencies: - '@microsoft/api-extractor-model': 7.30.7(@types/node@22.16.5) + '@microsoft/api-extractor-model': 7.30.7(@types/node@22.18.1) '@microsoft/tsdoc': 0.15.1 '@microsoft/tsdoc-config': 0.17.1 - '@rushstack/node-core-library': 5.14.0(@types/node@22.16.5) + '@rushstack/node-core-library': 5.14.0(@types/node@22.18.1) '@rushstack/rig-package': 0.5.3 - '@rushstack/terminal': 0.15.4(@types/node@22.16.5) - '@rushstack/ts-command-line': 5.0.2(@types/node@22.16.5) + '@rushstack/terminal': 0.15.4(@types/node@22.18.1) + '@rushstack/ts-command-line': 5.0.2(@types/node@22.18.1) lodash: 4.17.21 minimatch: 10.0.3 resolve: 1.22.10 @@ -5886,37 +5847,29 @@ snapshots: '@remix-run/router@1.23.0': {} - '@rsbuild/core@1.5.0': + '@rsbuild/core@1.5.4': dependencies: - '@rspack/core': 1.5.0(@swc/helpers@0.5.17) - '@rspack/lite-tapable': 1.0.1 - '@swc/helpers': 0.5.17 - core-js: 3.45.1 - jiti: 2.5.1 - - '@rsbuild/core@1.5.0-beta.4': - dependencies: - '@rspack/core': 1.5.0-beta.1(@swc/helpers@0.5.17) + '@rspack/core': 1.5.2(@swc/helpers@0.5.17) '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.45.1 jiti: 2.5.1 - '@rsbuild/core@1.5.3': + '@rsbuild/core@1.5.6': dependencies: - '@rspack/core': 1.5.2(@swc/helpers@0.5.17) + '@rspack/core': 1.5.3(@swc/helpers@0.5.17) '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 core-js: 3.45.1 jiti: 2.5.1 - '@rsbuild/plugin-babel@1.0.6(@rsbuild/core@1.5.0)': + '@rsbuild/plugin-babel@1.0.6(@rsbuild/core@1.5.6)': dependencies: '@babel/core': 7.28.3 '@babel/plugin-proposal-decorators': 7.28.0(@babel/core@7.28.3) '@babel/plugin-transform-class-properties': 7.27.1(@babel/core@7.28.3) '@babel/preset-typescript': 7.27.1(@babel/core@7.28.3) - '@rsbuild/core': 1.5.0 + '@rsbuild/core': 1.5.6 '@types/babel__core': 7.20.5 deepmerge: 4.3.1 reduce-configs: 1.1.1 @@ -5924,7 +5877,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@rsbuild/plugin-check-syntax@1.3.0(@rsbuild/core@1.5.3)': + '@rsbuild/plugin-check-syntax@1.3.0(@rsbuild/core@1.5.6)': dependencies: acorn: 8.15.0 browserslist-to-es-version: 1.0.0 @@ -5932,47 +5885,39 @@ snapshots: picocolors: 1.1.1 source-map: 0.7.4 optionalDependencies: - '@rsbuild/core': 1.5.3 + '@rsbuild/core': 1.5.6 - '@rsbuild/plugin-react@1.4.0(@rsbuild/core@1.5.0)': + '@rsbuild/plugin-react@1.4.0(@rsbuild/core@1.5.6)': dependencies: - '@rsbuild/core': 1.5.0 + '@rsbuild/core': 1.5.6 '@rspack/plugin-react-refresh': 1.5.0(react-refresh@0.17.0) react-refresh: 0.17.0 transitivePeerDependencies: - webpack-hot-middleware - '@rsbuild/plugin-react@1.4.0(@rsbuild/core@1.5.3)': + '@rsbuild/plugin-sass@1.4.0(@rsbuild/core@1.5.6)': dependencies: - '@rsbuild/core': 1.5.3 - '@rspack/plugin-react-refresh': 1.5.0(react-refresh@0.17.0) - react-refresh: 0.17.0 - transitivePeerDependencies: - - webpack-hot-middleware - - '@rsbuild/plugin-sass@1.4.0(@rsbuild/core@1.5.3)': - dependencies: - '@rsbuild/core': 1.5.3 + '@rsbuild/core': 1.5.6 deepmerge: 4.3.1 loader-utils: 2.0.4 postcss: 8.5.6 reduce-configs: 1.1.1 sass-embedded: 1.90.0 - '@rsbuild/plugin-vue-jsx@1.1.1(@babel/core@7.28.3)(@rsbuild/core@1.5.0)': + '@rsbuild/plugin-vue-jsx@1.1.1(@babel/core@7.28.3)(@rsbuild/core@1.5.6)': dependencies: - '@rsbuild/plugin-babel': 1.0.6(@rsbuild/core@1.5.0) + '@rsbuild/plugin-babel': 1.0.6(@rsbuild/core@1.5.6) '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.28.3) babel-plugin-vue-jsx-hmr: 1.0.0 optionalDependencies: - '@rsbuild/core': 1.5.0 + '@rsbuild/core': 1.5.6 transitivePeerDependencies: - '@babel/core' - supports-color - '@rsbuild/plugin-vue@1.1.2(@rsbuild/core@1.5.0)(vue@3.5.20(typescript@5.9.2))': + '@rsbuild/plugin-vue@1.1.2(@rsbuild/core@1.5.6)(vue@3.5.20(typescript@5.9.2))': dependencies: - '@rsbuild/core': 1.5.0 + '@rsbuild/core': 1.5.6 vue-loader: 17.4.2(vue@3.5.20(typescript@5.9.2))(webpack@5.101.2) webpack: 5.101.2 transitivePeerDependencies: @@ -5985,13 +5930,13 @@ snapshots: '@rsdoctor/client@1.2.3': {} - '@rsdoctor/core@1.2.3(@rsbuild/core@1.5.3)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/core@1.2.3(@rsbuild/core@1.5.6)(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: - '@rsbuild/plugin-check-syntax': 1.3.0(@rsbuild/core@1.5.3) - '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/sdk': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/types': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsbuild/plugin-check-syntax': 1.3.0(@rsbuild/core@1.5.6) + '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/sdk': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/types': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) axios: 1.12.0 browserslist-load-config: 1.0.0 enhanced-resolve: 5.12.0 @@ -6010,10 +5955,10 @@ snapshots: - utf-8-validate - webpack - '@rsdoctor/graph@1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/graph@1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: - '@rsdoctor/types': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/types': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) lodash.unionby: 4.8.0 source-map: 0.7.4 transitivePeerDependencies: @@ -6021,16 +5966,16 @@ snapshots: - supports-color - webpack - '@rsdoctor/rspack-plugin@1.2.3(@rsbuild/core@1.5.3)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/rspack-plugin@1.2.3(@rsbuild/core@1.5.6)(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: - '@rsdoctor/core': 1.2.3(@rsbuild/core@1.5.3)(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/sdk': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/types': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/core': 1.2.3(@rsbuild/core@1.5.6)(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/sdk': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/types': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) lodash: 4.17.21 optionalDependencies: - '@rspack/core': 1.5.2(@swc/helpers@0.5.17) + '@rspack/core': 1.5.3(@swc/helpers@0.5.17) transitivePeerDependencies: - '@rsbuild/core' - bufferutil @@ -6039,12 +5984,12 @@ snapshots: - utf-8-validate - webpack - '@rsdoctor/sdk@1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/sdk@1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: '@rsdoctor/client': 1.2.3 - '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/types': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) - '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/graph': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/types': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/utils': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) '@types/fs-extra': 11.0.4 body-parser: 1.20.3 cors: 2.8.5 @@ -6063,20 +6008,20 @@ snapshots: - utf-8-validate - webpack - '@rsdoctor/types@1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/types@1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: '@types/connect': 3.4.38 '@types/estree': 1.0.5 '@types/tapable': 2.2.7 source-map: 0.7.4 optionalDependencies: - '@rspack/core': 1.5.2(@swc/helpers@0.5.17) + '@rspack/core': 1.5.3(@swc/helpers@0.5.17) webpack: 5.101.2 - '@rsdoctor/utils@1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2)': + '@rsdoctor/utils@1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2)': dependencies: '@babel/code-frame': 7.26.2 - '@rsdoctor/types': 1.2.3(@rspack/core@1.5.2(@swc/helpers@0.5.17))(webpack@5.101.2) + '@rsdoctor/types': 1.2.3(@rspack/core@1.5.3(@swc/helpers@0.5.17))(webpack@5.101.2) '@types/estree': 1.0.5 acorn: 8.15.0 acorn-import-attributes: 1.9.5(acorn@8.15.0) @@ -6097,14 +6042,16 @@ snapshots: - supports-color - webpack - '@rslib/core@0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(typescript@5.9.2)': + '@rslib/core@0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(typescript@5.9.2)': dependencies: - '@rsbuild/core': 1.5.0-beta.4 - rsbuild-plugin-dts: 0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(@rsbuild/core@1.5.0-beta.4)(typescript@5.9.2) - tinyglobby: 0.2.14 + '@rsbuild/core': 1.5.4 + rsbuild-plugin-dts: 0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(@rsbuild/core@1.5.4)(typescript@5.9.2) + tinyglobby: 0.2.15 optionalDependencies: - '@microsoft/api-extractor': 7.52.11(@types/node@22.16.5) + '@microsoft/api-extractor': 7.52.11(@types/node@22.18.1) typescript: 5.9.2 + transitivePeerDependencies: + - '@typescript/native-preview' '@rslint/core@0.1.12': optionalDependencies: @@ -6133,127 +6080,69 @@ snapshots: '@rslint/win32-x64@0.1.12': optional: true - '@rspack/binding-darwin-arm64@1.5.0': - optional: true - - '@rspack/binding-darwin-arm64@1.5.0-beta.1': - optional: true - '@rspack/binding-darwin-arm64@1.5.2': optional: true - '@rspack/binding-darwin-x64@1.5.0': - optional: true - - '@rspack/binding-darwin-x64@1.5.0-beta.1': + '@rspack/binding-darwin-arm64@1.5.3': optional: true '@rspack/binding-darwin-x64@1.5.2': optional: true - '@rspack/binding-linux-arm64-gnu@1.5.0': - optional: true - - '@rspack/binding-linux-arm64-gnu@1.5.0-beta.1': + '@rspack/binding-darwin-x64@1.5.3': optional: true '@rspack/binding-linux-arm64-gnu@1.5.2': optional: true - '@rspack/binding-linux-arm64-musl@1.5.0': - optional: true - - '@rspack/binding-linux-arm64-musl@1.5.0-beta.1': + '@rspack/binding-linux-arm64-gnu@1.5.3': optional: true '@rspack/binding-linux-arm64-musl@1.5.2': optional: true - '@rspack/binding-linux-x64-gnu@1.5.0': - optional: true - - '@rspack/binding-linux-x64-gnu@1.5.0-beta.1': + '@rspack/binding-linux-arm64-musl@1.5.3': optional: true '@rspack/binding-linux-x64-gnu@1.5.2': optional: true - '@rspack/binding-linux-x64-musl@1.5.0': - optional: true - - '@rspack/binding-linux-x64-musl@1.5.0-beta.1': + '@rspack/binding-linux-x64-gnu@1.5.3': optional: true '@rspack/binding-linux-x64-musl@1.5.2': optional: true - '@rspack/binding-wasm32-wasi@1.5.0': - dependencies: - '@napi-rs/wasm-runtime': 1.0.1 + '@rspack/binding-linux-x64-musl@1.5.3': optional: true - '@rspack/binding-wasm32-wasi@1.5.0-beta.1': + '@rspack/binding-wasm32-wasi@1.5.2': dependencies: '@napi-rs/wasm-runtime': 1.0.1 optional: true - '@rspack/binding-wasm32-wasi@1.5.2': + '@rspack/binding-wasm32-wasi@1.5.3': dependencies: '@napi-rs/wasm-runtime': 1.0.1 optional: true - '@rspack/binding-win32-arm64-msvc@1.5.0': - optional: true - - '@rspack/binding-win32-arm64-msvc@1.5.0-beta.1': - optional: true - '@rspack/binding-win32-arm64-msvc@1.5.2': optional: true - '@rspack/binding-win32-ia32-msvc@1.5.0': - optional: true - - '@rspack/binding-win32-ia32-msvc@1.5.0-beta.1': + '@rspack/binding-win32-arm64-msvc@1.5.3': optional: true '@rspack/binding-win32-ia32-msvc@1.5.2': optional: true - '@rspack/binding-win32-x64-msvc@1.5.0': - optional: true - - '@rspack/binding-win32-x64-msvc@1.5.0-beta.1': + '@rspack/binding-win32-ia32-msvc@1.5.3': optional: true '@rspack/binding-win32-x64-msvc@1.5.2': optional: true - '@rspack/binding@1.5.0': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.5.0 - '@rspack/binding-darwin-x64': 1.5.0 - '@rspack/binding-linux-arm64-gnu': 1.5.0 - '@rspack/binding-linux-arm64-musl': 1.5.0 - '@rspack/binding-linux-x64-gnu': 1.5.0 - '@rspack/binding-linux-x64-musl': 1.5.0 - '@rspack/binding-wasm32-wasi': 1.5.0 - '@rspack/binding-win32-arm64-msvc': 1.5.0 - '@rspack/binding-win32-ia32-msvc': 1.5.0 - '@rspack/binding-win32-x64-msvc': 1.5.0 - - '@rspack/binding@1.5.0-beta.1': - optionalDependencies: - '@rspack/binding-darwin-arm64': 1.5.0-beta.1 - '@rspack/binding-darwin-x64': 1.5.0-beta.1 - '@rspack/binding-linux-arm64-gnu': 1.5.0-beta.1 - '@rspack/binding-linux-arm64-musl': 1.5.0-beta.1 - '@rspack/binding-linux-x64-gnu': 1.5.0-beta.1 - '@rspack/binding-linux-x64-musl': 1.5.0-beta.1 - '@rspack/binding-wasm32-wasi': 1.5.0-beta.1 - '@rspack/binding-win32-arm64-msvc': 1.5.0-beta.1 - '@rspack/binding-win32-ia32-msvc': 1.5.0-beta.1 - '@rspack/binding-win32-x64-msvc': 1.5.0-beta.1 + '@rspack/binding-win32-x64-msvc@1.5.3': + optional: true '@rspack/binding@1.5.2': optionalDependencies: @@ -6268,26 +6157,31 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.5.2 '@rspack/binding-win32-x64-msvc': 1.5.2 - '@rspack/core@1.5.0(@swc/helpers@0.5.17)': - dependencies: - '@module-federation/runtime-tools': 0.18.0 - '@rspack/binding': 1.5.0 - '@rspack/lite-tapable': 1.0.1 + '@rspack/binding@1.5.3': optionalDependencies: - '@swc/helpers': 0.5.17 + '@rspack/binding-darwin-arm64': 1.5.3 + '@rspack/binding-darwin-x64': 1.5.3 + '@rspack/binding-linux-arm64-gnu': 1.5.3 + '@rspack/binding-linux-arm64-musl': 1.5.3 + '@rspack/binding-linux-x64-gnu': 1.5.3 + '@rspack/binding-linux-x64-musl': 1.5.3 + '@rspack/binding-wasm32-wasi': 1.5.3 + '@rspack/binding-win32-arm64-msvc': 1.5.3 + '@rspack/binding-win32-ia32-msvc': 1.5.3 + '@rspack/binding-win32-x64-msvc': 1.5.3 - '@rspack/core@1.5.0-beta.1(@swc/helpers@0.5.17)': + '@rspack/core@1.5.2(@swc/helpers@0.5.17)': dependencies: '@module-federation/runtime-tools': 0.18.0 - '@rspack/binding': 1.5.0-beta.1 + '@rspack/binding': 1.5.2 '@rspack/lite-tapable': 1.0.1 optionalDependencies: '@swc/helpers': 0.5.17 - '@rspack/core@1.5.2(@swc/helpers@0.5.17)': + '@rspack/core@1.5.3(@swc/helpers@0.5.17)': dependencies: '@module-federation/runtime-tools': 0.18.0 - '@rspack/binding': 1.5.2 + '@rspack/binding': 1.5.3 '@rspack/lite-tapable': 1.0.1 optionalDependencies: '@swc/helpers': 0.5.17 @@ -6304,8 +6198,8 @@ snapshots: dependencies: '@mdx-js/mdx': 3.1.1 '@mdx-js/react': 3.1.1(@types/react@19.1.11)(react@19.1.1) - '@rsbuild/core': 1.5.3 - '@rsbuild/plugin-react': 1.4.0(@rsbuild/core@1.5.3) + '@rsbuild/core': 1.5.6 + '@rsbuild/plugin-react': 1.4.0(@rsbuild/core@1.5.6) '@rspress/mdx-rs': 0.6.6 '@rspress/runtime': 2.0.0-beta.31 '@rspress/shared': 2.0.0-beta.31 @@ -6331,7 +6225,7 @@ snapshots: rehype-raw: 7.0.0 remark-gfm: 4.0.1 shiki: 3.12.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 unified: 11.0.5 unist-util-visit: 5.0.0 @@ -6409,7 +6303,7 @@ snapshots: '@rspress/shared@2.0.0-beta.31': dependencies: - '@rsbuild/core': 1.5.3 + '@rsbuild/core': 1.5.6 '@shikijs/rehype': 3.12.2 gray-matter: 4.0.3 lodash-es: 4.17.21 @@ -6442,7 +6336,7 @@ snapshots: - react - react-dom - '@rushstack/node-core-library@5.14.0(@types/node@22.16.5)': + '@rushstack/node-core-library@5.14.0(@types/node@22.18.1)': dependencies: ajv: 8.13.0 ajv-draft-04: 1.0.0(ajv@8.13.0) @@ -6453,23 +6347,23 @@ snapshots: resolve: 1.22.10 semver: 7.5.4 optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@rushstack/rig-package@0.5.3': dependencies: resolve: 1.22.10 strip-json-comments: 3.1.1 - '@rushstack/terminal@0.15.4(@types/node@22.16.5)': + '@rushstack/terminal@0.15.4(@types/node@22.18.1)': dependencies: - '@rushstack/node-core-library': 5.14.0(@types/node@22.16.5) + '@rushstack/node-core-library': 5.14.0(@types/node@22.18.1) supports-color: 8.1.1 optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 - '@rushstack/ts-command-line@5.0.2(@types/node@22.16.5)': + '@rushstack/ts-command-line@5.0.2(@types/node@22.18.1)': dependencies: - '@rushstack/terminal': 0.15.4(@types/node@22.16.5) + '@rushstack/terminal': 0.15.4(@types/node@22.18.1) '@types/argparse': 1.0.38 argparse: 1.0.10 string-argv: 0.3.2 @@ -6613,11 +6507,11 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/cors@2.8.17': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/debug@4.1.12': dependencies: @@ -6646,12 +6540,14 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 + '@types/is-url@1.2.32': {} + '@types/istanbul-lib-coverage@2.0.6': {} '@types/istanbul-lib-report@3.0.3': @@ -6677,7 +6573,7 @@ snapshots: '@types/jsdom@21.1.7': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/tough-cookie': 4.0.5 parse5: 7.3.0 @@ -6685,7 +6581,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/mdast@4.0.4': dependencies: @@ -6701,13 +6597,13 @@ snapshots: dependencies: undici-types: 6.21.0 - '@types/node@22.16.5': + '@types/node@22.18.1': dependencies: undici-types: 6.21.0 '@types/pixelmatch@5.2.6': dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 '@types/react-dom@19.1.8(@types/react@19.1.11)': dependencies: @@ -6765,7 +6661,7 @@ snapshots: '@vitest/snapshot@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 '@vitest/spy@3.2.4': @@ -6828,7 +6724,7 @@ snapshots: '@vue/compiler-ssr': 3.5.20 '@vue/shared': 3.5.20 estree-walker: 2.0.2 - magic-string: 0.30.17 + magic-string: 0.30.19 postcss: 8.5.6 source-map-js: 1.2.1 @@ -7151,14 +7047,14 @@ snapshots: browserslist-to-es-version@1.0.0: dependencies: - browserslist: 4.25.1 + browserslist: 4.24.5 - browserslist@4.25.1: + browserslist@4.24.5: dependencies: - caniuse-lite: 1.0.30001727 - electron-to-chromium: 1.5.187 + caniuse-lite: 1.0.30001718 + electron-to-chromium: 1.5.150 node-releases: 2.0.19 - update-browserslist-db: 1.1.3(browserslist@4.25.1) + update-browserslist-db: 1.1.3(browserslist@4.24.5) buffer-builder@0.2.0: {} @@ -7183,7 +7079,7 @@ snapshots: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - caniuse-lite@1.0.30001727: {} + caniuse-lite@1.0.30001718: {} ccount@2.0.1: {} @@ -7254,6 +7150,8 @@ snapshots: cli-spinners@2.6.1: {} + cli-spinners@2.9.2: {} + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -7454,7 +7352,7 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.187: {} + electron-to-chromium@1.5.150: {} emoji-regex@8.0.0: {} @@ -7473,7 +7371,7 @@ snapshots: engine.io@6.6.4: dependencies: '@types/cors': 2.8.17 - '@types/node': 22.16.5 + '@types/node': 22.18.1 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.7.2 @@ -7641,9 +7539,9 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.4.4(picomatch@4.0.2): + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: - picomatch: 4.0.2 + picomatch: 4.0.3 figures@3.2.0: dependencies: @@ -8092,6 +7990,8 @@ snapshots: is-unicode-supported@0.1.0: {} + is-url@1.2.4: {} + is-windows@1.0.2: {} is-wsl@2.2.0: @@ -8110,7 +8010,7 @@ snapshots: make-dir: 4.0.0 supports-color: 7.2.0 - istanbul-reports@3.1.7: + istanbul-reports@3.2.0: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 @@ -8162,7 +8062,7 @@ snapshots: jest-mock@30.0.5: dependencies: '@jest/types': 30.0.5 - '@types/node': 22.16.5 + '@types/node': 22.18.1 jest-util: 30.0.5 jest-regex-util@30.0.1: {} @@ -8170,15 +8070,15 @@ snapshots: jest-util@30.0.5: dependencies: '@jest/types': 30.0.5 - '@types/node': 22.16.5 + '@types/node': 22.18.1 chalk: 4.1.2 ci-info: 4.3.0 graceful-fs: 4.2.11 - picomatch: 4.0.2 + picomatch: 4.0.3 jest-worker@27.5.1: dependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.1 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -8227,7 +8127,7 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.2.0 - ws: 8.18.2 + ws: 8.18.3 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -8315,9 +8215,9 @@ snapshots: lz-string@1.5.0: {} - magic-string@0.30.17: + magic-string@0.30.19: dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 make-dir@4.0.0: dependencies: @@ -8943,7 +8843,7 @@ snapshots: bl: 4.1.0 chalk: 4.1.2 cli-cursor: 3.1.0 - cli-spinners: 2.6.1 + cli-spinners: 2.9.2 is-interactive: 1.0.0 log-symbols: 4.1.0 strip-ansi: 6.0.1 @@ -9023,7 +8923,7 @@ snapshots: picomatch@2.3.1: {} - picomatch@4.0.2: {} + picomatch@4.0.3: {} pify@4.0.1: {} @@ -9281,25 +9181,25 @@ snapshots: rrweb-cssom@0.8.0: {} - rsbuild-plugin-dts@0.12.2(@microsoft/api-extractor@7.52.11(@types/node@22.16.5))(@rsbuild/core@1.5.0-beta.4)(typescript@5.9.2): + rsbuild-plugin-dts@0.13.2(@microsoft/api-extractor@7.52.11(@types/node@22.18.1))(@rsbuild/core@1.5.4)(typescript@5.9.2): dependencies: '@ast-grep/napi': 0.37.0 - '@rsbuild/core': 1.5.0-beta.4 - magic-string: 0.30.17 + '@rsbuild/core': 1.5.4 + magic-string: 0.30.19 picocolors: 1.1.1 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tsconfig-paths: 4.2.0 optionalDependencies: - '@microsoft/api-extractor': 7.52.11(@types/node@22.16.5) + '@microsoft/api-extractor': 7.52.11(@types/node@22.18.1) typescript: 5.9.2 - rsbuild-plugin-google-analytics@1.0.4(@rsbuild/core@1.5.3): + rsbuild-plugin-google-analytics@1.0.4(@rsbuild/core@1.5.6): optionalDependencies: - '@rsbuild/core': 1.5.3 + '@rsbuild/core': 1.5.6 - rsbuild-plugin-open-graph@1.1.0(@rsbuild/core@1.5.3): + rsbuild-plugin-open-graph@1.1.0(@rsbuild/core@1.5.6): optionalDependencies: - '@rsbuild/core': 1.5.3 + '@rsbuild/core': 1.5.6 rslog@1.2.11: {} @@ -9566,7 +9466,7 @@ snapshots: is-plain-obj: 4.1.0 semver: 7.7.2 sort-object-keys: 1.1.3 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 source-map-js@1.2.1: {} @@ -9721,10 +9621,10 @@ snapshots: tinyexec@1.0.1: {} - tinyglobby@0.2.14: + tinyglobby@0.2.15: dependencies: - fdir: 6.4.4(picomatch@4.0.2) - picomatch: 4.0.2 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 tinypool@1.1.1: {} @@ -9850,9 +9750,9 @@ snapshots: upath@2.0.1: {} - update-browserslist-db@1.1.3(browserslist@4.25.1): + update-browserslist-db@1.1.3(browserslist@4.24.5): dependencies: - browserslist: 4.25.1 + browserslist: 4.24.5 escalade: 3.2.0 picocolors: 1.1.1 @@ -9937,7 +9837,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.14.1 acorn: 8.15.0 acorn-import-phases: 1.0.4(acorn@8.15.0) - browserslist: 4.25.1 + browserslist: 4.24.5 chrome-trace-event: 1.0.4 enhanced-resolve: 5.18.3 es-module-lexer: 1.7.0 @@ -9992,7 +9892,7 @@ snapshots: ws@8.17.1: {} - ws@8.18.2: {} + ws@8.18.3: {} xml-name-validator@5.0.0: {}