Skip to content

Commit d617d32

Browse files
committed
improve: types
1 parent 4c0eb36 commit d617d32

File tree

6 files changed

+208
-56
lines changed

6 files changed

+208
-56
lines changed

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"module": "dist/vue-rough-notation.esm.js",
1111
"unpkg": "dist/vue-rough-notation.js",
1212
"files": [
13-
"dist/*"
13+
"dist/*",
14+
"types/*"
1415
],
16+
"types": "types/index.d.ts",
1517
"browserslist": [
1618
"> 1%",
1719
"last 2 versions",
@@ -37,10 +39,13 @@
3739
},
3840
"devDependencies": {
3941
"@babel/core": "^7.10.1",
42+
"@babel/plugin-transform-runtime": "^7.10.1",
43+
"@rollup/plugin-babel": "^5.0.2",
44+
"@rollup/plugin-commonjs": "^12.0.0",
45+
"@rollup/plugin-node-resolve": "^8.0.0",
46+
"@rollup/plugin-typescript": "^4.1.2",
47+
"@types/vue": "^2.0.0",
4048
"rollup": "^2.11.2",
41-
"rollup-plugin-babel": "^4.4.0",
42-
"rollup-plugin-commonjs": "^10.1.0",
43-
"rollup-plugin-node-resolve": "^5.2.0",
4449
"rollup-plugin-terser": "^6.1.0"
4550
}
4651
}

rollup.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import path from 'path';
2-
import node from 'rollup-plugin-node-resolve';
3-
import babel from 'rollup-plugin-babel';
2+
import resolve from '@rollup/plugin-node-resolve';
3+
import babel from '@rollup/plugin-babel';
44
import { terser } from 'rollup-plugin-terser';
5-
import cjs from 'rollup-plugin-commonjs';
5+
import commonjs from '@rollup/plugin-commonjs';
66

77
export default () => [
88
getConfig({
@@ -27,9 +27,12 @@ function getConfig ({
2727
format,
2828
},
2929
plugins: [
30-
node(),
31-
cjs(),
32-
babel({ runtimeHelpers: true }),
30+
resolve(),
31+
commonjs(),
32+
babel({
33+
babelHelpers: 'runtime',
34+
plugins: ['@babel/plugin-transform-runtime'],
35+
}),
3336
terser(),
3437
],
3538
};

src/component.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// import { annotate } from 'rough-notation';
2-
import { annotate } from '../node_modules/rough-notation/lib/rough-notation.js';
1+
import { annotate } from 'rough-notation';
32

43
const AVAILABLE_TYPES = [
54
'underline',

types/VueRoughNotation.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { PluginObject } from "vue";
2+
3+
export interface VueRoughNotationPluginObject extends PluginObject<any> {};

types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { VueRoughNotationPluginObject } from './VueRoughNotation';
2+
3+
declare var VueRoughNotation: VueRoughNotationPluginObject;
4+
export default VueRoughNotation;

0 commit comments

Comments
 (0)