Skip to content

Commit

Permalink
pass number props, minimize specified layout (#107)
Browse files Browse the repository at this point in the history
* pass number props, minimize specified layout

* flexible for default values

* fix form control

* switch to rollup, fix build

* update storybook

* Update publish.yml
  • Loading branch information
scottrepreneur authored Dec 21, 2023
1 parent 99e89fb commit eac593e
Show file tree
Hide file tree
Showing 67 changed files with 14,619 additions and 16,174 deletions.
66 changes: 0 additions & 66 deletions .eslintrc.js

This file was deleted.

64 changes: 64 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"root": true,
"plugins": ["import", "prettier", "@typescript-eslint"],
"extends": [
"airbnb",
"eslint:recommended",
"plugin:react/recommended",
"plugin:storybook/recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json"],
"tsconfigRootDir": ".",
"jsx": true
},
"ignorePatterns": ["bin", "dist", "src/components/icons/*.tsx"],
"rules": {
// GENERAL
"no-use-before-define": "off",
"no-param-reassign": [2, { "props": false }],
// REACT
"react/function-component-definition": [
2,
{ "namedComponents": ["arrow-function"] }
],
"react/require-default-props": "off",
"react/jsx-filename-extension": [2, { "extensions": [".jsx", ".tsx"] }],
"react/jsx-props-no-spreading": "off",
// IMPORT
"import/prefer-default-export": "off",
"import/extensions": [
"error",
"ignorePackages",
{ "js": "never", "jsx": "never", "ts": "never", "tsx": "never" }
],
// USE .PRETTIERRC FOR SETTINGS
"prettier/prettier": ["error"],
// TYPESCRIPT
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn"
},
"env": {
"jest": true,
"browser": true,
"node": true
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
// use <root>/tsconfig.json
"typescript": {
"path": ["src"],
"alwaysTryTypes": true
}
}
}
}
13 changes: 8 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2 # Use PNPM
with:
version: 8

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install

- name: Build Latest
run: yarn build && yarn build-storybook
run: pnpm build && pnpm build-storybook
env:
NODE_OPTIONS: --max-old-space-size=8096

- name: Publish NPM Package
run: yarn publish --non-interactive --access public
run: pnpm publish --non-interactive --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Expand Down
21 changes: 11 additions & 10 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const config: StorybookConfig = {
core: {
builder: {
name: '@storybook/builder-webpack5',
options: {
lazyCompilation: true,
},
options: {},
// lazyCompilation: true,
// fsCache: true,
// },
},
},
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
Expand Down Expand Up @@ -53,19 +54,19 @@ const config: StorybookConfig = {
// config.resolve.extensions.push('.eot', '.otf', '.tff', '.woff', '.woff2');
config.resolve.extensions?.push('.ts', '.tsx');

config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: config.resolve?.extensions,
}),
];
// config.resolve.plugins = [
// ...(config.resolve.plugins || []),
// new TsconfigPathsPlugin({
// extensions: config.resolve?.extensions,
// }),
// ];

// include ts files here so they can be resolved properly
// config.resolve.modules.push(process.cwd() + '/node_modules');
// config.resolve.modules.push(process.cwd() + '/src');

// this is needed for working w/ linked folders
config.resolve.symlinks = false;
// config.resolve.symlinks = false;
}

// return result
Expand Down
118 changes: 58 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@raidguild/design-system",
"version": "0.5.0",
"version": "0.5.1",
"license": "MIT",
"author": "Raid Guild",
"module": "dist/design-system.esm.js",
"typings": "dist/index.d.ts",
"main": "./dist/cjs/src/index.js",
"module": "./dist/esm/src/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"homepage": "https://raid-guild.github.io/design-system",
"files": [
"dist"
Expand All @@ -13,9 +15,7 @@
"node": ">=18"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build --format esm",
"test": "tsdx test --passWithNoTests",
"build": "rm -rf ./dist && rollup -c",
"lint": "eslint src",
"prepare": "yarn build",
"size": "size-limit",
Expand All @@ -27,38 +27,39 @@
"generate-icons": "node bin/generate-icons.js",
"generate-icons:watch": "yarn generate-icons --watch"
},
"peerDependencies": {
"react": ">=18"
},
"husky": {
"hooks": {
"pre-commit": "lint src"
}
"dependencies": {
"@chakra-ui/react": "^2.8.2",
"@chakra-ui/theme-tools": "^2.0.18",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@storybook/react": "^7.0.21",
"@storybook/theming": "^7.0.21",
"@tokens-studio/sd-transforms": "^0.11.3",
"@types/react-datepicker": "^4.8.0",
"chakra-react-select": "^4.6.0",
"framer-motion": "^10.12.16",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-datepicker": "^4.8.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.38.0",
"react-icons": "^4.3.1",
"tsconfig-paths-webpack-plugin": "^4.0.0"
},
"size-limit": [
{
"path": "dist/design-system.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/design-system.esm.js",
"limit": "10 KB"
}
],
"devDependencies": {
"@babel/core": "^7.15.0",
"@chakra-ui/storybook-addon": "^4.0.16",
"@chakra-ui/storybook-addon": "^4.0.17",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@size-limit/preset-small-lib": "^5.0.3",
"@storybook/addon-docs": "^7.0.21",
"@storybook/addon-essentials": "^7.0.21",
"@storybook/addon-links": "^7.0.21",
"@storybook/addon-viewport": "^7.0.21",
"@storybook/addons": "^7.0.21",
"@storybook/react-webpack5": "^7.0.21",
"@svgr/core": "^5.5.0",
"@svgr/plugin-jsx": "^5.5.0",
"@svgr/plugin-prettier": "^5.5.0",
"@svgr/plugin-svgo": "^5.5.0",
"@storybook/addon-docs": "^7.6.6",
"@storybook/addon-essentials": "^7.6.6",
"@storybook/addon-links": "^7.6.6",
"@storybook/addon-viewport": "^7.6.6",
"@storybook/addons": "^7.6.6",
"@storybook/react-webpack5": "^7.6.6",
"@types/lodash": "^4.14.186",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
Expand All @@ -80,35 +81,32 @@
"husky": "^7.0.1",
"prettier": "^2.5.1",
"react-is": "^17.0.2",
"rollup": "^4.9.1",
"rollup-plugin-import-css": "^3.3.5",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-typescript2": "^0.36.0",
"size-limit": "^5.0.3",
"storybook": "^7.0.21",
"storybook": "^7.6.6",
"ts-loader": "^9.4.1",
"tsdx": "^0.14.1",
"tslib": "^2.3.1",
"typescript": "^5.1.3"
},
"dependencies": {
"@chakra-ui/react": "^2.7.0",
"@chakra-ui/theme-tools": "^2.0.18",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@rollup/plugin-replace": "^3.0.0",
"@storybook/react": "^7.0.21",
"@storybook/theming": "^7.0.21",
"@tokens-studio/sd-transforms": "^0.11.3",
"@types/react-datepicker": "^4.8.0",
"chakra-react-select": "^4.6.0",
"framer-motion": "^10.12.16",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"react": "^18.2.0",
"react-datepicker": "^4.8.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.38.0",
"react-icons": "^4.3.1",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-css-porter": "^1.0.2",
"token-transformer": "^0.0.33",
"tsconfig-paths-webpack-plugin": "^4.0.0"
}
"peerDependencies": {
"react": ">=18"
},
"husky": {
"hooks": {
"pre-commit": "lint src"
}
},
"size-limit": [
{
"path": "dist/design-system.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/design-system.esm.js",
"limit": "10 KB"
}
]
}
Loading

0 comments on commit eac593e

Please sign in to comment.