kmod-cli 1.4.9 → 1.4.11

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/README.md CHANGED
@@ -38,8 +38,67 @@ npx kumod add --all # add all component
38
38
  npx kumod add button # add button component
39
39
  #...any other command
40
40
  ```
41
-
42
-
41
+ ## Components
42
+
43
+ - access-denied
44
+ - breadcumb
45
+ - count-down
46
+ - count-input
47
+ - button
48
+ - calendar
49
+ - date-input
50
+ - date-range-picker
51
+ - label
52
+ - popover
53
+ - select
54
+ - switch
55
+ - datetime-picker
56
+ - input
57
+ - period-input
58
+ - time-picker-input
59
+ - time-picker-utils
60
+ - time-picker
61
+ - gradient-outline
62
+ - gradient-svg
63
+ - grid-layout
64
+ - hydrate-guard
65
+ - image
66
+ - loader-slash-gradient
67
+ - masonry-gallery
68
+ - modal
69
+ - multi-select
70
+ - non-hydration
71
+ - portal
72
+ - segments-circle
73
+ - single-select
74
+ - stroke-circle
75
+ - column-table
76
+ - data-table
77
+ - readme
78
+ - table
79
+ - text-hover-effect
80
+ - timout-loader
81
+ - toast
82
+ - config
83
+ - feature-config
84
+ - keys
85
+ - api-service
86
+ - calculate
87
+ - idb
88
+ - lib
89
+ - storage
90
+ - fade-on-scroll
91
+ - safe-action
92
+ - spam-guard
93
+ - utils
94
+ - feature-guard
95
+ - refine-provider
96
+ - query
97
+ - color-by-text
98
+ - stripe-effect
99
+ - kookies
100
+ - hash-aes
101
+ - simple-validate
43
102
  ## Contributing
44
103
 
45
104
  Contributions are welcome! Please open issues or pull requests.
@@ -65,4 +65,6 @@ const components = scanTemplates(templatesDir);
65
65
 
66
66
  fs.writeFileSync(outPath, JSON.stringify(components, null, 2));
67
67
 
68
+
69
+
68
70
  console.log(`✅ Generated components.json with ${Object.keys(components).length} entries`);
@@ -0,0 +1,39 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ const readmePath = path.join(__dirname, '../README.md');
9
+ const componentsPath = path.join(__dirname, '../components.json');
10
+
11
+ // đọc components.json
12
+ const componentsConfig = JSON.parse(
13
+ fs.readFileSync(componentsPath, 'utf8')
14
+ );
15
+
16
+ // build list
17
+ const componentList = Object.keys(componentsConfig)
18
+ .map((k) => `- ${k}`)
19
+ .join('\n');
20
+
21
+ // đọc README
22
+ const readmeContent = fs.readFileSync(readmePath, 'utf8');
23
+
24
+ // regex tìm block ## Components
25
+ const regex = /## Components[\s\S]*?(?=\n## |\n?$)/;
26
+
27
+ if (!regex.test(readmeContent)) {
28
+ throw new Error('Không tìm thấy heading "## Components" trong README.md');
29
+ }
30
+
31
+ const newReadme = readmeContent.replace(
32
+ regex,
33
+ `## Components\n\n${componentList}`
34
+ );
35
+
36
+ // ghi lại README
37
+ fs.writeFileSync(readmePath, newReadme);
38
+
39
+ console.log('✅ Updated README.md');
@@ -1167,9 +1167,29 @@ export const cookiesProvider = {
1167
1167
 
1168
1168
  // =================== Example ===================
1169
1169
 
1170
+ // create httpClient
1171
+
1172
+ // const TOKEN = "token";
1173
+
1174
+ // const httpClient = createHttpClient(
1175
+ // `${process.env.NEXT_PUBLIC_API_URL}`,
1176
+ // TOKEN, --> key_name_cookie
1177
+ // "cookie", --> storage
1178
+ // "Bearer" --> prefix
1179
+ // );
1180
+
1181
+
1182
+ // create dataProvider
1183
+
1184
+ // const dataProvider = useDataProvider(httpClient);
1185
+
1170
1186
  // wrapped all into:
1171
- // <DataProvider>
1172
- // <AuthProvider>
1187
+ // <DataProvider dataProvider={dataProvider}>
1188
+ // <AuthProvider
1189
+ // loginUrl={"/auth/login"} --> api_login
1190
+ // tokenKey={TOKEN}
1191
+ // meUrl='/auth/me' --> api_get_me_by_token
1192
+ // >
1173
1193
  // <App />
1174
1194
  // </AuthProvider>
1175
1195
  // </DataProvider>
package/components.json CHANGED
@@ -358,7 +358,9 @@
358
358
  "dependencies": [
359
359
  "js-cookie"
360
360
  ],
361
- "devDependencies": []
361
+ "devDependencies": [
362
+ "@types/js-cookie"
363
+ ]
362
364
  },
363
365
  "hash-aes": {
364
366
  "path": "component-templates/utils/hash/hash-aes.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmod-cli",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "Stack components utilities fast setup in projects",
5
5
  "author": "kumo_d",
6
6
  "license": "MIT",