diff --git a/.github/workflows/test-ubuntu.yml b/.github/workflows/test-ubuntu.yml index 0695296fb..b788670ee 100644 --- a/.github/workflows/test-ubuntu.yml +++ b/.github/workflows/test-ubuntu.yml @@ -17,9 +17,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # ======== ut ======== - ut-mac: - # run ut in MacOS, as SWC cases will fail in Ubuntu CI - runs-on: macos-14 + ut-ubuntu: + runs-on: ubuntu-latest strategy: matrix: node-version: [18.x] @@ -60,8 +59,8 @@ jobs: if: steps.changes.outputs.changed == 'true' run: pnpm run test:unit - # ======== e2e ======== - e2e-ubuntu: + # ======== integration && e2e ======== + integration-e2e-ubuntu: runs-on: ubuntu-latest strategy: matrix: @@ -97,18 +96,12 @@ jobs: - name: Install Dependencies if: steps.changes.outputs.changed == 'true' - run: pnpm install && cd ./e2e && pnpx playwright install - - - name: E2E Artifact Test (Vitest) - if: steps.changes.outputs.changed == 'true' - run: pnpm run test:artifact + run: pnpm install && cd ./tests && npx playwright install - - name: Examples Test + - name: Features Integration Test (Vitest) if: steps.changes.outputs.changed == 'true' - run: | - pnpm run build:examples + run: pnpm run test:features - - name: E2E Test (Playwright) + - name: Examples E2E Test (Playwright) if: steps.changes.outputs.changed == 'true' run: pnpm run test:e2e - diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index dec5bb913..3b2bccc68 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -64,8 +64,8 @@ jobs: if: steps.changes.outputs.changed == 'true' run: pnpm run test:unit - # # ======== e2e ======== - e2e-windows: + # # ======== integration && e2e ======== + integration-e2e-windows: runs-on: windows-latest strategy: matrix: @@ -106,16 +106,12 @@ jobs: - name: Install Dependencies if: steps.changes.outputs.changed == 'true' - run: pnpm install && cd ./e2e && npx playwright install + run: pnpm install && cd ./tests && npx playwright install - - name: E2E Artifact Test (Vitest) + - name: Features Integration Test (Vitest) if: steps.changes.outputs.changed == 'true' - run: pnpm run test:artifact + run: pnpm run test:features - - name: Examples Test - if: steps.changes.outputs.changed == 'true' - run: pnpm run build:examples - - - name: E2E Test (Playwright) + - name: Examples E2E Test (Playwright) if: steps.changes.outputs.changed == 'true' run: pnpm run test:e2e diff --git a/.gitignore b/.gitignore index d8068c04c..4dca0955d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ doc_build/ playwright-report/ tsconfig.tsbuildinfo test-temp-* +test-results .vscode/**/* !.vscode/settings.json diff --git a/biome.json b/biome.json index d7893851b..fcdfd05fd 100644 --- a/biome.json +++ b/biome.json @@ -36,7 +36,7 @@ }, "linter": { "enabled": true, - "ignore": ["./e2e/cases/**/*/src/*"], + "ignore": ["./tests/features/**/*/src/*"], "rules": { "recommended": true, "style": { diff --git a/e2e/cases/copy/index.test.ts b/e2e/cases/copy/index.test.ts deleted file mode 100644 index 41df4b49e..000000000 --- a/e2e/cases/copy/index.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { join } from 'node:path'; -import { buildAndGetResults, generateFileTree } from '@e2e/helper'; -import { expect, test } from 'vitest'; - -test('copy', async () => { - const fixturePath = __dirname; - await buildAndGetResults(fixturePath); - - const fileTree = generateFileTree(join(fixturePath, './dist/esm')); - expect(fileTree).toMatchInlineSnapshot(` - { - "index.js": "/e2e/cases/copy/dist/esm/index.js", - "temp-1": { - "b.png": "/e2e/cases/copy/dist/esm/temp-1/b.png", - }, - "temp-2": { - "a.png": "/e2e/cases/copy/dist/esm/temp-2/a.png", - }, - "temp-3": { - "a.png": "/e2e/cases/copy/dist/esm/temp-3/a.png", - "b.txt": "/e2e/cases/copy/dist/esm/temp-3/b.txt", - }, - "temp-4": { - "_index.html": "/e2e/cases/copy/dist/esm/temp-4/_index.html", - }, - "temp-5": { - "index.html": "/e2e/cases/copy/dist/esm/temp-5/index.html", - }, - "temp-6": { - "index.html": "/e2e/cases/copy/dist/esm/temp-6/index.html", - }, - } - `); -}); diff --git a/e2e/cases/sourcemap/index.test.ts b/e2e/cases/sourcemap/index.test.ts deleted file mode 100644 index 586cf1acc..000000000 --- a/e2e/cases/sourcemap/index.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -import os from 'node:os'; -import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; -import { expect, test } from 'vitest'; - -test('should not generate js sourcemap by default', async () => { - const fixturePath = join(__dirname, 'default'); - const { contents } = await buildAndGetResults(fixturePath, 'js'); - const files = Object.keys(contents.esm); - - expect(files).toMatchInlineSnapshot(` - [ - "/e2e/cases/sourcemap/default/dist/esm/index.js", - ] - `); -}); - -test('should generate js external sourcemap: cheap-module-source-map', async () => { - const fixturePath = join(__dirname, 'external'); - const { contents } = await buildAndGetResults(fixturePath, 'js'); - const files = Object.keys(contents.esm); - - expect(files).toMatchInlineSnapshot(` - [ - "/e2e/cases/sourcemap/external/dist/esm/index.js", - "/e2e/cases/sourcemap/external/dist/esm/index.js.map", - ] - `); -}); - -test('should generate js inline sourcemap: inline-cheap-module-source-map', async () => { - const fixturePath = join(__dirname, 'inline'); - const { contents } = await buildAndGetResults(fixturePath, 'js'); - const files = Object.keys(contents.esm); - const code = Object.values(contents.esm); - - expect(files).toMatchInlineSnapshot(` - [ - "/e2e/cases/sourcemap/inline/dist/esm/index.js", - ] - `); - - if (os.platform() === 'win32') { - expect(code).toMatchInlineSnapshot(` - [ - "const foo = 'foo'; - export { foo }; - - //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9zb3VyY2VtYXAtaW5saW5lLXRlc3QvLi4vX19maXh0dXJlc19fL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZm9vID0gJ2Zvbyc7XHJcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9", - ] - `); - } else { - expect(code).toMatchInlineSnapshot(` - [ - "const foo = 'foo'; - export { foo }; - - //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9zb3VyY2VtYXAtaW5saW5lLXRlc3QvLi4vX19maXh0dXJlc19fL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZm9vID0gJ2Zvbyc7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==", - ] - `); - } -}); diff --git a/package.json b/package.json index 0e1125cba..195f34586 100644 --- a/package.json +++ b/package.json @@ -13,16 +13,17 @@ "changeset": "changeset", "check-dependency-version": "check-dependency-version-consistency .", "check-spell": "npx cspell", - "lint": "biome check . --diagnostic-level=warn && pnpm run check-spell", + "lint": "biome check . --diagnostic-level=warn && pnpm run check-spell", "prebundle": "nx run-many -t prebundle", "prepare": "pnpm run build && simple-git-hooks", "sort-package-json": "npx sort-package-json \"packages/*/package.json\"", - "test:artifact": "vitest run --project artifact", - "test:artifact:watch": "vitest --project artifact", - "test:e2e": "cd e2e && pnpm run test", + "test": "pnpm run test:unit && pnpm run test:features && pnpm run test:e2e", + "test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e", + "test:features": "vitest run --project features", + "test:features:watch": "vitest --project features", "test:unit": "vitest run --project unit*", "test:unit:watch": "vitest --project unit*", - "testu": "pnpm run test:unit -u && pnpm run test:artifact -u", + "test:update": "pnpm run test:unit -u && pnpm run test:features -u", "update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l", "watch": "pnpm build --watch" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93e7c53b0..f634ff958 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,7 +57,141 @@ importers: specifier: ^2.1.1 version: 2.1.1(@types/node@18.19.39)(terser@5.31.6) - e2e: + examples/express-plugin: + devDependencies: + '@rslib/core': + specifier: workspace:* + version: link:../../packages/core + '@types/express': + specifier: ^4.17.21 + version: 4.17.21 + express: + specifier: ^4.21.0 + version: 4.21.0 + typescript: + specifier: ^5.6.2 + version: 5.6.2 + + examples/react-component: + devDependencies: + '@rsbuild/plugin-react': + specifier: 1.0.2 + version: 1.0.2(@rsbuild/core@1.0.7) + '@rslib/core': + specifier: workspace:* + version: link:../../packages/core + '@types/react': + specifier: ^18.3.9 + version: 18.3.9 + react: + specifier: ^18.3.1 + version: 18.3.1 + + packages/core: + dependencies: + '@microsoft/api-extractor': + specifier: ^7 + version: 7.47.9(@types/node@18.19.39) + '@rsbuild/core': + specifier: 1.0.7 + version: 1.0.7 + rsbuild-plugin-dts: + specifier: workspace:* + version: link:../plugin-dts + devDependencies: + '@rslib/tsconfig': + specifier: workspace:* + version: link:../../scripts/tsconfig + '@types/fs-extra': + specifier: ^11.0.4 + version: 11.0.4 + commander: + specifier: ^12.1.0 + version: 12.1.0 + fast-glob: + specifier: ^3.3.2 + version: 3.3.2 + fs-extra: + specifier: ^11.2.0 + version: 11.2.0 + memfs: + specifier: ^4.12.0 + version: 4.12.0 + picocolors: + specifier: 1.1.0 + version: 1.1.0 + prebundle: + specifier: 1.2.2 + version: 1.2.2(typescript@5.6.2) + rslib: + specifier: npm:@rslib/core@0.0.7 + version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' + rslog: + specifier: ^1.2.3 + version: 1.2.3 + tsconfck: + specifier: 3.1.3 + version: 3.1.3(typescript@5.6.2) + typescript: + specifier: ^5.6.2 + version: 5.6.2 + + packages/create-rslib: + dependencies: + create-rstack: + specifier: 1.0.3 + version: 1.0.3 + devDependencies: + '@rslib/tsconfig': + specifier: workspace:* + version: link:../../scripts/tsconfig + '@types/fs-extra': + specifier: ^11.0.4 + version: 11.0.4 + '@types/node': + specifier: ~18.19.39 + version: 18.19.39 + fs-extra: + specifier: ^11.2.0 + version: 11.2.0 + rslib: + specifier: npm:@rslib/core@0.0.7 + version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' + typescript: + specifier: ^5.6.2 + version: 5.6.2 + + packages/plugin-dts: + dependencies: + fast-glob: + specifier: ^3.3.2 + version: 3.3.2 + magic-string: + specifier: ^0.30.11 + version: 0.30.11 + picocolors: + specifier: 1.1.0 + version: 1.1.0 + devDependencies: + '@microsoft/api-extractor': + specifier: ^7.47.9 + version: 7.47.9(@types/node@18.19.39) + '@rsbuild/core': + specifier: 1.0.7 + version: 1.0.7 + '@rslib/tsconfig': + specifier: workspace:* + version: link:../../scripts/tsconfig + rslib: + specifier: npm:@rslib/core@0.0.7 + version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' + typescript: + specifier: ^5.6.2 + version: 5.6.2 + + scripts/tsconfig: {} + + tests: dependencies: '@examples/react-component': specifier: workspace:* @@ -69,9 +203,6 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) devDependencies: - '@e2e/helper': - specifier: workspace:* - version: link:scripts '@playwright/test': specifier: 1.47.2 version: 1.47.2 @@ -111,12 +242,17 @@ importers: strip-ansi: specifier: ^7.1.0 version: 7.1.0 + test-helper: + specifier: workspace:* + version: link:scripts + + tests/e2e/react-component: {} - e2e/cases/alias: {} + tests/features/alias: {} - e2e/cases/asset/limit: {} + tests/features/asset/limit: {} - e2e/cases/asset/name: + tests/features/asset/name: dependencies: react: specifier: ^18.3.1 @@ -126,11 +262,11 @@ importers: specifier: ^1.0.2 version: 1.0.2(@rsbuild/core@1.0.7) - e2e/cases/asset/path: {} + tests/features/asset/path: {} - e2e/cases/asset/public-path: {} + tests/features/asset/public-path: {} - e2e/cases/asset/svgr: + tests/features/asset/svgr: dependencies: react: specifier: ^18 @@ -143,19 +279,19 @@ importers: specifier: 1.0.2 version: 1.0.2(@rsbuild/core@1.0.7)(typescript@5.6.2) - e2e/cases/auto-extension/type-commonjs/config-override: {} + tests/features/auto-extension/type-commonjs/config-override: {} - e2e/cases/auto-extension/type-commonjs/default: {} + tests/features/auto-extension/type-commonjs/default: {} - e2e/cases/auto-extension/type-commonjs/false: {} + tests/features/auto-extension/type-commonjs/false: {} - e2e/cases/auto-extension/type-module/config-override: {} + tests/features/auto-extension/type-module/config-override: {} - e2e/cases/auto-extension/type-module/default: {} + tests/features/auto-extension/type-module/default: {} - e2e/cases/auto-extension/type-module/false: {} + tests/features/auto-extension/type-module/false: {} - e2e/cases/auto-external/default: + tests/features/auto-external/default: dependencies: ora: specifier: 8.1.0 @@ -164,13 +300,13 @@ importers: specifier: ^18.3.1 version: 18.3.1 - e2e/cases/auto-external/external-sub-path: + tests/features/auto-external/external-sub-path: dependencies: react: specifier: ^18.3.1 version: 18.3.1 - e2e/cases/auto-external/false: + tests/features/auto-external/false: dependencies: ora: specifier: 8.1.0 @@ -179,29 +315,29 @@ importers: specifier: ^18.3.1 version: 18.3.1 - e2e/cases/auto-external/module-import-warn: + tests/features/auto-external/module-import-warn: dependencies: react: specifier: ^18.3.1 version: 18.3.1 - e2e/cases/auto-external/with-externals: + tests/features/auto-external/with-externals: dependencies: react: specifier: ^18.3.1 version: 18.3.1 - e2e/cases/banner-footer: {} + tests/features/banner-footer: {} - e2e/cases/bundle-false/asset: {} + tests/features/bundle-false/asset: {} - e2e/cases/bundle-false/basic: {} + tests/features/bundle-false/basic: {} - e2e/cases/bundle-false/js-extension: {} + tests/features/bundle-false/js-extension: {} - e2e/cases/bundle-false/single-file: {} + tests/features/bundle-false/single-file: {} - e2e/cases/bundle-false/svgr: + tests/features/bundle-false/svgr: dependencies: react: specifier: ^18.3.1 @@ -214,111 +350,109 @@ importers: specifier: 1.0.2 version: 1.0.2(@rsbuild/core@1.0.7)(typescript@5.6.2) - e2e/cases/cli: {} - - e2e/cases/copy: {} + tests/features/cli: {} - e2e/cases/decorators/default: {} + tests/features/copy: {} - e2e/cases/decorators/tsconfig: {} + tests/features/decorators/default: {} - e2e/cases/define: {} + tests/features/decorators/tsconfig: {} - e2e/cases/dts/bundle-false/abort-on-error: {} + tests/features/define: {} - e2e/cases/dts/bundle-false/auto-extension: {} + tests/features/dts/bundle-false/abort-on-error: {} - e2e/cases/dts/bundle-false/basic: {} + tests/features/dts/bundle-false/auto-extension: {} - e2e/cases/dts/bundle-false/dist-path: {} + tests/features/dts/bundle-false/basic: {} - e2e/cases/dts/bundle-false/false: {} + tests/features/dts/bundle-false/dist-path: {} - e2e/cases/dts/bundle/abort-on-error: {} + tests/features/dts/bundle-false/false: {} - e2e/cases/dts/bundle/absolute-entry: {} + tests/features/dts/bundle/abort-on-error: {} - e2e/cases/dts/bundle/auto-extension: {} + tests/features/dts/bundle/absolute-entry: {} - e2e/cases/dts/bundle/basic: {} + tests/features/dts/bundle/auto-extension: {} - e2e/cases/dts/bundle/bundle-name: {} + tests/features/dts/bundle/basic: {} - e2e/cases/dts/bundle/dist-path: {} + tests/features/dts/bundle/bundle-name: {} - e2e/cases/dts/bundle/false: {} + tests/features/dts/bundle/dist-path: {} - e2e/cases/entry/glob: {} + tests/features/dts/bundle/false: {} - e2e/cases/entry/multiple: {} + tests/features/entry/glob: {} - e2e/cases/entry/single: {} + tests/features/entry/multiple: {} - e2e/cases/examples-e2e/react-component: {} + tests/features/entry/single: {} - e2e/cases/extension-alias: {} + tests/features/extension-alias: {} - e2e/cases/external-helpers/config-override: + tests/features/external-helpers/config-override: dependencies: '@swc/helpers': specifier: 0.5.13 version: 0.5.13 - e2e/cases/external-helpers/default: {} + tests/features/external-helpers/default: {} - e2e/cases/external-helpers/no-deps: {} + tests/features/external-helpers/no-deps: {} - e2e/cases/external-helpers/true: + tests/features/external-helpers/true: dependencies: '@swc/helpers': specifier: 0.5.13 version: 0.5.13 - e2e/cases/externals/browser: {} + tests/features/externals/browser: {} - e2e/cases/externals/module-import-warn: {} + tests/features/externals/module-import-warn: {} - e2e/cases/externals/node: {} + tests/features/externals/node: {} - e2e/cases/minify/config: {} + tests/features/minify/config: {} - e2e/cases/minify/default: {} + tests/features/minify/default: {} - e2e/cases/resolve/data-url: {} + tests/features/resolve/data-url: {} - e2e/cases/resolve/false: {} + tests/features/resolve/false: {} - e2e/cases/resolve/false/browser-false: {} + tests/features/resolve/false/browser-false: {} - e2e/cases/resolve/node-protocol: {} + tests/features/resolve/node-protocol: {} - e2e/cases/resolve/with-condition-exports: {} + tests/features/resolve/with-condition-exports: {} - e2e/cases/resolve/with-js-extensions: {} + tests/features/resolve/with-js-extensions: {} - e2e/cases/resolve/with-main-fields: {} + tests/features/resolve/with-main-fields: {} - e2e/cases/shims/cjs: {} + tests/features/shims/cjs: {} - e2e/cases/shims/esm: {} + tests/features/shims/esm: {} - e2e/cases/sourcemap/default: {} + tests/features/sourcemap/default: {} - e2e/cases/sourcemap/external: {} + tests/features/sourcemap/external: {} - e2e/cases/sourcemap/inline: {} + tests/features/sourcemap/inline: {} - e2e/cases/syntax/config: {} + tests/features/syntax/config: {} - e2e/cases/syntax/default: {} + tests/features/syntax/default: {} - e2e/cases/transform-import/arco-design: + tests/features/transform-import/arco-design: dependencies: '@arco-design/web-react': specifier: ^2.64.0 version: 2.64.0(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - e2e/cases/transform-import/lodash: + tests/features/transform-import/lodash: dependencies: lodash: specifier: ^4.17.21 @@ -326,145 +460,11 @@ importers: devDependencies: '@types/lodash': specifier: ^4.17.7 - version: 4.17.7 + version: 4.17.9 - e2e/cases/tsconfig: {} + tests/features/tsconfig: {} - e2e/scripts: {} - - examples/express-plugin: - devDependencies: - '@rslib/core': - specifier: workspace:* - version: link:../../packages/core - '@types/express': - specifier: ^4.17.21 - version: 4.17.21 - express: - specifier: ^4.21.0 - version: 4.21.0 - typescript: - specifier: ^5.6.2 - version: 5.6.2 - - examples/react-component: - devDependencies: - '@rsbuild/plugin-react': - specifier: 1.0.2 - version: 1.0.2(@rsbuild/core@1.0.7) - '@rslib/core': - specifier: workspace:* - version: link:../../packages/core - '@types/react': - specifier: ^18.3.9 - version: 18.3.9 - react: - specifier: ^18.3.1 - version: 18.3.1 - - packages/core: - dependencies: - '@microsoft/api-extractor': - specifier: ^7 - version: 7.47.9(@types/node@18.19.39) - '@rsbuild/core': - specifier: 1.0.7 - version: 1.0.7 - rsbuild-plugin-dts: - specifier: workspace:* - version: link:../plugin-dts - devDependencies: - '@rslib/tsconfig': - specifier: workspace:* - version: link:../../scripts/tsconfig - '@types/fs-extra': - specifier: ^11.0.4 - version: 11.0.4 - commander: - specifier: ^12.1.0 - version: 12.1.0 - fast-glob: - specifier: ^3.3.2 - version: 3.3.2 - fs-extra: - specifier: ^11.2.0 - version: 11.2.0 - memfs: - specifier: ^4.12.0 - version: 4.12.0 - picocolors: - specifier: 1.1.0 - version: 1.1.0 - prebundle: - specifier: 1.2.2 - version: 1.2.2(typescript@5.6.2) - rslib: - specifier: npm:@rslib/core@0.0.7 - version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' - rslog: - specifier: ^1.2.3 - version: 1.2.3 - tsconfck: - specifier: 3.1.3 - version: 3.1.3(typescript@5.6.2) - typescript: - specifier: ^5.6.2 - version: 5.6.2 - - packages/create-rslib: - dependencies: - create-rstack: - specifier: 1.0.3 - version: 1.0.3 - devDependencies: - '@rslib/tsconfig': - specifier: workspace:* - version: link:../../scripts/tsconfig - '@types/fs-extra': - specifier: ^11.0.4 - version: 11.0.4 - '@types/node': - specifier: ~18.19.39 - version: 18.19.39 - fs-extra: - specifier: ^11.2.0 - version: 11.2.0 - rslib: - specifier: npm:@rslib/core@0.0.7 - version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' - typescript: - specifier: ^5.6.2 - version: 5.6.2 - - packages/plugin-dts: - dependencies: - fast-glob: - specifier: ^3.3.2 - version: 3.3.2 - magic-string: - specifier: ^0.30.11 - version: 0.30.11 - picocolors: - specifier: 1.1.0 - version: 1.1.0 - devDependencies: - '@microsoft/api-extractor': - specifier: ^7.47.9 - version: 7.47.9(@types/node@18.19.39) - '@rsbuild/core': - specifier: 1.0.7 - version: 1.0.7 - '@rslib/tsconfig': - specifier: workspace:* - version: link:../../scripts/tsconfig - rslib: - specifier: npm:@rslib/core@0.0.7 - version: '@rslib/core@0.0.7(@microsoft/api-extractor@7.47.9(@types/node@18.19.39))(typescript@5.6.2)' - typescript: - specifier: ^5.6.2 - version: 5.6.2 - - scripts/tsconfig: {} + tests/scripts: {} website: devDependencies: @@ -1475,8 +1475,8 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - '@types/lodash@4.17.7': - resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==} + '@types/lodash@4.17.9': + resolution: {integrity: sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==} '@types/mdast@3.0.15': resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} @@ -1685,8 +1685,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} ansi-styles@3.2.1: @@ -2181,8 +2181,8 @@ packages: electron-to-chromium@1.5.15: resolution: {integrity: sha512-Z4rIDoImwEJW+YYKnPul4DzqsWVqYetYVN3XqDmRpgV0mjz0hYTaeeh+8/9CL1bk3AHYmF4freW/NTiVoXA2gA==} - emoji-regex@10.3.0: - resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2782,8 +2782,8 @@ packages: resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} engines: {node: '>=12'} - is-unicode-supported@2.0.0: - resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} engines: {node: '>=18'} is-windows@1.0.2: @@ -5581,7 +5581,7 @@ snapshots: dependencies: '@types/node': 18.19.39 - '@types/lodash@4.17.7': {} + '@types/lodash@4.17.9': {} '@types/mdast@3.0.15': dependencies: @@ -5825,7 +5825,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.0.1: {} + ansi-regex@6.1.0: {} ansi-styles@3.2.1: dependencies: @@ -6292,7 +6292,7 @@ snapshots: electron-to-chromium@1.5.15: {} - emoji-regex@10.3.0: {} + emoji-regex@10.4.0: {} emoji-regex@8.0.0: {} @@ -6976,7 +6976,7 @@ snapshots: is-unicode-supported@1.3.0: {} - is-unicode-supported@2.0.0: {} + is-unicode-supported@2.1.0: {} is-windows@1.0.2: {} @@ -7727,7 +7727,7 @@ snapshots: cli-cursor: 5.0.0 cli-spinners: 2.9.2 is-interactive: 2.0.0 - is-unicode-supported: 2.0.0 + is-unicode-supported: 2.1.0 log-symbols: 6.0.0 stdin-discarder: 0.2.2 string-width: 7.2.0 @@ -8471,7 +8471,7 @@ snapshots: string-width@7.2.0: dependencies: - emoji-regex: 10.3.0 + emoji-regex: 10.4.0 get-east-asian-width: 1.2.0 strip-ansi: 7.1.0 @@ -8490,7 +8490,7 @@ snapshots: strip-ansi@7.1.0: dependencies: - ansi-regex: 6.0.1 + ansi-regex: 6.1.0 strip-bom-string@1.0.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e5aae1533..a5093d85e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,7 +2,7 @@ packages: - 'website' - 'packages/*' - 'scripts/*' - - 'e2e/**' + - 'tests/**' - 'examples/**' - '!**/compiled/**' - '!**/dist-types/**' diff --git a/e2e/README.md b/tests/README.md similarity index 100% rename from e2e/README.md rename to tests/README.md diff --git a/e2e/assets/image.png b/tests/assets/image.png similarity index 100% rename from e2e/assets/image.png rename to tests/assets/image.png diff --git a/e2e/assets/logo.svg b/tests/assets/logo.svg similarity index 100% rename from e2e/assets/logo.svg rename to tests/assets/logo.svg diff --git a/e2e/cases/examples-e2e/react-component/index.pw.test.ts b/tests/e2e/react-component/index.pw.test.ts similarity index 93% rename from e2e/cases/examples-e2e/react-component/index.pw.test.ts rename to tests/e2e/react-component/index.pw.test.ts index ab4062bfd..fc01e1eb3 100644 --- a/e2e/cases/examples-e2e/react-component/index.pw.test.ts +++ b/tests/e2e/react-component/index.pw.test.ts @@ -1,5 +1,5 @@ -import { dev } from '@e2e/helper/rsbuild'; import { expect, test } from '@playwright/test'; +import { dev } from 'test-helper/rsbuild'; test('should render example "react-component" successfully', async ({ page, diff --git a/e2e/cases/examples-e2e/react-component/package.json b/tests/e2e/react-component/package.json similarity index 100% rename from e2e/cases/examples-e2e/react-component/package.json rename to tests/e2e/react-component/package.json diff --git a/e2e/cases/examples-e2e/react-component/rsbuild.config.ts b/tests/e2e/react-component/rsbuild.config.ts similarity index 100% rename from e2e/cases/examples-e2e/react-component/rsbuild.config.ts rename to tests/e2e/react-component/rsbuild.config.ts diff --git a/e2e/cases/examples-e2e/react-component/src/App.tsx b/tests/e2e/react-component/src/App.tsx similarity index 100% rename from e2e/cases/examples-e2e/react-component/src/App.tsx rename to tests/e2e/react-component/src/App.tsx diff --git a/e2e/cases/examples-e2e/react-component/src/index.tsx b/tests/e2e/react-component/src/index.tsx similarity index 100% rename from e2e/cases/examples-e2e/react-component/src/index.tsx rename to tests/e2e/react-component/src/index.tsx diff --git a/e2e/cases/examples-e2e/react-component/tsconfig.json b/tests/e2e/react-component/tsconfig.json similarity index 100% rename from e2e/cases/examples-e2e/react-component/tsconfig.json rename to tests/e2e/react-component/tsconfig.json diff --git a/e2e/cases/alias/__snapshots__/index.test.ts.snap b/tests/features/alias/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/alias/__snapshots__/index.test.ts.snap rename to tests/features/alias/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/alias/index.test.ts b/tests/features/alias/index.test.ts similarity index 88% rename from e2e/cases/alias/index.test.ts rename to tests/features/alias/index.test.ts index 990037263..fecdc4e37 100644 --- a/e2e/cases/alias/index.test.ts +++ b/tests/features/alias/index.test.ts @@ -1,4 +1,4 @@ -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('source.alias', async () => { diff --git a/e2e/cases/alias/package.json b/tests/features/alias/package.json similarity index 100% rename from e2e/cases/alias/package.json rename to tests/features/alias/package.json diff --git a/e2e/cases/alias/rslib.config.ts b/tests/features/alias/rslib.config.ts similarity index 95% rename from e2e/cases/alias/rslib.config.ts rename to tests/features/alias/rslib.config.ts index bfba13462..726c76eda 100644 --- a/e2e/cases/alias/rslib.config.ts +++ b/tests/features/alias/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/alias/src/a.ts b/tests/features/alias/src/a.ts similarity index 100% rename from e2e/cases/alias/src/a.ts rename to tests/features/alias/src/a.ts diff --git a/e2e/cases/alias/src/index.ts b/tests/features/alias/src/index.ts similarity index 100% rename from e2e/cases/alias/src/index.ts rename to tests/features/alias/src/index.ts diff --git a/e2e/cases/alias/tsconfig.json b/tests/features/alias/tsconfig.json similarity index 100% rename from e2e/cases/alias/tsconfig.json rename to tests/features/alias/tsconfig.json diff --git a/e2e/cases/asset/__snapshots__/index.test.ts.snap b/tests/features/asset/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/asset/__snapshots__/index.test.ts.snap rename to tests/features/asset/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/asset/index.test.ts b/tests/features/asset/index.test.ts similarity index 98% rename from e2e/cases/asset/index.test.ts rename to tests/features/asset/index.test.ts index 794c7178c..65cd85ea1 100644 --- a/e2e/cases/asset/index.test.ts +++ b/tests/features/asset/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('set the size threshold to inline static assets', async () => { diff --git a/e2e/cases/asset/limit/package.json b/tests/features/asset/limit/package.json similarity index 100% rename from e2e/cases/asset/limit/package.json rename to tests/features/asset/limit/package.json diff --git a/e2e/cases/asset/limit/rslib.config.ts b/tests/features/asset/limit/rslib.config.ts similarity index 93% rename from e2e/cases/asset/limit/rslib.config.ts rename to tests/features/asset/limit/rslib.config.ts index d1286bb0c..9c9e5b896 100644 --- a/e2e/cases/asset/limit/rslib.config.ts +++ b/tests/features/asset/limit/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/asset/limit/src/index.js b/tests/features/asset/limit/src/index.js similarity index 100% rename from e2e/cases/asset/limit/src/index.js rename to tests/features/asset/limit/src/index.js diff --git a/e2e/cases/asset/name/package.json b/tests/features/asset/name/package.json similarity index 100% rename from e2e/cases/asset/name/package.json rename to tests/features/asset/name/package.json diff --git a/e2e/cases/asset/name/rslib.config.ts b/tests/features/asset/name/rslib.config.ts similarity index 92% rename from e2e/cases/asset/name/rslib.config.ts rename to tests/features/asset/name/rslib.config.ts index c5d37a820..41a62905e 100644 --- a/e2e/cases/asset/name/rslib.config.ts +++ b/tests/features/asset/name/rslib.config.ts @@ -1,6 +1,6 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { pluginReact } from '@rsbuild/plugin-react'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/asset/name/src/index.jsx b/tests/features/asset/name/src/index.jsx similarity index 100% rename from e2e/cases/asset/name/src/index.jsx rename to tests/features/asset/name/src/index.jsx diff --git a/e2e/cases/asset/path/package.json b/tests/features/asset/path/package.json similarity index 100% rename from e2e/cases/asset/path/package.json rename to tests/features/asset/path/package.json diff --git a/e2e/cases/asset/path/rslib.config.ts b/tests/features/asset/path/rslib.config.ts similarity index 90% rename from e2e/cases/asset/path/rslib.config.ts rename to tests/features/asset/path/rslib.config.ts index 09227beae..aca26ef5a 100644 --- a/e2e/cases/asset/path/rslib.config.ts +++ b/tests/features/asset/path/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/asset/path/src/index.js b/tests/features/asset/path/src/index.js similarity index 100% rename from e2e/cases/asset/path/src/index.js rename to tests/features/asset/path/src/index.js diff --git a/e2e/cases/asset/public-path/package.json b/tests/features/asset/public-path/package.json similarity index 100% rename from e2e/cases/asset/public-path/package.json rename to tests/features/asset/public-path/package.json diff --git a/e2e/cases/asset/public-path/rslib.config.ts b/tests/features/asset/public-path/rslib.config.ts similarity index 92% rename from e2e/cases/asset/public-path/rslib.config.ts rename to tests/features/asset/public-path/rslib.config.ts index ee5ce7394..7314ce292 100644 --- a/e2e/cases/asset/public-path/rslib.config.ts +++ b/tests/features/asset/public-path/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/asset/public-path/src/index.js b/tests/features/asset/public-path/src/index.js similarity index 100% rename from e2e/cases/asset/public-path/src/index.js rename to tests/features/asset/public-path/src/index.js diff --git a/e2e/cases/asset/svgr/package.json b/tests/features/asset/svgr/package.json similarity index 100% rename from e2e/cases/asset/svgr/package.json rename to tests/features/asset/svgr/package.json diff --git a/e2e/cases/asset/svgr/rslib.config.ts b/tests/features/asset/svgr/rslib.config.ts similarity index 96% rename from e2e/cases/asset/svgr/rslib.config.ts rename to tests/features/asset/svgr/rslib.config.ts index 63f7446f3..675713e04 100644 --- a/e2e/cases/asset/svgr/rslib.config.ts +++ b/tests/features/asset/svgr/rslib.config.ts @@ -1,7 +1,7 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { pluginReact } from '@rsbuild/plugin-react'; import { pluginSvgr } from '@rsbuild/plugin-svgr'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/asset/svgr/src/index.js b/tests/features/asset/svgr/src/index.js similarity index 100% rename from e2e/cases/asset/svgr/src/index.js rename to tests/features/asset/svgr/src/index.js diff --git a/e2e/cases/asset/svgr/src/namedExport.js b/tests/features/asset/svgr/src/namedExport.js similarity index 100% rename from e2e/cases/asset/svgr/src/namedExport.js rename to tests/features/asset/svgr/src/namedExport.js diff --git a/e2e/cases/auto-extension/__fixtures__/src/common.ts b/tests/features/auto-extension/__fixtures__/src/common.ts similarity index 100% rename from e2e/cases/auto-extension/__fixtures__/src/common.ts rename to tests/features/auto-extension/__fixtures__/src/common.ts diff --git a/e2e/cases/auto-extension/__fixtures__/src/index.ts b/tests/features/auto-extension/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/auto-extension/__fixtures__/src/index.ts rename to tests/features/auto-extension/__fixtures__/src/index.ts diff --git a/e2e/cases/auto-extension/index.test.ts b/tests/features/auto-extension/index.test.ts similarity index 89% rename from e2e/cases/auto-extension/index.test.ts rename to tests/features/auto-extension/index.test.ts index 5b0434909..c4c57d6d0 100644 --- a/e2e/cases/auto-extension/index.test.ts +++ b/tests/features/auto-extension/index.test.ts @@ -1,5 +1,5 @@ import { extname, join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { describe, expect, test } from 'vitest'; describe('autoExtension: true', () => { @@ -40,7 +40,7 @@ describe('should respect output.filename.js to override builtin logic', () => { const { entryFiles } = await buildAndGetResults(fixturePath); expect(extname(entryFiles.esm!)).toEqual('.mjs'); expect(entryFiles.cjs).toMatchInlineSnapshot( - `"/e2e/cases/auto-extension/type-commonjs/config-override/dist/cjs/index.d08e1bb3.js"`, + `"/tests/features/auto-extension/type-commonjs/config-override/dist/cjs/index.d08e1bb3.js"`, ); }); @@ -48,7 +48,7 @@ describe('should respect output.filename.js to override builtin logic', () => { const fixturePath = join(__dirname, 'type-module', 'config-override'); const { entryFiles } = await buildAndGetResults(fixturePath); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/auto-extension/type-module/config-override/dist/esm/index.d2068839.js"`, + `"/tests/features/auto-extension/type-module/config-override/dist/esm/index.d2068839.js"`, ); expect(extname(entryFiles.cjs!)).toEqual('.cjs'); }); diff --git a/e2e/cases/auto-extension/type-commonjs/config-override/package.json b/tests/features/auto-extension/type-commonjs/config-override/package.json similarity index 100% rename from e2e/cases/auto-extension/type-commonjs/config-override/package.json rename to tests/features/auto-extension/type-commonjs/config-override/package.json diff --git a/e2e/cases/auto-extension/type-commonjs/config-override/rslib.config.ts b/tests/features/auto-extension/type-commonjs/config-override/rslib.config.ts similarity index 97% rename from e2e/cases/auto-extension/type-commonjs/config-override/rslib.config.ts rename to tests/features/auto-extension/type-commonjs/config-override/rslib.config.ts index b994a43a4..d178eaa4f 100644 --- a/e2e/cases/auto-extension/type-commonjs/config-override/rslib.config.ts +++ b/tests/features/auto-extension/type-commonjs/config-override/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-extension/type-commonjs/default/package.json b/tests/features/auto-extension/type-commonjs/default/package.json similarity index 100% rename from e2e/cases/auto-extension/type-commonjs/default/package.json rename to tests/features/auto-extension/type-commonjs/default/package.json diff --git a/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts b/tests/features/auto-extension/type-commonjs/default/rslib.config.ts similarity index 94% rename from e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts rename to tests/features/auto-extension/type-commonjs/default/rslib.config.ts index 3ad8750f6..6c8336d38 100644 --- a/e2e/cases/auto-extension/type-commonjs/default/rslib.config.ts +++ b/tests/features/auto-extension/type-commonjs/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/auto-extension/type-commonjs/false/package.json b/tests/features/auto-extension/type-commonjs/false/package.json similarity index 100% rename from e2e/cases/auto-extension/type-commonjs/false/package.json rename to tests/features/auto-extension/type-commonjs/false/package.json diff --git a/e2e/cases/auto-extension/type-module/false/rslib.config.ts b/tests/features/auto-extension/type-commonjs/false/rslib.config.ts similarity index 95% rename from e2e/cases/auto-extension/type-module/false/rslib.config.ts rename to tests/features/auto-extension/type-commonjs/false/rslib.config.ts index d3935a6be..3aeb7ff54 100644 --- a/e2e/cases/auto-extension/type-module/false/rslib.config.ts +++ b/tests/features/auto-extension/type-commonjs/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-extension/type-module/config-override/package.json b/tests/features/auto-extension/type-module/config-override/package.json similarity index 100% rename from e2e/cases/auto-extension/type-module/config-override/package.json rename to tests/features/auto-extension/type-module/config-override/package.json diff --git a/e2e/cases/auto-extension/type-module/config-override/rslib.config.ts b/tests/features/auto-extension/type-module/config-override/rslib.config.ts similarity index 97% rename from e2e/cases/auto-extension/type-module/config-override/rslib.config.ts rename to tests/features/auto-extension/type-module/config-override/rslib.config.ts index 6a41a8f7c..25274b1b2 100644 --- a/e2e/cases/auto-extension/type-module/config-override/rslib.config.ts +++ b/tests/features/auto-extension/type-module/config-override/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-extension/type-module/default/package.json b/tests/features/auto-extension/type-module/default/package.json similarity index 100% rename from e2e/cases/auto-extension/type-module/default/package.json rename to tests/features/auto-extension/type-module/default/package.json diff --git a/e2e/cases/auto-extension/type-module/default/rslib.config.ts b/tests/features/auto-extension/type-module/default/rslib.config.ts similarity index 94% rename from e2e/cases/auto-extension/type-module/default/rslib.config.ts rename to tests/features/auto-extension/type-module/default/rslib.config.ts index 3ad8750f6..6c8336d38 100644 --- a/e2e/cases/auto-extension/type-module/default/rslib.config.ts +++ b/tests/features/auto-extension/type-module/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/auto-extension/type-module/false/package.json b/tests/features/auto-extension/type-module/false/package.json similarity index 100% rename from e2e/cases/auto-extension/type-module/false/package.json rename to tests/features/auto-extension/type-module/false/package.json diff --git a/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts b/tests/features/auto-extension/type-module/false/rslib.config.ts similarity index 95% rename from e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts rename to tests/features/auto-extension/type-module/false/rslib.config.ts index d3935a6be..3aeb7ff54 100644 --- a/e2e/cases/auto-extension/type-commonjs/false/rslib.config.ts +++ b/tests/features/auto-extension/type-module/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-external/__fixtures__/src/index.ts b/tests/features/auto-external/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/auto-external/__fixtures__/src/index.ts rename to tests/features/auto-external/__fixtures__/src/index.ts diff --git a/e2e/cases/auto-external/default/package.json b/tests/features/auto-external/default/package.json similarity index 100% rename from e2e/cases/auto-external/default/package.json rename to tests/features/auto-external/default/package.json diff --git a/e2e/cases/auto-external/default/rslib.config.ts b/tests/features/auto-external/default/rslib.config.ts similarity index 96% rename from e2e/cases/auto-external/default/rslib.config.ts rename to tests/features/auto-external/default/rslib.config.ts index 5b5665874..8f8dbf42b 100644 --- a/e2e/cases/auto-external/default/rslib.config.ts +++ b/tests/features/auto-external/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-external/default/src/index.ts b/tests/features/auto-external/default/src/index.ts similarity index 100% rename from e2e/cases/auto-external/default/src/index.ts rename to tests/features/auto-external/default/src/index.ts diff --git a/e2e/cases/auto-external/default/tsconfig.json b/tests/features/auto-external/default/tsconfig.json similarity index 100% rename from e2e/cases/auto-external/default/tsconfig.json rename to tests/features/auto-external/default/tsconfig.json diff --git a/e2e/cases/auto-external/external-sub-path/package.json b/tests/features/auto-external/external-sub-path/package.json similarity index 100% rename from e2e/cases/auto-external/external-sub-path/package.json rename to tests/features/auto-external/external-sub-path/package.json diff --git a/e2e/cases/entry/single/rslib.config.ts b/tests/features/auto-external/external-sub-path/rslib.config.ts similarity index 94% rename from e2e/cases/entry/single/rslib.config.ts rename to tests/features/auto-external/external-sub-path/rslib.config.ts index 3cac7018f..a1f544775 100644 --- a/e2e/cases/entry/single/rslib.config.ts +++ b/tests/features/auto-external/external-sub-path/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/auto-external/external-sub-path/src/index.ts b/tests/features/auto-external/external-sub-path/src/index.ts similarity index 100% rename from e2e/cases/auto-external/external-sub-path/src/index.ts rename to tests/features/auto-external/external-sub-path/src/index.ts diff --git a/e2e/cases/auto-external/false/package.json b/tests/features/auto-external/false/package.json similarity index 100% rename from e2e/cases/auto-external/false/package.json rename to tests/features/auto-external/false/package.json diff --git a/e2e/cases/auto-external/false/rslib.config.ts b/tests/features/auto-external/false/rslib.config.ts similarity index 96% rename from e2e/cases/auto-external/false/rslib.config.ts rename to tests/features/auto-external/false/rslib.config.ts index b007f0a69..4360d713a 100644 --- a/e2e/cases/auto-external/false/rslib.config.ts +++ b/tests/features/auto-external/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/auto-external/false/src/index.ts b/tests/features/auto-external/false/src/index.ts similarity index 100% rename from e2e/cases/auto-external/false/src/index.ts rename to tests/features/auto-external/false/src/index.ts diff --git a/e2e/cases/auto-external/false/tsconfig.json b/tests/features/auto-external/false/tsconfig.json similarity index 100% rename from e2e/cases/auto-external/false/tsconfig.json rename to tests/features/auto-external/false/tsconfig.json diff --git a/e2e/cases/auto-external/index.test.ts b/tests/features/auto-external/index.test.ts similarity index 97% rename from e2e/cases/auto-external/index.test.ts rename to tests/features/auto-external/index.test.ts index 529286bcb..c581e89cb 100644 --- a/e2e/cases/auto-external/index.test.ts +++ b/tests/features/auto-external/index.test.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { buildAndGetResults, proxyConsole } from '@e2e/helper'; import stripAnsi from 'strip-ansi'; +import { buildAndGetResults, proxyConsole } from 'test-helper'; import { expect, test } from 'vitest'; import { composeModuleImportWarn } from '../../../packages/core/src/config'; diff --git a/e2e/cases/auto-external/module-import-warn/package.json b/tests/features/auto-external/module-import-warn/package.json similarity index 100% rename from e2e/cases/auto-external/module-import-warn/package.json rename to tests/features/auto-external/module-import-warn/package.json diff --git a/e2e/cases/auto-external/module-import-warn/rslib.config.ts b/tests/features/auto-external/module-import-warn/rslib.config.ts similarity index 76% rename from e2e/cases/auto-external/module-import-warn/rslib.config.ts rename to tests/features/auto-external/module-import-warn/rslib.config.ts index 2cf69ebad..a79eb97f0 100644 --- a/e2e/cases/auto-external/module-import-warn/rslib.config.ts +++ b/tests/features/auto-external/module-import-warn/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/auto-external/module-import-warn/src/index.ts b/tests/features/auto-external/module-import-warn/src/index.ts similarity index 100% rename from e2e/cases/auto-external/module-import-warn/src/index.ts rename to tests/features/auto-external/module-import-warn/src/index.ts diff --git a/e2e/cases/auto-external/with-externals/package.json b/tests/features/auto-external/with-externals/package.json similarity index 100% rename from e2e/cases/auto-external/with-externals/package.json rename to tests/features/auto-external/with-externals/package.json diff --git a/e2e/cases/auto-external/with-externals/rslib.config.ts b/tests/features/auto-external/with-externals/rslib.config.ts similarity index 95% rename from e2e/cases/auto-external/with-externals/rslib.config.ts rename to tests/features/auto-external/with-externals/rslib.config.ts index 1c108e5ad..4c393e5d3 100644 --- a/e2e/cases/auto-external/with-externals/rslib.config.ts +++ b/tests/features/auto-external/with-externals/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/banner-footer/index.test.ts b/tests/features/banner-footer/index.test.ts similarity index 97% rename from e2e/cases/banner-footer/index.test.ts rename to tests/features/banner-footer/index.test.ts index 09db6e1f8..52abef4f1 100644 --- a/e2e/cases/banner-footer/index.test.ts +++ b/tests/features/banner-footer/index.test.ts @@ -1,4 +1,4 @@ -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; enum BannerFooter { diff --git a/e2e/cases/banner-footer/package.json b/tests/features/banner-footer/package.json similarity index 100% rename from e2e/cases/banner-footer/package.json rename to tests/features/banner-footer/package.json diff --git a/e2e/cases/banner-footer/rslib.config.ts b/tests/features/banner-footer/rslib.config.ts similarity index 99% rename from e2e/cases/banner-footer/rslib.config.ts rename to tests/features/banner-footer/rslib.config.ts index 8043e89a1..e170e9b45 100644 --- a/e2e/cases/banner-footer/rslib.config.ts +++ b/tests/features/banner-footer/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { type LibConfig, defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; const bannerFooterConfig: LibConfig = { banner: { diff --git a/e2e/cases/banner-footer/src/foo.ts b/tests/features/banner-footer/src/foo.ts similarity index 100% rename from e2e/cases/banner-footer/src/foo.ts rename to tests/features/banner-footer/src/foo.ts diff --git a/e2e/cases/banner-footer/src/index.css b/tests/features/banner-footer/src/index.css similarity index 100% rename from e2e/cases/banner-footer/src/index.css rename to tests/features/banner-footer/src/index.css diff --git a/e2e/cases/banner-footer/src/index.ts b/tests/features/banner-footer/src/index.ts similarity index 100% rename from e2e/cases/banner-footer/src/index.ts rename to tests/features/banner-footer/src/index.ts diff --git a/e2e/cases/banner-footer/tsconfig.json b/tests/features/banner-footer/tsconfig.json similarity index 100% rename from e2e/cases/banner-footer/tsconfig.json rename to tests/features/banner-footer/tsconfig.json diff --git a/e2e/cases/bundle-false/__snapshots__/index.test.ts.snap b/tests/features/bundle-false/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/bundle-false/__snapshots__/index.test.ts.snap rename to tests/features/bundle-false/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/bundle-false/asset/package.json b/tests/features/bundle-false/asset/package.json similarity index 100% rename from e2e/cases/bundle-false/asset/package.json rename to tests/features/bundle-false/asset/package.json diff --git a/e2e/cases/bundle-false/asset/rslib.config.ts b/tests/features/bundle-false/asset/rslib.config.ts similarity index 96% rename from e2e/cases/bundle-false/asset/rslib.config.ts rename to tests/features/bundle-false/asset/rslib.config.ts index ba796ab38..68e3b9d61 100644 --- a/e2e/cases/bundle-false/asset/rslib.config.ts +++ b/tests/features/bundle-false/asset/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/bundle-false/asset/src/index.js b/tests/features/bundle-false/asset/src/index.js similarity index 100% rename from e2e/cases/bundle-false/asset/src/index.js rename to tests/features/bundle-false/asset/src/index.js diff --git a/e2e/cases/bundle-false/basic/package.json b/tests/features/bundle-false/basic/package.json similarity index 100% rename from e2e/cases/bundle-false/basic/package.json rename to tests/features/bundle-false/basic/package.json diff --git a/e2e/cases/bundle-false/js-extension/rslib.config.ts b/tests/features/bundle-false/basic/rslib.config.ts similarity index 95% rename from e2e/cases/bundle-false/js-extension/rslib.config.ts rename to tests/features/bundle-false/basic/rslib.config.ts index 3d6088d81..6a10170f6 100644 --- a/e2e/cases/bundle-false/js-extension/rslib.config.ts +++ b/tests/features/bundle-false/basic/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/bundle-false/basic/src/index.ts b/tests/features/bundle-false/basic/src/index.ts similarity index 100% rename from e2e/cases/bundle-false/basic/src/index.ts rename to tests/features/bundle-false/basic/src/index.ts diff --git a/e2e/cases/bundle-false/basic/src/sum.ts b/tests/features/bundle-false/basic/src/sum.ts similarity index 100% rename from e2e/cases/bundle-false/basic/src/sum.ts rename to tests/features/bundle-false/basic/src/sum.ts diff --git a/e2e/cases/bundle-false/basic/src/utils/numbers.ts b/tests/features/bundle-false/basic/src/utils/numbers.ts similarity index 100% rename from e2e/cases/bundle-false/basic/src/utils/numbers.ts rename to tests/features/bundle-false/basic/src/utils/numbers.ts diff --git a/e2e/cases/bundle-false/basic/src/utils/strings.ts b/tests/features/bundle-false/basic/src/utils/strings.ts similarity index 100% rename from e2e/cases/bundle-false/basic/src/utils/strings.ts rename to tests/features/bundle-false/basic/src/utils/strings.ts diff --git a/e2e/cases/bundle-false/basic/tsconfig.json b/tests/features/bundle-false/basic/tsconfig.json similarity index 100% rename from e2e/cases/bundle-false/basic/tsconfig.json rename to tests/features/bundle-false/basic/tsconfig.json diff --git a/e2e/cases/bundle-false/index.test.ts b/tests/features/bundle-false/index.test.ts similarity index 75% rename from e2e/cases/bundle-false/index.test.ts rename to tests/features/bundle-false/index.test.ts index f928654cf..2b1d15af3 100644 --- a/e2e/cases/bundle-false/index.test.ts +++ b/tests/features/bundle-false/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('basic', async () => { @@ -8,18 +8,18 @@ test('basic', async () => { expect(files.esm).toMatchInlineSnapshot(` [ - "/e2e/cases/bundle-false/basic/dist/esm/index.js", - "/e2e/cases/bundle-false/basic/dist/esm/sum.js", - "/e2e/cases/bundle-false/basic/dist/esm/utils/numbers.js", - "/e2e/cases/bundle-false/basic/dist/esm/utils/strings.js", + "/tests/features/bundle-false/basic/dist/esm/index.js", + "/tests/features/bundle-false/basic/dist/esm/sum.js", + "/tests/features/bundle-false/basic/dist/esm/utils/numbers.js", + "/tests/features/bundle-false/basic/dist/esm/utils/strings.js", ] `); expect(files.cjs).toMatchInlineSnapshot(` [ - "/e2e/cases/bundle-false/basic/dist/cjs/index.cjs", - "/e2e/cases/bundle-false/basic/dist/cjs/sum.cjs", - "/e2e/cases/bundle-false/basic/dist/cjs/utils/numbers.cjs", - "/e2e/cases/bundle-false/basic/dist/cjs/utils/strings.cjs", + "/tests/features/bundle-false/basic/dist/cjs/index.cjs", + "/tests/features/bundle-false/basic/dist/cjs/sum.cjs", + "/tests/features/bundle-false/basic/dist/cjs/utils/numbers.cjs", + "/tests/features/bundle-false/basic/dist/cjs/utils/strings.cjs", ] `); }); @@ -30,12 +30,12 @@ test('single file', async () => { expect(files.esm).toMatchInlineSnapshot(` [ - "/e2e/cases/bundle-false/single-file/dist/esm/index.js", + "/tests/features/bundle-false/single-file/dist/esm/index.js", ] `); expect(files.cjs).toMatchInlineSnapshot(` [ - "/e2e/cases/bundle-false/single-file/dist/cjs/index.cjs", + "/tests/features/bundle-false/single-file/dist/cjs/index.cjs", ] `); }); diff --git a/e2e/cases/bundle-false/js-extension/package.json b/tests/features/bundle-false/js-extension/package.json similarity index 100% rename from e2e/cases/bundle-false/js-extension/package.json rename to tests/features/bundle-false/js-extension/package.json diff --git a/e2e/cases/bundle-false/basic/rslib.config.ts b/tests/features/bundle-false/js-extension/rslib.config.ts similarity index 95% rename from e2e/cases/bundle-false/basic/rslib.config.ts rename to tests/features/bundle-false/js-extension/rslib.config.ts index 3d6088d81..6a10170f6 100644 --- a/e2e/cases/bundle-false/basic/rslib.config.ts +++ b/tests/features/bundle-false/js-extension/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/bundle-false/js-extension/src/bar.ts b/tests/features/bundle-false/js-extension/src/bar.ts similarity index 100% rename from e2e/cases/bundle-false/js-extension/src/bar.ts rename to tests/features/bundle-false/js-extension/src/bar.ts diff --git a/e2e/cases/bundle-false/js-extension/src/baz.js.ts b/tests/features/bundle-false/js-extension/src/baz.js.ts similarity index 100% rename from e2e/cases/bundle-false/js-extension/src/baz.js.ts rename to tests/features/bundle-false/js-extension/src/baz.js.ts diff --git a/e2e/cases/bundle-false/js-extension/src/foo.js b/tests/features/bundle-false/js-extension/src/foo.js similarity index 100% rename from e2e/cases/bundle-false/js-extension/src/foo.js rename to tests/features/bundle-false/js-extension/src/foo.js diff --git a/e2e/cases/bundle-false/js-extension/src/index.js b/tests/features/bundle-false/js-extension/src/index.js similarity index 100% rename from e2e/cases/bundle-false/js-extension/src/index.js rename to tests/features/bundle-false/js-extension/src/index.js diff --git a/e2e/cases/bundle-false/js-extension/src/qux.cjs b/tests/features/bundle-false/js-extension/src/qux.cjs similarity index 100% rename from e2e/cases/bundle-false/js-extension/src/qux.cjs rename to tests/features/bundle-false/js-extension/src/qux.cjs diff --git a/e2e/cases/bundle-false/js-extension/tsconfig.json b/tests/features/bundle-false/js-extension/tsconfig.json similarity index 100% rename from e2e/cases/bundle-false/js-extension/tsconfig.json rename to tests/features/bundle-false/js-extension/tsconfig.json diff --git a/e2e/cases/bundle-false/single-file/package.json b/tests/features/bundle-false/single-file/package.json similarity index 100% rename from e2e/cases/bundle-false/single-file/package.json rename to tests/features/bundle-false/single-file/package.json diff --git a/e2e/cases/bundle-false/single-file/rslib.config.ts b/tests/features/bundle-false/single-file/rslib.config.ts similarity index 95% rename from e2e/cases/bundle-false/single-file/rslib.config.ts rename to tests/features/bundle-false/single-file/rslib.config.ts index 3d6088d81..6a10170f6 100644 --- a/e2e/cases/bundle-false/single-file/rslib.config.ts +++ b/tests/features/bundle-false/single-file/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/bundle-false/single-file/src/index.ts b/tests/features/bundle-false/single-file/src/index.ts similarity index 100% rename from e2e/cases/bundle-false/single-file/src/index.ts rename to tests/features/bundle-false/single-file/src/index.ts diff --git a/e2e/cases/bundle-false/single-file/tsconfig.json b/tests/features/bundle-false/single-file/tsconfig.json similarity index 100% rename from e2e/cases/bundle-false/single-file/tsconfig.json rename to tests/features/bundle-false/single-file/tsconfig.json diff --git a/e2e/cases/bundle-false/svgr/package.json b/tests/features/bundle-false/svgr/package.json similarity index 100% rename from e2e/cases/bundle-false/svgr/package.json rename to tests/features/bundle-false/svgr/package.json diff --git a/e2e/cases/bundle-false/svgr/rslib.config.ts b/tests/features/bundle-false/svgr/rslib.config.ts similarity index 96% rename from e2e/cases/bundle-false/svgr/rslib.config.ts rename to tests/features/bundle-false/svgr/rslib.config.ts index 1c6ab42f0..20dbe11a8 100644 --- a/e2e/cases/bundle-false/svgr/rslib.config.ts +++ b/tests/features/bundle-false/svgr/rslib.config.ts @@ -1,7 +1,7 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { pluginReact } from '@rsbuild/plugin-react'; import { pluginSvgr } from '@rsbuild/plugin-svgr'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/bundle-false/svgr/src/index.jsx b/tests/features/bundle-false/svgr/src/index.jsx similarity index 100% rename from e2e/cases/bundle-false/svgr/src/index.jsx rename to tests/features/bundle-false/svgr/src/index.jsx diff --git a/e2e/cases/cli/index.test.ts b/tests/features/cli/index.test.ts similarity index 94% rename from e2e/cases/cli/index.test.ts rename to tests/features/cli/index.test.ts index dd1d70557..deb3f346c 100644 --- a/e2e/cases/cli/index.test.ts +++ b/tests/features/cli/index.test.ts @@ -1,7 +1,7 @@ import { execSync } from 'node:child_process'; import path from 'node:path'; -import { globContentJSON } from '@e2e/helper'; import fse from 'fs-extra'; +import { globContentJSON } from 'test-helper'; import { expect, test } from 'vitest'; test.todo('build command', async () => {}); diff --git a/e2e/cases/cli/package.json b/tests/features/cli/package.json similarity index 100% rename from e2e/cases/cli/package.json rename to tests/features/cli/package.json diff --git a/e2e/cases/cli/rslib.config.ts b/tests/features/cli/rslib.config.ts similarity index 67% rename from e2e/cases/cli/rslib.config.ts rename to tests/features/cli/rslib.config.ts index 9cb50ef03..a1b1d8104 100644 --- a/e2e/cases/cli/rslib.config.ts +++ b/tests/features/cli/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/tests/features/copy/index.test.ts b/tests/features/copy/index.test.ts new file mode 100644 index 000000000..4e0cad5dd --- /dev/null +++ b/tests/features/copy/index.test.ts @@ -0,0 +1,34 @@ +import { join } from 'node:path'; +import { buildAndGetResults, generateFileTree } from 'test-helper'; +import { expect, test } from 'vitest'; + +test('copy', async () => { + const fixturePath = __dirname; + await buildAndGetResults(fixturePath); + + const fileTree = generateFileTree(join(fixturePath, './dist/esm')); + expect(fileTree).toMatchInlineSnapshot(` + { + "index.js": "/tests/features/copy/dist/esm/index.js", + "temp-1": { + "b.png": "/tests/features/copy/dist/esm/temp-1/b.png", + }, + "temp-2": { + "a.png": "/tests/features/copy/dist/esm/temp-2/a.png", + }, + "temp-3": { + "a.png": "/tests/features/copy/dist/esm/temp-3/a.png", + "b.txt": "/tests/features/copy/dist/esm/temp-3/b.txt", + }, + "temp-4": { + "_index.html": "/tests/features/copy/dist/esm/temp-4/_index.html", + }, + "temp-5": { + "index.html": "/tests/features/copy/dist/esm/temp-5/index.html", + }, + "temp-6": { + "index.html": "/tests/features/copy/dist/esm/temp-6/index.html", + }, + } + `); +}); diff --git a/e2e/cases/copy/package.json b/tests/features/copy/package.json similarity index 100% rename from e2e/cases/copy/package.json rename to tests/features/copy/package.json diff --git a/e2e/cases/copy/rslib.config.ts b/tests/features/copy/rslib.config.ts similarity index 95% rename from e2e/cases/copy/rslib.config.ts rename to tests/features/copy/rslib.config.ts index cc486385f..0348ad222 100644 --- a/e2e/cases/copy/rslib.config.ts +++ b/tests/features/copy/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/copy/src/index.html b/tests/features/copy/src/index.html similarity index 100% rename from e2e/cases/copy/src/index.html rename to tests/features/copy/src/index.html diff --git a/e2e/cases/copy/src/index.ts b/tests/features/copy/src/index.ts similarity index 100% rename from e2e/cases/copy/src/index.ts rename to tests/features/copy/src/index.ts diff --git a/e2e/cases/copy/src/test.txt b/tests/features/copy/src/test.txt similarity index 100% rename from e2e/cases/copy/src/test.txt rename to tests/features/copy/src/test.txt diff --git a/e2e/cases/copy/temp-1/a.png b/tests/features/copy/temp-1/a.png similarity index 100% rename from e2e/cases/copy/temp-1/a.png rename to tests/features/copy/temp-1/a.png diff --git a/e2e/cases/copy/temp-2/a.png b/tests/features/copy/temp-2/a.png similarity index 100% rename from e2e/cases/copy/temp-2/a.png rename to tests/features/copy/temp-2/a.png diff --git a/e2e/cases/copy/temp-3/a.png b/tests/features/copy/temp-3/a.png similarity index 100% rename from e2e/cases/copy/temp-3/a.png rename to tests/features/copy/temp-3/a.png diff --git a/e2e/cases/copy/temp-3/b.txt b/tests/features/copy/temp-3/b.txt similarity index 100% rename from e2e/cases/copy/temp-3/b.txt rename to tests/features/copy/temp-3/b.txt diff --git a/e2e/cases/copy/temp-4/index.html b/tests/features/copy/temp-4/index.html similarity index 100% rename from e2e/cases/copy/temp-4/index.html rename to tests/features/copy/temp-4/index.html diff --git a/e2e/cases/decorators/__fixtures__/src/index.ts b/tests/features/decorators/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/decorators/__fixtures__/src/index.ts rename to tests/features/decorators/__fixtures__/src/index.ts diff --git a/e2e/cases/decorators/__fixtures__/tsconfig.decorators.json b/tests/features/decorators/__fixtures__/tsconfig.decorators.json similarity index 100% rename from e2e/cases/decorators/__fixtures__/tsconfig.decorators.json rename to tests/features/decorators/__fixtures__/tsconfig.decorators.json diff --git a/e2e/cases/decorators/__fixtures__/tsconfig.json b/tests/features/decorators/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/decorators/__fixtures__/tsconfig.json rename to tests/features/decorators/__fixtures__/tsconfig.json diff --git a/e2e/cases/decorators/__snapshots__/index.test.ts.snap b/tests/features/decorators/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/decorators/__snapshots__/index.test.ts.snap rename to tests/features/decorators/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/decorators/default/package.json b/tests/features/decorators/default/package.json similarity index 100% rename from e2e/cases/decorators/default/package.json rename to tests/features/decorators/default/package.json diff --git a/e2e/cases/decorators/default/rslib.config.ts b/tests/features/decorators/default/rslib.config.ts similarity index 81% rename from e2e/cases/decorators/default/rslib.config.ts rename to tests/features/decorators/default/rslib.config.ts index ed308bd88..773d280e3 100644 --- a/e2e/cases/decorators/default/rslib.config.ts +++ b/tests/features/decorators/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/decorators/index.test.ts b/tests/features/decorators/index.test.ts similarity index 93% rename from e2e/cases/decorators/index.test.ts rename to tests/features/decorators/index.test.ts index d4c1ff64c..cc3c72e40 100644 --- a/e2e/cases/decorators/index.test.ts +++ b/tests/features/decorators/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('decorators default to 2022-03', async () => { diff --git a/e2e/cases/decorators/tsconfig/package.json b/tests/features/decorators/tsconfig/package.json similarity index 100% rename from e2e/cases/decorators/tsconfig/package.json rename to tests/features/decorators/tsconfig/package.json diff --git a/e2e/cases/decorators/tsconfig/rslib.config.ts b/tests/features/decorators/tsconfig/rslib.config.ts similarity index 91% rename from e2e/cases/decorators/tsconfig/rslib.config.ts rename to tests/features/decorators/tsconfig/rslib.config.ts index 989858be6..e4f688876 100644 --- a/e2e/cases/decorators/tsconfig/rslib.config.ts +++ b/tests/features/decorators/tsconfig/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/define/index.test.ts b/tests/features/define/index.test.ts similarity index 93% rename from e2e/cases/define/index.test.ts rename to tests/features/define/index.test.ts index df7e15096..7363f2453 100644 --- a/e2e/cases/define/index.test.ts +++ b/tests/features/define/index.test.ts @@ -1,4 +1,4 @@ -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('source.define', async () => { diff --git a/e2e/cases/define/package.json b/tests/features/define/package.json similarity index 100% rename from e2e/cases/define/package.json rename to tests/features/define/package.json diff --git a/e2e/cases/define/rslib.config.ts b/tests/features/define/rslib.config.ts similarity index 98% rename from e2e/cases/define/rslib.config.ts rename to tests/features/define/rslib.config.ts index 882370485..a56ea2072 100644 --- a/e2e/cases/define/rslib.config.ts +++ b/tests/features/define/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/define/src/env.d.ts b/tests/features/define/src/env.d.ts similarity index 100% rename from e2e/cases/define/src/env.d.ts rename to tests/features/define/src/env.d.ts diff --git a/e2e/cases/define/src/index.ts b/tests/features/define/src/index.ts similarity index 100% rename from e2e/cases/define/src/index.ts rename to tests/features/define/src/index.ts diff --git a/e2e/cases/dts/__snapshots__/index.test.ts.snap b/tests/features/dts/__snapshots__/index.test.ts.snap similarity index 62% rename from e2e/cases/dts/__snapshots__/index.test.ts.snap rename to tests/features/dts/__snapshots__/index.test.ts.snap index 353e92c91..bf2332dee 100644 --- a/e2e/cases/dts/__snapshots__/index.test.ts.snap +++ b/tests/features/dts/__snapshots__/index.test.ts.snap @@ -2,18 +2,18 @@ exports[`dts when bundle: false > basic 2`] = ` { - "/e2e/cases/dts/bundle-false/basic/dist/esm/index.d.ts": "export * from './utils/numbers'; + "/tests/features/dts/bundle-false/basic/dist/esm/index.d.ts": "export * from './utils/numbers'; export * from './utils/strings'; export * from './sum'; ", - "/e2e/cases/dts/bundle-false/basic/dist/esm/sum.d.ts": "export declare const numSum: number; + "/tests/features/dts/bundle-false/basic/dist/esm/sum.d.ts": "export declare const numSum: number; export declare const strSum: string; ", - "/e2e/cases/dts/bundle-false/basic/dist/esm/utils/numbers.d.ts": "export declare const num1 = 1; + "/tests/features/dts/bundle-false/basic/dist/esm/utils/numbers.d.ts": "export declare const num1 = 1; export declare const num2 = 2; export declare const num3 = 3; ", - "/e2e/cases/dts/bundle-false/basic/dist/esm/utils/strings.d.ts": "export declare const str1 = "str1"; + "/tests/features/dts/bundle-false/basic/dist/esm/utils/strings.d.ts": "export declare const str1 = "str1"; export declare const str2 = "str2"; export declare const str3 = "str3"; ", diff --git a/e2e/cases/dts/bundle-false/__fixtures__/src/index.ts b/tests/features/dts/bundle-false/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/dts/bundle-false/__fixtures__/src/index.ts rename to tests/features/dts/bundle-false/__fixtures__/src/index.ts diff --git a/e2e/cases/dts/bundle-false/__fixtures__/src/sum.ts b/tests/features/dts/bundle-false/__fixtures__/src/sum.ts similarity index 100% rename from e2e/cases/dts/bundle-false/__fixtures__/src/sum.ts rename to tests/features/dts/bundle-false/__fixtures__/src/sum.ts diff --git a/e2e/cases/dts/bundle-false/__fixtures__/src/utils/numbers.ts b/tests/features/dts/bundle-false/__fixtures__/src/utils/numbers.ts similarity index 100% rename from e2e/cases/dts/bundle-false/__fixtures__/src/utils/numbers.ts rename to tests/features/dts/bundle-false/__fixtures__/src/utils/numbers.ts diff --git a/e2e/cases/dts/bundle-false/__fixtures__/src/utils/strings.ts b/tests/features/dts/bundle-false/__fixtures__/src/utils/strings.ts similarity index 100% rename from e2e/cases/dts/bundle-false/__fixtures__/src/utils/strings.ts rename to tests/features/dts/bundle-false/__fixtures__/src/utils/strings.ts diff --git a/e2e/cases/dts/bundle-false/__fixtures__/tsconfig.json b/tests/features/dts/bundle-false/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/dts/bundle-false/__fixtures__/tsconfig.json rename to tests/features/dts/bundle-false/__fixtures__/tsconfig.json diff --git a/e2e/cases/dts/bundle-false/abort-on-error/package.json b/tests/features/dts/bundle-false/abort-on-error/package.json similarity index 100% rename from e2e/cases/dts/bundle-false/abort-on-error/package.json rename to tests/features/dts/bundle-false/abort-on-error/package.json diff --git a/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts b/tests/features/dts/bundle-false/abort-on-error/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts rename to tests/features/dts/bundle-false/abort-on-error/rslib.config.ts index b05326398..04c4fc9ea 100644 --- a/e2e/cases/dts/bundle-false/abort-on-error/rslib.config.ts +++ b/tests/features/dts/bundle-false/abort-on-error/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle-false/abort-on-error/src/const.ts b/tests/features/dts/bundle-false/abort-on-error/src/const.ts similarity index 100% rename from e2e/cases/dts/bundle-false/abort-on-error/src/const.ts rename to tests/features/dts/bundle-false/abort-on-error/src/const.ts diff --git a/e2e/cases/dts/bundle-false/abort-on-error/src/index.ts b/tests/features/dts/bundle-false/abort-on-error/src/index.ts similarity index 100% rename from e2e/cases/dts/bundle-false/abort-on-error/src/index.ts rename to tests/features/dts/bundle-false/abort-on-error/src/index.ts diff --git a/e2e/cases/dts/bundle-false/abort-on-error/tsconfig.json b/tests/features/dts/bundle-false/abort-on-error/tsconfig.json similarity index 100% rename from e2e/cases/dts/bundle-false/abort-on-error/tsconfig.json rename to tests/features/dts/bundle-false/abort-on-error/tsconfig.json diff --git a/e2e/cases/dts/bundle-false/auto-extension/package.json b/tests/features/dts/bundle-false/auto-extension/package.json similarity index 100% rename from e2e/cases/dts/bundle-false/auto-extension/package.json rename to tests/features/dts/bundle-false/auto-extension/package.json diff --git a/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts b/tests/features/dts/bundle-false/auto-extension/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts rename to tests/features/dts/bundle-false/auto-extension/rslib.config.ts index 755eadfc4..fff831d5a 100644 --- a/e2e/cases/dts/bundle-false/auto-extension/rslib.config.ts +++ b/tests/features/dts/bundle-false/auto-extension/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle-false/basic/package.json b/tests/features/dts/bundle-false/basic/package.json similarity index 100% rename from e2e/cases/dts/bundle-false/basic/package.json rename to tests/features/dts/bundle-false/basic/package.json diff --git a/e2e/cases/dts/bundle-false/basic/rslib.config.ts b/tests/features/dts/bundle-false/basic/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle-false/basic/rslib.config.ts rename to tests/features/dts/bundle-false/basic/rslib.config.ts index f1fe7fff8..0afd630fe 100644 --- a/e2e/cases/dts/bundle-false/basic/rslib.config.ts +++ b/tests/features/dts/bundle-false/basic/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle-false/dist-path/package.json b/tests/features/dts/bundle-false/dist-path/package.json similarity index 100% rename from e2e/cases/dts/bundle-false/dist-path/package.json rename to tests/features/dts/bundle-false/dist-path/package.json diff --git a/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts b/tests/features/dts/bundle-false/dist-path/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle-false/dist-path/rslib.config.ts rename to tests/features/dts/bundle-false/dist-path/rslib.config.ts index a53f7cc7e..84591201e 100644 --- a/e2e/cases/dts/bundle-false/dist-path/rslib.config.ts +++ b/tests/features/dts/bundle-false/dist-path/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle-false/false/package.json b/tests/features/dts/bundle-false/false/package.json similarity index 100% rename from e2e/cases/dts/bundle-false/false/package.json rename to tests/features/dts/bundle-false/false/package.json diff --git a/e2e/cases/dts/bundle-false/false/rslib.config.ts b/tests/features/dts/bundle-false/false/rslib.config.ts similarity index 95% rename from e2e/cases/dts/bundle-false/false/rslib.config.ts rename to tests/features/dts/bundle-false/false/rslib.config.ts index f139128d7..a759db36a 100644 --- a/e2e/cases/dts/bundle-false/false/rslib.config.ts +++ b/tests/features/dts/bundle-false/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/__fixtures__/src/index.ts b/tests/features/dts/bundle/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/dts/bundle/__fixtures__/src/index.ts rename to tests/features/dts/bundle/__fixtures__/src/index.ts diff --git a/e2e/cases/dts/bundle/__fixtures__/src/sum.ts b/tests/features/dts/bundle/__fixtures__/src/sum.ts similarity index 100% rename from e2e/cases/dts/bundle/__fixtures__/src/sum.ts rename to tests/features/dts/bundle/__fixtures__/src/sum.ts diff --git a/e2e/cases/dts/bundle/__fixtures__/src/utils/numbers.ts b/tests/features/dts/bundle/__fixtures__/src/utils/numbers.ts similarity index 100% rename from e2e/cases/dts/bundle/__fixtures__/src/utils/numbers.ts rename to tests/features/dts/bundle/__fixtures__/src/utils/numbers.ts diff --git a/e2e/cases/dts/bundle/__fixtures__/src/utils/strings.ts b/tests/features/dts/bundle/__fixtures__/src/utils/strings.ts similarity index 100% rename from e2e/cases/dts/bundle/__fixtures__/src/utils/strings.ts rename to tests/features/dts/bundle/__fixtures__/src/utils/strings.ts diff --git a/e2e/cases/dts/bundle/__fixtures__/tsconfig.json b/tests/features/dts/bundle/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/dts/bundle/__fixtures__/tsconfig.json rename to tests/features/dts/bundle/__fixtures__/tsconfig.json diff --git a/e2e/cases/dts/bundle/abort-on-error/package.json b/tests/features/dts/bundle/abort-on-error/package.json similarity index 100% rename from e2e/cases/dts/bundle/abort-on-error/package.json rename to tests/features/dts/bundle/abort-on-error/package.json diff --git a/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts b/tests/features/dts/bundle/abort-on-error/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/abort-on-error/rslib.config.ts rename to tests/features/dts/bundle/abort-on-error/rslib.config.ts index cf19c4099..e86478b8c 100644 --- a/e2e/cases/dts/bundle/abort-on-error/rslib.config.ts +++ b/tests/features/dts/bundle/abort-on-error/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/abort-on-error/src/const.ts b/tests/features/dts/bundle/abort-on-error/src/const.ts similarity index 100% rename from e2e/cases/dts/bundle/abort-on-error/src/const.ts rename to tests/features/dts/bundle/abort-on-error/src/const.ts diff --git a/e2e/cases/dts/bundle/abort-on-error/src/index.ts b/tests/features/dts/bundle/abort-on-error/src/index.ts similarity index 100% rename from e2e/cases/dts/bundle/abort-on-error/src/index.ts rename to tests/features/dts/bundle/abort-on-error/src/index.ts diff --git a/e2e/cases/dts/bundle/abort-on-error/tsconfig.json b/tests/features/dts/bundle/abort-on-error/tsconfig.json similarity index 100% rename from e2e/cases/dts/bundle/abort-on-error/tsconfig.json rename to tests/features/dts/bundle/abort-on-error/tsconfig.json diff --git a/e2e/cases/dts/bundle/absolute-entry/package.json b/tests/features/dts/bundle/absolute-entry/package.json similarity index 100% rename from e2e/cases/dts/bundle/absolute-entry/package.json rename to tests/features/dts/bundle/absolute-entry/package.json diff --git a/e2e/cases/dts/bundle/absolute-entry/rslib.config.ts b/tests/features/dts/bundle/absolute-entry/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/absolute-entry/rslib.config.ts rename to tests/features/dts/bundle/absolute-entry/rslib.config.ts index 0ef7d5868..5112a95fc 100644 --- a/e2e/cases/dts/bundle/absolute-entry/rslib.config.ts +++ b/tests/features/dts/bundle/absolute-entry/rslib.config.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/auto-extension/package.json b/tests/features/dts/bundle/auto-extension/package.json similarity index 100% rename from e2e/cases/dts/bundle/auto-extension/package.json rename to tests/features/dts/bundle/auto-extension/package.json diff --git a/e2e/cases/dts/bundle/auto-extension/rslib.config.ts b/tests/features/dts/bundle/auto-extension/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/auto-extension/rslib.config.ts rename to tests/features/dts/bundle/auto-extension/rslib.config.ts index 0f18154d3..91c2b05a6 100644 --- a/e2e/cases/dts/bundle/auto-extension/rslib.config.ts +++ b/tests/features/dts/bundle/auto-extension/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/basic/package.json b/tests/features/dts/bundle/basic/package.json similarity index 100% rename from e2e/cases/dts/bundle/basic/package.json rename to tests/features/dts/bundle/basic/package.json diff --git a/e2e/cases/dts/bundle/basic/rslib.config.ts b/tests/features/dts/bundle/basic/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/basic/rslib.config.ts rename to tests/features/dts/bundle/basic/rslib.config.ts index be3140d39..096228bd7 100644 --- a/e2e/cases/dts/bundle/basic/rslib.config.ts +++ b/tests/features/dts/bundle/basic/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/bundle-name/package.json b/tests/features/dts/bundle/bundle-name/package.json similarity index 100% rename from e2e/cases/dts/bundle/bundle-name/package.json rename to tests/features/dts/bundle/bundle-name/package.json diff --git a/e2e/cases/dts/bundle/bundle-name/rslib.config.ts b/tests/features/dts/bundle/bundle-name/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/bundle-name/rslib.config.ts rename to tests/features/dts/bundle/bundle-name/rslib.config.ts index 6e7b7ecd7..1e3d43d77 100644 --- a/e2e/cases/dts/bundle/bundle-name/rslib.config.ts +++ b/tests/features/dts/bundle/bundle-name/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/dist-path/package.json b/tests/features/dts/bundle/dist-path/package.json similarity index 100% rename from e2e/cases/dts/bundle/dist-path/package.json rename to tests/features/dts/bundle/dist-path/package.json diff --git a/e2e/cases/dts/bundle/dist-path/rslib.config.ts b/tests/features/dts/bundle/dist-path/rslib.config.ts similarity index 96% rename from e2e/cases/dts/bundle/dist-path/rslib.config.ts rename to tests/features/dts/bundle/dist-path/rslib.config.ts index d057f50dd..3ad3abba6 100644 --- a/e2e/cases/dts/bundle/dist-path/rslib.config.ts +++ b/tests/features/dts/bundle/dist-path/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/bundle/false/package.json b/tests/features/dts/bundle/false/package.json similarity index 100% rename from e2e/cases/dts/bundle/false/package.json rename to tests/features/dts/bundle/false/package.json diff --git a/e2e/cases/dts/bundle/false/rslib.config.ts b/tests/features/dts/bundle/false/rslib.config.ts similarity index 95% rename from e2e/cases/dts/bundle/false/rslib.config.ts rename to tests/features/dts/bundle/false/rslib.config.ts index 2ab7af7c9..da3148fec 100644 --- a/e2e/cases/dts/bundle/false/rslib.config.ts +++ b/tests/features/dts/bundle/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/dts/index.test.ts b/tests/features/dts/index.test.ts similarity index 68% rename from e2e/cases/dts/index.test.ts rename to tests/features/dts/index.test.ts index 98bcb3be8..0f69b90be 100644 --- a/e2e/cases/dts/index.test.ts +++ b/tests/features/dts/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { describe, expect, test } from 'vitest'; describe('dts when bundle: false', () => { @@ -9,10 +9,10 @@ describe('dts when bundle: false', () => { expect(files.esm).toMatchInlineSnapshot(` [ - "/e2e/cases/dts/bundle-false/basic/dist/esm/index.d.ts", - "/e2e/cases/dts/bundle-false/basic/dist/esm/sum.d.ts", - "/e2e/cases/dts/bundle-false/basic/dist/esm/utils/numbers.d.ts", - "/e2e/cases/dts/bundle-false/basic/dist/esm/utils/strings.d.ts", + "/tests/features/dts/bundle-false/basic/dist/esm/index.d.ts", + "/tests/features/dts/bundle-false/basic/dist/esm/sum.d.ts", + "/tests/features/dts/bundle-false/basic/dist/esm/utils/numbers.d.ts", + "/tests/features/dts/bundle-false/basic/dist/esm/utils/strings.d.ts", ] `); expect(contents.esm).toMatchSnapshot(); @@ -31,10 +31,10 @@ describe('dts when bundle: false', () => { expect(files.esm).toMatchInlineSnapshot(` [ - "/e2e/cases/dts/bundle-false/dist-path/dist/custom/index.d.ts", - "/e2e/cases/dts/bundle-false/dist-path/dist/custom/sum.d.ts", - "/e2e/cases/dts/bundle-false/dist-path/dist/custom/utils/numbers.d.ts", - "/e2e/cases/dts/bundle-false/dist-path/dist/custom/utils/strings.d.ts", + "/tests/features/dts/bundle-false/dist-path/dist/custom/index.d.ts", + "/tests/features/dts/bundle-false/dist-path/dist/custom/sum.d.ts", + "/tests/features/dts/bundle-false/dist-path/dist/custom/utils/numbers.d.ts", + "/tests/features/dts/bundle-false/dist-path/dist/custom/utils/strings.d.ts", ] `); }); @@ -52,10 +52,10 @@ describe('dts when bundle: false', () => { expect(files.cjs).toMatchInlineSnapshot(` [ - "/e2e/cases/dts/bundle-false/auto-extension/dist/cjs/index.d.cts", - "/e2e/cases/dts/bundle-false/auto-extension/dist/cjs/sum.d.cts", - "/e2e/cases/dts/bundle-false/auto-extension/dist/cjs/utils/numbers.d.cts", - "/e2e/cases/dts/bundle-false/auto-extension/dist/cjs/utils/strings.d.cts", + "/tests/features/dts/bundle-false/auto-extension/dist/cjs/index.d.cts", + "/tests/features/dts/bundle-false/auto-extension/dist/cjs/sum.d.cts", + "/tests/features/dts/bundle-false/auto-extension/dist/cjs/utils/numbers.d.cts", + "/tests/features/dts/bundle-false/auto-extension/dist/cjs/utils/strings.d.cts", ] `); }); @@ -70,7 +70,7 @@ describe('dts when bundle: true', () => { ); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/basic/dist/esm/index.d.ts"`, + `"/tests/features/dts/bundle/basic/dist/esm/index.d.ts"`, ); expect(entries).toMatchSnapshot(); }); @@ -87,7 +87,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/dist-path/dist/custom/index.d.ts"`, + `"/tests/features/dts/bundle/dist-path/dist/custom/index.d.ts"`, ); }); @@ -103,7 +103,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.cjs).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/auto-extension/dist/cjs/index.d.cts"`, + `"/tests/features/dts/bundle/auto-extension/dist/cjs/index.d.cts"`, ); }); @@ -112,7 +112,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/bundle-name/dist/esm/bundleName.d.ts"`, + `"/tests/features/dts/bundle/bundle-name/dist/esm/bundleName.d.ts"`, ); }); @@ -121,7 +121,7 @@ describe('dts when bundle: true', () => { const { entryFiles } = await buildAndGetResults(fixturePath, 'dts'); expect(entryFiles.esm).toMatchInlineSnapshot( - `"/e2e/cases/dts/bundle/absolute-entry/dist/esm/index.d.ts"`, + `"/tests/features/dts/bundle/absolute-entry/dist/esm/index.d.ts"`, ); }); }); diff --git a/e2e/cases/entry/glob/package.json b/tests/features/entry/glob/package.json similarity index 100% rename from e2e/cases/entry/glob/package.json rename to tests/features/entry/glob/package.json diff --git a/e2e/cases/entry/glob/rslib.config.ts b/tests/features/entry/glob/rslib.config.ts similarity index 95% rename from e2e/cases/entry/glob/rslib.config.ts rename to tests/features/entry/glob/rslib.config.ts index 38bd7e533..d48379eb1 100644 --- a/e2e/cases/entry/glob/rslib.config.ts +++ b/tests/features/entry/glob/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/entry/glob/src/bar.ts b/tests/features/entry/glob/src/bar.ts similarity index 100% rename from e2e/cases/entry/glob/src/bar.ts rename to tests/features/entry/glob/src/bar.ts diff --git a/e2e/cases/entry/glob/src/foo.ts b/tests/features/entry/glob/src/foo.ts similarity index 100% rename from e2e/cases/entry/glob/src/foo.ts rename to tests/features/entry/glob/src/foo.ts diff --git a/e2e/cases/entry/glob/src/ignore/baz.ignore.ts b/tests/features/entry/glob/src/ignore/baz.ignore.ts similarity index 100% rename from e2e/cases/entry/glob/src/ignore/baz.ignore.ts rename to tests/features/entry/glob/src/ignore/baz.ignore.ts diff --git a/e2e/cases/entry/glob/src/index.ignore.ts b/tests/features/entry/glob/src/index.ignore.ts similarity index 100% rename from e2e/cases/entry/glob/src/index.ignore.ts rename to tests/features/entry/glob/src/index.ignore.ts diff --git a/e2e/cases/entry/glob/src/index.ts b/tests/features/entry/glob/src/index.ts similarity index 100% rename from e2e/cases/entry/glob/src/index.ts rename to tests/features/entry/glob/src/index.ts diff --git a/e2e/cases/entry/index.test.ts b/tests/features/entry/index.test.ts similarity index 51% rename from e2e/cases/entry/index.test.ts rename to tests/features/entry/index.test.ts index d14c42880..a9c09e586 100644 --- a/e2e/cases/entry/index.test.ts +++ b/tests/features/entry/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('single entry bundle', async () => { @@ -9,10 +9,10 @@ test('single entry bundle', async () => { expect(files).toMatchInlineSnapshot(` { "cjs": [ - "/e2e/cases/entry/single/dist/cjs/index.cjs", + "/tests/features/entry/single/dist/cjs/index.cjs", ], "esm": [ - "/e2e/cases/entry/single/dist/esm/index.js", + "/tests/features/entry/single/dist/esm/index.js", ], } `); @@ -25,12 +25,12 @@ test('multiple entry bundle', async () => { expect(files).toMatchInlineSnapshot(` { "cjs": [ - "/e2e/cases/entry/multiple/dist/cjs/bar.cjs", - "/e2e/cases/entry/multiple/dist/cjs/index.cjs", + "/tests/features/entry/multiple/dist/cjs/bar.cjs", + "/tests/features/entry/multiple/dist/cjs/index.cjs", ], "esm": [ - "/e2e/cases/entry/multiple/dist/esm/bar.js", - "/e2e/cases/entry/multiple/dist/esm/index.js", + "/tests/features/entry/multiple/dist/esm/bar.js", + "/tests/features/entry/multiple/dist/esm/index.js", ], } `); @@ -43,14 +43,14 @@ test('glob entry bundleless', async () => { expect(files).toMatchInlineSnapshot(` { "cjs": [ - "/e2e/cases/entry/glob/dist/cjs/bar.cjs", - "/e2e/cases/entry/glob/dist/cjs/foo.cjs", - "/e2e/cases/entry/glob/dist/cjs/index.cjs", + "/tests/features/entry/glob/dist/cjs/bar.cjs", + "/tests/features/entry/glob/dist/cjs/foo.cjs", + "/tests/features/entry/glob/dist/cjs/index.cjs", ], "esm": [ - "/e2e/cases/entry/glob/dist/esm/bar.js", - "/e2e/cases/entry/glob/dist/esm/foo.js", - "/e2e/cases/entry/glob/dist/esm/index.js", + "/tests/features/entry/glob/dist/esm/bar.js", + "/tests/features/entry/glob/dist/esm/foo.js", + "/tests/features/entry/glob/dist/esm/index.js", ], } `); diff --git a/e2e/cases/entry/multiple/package.json b/tests/features/entry/multiple/package.json similarity index 100% rename from e2e/cases/entry/multiple/package.json rename to tests/features/entry/multiple/package.json diff --git a/e2e/cases/entry/multiple/rslib.config.ts b/tests/features/entry/multiple/rslib.config.ts similarity index 95% rename from e2e/cases/entry/multiple/rslib.config.ts rename to tests/features/entry/multiple/rslib.config.ts index 077ddd9e0..e6694b52c 100644 --- a/e2e/cases/entry/multiple/rslib.config.ts +++ b/tests/features/entry/multiple/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/entry/multiple/src/bar.ts b/tests/features/entry/multiple/src/bar.ts similarity index 100% rename from e2e/cases/entry/multiple/src/bar.ts rename to tests/features/entry/multiple/src/bar.ts diff --git a/e2e/cases/entry/multiple/src/foo.ts b/tests/features/entry/multiple/src/foo.ts similarity index 100% rename from e2e/cases/entry/multiple/src/foo.ts rename to tests/features/entry/multiple/src/foo.ts diff --git a/e2e/cases/entry/multiple/src/index.ts b/tests/features/entry/multiple/src/index.ts similarity index 100% rename from e2e/cases/entry/multiple/src/index.ts rename to tests/features/entry/multiple/src/index.ts diff --git a/e2e/cases/entry/single/package.json b/tests/features/entry/single/package.json similarity index 100% rename from e2e/cases/entry/single/package.json rename to tests/features/entry/single/package.json diff --git a/e2e/cases/auto-external/external-sub-path/rslib.config.ts b/tests/features/entry/single/rslib.config.ts similarity index 94% rename from e2e/cases/auto-external/external-sub-path/rslib.config.ts rename to tests/features/entry/single/rslib.config.ts index 3cac7018f..a1f544775 100644 --- a/e2e/cases/auto-external/external-sub-path/rslib.config.ts +++ b/tests/features/entry/single/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/entry/single/src/foo.ts b/tests/features/entry/single/src/foo.ts similarity index 100% rename from e2e/cases/entry/single/src/foo.ts rename to tests/features/entry/single/src/foo.ts diff --git a/e2e/cases/entry/single/src/index.ts b/tests/features/entry/single/src/index.ts similarity index 100% rename from e2e/cases/entry/single/src/index.ts rename to tests/features/entry/single/src/index.ts diff --git a/e2e/cases/extension-alias/__snapshots__/index.test.ts.snap b/tests/features/extension-alias/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/extension-alias/__snapshots__/index.test.ts.snap rename to tests/features/extension-alias/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/extension-alias/index.test.ts b/tests/features/extension-alias/index.test.ts similarity index 84% rename from e2e/cases/extension-alias/index.test.ts rename to tests/features/extension-alias/index.test.ts index efa5ae1d3..32f241156 100644 --- a/e2e/cases/extension-alias/index.test.ts +++ b/tests/features/extension-alias/index.test.ts @@ -1,4 +1,4 @@ -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('resolve.extensionAlias should work', async () => { diff --git a/e2e/cases/extension-alias/package.json b/tests/features/extension-alias/package.json similarity index 100% rename from e2e/cases/extension-alias/package.json rename to tests/features/extension-alias/package.json diff --git a/e2e/cases/extension-alias/rslib.config.ts b/tests/features/extension-alias/rslib.config.ts similarity index 94% rename from e2e/cases/extension-alias/rslib.config.ts rename to tests/features/extension-alias/rslib.config.ts index 3cac7018f..a1f544775 100644 --- a/e2e/cases/extension-alias/rslib.config.ts +++ b/tests/features/extension-alias/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/extension-alias/src/bar.js b/tests/features/extension-alias/src/bar.js similarity index 100% rename from e2e/cases/extension-alias/src/bar.js rename to tests/features/extension-alias/src/bar.js diff --git a/e2e/cases/extension-alias/src/foo.ts b/tests/features/extension-alias/src/foo.ts similarity index 100% rename from e2e/cases/extension-alias/src/foo.ts rename to tests/features/extension-alias/src/foo.ts diff --git a/e2e/cases/extension-alias/src/index.ts b/tests/features/extension-alias/src/index.ts similarity index 100% rename from e2e/cases/extension-alias/src/index.ts rename to tests/features/extension-alias/src/index.ts diff --git a/e2e/cases/extension-alias/tsconfig.json b/tests/features/extension-alias/tsconfig.json similarity index 100% rename from e2e/cases/extension-alias/tsconfig.json rename to tests/features/extension-alias/tsconfig.json diff --git a/e2e/cases/external-helpers/__fixtures__/src/index.ts b/tests/features/external-helpers/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/external-helpers/__fixtures__/src/index.ts rename to tests/features/external-helpers/__fixtures__/src/index.ts diff --git a/e2e/cases/external-helpers/__fixtures__/tsconfig.json b/tests/features/external-helpers/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/external-helpers/__fixtures__/tsconfig.json rename to tests/features/external-helpers/__fixtures__/tsconfig.json diff --git a/e2e/cases/external-helpers/__snapshots__/index.test.ts.snap b/tests/features/external-helpers/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/external-helpers/__snapshots__/index.test.ts.snap rename to tests/features/external-helpers/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/external-helpers/config-override/package.json b/tests/features/external-helpers/config-override/package.json similarity index 100% rename from e2e/cases/external-helpers/config-override/package.json rename to tests/features/external-helpers/config-override/package.json diff --git a/e2e/cases/external-helpers/config-override/rslib.config.ts b/tests/features/external-helpers/config-override/rslib.config.ts similarity index 92% rename from e2e/cases/external-helpers/config-override/rslib.config.ts rename to tests/features/external-helpers/config-override/rslib.config.ts index 181a4f158..97dcf0156 100644 --- a/e2e/cases/external-helpers/config-override/rslib.config.ts +++ b/tests/features/external-helpers/config-override/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/external-helpers/default/package.json b/tests/features/external-helpers/default/package.json similarity index 100% rename from e2e/cases/external-helpers/default/package.json rename to tests/features/external-helpers/default/package.json diff --git a/e2e/cases/external-helpers/default/rslib.config.ts b/tests/features/external-helpers/default/rslib.config.ts similarity index 80% rename from e2e/cases/external-helpers/default/rslib.config.ts rename to tests/features/external-helpers/default/rslib.config.ts index e4610af9a..aff5c5abb 100644 --- a/e2e/cases/external-helpers/default/rslib.config.ts +++ b/tests/features/external-helpers/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/external-helpers/index.test.ts b/tests/features/external-helpers/index.test.ts similarity index 96% rename from e2e/cases/external-helpers/index.test.ts rename to tests/features/external-helpers/index.test.ts index df458c5fb..ac0f733e1 100644 --- a/e2e/cases/external-helpers/index.test.ts +++ b/tests/features/external-helpers/index.test.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { buildAndGetResults, proxyConsole } from '@e2e/helper'; import stripAnsi from 'strip-ansi'; +import { buildAndGetResults, proxyConsole } from 'test-helper'; import { expect, test } from 'vitest'; test('should not external @swc/helpers by default', async () => { diff --git a/e2e/cases/external-helpers/no-deps/package.json b/tests/features/external-helpers/no-deps/package.json similarity index 100% rename from e2e/cases/external-helpers/no-deps/package.json rename to tests/features/external-helpers/no-deps/package.json diff --git a/e2e/cases/external-helpers/no-deps/rslib.config.ts b/tests/features/external-helpers/no-deps/rslib.config.ts similarity index 82% rename from e2e/cases/external-helpers/no-deps/rslib.config.ts rename to tests/features/external-helpers/no-deps/rslib.config.ts index f48f49be6..774c62527 100644 --- a/e2e/cases/external-helpers/no-deps/rslib.config.ts +++ b/tests/features/external-helpers/no-deps/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/external-helpers/true/package.json b/tests/features/external-helpers/true/package.json similarity index 100% rename from e2e/cases/external-helpers/true/package.json rename to tests/features/external-helpers/true/package.json diff --git a/e2e/cases/external-helpers/true/rslib.config.ts b/tests/features/external-helpers/true/rslib.config.ts similarity index 90% rename from e2e/cases/external-helpers/true/rslib.config.ts rename to tests/features/external-helpers/true/rslib.config.ts index 6acbb1e46..bfdf1849e 100644 --- a/e2e/cases/external-helpers/true/rslib.config.ts +++ b/tests/features/external-helpers/true/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/externals/browser/package.json b/tests/features/externals/browser/package.json similarity index 100% rename from e2e/cases/externals/browser/package.json rename to tests/features/externals/browser/package.json diff --git a/e2e/cases/externals/browser/rslib.config.ts b/tests/features/externals/browser/rslib.config.ts similarity index 95% rename from e2e/cases/externals/browser/rslib.config.ts rename to tests/features/externals/browser/rslib.config.ts index 29633e4d0..843e34d16 100644 --- a/e2e/cases/externals/browser/rslib.config.ts +++ b/tests/features/externals/browser/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/externals/browser/src/index.ts b/tests/features/externals/browser/src/index.ts similarity index 100% rename from e2e/cases/externals/browser/src/index.ts rename to tests/features/externals/browser/src/index.ts diff --git a/e2e/cases/externals/index.test.ts b/tests/features/externals/index.test.ts similarity index 97% rename from e2e/cases/externals/index.test.ts rename to tests/features/externals/index.test.ts index 9dfd2e436..6fed54285 100644 --- a/e2e/cases/externals/index.test.ts +++ b/tests/features/externals/index.test.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; -import { buildAndGetResults, proxyConsole } from '@e2e/helper'; import stripAnsi from 'strip-ansi'; +import { buildAndGetResults, proxyConsole } from 'test-helper'; import { expect, test } from 'vitest'; import { composeModuleImportWarn } from '../../../packages/core/src/config'; diff --git a/e2e/cases/externals/module-import-warn/package.json b/tests/features/externals/module-import-warn/package.json similarity index 100% rename from e2e/cases/externals/module-import-warn/package.json rename to tests/features/externals/module-import-warn/package.json diff --git a/e2e/cases/externals/module-import-warn/rslib.config.ts b/tests/features/externals/module-import-warn/rslib.config.ts similarity index 85% rename from e2e/cases/externals/module-import-warn/rslib.config.ts rename to tests/features/externals/module-import-warn/rslib.config.ts index 46fea451d..bcef068da 100644 --- a/e2e/cases/externals/module-import-warn/rslib.config.ts +++ b/tests/features/externals/module-import-warn/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/externals/module-import-warn/src/baz.ts b/tests/features/externals/module-import-warn/src/baz.ts similarity index 100% rename from e2e/cases/externals/module-import-warn/src/baz.ts rename to tests/features/externals/module-import-warn/src/baz.ts diff --git a/e2e/cases/externals/module-import-warn/src/index.ts b/tests/features/externals/module-import-warn/src/index.ts similarity index 100% rename from e2e/cases/externals/module-import-warn/src/index.ts rename to tests/features/externals/module-import-warn/src/index.ts diff --git a/e2e/cases/externals/node/package.json b/tests/features/externals/node/package.json similarity index 100% rename from e2e/cases/externals/node/package.json rename to tests/features/externals/node/package.json diff --git a/e2e/cases/externals/node/rslib.config.ts b/tests/features/externals/node/rslib.config.ts similarity index 97% rename from e2e/cases/externals/node/rslib.config.ts rename to tests/features/externals/node/rslib.config.ts index 242e29f6a..ffac0872e 100644 --- a/e2e/cases/externals/node/rslib.config.ts +++ b/tests/features/externals/node/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/externals/node/src/index.ts b/tests/features/externals/node/src/index.ts similarity index 100% rename from e2e/cases/externals/node/src/index.ts rename to tests/features/externals/node/src/index.ts diff --git a/e2e/cases/minify/config/package.json b/tests/features/minify/config/package.json similarity index 100% rename from e2e/cases/minify/config/package.json rename to tests/features/minify/config/package.json diff --git a/e2e/cases/minify/config/rslib.config.ts b/tests/features/minify/config/rslib.config.ts similarity index 81% rename from e2e/cases/minify/config/rslib.config.ts rename to tests/features/minify/config/rslib.config.ts index 5b5d608d0..a6852412f 100644 --- a/e2e/cases/minify/config/rslib.config.ts +++ b/tests/features/minify/config/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/minify/config/src/index.ts b/tests/features/minify/config/src/index.ts similarity index 100% rename from e2e/cases/minify/config/src/index.ts rename to tests/features/minify/config/src/index.ts diff --git a/e2e/cases/minify/default/package.json b/tests/features/minify/default/package.json similarity index 100% rename from e2e/cases/minify/default/package.json rename to tests/features/minify/default/package.json diff --git a/e2e/cases/minify/default/rslib.config.ts b/tests/features/minify/default/rslib.config.ts similarity index 80% rename from e2e/cases/minify/default/rslib.config.ts rename to tests/features/minify/default/rslib.config.ts index 81545d6da..e5b8a2c65 100644 --- a/e2e/cases/minify/default/rslib.config.ts +++ b/tests/features/minify/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/minify/default/src/index.ts b/tests/features/minify/default/src/index.ts similarity index 100% rename from e2e/cases/minify/default/src/index.ts rename to tests/features/minify/default/src/index.ts diff --git a/e2e/cases/minify/index.test.ts b/tests/features/minify/index.test.ts similarity index 88% rename from e2e/cases/minify/index.test.ts rename to tests/features/minify/index.test.ts index 121e53d2a..0e51e82e8 100644 --- a/e2e/cases/minify/index.test.ts +++ b/tests/features/minify/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('tree shaking is enabled by default, bar and baz should be shaken', async () => { diff --git a/e2e/cases/resolve/data-url/index.ts b/tests/features/resolve/data-url/index.ts similarity index 100% rename from e2e/cases/resolve/data-url/index.ts rename to tests/features/resolve/data-url/index.ts diff --git a/e2e/cases/resolve/data-url/package.json b/tests/features/resolve/data-url/package.json similarity index 100% rename from e2e/cases/resolve/data-url/package.json rename to tests/features/resolve/data-url/package.json diff --git a/e2e/cases/resolve/false/rslib.config.ts b/tests/features/resolve/data-url/rslib.config.ts similarity index 94% rename from e2e/cases/resolve/false/rslib.config.ts rename to tests/features/resolve/data-url/rslib.config.ts index 291204c05..388ed9b6c 100644 --- a/e2e/cases/resolve/false/rslib.config.ts +++ b/tests/features/resolve/data-url/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/resolve/false/bar.ts b/tests/features/resolve/false/bar.ts similarity index 100% rename from e2e/cases/resolve/false/bar.ts rename to tests/features/resolve/false/bar.ts diff --git a/e2e/cases/resolve/false/browser-false/package.json b/tests/features/resolve/false/browser-false/package.json similarity index 100% rename from e2e/cases/resolve/false/browser-false/package.json rename to tests/features/resolve/false/browser-false/package.json diff --git a/e2e/cases/resolve/false/index.ts b/tests/features/resolve/false/index.ts similarity index 100% rename from e2e/cases/resolve/false/index.ts rename to tests/features/resolve/false/index.ts diff --git a/e2e/cases/resolve/false/package.json b/tests/features/resolve/false/package.json similarity index 100% rename from e2e/cases/resolve/false/package.json rename to tests/features/resolve/false/package.json diff --git a/e2e/cases/resolve/data-url/rslib.config.ts b/tests/features/resolve/false/rslib.config.ts similarity index 94% rename from e2e/cases/resolve/data-url/rslib.config.ts rename to tests/features/resolve/false/rslib.config.ts index 291204c05..388ed9b6c 100644 --- a/e2e/cases/resolve/data-url/rslib.config.ts +++ b/tests/features/resolve/false/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/resolve/index.test.ts b/tests/features/resolve/index.test.ts similarity index 98% rename from e2e/cases/resolve/index.test.ts rename to tests/features/resolve/index.test.ts index c10528bcf..0cbd76e79 100644 --- a/e2e/cases/resolve/index.test.ts +++ b/tests/features/resolve/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('resolve data url', async () => { diff --git a/e2e/cases/resolve/node-protocol/index.ts b/tests/features/resolve/node-protocol/index.ts similarity index 100% rename from e2e/cases/resolve/node-protocol/index.ts rename to tests/features/resolve/node-protocol/index.ts diff --git a/e2e/cases/resolve/node-protocol/package.json b/tests/features/resolve/node-protocol/package.json similarity index 100% rename from e2e/cases/resolve/node-protocol/package.json rename to tests/features/resolve/node-protocol/package.json diff --git a/e2e/cases/resolve/node-protocol/rslib.config.ts b/tests/features/resolve/node-protocol/rslib.config.ts similarity index 95% rename from e2e/cases/resolve/node-protocol/rslib.config.ts rename to tests/features/resolve/node-protocol/rslib.config.ts index 3ee7f385f..b7b8089f7 100644 --- a/e2e/cases/resolve/node-protocol/rslib.config.ts +++ b/tests/features/resolve/node-protocol/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/resolve/with-condition-exports/.gitignore b/tests/features/resolve/with-condition-exports/.gitignore similarity index 100% rename from e2e/cases/resolve/with-condition-exports/.gitignore rename to tests/features/resolve/with-condition-exports/.gitignore diff --git a/e2e/cases/resolve/with-condition-exports/entry1.ts b/tests/features/resolve/with-condition-exports/entry1.ts similarity index 100% rename from e2e/cases/resolve/with-condition-exports/entry1.ts rename to tests/features/resolve/with-condition-exports/entry1.ts diff --git a/e2e/cases/resolve/with-condition-exports/entry2.ts b/tests/features/resolve/with-condition-exports/entry2.ts similarity index 100% rename from e2e/cases/resolve/with-condition-exports/entry2.ts rename to tests/features/resolve/with-condition-exports/entry2.ts diff --git a/e2e/cases/resolve/with-condition-exports/entry3.ts b/tests/features/resolve/with-condition-exports/entry3.ts similarity index 100% rename from e2e/cases/resolve/with-condition-exports/entry3.ts rename to tests/features/resolve/with-condition-exports/entry3.ts diff --git a/e2e/cases/resolve/with-condition-exports/entry4.ts b/tests/features/resolve/with-condition-exports/entry4.ts similarity index 100% rename from e2e/cases/resolve/with-condition-exports/entry4.ts rename to tests/features/resolve/with-condition-exports/entry4.ts diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib1/package.json b/tests/features/resolve/with-condition-exports/node_modules/lib1/package.json similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib1/package.json rename to tests/features/resolve/with-condition-exports/node_modules/lib1/package.json diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib1/src/index.cjs b/tests/features/resolve/with-condition-exports/node_modules/lib1/src/index.cjs similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib1/src/index.cjs rename to tests/features/resolve/with-condition-exports/node_modules/lib1/src/index.cjs diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib1/src/index.mjs b/tests/features/resolve/with-condition-exports/node_modules/lib1/src/index.mjs similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib1/src/index.mjs rename to tests/features/resolve/with-condition-exports/node_modules/lib1/src/index.mjs diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib2/package.json b/tests/features/resolve/with-condition-exports/node_modules/lib2/package.json similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib2/package.json rename to tests/features/resolve/with-condition-exports/node_modules/lib2/package.json diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/index.cjs b/tests/features/resolve/with-condition-exports/node_modules/lib2/src/index.cjs similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/index.cjs rename to tests/features/resolve/with-condition-exports/node_modules/lib2/src/index.cjs diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/index.mjs b/tests/features/resolve/with-condition-exports/node_modules/lib2/src/index.mjs similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/index.mjs rename to tests/features/resolve/with-condition-exports/node_modules/lib2/src/index.mjs diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/module.js b/tests/features/resolve/with-condition-exports/node_modules/lib2/src/module.js similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib2/src/module.js rename to tests/features/resolve/with-condition-exports/node_modules/lib2/src/module.js diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib3/package.json b/tests/features/resolve/with-condition-exports/node_modules/lib3/package.json similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib3/package.json rename to tests/features/resolve/with-condition-exports/node_modules/lib3/package.json diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib3/src/browser.js b/tests/features/resolve/with-condition-exports/node_modules/lib3/src/browser.js similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib3/src/browser.js rename to tests/features/resolve/with-condition-exports/node_modules/lib3/src/browser.js diff --git a/e2e/cases/resolve/with-condition-exports/node_modules/lib3/src/node.js b/tests/features/resolve/with-condition-exports/node_modules/lib3/src/node.js similarity index 100% rename from e2e/cases/resolve/with-condition-exports/node_modules/lib3/src/node.js rename to tests/features/resolve/with-condition-exports/node_modules/lib3/src/node.js diff --git a/e2e/cases/resolve/with-condition-exports/package.json b/tests/features/resolve/with-condition-exports/package.json similarity index 100% rename from e2e/cases/resolve/with-condition-exports/package.json rename to tests/features/resolve/with-condition-exports/package.json diff --git a/e2e/cases/resolve/with-condition-exports/rslib.config.ts b/tests/features/resolve/with-condition-exports/rslib.config.ts similarity index 90% rename from e2e/cases/resolve/with-condition-exports/rslib.config.ts rename to tests/features/resolve/with-condition-exports/rslib.config.ts index 84d1bb8fa..50c7862a1 100644 --- a/e2e/cases/resolve/with-condition-exports/rslib.config.ts +++ b/tests/features/resolve/with-condition-exports/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/resolve/with-js-extensions/example.mts b/tests/features/resolve/with-js-extensions/example.mts similarity index 100% rename from e2e/cases/resolve/with-js-extensions/example.mts rename to tests/features/resolve/with-js-extensions/example.mts diff --git a/e2e/cases/resolve/with-js-extensions/index.ts b/tests/features/resolve/with-js-extensions/index.ts similarity index 100% rename from e2e/cases/resolve/with-js-extensions/index.ts rename to tests/features/resolve/with-js-extensions/index.ts diff --git a/e2e/cases/resolve/with-js-extensions/package.json b/tests/features/resolve/with-js-extensions/package.json similarity index 100% rename from e2e/cases/resolve/with-js-extensions/package.json rename to tests/features/resolve/with-js-extensions/package.json diff --git a/e2e/cases/resolve/with-js-extensions/rslib.config.ts b/tests/features/resolve/with-js-extensions/rslib.config.ts similarity index 95% rename from e2e/cases/resolve/with-js-extensions/rslib.config.ts rename to tests/features/resolve/with-js-extensions/rslib.config.ts index 9c8478493..f72c21d82 100644 --- a/e2e/cases/resolve/with-js-extensions/rslib.config.ts +++ b/tests/features/resolve/with-js-extensions/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/resolve/with-main-fields/.gitignore b/tests/features/resolve/with-main-fields/.gitignore similarity index 100% rename from e2e/cases/resolve/with-main-fields/.gitignore rename to tests/features/resolve/with-main-fields/.gitignore diff --git a/e2e/cases/resolve/with-main-fields/entry1.ts b/tests/features/resolve/with-main-fields/entry1.ts similarity index 100% rename from e2e/cases/resolve/with-main-fields/entry1.ts rename to tests/features/resolve/with-main-fields/entry1.ts diff --git a/e2e/cases/resolve/with-main-fields/entry2.ts b/tests/features/resolve/with-main-fields/entry2.ts similarity index 100% rename from e2e/cases/resolve/with-main-fields/entry2.ts rename to tests/features/resolve/with-main-fields/entry2.ts diff --git a/e2e/cases/resolve/with-main-fields/node_modules/lib1/package.json b/tests/features/resolve/with-main-fields/node_modules/lib1/package.json similarity index 100% rename from e2e/cases/resolve/with-main-fields/node_modules/lib1/package.json rename to tests/features/resolve/with-main-fields/node_modules/lib1/package.json diff --git a/e2e/cases/resolve/with-main-fields/node_modules/lib1/src/index.ts b/tests/features/resolve/with-main-fields/node_modules/lib1/src/index.ts similarity index 100% rename from e2e/cases/resolve/with-main-fields/node_modules/lib1/src/index.ts rename to tests/features/resolve/with-main-fields/node_modules/lib1/src/index.ts diff --git a/e2e/cases/resolve/with-main-fields/node_modules/lib2/package.json b/tests/features/resolve/with-main-fields/node_modules/lib2/package.json similarity index 100% rename from e2e/cases/resolve/with-main-fields/node_modules/lib2/package.json rename to tests/features/resolve/with-main-fields/node_modules/lib2/package.json diff --git a/e2e/cases/resolve/with-main-fields/node_modules/lib2/src/browser.ts b/tests/features/resolve/with-main-fields/node_modules/lib2/src/browser.ts similarity index 100% rename from e2e/cases/resolve/with-main-fields/node_modules/lib2/src/browser.ts rename to tests/features/resolve/with-main-fields/node_modules/lib2/src/browser.ts diff --git a/e2e/cases/resolve/with-main-fields/node_modules/lib2/src/main.ts b/tests/features/resolve/with-main-fields/node_modules/lib2/src/main.ts similarity index 100% rename from e2e/cases/resolve/with-main-fields/node_modules/lib2/src/main.ts rename to tests/features/resolve/with-main-fields/node_modules/lib2/src/main.ts diff --git a/e2e/cases/resolve/with-main-fields/package.json b/tests/features/resolve/with-main-fields/package.json similarity index 100% rename from e2e/cases/resolve/with-main-fields/package.json rename to tests/features/resolve/with-main-fields/package.json diff --git a/e2e/cases/resolve/with-main-fields/rslib.config.ts b/tests/features/resolve/with-main-fields/rslib.config.ts similarity index 93% rename from e2e/cases/resolve/with-main-fields/rslib.config.ts rename to tests/features/resolve/with-main-fields/rslib.config.ts index 3ea7f6c17..802ba2f1a 100644 --- a/e2e/cases/resolve/with-main-fields/rslib.config.ts +++ b/tests/features/resolve/with-main-fields/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/shims/cjs/package.json b/tests/features/shims/cjs/package.json similarity index 100% rename from e2e/cases/shims/cjs/package.json rename to tests/features/shims/cjs/package.json diff --git a/e2e/cases/shims/cjs/rslib.config.ts b/tests/features/shims/cjs/rslib.config.ts similarity index 95% rename from e2e/cases/shims/cjs/rslib.config.ts rename to tests/features/shims/cjs/rslib.config.ts index 23f9d4e2a..670d42888 100644 --- a/e2e/cases/shims/cjs/rslib.config.ts +++ b/tests/features/shims/cjs/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/shims/cjs/src/index.ts b/tests/features/shims/cjs/src/index.ts similarity index 100% rename from e2e/cases/shims/cjs/src/index.ts rename to tests/features/shims/cjs/src/index.ts diff --git a/e2e/cases/shims/esm/package.json b/tests/features/shims/esm/package.json similarity index 100% rename from e2e/cases/shims/esm/package.json rename to tests/features/shims/esm/package.json diff --git a/e2e/cases/shims/esm/rslib.config.ts b/tests/features/shims/esm/rslib.config.ts similarity index 89% rename from e2e/cases/shims/esm/rslib.config.ts rename to tests/features/shims/esm/rslib.config.ts index 66ffc4b14..8aebc6bb8 100644 --- a/e2e/cases/shims/esm/rslib.config.ts +++ b/tests/features/shims/esm/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/shims/esm/src/index.ts b/tests/features/shims/esm/src/index.ts similarity index 100% rename from e2e/cases/shims/esm/src/index.ts rename to tests/features/shims/esm/src/index.ts diff --git a/e2e/cases/shims/index.test.ts b/tests/features/shims/index.test.ts similarity index 97% rename from e2e/cases/shims/index.test.ts rename to tests/features/shims/index.test.ts index 549851862..e130e1681 100644 --- a/e2e/cases/shims/index.test.ts +++ b/tests/features/shims/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { describe, expect, test } from 'vitest'; test('shims for __dirname and __filename in ESM', async () => { diff --git a/e2e/cases/sourcemap/__fixtures__/src/index.ts b/tests/features/sourcemap/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/sourcemap/__fixtures__/src/index.ts rename to tests/features/sourcemap/__fixtures__/src/index.ts diff --git a/e2e/cases/sourcemap/__fixtures__/tsconfig.json b/tests/features/sourcemap/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/sourcemap/__fixtures__/tsconfig.json rename to tests/features/sourcemap/__fixtures__/tsconfig.json diff --git a/e2e/cases/sourcemap/default/package.json b/tests/features/sourcemap/default/package.json similarity index 100% rename from e2e/cases/sourcemap/default/package.json rename to tests/features/sourcemap/default/package.json diff --git a/e2e/cases/sourcemap/default/rslib.config.ts b/tests/features/sourcemap/default/rslib.config.ts similarity index 78% rename from e2e/cases/sourcemap/default/rslib.config.ts rename to tests/features/sourcemap/default/rslib.config.ts index c373c9671..f47cc32a4 100644 --- a/e2e/cases/sourcemap/default/rslib.config.ts +++ b/tests/features/sourcemap/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/sourcemap/external/package.json b/tests/features/sourcemap/external/package.json similarity index 100% rename from e2e/cases/sourcemap/external/package.json rename to tests/features/sourcemap/external/package.json diff --git a/e2e/cases/sourcemap/external/rslib.config.ts b/tests/features/sourcemap/external/rslib.config.ts similarity index 83% rename from e2e/cases/sourcemap/external/rslib.config.ts rename to tests/features/sourcemap/external/rslib.config.ts index 8955267e4..e1e665c5d 100644 --- a/e2e/cases/sourcemap/external/rslib.config.ts +++ b/tests/features/sourcemap/external/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/tests/features/sourcemap/index.test.ts b/tests/features/sourcemap/index.test.ts new file mode 100644 index 000000000..b70c8244a --- /dev/null +++ b/tests/features/sourcemap/index.test.ts @@ -0,0 +1,44 @@ +import os from 'node:os'; +import { join } from 'node:path'; +import { buildAndGetResults } from 'test-helper'; +import { expect, test } from 'vitest'; + +test('should not generate js sourcemap by default', async () => { + const fixturePath = join(__dirname, 'default'); + const { contents } = await buildAndGetResults(fixturePath, 'js'); + const files = Object.keys(contents.esm); + + expect(files).toMatchInlineSnapshot(` + [ + "/tests/features/sourcemap/default/dist/esm/index.js", + ] + `); +}); + +test('should generate js external sourcemap: cheap-module-source-map', async () => { + const fixturePath = join(__dirname, 'external'); + const { contents } = await buildAndGetResults(fixturePath, 'js'); + const files = Object.keys(contents.esm); + + expect(files).toMatchInlineSnapshot(` + [ + "/tests/features/sourcemap/external/dist/esm/index.js", + "/tests/features/sourcemap/external/dist/esm/index.js.map", + ] + `); +}); + +test('should generate js inline sourcemap: inline-cheap-module-source-map', async () => { + const fixturePath = join(__dirname, 'inline'); + const { contents } = await buildAndGetResults(fixturePath, 'js'); + const files = Object.keys(contents.esm); + const code = Object.values(contents.esm); + + expect(files).toMatchInlineSnapshot(` + [ + "/tests/features/sourcemap/inline/dist/esm/index.js", + ] + `); + + expect(code[0]).toContain('//# sourceMappingURL=data:application/json'); +}); diff --git a/e2e/cases/sourcemap/inline/package.json b/tests/features/sourcemap/inline/package.json similarity index 100% rename from e2e/cases/sourcemap/inline/package.json rename to tests/features/sourcemap/inline/package.json diff --git a/e2e/cases/sourcemap/inline/rslib.config.ts b/tests/features/sourcemap/inline/rslib.config.ts similarity index 83% rename from e2e/cases/sourcemap/inline/rslib.config.ts rename to tests/features/sourcemap/inline/rslib.config.ts index e227cb23b..e155d6596 100644 --- a/e2e/cases/sourcemap/inline/rslib.config.ts +++ b/tests/features/sourcemap/inline/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig()], diff --git a/e2e/cases/syntax/__fixtures__/src/foo.ts b/tests/features/syntax/__fixtures__/src/foo.ts similarity index 100% rename from e2e/cases/syntax/__fixtures__/src/foo.ts rename to tests/features/syntax/__fixtures__/src/foo.ts diff --git a/e2e/cases/syntax/__fixtures__/src/index.ts b/tests/features/syntax/__fixtures__/src/index.ts similarity index 100% rename from e2e/cases/syntax/__fixtures__/src/index.ts rename to tests/features/syntax/__fixtures__/src/index.ts diff --git a/e2e/cases/syntax/__fixtures__/tsconfig.json b/tests/features/syntax/__fixtures__/tsconfig.json similarity index 100% rename from e2e/cases/syntax/__fixtures__/tsconfig.json rename to tests/features/syntax/__fixtures__/tsconfig.json diff --git a/e2e/cases/syntax/__snapshots__/index.test.ts.snap b/tests/features/syntax/__snapshots__/index.test.ts.snap similarity index 100% rename from e2e/cases/syntax/__snapshots__/index.test.ts.snap rename to tests/features/syntax/__snapshots__/index.test.ts.snap diff --git a/e2e/cases/syntax/config/package.json b/tests/features/syntax/config/package.json similarity index 100% rename from e2e/cases/syntax/config/package.json rename to tests/features/syntax/config/package.json diff --git a/e2e/cases/syntax/config/rslib.config.ts b/tests/features/syntax/config/rslib.config.ts similarity index 97% rename from e2e/cases/syntax/config/rslib.config.ts rename to tests/features/syntax/config/rslib.config.ts index 23dc4148e..61187f7f9 100644 --- a/e2e/cases/syntax/config/rslib.config.ts +++ b/tests/features/syntax/config/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/syntax/default/package.json b/tests/features/syntax/default/package.json similarity index 100% rename from e2e/cases/syntax/default/package.json rename to tests/features/syntax/default/package.json diff --git a/e2e/cases/syntax/default/rslib.config.ts b/tests/features/syntax/default/rslib.config.ts similarity index 94% rename from e2e/cases/syntax/default/rslib.config.ts rename to tests/features/syntax/default/rslib.config.ts index 0d7fea2ef..8bbf72faa 100644 --- a/e2e/cases/syntax/default/rslib.config.ts +++ b/tests/features/syntax/default/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/syntax/index.test.ts b/tests/features/syntax/index.test.ts similarity index 95% rename from e2e/cases/syntax/index.test.ts rename to tests/features/syntax/index.test.ts index 894089c21..e59239f80 100644 --- a/e2e/cases/syntax/index.test.ts +++ b/tests/features/syntax/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('should downgrade class private method by default', async () => { diff --git a/e2e/cases/transform-import/arco-design/package.json b/tests/features/transform-import/arco-design/package.json similarity index 100% rename from e2e/cases/transform-import/arco-design/package.json rename to tests/features/transform-import/arco-design/package.json diff --git a/e2e/cases/transform-import/arco-design/rslib.config.ts b/tests/features/transform-import/arco-design/rslib.config.ts similarity index 98% rename from e2e/cases/transform-import/arco-design/rslib.config.ts rename to tests/features/transform-import/arco-design/rslib.config.ts index e7bf5d7f1..04881477a 100644 --- a/e2e/cases/transform-import/arco-design/rslib.config.ts +++ b/tests/features/transform-import/arco-design/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/transform-import/arco-design/src/index.ts b/tests/features/transform-import/arco-design/src/index.ts similarity index 100% rename from e2e/cases/transform-import/arco-design/src/index.ts rename to tests/features/transform-import/arco-design/src/index.ts diff --git a/e2e/cases/transform-import/arco-design/tsconfig.json b/tests/features/transform-import/arco-design/tsconfig.json similarity index 100% rename from e2e/cases/transform-import/arco-design/tsconfig.json rename to tests/features/transform-import/arco-design/tsconfig.json diff --git a/e2e/cases/transform-import/index.test.ts b/tests/features/transform-import/index.test.ts similarity index 96% rename from e2e/cases/transform-import/index.test.ts rename to tests/features/transform-import/index.test.ts index 8327169eb..d59d3b9ab 100644 --- a/e2e/cases/transform-import/index.test.ts +++ b/tests/features/transform-import/index.test.ts @@ -1,5 +1,5 @@ import { join } from 'node:path'; -import { type FormatType, buildAndGetResults } from '@e2e/helper'; +import { type FormatType, buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('transformImport with arco-design', async () => { diff --git a/e2e/cases/transform-import/lodash/package.json b/tests/features/transform-import/lodash/package.json similarity index 100% rename from e2e/cases/transform-import/lodash/package.json rename to tests/features/transform-import/lodash/package.json diff --git a/e2e/cases/transform-import/lodash/rslib.config.ts b/tests/features/transform-import/lodash/rslib.config.ts similarity index 98% rename from e2e/cases/transform-import/lodash/rslib.config.ts rename to tests/features/transform-import/lodash/rslib.config.ts index 5d6f49ebc..5c106b350 100644 --- a/e2e/cases/transform-import/lodash/rslib.config.ts +++ b/tests/features/transform-import/lodash/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [ diff --git a/e2e/cases/transform-import/lodash/src/index.ts b/tests/features/transform-import/lodash/src/index.ts similarity index 100% rename from e2e/cases/transform-import/lodash/src/index.ts rename to tests/features/transform-import/lodash/src/index.ts diff --git a/e2e/cases/transform-import/lodash/tsconfig.json b/tests/features/transform-import/lodash/tsconfig.json similarity index 100% rename from e2e/cases/transform-import/lodash/tsconfig.json rename to tests/features/transform-import/lodash/tsconfig.json diff --git a/e2e/cases/tsconfig/index.test.ts b/tests/features/tsconfig/index.test.ts similarity index 86% rename from e2e/cases/tsconfig/index.test.ts rename to tests/features/tsconfig/index.test.ts index c3a75d355..7fa2ec9e4 100644 --- a/e2e/cases/tsconfig/index.test.ts +++ b/tests/features/tsconfig/index.test.ts @@ -1,4 +1,4 @@ -import { buildAndGetResults } from '@e2e/helper'; +import { buildAndGetResults } from 'test-helper'; import { expect, test } from 'vitest'; test('tsconfig path', async () => { diff --git a/e2e/cases/tsconfig/package.json b/tests/features/tsconfig/package.json similarity index 100% rename from e2e/cases/tsconfig/package.json rename to tests/features/tsconfig/package.json diff --git a/e2e/cases/tsconfig/rslib.config.ts b/tests/features/tsconfig/rslib.config.ts similarity index 95% rename from e2e/cases/tsconfig/rslib.config.ts rename to tests/features/tsconfig/rslib.config.ts index fbc37d007..dd8af3e07 100644 --- a/e2e/cases/tsconfig/rslib.config.ts +++ b/tests/features/tsconfig/rslib.config.ts @@ -1,5 +1,5 @@ -import { generateBundleCjsConfig, generateBundleEsmConfig } from '@e2e/helper'; import { defineConfig } from '@rslib/core'; +import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; export default defineConfig({ lib: [generateBundleEsmConfig(), generateBundleCjsConfig()], diff --git a/e2e/cases/tsconfig/src/foo.ts b/tests/features/tsconfig/src/foo.ts similarity index 100% rename from e2e/cases/tsconfig/src/foo.ts rename to tests/features/tsconfig/src/foo.ts diff --git a/e2e/cases/tsconfig/src/index.ts b/tests/features/tsconfig/src/index.ts similarity index 100% rename from e2e/cases/tsconfig/src/index.ts rename to tests/features/tsconfig/src/index.ts diff --git a/e2e/cases/tsconfig/tsconfig.custom.json b/tests/features/tsconfig/tsconfig.custom.json similarity index 100% rename from e2e/cases/tsconfig/tsconfig.custom.json rename to tests/features/tsconfig/tsconfig.custom.json diff --git a/e2e/package.json b/tests/package.json similarity index 81% rename from e2e/package.json rename to tests/package.json index 0309281bf..63ac8ced2 100644 --- a/e2e/package.json +++ b/tests/package.json @@ -1,9 +1,9 @@ { - "name": "@rslib/e2e", + "name": "@rslib/tests", "private": true, "type": "module", "scripts": { - "test": "playwright test --pass-with-no-tests" + "test:e2e": "playwright test --pass-with-no-tests" }, "dependencies": { "@examples/react-component": "workspace:*", @@ -11,7 +11,6 @@ "react-dom": "^18.3.1" }, "devDependencies": { - "@e2e/helper": "workspace:*", "@playwright/test": "1.47.2", "@rsbuild/core": "1.0.7", "@rsbuild/plugin-react": "1.0.2", @@ -24,6 +23,7 @@ "fast-glob": "^3.3.2", "fs-extra": "^11.2.0", "path-serializer": "0.0.6", - "strip-ansi": "^7.1.0" + "strip-ansi": "^7.1.0", + "test-helper": "workspace:*" } } diff --git a/e2e/playwright.config.ts b/tests/playwright.config.ts similarity index 100% rename from e2e/playwright.config.ts rename to tests/playwright.config.ts diff --git a/e2e/scripts/helper.ts b/tests/scripts/helper.ts similarity index 100% rename from e2e/scripts/helper.ts rename to tests/scripts/helper.ts diff --git a/e2e/scripts/index.ts b/tests/scripts/index.ts similarity index 100% rename from e2e/scripts/index.ts rename to tests/scripts/index.ts diff --git a/e2e/scripts/package.json b/tests/scripts/package.json similarity index 78% rename from e2e/scripts/package.json rename to tests/scripts/package.json index 9b3407516..77f4e201a 100644 --- a/e2e/scripts/package.json +++ b/tests/scripts/package.json @@ -1,5 +1,5 @@ { - "name": "@e2e/helper", + "name": "test-helper", "version": "1.0.0", "private": true, "main": "index.ts", diff --git a/e2e/scripts/rsbuild.ts b/tests/scripts/rsbuild.ts similarity index 100% rename from e2e/scripts/rsbuild.ts rename to tests/scripts/rsbuild.ts diff --git a/e2e/scripts/shared.ts b/tests/scripts/shared.ts similarity index 100% rename from e2e/scripts/shared.ts rename to tests/scripts/shared.ts diff --git a/e2e/setupVitestTests.ts b/tests/setupVitestTests.ts similarity index 100% rename from e2e/setupVitestTests.ts rename to tests/setupVitestTests.ts diff --git a/e2e/tsconfig.json b/tests/tsconfig.json similarity index 100% rename from e2e/tsconfig.json rename to tests/tsconfig.json diff --git a/e2e/vitest.config.ts b/tests/vitest.config.ts similarity index 61% rename from e2e/vitest.config.ts rename to tests/vitest.config.ts index 05c229a9c..a6950a79a 100644 --- a/e2e/vitest.config.ts +++ b/tests/vitest.config.ts @@ -4,9 +4,9 @@ import { shared } from '../vitest.workspace'; export default defineConfig({ test: { ...shared, - name: 'artifact', + name: 'features', setupFiles: ['./setupVitestTests.ts'], - include: ['./cases/**/*.test.ts'], - exclude: ['./cases/**/*.pw.test.ts', '**/node_modules/**'], + include: ['./features/**/*.test.ts'], + exclude: ['**/node_modules/**'], }, }); diff --git a/vitest.workspace.ts b/vitest.workspace.ts index ce5474861..d5cb251d4 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -9,4 +9,4 @@ export const shared: ProjectConfig = { exclude: ['**/node_modules/**'], }; -export default defineWorkspace(['packages/*', 'e2e']); +export default defineWorkspace(['packages/*', 'tests']);