Skip to content

Commit

Permalink
chore: add first version of code
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloyx committed Jun 18, 2024
1 parent 992f4cd commit e1367a2
Show file tree
Hide file tree
Showing 426 changed files with 42,060 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"presets": [
"@babel/preset-env",
"@babel/typescript",
["@babel/preset-react", {"runtime": "automatic"}]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime",
[ "babel-plugin-webpack-alias", { "config": "./config/webpack.common.js" } ]
],
"env": {
"dev": {
"plugins": [
"react-hot-loader/babel"
]
},
"prod": {
}
}
}
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Dockerfile
Jenkinsfile
build.sh
default.conf
src/demo/*
demo/*
!demo/partials/
dist
dist-npm
flow-typed
jsConfig.json
node_modules
readme.md
package-lock.json
package.json
yarn.lock
docs/build
118 changes: 118 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
module.exports = {
extends: ['airbnb', 'plugin:storybook/recommended', 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
plugins: [
'jsx-a11y',
'react',
'react-hooks',
'@typescript-eslint',
],

parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'no-console': 0,
'no-bitwise': ['error', { int32Hint: true }],
'no-use-before-define': 0,
'no-param-reassign': 0,
'no-shadow': 0,
'func-names': 0,
'require-yield': 0,
'no-else-return': 0,
'newline-per-chained-call': 0,
'no-confusing-arrow': 0,
'arrow-parens': [
'error',
'always',
],
'arrow-body-style': [
2,
'as-needed',
],
'class-methods-use-this': 0,
'max-len': 0,
'comma-dangle': [
2,
'always-multiline',
],
'no-nested-ternary': 0,
'no-trailing-spaces': [
2,
{
skipBlankLines: true,
},
],
indent: [
2,
2,
{
SwitchCase: 1,
},
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'prefer-template': 2,
'import/imports-first': 0,
'import/newline-after-import': 0,
'import/no-dynamic-require': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/no-unresolved': 2,
'import/no-webpack-loader-syntax': 0,
'import/prefer-default-export': 0,
'jsx-a11y/aria-props': 2,
'jsx-a11y/heading-has-content': 0,
'jsx-a11y/anchor-is-valid': 0,
// "jsx-a11y/href-no-hash": 2,
'jsx-a11y/label-has-for': 2,
'jsx-a11y/mouse-events-have-key-events': 2,
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'react/jsx-first-prop-new-line': [
2,
'multiline',
],
'react-hooks/exhaustive-deps': 1,
'react/jsx-filename-extension': 0,
'react/jsx-no-target-blank': 0,
'react/require-default-props': 0,
'react/require-extension': 0,
'react/forbid-prop-types': 0,
'react/prop-types': 0,
'react/self-closing-comp': 0,
'react/no-array-index-key': 0,
'react/no-unused-prop-types': 0,
'react/react-in-jsx-scope': 0,
'react/no-did-mount-set-state': 0,
'react/destructuring-assignment': 0,
'react/jsx-props-no-spreading': 0,
'import/no-cycle': 2,
'react/static-property-placement': 2,
},
settings: {
'import/resolver': {
webpack: {
config: './config/webpack.common',
},
},
},
};
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
dist
dist-npm

# Editor directories and files
.idea
*.iml
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.DS_Store
25 changes: 25 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.idea/
config/
dist/
src/demo/
src/lib/components/**/demo.js
demo/
demo.js
.babelrc
.eslintignore
.eslintrc.js
.flowconfig
.gitignore
.npmignore
.prettierignore
.stylelintrc
build.sh
default.conf
Dockerfile
enzyme.config.js
Jenkinsfile
jest.config.js
jsConfig.json
postcss.config.json
styleguide.config.js
webpack.config.js
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tag-version-prefix=
save-exact=true
progress=true
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.gitignore
.prettierignore
yarn.lock
yarn-error.log
package-lock.json
dist
coverage
111 changes: 111 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const path = require('path');
const config = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"@storybook/addon-styling-webpack",
({
name: "@storybook/addon-styling-webpack",

options: {
rules: [{
test: /\.(less)$/,
sideEffects: true,
use: [
require.resolve("style-loader"),
{
loader: require.resolve("css-loader"),
options: {},
},
{
loader: require.resolve("less-loader"),
options: {
lessOptions: {
javascriptEnabled: true,
paths: [
path.resolve(__dirname, './node_modules'),
path.resolve('./src/lib/components'),
],
},
},
},
],
},],
}
})
],

swc: () => ({
jsc: {
transform: {
react: {
runtime: 'automatic'
}
}
}
}),

framework: {
name: "@storybook/react-webpack5",
options: {
builder: {
useSWC: true,
},
},
},

typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => prop.name.includes('aria') ? false : true,
},
},

webpackFinal: async (config) => {
config.resolve.alias = {
...config.resolve.alias,
'@Src': path.resolve(__dirname, '../src/'),
'@Resources': path.resolve(__dirname, '../src/lib/resources/'),
'@Lib': path.resolve(__dirname, '../src/lib/'),
'@Components': path.resolve(__dirname, '../src/lib/components/'),
'@Demo': path.resolve(__dirname, '../src/demo/'),
'@Styles': path.resolve(__dirname, '../src/styles/'),
'@Images': path.resolve(__dirname, '../src/lib/resources/images/'),
};

const fileLoaderRule = config.module.rules.find(rule => rule.test && rule.test.test('.svg'));
fileLoaderRule.exclude = /\.svg$/;

config.module.rules.push({
test: /\.svg$/i,
type: 'asset',
resourceQuery: /url/, // *.svg?url
});


config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url
use: ['@svgr/webpack'],
});

return config;
},

docs: {
autodocs: "tag",
},
};

export default config;
Loading

0 comments on commit e1367a2

Please sign in to comment.