From d5957d63752136f0a7056e1be570e0f5594759a0 Mon Sep 17 00:00:00 2001 From: nurulakbaral Date: Tue, 10 Jan 2023 10:06:39 +0700 Subject: [PATCH] react-resval v1.0.0-beta --- .github/workflows/lint-test.yml | 2 +- docs/docs-react/src/app/resval.tsx | 3 ++- docs/docs-react/src/hooks/use-vx.ts | 16 ++++++++++++++-- package.json | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 820a65c..5b4800b 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -17,4 +17,4 @@ jobs: - run: npx nx affected --target=lint --fix --parallel --base=main --head=HEAD - run: npx nx format:write --uncommitted - run: npx nx test react-resval - - run: npx nx e2e docs-react-e2e --prod + # - run: npx nx e2e docs-react-e2e --prod diff --git a/docs/docs-react/src/app/resval.tsx b/docs/docs-react/src/app/resval.tsx index 17ebc54..4584f56 100644 --- a/docs/docs-react/src/app/resval.tsx +++ b/docs/docs-react/src/app/resval.tsx @@ -4,7 +4,7 @@ import { useVx } from '../hooks/use-vx' export default function Resval() { const [count, setCount] = React.useState(0) - const { color1 } = useVx() + const { color1, value } = useVx() return (
@@ -17,6 +17,7 @@ export default function Resval() { > Count: {count} +

{value}

) } diff --git a/docs/docs-react/src/hooks/use-vx.ts b/docs/docs-react/src/hooks/use-vx.ts index 615960a..e253d48 100644 --- a/docs/docs-react/src/hooks/use-vx.ts +++ b/docs/docs-react/src/hooks/use-vx.ts @@ -1,7 +1,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable prefer-const */ -import { createResponsiveValues } from '@resval/react-responsive-values' +// dev +// import { createResponsiveValues } from '@resval/react-responsive-values' +// prod +import { createResponsiveValues } from '../../../../dist/packages/react-resval' const vx = createResponsiveValues({ breakpoints: { @@ -17,7 +20,7 @@ const vx = createResponsiveValues({ let utilityValues: any = {} -for (let i = 0; i < 1000_000; i++) { +for (let i = 0; i < 100_000; i++) { utilityValues[`color${i}`] = { base: 'red', xs: 'green', @@ -28,6 +31,15 @@ for (let i = 0; i < 1000_000; i++) { } } +utilityValues['value'] = { + base: 'base', + xs: 'xs', + sm: 'sm', + md: 'md', + lg: 'lg', + xl: 'xl', +} + export function useVx() { return vx(utilityValues) } diff --git a/package.json b/package.json index b22e066..2a2ea97 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "nx affected --target=lint --fix --parallel --base=feat/add-cache-for-optimizing-rendering --head=HEAD", + "nx affected --target=lint --fix --parallel --base=main --head=HEAD", "nx format:write --uncommitted" ] }