Skip to content

Commit

Permalink
feat: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyage committed Jun 8, 2022
0 parents commit 0735478
Show file tree
Hide file tree
Showing 24 changed files with 51,912 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@taoyage/configs/commitlint');
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
es
lib
public
.commitlintrc.js
.lintstagedrc.js
.prettierrc.js
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const configs = require('@taoyage/configs/eslint-ts');

module.exports = {
...configs,
settings: {
...configs.settings,
'import/resolver': {
alias: {
map: [['@', './packages']],
extensions: ['.ts', '.tsx', '.js', '.json'],
},
},
},
};
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
esm
cjs
lib
.idea/
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@taoyage/configs/lintstaged');
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@taoyage/configs/prettier');
59 changes: 59 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');

function resolve(...dirs) {
return path.join(__dirname, '../', ...dirs);
}

module.exports = {
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
framework: '@storybook/react',
core: {
builder: '@storybook/builder-webpack5',
},
webpackFinal: (config, { configType }) => {
const isProd = configType === 'PRODUCTION';
const env = isProd ? 'production' : 'development';

config.mode = env;

config.devtool = isProd ? false : 'cheap-module-source-map';

config.resolve = {
...config.resolve,
alias: {
...config.resolve.alias,
'@': resolve('packages'),
},
};

config.module.rules.push({
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'sass-loader',
},
],
include: [resolve('stories'), resolve('packages')],
});

config.plugins.push(
new ReactRefreshWebpackPlugin({
overlay: false,
})
);

config.plugins.push(
new MiniCssExtractPlugin({
filename: `[name]${isProd ? '.[hash]' : ''}.css`,
chunkFilename: `[id]${isProd ? '.[hash]' : ''}.css`,
})
);

return config;
},
};
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# react-mobile-components
Loading

0 comments on commit 0735478

Please sign in to comment.