Skip to content

Commit 3828f59

Browse files
authored
feat(build): remove deprecated es/ build (#3604)
1 parent 1737072 commit 3828f59

Some content is hidden

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

104 files changed

+395
-639
lines changed

docs/components/importdoc.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@
125125

126126
<aside class="alert alert-warning my-4">
127127
<p class="mb-0">
128-
<b-badge variant="warning" tag="strong">Deprecation Warning as of v2.0.0-rc.22:</b-badge>
128+
<b-badge variant="warning" tag="strong">CHANGED as of v2.0.0:</b-badge>
129129
Importing components, directives and plugins from
130130
<code class="notranslate" translate="no">bootstrap-vue/es/*</code>
131-
has been deprecated. All components, directives and plugins are now available as top-level named
131+
has been removed. All components, directives and plugins are now available as top-level named
132132
exports in the <code class="notranslate" translate="no">ESM</code> and
133133
<code class="notranslate" translate="no">CommonJS</code> builds. The
134-
<code class="notranslate" translate="no">es/</code> directory build will be removed in a future
135-
release.
134+
<code class="notranslate" translate="no">es/</code> directory build has been removed.
136135
</p>
137136
</aside>
138137
</section>
@@ -144,6 +143,8 @@ import kebabCase from 'lodash/kebabCase'
144143
import startCase from 'lodash/startCase'
145144
import AnchoredHeading from './anchored-heading'
146145
146+
const importPath = 'bootstrap-vue'
147+
147148
export default {
148149
name: 'BDVImportdoc',
149150
components: { AnchoredHeading },
@@ -212,9 +213,8 @@ export default {
212213
},
213214
directiveImportCode() {
214215
const firstDirective = this.directives[0]
215-
const firstDirectiveImport = this.directiveImports[0]
216216
return [
217-
`import { ${firstDirective} } from '${firstDirectiveImport.importPath}'`,
217+
`import { ${firstDirective} } from '${importPath}'`,
218218
"// Note: Vue automatically prefixes the directive name with 'v-'",
219219
`Vue.directive('${this.directiveName(firstDirective)}', ${firstDirective})`
220220
].join('\n')

scripts/build.sh

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,20 @@ echo 'Done.'
1313
echo ''
1414

1515
# Cleanup
16-
rm -rf dist es esm
16+
rm -rf dist esm
1717

1818
echo 'Compile JS...'
1919
rollup -c scripts/rollup.config.js
2020
echo 'Done.'
2121
echo ''
2222

23-
echo 'Build ESM modules...'
23+
echo 'Compiling ESM modular build...'
2424
NODE_ENV=esm babel src --out-dir esm --ignore 'src/**/*.spec.js'
25-
rm -f esm/legacy-es.js esm/browser.js
25+
rm -f esm/browser.js
2626
echo "${BV_BANNER}" | cat - esm/index.js > esm/tmp.js && mv -f esm/tmp.js esm/index.js
2727
echo 'Done.'
2828
echo ''
2929

30-
echo 'Build ES modules (deprecated)...'
31-
NODE_ENV=es babel src --out-dir es --ignore 'src/**/*.spec.js'
32-
rm -f es/index.js es/browser.js
33-
echo "${BV_BANNER}" | cat - es/legacy-es.js > es/index.js
34-
rm -f es/legacy-es.js
35-
echo 'Done.'
36-
echo ''
37-
3830
echo 'Minify JS...'
3931
terser dist/bootstrap-vue.js \
4032
--compress typeofs=false \
@@ -78,29 +70,16 @@ echo 'Done.'
7870
echo ''
7971

8072
echo 'Copying types from src/ to esm/ ...'
81-
# There must be a better way to do this
73+
# This may no longer be needed, as all exports are at top level now.
8274
#
83-
# The following does not preserve the paths
84-
# shopt -s globstar
85-
# cp src/**/*.d.ts es
86-
#
87-
# So we resort to a find with exec
88-
cd src
89-
find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';'
90-
cd ..
91-
echo 'Done.'
92-
echo ''
93-
94-
echo 'Copying types from src/ to es/ ...'
9575
# There must be a better way to do this
96-
#
9776
# The following does not preserve the paths
9877
# shopt -s globstar
9978
# cp src/**/*.d.ts es
10079
#
10180
# So we resort to a find with exec
10281
cd src
103-
find . -type f -name '*.d.ts' -exec cp {} ../es/{} ';'
82+
find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';'
10483
cd ..
10584
echo 'Done.'
10685
echo ''

src/bv-config.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ import Vue, { PluginFunction, PluginObject } from 'vue'
22
import { BvPlugin } from './'
33

44
export declare const BVConfigPlugin: BvPlugin
5-
export default BVConfigPlugin

src/bv-config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
//
44
import { pluginFactory } from './utils/plugins'
55

6-
const BVConfigPlugin = /*#__PURE__*/ pluginFactory()
7-
8-
export default BVConfigPlugin
6+
export const BVConfigPlugin = /*#__PURE__*/ pluginFactory()

src/components/alert/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'
66

77
// Plugin
88
export declare const AlertPlugin: BvPlugin
9-
export default AlertPlugin
109

1110
// Component: b-alert
1211
export declare class BAlert extends BvComponent {

src/components/alert/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ const AlertPlugin = /*#__PURE__*/ pluginFactory({
66
})
77

88
export { AlertPlugin, BAlert }
9-
10-
export default AlertPlugin

src/components/badge/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'
66

77
// Plugin
88
export declare const BadgePlugin: BvPlugin
9-
export default BadgePlugin
109

1110
// Component: b-badge
1211
export declare class BBadge extends BvComponent {}

src/components/badge/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ const BadgePlugin = /*#__PURE__*/ pluginFactory({
66
})
77

88
export { BadgePlugin, BBadge }
9-
10-
export default BadgePlugin

src/components/breadcrumb/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'
66

77
// Plugin
88
export declare const BreadcrumbPlugin: BvPlugin
9-
export default BreadcrumbPlugin
109

1110
// Component: b-breadcrumb
1211
export declare class BBreadcrumb extends BvComponent {}

src/components/breadcrumb/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ const BreadcrumbPlugin = /*#__PURE__*/ pluginFactory({
88
})
99

1010
export { BreadcrumbPlugin, BBreadcrumb, BBreadcrumbItem, BBreadcrumbLink }
11-
12-
export default BreadcrumbPlugin

0 commit comments

Comments
 (0)