Skip to content

Commit 310c7dc

Browse files
authored
fix(docs): drop self-closing tags + build system improvements (fixes #2882) (#2893)
* fix(docs): drop self-closing tags + build system improvements * prettify * further remove self-closing tags * remove all remaining self-closing tags * Update table-tfoot-events.spec.js * Update table-thead-events.spec.js * improve docs markup * Update search.vue
1 parent 6f899fc commit 310c7dc

Some content is hidden

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

81 files changed

+1422
-966
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.nuxt/
2+
dist/
3+
docs-dist/
4+
es/
25
node_modules/
36
nuxt/plugin.template.js

.eslintrc.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['standard', 'plugin:vue/recommended', 'plugin:prettier/recommended'],
3-
plugins: ['jest', 'node', 'promise'],
3+
plugins: ['jest', 'markdown', 'node', 'promise'],
44
parserOptions: {
55
parser: 'babel-eslint',
66
sourceType: 'module'
@@ -14,6 +14,16 @@ module.exports = {
1414
Vue: true
1515
},
1616
rules: {
17+
'vue/html-self-closing': [
18+
'error',
19+
{
20+
html: {
21+
void: 'never',
22+
normal: 'never',
23+
component: 'never'
24+
}
25+
}
26+
],
1727
'vue/max-attributes-per-line': ['error', { singleline: 4 }],
1828
'vue/no-template-shadow': 'off',
1929
'vue/no-use-v-if-with-v-for': 'off',

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Thank you to all our backers! 🙏
8989

9090
This project exists thanks to all the people who contribute. [[Contribute]](CONTRIBUTING.md).
9191

92-
<a href="https://github.com/bootstrap-vue/bootstrap-vue/graphs/contributors"><img src="https://opencollective.com/bootstrap-vue/contributors.svg?width=890" /></a>
92+
<a href="https://github.com/bootstrap-vue/bootstrap-vue/graphs/contributors"><img src="https://opencollective.com/bootstrap-vue/contributors.svg?width=890"></a>
9393

9494
<h2 align="center">License</h2>
9595

babel.config.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
module.exports = function(api) {
1+
module.exports = api => {
22
const isDocs = api.env('docs')
33

4+
let presets = []
5+
if (!isDocs) {
6+
presets.push(['@babel/env', { useBuiltIns: 'entry', corejs: { version: 2 } }])
7+
}
8+
49
return {
5-
presets: isDocs ? [] : [['@babel/env', { useBuiltIns: 'entry', corejs: { version: 2 } }]],
10+
presets,
611
env: {
712
es: {
813
plugins: [['@babel/plugin-transform-modules-commonjs', { noInterop: true, loose: true }]]

docs/components/codemirror.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<textarea ref="textArea" :value="value" />
2+
<textarea ref="textArea" :value="value"></textarea>
33
</template>
44

55
<script>

docs/components/componentdoc.vue

+9-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<template>
2-
<section
3-
v-if="component"
4-
class="bd-content"
5-
>
2+
<section v-if="component" class="bd-content">
63
<b-row tag="header" align-v="center">
74
<b-col sm="9">
85
<anchored-heading :id="`comp-ref-${componentName}`" level="2">
@@ -44,7 +41,7 @@
4441
<b-badge variant="warning">
4542
{{ typeof item.deprecated === 'string' ? 'deprecation' : 'deprecated' }}
4643
</b-badge>
47-
<!-- if deprecated is a string, show the string value -->
44+
<!-- If deprecated is a string, show the string value -->
4845
<small v-if="typeof item.deprecated === 'string'">{{ item.deprecated }}</small>
4946
</template>
5047
<template slot="defaultValue" slot-scope="{ value }">
@@ -83,7 +80,7 @@
8380
small
8481
head-variant="default"
8582
striped
86-
/>
83+
></b-table>
8784
</article>
8885

8986
<article v-if="events && events.length > 0">
@@ -113,7 +110,10 @@
113110
<anchored-heading :id="`comp-ref-${componentName}-rootEventListeners`" level="4">
114111
$root Event Listeners
115112
</anchored-heading>
116-
<p>You can control <code>{{ tag }}</code> by emitting the following events on <samp>$root</samp>:</p>
113+
<p>
114+
You can control <code>{{ tag }}</code> by emitting the following events on
115+
<samp>$root</samp>:
116+
</p>
117117
<b-table
118118
:items="rootEventListeners"
119119
:fields="rootEventListenersFields"
@@ -151,9 +151,7 @@ import kebabCase from 'lodash/kebabCase'
151151
import AnchoredHeading from './anchored-heading'
152152
153153
export default {
154-
components: {
155-
AnchoredHeading
156-
},
154+
components: { AnchoredHeading },
157155
props: {
158156
component: {},
159157
slots: {
@@ -206,7 +204,6 @@ export default {
206204
},
207205
propsFields() {
208206
const props = this.componentProps
209-
210207
const hasRequired = Object.keys(props).some(p => props[p].required)
211208
212209
const fields = [
@@ -259,19 +256,15 @@ export default {
259256
260257
// Describe value
261258
let defaultVal = p.default
262-
263259
if (defaultVal instanceof Function && !Array.isArray(defaultVal)) {
264260
defaultVal = defaultVal()
265261
}
266-
267262
if (typeof defaultVal !== 'string') {
268263
defaultVal = JSON.stringify(defaultVal)
269264
}
270-
271265
if (defaultVal === '' || defaultVal === null || defaultVal === 'null') {
272266
defaultVal = ''
273267
}
274-
275268
defaultVal = (defaultVal || '').replace(/"/g, "'")
276269
277270
// Requied prop?
@@ -294,7 +287,7 @@ export default {
294287
return kebabCase(this.component)
295288
},
296289
tag() {
297-
return '<' + this.componentName + '>'
290+
return `<${this.componentName}>`
298291
},
299292
githubURL() {
300293
const base = 'https://github.com/bootstrap-vue/bootstrap-vue/tree/dev/src/components'

docs/components/importdoc.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<p><strong>Example:</strong></p>
2222

23-
<pre class="hljs js text-monospace p-2"><code v-html="componentImportCode" /></pre>
23+
<pre class="hljs js text-monospace p-2"><code v-html="componentImportCode"></code></pre>
2424
</article>
2525
</template>
2626

@@ -41,7 +41,7 @@
4141

4242
<p><strong>Example:</strong></p>
4343

44-
<pre class="hljs js text-monospace p-2"><code v-html="directiveImportCode" /></pre>
44+
<pre class="hljs js text-monospace p-2"><code v-html="directiveImportCode"></code></pre>
4545
</article>
4646
</template>
4747

@@ -59,7 +59,7 @@
5959
This plugin includes all of the above listed individual directives.
6060
</p>
6161

62-
<pre class="hljs js text-monospace p-2"><code v-html="pluginImportCode" /></pre>
62+
<pre class="hljs js text-monospace p-2"><code v-html="pluginImportCode"></code></pre>
6363

6464
<template v-if="meta.plugins && meta.plugins.length > 0">
6565
<p>This plugin also automatically includes the following plugins:</p>
@@ -72,15 +72,13 @@
7272
</template>
7373

7474
<script>
75+
import hljs from 'highlightjs'
7576
import kebabCase from 'lodash/kebabCase'
7677
import startCase from 'lodash/startCase'
77-
import hljs from 'highlightjs'
7878
import AnchoredHeading from './anchored-heading'
7979
8080
export default {
81-
components: {
82-
AnchoredHeading
83-
},
81+
components: { AnchoredHeading },
8482
props: {
8583
meta: {}
8684
},

docs/components/jsfiddle.vue

+11-22
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
:allowtransparency="true"
99
frameborder="0"
1010
:src="src"
11-
/>
12-
<div
13-
v-if="height === 0"
14-
class="text-center"
15-
>
11+
></iframe>
12+
<div v-if="height === 0" class="text-center">
1613
<img src="//jsfiddle.net/img/embeddable/logo-dark.png" alt="jsfiddle">
1714
<br>
1815
<small class="text-muted mt-1">
@@ -66,13 +63,14 @@ export default {
6663
},
6764
computed: {
6865
src() {
69-
let url = `//jsfiddle.net/${this.slug}/embedded/${this.tabs}/${this.theme}?`
70-
;['fontColor', 'accentColor', 'bodyColor', 'menuColor'].forEach(attr => {
66+
const attrs = ['fontColor', 'accentColor', 'bodyColor', 'menuColor']
67+
const baseUrl = `//jsfiddle.net/${this.slug}/embedded/${this.tabs}/${this.theme}?`
68+
return attrs.reduce((url, attr) => {
7169
if (this[attr] && this[attr].length > 0) {
7270
url += `${attr}=${this[attr]}&`
7371
}
74-
})
75-
return url
72+
return url
73+
}, baseUrl)
7674
},
7775
url() {
7876
return `//jsfiddle.net/${this.slug}`
@@ -90,23 +88,14 @@ export default {
9088
},
9189
methods: {
9290
setHeight(data) {
93-
let height
9491
if (this.slug === data.slug) {
95-
height = data.height <= 0 ? 400 : data.height + 50
96-
this.height = height
97-
return height
92+
this.height = data.height <= 0 ? 400 : data.height + 50
9893
}
9994
},
10095
onMessage(event) {
101-
const eventName = event.data[0]
102-
const data = event.data[1]
103-
switch (eventName) {
104-
case 'embed':
105-
return this.setHeight(data)
106-
case 'resultsFrame':
107-
return this.setHeight(data)
108-
default:
109-
break
96+
const [eventName, data] = event.data
97+
if (eventName === 'embed' || eventName === 'resultsFrame') {
98+
this.setHeight(data)
11099
}
111100
}
112101
}

docs/components/nav.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<b-navbar toggleable="md" class="navbar-dark bd-navbar" sticky>
3-
<b-navbar-toggle target="bd-main-nav" />
3+
<b-navbar-toggle target="bd-main-nav"></b-navbar-toggle>
44

55
<b-navbar-brand to="/" exact>
66
<svg
@@ -110,7 +110,7 @@
110110
scrolling="0"
111111
width="100px"
112112
height="20px"
113-
/>
113+
></iframe>
114114
</div>
115115
</b-navbar-nav>
116116
</b-collapse>

0 commit comments

Comments
 (0)