Skip to content

Commit 7bb3e39

Browse files
committed
Chore(ts): house keeping
1 parent 9ee6e9e commit 7bb3e39

10 files changed

+56
-27
lines changed

.npmignore

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.idea
2-
.gitignore
3-
node_modules/
4-
src/
5-
docs/
6-
test/
7-
*.log
8-
.tmp
1+
# Ignore everything
2+
*
3+
4+
# Don't ignore the dist/ folder's content
5+
!dist/*
6+
7+
# Don't ignore the package.json file
8+
!package.json

docs/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ export default {
127127
import {inject} from "vue";
128128
const $dialog = inject('$dialog')
129129
const openDialog = () => $dialog.alert('Hello world!')
130-
return { openDialog }
131130
</script>
132131
```
133132

package.json

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
{
22
"name": "vuejs-dialog",
3-
"version": "2.0.0-rc1",
4-
"private": true,
3+
"version": "2.0.0-rc.0",
54
"type": "module",
65
"engines": {
76
"node": ">=20"
87
},
98
"main": "./dist/vuejs-dialog.es.js",
109
"typings": "./dist/vuejs-dialog.d.ts",
10+
"repository": {
11+
"type": "git",
12+
"url": "git+ssh://git@github.com/Godofbrowser/vuejs-dialog.git"
13+
},
14+
"author": {
15+
"name": "Ajeh Emeke",
16+
"email": "ajemeke@gmail.com"
17+
},
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/Godofbrowser/vuejs-dialog/issues"
21+
},
22+
"homepage": "https://github.com/Godofbrowser/vuejs-dialog#readme",
23+
"keywords": [
24+
"vue",
25+
"vuejs",
26+
"confirm",
27+
"dialog",
28+
"alert",
29+
"simple",
30+
"loading-dialog",
31+
"hard-confirm",
32+
"soft-confirm"
33+
],
1134
"scripts": {
1235
"lib:build": "vite build --config vite-lib.config.ts && tail -n +3 src/plugin/vue-shim.d.ts >> dist/vuejs-dialog.d.ts",
1336
"docs:dev": "vuepress dev docs",

pnpm-lock.yaml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugin/components/DialogApp.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import DialogWindow from './DialogWindow.vue'
1616
import {firstIndex} from '../utilities'
1717
import {defineComponent} from "vue";
18-
import {DialogWindowOptions} from "@/plugin/interface";
18+
import {DialogWindowOptions} from "../interface";
1919
2020
const deleteByIndex = (arr, idx) => arr.filter((_, i) => i !== idx);
2121

src/plugin/components/OkButton.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import BtnLoader from './ButtonLoader.vue'
1414
import {defineComponent, PropType} from "vue";
1515
import {CONFIRM_TYPES} from "../constants";
16-
import {ButtonStateInterface, DialogWindowOptions} from "@/plugin/interface.js";
16+
import {ButtonStateInterface, DialogWindowOptions} from "../../plugin/interface.js";
1717
1818
export default defineComponent({
1919
name: "OkButton",

src/plugin/promise.dialog.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export class PromiseDialog {
2020
private dgApp: App;
2121
private dgAppComponentInstance: ComponentInstance<DialogComponent>;
2222

23+
/**
24+
* @internal
25+
*/
2326
private mounted = false;
2427

2528

@@ -63,6 +66,10 @@ export class PromiseDialog {
6366
})
6467
}
6568

69+
70+
/**
71+
* @internal
72+
*/
6673
private mountIfNotMounted(): void {
6774
if (this.mounted) return
6875

@@ -97,9 +104,6 @@ export class PromiseDialog {
97104
*/
98105
private static dialogInstance: PromiseDialog
99106

100-
/**
101-
* @internal
102-
*/
103107
public static install(app: App<Element>, options?: DialogPluginOptions) {
104108
if (PromiseDialog.dialogInstance) {
105109
PromiseDialog.dialogInstance.destroy()

src/plugin/vue-shim.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {PromiseDialog} from "./promise.dialog";
2+
3+
declare module 'vue' {
4+
export interface ComponentCustomProperties {
5+
$dialog: typeof PromiseDialog;
6+
}
7+
}

tsconfig.app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"src/**/*.d.ts",
66
"src/**/*",
77
"src/**/*.vue",
8-
"node_modules/@vue/runtime-core/dist/runtime-core.d.ts"
8+
"node_modules/.pnpm/@vue+runtime-core@3.5.3/node_modules/@vue/runtime-core/dist/runtime-core.d.ts"
99
],
1010
"exclude": ["src/**/__tests__/*"],
1111
"compilerOptions": {

vite-lib.config.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { resolve } from 'path';
22
import { defineConfig } from 'vite';
33
import viteConfig from "./vite.config";
44
import {mergeConfig} from "vitest/config";
5-
// import dtsPlugin from "vite-plugin-dts";
5+
import dtsPlugin from "vite-plugin-dts";
66
import pkg from './package.json'
77

88
const packageName = pkg.name;
@@ -31,21 +31,17 @@ export default mergeConfig(
3131
vue: 'Vue',
3232
},
3333
assetFileNames: (assetInfo) => {
34-
// console.log('#'.repeat(45), ' assetInfo: ', assetInfo)
3534
if (assetInfo.name == "style.css") return packageName +".min.css";
3635
return assetInfo.name;
3736
},
3837
},
3938
},
4039
},
4140
plugins: [
42-
// dtsPlugin({
43-
// rollupTypes: true,
44-
// copyDtsFiles: true,
45-
// beforeWriteFile(filePath, content) {
46-
// return { filePath, content }
47-
// }
48-
// }),
41+
dtsPlugin({
42+
rollupTypes: true,
43+
copyDtsFiles: true,
44+
}),
4945
]
5046
}
5147
))

0 commit comments

Comments
 (0)