galaxy-design 0.2.70 → 0.2.72

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.
@@ -0,0 +1,131 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Galaxy Framework Registry",
4
+ "description": "Framework-specific source-of-truth registry used for file copying, dependency resolution, and installation.",
5
+ "type": "object",
6
+ "required": ["components", "groups"],
7
+ "properties": {
8
+ "name": {
9
+ "type": "string"
10
+ },
11
+ "framework": {
12
+ "type": "string",
13
+ "enum": [
14
+ "react",
15
+ "vue",
16
+ "angular",
17
+ "react-native",
18
+ "flutter"
19
+ ]
20
+ },
21
+ "components": {
22
+ "type": "object",
23
+ "additionalProperties": {
24
+ "$ref": "#/definitions/frameworkComponent"
25
+ }
26
+ },
27
+ "groups": {
28
+ "type": "object",
29
+ "additionalProperties": {
30
+ "$ref": "#/definitions/componentGroup"
31
+ }
32
+ }
33
+ },
34
+ "definitions": {
35
+ "componentGroup": {
36
+ "type": "object",
37
+ "required": ["name", "components"],
38
+ "properties": {
39
+ "name": {
40
+ "type": "string"
41
+ },
42
+ "components": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "string"
46
+ }
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ },
51
+ "frameworkComponent": {
52
+ "type": "object",
53
+ "required": [
54
+ "name",
55
+ "type",
56
+ "description",
57
+ "files",
58
+ "dependencies",
59
+ "devDependencies",
60
+ "registryDependencies",
61
+ "category"
62
+ ],
63
+ "properties": {
64
+ "name": {
65
+ "type": "string"
66
+ },
67
+ "selector": {
68
+ "type": "string"
69
+ },
70
+ "type": {
71
+ "type": "string",
72
+ "enum": [
73
+ "form",
74
+ "layout",
75
+ "navigation",
76
+ "feedback",
77
+ "data-display",
78
+ "modal-overlay",
79
+ "interactive",
80
+ "charts",
81
+ "block",
82
+ "other"
83
+ ]
84
+ },
85
+ "description": {
86
+ "type": "string"
87
+ },
88
+ "files": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string"
92
+ }
93
+ },
94
+ "dependencies": {
95
+ "type": "array",
96
+ "items": {
97
+ "type": "string"
98
+ }
99
+ },
100
+ "devDependencies": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "string"
104
+ }
105
+ },
106
+ "peerDependencies": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "string"
110
+ }
111
+ },
112
+ "registryDependencies": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "exports": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "string"
122
+ }
123
+ },
124
+ "category": {
125
+ "type": "string"
126
+ }
127
+ },
128
+ "additionalProperties": true
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,177 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Galaxy Registry Summary",
4
+ "description": "Discovery-focused component catalog. Use registry-<framework>.json for framework-specific source-of-truth data.",
5
+ "type": "object",
6
+ "required": ["components", "groups"],
7
+ "properties": {
8
+ "components": {
9
+ "type": "object",
10
+ "additionalProperties": {
11
+ "$ref": "#/definitions/componentSummary"
12
+ }
13
+ },
14
+ "groups": {
15
+ "type": "object",
16
+ "additionalProperties": {
17
+ "$ref": "#/definitions/componentGroup"
18
+ }
19
+ }
20
+ },
21
+ "definitions": {
22
+ "framework": {
23
+ "type": "string",
24
+ "enum": [
25
+ "react",
26
+ "nextjs",
27
+ "vue",
28
+ "nuxtjs",
29
+ "angular",
30
+ "react-native",
31
+ "flutter"
32
+ ]
33
+ },
34
+ "componentGroup": {
35
+ "type": "object",
36
+ "required": ["name", "components"],
37
+ "properties": {
38
+ "name": {
39
+ "type": "string"
40
+ },
41
+ "components": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string"
45
+ }
46
+ }
47
+ },
48
+ "additionalProperties": false
49
+ },
50
+ "propType": {
51
+ "type": "object",
52
+ "properties": {
53
+ "kind": {
54
+ "type": "string"
55
+ },
56
+ "name": {
57
+ "type": "string"
58
+ },
59
+ "values": {
60
+ "type": "array"
61
+ },
62
+ "of": {}
63
+ },
64
+ "additionalProperties": true
65
+ },
66
+ "propOverride": {
67
+ "type": "object",
68
+ "properties": {
69
+ "name": {
70
+ "type": "string"
71
+ },
72
+ "type": {
73
+ "$ref": "#/definitions/propType"
74
+ },
75
+ "default": {},
76
+ "description": {
77
+ "type": "string"
78
+ }
79
+ },
80
+ "additionalProperties": true
81
+ },
82
+ "propDefinition": {
83
+ "type": "object",
84
+ "required": ["name", "type", "frameworks"],
85
+ "properties": {
86
+ "name": {
87
+ "type": "string"
88
+ },
89
+ "type": {
90
+ "$ref": "#/definitions/propType"
91
+ },
92
+ "default": {},
93
+ "description": {
94
+ "type": "string"
95
+ },
96
+ "frameworks": {
97
+ "type": "array",
98
+ "items": {
99
+ "$ref": "#/definitions/framework"
100
+ }
101
+ },
102
+ "overrides": {
103
+ "type": "object",
104
+ "additionalProperties": {
105
+ "$ref": "#/definitions/propOverride"
106
+ }
107
+ }
108
+ },
109
+ "additionalProperties": true
110
+ },
111
+ "childComponent": {
112
+ "type": "object",
113
+ "required": ["name", "props"],
114
+ "properties": {
115
+ "name": {
116
+ "type": "string"
117
+ },
118
+ "props": {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/definitions/propDefinition"
122
+ }
123
+ }
124
+ },
125
+ "additionalProperties": false
126
+ },
127
+ "componentSummary": {
128
+ "type": "object",
129
+ "required": ["name", "type", "description", "category", "frameworks"],
130
+ "properties": {
131
+ "name": {
132
+ "type": "string"
133
+ },
134
+ "type": {
135
+ "type": "string",
136
+ "enum": [
137
+ "form",
138
+ "layout",
139
+ "navigation",
140
+ "feedback",
141
+ "data-display",
142
+ "modal-overlay",
143
+ "interactive",
144
+ "charts",
145
+ "block",
146
+ "other"
147
+ ]
148
+ },
149
+ "description": {
150
+ "type": "string"
151
+ },
152
+ "category": {
153
+ "type": "string"
154
+ },
155
+ "frameworks": {
156
+ "type": "array",
157
+ "items": {
158
+ "$ref": "#/definitions/framework"
159
+ }
160
+ },
161
+ "props": {
162
+ "type": "array",
163
+ "items": {
164
+ "$ref": "#/definitions/propDefinition"
165
+ }
166
+ },
167
+ "children": {
168
+ "type": "array",
169
+ "items": {
170
+ "$ref": "#/definitions/childComponent"
171
+ }
172
+ }
173
+ },
174
+ "additionalProperties": true
175
+ }
176
+ }
177
+ }
@@ -11,7 +11,8 @@ import { dirname } from 'path';
11
11
  * Get GitHub raw content URL
12
12
  */ export function getGitHubRawUrl(filePath) {
13
13
  const { owner, repo, branch } = GITHUB_CONFIG;
14
- return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}`;
14
+ const cacheBust = Date.now();
15
+ return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}?v=${cacheBust}`;
15
16
  }
16
17
  /**
17
18
  * Fetch file content from GitHub
@@ -21,7 +22,13 @@ import { dirname } from 'path';
21
22
  */ export async function fetchFileFromGitHub(filePath) {
22
23
  const url = getGitHubRawUrl(filePath);
23
24
  try {
24
- const response = await fetch(url);
25
+ const response = await fetch(url, {
26
+ cache: 'no-store',
27
+ headers: {
28
+ 'Cache-Control': 'no-cache',
29
+ Pragma: 'no-cache'
30
+ }
31
+ });
25
32
  if (!response.ok) {
26
33
  if (response.status === 404) {
27
34
  throw new Error(`File not found: ${filePath}`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/github-fetcher.ts"],"sourcesContent":["import { writeFileSync, mkdirSync, existsSync } from 'fs';\nimport { dirname } from 'path';\n\n/**\n * GitHub repository configuration\n */\nconst GITHUB_CONFIG = {\n\towner: 'buikevin',\n\trepo: 'galaxy-design',\n\tbranch: 'main',\n};\n\n/**\n * Get GitHub raw content URL\n */\nexport function getGitHubRawUrl(filePath: string): string {\n\tconst { owner, repo, branch } = GITHUB_CONFIG;\n\treturn `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}`;\n}\n\n/**\n * Fetch file content from GitHub\n *\n * @param filePath - Relative path in repository\n * @returns File content as string\n */\nexport async function fetchFileFromGitHub(filePath: string): Promise<string> {\n\tconst url = getGitHubRawUrl(filePath);\n\n\ttry {\n\t\tconst response = await fetch(url);\n\n\t\tif (!response.ok) {\n\t\t\tif (response.status === 404) {\n\t\t\t\tthrow new Error(`File not found: ${filePath}`);\n\t\t\t}\n\t\t\tthrow new Error(`Failed to fetch ${filePath}: ${response.statusText}`);\n\t\t}\n\n\t\treturn await response.text();\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tthrow new Error(`GitHub fetch error: ${error.message}`);\n\t\t}\n\t\tthrow new Error(`Unknown error fetching ${filePath}`);\n\t}\n}\n\n/**\n * Fetch and save file from GitHub to local path\n *\n * @param sourceFilePath - Path in GitHub repository\n * @param targetFilePath - Local file path to save\n * @returns True if successful\n */\nexport async function fetchAndSaveFile(\n\tsourceFilePath: string,\n\ttargetFilePath: string,\n): Promise<boolean> {\n\ttry {\n\t\tconst content = await fetchFileFromGitHub(sourceFilePath);\n\n\t\t// Create directory if it doesn't exist\n\t\tconst dir = dirname(targetFilePath);\n\t\tif (!existsSync(dir)) {\n\t\t\tmkdirSync(dir, { recursive: true });\n\t\t}\n\n\t\t// Write file\n\t\twriteFileSync(targetFilePath, content, 'utf-8');\n\t\treturn true;\n\t} catch (error) {\n\t\tconsole.error(`Failed to fetch and save ${sourceFilePath}:`, error);\n\t\treturn false;\n\t}\n}\n\n/**\n * Fetch multiple files from GitHub\n *\n * @param files - Array of { source: githubPath, target: localPath }\n * @returns Results for each file\n */\nexport async function fetchMultipleFiles(\n\tfiles: Array<{ source: string; target: string }>,\n): Promise<Array<{ file: string; success: boolean; error?: string }>> {\n\tconst results = await Promise.all(\n\t\tfiles.map(async ({ source, target }) => {\n\t\t\ttry {\n\t\t\t\tconst success = await fetchAndSaveFile(source, target);\n\t\t\t\treturn {\n\t\t\t\t\tfile: source,\n\t\t\t\t\tsuccess,\n\t\t\t\t\terror: success ? undefined : 'Failed to fetch',\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn {\n\t\t\t\t\tfile: source,\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: error instanceof Error ? error.message : 'Unknown error',\n\t\t\t\t};\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn results;\n}\n\n/**\n * Get component source path in GitHub repository\n *\n * @param platform - Platform (vue, react, angular, react-native, flutter)\n * @param componentName - Component name\n * @param fileName - File name\n * @returns GitHub repository path\n */\nexport function getComponentGitHubPath(\n\tplatform: string,\n\tcomponentName: string,\n\tfileName: string,\n): string {\n\t// Map platform to package directory\n\tconst platformMap: Record<string, string> = {\n\t\tvue: 'packages/vue/src/components',\n\t\treact: 'packages/react/src/components',\n\t\tangular: 'packages/angular/src/components',\n\t\t'react-native': 'packages/react-native/src/components',\n\t\tflutter: 'packages/flutter/lib/components',\n\t};\n\n\tconst basePath = platformMap[platform] || `packages/${platform}/src/components`;\n\treturn `${basePath}/${componentName}/${fileName}`;\n}\n\n/**\n * Check if GitHub repository is accessible\n */\nexport async function checkGitHubConnection(): Promise<boolean> {\n\ttry {\n\t\tconst url = getGitHubRawUrl('README.md');\n\t\tconst response = await fetch(url, { method: 'HEAD' });\n\t\treturn response.ok;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"names":["writeFileSync","mkdirSync","existsSync","dirname","GITHUB_CONFIG","owner","repo","branch","getGitHubRawUrl","filePath","fetchFileFromGitHub","url","response","fetch","ok","status","Error","statusText","text","error","message","fetchAndSaveFile","sourceFilePath","targetFilePath","content","dir","recursive","console","fetchMultipleFiles","files","results","Promise","all","map","source","target","success","file","undefined","getComponentGitHubPath","platform","componentName","fileName","platformMap","vue","react","angular","flutter","basePath","checkGitHubConnection","method"],"mappings":"AAAA,SAASA,aAAa,EAAEC,SAAS,EAAEC,UAAU,QAAQ,KAAK;AAC1D,SAASC,OAAO,QAAQ,OAAO;AAE/B;;CAEC,GACD,MAAMC,gBAAgB;IACrBC,OAAO;IACPC,MAAM;I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;;;;;CAKC,GACD,OAAO,eAAeS,mBACrBC,KAAgD;IAEhD,MAAMC,UAAU,MAAMC,QAAQC,GAAG,CAChCH,MAAMI,GAAG,CAAC,OAAO,EAAEC,MAAM,EAAEC,MAAM,EAAE;QAClC,IAAI;YACH,MAAMC,UAAU,MAAMf,iBAAiBa,QAAQC;YAC/C,OAAO;gBACNE,MAAMH;gBACNE;gBACAjB,OAAOiB,UAAUE,YAAY;YAC9B;QACD,EAAE,OAAOnB,OAAO;YACf,OAAO;gBACNkB,MAAMH;gBACNE,SAAS;gBACTjB,OAAOA,iBAAiBH,QAAQG,MAAMC,OAAO,GAAG;YACjD;QACD;IACD;IAGD,OAAOU;AACR;AAEA;;;;;;;CAOC,GACD,OAAO,SAASS,uBACfC,QAAgB,EAChBC,aAAqB,EACrBC,QAAgB;IAEhB,oCAAoC;IACpC,MAAMC,cAAsC;QAC3CC,KAAK;QACLC,OAAO;QACPC,SAAS;QACT,gBAAgB;QAChBC,SAAS;IACV;IAEA,MAAMC,WAAWL,WAAW,CAACH,SAAS,IAAI,CAAC,SAAS,EAAEA,SAAS,eAAe,CAAC;IAC/E,OAAO,GAAGQ,SAAS,CAAC,EAAEP,cAAc,CAAC,EAAEC,UAAU;AAClD;AAEA;;CAEC,GACD,OAAO,eAAeO;IACrB,IAAI;QACH,MAAMtC,MAAMH,gBAAgB;QAC5B,MAAMI,WAAW,MAAMC,MAAMF,KAAK;YAAEuC,QAAQ;QAAO;QACnD,OAAOtC,SAASE,EAAE;IACnB,EAAE,UAAM;QACP,OAAO;IACR;AACD"}
1
+ {"version":3,"sources":["../../src/utils/github-fetcher.ts"],"sourcesContent":["import { writeFileSync, mkdirSync, existsSync } from 'fs';\nimport { dirname } from 'path';\n\n/**\n * GitHub repository configuration\n */\nconst GITHUB_CONFIG = {\n\towner: 'buikevin',\n\trepo: 'galaxy-design',\n\tbranch: 'main',\n};\n\n/**\n * Get GitHub raw content URL\n */\nexport function getGitHubRawUrl(filePath: string): string {\n\tconst { owner, repo, branch } = GITHUB_CONFIG;\n\tconst cacheBust = Date.now();\n\treturn `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}?v=${cacheBust}`;\n}\n\n/**\n * Fetch file content from GitHub\n *\n * @param filePath - Relative path in repository\n * @returns File content as string\n */\nexport async function fetchFileFromGitHub(filePath: string): Promise<string> {\n\tconst url = getGitHubRawUrl(filePath);\n\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tcache: 'no-store',\n\t\t\theaders: {\n\t\t\t\t'Cache-Control': 'no-cache',\n\t\t\t\tPragma: 'no-cache',\n\t\t\t},\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tif (response.status === 404) {\n\t\t\t\tthrow new Error(`File not found: ${filePath}`);\n\t\t\t}\n\t\t\tthrow new Error(`Failed to fetch ${filePath}: ${response.statusText}`);\n\t\t}\n\n\t\treturn await response.text();\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tthrow new Error(`GitHub fetch error: ${error.message}`);\n\t\t}\n\t\tthrow new Error(`Unknown error fetching ${filePath}`);\n\t}\n}\n\n/**\n * Fetch and save file from GitHub to local path\n *\n * @param sourceFilePath - Path in GitHub repository\n * @param targetFilePath - Local file path to save\n * @returns True if successful\n */\nexport async function fetchAndSaveFile(\n\tsourceFilePath: string,\n\ttargetFilePath: string,\n): Promise<boolean> {\n\ttry {\n\t\tconst content = await fetchFileFromGitHub(sourceFilePath);\n\n\t\t// Create directory if it doesn't exist\n\t\tconst dir = dirname(targetFilePath);\n\t\tif (!existsSync(dir)) {\n\t\t\tmkdirSync(dir, { recursive: true });\n\t\t}\n\n\t\t// Write file\n\t\twriteFileSync(targetFilePath, content, 'utf-8');\n\t\treturn true;\n\t} catch (error) {\n\t\tconsole.error(`Failed to fetch and save ${sourceFilePath}:`, error);\n\t\treturn false;\n\t}\n}\n\n/**\n * Fetch multiple files from GitHub\n *\n * @param files - Array of { source: githubPath, target: localPath }\n * @returns Results for each file\n */\nexport async function fetchMultipleFiles(\n\tfiles: Array<{ source: string; target: string }>,\n): Promise<Array<{ file: string; success: boolean; error?: string }>> {\n\tconst results = await Promise.all(\n\t\tfiles.map(async ({ source, target }) => {\n\t\t\ttry {\n\t\t\t\tconst success = await fetchAndSaveFile(source, target);\n\t\t\t\treturn {\n\t\t\t\t\tfile: source,\n\t\t\t\t\tsuccess,\n\t\t\t\t\terror: success ? undefined : 'Failed to fetch',\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn {\n\t\t\t\t\tfile: source,\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: error instanceof Error ? error.message : 'Unknown error',\n\t\t\t\t};\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn results;\n}\n\n/**\n * Get component source path in GitHub repository\n *\n * @param platform - Platform (vue, react, angular, react-native, flutter)\n * @param componentName - Component name\n * @param fileName - File name\n * @returns GitHub repository path\n */\nexport function getComponentGitHubPath(\n\tplatform: string,\n\tcomponentName: string,\n\tfileName: string,\n): string {\n\t// Map platform to package directory\n\tconst platformMap: Record<string, string> = {\n\t\tvue: 'packages/vue/src/components',\n\t\treact: 'packages/react/src/components',\n\t\tangular: 'packages/angular/src/components',\n\t\t'react-native': 'packages/react-native/src/components',\n\t\tflutter: 'packages/flutter/lib/components',\n\t};\n\n\tconst basePath = platformMap[platform] || `packages/${platform}/src/components`;\n\treturn `${basePath}/${componentName}/${fileName}`;\n}\n\n/**\n * Check if GitHub repository is accessible\n */\nexport async function checkGitHubConnection(): Promise<boolean> {\n\ttry {\n\t\tconst url = getGitHubRawUrl('README.md');\n\t\tconst response = await fetch(url, { method: 'HEAD' });\n\t\treturn response.ok;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"names":["writeFileSync","mkdirSync","existsSync","dirname","GITHUB_CONFIG","owner","repo","branch","getGitHubRawUrl","filePath","cacheBust","Date","now","fetchFileFromGitHub","url","response","fetch","cache","headers","Pragma","ok","status","Error","statusText","text","error","message","fetchAndSaveFile","sourceFilePath","targetFilePath","content","dir","recursive","console","fetchMultipleFiles","files","results","Promise","all","map","source","target","success","file","undefined","getComponentGitHubPath","platform","componentName","fileName","platformMap","vue","react","angular","flutter","basePath","checkGitHubConnection","method"],"mappings":"AAAA,SAASA,aAAa,EAAEC,SAAS,EAAEC,UAAU,QAAQ,KAAK;AAC1D,SAASC,OAAO,QAAQ,OAAO;AAE/B;;CAEC,GACD,MAAMC,gBAAgB;IACrBC,OAAO;IACPC,MAAM;IACNC,QAAQ;AACT;AAEA;;CAEC,GACD,OAAO,SAASC,gBAAgBC,QAAgB;IAC/C,MAAM,EAAEJ,KAAK,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGH;IAChC,MAAMM,YAAYC,KAAKC,GAAG;IAC1B,OAAO,CAAC,kCAAkC,EAAEP,MAAM,CAAC,EAAEC,KAAK,CAAC,EAAEC,OAAO,CAAC,EAAEE,SAAS,GAAG,EAAEC,WAAW;AACjG;AAEA;;;;;CAKC,GACD,OAAO,eAAeG,oBAAoBJ,QAAgB;IACzD,MAAMK,MAAMN,gBAAgBC;IAE5B,IAAI;QACH,MAAMM,WAAW,MAAMC,MAAMF,KAAK;YACjCG,OAAO;YACPC,SAAS;gBACR,iBAAiB;gBACjBC,QAAQ;YACT;QACD;QAEA,IAAI,CAACJ,SAASK,EAAE,EAAE;YACjB,IAAIL,SAASM,MAAM,KAAK,KAAK;gBAC5B,MAAM,IAAIC,MAAM,CAAC,gBAAgB,EAAEb,UAAU;YAC9C;YACA,MAAM,IAAIa,MAAM,CAAC,gBAAgB,EAAEb,SAAS,EAAE,EAAEM,SAASQ,UAAU,EAAE;QACtE;QAEA,OAAO,MAAMR,SAASS,IAAI;IAC3B,EAAE,OAAOC,OAAO;QACf,IAAIA,iBAAiBH,OAAO;YAC3B,MAAM,IAAIA,MAAM,CAAC,oBAAoB,EAAEG,MAAMC,OAAO,EAAE;QACvD;QACA,MAAM,IAAIJ,MAAM,CAAC,uBAAuB,EAAEb,UAAU;IACrD;AACD;AAEA;;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ACH,MAAMzC,MAAMN,gBAAgB;QAC5B,MAAMO,WAAW,MAAMC,MAAMF,KAAK;YAAE0C,QAAQ;QAAO;QACnD,OAAOzC,SAASK,EAAE;IACnB,EAAE,UAAM;QACP,OAAO;IACR;AACD"}
@@ -33,6 +33,12 @@ let cachedRegistry = null;
33
33
  const registry = loadRegistry();
34
34
  return Object.values(registry.components).filter((c)=>c.type === type);
35
35
  }
36
+ /**
37
+ * Get components that support a specific framework
38
+ */ export function getComponentsByFramework(framework) {
39
+ const registry = loadRegistry();
40
+ return Object.values(registry.components).filter((component)=>component.frameworks.includes(framework));
41
+ }
36
42
  /**
37
43
  * Get components by group name
38
44
  */ export function getComponentsByGroup(groupName) {
@@ -58,14 +64,8 @@ let cachedRegistry = null;
58
64
  /**
59
65
  * Get component dependencies (including peer dependencies)
60
66
  */ export function getComponentDependencies(name) {
61
- const component = getComponent(name);
62
- if (!component) {
63
- return [];
64
- }
65
- const deps = new Set();
66
- // Add component dependencies
67
- component.dependencies.forEach((dep)=>deps.add(dep));
68
- return Array.from(deps);
67
+ void name;
68
+ return [];
69
69
  }
70
70
  /**
71
71
  * Resolve component names with aliases
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/registry.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nexport interface Component {\n name: string;\n selector: string;\n type: 'form' | 'layout' | 'navigation' | 'data-display' | 'modal-overlay' | 'other';\n description: string;\n files: string[];\n dependencies: string[];\n peerDependencies: string[];\n exports: string[];\n}\n\nexport interface ComponentGroup {\n name: string;\n components: string[];\n}\n\nexport interface Registry {\n components: Record<string, Component>;\n groups: Record<string, ComponentGroup>;\n}\n\nlet cachedRegistry: Registry | null = null;\n\n/**\n * Load the component registry\n */\nexport function loadRegistry(): Registry {\n if (cachedRegistry) {\n return cachedRegistry;\n }\n\n const registryPath = resolve(__dirname, '../registry.json');\n const registryContent = readFileSync(registryPath, 'utf-8');\n cachedRegistry = JSON.parse(registryContent);\n return cachedRegistry;\n}\n\n/**\n * Get a component by name\n */\nexport function getComponent(name: string): Component | undefined {\n const registry = loadRegistry();\n return registry.components[name];\n}\n\n/**\n * Get all components\n */\nexport function getAllComponents(): Record<string, Component> {\n const registry = loadRegistry();\n return registry.components;\n}\n\n/**\n * Get components by type\n */\nexport function getComponentsByType(type: 'form' | 'layout' | 'navigation' | 'data-display' | 'modal-overlay' | 'other'): Component[] {\n const registry = loadRegistry();\n return Object.values(registry.components).filter(c => c.type === type);\n}\n\n/**\n * Get components by group name\n */\nexport function getComponentsByGroup(groupName: string): Component[] {\n const registry = loadRegistry();\n const group = registry.groups[groupName];\n\n if (!group) {\n return [];\n }\n\n return group.components\n .map(name => registry.components[name])\n .filter(Boolean);\n}\n\n/**\n * Get all component groups\n */\nexport function getAllGroups(): Record<string, ComponentGroup> {\n const registry = loadRegistry();\n return registry.groups;\n}\n\n/**\n * Check if a component exists\n */\nexport function componentExists(name: string): boolean {\n const registry = loadRegistry();\n return !!registry.components[name];\n}\n\n/**\n * Get component dependencies (including peer dependencies)\n */\nexport function getComponentDependencies(name: string): string[] {\n const component = getComponent(name);\n if (!component) {\n return [];\n }\n\n const deps = new Set<string>();\n\n // Add component dependencies\n component.dependencies.forEach(dep => deps.add(dep));\n\n return Array.from(deps);\n}\n\n/**\n * Resolve component names with aliases\n */\nexport function resolveComponentName(input: string): string | null {\n const registry = loadRegistry();\n\n // Check exact match\n if (registry.components[input]) {\n return input;\n }\n\n // Check group match\n if (registry.groups[input]) {\n return input;\n }\n\n // Check case-insensitive match\n const lowerInput = input.toLowerCase();\n for (const name of Object.keys(registry.components)) {\n if (name.toLowerCase() === lowerInput) {\n return name;\n }\n }\n\n return null;\n}\n"],"names":["readFileSync","resolve","dirname","fileURLToPath","__filename","url","__dirname","cachedRegistry","loadRegistry","registryPath","registryContent","JSON","parse","getComponent","name","registry","components","getAllComponents","getComponentsByType","type","Object","values","filter","c","getComponentsByGroup","groupName","group","groups","map","Boolean","getAllGroups","componentExists","getComponentDependencies","component","deps","Set","dependencies","forEach","dep","add","Array","from","resolveComponentName","input","lowerInput","toLowerCase","keys"],"mappings":"AAAA,SAASA,YAAY,QAAQ,KAAK;AAClC,SAASC,OAAO,EAAEC,OAAO,QAAQ,OAAO;AACxC,SAASC,aAAa,QAAQ,MAAM;AAEpC,MAAMC,aAAaD,cAAc,YAAYE,GAAG;AAChD,MAAMC,YAAYJ,QAAQE;AAuB1B,IAAIG,iBAAkC;AAEtC;;CAEC,GACD,OAAO,SAASC;IACd,IAAID,gBAAgB;QAClB,OAAOA;IACT;IAEA,MAAME,eAAeR,QAAQK,WAAW;IACxC,MAAMI,kBAAkBV,aAAaS,cAAc;IACnDF,iBAAiBI,KAAKC,KAAK,CAACF;IAC5B,OAAOH;AACT;AAEA;;CAEC,GACD,OAAO,SAASM,aAAaC,IAAY;IACvC,MAAMC,WAAWP;IACjB,OAAOO,SAASC,UAAU,CAACF,KAAK;AAClC;AAEA;;CAEC,GACD,OAAO,SAASG;IACd,MAAMF,WAAWP;IACjB,OAAOO,SAASC,UAAU;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASE,oBAAoBC,IAAmF;IACrH,MAAMJ,WAAWP;IACjB,OAAOY,OAAOC,MAAM,CAACN,SAASC,UAAU,EAAEM,MAAM,CAACC,CAAAA,IAAKA,EAAEJ,IAAI,KAAKA;AACnE;AAEA;;CAEC,GACD,OAAO,SAASK,qBAAqBC,SAAiB;IACpD,MAAMV,WAAWP;IACjB,MAAMkB,QAAQX,SAASY,MAAM,CAACF,UAAU;IAExC,IAAI,CAACC,OAAO;QACV,OAAO,EAAE;IACX;IAEA,OAAOA,MAAMV,UAAU,CACpBY,GAAG,CAACd,CAAAA,OAAQC,SAASC,UAAU,CAACF,KAAK,EACrCQ,MAAM,CAACO;AACZ;AAEA;;CAEC,GACD,OAAO,SAASC;IACd,MAAMf,WAAWP;IACjB,OAAOO,SAASY,MAAM;AACxB;AAEA;;CAEC,GACD,OAAO,SAASI,gBAAgBjB,IAAY;IAC1C,MAAMC,WAAWP;IACjB,OAAO,CAAC,CAACO,SAASC,UAAU,CAACF,KAAK;AACpC;AAEA;;CAEC,GACD,OAAO,SAASkB,yBAAyBlB,IAAY;IACnD,MAAMmB,YAAYpB,aAAaC;IAC/B,IAAI,CAACmB,WAAW;QACd,OAAO,EAAE;IACX;IAEA,MAAMC,OAAO,IAAIC;IAEjB,6BAA6B;IAC7BF,UAAUG,YAAY,CAACC,OAAO,CAACC,CAAAA,MAAOJ,KAAKK,GAAG,CAACD;IAE/C,OAAOE,MAAMC,IAAI,CAACP;AACpB;AAEA;;CAEC,GACD,OAAO,SAASQ,qBAAqBC,KAAa;IAChD,MAAM5B,WAAWP;IAEjB,oBAAoB;IACpB,IAAIO,SAASC,UAAU,CAAC2B,MAAM,EAAE;QAC9B,OAAOA;IACT;IAEA,oBAAoB;IACpB,IAAI5B,SAASY,MAAM,CAACgB,MAAM,EAAE;QAC1B,OAAOA;IACT;IAEA,+BAA+B;IAC/B,MAAMC,aAAaD,MAAME,WAAW;IACpC,KAAK,MAAM/B,QAAQM,OAAO0B,IAAI,CAAC/B,SAASC,UAAU,EAAG;QACnD,IAAIF,KAAK+B,WAAW,OAAOD,YAAY;YACrC,OAAO9B;QACT;IACF;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../src/utils/registry.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nexport type SummaryFramework =\n | 'react'\n | 'nextjs'\n | 'vue'\n | 'nuxtjs'\n | 'angular'\n | 'react-native'\n | 'flutter';\n\nexport interface SummaryProp {\n name: string;\n type: unknown;\n default?: unknown;\n description?: string;\n frameworks?: SummaryFramework[];\n overrides?: Record<string, unknown>;\n}\n\nexport interface SummaryChildComponent {\n name: string;\n props: SummaryProp[];\n}\n\nexport interface Component {\n name: string;\n type:\n | 'form'\n | 'layout'\n | 'navigation'\n | 'feedback'\n | 'data-display'\n | 'modal-overlay'\n | 'interactive'\n | 'charts'\n | 'block'\n | 'other';\n description: string;\n category: string;\n frameworks: SummaryFramework[];\n props?: SummaryProp[];\n children?: SummaryChildComponent[];\n}\n\nexport interface ComponentGroup {\n name: string;\n components: string[];\n}\n\nexport interface Registry {\n components: Record<string, Component>;\n groups: Record<string, ComponentGroup>;\n}\n\nlet cachedRegistry: Registry | null = null;\n\n/**\n * Load the component registry\n */\nexport function loadRegistry(): Registry {\n if (cachedRegistry) {\n return cachedRegistry;\n }\n\n const registryPath = resolve(__dirname, '../registry.json');\n const registryContent = readFileSync(registryPath, 'utf-8');\n cachedRegistry = JSON.parse(registryContent);\n return cachedRegistry;\n}\n\n/**\n * Get a component by name\n */\nexport function getComponent(name: string): Component | undefined {\n const registry = loadRegistry();\n return registry.components[name];\n}\n\n/**\n * Get all components\n */\nexport function getAllComponents(): Record<string, Component> {\n const registry = loadRegistry();\n return registry.components;\n}\n\n/**\n * Get components by type\n */\nexport function getComponentsByType(type: Component['type']): Component[] {\n const registry = loadRegistry();\n return Object.values(registry.components).filter(c => c.type === type);\n}\n\n/**\n * Get components that support a specific framework\n */\nexport function getComponentsByFramework(framework: SummaryFramework): Component[] {\n const registry = loadRegistry();\n return Object.values(registry.components).filter((component) =>\n component.frameworks.includes(framework),\n );\n}\n\n/**\n * Get components by group name\n */\nexport function getComponentsByGroup(groupName: string): Component[] {\n const registry = loadRegistry();\n const group = registry.groups[groupName];\n\n if (!group) {\n return [];\n }\n\n return group.components\n .map(name => registry.components[name])\n .filter(Boolean);\n}\n\n/**\n * Get all component groups\n */\nexport function getAllGroups(): Record<string, ComponentGroup> {\n const registry = loadRegistry();\n return registry.groups;\n}\n\n/**\n * Check if a component exists\n */\nexport function componentExists(name: string): boolean {\n const registry = loadRegistry();\n return !!registry.components[name];\n}\n\n/**\n * Get component dependencies (including peer dependencies)\n */\nexport function getComponentDependencies(name: string): string[] {\n void name;\n return [];\n}\n\n/**\n * Resolve component names with aliases\n */\nexport function resolveComponentName(input: string): string | null {\n const registry = loadRegistry();\n\n // Check exact match\n if (registry.components[input]) {\n return input;\n }\n\n // Check group match\n if (registry.groups[input]) {\n return input;\n }\n\n // Check case-insensitive match\n const lowerInput = input.toLowerCase();\n for (const name of Object.keys(registry.components)) {\n if (name.toLowerCase() === lowerInput) {\n return name;\n }\n }\n\n return null;\n}\n"],"names":["readFileSync","resolve","dirname","fileURLToPath","__filename","url","__dirname","cachedRegistry","loadRegistry","registryPath","registryContent","JSON","parse","getComponent","name","registry","components","getAllComponents","getComponentsByType","type","Object","values","filter","c","getComponentsByFramework","framework","component","frameworks","includes","getComponentsByGroup","groupName","group","groups","map","Boolean","getAllGroups","componentExists","getComponentDependencies","resolveComponentName","input","lowerInput","toLowerCase","keys"],"mappings":"AAAA,SAASA,YAAY,QAAQ,KAAK;AAClC,SAASC,OAAO,EAAEC,OAAO,QAAQ,OAAO;AACxC,SAASC,aAAa,QAAQ,MAAM;AAEpC,MAAMC,aAAaD,cAAc,YAAYE,GAAG;AAChD,MAAMC,YAAYJ,QAAQE;AAuD1B,IAAIG,iBAAkC;AAEtC;;CAEC,GACD,OAAO,SAASC;IACd,IAAID,gBAAgB;QAClB,OAAOA;IACT;IAEA,MAAME,eAAeR,QAAQK,WAAW;IACxC,MAAMI,kBAAkBV,aAAaS,cAAc;IACnDF,iBAAiBI,KAAKC,KAAK,CAACF;IAC5B,OAAOH;AACT;AAEA;;CAEC,GACD,OAAO,SAASM,aAAaC,IAAY;IACvC,MAAMC,WAAWP;IACjB,OAAOO,SAASC,UAAU,CAACF,KAAK;AAClC;AAEA;;CAEC,GACD,OAAO,SAASG;IACd,MAAMF,WAAWP;IACjB,OAAOO,SAASC,UAAU;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASE,oBAAoBC,IAAuB;IACzD,MAAMJ,WA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OD,YAAY;YACrC,OAAO1B;QACT;IACF;IAEA,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "galaxy-design",
3
- "version": "0.2.70",
3
+ "version": "0.2.72",
4
4
  "description": "CLI tool for adding Galaxy UI components to your Vue, React, Angular, Next.js, Nuxt.js, React Native, or Flutter project",
5
5
  "author": "Bùi Trọng Hiếu (kevinbui) <kevinbui210191@gmail.com>",
6
6
  "license": "MIT",
@@ -60,7 +60,8 @@
60
60
  }
61
61
  },
62
62
  "scripts": {
63
- "build": "swc src -d dist --config-file .swcrc --strip-leading-paths && cp src/registry.json dist/ && cp -r src/registries dist/ && cp -r src/schemas dist/ && cp -r src/templates dist/",
63
+ "audit:registry": "node scripts/audit-registries.cjs",
64
+ "build": "swc src -d dist --config-file .swcrc --strip-leading-paths && cp src/registry.json dist/ && cp src/registries/registry-*.json dist/ && cp -r src/registries dist/ && cp -r src/schemas dist/ && cp -r src/templates dist/",
64
65
  "prepublishOnly": "npm run build"
65
66
  },
66
67
  "dependencies": {