Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 4dd8d4f

Browse files
committed
refactor: move docs to app and add playground
playground contains app.vue and moved docs to app as well. This commit doesn't seem to have things be working yet. playground/app.vue is not running correctly
1 parent 1798fe4 commit 4dd8d4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+370
-148
lines changed

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
auto-install-peers=true
2+
strict-peer-dependencies=false

packages/docs/.vuepress/client.ts renamed to apps/docs/.vuepress/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {h} from 'vue'
77
export default defineClientConfig({
88
async enhance({app, router, siteData}) {
99
if (!__VUEPRESS_SSR__) {
10-
const {BootstrapVue3, BToastPlugin} = await import('../../bootstrap-vue-3/dist/bootstrap-vue-3.es')
10+
const {BootstrapVue3, BToastPlugin} = await import('../../../packages/bootstrap-vue-3/dist/bootstrap-vue-3.es')
1111
app.use(BootstrapVue3)
1212
app.use(BToastPlugin, {BToast: {injectkey: 'toast'}})
1313
app.component('doc-reference', DocReference)
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "tsconfig/base.json",
33
"compilerOptions": {
4-
"types": ["vitest/globals", "@vuepress/client/types", "vite/client"]
4+
"types": ["@vuepress/client/types", "vite/client"]
55
},
66
"include": ["./**/*.ts", "./**/*.vue", ".vuepress/**/*.ts", ".vuepress/**/*.vue"]
77
}

apps/playground/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

apps/playground/README.md

+16

apps/playground/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue + TS</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

apps/playground/package.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "playground",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc --noEmit && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"bootstrap-vue-3": "workspace:*",
13+
"bootstrap": "5.x.x",
14+
"vue": "^3.2.37",
15+
"vue-router": "4.x.x"
16+
},
17+
"devDependencies": {
18+
"@vitejs/plugin-vue": "^3.0.0",
19+
"tsconfig": "workspace:*",
20+
"typescript": "^4.6.4",
21+
"vite": "^3.0.0",
22+
"vue-tsc": "^0.38.4"
23+
}
24+
}

apps/playground/public/vite.svg

+1

packages/bootstrap-vue-3/src/App.vue renamed to apps/playground/src/App.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -1891,10 +1891,13 @@ import {
18911891
Ref,
18921892
ref,
18931893
} from 'vue'
1894-
import {useBreadcrumb} from './composables/useBreadcrumb'
1895-
import type {TableField, TableItem} from './types'
1896-
import {BvEvent} from './utils/bvEvent'
1897-
import {ToastInstance, useToast} from './components/BToast/plugin'
1894+
import {useBreadcrumb} from '../../../packages/bootstrap-vue-3/src/composables/useBreadcrumb'
1895+
import type {TableField, TableItem} from '../../../packages/bootstrap-vue-3/src/types'
1896+
import {BvEvent} from '../../../packages/bootstrap-vue-3/src/utils/bvEvent'
1897+
import {
1898+
ToastInstance,
1899+
useToast,
1900+
} from '../../../packages/bootstrap-vue-3/src/components/BToast/plugin'
18981901

18991902
export default defineComponent({
19001903
name: 'App',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
4+
defineProps<{ msg: string }>()
5+
6+
const count = ref(0)
7+
</script>
8+
9+
<template>
10+
<h1>{{ msg }}</h1>
11+
12+
<div class="card">
13+
<button type="button" @click="count++">count is {{ count }}</button>
14+
<p>
15+
Edit
16+
<code>components/HelloWorld.vue</code> to test HMR
17+
</p>
18+
</div>
19+
20+
<p>
21+
Check out
22+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
23+
>create-vue</a
24+
>, the official Vue + Vite starter
25+
</p>
26+
<p>
27+
Install
28+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
29+
in your IDE for a better DX
30+
</p>
31+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
32+
</template>
33+
34+
<style scoped>
35+
.read-the-docs {
36+
color: #888;
37+
}
38+
</style>

apps/playground/src/main.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {createApp} from 'vue'
2+
import App from './App.vue'
3+
import {BootstrapVue3, BToastPlugin} from 'bootstrap-vue-3'
4+
5+
import 'bootstrap/dist/css/bootstrap.css'
6+
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
7+
8+
createApp(App).use(BootstrapVue3).use(BToastPlugin).mount('#app')

packages/bootstrap-vue-3/src/shims-vue.d.ts renamed to apps/playground/src/vite-env.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* eslint-disable */
1+
/// <reference types="vite/client" />
2+
23
declare module '*.vue' {
34
import type {DefineComponent} from 'vue'
45
const component: DefineComponent<{}, {}, any>

apps/playground/tsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "tsconfig/base.json",
3+
"compilerOptions": {
4+
"types": ["vite/client"]
5+
},
6+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],
7+
"references": [{ "path": "./tsconfig.node.json" }]
8+
}

apps/playground/tsconfig.node.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
7+
},
8+
"include": ["vite.config.ts"]
9+
}

apps/playground/vite.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [vue()]
7+
})

package.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"private": true,
33
"workspaces": [
4-
"packages/*"
4+
"packages/*",
5+
"apps/*"
56
],
67
"scripts": {
78
"audit": "improved-yarn-audit --ignore-dev-deps --min-severity moderate",
@@ -12,6 +13,14 @@
1213
"prepare": "husky install && turbo run build"
1314
},
1415
"devDependencies": {
16+
"@typescript-eslint/eslint-plugin": "5.x.x",
17+
"@typescript-eslint/parser": "5.x.x",
18+
"@vue/eslint-config-typescript": "10.x.x",
19+
"eslint": "8.x.x",
20+
"eslint-config-prettier": "8.x.x",
21+
"eslint-plugin-prettier": "^4.0.0",
22+
"eslint-plugin-vue": "8.x.x",
23+
"prettier": "^2.3.2",
1524
"husky": "^7.0.2",
1625
"improved-yarn-audit": "3.x.x",
1726
"lint-staged": "12.x.x",

packages/bootstrap-vue-3/package.json

+5-16
Original file line numberDiff line numberDiff line change
@@ -29,44 +29,33 @@
2929
"dev": "vite",
3030
"build": "vue-tsc --noEmit && vite build",
3131
"serve": "vite preview",
32-
"docs:dev": "pnpm exec --workspace=docs vuepress dev docs",
33-
"docs:build": "pnpm exec --workspace=docs vuepress build .",
3432
"lint": "eslint --ext .js,.vue --ignore-path ../../.gitignore --fix src",
3533
"format": "prettier . --write",
36-
"docs:deploy": "./scripts/deploy.sh",
3734
"test": "pnpm run test:lint && pnpm run test:unit",
3835
"test:lint": "pnpm run lint",
3936
"test:unit": "vitest",
4037
"publish": "pnpm publish --tag develop"
4138
},
4239
"peerDependencies": {
43-
"bootstrap": "5.x.x"
44-
},
45-
"dependencies": {
40+
"bootstrap": "5.x.x",
4641
"vue": "3.x.x"
4742
},
4843
"devDependencies": {
49-
"bootstrap": "5.x.x",
50-
"tsconfig": "workspace:*",
5144
"@types/bootstrap": "5.x.x",
52-
"@typescript-eslint/eslint-plugin": "5.x.x",
53-
"@typescript-eslint/parser": "5.x.x",
5445
"@vitejs/plugin-vue": "2.x.x",
55-
"@vue/eslint-config-typescript": "10.x.x",
5646
"@vue/test-utils": "^2.0.0-rc.18",
57-
"eslint": "8.x.x",
58-
"eslint-config-prettier": "8.x.x",
59-
"eslint-plugin-prettier": "^4.0.0",
60-
"eslint-plugin-vue": "8.x.x",
47+
"bootstrap": "5.x.x",
48+
"@popperjs/core": "^2.x.x",
6149
"jsdom": "^19.0.0",
62-
"prettier": "^2.3.2",
6350
"rollup": "^2.76.0",
6451
"rollup-plugin-visualizer": "5.x.x",
6552
"sass": "1.x.x",
53+
"tsconfig": "workspace:*",
6654
"typescript": "4.x.x",
6755
"vite": "2.x.x",
6856
"vite-plugin-dts": "1.x.x",
6957
"vitest": "^0.10.4",
58+
"vue": "3.x.x",
7059
"vue-router": "4.x.x",
7160
"vue-tsc": "^0.37.2"
7261
},

packages/bootstrap-vue-3/src/main.ts

-53
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.vue' {
4+
import type {DefineComponent} from 'vue'
5+
const component: DefineComponent<{}, {}, any>
6+
export default component
7+
}

packages/bootstrap-vue-3/tests/setup.ts

Whitespace-only changes.
+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"extends": "tsconfig/base.json",
3+
"compilerOptions": {
4+
"types": ["vitest/globals", "vite/client"]
5+
},
36
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],
7+
"references": [{"path": "./tsconfig.node.json"}]
48
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
7+
},
8+
"include": ["vite.config.ts"]
9+
}

packages/tsconfig/base.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
23
"compilerOptions": {
3-
"target": "es2019",
4-
"module": "esnext",
4+
"target": "ESNext",
5+
"useDefineForClassFields": true,
6+
"module": "ESNext",
7+
"moduleResolution": "Node",
58
"strict": true,
69
"jsx": "preserve",
7-
"importHelpers": true,
8-
"moduleResolution": "node",
9-
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"resolveJsonModule": true,
12+
"isolatedModules": true,
1013
"esModuleInterop": true,
14+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
15+
"skipLibCheck": true,
16+
"importHelpers": true,
1117
"allowSyntheticDefaultImports": true,
12-
"forceConsistentCasingInFileNames": true,
13-
"sourceMap": true,
14-
"baseUrl": ".",
15-
"types": ["vitest/globals", "vite/client"],
16-
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
18+
"forceConsistentCasingInFileNames": true
1719
},
1820
"exclude": ["node_modules"],
1921
"vueCompilerOptions": {

0 commit comments

Comments
 (0)