Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 8fcdc42

Browse files
committed
refactor: optimizing performance
1 parent 2fa2d08 commit 8fcdc42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+382
-860
lines changed

README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,6 @@ if (process.env.NODE_ENV !== 'production') {
167167
}
168168
```
169169

170-
## Next.js
171-
172-
```diff
173-
/** @type {import('next').NextConfig} */
174-
- const nextConfig = {
175-
+ experimental: {
176-
+ optimizePackageImports: [
177-
+ '@codefixlabs/hooks',
178-
+ '@codefixlabs/lib',
179-
+ '@codefixlabs/ui',
180-
+ ],
181-
+ },
182-
};
183-
184-
module.exports = nextConfig
185-
```
186-
187170
## Tailwind CSS
188171

189172
In `postcss.config.js`
@@ -201,8 +184,7 @@ module.exports = {
201184
In `tailwind.config.ts`
202185

203186
```diff
204-
+ import { sharedConfig } from '@codefixlabs/tailwindcss/tailwind.config';
205-
+ import { stone } from '@codefixlabs/tailwindcss/color/stone';
187+
+ import { sharedConfig, stone } from '@codefixlabs/tailwindcss';
206188
import type { Config } from 'tailwindcss'
207189

208190
const config: Pick<Config, 'presets' | 'theme' | 'plugins'> = {

apps/docs/src/stories/checkbox/checkbox.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useId } from 'react';
1515
import type { SubmitHandler } from 'react-hook-form';
1616
import { useForm } from 'react-hook-form';
1717
import { z } from 'zod';
18-
import { wait } from '@codefixlabs/lib/wait';
18+
import { wait } from '@codefixlabs/lib';
1919
import { Checkbox } from '@codefixlabs/ui/checkbox';
2020
import { Label } from '@codefixlabs/ui/label';
2121
import { Button } from '@codefixlabs/ui/button';

apps/docs/src/stories/combobox/combobox.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ import { useState } from 'react';
3434
import type { ControllerRenderProps, SubmitHandler } from 'react-hook-form';
3535
import { useForm } from 'react-hook-form';
3636
import { z } from 'zod';
37-
import { getFirstInitials } from '@codefixlabs/lib/string';
38-
import { wait } from '@codefixlabs/lib/wait';
37+
import { getFirstInitials, wait } from '@codefixlabs/lib';
3938

4039
const meta: Meta<typeof Combobox> = {
4140
component: Combobox,

apps/docs/src/stories/date-picker/date-picker.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/dialog/dialog.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import { Button } from '@codefixlabs/ui/button';
33
import {
44
Dialog,

apps/docs/src/stories/input-password/input-password.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/input-phone-number/input-phone-number.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { isValidPhoneNumber, wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,
@@ -13,7 +13,6 @@ import type { ComponentProps } from 'react';
1313
import type { SubmitHandler } from 'react-hook-form';
1414
import { useForm } from 'react-hook-form';
1515
import { z } from 'zod';
16-
import { isValidPhoneNumber } from '@codefixlabs/lib/validation';
1716
import { InputPhoneNumber } from '@codefixlabs/ui/input-phone-number';
1817
import { Label } from '@codefixlabs/ui/label';
1918
import { Button } from '@codefixlabs/ui/button';

apps/docs/src/stories/input/input.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/radio-group/radio-group.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/select/select.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/switch/switch.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/src/stories/textarea/textarea.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { wait } from '@codefixlabs/lib/wait';
1+
import { wait } from '@codefixlabs/lib';
22
import {
33
Form,
44
FormControl,

apps/docs/tailwind.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { sharedConfig } from '@codefixlabs/tailwindcss/tailwind.config';
2-
import { stone } from '@codefixlabs/tailwindcss/color/stone';
1+
import { sharedConfig, stone } from '@codefixlabs/tailwindcss';
32
import type { Config } from 'tailwindcss';
43

54
const config: Pick<Config, 'presets' | 'plugins'> = {

packages/hooks/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/hooks
22

3+
## 0.1.15
4+
5+
### Patch Changes
6+
7+
- aaedd29: Optimizing performance
8+
39
## 0.1.14
410

511
### Patch Changes

packages/hooks/package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"name": "@codefixlabs/hooks",
3-
"version": "0.1.14",
3+
"version": "0.1.15",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
7-
"./package.json": "./package.json",
8-
"./*": {
9-
"types": "./dist/*.d.ts",
10-
"import": "./dist/*.mjs",
11-
"require": "./dist/*.js"
12-
}
13-
},
14-
"typesVersions": {
15-
"*": {
16-
"*": [
17-
"dist/*"
18-
]
7+
".": {
8+
"import": {
9+
"types": "./dist/index.d.mts",
10+
"default": "./dist/index.mjs"
11+
},
12+
"require": {
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.js"
15+
}
1916
}
2017
},
18+
"main": "./dist/index.js",
19+
"module": "./dist/index.mjs",
20+
"source": "./src/index.ts",
21+
"types": "./dist/index.d.ts",
2122
"files": [
2223
"dist"
2324
],

packages/hooks/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export * from '@/use-countries';
2+
export * from '@/use-isomorphic-layout-effect';
3+
export * from '@/use-modal';
4+
export * from '@/use-mounted';
5+
export * from '@/use-origin';
6+
export * from '@/use-previous';

packages/hooks/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "@codefixlabs/tsconfig/react-library.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
54
"paths": {
65
"@/*": ["./src/*"]
76
}

packages/hooks/tsup.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { defineConfig } from 'tsup';
44
export default defineConfig((options: Options) => ({
55
clean: !options.watch,
66
dts: true,
7-
entry: ['src/**/*.ts'],
7+
entry: ['src/index.ts'],
88
external: ['react'],
99
format: ['esm', 'cjs'],
10-
minify: !options.watch,
1110
sourcemap: true,
12-
splitting: false,
11+
splitting: true,
12+
treeshake: true,
1313
...options,
1414
}));

packages/lib/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/lib
22

3+
## 0.1.18
4+
5+
### Patch Changes
6+
7+
- aaedd29: Optimizing performance
8+
39
## 0.1.17
410

511
### Patch Changes

packages/lib/package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"name": "@codefixlabs/lib",
3-
"version": "0.1.17",
3+
"version": "0.1.18",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
7-
"./package.json": "./package.json",
8-
"./*": {
9-
"types": "./dist/*.d.ts",
10-
"import": "./dist/*.mjs",
11-
"require": "./dist/*.js"
12-
}
13-
},
14-
"typesVersions": {
15-
"*": {
16-
"*": [
17-
"dist/*"
18-
]
7+
".": {
8+
"import": {
9+
"types": "./dist/index.d.mts",
10+
"default": "./dist/index.mjs"
11+
},
12+
"require": {
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.js"
15+
}
1916
}
2017
},
18+
"main": "./dist/index.js",
19+
"module": "./dist/index.mjs",
20+
"source": "./src/index.ts",
21+
"types": "./dist/index.d.ts",
2122
"files": [
2223
"dist"
2324
],

packages/lib/src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export * from '@/array';
2+
export * from '@/editor-parser';
3+
export * from '@/http-status';
4+
export * from '@/number';
5+
export * from '@/search-params';
6+
export * from '@/string';
7+
export * from '@/types';
8+
export * from '@/validation';
9+
export * from '@/wait';

packages/lib/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "@codefixlabs/tsconfig/react-library.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
54
"paths": {
65
"@/*": ["./src/*"]
76
}

packages/lib/tsup.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { defineConfig } from 'tsup';
44
export default defineConfig((options: Options) => ({
55
clean: !options.watch,
66
dts: true,
7-
entry: ['src/**/*.ts'],
7+
entry: ['src/index.ts'],
88
external: ['react'],
99
format: ['esm', 'cjs'],
10-
minify: !options.watch,
1110
sourcemap: true,
12-
splitting: false,
11+
splitting: true,
12+
treeshake: true,
1313
...options,
1414
}));

packages/tailwindcss/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @codefixlabs/tailwindcss
22

3+
## 0.1.21
4+
5+
### Patch Changes
6+
7+
- aaedd29: Optimizing performance
8+
39
## 0.1.20
410

511
### Patch Changes

packages/tailwindcss/package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"name": "@codefixlabs/tailwindcss",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
7-
"./package.json": "./package.json",
8-
"./*": {
9-
"types": "./dist/*.d.ts",
10-
"import": "./dist/*.mjs",
11-
"require": "./dist/*.js"
12-
}
13-
},
14-
"typesVersions": {
15-
"*": {
16-
"*": [
17-
"dist/*"
18-
]
7+
".": {
8+
"import": {
9+
"types": "./dist/index.d.mts",
10+
"default": "./dist/index.mjs"
11+
},
12+
"require": {
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.js"
15+
}
1916
}
2017
},
18+
"main": "./dist/index.js",
19+
"module": "./dist/index.mjs",
20+
"source": "./src/index.ts",
21+
"types": "./dist/index.d.ts",
2122
"files": [
2223
"dist"
2324
],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@/color/stone';

packages/tailwindcss/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from '@/color';
2+
export * from '@/lib';
3+
export * from '@/tailwind.config';

packages/tailwindcss/src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@/lib/utils';

packages/tailwindcss/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "@codefixlabs/tsconfig/react-library.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
54
"paths": {
65
"@/*": ["./src/*"]
76
}

packages/tailwindcss/tsup.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { defineConfig } from 'tsup';
44
export default defineConfig((options: Options) => ({
55
clean: !options.watch,
66
dts: true,
7-
entry: ['src/**/*.ts'],
7+
entry: ['src/index.ts'],
88
external: ['react'],
99
format: ['esm', 'cjs'],
10-
minify: !options.watch,
1110
sourcemap: true,
12-
splitting: false,
11+
splitting: true,
12+
treeshake: true,
1313
...options,
1414
}));

packages/ui/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @codefixlabs/ui
22

3+
## 0.1.40
4+
5+
### Patch Changes
6+
7+
- aaedd29: Optimizing performance
8+
- Optimizing performance
9+
- Updated dependencies [aaedd29]
10+
- @codefixlabs/hooks@0.1.15
11+
- @codefixlabs/lib@0.1.18
12+
313
## 0.1.39
414

515
### Patch Changes

packages/ui/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefixlabs/ui",
3-
"version": "0.1.39",
3+
"version": "0.1.40",
44
"license": "MIT",
55
"sideEffects": false,
66
"exports": {
@@ -66,7 +66,6 @@
6666
"@radix-ui/react-toggle-group": "^1.0.4",
6767
"@radix-ui/react-toolbar": "^1.0.4",
6868
"@radix-ui/react-tooltip": "^1.0.7",
69-
"@react-email/components": "^0.0.11",
7069
"@tanstack/react-table": "^8.10.7",
7170
"@tanstack/table-core": "^8.10.7",
7271
"@tiptap/extension-highlight": "^2.1.12",

0 commit comments

Comments
 (0)