@cloudwick/astral-ui-cli 0.6.0 → 1.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 +1363 -916
- 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 +3 -3
- package/dist/templates/utils/{index.tsx → index.ts} +0 -1
- package/dist/templates/utils/stringUtils/index.tsx +1 -0
- package/dist/templates/utils/stringUtils/isRegexSafe.ts +30 -0
- package/package.json +1 -2
- /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: {
|
|
@@ -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": "1.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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|