Skip to content

Commit

Permalink
feat(build): remove deprecated es/ build (#3604)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorehouse committed Aug 13, 2019
1 parent 1737072 commit 3828f59
Show file tree
Hide file tree
Showing 104 changed files with 395 additions and 639 deletions.
12 changes: 6 additions & 6 deletions docs/components/importdoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,13 @@

<aside class="alert alert-warning my-4">
<p class="mb-0">
<b-badge variant="warning" tag="strong">Deprecation Warning as of v2.0.0-rc.22:</b-badge>
<b-badge variant="warning" tag="strong">CHANGED as of v2.0.0:</b-badge>
Importing components, directives and plugins from
<code class="notranslate" translate="no">bootstrap-vue/es/*</code>
has been deprecated. All components, directives and plugins are now available as top-level named
has been removed. All components, directives and plugins are now available as top-level named
exports in the <code class="notranslate" translate="no">ESM</code> and
<code class="notranslate" translate="no">CommonJS</code> builds. The
<code class="notranslate" translate="no">es/</code> directory build will be removed in a future
release.
<code class="notranslate" translate="no">es/</code> directory build has been removed.
</p>
</aside>
</section>
Expand All @@ -144,6 +143,8 @@ import kebabCase from 'lodash/kebabCase'
import startCase from 'lodash/startCase'
import AnchoredHeading from './anchored-heading'
const importPath = 'bootstrap-vue'
export default {
name: 'BDVImportdoc',
components: { AnchoredHeading },
Expand Down Expand Up @@ -212,9 +213,8 @@ export default {
},
directiveImportCode() {
const firstDirective = this.directives[0]
const firstDirectiveImport = this.directiveImports[0]
return [
`import { ${firstDirective} } from '${firstDirectiveImport.importPath}'`,
`import { ${firstDirective} } from '${importPath}'`,
"// Note: Vue automatically prefixes the directive name with 'v-'",
`Vue.directive('${this.directiveName(firstDirective)}', ${firstDirective})`
].join('\n')
Expand Down
31 changes: 5 additions & 26 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@ echo 'Done.'
echo ''

# Cleanup
rm -rf dist es esm
rm -rf dist esm

echo 'Compile JS...'
rollup -c scripts/rollup.config.js
echo 'Done.'
echo ''

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

echo 'Build ES modules (deprecated)...'
NODE_ENV=es babel src --out-dir es --ignore 'src/**/*.spec.js'
rm -f es/index.js es/browser.js
echo "${BV_BANNER}" | cat - es/legacy-es.js > es/index.js
rm -f es/legacy-es.js
echo 'Done.'
echo ''

echo 'Minify JS...'
terser dist/bootstrap-vue.js \
--compress typeofs=false \
Expand Down Expand Up @@ -78,29 +70,16 @@ echo 'Done.'
echo ''

echo 'Copying types from src/ to esm/ ...'
# There must be a better way to do this
# This may no longer be needed, as all exports are at top level now.
#
# The following does not preserve the paths
# shopt -s globstar
# cp src/**/*.d.ts es
#
# So we resort to a find with exec
cd src
find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';'
cd ..
echo 'Done.'
echo ''

echo 'Copying types from src/ to es/ ...'
# There must be a better way to do this
#
# The following does not preserve the paths
# shopt -s globstar
# cp src/**/*.d.ts es
#
# So we resort to a find with exec
cd src
find . -type f -name '*.d.ts' -exec cp {} ../es/{} ';'
find . -type f -name '*.d.ts' -exec cp {} ../esm/{} ';'
cd ..
echo 'Done.'
echo ''
Expand Down
1 change: 0 additions & 1 deletion src/bv-config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ import Vue, { PluginFunction, PluginObject } from 'vue'
import { BvPlugin } from './'

export declare const BVConfigPlugin: BvPlugin
export default BVConfigPlugin
4 changes: 1 addition & 3 deletions src/bv-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
//
import { pluginFactory } from './utils/plugins'

const BVConfigPlugin = /*#__PURE__*/ pluginFactory()

export default BVConfigPlugin
export const BVConfigPlugin = /*#__PURE__*/ pluginFactory()
1 change: 0 additions & 1 deletion src/components/alert/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const AlertPlugin: BvPlugin
export default AlertPlugin

// Component: b-alert
export declare class BAlert extends BvComponent {
Expand Down
2 changes: 0 additions & 2 deletions src/components/alert/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ const AlertPlugin = /*#__PURE__*/ pluginFactory({
})

export { AlertPlugin, BAlert }

export default AlertPlugin
1 change: 0 additions & 1 deletion src/components/badge/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const BadgePlugin: BvPlugin
export default BadgePlugin

// Component: b-badge
export declare class BBadge extends BvComponent {}
2 changes: 0 additions & 2 deletions src/components/badge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ const BadgePlugin = /*#__PURE__*/ pluginFactory({
})

export { BadgePlugin, BBadge }

export default BadgePlugin
1 change: 0 additions & 1 deletion src/components/breadcrumb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const BreadcrumbPlugin: BvPlugin
export default BreadcrumbPlugin

// Component: b-breadcrumb
export declare class BBreadcrumb extends BvComponent {}
Expand Down
2 changes: 0 additions & 2 deletions src/components/breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ const BreadcrumbPlugin = /*#__PURE__*/ pluginFactory({
})

export { BreadcrumbPlugin, BBreadcrumb, BBreadcrumbItem, BBreadcrumbLink }

export default BreadcrumbPlugin
1 change: 0 additions & 1 deletion src/components/button-group/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const ButtonGroupPlugin: BvPlugin
export default ButtonGroupPlugin

// Component: b-button-group
export declare class BButtonGroup extends BvComponent {}
2 changes: 0 additions & 2 deletions src/components/button-group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ const ButtonGroupPlugin = /*#__PURE__*/ pluginFactory({
})

export { ButtonGroupPlugin, BButtonGroup }

export default ButtonGroupPlugin
1 change: 0 additions & 1 deletion src/components/button-toolbar/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const ButtonToolbarPlugin: BvPlugin
export default ButtonToolbarPlugin

// Component: b-button-toolbar
export declare class BButtonToolbar extends BvComponent {}
2 changes: 0 additions & 2 deletions src/components/button-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ const ButtonToolbarPlugin = /*#__PURE__*/ pluginFactory({
})

export { ButtonToolbarPlugin, BButtonToolbar }

export default ButtonToolbarPlugin
1 change: 0 additions & 1 deletion src/components/button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const ButtonPlugin: BvPlugin
export default ButtonPlugin

// Component: b-button
export declare class BButton extends BvComponent {}
Expand Down
2 changes: 0 additions & 2 deletions src/components/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ const ButtonPlugin = /*#__PURE__*/ pluginFactory({
})

export { ButtonPlugin, BButton, BButtonClose }

export default ButtonPlugin
1 change: 0 additions & 1 deletion src/components/card/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const CardPlugin: BvPlugin
export default CardPlugin

// Component: b-card
export declare class BCard extends BvComponent {}
Expand Down
2 changes: 0 additions & 2 deletions src/components/card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ export {
BCardText,
BCardGroup
}

export default CardPlugin
1 change: 0 additions & 1 deletion src/components/carousel/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const CarouselPlugin: BvPlugin
export default CarouselPlugin

// Component: b-carousel
export declare class BCarousel extends BvComponent {
Expand Down
2 changes: 0 additions & 2 deletions src/components/carousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ const CarouselPlugin = /*#__PURE*/ pluginFactory({
})

export { CarouselPlugin, BCarousel, BCarouselSlide }

export default CarouselPlugin
1 change: 0 additions & 1 deletion src/components/collapse/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const CollapsePlugin: BvPlugin
export default CollapsePlugin

// Component: b-collapse
export declare class BCollapse extends BvComponent {
Expand Down
2 changes: 0 additions & 2 deletions src/components/collapse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ const CollapsePlugin = /*#__PURE__*/ pluginFactory({
})

export { CollapsePlugin, BCollapse }

export default CollapsePlugin
1 change: 0 additions & 1 deletion src/components/dropdown/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin
export declare const DropdownPlugin: BvPlugin
export default DropdownPlugin

// Component: b-dropdown
export declare class BDropdown extends BvComponent {
Expand Down
2 changes: 0 additions & 2 deletions src/components/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ export {
BDropdownText,
BDropdownGroup
}

export default DropdownPlugin
1 change: 0 additions & 1 deletion src/components/embed/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BvPlugin, BvComponent } from '../../'

// Plugin