@cloudwick/astral-ui-cli 0.6.0 → 2.0.0
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 +20 -46
- package/dist/index.js +1567 -1245
- package/dist/index.js.map +1 -1
- package/dist/templates/css/base.css +1 -1
- package/dist/templates/hooks/index.ts +1 -0
- package/dist/templates/schema/components-config.schema.json +1 -8
- package/dist/templates/tailwind/tailwind.config.js +11 -11
- package/dist/templates/utils/{index.tsx → index.ts} +0 -2
- package/dist/templates/utils/stringUtils/index.tsx +1 -0
- package/dist/templates/utils/stringUtils/isRegexSafe.ts +30 -0
- package/package.json +2 -3
- package/dist/templates/utils/cn.ts +0 -13
- /package/dist/templates/{utils → hooks}/useWindowSize.ts +0 -0
- /package/dist/templates/utils/{debounce.tsx → debounce.ts} +0 -0
- /package/dist/templates/utils/{findParentAttribute.tsx → findParentAttribute.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useWindowSize } from "./useWindowSize";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* This file is auto-generated. Do not edit directly. */
|
|
2
|
-
/* It is updated whenever the
|
|
2
|
+
/* It is updated whenever the CLI is built. */
|
|
3
3
|
|
|
4
4
|
/** @type {import('tailwindcss').Config} */
|
|
5
5
|
export default {
|
|
6
6
|
prefix: "",
|
|
7
7
|
content: [
|
|
8
|
-
"./src
|
|
9
|
-
"./
|
|
8
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
9
|
+
"./index.html"
|
|
10
10
|
],
|
|
11
11
|
darkMode: "class",
|
|
12
12
|
variants: {
|
|
@@ -39,20 +39,20 @@ export default {
|
|
|
39
39
|
"to": { opacity: "0" }
|
|
40
40
|
},
|
|
41
41
|
"panel-slide-in": {
|
|
42
|
-
"from": {
|
|
43
|
-
"to": {
|
|
42
|
+
"from": { transform: "translateX(110vw)" },
|
|
43
|
+
"to": { transform: "translateX(0)" }
|
|
44
44
|
},
|
|
45
45
|
"panel-slide-in-rtl": {
|
|
46
|
-
"from": {
|
|
47
|
-
"to": {
|
|
46
|
+
"from": { transform: "translateX(-110vw)" },
|
|
47
|
+
"to": { transform: "translateX(0)" }
|
|
48
48
|
},
|
|
49
49
|
"panel-slide-out": {
|
|
50
|
-
"from": {
|
|
51
|
-
"to": {
|
|
50
|
+
"from": { transform: "translateX(0)" },
|
|
51
|
+
"to": { transform: "translateX(110vw)" }
|
|
52
52
|
},
|
|
53
53
|
"panel-slide-out-rtl": {
|
|
54
|
-
"from": {
|
|
55
|
-
"to": {
|
|
54
|
+
"from": { transform: "translateX(0)" },
|
|
55
|
+
"to": { transform: "translateX(-110vw)" }
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
colors: {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely validates a regex pattern for potential ReDoS vulnerabilities.
|
|
3
|
+
* Checks for dangerous patterns that could cause exponential backtracking.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} pattern - The regex pattern to validate
|
|
6
|
+
* @returns {boolean} True if pattern is safe, false if potentially dangerous
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* isRegexSafe("^[a-z]+$") // returns true (safe pattern)
|
|
10
|
+
* isRegexSafe("(a+)+") // returns false (nested quantifiers)
|
|
11
|
+
* isRegexSafe("(a|aa)+") // returns false (overlapping alternation)
|
|
12
|
+
*/
|
|
13
|
+
export const isRegexSafe = ( pattern: string ): boolean => {
|
|
14
|
+
// Check for nested quantifiers like (a+)+ or (a*)* or (a{1,})+ which cause exponential backtracking
|
|
15
|
+
if ( /\([^)]*[*+{][^)]*\)[*+{]/.test( pattern )) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Check for alternation with overlap like (a|a)+ or (ab|a)+
|
|
20
|
+
if ( /\([^)]*\|[^)]*\)[*+{]/.test( pattern )) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Check for excessive length (unreasonably long patterns)
|
|
25
|
+
if ( pattern.length > 500 ) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return true;
|
|
30
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudwick/astral-ui-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "CLI for installing Astral UI components in any codebase",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsup",
|
|
16
|
-
"dev": "tsup --watch",
|
|
17
16
|
"test": "vitest run",
|
|
18
17
|
"lint:js": "eslint \"src/**/*.ts\"",
|
|
19
18
|
"lint": "yarn lint:js",
|
|
@@ -60,4 +59,4 @@
|
|
|
60
59
|
"engines": {
|
|
61
60
|
"node": ">=18.0.0"
|
|
62
61
|
}
|
|
63
|
-
}
|
|
62
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from "clsx";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Merges multiple class values into a single className string
|
|
6
|
-
* Uses clsx for conditional classes and twMerge to handle Tailwind conflicts
|
|
7
|
-
* @param inputs - Class values to merge
|
|
8
|
-
* @returns Merged className string
|
|
9
|
-
* @example cn("text-red-500", "bg-blue-500", isActive && "font-bold")
|
|
10
|
-
*/
|
|
11
|
-
export function cn( ...inputs: ClassValue[]) {
|
|
12
|
-
return twMerge( clsx( inputs ));
|
|
13
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|