From d394aca5516fe6e7d85fef9b28fde8bb4b43cf03 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 13 Jun 2023 23:05:07 -0700 Subject: [PATCH] Free your mind of the babel and the packed web ember-cli-storybook and storybook itself has progressed to the point where the DIY configs aren't necessary. It's all swept under the `framework: '@storybook/ember'` config in main.js. Yay! --- ui/.storybook/babel.config.js | 53 --------------------------------- ui/.storybook/main.js | 4 +++ ui/.storybook/webpack.config.js | 15 ---------- 3 files changed, 4 insertions(+), 68 deletions(-) delete mode 100644 ui/.storybook/babel.config.js delete mode 100644 ui/.storybook/webpack.config.js diff --git a/ui/.storybook/babel.config.js b/ui/.storybook/babel.config.js deleted file mode 100644 index efa331ea5..000000000 --- a/ui/.storybook/babel.config.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: MPL-2.0 - */ - -/* eslint-env node */ - -const templateCompiler = require('ember-source/dist/ember-template-compiler'); - -module.exports = { - presets: [ - [ - '@babel/preset-env', - { - shippedProposals: true, - useBuiltIns: 'usage', - corejs: '3', - targets: [ - 'last 1 Chrome versions', - 'last 1 Firefox versions', - 'last 1 Safari versions', - ], - }, - ], - ], - plugins: [ - [ - '@babel/plugin-proposal-decorators', - { - legacy: true, - }, - ], - ['@babel/plugin-proposal-class-properties', { loose: true }], - '@babel/plugin-syntax-dynamic-import', - [ - '@babel/plugin-proposal-object-rest-spread', - { loose: true, useBuiltIns: true }, - ], - 'babel-plugin-macros', - ['emotion', { sourceMap: true, autoLabel: true }], - [ - 'babel-plugin-htmlbars-inline-precompile', - { - precompile: templateCompiler.precompile, - modules: { - 'ember-cli-htmlbars': 'hbs', - 'ember-cli-htmlbars-inline-precompile': 'default', - 'htmlbars-inline-precompile': 'default', - }, - }, - ], - ], -}; diff --git a/ui/.storybook/main.js b/ui/.storybook/main.js index 082740391..f4d5cd4a0 100644 --- a/ui/.storybook/main.js +++ b/ui/.storybook/main.js @@ -5,6 +5,7 @@ /* eslint-env node */ module.exports = { + framework: '@storybook/ember', addons: [ '@storybook/addon-docs', '@storybook/addon-storysource', @@ -16,4 +17,7 @@ module.exports = { '../stories/components/*.stories.js', '../stories/charts/*.stories.js', ], + core: { + builder: '@storybook/builder-webpack4', + }, }; diff --git a/ui/.storybook/webpack.config.js b/ui/.storybook/webpack.config.js deleted file mode 100644 index e6492d1b1..000000000 --- a/ui/.storybook/webpack.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: MPL-2.0 - */ - -/* eslint-env node */ -module.exports = function ({ config }) { - config.module.rules.push({ - test: /\.stories\.jsx?$/, - loaders: [require.resolve('@storybook/source-loader')], - enforce: 'pre', - }); - - return config; -};