WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit df1a0fc

Browse files
committed
refactor: generate dts by vite plugin
1 parent 6b7d9b7 commit df1a0fc

File tree

6 files changed

+102
-98
lines changed

6 files changed

+102
-98
lines changed

api-extractor.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

package.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,41 @@
99
"files": [
1010
"dist"
1111
],
12-
"types": "dist/repl.d.ts",
12+
"types": "dist/vue-repl.d.ts",
1313
"exports": {
1414
".": {
15-
"types": "./dist/repl.d.ts",
15+
"types": "./dist/vue-repl.d.ts",
1616
"import": "./dist/vue-repl.js",
1717
"require": "./dist/ssr-stub.js"
1818
},
1919
"./monaco-editor": {
20-
"types": "./dist/editor-types.d.ts",
20+
"types": "./dist/monaco-editor.d.ts",
2121
"import": "./dist/monaco-editor.js",
2222
"require": null
2323
},
2424
"./codemirror-editor": {
25-
"types": "./dist/editor-types.d.ts",
25+
"types": "./dist/codemirror-editor.d.ts",
2626
"import": "./dist/codemirror-editor.js",
2727
"require": null
2828
},
2929
"./style.css": "./dist/style.css",
3030
"./dist/style.css": "./dist/style.css"
3131
},
32+
"typesVersions": {
33+
"*": {
34+
"*": [
35+
"./dist/*",
36+
"./*"
37+
]
38+
}
39+
},
3240
"scripts": {
3341
"dev": "vite",
3442
"build": "vite build",
35-
"build-types": "vue-tsc -p tsconfig.build.json && api-extractor run -c api-extractor.json && node scripts/cleanup.js",
3643
"build-preview": "vite build -c vite.preview.config.ts",
3744
"format": "prettier --write .",
3845
"release": "bumpp -r",
39-
"prepublishOnly": "npm run build && npm run build-types"
46+
"prepublishOnly": "npm run build"
4047
},
4148
"simple-git-hooks": {
4249
"pre-commit": "pnpm exec lint-staged --concurrent false"
@@ -58,7 +65,6 @@
5865
"homepage": "https://github.com/vuejs/repl#readme",
5966
"devDependencies": {
6067
"@babel/types": "^7.23.3",
61-
"@microsoft/api-extractor": "^7.38.3",
6268
"@rollup/plugin-replace": "^5.0.5",
6369
"@types/codemirror": "^5.60.13",
6470
"@types/node": "^20.9.0",
@@ -82,6 +88,7 @@
8288
"sucrase": "^3.34.0",
8389
"typescript": "^5.2.2",
8490
"vite": "^4.5.0",
91+
"vite-plugin-dts": "^3.6.3",
8592
"vue": "^3.3.8",
8693
"vue-tsc": "1.9.0-alpha.3"
8794
}

pnpm-lock.yaml

Lines changed: 81 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/cleanup.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

tsconfig.build.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Plugin, mergeConfig } from 'vite'
2+
import dts from 'vite-plugin-dts'
23
import base from './vite.preview.config'
34

45
const genStub: Plugin = {
@@ -14,7 +15,12 @@ const genStub: Plugin = {
1415
}
1516

1617
export default mergeConfig(base, {
17-
plugins: [genStub],
18+
plugins: [
19+
dts({
20+
rollupTypes: true,
21+
}),
22+
genStub,
23+
],
1824
optimizeDeps: {
1925
// avoid late discovered deps
2026
include: [

0 commit comments

Comments
 (0)