Skip to content

Commit 7e3d68f

Browse files
committed
update
1 parent 6e0a137 commit 7e3d68f

9 files changed

+33
-21
lines changed

docs/api-examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ outline: deep
55
<VueTree>
66
C:/course/
77
textbook/
8-
index.md
9-
index.md
10-
reading.md
11-
site.json
8+
index.md
9+
index.md
10+
reading.md
11+
site.json
1212
</VueTree>
1313

1414
# Runtime API Examples

package-lock.json

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tlylt/vue-tree",
3-
"version": "0.0.3",
3+
"version": "0.0.5",
44
"type": "module",
55
"scripts": {
66
"dev": "vite",
@@ -19,7 +19,7 @@
1919
"vue": "^3.0.0"
2020
},
2121
"devDependencies": {
22-
"@tlylt/vue-tree": "^0.0.3",
22+
"@tlylt/vue-tree": "^0.0.5",
2323
"@types/lodash": "^4.17.16",
2424
"@types/node": "^22.13.10",
2525
"@vitejs/plugin-vue": "^5.2.1",
@@ -49,9 +49,10 @@
4949
],
5050
"exports": {
5151
".": {
52+
"types": "./dist/types/index.d.ts",
5253
"import": "./dist/vue-tree.es.js",
5354
"require": "./dist/vue-tree.umd.js"
5455
},
5556
"./style.css": "./dist/vue-tree.css"
5657
}
57-
}
58+
}

src/App.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import HelloWorld from './components/HelloWorld.vue'
3-
import { VueTree } from './index.ts'
3+
import VueTree from './components/VueTree.vue'
44
5-
// import {VueTree} from '@tlylt/vue-tree'
5+
// import { VueTree } from '@tlylt/vue-tree'
66
// import '@tlylt/vue-tree/style.css'
77
88
</script>
@@ -12,9 +12,10 @@ import { VueTree } from './index.ts'
1212
<VueTree>
1313
C:/course/
1414
textbook/
15-
index.md
15+
index.md
1616
index.md
1717
reading.md
1818
site.json
1919
</VueTree>
20+
2021
</template>

src/components/VueTree.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<script lang="ts">
77
import { defineComponent } from 'vue';
8-
import { TreeNode } from './tree.ts';
8+
import { TreeNode } from './tree';
99
1010
export default defineComponent({
1111
name: 'VueTree',

tsconfig.app.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
"noUnusedLocals": true,
99
"noUnusedParameters": true,
1010
"noFallthroughCasesInSwitch": true,
11-
"noUncheckedSideEffectImports": true
11+
"noUncheckedSideEffectImports": true,
12+
13+
/* Type Declaration */
14+
"noEmit": false, // This is important to generate type declaration files
15+
"emitDeclarationOnly": true, // This prevents the generation of JS files, which is left to vite
16+
"declaration": true,
17+
"declarationMap": true,
18+
"outDir": "dist/types",
19+
"rootDir": "src"
1220
},
13-
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
21+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
22+
"exclude": ["node_modules", "dist"]
1423
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"references": [
44
{ "path": "./tsconfig.app.json" },
55
{ "path": "./tsconfig.node.json" }
6-
]
6+
],
77
}

tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"allowImportingTsExtensions": true,
1212
"isolatedModules": true,
1313
"moduleDetection": "force",
14-
"noEmit": true,
14+
"noEmit": true, // This is important to prevent the generation of JS files
1515

1616
/* Linting */
1717
"strict": true,

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ export default defineConfig({
2828
},
2929
},
3030
},
31+
emptyOutDir: false, // to retain the types folder generated by tsc
3132
},
3233
})

0 commit comments

Comments
 (0)