Skip to content

Commit cfdc11a

Browse files
committed
chore: fix build
1 parent e829b1e commit cfdc11a

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-class-setup",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"main": "dist/index.cjs.js",
55
"module": "dist/index.es.js",
66
"types": "dist/index.d.ts",
@@ -56,6 +56,6 @@
5656
"vite-plugin-dts": "^1.4.0",
5757
"vitest": "^0.20.2",
5858
"vue": "^3.2.37",
59-
"vue-tsc": "^0.39.4"
59+
"vue-tsc": "^0.40.1"
6060
}
6161
}

src/define.ts

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type DefineInstanceType<
3333

3434
export interface DefineConstructor {
3535
inject: typeof Context['inject'];
36+
use: typeof Context['use'];
3637
setup: typeof Context['setup'];
3738
setupOptions: typeof Context['setupOptions'];
3839
setupDefine: boolean;

src/setup.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { setupReference } from './setup-reference';
1414
import { getPropertyDescriptors } from './property-descriptors';
1515

1616
export type TargetConstructor = {
17+
use: typeof Context['use'];
1718
inject: typeof Context['inject'];
1819
setup: typeof Context['setup'];
1920
setupOptions: typeof Context['setupOptions'];

tests/use.spec.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ import Use from './use.vue';
55

66
test('Use', async () => {
77
const wrapper = mount(Use);
8-
console.log('>>>>>.', wrapper.html());
98
assert.equal(wrapper.find('.text').text(), '0');
109
assert.equal(wrapper.find('.text-eq').text(), 'true');
1110

1211
await wrapper.find('button').trigger('click');
1312

1413
assert.equal(wrapper.find('.text').text(), '1');
1514
assert.equal(wrapper.find('.text-eq').text(), 'true');
15+
16+
wrapper.vm.addValue();
17+
await wrapper.vm.$nextTick();
18+
19+
assert.equal(wrapper.find('.text').text(), '2');
20+
assert.equal(wrapper.find('.text-eq').text(), 'true');
1621
});

vite.config.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ export default defineConfig({
1818
},
1919
plugins: [
2020
vue2(),
21-
dts(),
21+
dts({
22+
afterDiagnostic(list) {
23+
if (list.length) {
24+
process.exit(1);
25+
}
26+
}
27+
}),
2228
{
2329
name: 'build-docs',
2430
buildEnd: buildDocs,

0 commit comments

Comments
 (0)