Skip to content

Commit 4fd6e56

Browse files
Brooooooklynfengmk2
authored andcommitted
adjust exports
1 parent 813474d commit 4fd6e56

8 files changed

Lines changed: 11 additions & 8 deletions

File tree

packages/cli/src/__tests__/__snapshots__/runCommand.spec.ts.snap renamed to packages/cli/binding/__tests__/__snapshots__/run-command.spec.ts.snap

File renamed without changes.

packages/cli/src/__tests__/runCommand.spec.ts renamed to packages/cli/binding/__tests__/run-command.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'node:path';
44

55
import { expect, test } from 'vitest';
66

7-
import { runCommand } from '../binding.js';
7+
import { runCommand } from '../index.js';
88

99
test('should run command successfully', async () => {
1010
const result = await runCommand({

packages/cli/build.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function buildNapiBinding() {
4646

4747
async function buildCli() {
4848
await build({
49-
input: ['./src/bin.ts', './src/index.ts', './src/config.ts', './src/binding.ts'],
49+
input: ['./src/bin.ts', './src/index.ts', './src/config.ts'],
5050
external: [/^node:/, 'vitest-dev', './vitest/dist/config.js', './vitest/dist/index.js'],
5151
plugins: [
5252
{
@@ -89,6 +89,8 @@ async function buildCli() {
8989
});
9090

9191
await cp(join(rolldownViteSourceDir, 'client.d.ts'), join(projectDir, 'dist', 'vite', 'client.d.ts'));
92+
await cp(join(projectDir, 'binding', 'index.d.ts'), join(projectDir, 'dist', 'binding.d.ts'));
93+
await cp(join(projectDir, 'binding', 'index.js'), join(projectDir, 'dist', 'binding.js'));
9294
}
9395

9496
async function buildVite() {

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"import": "./dist/index.js",
1212
"types": "./dist/index.d.ts"
1313
},
14+
"./bin": {
15+
"import": "./dist/bin.js"
16+
},
1417
"./binding": {
1518
"import": "./dist/binding.js",
1619
"types": "./dist/binding.d.ts"
1720
},
18-
"./bin": {
19-
"import": "./dist/bin.js"
20-
},
2121
"./browser": {
2222
"types": "./dist/vitest/browser/context.d.ts",
2323
"default": "./dist/vitest/browser/context.js"

packages/cli/src/binding.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/cli/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"skipLibCheck": true,
1111
"rootDir": "./src",
1212
"experimentalDecorators": true,
13-
"customConditions": ["dev"]
13+
"customConditions": ["dev"],
14+
"preserveSymlinks": true
1415
},
1516
"include": ["src"],
1617
"exclude": ["node_modules", "dist/**/*"]

packages/tools/src/sync-remote-deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ function mergePackageExports(
432432
const cliOwnExports = new Set([
433433
'.',
434434
'./bin',
435+
'./binding',
435436
'./test',
436437
'./client',
437438
'./vite',

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default defineConfig({
1313
'./rolldown/**',
1414
'./rolldown-vite/**',
1515
// FIXME: Error: failed to prepare the command for injection: Invalid argument (os error 22)
16-
'packages/cli/src/__tests__/',
16+
'packages/cli/binding/__tests__/',
1717
],
1818
},
1919
});

0 commit comments

Comments
 (0)