shadcn-packaged 2025.1.18 → 2025.1.20

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.
Files changed (3) hide show
  1. package/README.md +30 -15
  2. package/index.mjs +0 -0
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Shadcn Packaged
2
2
 
3
- This is a npm package of all [shadcn/ui](https://ui.shadcn.com/) components without CLI for easy use.
3
+ This is an npm package that exports all [shadcn/ui](https://ui.shadcn.com/) components without the need for a CLI, designed for ease of use.
4
4
 
5
- It simply exports all the useful files with type declaration.
5
+ It simply provides all useful files along with type declarations.
6
6
 
7
7
  ## Pre work
8
8
 
@@ -24,14 +24,14 @@ tailwind.config.js
24
24
  const config = {
25
25
  content: [
26
26
  "...",
27
- "./node_modules/shadcn-packaged/**/*.{jsx,js,ts,tsx}",
27
+ "./node_modules/shadcn-packaged/**/*.{jsx,js,ts,tsx}"
28
28
  ],
29
- presets: [require("shadcn-packaged/tailwind.config")],
29
+ presets: [require("shadcn-packaged/tailwind.config")]
30
30
  };
31
31
  export default config;
32
32
  ```
33
33
 
34
- next.config.js
34
+ For nextjs user, next.config.js
35
35
 
36
36
  ```javascript
37
37
  const nextConfig = {
@@ -42,7 +42,7 @@ const nextConfig = {
42
42
  export default nextConfig;
43
43
  ```
44
44
 
45
- vite.config.js [#optimizedeps-include](https://cn.vitejs.dev/config/dep-optimization-options.html#optimizedeps-include)
45
+ For vite user, vite.config.js
46
46
 
47
47
  ```javascript
48
48
  export default defineConfig({
@@ -54,15 +54,9 @@ export default defineConfig({
54
54
 
55
55
  ## Usage
56
56
 
57
- Package Struct
58
-
59
- - shadcn-packaged/ui/*: components
60
- - shadcn-packaged/hooks/*: hooks
61
- - shadcn-packaged/lib/utils: utils
62
-
63
57
  Import style
64
58
 
65
- > If you have a fully customized style in tailwindcss entry, you don't need to import it
59
+ > If you have a fully customized style in global entry css file, you don't need to import it
66
60
 
67
61
  ```javascript
68
62
  import "shadcn-packaged/index.css";
@@ -76,17 +70,38 @@ import { cn } from 'shadcn-packaged/lib/utils';
76
70
  import { useToast } from 'shadcn/hooks/use-toast';
77
71
  ```
78
72
 
73
+ Package Struct
74
+
75
+ - shadcn-packaged/ui/*: components
76
+ - shadcn-packaged/hooks/*: hooks
77
+ - shadcn-packaged/lib/utils: utils
78
+
79
79
  ## Type declaration and IDE auto import
80
80
 
81
- This package support vscode auto import, add below code to project main.tsx or root layout.tsx in NextJS
81
+ This package support vscode auto import.
82
+
83
+ If the automatic code import does not take effect, please try the following methods.
84
+
85
+ 1. add below code to project main.tsx or root layout.tsx in NextJS.
82
86
 
83
87
  ```typescript
84
88
  /// <reference types="shadcn-packaged" />
85
89
  ```
86
90
 
91
+ 2. change tsconig.json
92
+
93
+ ```json
94
+ {
95
+ "compilerOptions": {
96
+ // append to exist types
97
+ "types": ["...", "./node_modules/shadcn-packaged/**/*.ts"]
98
+ }
99
+ }
100
+ ```
101
+
87
102
  ## Custom Theme
88
103
 
89
- index.css | global.css (the tailwindcss entry)
104
+ index.css | global.css (the global entry css file)
90
105
 
91
106
  ```css
92
107
  @tailwind base;
package/index.mjs ADDED
File without changes
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "shadcn-packaged",
3
3
  "private": false,
4
- "version": "2025.1.18",
4
+ "version": "2025.1.20",
5
5
  "type": "module",
6
+ "module": "index.mjs",
6
7
  "scripts": {
7
8
  "dev": "vite",
8
9
  "build": "npm run shadcn:clean && npm run shadcn:generate && npm run shadcn:tsc && npm run shadcn:move",
@@ -19,7 +20,8 @@
19
20
  "lib",
20
21
  "index.d.ts",
21
22
  "tailwind.config.js",
22
- "index.css"
23
+ "index.css",
24
+ "index.mjs"
23
25
  ],
24
26
  "dependencies": {
25
27
  "@hookform/resolvers": "^3.10.0",