Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial button components #7

Merged
merged 15 commits into from
May 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["babel-plugin-react-scoped-css"]
}
14 changes: 12 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"ignorePaths": [
"graphics",
".storybook-dist"
".storybook-dist",
"*.otf"
],
"import": ".cspell-base.json",
"words": [
Expand All @@ -16,6 +17,15 @@
"svgs",
"tiktok",
"toniq",
"toniqlabs"
"toniqlabs",
"preinstall",
"globby",
"prismjs",
"overscroll",
"callout",
"fonturl",
"iefix",
"opentype",
"truetype"
]
}
29 changes: 27 additions & 2 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {StorybookConfig} from '@storybook/core-common';
import {dirname, resolve} from 'path';
import type {Configuration} from 'webpack';
ponnexcodev marked this conversation as resolved.
Show resolved Hide resolved

/** These configs values are exported as individual variables to appease some storybook build warnings. */

Expand All @@ -12,9 +14,9 @@ export const addons: StorybookConfig['addons'] = [
];
export const framework: StorybookConfig['framework'] = '@storybook/react';

export const staticDirs: StorybookConfig['staticDirs'] = ['./public'];
export const staticDirs: StorybookConfig['staticDirs'] = ['../public'];

export const webpackFinal: StorybookConfig['webpackFinal'] = (config) => {
export const webpackFinal: StorybookConfig['webpackFinal'] = (config: Configuration) => {
const maxAssetSize = 1024 * 1024;

config.optimization = {
Expand All @@ -31,6 +33,29 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = (config) => {
maxAssetSize: maxAssetSize,
};

config.module?.rules?.push({
test: /\.scoped\.(sc|c|sa)ss$/,
include: dirname(__dirname),
use: [
'style-loader',
'css-loader',
'scoped-css-loader',
'sass-loader',
{
loader: 'style-resources-loader',
options: {
patterns: ['./src/assets/styles/main.scss'],
},
},
],
});

config.resolve!.roots = [
// Fixes for unresolved assets from within css/scss at build time https://github.com/storybookjs/storybook/issues/12844#issuecomment-970088820
resolve(__dirname, '../public'),
'node_modules',
];

return config;
};

Expand Down
3 changes: 3 additions & 0 deletions .virmator/jest/jest-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const virmatorJestConfig: InitialOptionsTsJest = {
},
},
},
moduleNameMapper: {
'.+\\.(css|sass|scss)$': 'identity-obj-proxy',
},
};

export default virmatorJestConfig;
Loading