Skip to content

Commit 00e950c

Browse files
committed
fix(cli): restore binding aliases and cache snaps
1 parent 9f72b51 commit 00e950c

6 files changed

Lines changed: 28 additions & 32 deletions

File tree

packages/cli/binding/index.d.cts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
/* auto-generated by NAPI-RS */
2-
/* eslint-disable */
1+
type BindingErrorsOr<T> = T | BindingErrors;
2+
type FxHashSet<T> = Set<T>;
3+
type FxHashMap<K, V> = Map<K, V>;
4+
type MaybePromise<T> = T | Promise<T>;
5+
type Nullable<T> = T | null | undefined;
6+
type VoidNullable<T = void> = T | null | undefined | void;
7+
export type BindingStringOrRegex = string | RegExp;
8+
export type BindingResult<T> = { errors: BindingError[]; isBindingErrors: boolean } | T;
9+
310
export interface CodegenOptions {
411
/**
512
* Remove whitespace.

packages/cli/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ async function buildNapiBinding() {
8383

8484
const cli = new NapiCli();
8585

86-
const dtsHeader = process.env.RELEASE_BUILD
86+
const bindingFeatures = ['rolldown'];
87+
const dtsHeader = bindingFeatures.includes('rolldown')
8788
? (await import('../../rolldown/packages/rolldown/package.json', { with: { type: 'json' } }))
8889
.default.napi.dtsHeader
8990
: '';
@@ -100,7 +101,7 @@ async function buildNapiBinding() {
100101
jsBinding: 'index.cjs',
101102
dts: 'index.d.cts',
102103
release: process.env.VP_CLI_DEBUG !== '1',
103-
features: ['rolldown'],
104+
features: bindingFeatures,
104105
});
105106

106107
const outputs = await task;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "module",
33
"scripts": {
4-
"hello": "vp fmt"
4+
"hello": "node -e \"console.log('hello')\""
55
}
66
}
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
> vp run hello # create the cache for 'echo hello'
2-
$ vp fmt
3-
Finished in <variable>ms on 4 files using <variable> threads.
2+
$ node -e "console.log('hello')"
3+
hello
44

5-
---
6-
vp run: hello not cached because it modified its input. (Run `vp run --last-details` for full details)
75

86
> vp run hello # hit the cache
9-
$ vp fmt
10-
Finished in <variable>ms on 4 files using <variable> threads.
7+
$ node -e "console.log('hello')" ◉ cache hit, replaying
8+
hello
119

1210
---
13-
vp run: hello not cached because it modified its input. (Run `vp run --last-details` for full details)
11+
vp run: cache hit, <variable>ms saved.
1412

1513
> vp cache clean # clean the cache
1614
> vp run hello # cache miss after clean
17-
$ vp fmt
18-
Finished in <variable>ms on 4 files using <variable> threads.
19-
20-
---
21-
vp run: hello not cached because it modified its input. (Run `vp run --last-details` for full details)
15+
$ node -e "console.log('hello')"
16+
hello
2217

2318
> cd subfolder && vp cache clean # cache can be located and cleaned from subfolder
2419
> vp run hello # cache miss after clean
25-
$ vp fmt
26-
Finished in <variable>ms on 4 files using <variable> threads.
27-
28-
---
29-
vp run: hello not cached because it modified its input. (Run `vp run --last-details` for full details)
20+
$ node -e "console.log('hello')"
21+
hello
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
> vp run lint
2-
$ vp lint
3-
Found 0 warnings and 0 errors.
4-
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
2+
$ node -e "console.log('lint')"
3+
lint
54

6-
---
7-
vp run: lint not cached because it modified its input. (Run `vp run --last-details` for full details)
85

96
> mkdir dist
107
> vp run lint # new dist folder should not invalidate cache
11-
$ vp lint
12-
Found 0 warnings and 0 errors.
13-
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
8+
$ node -e "console.log('lint')" ◉ cache hit, replaying
9+
lint
1410

1511
---
16-
vp run: lint not cached because it modified its input. (Run `vp run --last-details` for full details)
12+
vp run: cache hit, <variable>ms saved.

packages/cli/snap-tests/ignore_dist/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
run: {
33
tasks: {
44
lint: {
5-
command: 'vp lint',
5+
command: 'node -e "console.log(\'lint\')"',
66
},
77
},
88
},

0 commit comments

Comments
 (0)