@supernovaio/cli 2.0.37 → 2.0.39
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 +1 -0
- package/dist/commands/analyze/adoption.d.ts +15 -0
- package/dist/commands/analyze/adoption.d.ts.map +1 -0
- package/dist/commands/analyze/adoption.js +34 -0
- package/dist/commands/analyze/adoption.js.map +1 -0
- package/dist/commands/analyze/components.d.ts +15 -0
- package/dist/commands/analyze/components.d.ts.map +1 -0
- package/dist/commands/analyze/components.js +34 -0
- package/dist/commands/analyze/components.js.map +1 -0
- package/dist/commands/analyze/status.d.ts +24 -0
- package/dist/commands/analyze/status.d.ts.map +1 -0
- package/dist/commands/analyze/status.js +54 -0
- package/dist/commands/analyze/status.js.map +1 -0
- package/dist/commands/analyze.d.ts +15 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +34 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/components-import.d.ts +3 -3
- package/dist/commands/components-import.d.ts.map +1 -1
- package/dist/commands/components-import.js +8 -2
- package/dist/commands/components-import.js.map +1 -1
- package/dist/commands/template-upload.d.ts +4 -2
- package/dist/commands/template-upload.d.ts.map +1 -1
- package/dist/commands/template-upload.js +47 -17
- package/dist/commands/template-upload.js.map +1 -1
- package/dist/types/config.d.ts +36 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +9 -2
- package/dist/types/config.js.map +1 -1
- package/dist/utils/analyze-command.d.ts +42 -0
- package/dist/utils/analyze-command.d.ts.map +1 -0
- package/dist/utils/analyze-command.js +606 -0
- package/dist/utils/analyze-command.js.map +1 -0
- package/dist/utils/analyze-status.d.ts +7 -0
- package/dist/utils/analyze-status.d.ts.map +1 -0
- package/dist/utils/analyze-status.js +94 -0
- package/dist/utils/analyze-status.js.map +1 -0
- package/dist/utils/config.service.d.ts +1 -2
- package/dist/utils/config.service.d.ts.map +1 -1
- package/dist/utils/config.service.js +5 -7
- package/dist/utils/config.service.js.map +1 -1
- package/dist/utils/discover.d.ts +21 -0
- package/dist/utils/discover.d.ts.map +1 -0
- package/dist/utils/discover.js +305 -0
- package/dist/utils/discover.js.map +1 -0
- package/dist/utils/http-client.d.ts +4 -0
- package/dist/utils/http-client.d.ts.map +1 -0
- package/dist/utils/http-client.js +18 -0
- package/dist/utils/http-client.js.map +1 -0
- package/dist/utils/validate-templates.d.ts +16 -0
- package/dist/utils/validate-templates.d.ts.map +1 -0
- package/dist/utils/validate-templates.js +140 -0
- package/dist/utils/validate-templates.js.map +1 -0
- package/oclif.manifest.json +233 -3
- package/package.json +5 -2
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7d906731-5fc8-5c9e-b336-a051b5efcb88")}catch(e){}}();
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
export function folderNameToDisplayName(folderName) {
|
|
6
|
+
return folderName
|
|
7
|
+
.replace(/[-_]/g, " ")
|
|
8
|
+
.replace(/([A-Z])/g, " $1")
|
|
9
|
+
.trim()
|
|
10
|
+
.replace(/\s+/g, " ")
|
|
11
|
+
.replace(/\b\w/g, c => c.toUpperCase());
|
|
12
|
+
}
|
|
13
|
+
function getAllFilesInDirectory(dirPath, relativeTo) {
|
|
14
|
+
return fs
|
|
15
|
+
.readdirSync(dirPath, { recursive: true, withFileTypes: true })
|
|
16
|
+
.filter(entry => entry.isFile() && entry.name !== "README.md")
|
|
17
|
+
.map(entry => path.relative(relativeTo, path.join(entry.parentPath || dirPath, entry.name)))
|
|
18
|
+
.sort();
|
|
19
|
+
}
|
|
20
|
+
function findThumbnail(templateDir) {
|
|
21
|
+
return [".png", ".svg", ".jpg", ".jpeg"]
|
|
22
|
+
.map(ext => `thumbnail${ext}`)
|
|
23
|
+
.find(filename => fs.existsSync(path.join(templateDir, filename)));
|
|
24
|
+
}
|
|
25
|
+
function parseDescriptionFromReadme(readmeFilePath) {
|
|
26
|
+
if (!fs.existsSync(readmeFilePath))
|
|
27
|
+
return "";
|
|
28
|
+
try {
|
|
29
|
+
const content = fs.readFileSync(readmeFilePath, "utf8");
|
|
30
|
+
const match = content.match(/^#[^\n]*\n+([^\n#]+)/m);
|
|
31
|
+
if (!match)
|
|
32
|
+
return "";
|
|
33
|
+
let description = match[1].trim();
|
|
34
|
+
description = description.replace(/\*\*/g, "").replace(/\*/g, "");
|
|
35
|
+
description = description.charAt(0).toUpperCase() + description.slice(1);
|
|
36
|
+
if (!description.endsWith(".") && !description.endsWith("!") && !description.endsWith("?")) {
|
|
37
|
+
description += ".";
|
|
38
|
+
}
|
|
39
|
+
return description;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function parseImportsFromTSFile(filePath, baseDir) {
|
|
46
|
+
if (!fs.existsSync(filePath))
|
|
47
|
+
return [];
|
|
48
|
+
try {
|
|
49
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
50
|
+
const dependencies = [];
|
|
51
|
+
const importRegex = /import\s+(?:[\w*{}\s,]+\s+from\s+)?['"`]([^'"`]+)['"`]/g;
|
|
52
|
+
let match;
|
|
53
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
54
|
+
const importPath = match[1];
|
|
55
|
+
if (importPath.startsWith("./") || importPath.startsWith("../")) {
|
|
56
|
+
try {
|
|
57
|
+
const fileDir = path.dirname(filePath);
|
|
58
|
+
const resolvedPath = path.resolve(fileDir, importPath);
|
|
59
|
+
const possiblePaths = [
|
|
60
|
+
resolvedPath,
|
|
61
|
+
resolvedPath + ".tsx",
|
|
62
|
+
resolvedPath + ".ts",
|
|
63
|
+
resolvedPath + ".json",
|
|
64
|
+
resolvedPath + ".js",
|
|
65
|
+
];
|
|
66
|
+
const actualPath = possiblePaths.find(p => fs.existsSync(p));
|
|
67
|
+
if (actualPath) {
|
|
68
|
+
const containerRoot = path.resolve(baseDir, "../../..");
|
|
69
|
+
const relativePath = path.relative(containerRoot, actualPath).replace(/\\/g, "/");
|
|
70
|
+
if (relativePath.startsWith("supernova/")) {
|
|
71
|
+
dependencies.push(relativePath);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return dependencies;
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function parseImportsFromDirectory(itemDir) {
|
|
86
|
+
const dependencies = new Set();
|
|
87
|
+
try {
|
|
88
|
+
const entries = fs.readdirSync(itemDir, { recursive: true, withFileTypes: true });
|
|
89
|
+
for (const entry of entries) {
|
|
90
|
+
if (entry.isFile()) {
|
|
91
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
92
|
+
if (ext === ".ts" || ext === ".tsx") {
|
|
93
|
+
const fullPath = path.join(entry.parentPath || itemDir, entry.name);
|
|
94
|
+
const fileDeps = parseImportsFromTSFile(fullPath, itemDir);
|
|
95
|
+
fileDeps.forEach(dep => dependencies.add(dep));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
}
|
|
102
|
+
return Array.from(dependencies).sort();
|
|
103
|
+
}
|
|
104
|
+
function parseMainReadmeTable(mainReadmePath, itemKey) {
|
|
105
|
+
if (!fs.existsSync(mainReadmePath))
|
|
106
|
+
return null;
|
|
107
|
+
try {
|
|
108
|
+
const content = fs.readFileSync(mainReadmePath, "utf8");
|
|
109
|
+
const tableMatch = content.match(/(\|\s*(?:Pattern|Template)\s*\|[^\n]*)\n\|[-\s|]*\n((?:\|[^\n]*\n)*)/i);
|
|
110
|
+
if (!tableMatch)
|
|
111
|
+
return null;
|
|
112
|
+
const headerCells = tableMatch[1]
|
|
113
|
+
.split("|")
|
|
114
|
+
.map(cell => cell.trim())
|
|
115
|
+
.filter(cell => cell);
|
|
116
|
+
const nameIndex = headerCells.findIndex(cell => /^(Pattern|Template)$/i.test(cell));
|
|
117
|
+
const descIndex = headerCells.findIndex(cell => /^Description$/i.test(cell));
|
|
118
|
+
if (nameIndex === -1 || descIndex === -1)
|
|
119
|
+
return null;
|
|
120
|
+
const rows = tableMatch[2].split("\n").filter(row => row.trim());
|
|
121
|
+
for (const row of rows) {
|
|
122
|
+
const cells = row
|
|
123
|
+
.split("|")
|
|
124
|
+
.map(cell => cell.trim())
|
|
125
|
+
.filter(cell => cell);
|
|
126
|
+
if (cells.length > Math.max(nameIndex, descIndex)) {
|
|
127
|
+
const name = cells[nameIndex]?.replace(/\[([^\]]+)\].*/, "$1");
|
|
128
|
+
const description = cells[descIndex];
|
|
129
|
+
if (name === itemKey) {
|
|
130
|
+
return description.endsWith(".") ? description : description + ".";
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function extractDescriptionFromReadme(itemDir, fallbackName, itemKey, subdirectory) {
|
|
140
|
+
const itemReadmePath = path.join(itemDir, "README.md");
|
|
141
|
+
const individualDescription = parseDescriptionFromReadme(itemReadmePath);
|
|
142
|
+
if (individualDescription) {
|
|
143
|
+
return individualDescription;
|
|
144
|
+
}
|
|
145
|
+
const containerRoot = path.resolve(itemDir, "../../..");
|
|
146
|
+
const mainReadmePath = path.join(containerRoot, "supernova", subdirectory, "README.md");
|
|
147
|
+
const tableDescription = parseMainReadmeTable(mainReadmePath, itemKey);
|
|
148
|
+
if (tableDescription) {
|
|
149
|
+
return tableDescription;
|
|
150
|
+
}
|
|
151
|
+
return `Use this to prototype similar to ${fallbackName}`;
|
|
152
|
+
}
|
|
153
|
+
function readPackageJson(basePath) {
|
|
154
|
+
const packageJsonPath = path.join(basePath, "package.json");
|
|
155
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
156
|
+
throw new Error(`package.json not found at ${packageJsonPath}`);
|
|
157
|
+
}
|
|
158
|
+
const content = fs.readFileSync(packageJsonPath, "utf8");
|
|
159
|
+
return JSON.parse(content);
|
|
160
|
+
}
|
|
161
|
+
function writePackageJson(basePath, packageData) {
|
|
162
|
+
const packageJsonPath = path.join(basePath, "package.json");
|
|
163
|
+
const content = JSON.stringify(packageData, null, 2) + "\n";
|
|
164
|
+
fs.writeFileSync(packageJsonPath, content, "utf8");
|
|
165
|
+
}
|
|
166
|
+
function discoverItems(basePath, subdirectory) {
|
|
167
|
+
const resolvedBasePath = basePath || process.cwd();
|
|
168
|
+
const itemsDir = path.join(resolvedBasePath, "supernova", subdirectory);
|
|
169
|
+
if (!fs.existsSync(itemsDir)) {
|
|
170
|
+
throw new Error(`${subdirectory} directory not found at ${itemsDir}`);
|
|
171
|
+
}
|
|
172
|
+
const items = {};
|
|
173
|
+
const entries = fs.readdirSync(itemsDir, { withFileTypes: true });
|
|
174
|
+
for (const entry of entries) {
|
|
175
|
+
if (!entry.isDirectory() || entry.name === "README.md") {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
const itemKey = entry.name;
|
|
179
|
+
const itemDir = path.join(itemsDir, itemKey);
|
|
180
|
+
const displayName = folderNameToDisplayName(itemKey);
|
|
181
|
+
const description = extractDescriptionFromReadme(itemDir, displayName, itemKey, subdirectory);
|
|
182
|
+
const thumbnail = findThumbnail(itemDir);
|
|
183
|
+
const files = getAllFilesInDirectory(itemDir, itemDir);
|
|
184
|
+
const containerRoot = path.resolve(itemDir, "../../..");
|
|
185
|
+
const itemRelativePath = path.relative(containerRoot, itemDir).replace(/\\/g, "/");
|
|
186
|
+
const fullPathFiles = files.map(file => `${itemRelativePath}/${file}`);
|
|
187
|
+
const importDependencies = parseImportsFromDirectory(itemDir);
|
|
188
|
+
const allDependencies = [...new Set([...importDependencies])];
|
|
189
|
+
const itemBasePath = itemRelativePath;
|
|
190
|
+
const externalDependencies = allDependencies.filter(dep => !dep.startsWith(itemBasePath + "/"));
|
|
191
|
+
const validExternalDependencies = externalDependencies.filter(dep => {
|
|
192
|
+
const fullPath = path.join(containerRoot, dep);
|
|
193
|
+
const exists = fs.existsSync(fullPath);
|
|
194
|
+
if (!exists) {
|
|
195
|
+
console.warn(`Warning: Dependency not found: ${dep} (expected at ${fullPath})`);
|
|
196
|
+
}
|
|
197
|
+
return exists;
|
|
198
|
+
});
|
|
199
|
+
const allFiles = new Set([...fullPathFiles, ...validExternalDependencies]);
|
|
200
|
+
const filteredFiles = Array.from(allFiles).filter(file => !file.endsWith("README.md") &&
|
|
201
|
+
!["/thumbnail.png", "/thumbnail.svg", "/thumbnail.jpg", "/thumbnail.jpeg"].some(ext => file.endsWith(ext)));
|
|
202
|
+
const existingFiles = filteredFiles
|
|
203
|
+
.filter(file => {
|
|
204
|
+
const fullPath = path.join(containerRoot, file);
|
|
205
|
+
const exists = fs.existsSync(fullPath);
|
|
206
|
+
if (!exists) {
|
|
207
|
+
console.warn(`Warning: File not found: ${file} (expected at ${fullPath})`);
|
|
208
|
+
}
|
|
209
|
+
return exists;
|
|
210
|
+
})
|
|
211
|
+
.sort();
|
|
212
|
+
const itemInfo = {
|
|
213
|
+
name: displayName,
|
|
214
|
+
description,
|
|
215
|
+
files: existingFiles,
|
|
216
|
+
};
|
|
217
|
+
if (thumbnail) {
|
|
218
|
+
itemInfo.thumbnail = `${itemRelativePath}/${thumbnail}`;
|
|
219
|
+
}
|
|
220
|
+
items[itemKey] = itemInfo;
|
|
221
|
+
}
|
|
222
|
+
return items;
|
|
223
|
+
}
|
|
224
|
+
function discoverTemplates(basePath) {
|
|
225
|
+
const resolvedBasePath = basePath || process.cwd();
|
|
226
|
+
return discoverItems(resolvedBasePath, "templates");
|
|
227
|
+
}
|
|
228
|
+
function discoverPatterns(basePath) {
|
|
229
|
+
const resolvedBasePath = basePath || process.cwd();
|
|
230
|
+
return discoverItems(resolvedBasePath, "patterns");
|
|
231
|
+
}
|
|
232
|
+
function resolveTransitiveDependencies(items, patterns, basePath) {
|
|
233
|
+
const resolvedItems = {};
|
|
234
|
+
for (const [itemKey, itemInfo] of Object.entries(items)) {
|
|
235
|
+
const resolvedFiles = new Set([...itemInfo.files]);
|
|
236
|
+
const dependentPatterns = new Set();
|
|
237
|
+
for (const file of itemInfo.files) {
|
|
238
|
+
const pathMatch = file.match(/^supernova\/patterns\/([^\/]+)\//);
|
|
239
|
+
if (pathMatch) {
|
|
240
|
+
dependentPatterns.add(pathMatch[1]);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function addTransitiveDependencies(patternKey, visited = new Set()) {
|
|
244
|
+
if (visited.has(patternKey)) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
visited.add(patternKey);
|
|
248
|
+
const pattern = patterns[patternKey];
|
|
249
|
+
if (!pattern) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
pattern.files.forEach(file => resolvedFiles.add(file));
|
|
253
|
+
for (const file of pattern.files) {
|
|
254
|
+
const pathMatch = file.match(/^supernova\/patterns\/([^\/]+)\//);
|
|
255
|
+
if (pathMatch && pathMatch[1] !== patternKey) {
|
|
256
|
+
addTransitiveDependencies(pathMatch[1], new Set(visited));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
for (const patternKey of dependentPatterns) {
|
|
261
|
+
addTransitiveDependencies(patternKey);
|
|
262
|
+
}
|
|
263
|
+
const containerRoot = path.resolve(basePath);
|
|
264
|
+
const validFiles = Array.from(resolvedFiles)
|
|
265
|
+
.filter(file => {
|
|
266
|
+
const fullPath = path.join(containerRoot, file);
|
|
267
|
+
const exists = fs.existsSync(fullPath);
|
|
268
|
+
if (!exists) {
|
|
269
|
+
console.warn(`Warning: Transitive dependency not found: ${file} (expected at ${fullPath})`);
|
|
270
|
+
}
|
|
271
|
+
return exists;
|
|
272
|
+
})
|
|
273
|
+
.sort();
|
|
274
|
+
resolvedItems[itemKey] = {
|
|
275
|
+
...itemInfo,
|
|
276
|
+
files: validFiles,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return resolvedItems;
|
|
280
|
+
}
|
|
281
|
+
export async function discoverTemplatesAndPatterns(basePath) {
|
|
282
|
+
const resolvedBasePath = basePath || process.cwd();
|
|
283
|
+
const rawTemplates = discoverTemplates(resolvedBasePath);
|
|
284
|
+
const rawPatterns = discoverPatterns(resolvedBasePath);
|
|
285
|
+
const templates = resolveTransitiveDependencies(rawTemplates, rawPatterns, resolvedBasePath);
|
|
286
|
+
const patterns = resolveTransitiveDependencies(rawPatterns, rawPatterns, resolvedBasePath);
|
|
287
|
+
return { templates, patterns };
|
|
288
|
+
}
|
|
289
|
+
export async function discoverFilesForTemplates(pkgTemplates, basePath) {
|
|
290
|
+
const { templates } = await discoverTemplatesAndPatterns(basePath);
|
|
291
|
+
return Object.fromEntries(Object.entries(pkgTemplates).map(([key, pkgTemplate]) => [key, { ...templates[key], ...pkgTemplate }]));
|
|
292
|
+
}
|
|
293
|
+
export async function discoverAndUpdatePackageJson(basePath) {
|
|
294
|
+
const result = await discoverTemplatesAndPatterns(basePath);
|
|
295
|
+
const resolvedBasePath = basePath || process.cwd();
|
|
296
|
+
const packageData = readPackageJson(resolvedBasePath);
|
|
297
|
+
if (!packageData.supernova) {
|
|
298
|
+
packageData.supernova = {};
|
|
299
|
+
}
|
|
300
|
+
packageData.supernova.templates = Object.fromEntries(Object.entries(result.templates).map(([key, { name, description }]) => [key, { name, description }]));
|
|
301
|
+
writePackageJson(resolvedBasePath, packageData);
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=discover.js.map
|
|
305
|
+
//# debugId=7d906731-5fc8-5c9e-b336-a051b5efcb88
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sources":["../../src/utils/discover.ts"],"sourceRoot":"","sourcesContent":["import fs from \"node:fs\"\nimport path from \"node:path\"\n\ninterface TemplateInfo {\n name: string\n description: string\n thumbnail?: string\n files: string[]\n}\n\ninterface ItemsObject {\n [itemKey: string]: TemplateInfo\n}\n\n/**\n * Converts folder name to spaced title case\n * e.g., \"AppShell\" -> \"App Shell\", \"PortalFeatureDetail\" -> \"Portal Feature Detail\"\n */\nexport function folderNameToDisplayName(folderName: string): string {\n return folderName\n .replace(/[-_]/g, \" \") // kebab-case and snake_case → spaces\n .replace(/([A-Z])/g, \" $1\") // PascalCase/camelCase → spaces before uppercase\n .trim()\n .replace(/\\s+/g, \" \") // normalize multiple spaces\n .replace(/\\b\\w/g, c => c.toUpperCase()) // capitalize each word\n}\n\n/**\n * Recursively get all files in a directory relative to that directory\n */\nfunction getAllFilesInDirectory(dirPath: string, relativeTo: string): string[] {\n return fs\n .readdirSync(dirPath, { recursive: true, withFileTypes: true })\n .filter(entry => entry.isFile() && entry.name !== \"README.md\")\n .map(entry => path.relative(relativeTo, path.join(entry.parentPath || dirPath, entry.name)))\n .sort()\n}\n\n/**\n * Check for thumbnail files in a directory\n */\nfunction findThumbnail(templateDir: string): string | undefined {\n return [\".png\", \".svg\", \".jpg\", \".jpeg\"]\n .map(ext => `thumbnail${ext}`)\n .find(filename => fs.existsSync(path.join(templateDir, filename)))\n}\n\n/**\n * Parse description from a README.md file in any directory\n * Takes the first sentence after the first # heading\n *\n * @param readmeFilePath - Full path to README.md file\n * @returns string - The description or empty string if not found\n */\nfunction parseDescriptionFromReadme(readmeFilePath: string): string {\n if (!fs.existsSync(readmeFilePath)) return \"\"\n\n try {\n const content = fs.readFileSync(readmeFilePath, \"utf8\")\n\n // Find first paragraph after first # heading\n const match = content.match(/^#[^\\n]*\\n+([^\\n#]+)/m)\n if (!match) return \"\"\n\n let description = match[1].trim()\n\n // Clean up the description\n description = description.replace(/\\*\\*/g, \"\").replace(/\\*/g, \"\") // Remove markdown formatting\n description = description.charAt(0).toUpperCase() + description.slice(1) // Ensure capital letter\n\n // Ensure it ends with period if it doesn't already\n if (!description.endsWith(\".\") && !description.endsWith(\"!\") && !description.endsWith(\"?\")) {\n description += \".\"\n }\n\n return description\n } catch (error) {\n return \"\"\n }\n}\n\n/**\n * Parse TypeScript/TSX files for import statements and extract file dependencies\n * @param filePath - Path to .ts/.tsx file\n * @param baseDir - Base directory for resolving relative imports\n * @returns string[] - Array of imported file paths (resolved to project root)\n */\nfunction parseImportsFromTSFile(filePath: string, baseDir: string): string[] {\n if (!fs.existsSync(filePath)) return []\n\n try {\n const content = fs.readFileSync(filePath, \"utf8\")\n const dependencies: string[] = []\n\n // Regex to match import statements\n const importRegex = /import\\s+(?:[\\w*{}\\s,]+\\s+from\\s+)?['\"`]([^'\"`]+)['\"`]/g\n\n let match\n while ((match = importRegex.exec(content)) !== null) {\n const importPath = match[1]\n\n // Only process relative imports (starting with ./ or ../)\n if (importPath.startsWith(\"./\") || importPath.startsWith(\"../\")) {\n try {\n // Resolve relative to the file's directory\n const fileDir = path.dirname(filePath)\n const resolvedPath = path.resolve(fileDir, importPath)\n\n // Try common extensions if no extension provided\n const possiblePaths = [\n resolvedPath,\n resolvedPath + \".tsx\",\n resolvedPath + \".ts\",\n resolvedPath + \".json\",\n resolvedPath + \".js\",\n ]\n\n const actualPath = possiblePaths.find(p => fs.existsSync(p))\n\n if (actualPath) {\n // Convert to path relative to container root\n const containerRoot = path.resolve(baseDir, \"../../..\")\n const relativePath = path.relative(containerRoot, actualPath).replace(/\\\\/g, \"/\")\n\n // Only include files within the supernova directory\n if (relativePath.startsWith(\"supernova/\")) {\n dependencies.push(relativePath)\n }\n }\n } catch (error) {\n // Skip invalid import paths\n }\n }\n }\n\n return dependencies\n } catch (error) {\n return []\n }\n}\n\n/**\n * Parse all TypeScript/TSX files in a directory for import dependencies\n * @param itemDir - Directory containing the template/pattern\n * @returns string[] - Array of all imported file paths from all TS/TSX files\n */\nfunction parseImportsFromDirectory(itemDir: string): string[] {\n const dependencies = new Set<string>()\n\n try {\n const entries = fs.readdirSync(itemDir, { recursive: true, withFileTypes: true })\n\n for (const entry of entries) {\n if (entry.isFile()) {\n const ext = path.extname(entry.name).toLowerCase()\n if (ext === \".ts\" || ext === \".tsx\") {\n const fullPath = path.join(entry.parentPath || itemDir, entry.name)\n const fileDeps = parseImportsFromTSFile(fullPath, itemDir)\n fileDeps.forEach(dep => dependencies.add(dep))\n }\n }\n }\n } catch (error) {\n // Skip directories that can't be read\n }\n\n return Array.from(dependencies).sort()\n}\n\n/**\n * Parse main directory README.md for table-based descriptions\n * Extracts description from markdown table like:\n * | Pattern | Description |\n * | PromptEditor | Tiptap rich text editor |\n */\nfunction parseMainReadmeTable(mainReadmePath: string, itemKey: string): string | null {\n if (!fs.existsSync(mainReadmePath)) return null\n\n try {\n const content = fs.readFileSync(mainReadmePath, \"utf8\")\n\n // Find table that contains Pattern or Template header\n const tableMatch = content.match(/(\\|\\s*(?:Pattern|Template)\\s*\\|[^\\n]*)\\n\\|[-\\s|]*\\n((?:\\|[^\\n]*\\n)*)/i)\n if (!tableMatch) return null\n\n // Parse header to get column indices\n const headerCells = tableMatch[1]\n .split(\"|\")\n .map(cell => cell.trim())\n .filter(cell => cell)\n const nameIndex = headerCells.findIndex(cell => /^(Pattern|Template)$/i.test(cell))\n const descIndex = headerCells.findIndex(cell => /^Description$/i.test(cell))\n\n if (nameIndex === -1 || descIndex === -1) return null\n\n // Parse table rows\n const rows = tableMatch[2].split(\"\\n\").filter(row => row.trim())\n\n for (const row of rows) {\n const cells = row\n .split(\"|\")\n .map(cell => cell.trim())\n .filter(cell => cell)\n\n if (cells.length > Math.max(nameIndex, descIndex)) {\n const name = cells[nameIndex]?.replace(/\\[([^\\]]+)\\].*/, \"$1\") // Remove markdown link syntax\n const description = cells[descIndex]\n\n if (name === itemKey) {\n return description.endsWith(\".\") ? description : description + \".\"\n }\n }\n }\n } catch (error) {\n // If error reading file, return null\n }\n\n return null\n}\n\n/**\n * Extract description from README.md file\n * Priority: 1) Individual README, 2) Main directory table, 3) Fallback\n */\nfunction extractDescriptionFromReadme(\n itemDir: string,\n fallbackName: string,\n itemKey: string,\n subdirectory: \"templates\" | \"patterns\",\n): string {\n // Try individual README first (highest priority)\n const itemReadmePath = path.join(itemDir, \"README.md\")\n const individualDescription = parseDescriptionFromReadme(itemReadmePath)\n if (individualDescription) {\n return individualDescription\n }\n\n // Try main directory table second\n const containerRoot = path.resolve(itemDir, \"../../..\")\n const mainReadmePath = path.join(containerRoot, \"supernova\", subdirectory, \"README.md\")\n const tableDescription = parseMainReadmeTable(mainReadmePath, itemKey)\n if (tableDescription) {\n return tableDescription\n }\n\n // Fall back to default\n return `Use this to prototype similar to ${fallbackName}`\n}\n\n/**\n * Read package.json and return parsed content\n */\nfunction readPackageJson(basePath: string): any {\n const packageJsonPath = path.join(basePath, \"package.json\")\n\n if (!fs.existsSync(packageJsonPath)) {\n throw new Error(`package.json not found at ${packageJsonPath}`)\n }\n\n const content = fs.readFileSync(packageJsonPath, \"utf8\")\n return JSON.parse(content)\n}\n\n/**\n * Write package.json with proper formatting\n */\nfunction writePackageJson(basePath: string, packageData: any): void {\n const packageJsonPath = path.join(basePath, \"package.json\")\n const content = JSON.stringify(packageData, null, 2) + \"\\n\"\n fs.writeFileSync(packageJsonPath, content, \"utf8\")\n}\n\n/**\n * Discovers items in a supernova subdirectory and returns metadata object\n *\n * @param basePath - Base directory path (defaults to current working directory)\n * @param subdirectory - Subdirectory name ('templates' or 'patterns')\n * @returns ItemsObject - Object with item metadata\n */\nfunction discoverItems(basePath: string, subdirectory: \"templates\" | \"patterns\"): ItemsObject {\n const resolvedBasePath = basePath || process.cwd()\n const itemsDir = path.join(resolvedBasePath, \"supernova\", subdirectory)\n\n // Check if directory exists\n if (!fs.existsSync(itemsDir)) {\n throw new Error(`${subdirectory} directory not found at ${itemsDir}`)\n }\n\n const items: ItemsObject = {}\n\n // Read all entries in directory\n const entries = fs.readdirSync(itemsDir, { withFileTypes: true })\n\n for (const entry of entries) {\n // Skip non-directories and README files\n if (!entry.isDirectory() || entry.name === \"README.md\") {\n continue\n }\n\n const itemKey = entry.name\n const itemDir = path.join(itemsDir, itemKey)\n\n // Generate display name\n const displayName = folderNameToDisplayName(itemKey)\n\n // Extract description from README.md\n const description = extractDescriptionFromReadme(itemDir, displayName, itemKey, subdirectory)\n\n // Find thumbnail\n const thumbnail = findThumbnail(itemDir)\n\n // Get all files in item directory with full paths\n const files = getAllFilesInDirectory(itemDir, itemDir)\n const containerRoot = path.resolve(itemDir, \"../../..\") // This goes from supernova/templates/X to container root\n const itemRelativePath = path.relative(containerRoot, itemDir).replace(/\\\\/g, \"/\")\n const fullPathFiles = files.map(file => `${itemRelativePath}/${file}`)\n\n // Parse dependencies from TypeScript/TSX import statements\n const importDependencies = parseImportsFromDirectory(itemDir)\n\n // Combine both sources of dependencies\n const allDependencies = [...new Set([...importDependencies])]\n\n // Filter out dependencies that are within the same item directory\n const itemBasePath = itemRelativePath\n const externalDependencies = allDependencies.filter(dep => !dep.startsWith(itemBasePath + \"/\"))\n\n // Validate that external dependencies exist in the filesystem\n const validExternalDependencies = externalDependencies.filter(dep => {\n const fullPath = path.join(containerRoot, dep)\n const exists = fs.existsSync(fullPath)\n if (!exists) {\n console.warn(`Warning: Dependency not found: ${dep} (expected at ${fullPath})`)\n }\n return exists\n })\n\n // Combine files and valid dependencies, remove duplicates\n const allFiles = new Set([...fullPathFiles, ...validExternalDependencies])\n // Remove README.md files and thumbnail files from the combined list\n const filteredFiles = Array.from(allFiles).filter(\n file =>\n !file.endsWith(\"README.md\") &&\n ![\"/thumbnail.png\", \"/thumbnail.svg\", \"/thumbnail.jpg\", \"/thumbnail.jpeg\"].some(ext => file.endsWith(ext)),\n )\n\n // Validate that all files exist in the filesystem\n const existingFiles = filteredFiles\n .filter(file => {\n const fullPath = path.join(containerRoot, file)\n const exists = fs.existsSync(fullPath)\n if (!exists) {\n console.warn(`Warning: File not found: ${file} (expected at ${fullPath})`)\n }\n return exists\n })\n .sort()\n\n // Build item info object\n const itemInfo: TemplateInfo = {\n name: displayName,\n description,\n files: existingFiles,\n }\n\n // Only add thumbnail property if it exists (with full path)\n if (thumbnail) {\n itemInfo.thumbnail = `${itemRelativePath}/${thumbnail}`\n }\n\n items[itemKey] = itemInfo\n }\n\n return items\n}\n\n/**\n * Discovers templates in supernova/templates directory and returns metadata object\n *\n * @param basePath - Base directory path (defaults to current working directory)\n * @returns ItemsObject - Object with template metadata\n */\nfunction discoverTemplates(basePath?: string): ItemsObject {\n const resolvedBasePath = basePath || process.cwd()\n return discoverItems(resolvedBasePath, \"templates\")\n}\n\n/**\n * Discovers patterns in supernova/patterns directory and returns metadata object\n *\n * @param basePath - Base directory path (defaults to current working directory)\n * @returns ItemsObject - Object with pattern metadata\n */\nfunction discoverPatterns(basePath?: string): ItemsObject {\n const resolvedBasePath = basePath || process.cwd()\n return discoverItems(resolvedBasePath, \"patterns\")\n}\n\n/**\n * Resolve transitive dependencies for templates/patterns\n * If Template A imports Pattern B, and Pattern B imports Pattern C,\n * then Template A should include files from both Pattern B and Pattern C\n */\nfunction resolveTransitiveDependencies(items: ItemsObject, patterns: ItemsObject, basePath: string): ItemsObject {\n const resolvedItems: ItemsObject = {}\n\n for (const [itemKey, itemInfo] of Object.entries(items)) {\n const resolvedFiles = new Set([...itemInfo.files])\n\n // Find which patterns this item depends on\n const dependentPatterns = new Set<string>()\n\n // Check direct dependencies by looking at file paths\n for (const file of itemInfo.files) {\n const pathMatch = file.match(/^supernova\\/patterns\\/([^\\/]+)\\//)\n if (pathMatch) {\n dependentPatterns.add(pathMatch[1])\n }\n }\n\n // Recursively resolve transitive dependencies\n function addTransitiveDependencies(patternKey: string, visited = new Set<string>()) {\n if (visited.has(patternKey)) {\n return // Avoid circular dependencies\n }\n visited.add(patternKey)\n\n const pattern = patterns[patternKey]\n if (!pattern) {\n return\n }\n\n // Add all files from this pattern\n pattern.files.forEach(file => resolvedFiles.add(file))\n\n // Find what patterns this pattern depends on\n for (const file of pattern.files) {\n const pathMatch = file.match(/^supernova\\/patterns\\/([^\\/]+)\\//)\n if (pathMatch && pathMatch[1] !== patternKey) {\n // Recursively add transitive dependencies\n addTransitiveDependencies(pathMatch[1], new Set(visited))\n }\n }\n }\n\n // Resolve transitive dependencies for each direct dependency\n for (const patternKey of dependentPatterns) {\n addTransitiveDependencies(patternKey)\n }\n\n // Validate all resolved files exist\n const containerRoot = path.resolve(basePath)\n const validFiles = Array.from(resolvedFiles)\n .filter(file => {\n const fullPath = path.join(containerRoot, file)\n const exists = fs.existsSync(fullPath)\n if (!exists) {\n console.warn(`Warning: Transitive dependency not found: ${file} (expected at ${fullPath})`)\n }\n return exists\n })\n .sort()\n\n resolvedItems[itemKey] = {\n ...itemInfo,\n files: validFiles,\n }\n }\n\n return resolvedItems\n}\n\n/**\n * Discovers templates and patterns, then updates package.json with the results\n *\n * @param basePath - Base directory path (defaults to current working directory)\n * @returns Promise<{templates: ItemsObject, patterns: ItemsObject}> - Object with template and pattern metadata\n */\n\nexport async function discoverTemplatesAndPatterns(\n basePath?: string,\n): Promise<{ templates: ItemsObject; patterns: ItemsObject }> {\n const resolvedBasePath = basePath || process.cwd()\n\n // First discover templates and patterns independently\n const rawTemplates = discoverTemplates(resolvedBasePath)\n const rawPatterns = discoverPatterns(resolvedBasePath)\n\n // Resolve transitive dependencies for templates\n const templates = resolveTransitiveDependencies(rawTemplates, rawPatterns, resolvedBasePath)\n\n // Resolve transitive dependencies for patterns (in case patterns depend on other patterns)\n const patterns = resolveTransitiveDependencies(rawPatterns, rawPatterns, resolvedBasePath)\n\n return { templates, patterns }\n}\n\nexport async function discoverFilesForTemplates(\n pkgTemplates: Record<string, Pick<TemplateInfo, \"name\" | \"description\">>,\n basePath?: string,\n): Promise<ItemsObject> {\n const { templates } = await discoverTemplatesAndPatterns(basePath)\n return Object.fromEntries(\n Object.entries(pkgTemplates).map(([key, pkgTemplate]) => [key, { ...templates[key], ...pkgTemplate }]),\n )\n}\n\nexport async function discoverAndUpdatePackageJson(\n basePath?: string,\n): Promise<{ templates: ItemsObject; patterns: ItemsObject }> {\n const result = await discoverTemplatesAndPatterns(basePath)\n const resolvedBasePath = basePath || process.cwd()\n\n // Read current package.json\n const packageData = readPackageJson(resolvedBasePath)\n\n // Ensure supernova object exists\n if (!packageData.supernova) {\n packageData.supernova = {}\n }\n\n // Only persist name and description — files and thumbnail are always re-discovered at upload time\n packageData.supernova.templates = Object.fromEntries(\n Object.entries(result.templates).map(([key, { name, description }]) => [key, { name, description }]),\n )\n\n // Write back to package.json\n writePackageJson(resolvedBasePath, packageData)\n\n return result\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAiB5B,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,OAAO,UAAU;SACd,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;SACrB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;SAC1B,IAAI,EAAE;SACN,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA;AAC3C,CAAC;AAKD,SAAS,sBAAsB,CAAC,OAAe,EAAE,UAAkB;IACjE,OAAO,EAAE;SACN,WAAW,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAC9D,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;SAC7D,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI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G,EAAE,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,CACvG,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,QAAiB;IAEjB,MAAM,MAAM,GAAG,MAAM,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IAC3D,MAAM,gBAAgB,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;IAGlD,MAAM,WAAW,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAA;IAGrD,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QAC3B,WAAW,CAAC,SAAS,GAAG,EAAE,CAAA;IAC5B,CAAC;IAGD,WAAW,CAAC,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,WAAW,CAClD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CACrG,CAAA;IAGD,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAA;IAE/C,OAAO,MAAM,CAAA;AACf,CAAC","debug_id":"7d906731-5fc8-5c9e-b336-a051b5efcb88"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/utils/http-client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAG5C,OAAO,EAAwB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEzE,wBAAsB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAW5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a966c97b-b882-521a-91df-7d00928cf26e")}catch(e){}}();
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { VaultService } from "../services/vault.service.js";
|
|
5
|
+
import { apiUrlForEnvironment } from "../types/environment.js";
|
|
6
|
+
export async function createApiClient(env) {
|
|
7
|
+
const token = await new VaultService().getTokensFromVault(env);
|
|
8
|
+
return axios.create({
|
|
9
|
+
baseURL: apiUrlForEnvironment(env),
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${token.accessToken}`,
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
},
|
|
14
|
+
timeout: 30_000,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=http-client.js.map
|
|
18
|
+
//# debugId=a966c97b-b882-521a-91df-7d00928cf26e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sources":["../../src/utils/http-client.ts"],"sourceRoot":"","sourcesContent":["import axios, { AxiosInstance } from \"axios\"\n\nimport { VaultService } from \"../services/vault.service.js\"\nimport { apiUrlForEnvironment, TargetEnv } from \"../types/environment.js\"\n\nexport async function createApiClient(env: TargetEnv): Promise<AxiosInstance> {\n const token = await new VaultService().getTokensFromVault(env)\n\n return axios.create({\n baseURL: apiUrlForEnvironment(env),\n headers: {\n Authorization: `Bearer ${token.accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n timeout: 30_000,\n })\n}\n"],"names":[],"mappings":";;AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAa,MAAM,yBAAyB,CAAA;AAEzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAc;IAClD,MAAM,KAAK,GAAG,MAAM,IAAI,YAAY,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAA;IAE9D,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;QAClC,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,KAAK,CAAC,WAAW,EAAE;YAC5C,cAAc,EAAE,kBAAkB;SACnC;QACD,OAAO,EAAE,MAAM;KAChB,CAAC,CAAA;AACJ,CAAC","debug_id":"a966c97b-b882-521a-91df-7d00928cf26e"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TemplatePreset = {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
thumbnail?: string;
|
|
5
|
+
files?: string[];
|
|
6
|
+
};
|
|
7
|
+
export interface Logger {
|
|
8
|
+
warn: (msg: string) => void;
|
|
9
|
+
error: (msg: string) => never;
|
|
10
|
+
log: (msg: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function fileExists(p: string): Promise<boolean>;
|
|
13
|
+
export declare function validateTemplates(templates: {
|
|
14
|
+
[key: string]: TemplatePreset;
|
|
15
|
+
}, logger: Logger, debug?: boolean): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=validate-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-templates.d.ts","sourceRoot":"","sources":["../../src/utils/validate-templates.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAExG,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAA;IAC7B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3B;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,oBAOzC;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,EAC5C,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8648ca5c-4a11-592c-b7d6-b6ccc9afb0f6")}catch(e){}}();
|
|
3
|
+
import { action } from "@oclif/core/ux";
|
|
4
|
+
import { exec as execCallback } from "node:child_process";
|
|
5
|
+
import * as fs from "node:fs/promises";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
|
+
const exec = promisify(execCallback);
|
|
9
|
+
export async function fileExists(p) {
|
|
10
|
+
try {
|
|
11
|
+
await fs.access(p);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export async function validateTemplates(templates, logger, debug) {
|
|
19
|
+
action.start(`🔍 Validating ${Object.keys(templates).length} template(s)`);
|
|
20
|
+
for (const [templateKey, template] of Object.entries(templates)) {
|
|
21
|
+
action.start(`Validating template '${templateKey}'`);
|
|
22
|
+
if (!template.files || template.files.length === 0) {
|
|
23
|
+
action.stop("no files specified");
|
|
24
|
+
logger.error(`Template '${templateKey}': No files specified`);
|
|
25
|
+
}
|
|
26
|
+
const expectedMainFile = `supernova/templates/${templateKey}/${templateKey}.tsx`;
|
|
27
|
+
if (!template.files.includes(expectedMainFile)) {
|
|
28
|
+
action.stop("main file missing");
|
|
29
|
+
logger.error(`Template '${templateKey}': Expected main file '${expectedMainFile}' not found in files array`);
|
|
30
|
+
}
|
|
31
|
+
for (const filePath of template.files) {
|
|
32
|
+
if (!(await fileExists(path.resolve(filePath)))) {
|
|
33
|
+
action.stop("files missing");
|
|
34
|
+
logger.error(`Template '${templateKey}': File does not exist: ${filePath}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
await testTemplateBuild(templateKey, template.files, logger, debug);
|
|
39
|
+
action.stop("build successful");
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
action.stop("build failed");
|
|
43
|
+
logger.error(`Template '${templateKey}': Build test failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
action.stop("validation complete");
|
|
47
|
+
}
|
|
48
|
+
async function testTemplateBuild(templateKey, files, logger, debug) {
|
|
49
|
+
const appTsxPath = path.resolve("src/App.tsx");
|
|
50
|
+
const componentsDir = path.resolve("src/components");
|
|
51
|
+
const toDestPath = (filePath) => path.join(componentsDir, filePath.replace(/^supernova\/(patterns|templates)\//, ""));
|
|
52
|
+
let originalAppContent = "";
|
|
53
|
+
let copiedFiles = [];
|
|
54
|
+
let failed = false;
|
|
55
|
+
try {
|
|
56
|
+
await checkNoDirsExist(files.map(f => path.dirname(toDestPath(f))));
|
|
57
|
+
copiedFiles = await copyFiles(files, toDestPath);
|
|
58
|
+
originalAppContent = await patchAppTsx(appTsxPath, templateKey);
|
|
59
|
+
await runBuild(logger);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
failed = true;
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
const keepFilesForDebugging = debug && failed;
|
|
67
|
+
if (!keepFilesForDebugging) {
|
|
68
|
+
await cleanup(copiedFiles, appTsxPath, originalAppContent);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function checkNoDirsExist(dirs) {
|
|
73
|
+
for (const dir of [...new Set(dirs)]) {
|
|
74
|
+
if (await fileExists(dir)) {
|
|
75
|
+
throw new Error(`Component directory already exists: ${path.relative(process.cwd(), dir)}. Please remove or rename this directory before testing the template.`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async function copyFiles(files, toDestPath) {
|
|
80
|
+
const copiedFiles = [];
|
|
81
|
+
for (const filePath of files) {
|
|
82
|
+
const destPath = toDestPath(filePath);
|
|
83
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
84
|
+
await fs.copyFile(path.resolve(filePath), destPath);
|
|
85
|
+
copiedFiles.push(destPath);
|
|
86
|
+
if (destPath.endsWith(".tsx") || destPath.endsWith(".ts")) {
|
|
87
|
+
await updateImportsInFile(destPath);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return copiedFiles;
|
|
91
|
+
}
|
|
92
|
+
async function patchAppTsx(appTsxPath, templateKey) {
|
|
93
|
+
if (!(await fileExists(appTsxPath)))
|
|
94
|
+
return "";
|
|
95
|
+
const originalContent = await fs.readFile(appTsxPath, "utf8");
|
|
96
|
+
await fs.writeFile(appTsxPath, `import { ${templateKey} } from "./components/${templateKey}/${templateKey}"\n\nexport default function App() {\n return <${templateKey} />\n}`);
|
|
97
|
+
return originalContent;
|
|
98
|
+
}
|
|
99
|
+
async function runBuild(logger) {
|
|
100
|
+
try {
|
|
101
|
+
const result = await exec("npm run build", { cwd: process.cwd() });
|
|
102
|
+
if (result.stderr)
|
|
103
|
+
logger.log(`Build stderr: ${result.stderr}`);
|
|
104
|
+
}
|
|
105
|
+
catch (buildError) {
|
|
106
|
+
logger.log(`Build failed with error: ${buildError.message}`);
|
|
107
|
+
if (buildError.stdout)
|
|
108
|
+
logger.log(`Build stdout: ${buildError.stdout}`);
|
|
109
|
+
if (buildError.stderr)
|
|
110
|
+
logger.log(`Build stderr: ${buildError.stderr}`);
|
|
111
|
+
throw buildError;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function cleanup(copiedFiles, appTsxPath, originalAppContent) {
|
|
115
|
+
for (const filePath of copiedFiles) {
|
|
116
|
+
if (await fileExists(filePath)) {
|
|
117
|
+
await fs.rm(filePath, { force: true });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const sortedDirs = [...new Set(copiedFiles.map(f => path.dirname(f)))].sort((a, b) => b.length - a.length);
|
|
121
|
+
for (const dir of sortedDirs) {
|
|
122
|
+
try {
|
|
123
|
+
await fs.rm(dir, { recursive: true, force: true });
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (originalAppContent && (await fileExists(appTsxPath))) {
|
|
129
|
+
await fs.writeFile(appTsxPath, originalAppContent);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function updateImportsInFile(filePath) {
|
|
133
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
134
|
+
const updatedContent = content.replace(/from\s+["']\.\.\/\.\.\/(patterns|templates)\/([^/"']+\/[^"']+)["']/g, 'from "../$2"');
|
|
135
|
+
if (content !== updatedContent) {
|
|
136
|
+
await fs.writeFile(filePath, updatedContent);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=validate-templates.js.map
|
|
140
|
+
//# debugId=8648ca5c-4a11-592c-b7d6-b6ccc9afb0f6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-templates.js","sources":["../../src/utils/validate-templates.ts"],"sourceRoot":"","sourcesContent":["import { action } from \"@oclif/core/ux\"\nimport { exec as execCallback } from \"node:child_process\"\nimport * as fs from \"node:fs/promises\"\nimport path from \"node:path\"\nimport { promisify } from \"node:util\"\n\nconst exec = promisify(execCallback)\n\nexport type TemplatePreset = { name: string; description: string; thumbnail?: string; files?: string[] }\n\nexport interface Logger {\n warn: (msg: string) => void\n error: (msg: string) => never\n log: (msg: string) => void\n}\n\nexport async function fileExists(p: string) {\n try {\n await fs.access(p)\n return true\n } catch {\n return false\n }\n}\n\nexport async function validateTemplates(\n templates: { [key: string]: TemplatePreset },\n logger: Logger,\n debug?: boolean,\n): Promise<void> {\n action.start(`🔍 Validating ${Object.keys(templates).length} template(s)`)\n\n for (const [templateKey, template] of Object.entries(templates)) {\n action.start(`Validating template '${templateKey}'`)\n\n // Check if template has files\n if (!template.files || template.files.length === 0) {\n action.stop(\"no files specified\")\n logger.error(`Template '${templateKey}': No files specified`)\n }\n\n // Validate main file exists\n const expectedMainFile = `supernova/templates/${templateKey}/${templateKey}.tsx`\n if (!template.files.includes(expectedMainFile)) {\n action.stop(\"main file missing\")\n logger.error(`Template '${templateKey}': Expected main file '${expectedMainFile}' not found in files array`)\n }\n\n // Validate all files exist on disk\n for (const filePath of template.files) {\n if (!(await fileExists(path.resolve(filePath)))) {\n action.stop(\"files missing\")\n logger.error(`Template '${templateKey}': File does not exist: ${filePath}`)\n }\n }\n\n // Actually test the template by copying and building\n try {\n await testTemplateBuild(templateKey, template.files, logger, debug)\n action.stop(\"build successful\")\n } catch (error) {\n action.stop(\"build failed\")\n logger.error(\n `Template '${templateKey}': Build test failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\n }\n\n action.stop(\"validation complete\")\n}\n\nasync function testTemplateBuild(templateKey: string, files: string[], logger: Logger, debug?: boolean): Promise<void> {\n const appTsxPath = path.resolve(\"src/App.tsx\")\n const componentsDir = path.resolve(\"src/components\")\n const toDestPath = (filePath: string) =>\n path.join(componentsDir, filePath.replace(/^supernova\\/(patterns|templates)\\//, \"\"))\n\n let originalAppContent = \"\"\n let copiedFiles: string[] = []\n let failed = false\n\n try {\n await checkNoDirsExist(files.map(f => path.dirname(toDestPath(f))))\n copiedFiles = await copyFiles(files, toDestPath)\n originalAppContent = await patchAppTsx(appTsxPath, templateKey)\n await runBuild(logger)\n } catch (error) {\n failed = true\n throw error\n } finally {\n const keepFilesForDebugging = debug && failed\n if (!keepFilesForDebugging) {\n await cleanup(copiedFiles, appTsxPath, originalAppContent)\n }\n }\n}\n\nasync function checkNoDirsExist(dirs: string[]): Promise<void> {\n for (const dir of [...new Set(dirs)]) {\n if (await fileExists(dir)) {\n throw new Error(\n `Component directory already exists: ${path.relative(process.cwd(), dir)}. Please remove or rename this directory before testing the template.`,\n )\n }\n }\n}\n\nasync function copyFiles(files: string[], toDestPath: (f: string) => string): Promise<string[]> {\n const copiedFiles: string[] = []\n for (const filePath of files) {\n const destPath = toDestPath(filePath)\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.copyFile(path.resolve(filePath), destPath)\n copiedFiles.push(destPath)\n if (destPath.endsWith(\".tsx\") || destPath.endsWith(\".ts\")) {\n await updateImportsInFile(destPath)\n }\n }\n return copiedFiles\n}\n\nasync function patchAppTsx(appTsxPath: string, templateKey: string): Promise<string> {\n if (!(await fileExists(appTsxPath))) return \"\"\n const originalContent = await fs.readFile(appTsxPath, \"utf8\")\n await fs.writeFile(\n appTsxPath,\n `import { ${templateKey} } from \"./components/${templateKey}/${templateKey}\"\\n\\nexport default function App() {\\n return <${templateKey} />\\n}`,\n )\n return originalContent\n}\n\nasync function runBuild(logger: Logger): Promise<void> {\n try {\n const result = await exec(\"npm run build\", { cwd: process.cwd() })\n if (result.stderr) logger.log(`Build stderr: ${result.stderr}`)\n } catch (buildError: any) {\n logger.log(`Build failed with error: ${buildError.message}`)\n if (buildError.stdout) logger.log(`Build stdout: ${buildError.stdout}`)\n if (buildError.stderr) logger.log(`Build stderr: ${buildError.stderr}`)\n throw buildError\n }\n}\n\nasync function cleanup(copiedFiles: string[], appTsxPath: string, originalAppContent: string): Promise<void> {\n for (const filePath of copiedFiles) {\n if (await fileExists(filePath)) {\n await fs.rm(filePath, { force: true })\n }\n }\n\n const sortedDirs = [...new Set(copiedFiles.map(f => path.dirname(f)))].sort((a, b) => b.length - a.length)\n for (const dir of sortedDirs) {\n try {\n await fs.rm(dir, { recursive: true, force: true })\n } catch {\n // ignore\n }\n }\n\n if (originalAppContent && (await fileExists(appTsxPath))) {\n await fs.writeFile(appTsxPath, originalAppContent)\n }\n}\n\nasync function updateImportsInFile(filePath: string): Promise<void> {\n const content = await fs.readFile(filePath, \"utf8\")\n const updatedContent = content.replace(\n /from\\s+[\"']\\.\\.\\/\\.\\.\\/(patterns|templates)\\/([^/\"']+\\/[^\"']+)[\"']/g,\n 'from \"../$2\"',\n )\n if (content !== updatedContent) {\n await fs.writeFile(filePath, updatedContent)\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;AAUpC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,CAAS;IACxC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAA4C,EAC5C,MAAc,EACd,KAAe;IAEf,MAAM,CAAC,KAAK,CAAC,iBAAiB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,cAAc,CAAC,CAAA;IAE1E,KAAK,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,KAAK,CAAC,w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