@pautena/react-design-system 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/.eslintrc.js +0 -26
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/deploy-storybook.yaml +0 -23
- package/.github/workflows/publish.yml +0 -31
- package/.husky/pre-commit +0 -5
- package/.prettierignore +0 -5
- package/.prettierrc.js +0 -5
- package/.storybook/main.js +0 -10
- package/.storybook/preview.js +0 -36
- package/babel.config.js +0 -13
- package/jest.config.js +0 -17
- package/jest.setup.ts +0 -5
- package/rollup.config.js +0 -52
- package/tsconfig.json +0 -25
- package/tsconfig.rollup.json +0 -28
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pautena/react-design-system",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "My custom design system on top of MUI",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build": "rollup -c",
|
|
9
10
|
"test": "jest",
|
package/.eslintrc.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
node: true,
|
|
6
|
-
},
|
|
7
|
-
extends: [
|
|
8
|
-
"eslint:recommended",
|
|
9
|
-
"plugin:react/recommended",
|
|
10
|
-
"plugin:@typescript-eslint/recommended",
|
|
11
|
-
"plugin:prettier/recommended",
|
|
12
|
-
],
|
|
13
|
-
parser: "@typescript-eslint/parser",
|
|
14
|
-
parserOptions: {
|
|
15
|
-
ecmaFeatures: {
|
|
16
|
-
jsx: true,
|
|
17
|
-
},
|
|
18
|
-
ecmaVersion: "latest",
|
|
19
|
-
sourceType: "module",
|
|
20
|
-
},
|
|
21
|
-
plugins: ["react", "@typescript-eslint"],
|
|
22
|
-
rules: {
|
|
23
|
-
"prettier/prettier": "error",
|
|
24
|
-
"react/display-name": "off",
|
|
25
|
-
},
|
|
26
|
-
};
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
name: 'ci'
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
ci:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v2
|
|
13
|
-
- uses: actions/cache@v2
|
|
14
|
-
with:
|
|
15
|
-
path: |
|
|
16
|
-
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
17
|
-
'**/node_modules'
|
|
18
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
19
|
-
restore-keys: |
|
|
20
|
-
${{ runner.os }}-yarn-
|
|
21
|
-
- run: yarn
|
|
22
|
-
- run: yarn lint
|
|
23
|
-
- run: yarn test
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
name: 'Deploy Storybook'
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
ci:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v2
|
|
12
|
-
- uses: actions/cache@v2
|
|
13
|
-
id: yarn-cache
|
|
14
|
-
with:
|
|
15
|
-
path: '**/node_modules'
|
|
16
|
-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
17
|
-
- run: yarn
|
|
18
|
-
- run: yarn storybook:build
|
|
19
|
-
- name: Deploy
|
|
20
|
-
uses: peaceiris/actions-gh-pages@v3
|
|
21
|
-
with:
|
|
22
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
23
|
-
publish_dir: ./storybook-static
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Publish to NPM
|
|
2
|
-
on:
|
|
3
|
-
release:
|
|
4
|
-
types: [created]
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
steps:
|
|
9
|
-
- name: Checkout
|
|
10
|
-
uses: actions/checkout@v2
|
|
11
|
-
- uses: actions/cache@v2
|
|
12
|
-
with:
|
|
13
|
-
path: |
|
|
14
|
-
${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
15
|
-
'**/node_modules'
|
|
16
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
17
|
-
restore-keys: |
|
|
18
|
-
${{ runner.os }}-yarn-
|
|
19
|
-
- name: Setup Node
|
|
20
|
-
uses: actions/setup-node@v2
|
|
21
|
-
with:
|
|
22
|
-
node-version: '16.x'
|
|
23
|
-
registry-url: 'https://registry.npmjs.org'
|
|
24
|
-
- name: Install dependencies
|
|
25
|
-
run: yarn install
|
|
26
|
-
- name: Build
|
|
27
|
-
run: yarn build
|
|
28
|
-
- name: Publish package on NPM
|
|
29
|
-
run: npm publish --access public
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.husky/pre-commit
DELETED
package/.prettierignore
DELETED
package/.prettierrc.js
DELETED
package/.storybook/main.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
3
|
-
addons: [
|
|
4
|
-
"@storybook/addon-links",
|
|
5
|
-
"@storybook/addon-essentials",
|
|
6
|
-
"@storybook/addon-interactions",
|
|
7
|
-
"@storybook/addon-knobs",
|
|
8
|
-
],
|
|
9
|
-
framework: "@storybook/react",
|
|
10
|
-
};
|
package/.storybook/preview.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider, CssBaseline, createTheme } from "@mui/material";
|
|
2
|
-
import { addDecorator } from "@storybook/react";
|
|
3
|
-
import { Box } from "@mui/material";
|
|
4
|
-
import { select, withKnobs } from "@storybook/addon-knobs";
|
|
5
|
-
|
|
6
|
-
const light = createTheme();
|
|
7
|
-
const dark = createTheme({
|
|
8
|
-
palette: {
|
|
9
|
-
mode: "dark",
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const themes = { light, dark };
|
|
14
|
-
const themeNames = Object.keys(themes);
|
|
15
|
-
|
|
16
|
-
addDecorator((Story) => {
|
|
17
|
-
const theme = select("Theme", themeNames, themeNames[0], "Themes");
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<ThemeProvider theme={themes[theme]}>
|
|
21
|
-
<CssBaseline />
|
|
22
|
-
<Story />
|
|
23
|
-
</ThemeProvider>
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
addDecorator(withKnobs);
|
|
27
|
-
|
|
28
|
-
export const parameters = {
|
|
29
|
-
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
30
|
-
controls: {
|
|
31
|
-
matchers: {
|
|
32
|
-
color: /(background|color)$/i,
|
|
33
|
-
date: /Date$/,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
package/babel.config.js
DELETED
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
testEnvironment: "jsdom",
|
|
3
|
-
setupFilesAfterEnv: ["./jest.setup.ts"],
|
|
4
|
-
collectCoverageFrom: [
|
|
5
|
-
"./src/**",
|
|
6
|
-
"!src/**/*.stories.tsx",
|
|
7
|
-
"!src/**/*.dummy.ts",
|
|
8
|
-
"!src/**/*.mock.tsx",
|
|
9
|
-
"!src/**/*.test.tsx",
|
|
10
|
-
"!src/storybook.tsx",
|
|
11
|
-
"!src/tests/**",
|
|
12
|
-
"!src/**/__snapshots__/**",
|
|
13
|
-
],
|
|
14
|
-
moduleNameMapper: {
|
|
15
|
-
"~/(.*)": "<rootDir>/src/$1",
|
|
16
|
-
},
|
|
17
|
-
};
|
package/jest.setup.ts
DELETED
package/rollup.config.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import resolve from "@rollup/plugin-node-resolve";
|
|
2
|
-
import commonjs from "@rollup/plugin-commonjs";
|
|
3
|
-
import typescript from "@rollup/plugin-typescript";
|
|
4
|
-
import alias from "@rollup/plugin-alias";
|
|
5
|
-
import dts from "rollup-plugin-dts";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import { terser } from "rollup-plugin-terser";
|
|
8
|
-
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
|
9
|
-
import packageJson from "./package.json";
|
|
10
|
-
|
|
11
|
-
const projectRootDir = path.resolve(__dirname);
|
|
12
|
-
|
|
13
|
-
export default [
|
|
14
|
-
{
|
|
15
|
-
input: "src/index.ts",
|
|
16
|
-
output: [
|
|
17
|
-
{
|
|
18
|
-
file: packageJson.main,
|
|
19
|
-
format: "cjs",
|
|
20
|
-
sourcemap: true,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
file: packageJson.module,
|
|
24
|
-
format: "esm",
|
|
25
|
-
sourcemap: true,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
plugins: [
|
|
29
|
-
peerDepsExternal(),
|
|
30
|
-
resolve(),
|
|
31
|
-
commonjs(),
|
|
32
|
-
typescript({
|
|
33
|
-
tsconfig: "./tsconfig.rollup.json",
|
|
34
|
-
}),
|
|
35
|
-
terser(),
|
|
36
|
-
alias({
|
|
37
|
-
entries: [
|
|
38
|
-
{
|
|
39
|
-
find: "~",
|
|
40
|
-
replacement: path.resolve(projectRootDir, "src"),
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
}),
|
|
44
|
-
],
|
|
45
|
-
external: ["react", "react-dom"],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
input: "dist/esm/types/index.d.ts",
|
|
49
|
-
output: [{ file: "dist/index.d.ts", format: "esm" }],
|
|
50
|
-
plugins: [dts()],
|
|
51
|
-
},
|
|
52
|
-
];
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"esModuleInterop": true,
|
|
4
|
-
"strict": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"jsx": "react",
|
|
7
|
-
"lib": ["ES2016", "dom"],
|
|
8
|
-
"module": "ESNext",
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"declarationDir": "types",
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"outDir": "dist",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"emitDeclarationOnly": true,
|
|
15
|
-
"allowSyntheticDefaultImports": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"types": ["jest"],
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"~/*": ["src/*"]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"include": ["./jest.setup.ts", "src/*"],
|
|
24
|
-
"exclude": ["dist", "node_modules"]
|
|
25
|
-
}
|
package/tsconfig.rollup.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"esModuleInterop": true,
|
|
4
|
-
"strict": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"jsx": "react",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "types",
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"rootDir": "src",
|
|
12
|
-
"outDir": "dist",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"emitDeclarationOnly": true,
|
|
15
|
-
"allowSyntheticDefaultImports": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true
|
|
17
|
-
},
|
|
18
|
-
"exclude": [
|
|
19
|
-
"dist",
|
|
20
|
-
"types",
|
|
21
|
-
"storybook-static",
|
|
22
|
-
"node_modules",
|
|
23
|
-
"src/tests",
|
|
24
|
-
"src/**/*.test.tsx",
|
|
25
|
-
"src/**/*.stories.tsx",
|
|
26
|
-
"src/storybook.tsx"
|
|
27
|
-
]
|
|
28
|
-
}
|