coretik-block-generator-mcp 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/CLAUDE_INSTRUCTIONS.md +30 -0
- package/README.md +193 -0
- package/dist/constants.d.ts +55 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +27 -0
- package/dist/constants.js.map +1 -0
- package/dist/conventions.d.ts +19 -0
- package/dist/conventions.d.ts.map +1 -0
- package/dist/conventions.js +158 -0
- package/dist/conventions.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +518 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/learned-conventions.d.ts +53 -0
- package/dist/schemas/learned-conventions.d.ts.map +1 -0
- package/dist/schemas/learned-conventions.js +47 -0
- package/dist/schemas/learned-conventions.js.map +1 -0
- package/dist/services/convention-store.d.ts +9 -0
- package/dist/services/convention-store.d.ts.map +1 -0
- package/dist/services/convention-store.js +84 -0
- package/dist/services/convention-store.js.map +1 -0
- package/dist/services/feedback.d.ts +29 -0
- package/dist/services/feedback.d.ts.map +1 -0
- package/dist/services/feedback.js +199 -0
- package/dist/services/feedback.js.map +1 -0
- package/dist/services/naming.d.ts +51 -0
- package/dist/services/naming.d.ts.map +1 -0
- package/dist/services/naming.js +87 -0
- package/dist/services/naming.js.map +1 -0
- package/dist/services/pattern-extractor.d.ts +14 -0
- package/dist/services/pattern-extractor.d.ts.map +1 -0
- package/dist/services/pattern-extractor.js +310 -0
- package/dist/services/pattern-extractor.js.map +1 -0
- package/dist/services/registration.d.ts +31 -0
- package/dist/services/registration.d.ts.map +1 -0
- package/dist/services/registration.js +275 -0
- package/dist/services/registration.js.map +1 -0
- package/dist/templates/generators.d.ts +59 -0
- package/dist/templates/generators.d.ts.map +1 -0
- package/dist/templates/generators.js +79 -0
- package/dist/templates/generators.js.map +1 -0
- package/dist/templates/html-template.d.ts +12 -0
- package/dist/templates/html-template.d.ts.map +1 -0
- package/dist/templates/html-template.js +189 -0
- package/dist/templates/html-template.js.map +1 -0
- package/dist/templates/php-class.d.ts +19 -0
- package/dist/templates/php-class.d.ts.map +1 -0
- package/dist/templates/php-class.js +271 -0
- package/dist/templates/php-class.js.map +1 -0
- package/dist/templates/scss.d.ts +7 -0
- package/dist/templates/scss.d.ts.map +1 -0
- package/dist/templates/scss.js +102 -0
- package/dist/templates/scss.js.map +1 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +56 -0
- package/dist/utils.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { createEmptyConventions } from '../schemas/learned-conventions.js';
|
|
3
|
+
import { findFiles, readFileSafe } from '../utils.js';
|
|
4
|
+
/**
|
|
5
|
+
* Scan all existing blocks and extract patterns into LearnedConventions.
|
|
6
|
+
*/
|
|
7
|
+
export async function extractPatterns(projectRoot, paths) {
|
|
8
|
+
const conventions = createEmptyConventions();
|
|
9
|
+
const phpResults = await extractPhpPatterns(projectRoot, paths.blocksPhp);
|
|
10
|
+
const templateResults = await extractTemplatePatterns(projectRoot, paths.templates);
|
|
11
|
+
const scssResults = await extractScssPatterns(projectRoot, paths.scss);
|
|
12
|
+
conventions.blockCount = phpResults.blockCount;
|
|
13
|
+
conventions.php = phpResults.php;
|
|
14
|
+
conventions.template = templateResults;
|
|
15
|
+
conventions.scss = scssResults;
|
|
16
|
+
conventions.naming = phpResults.naming;
|
|
17
|
+
conventions.fields = phpResults.fields;
|
|
18
|
+
return conventions;
|
|
19
|
+
}
|
|
20
|
+
async function extractPhpPatterns(projectRoot, blocksDir) {
|
|
21
|
+
const dir = join(projectRoot, blocksDir);
|
|
22
|
+
const files = await findFiles(dir, /\.php$/);
|
|
23
|
+
const importCounts = new Map();
|
|
24
|
+
const traitCounts = new Map();
|
|
25
|
+
const interfaceCounts = new Map();
|
|
26
|
+
const baseClasses = {};
|
|
27
|
+
const visibilityCounts = { protected: 0, private: 0, public: 0 };
|
|
28
|
+
let useSettingsCount = 0;
|
|
29
|
+
const extraMethodCounts = new Map();
|
|
30
|
+
const fieldPatternCounts = new Map();
|
|
31
|
+
const namingPrefixes = {};
|
|
32
|
+
const classNameSuffixes = {};
|
|
33
|
+
let imageReturnFormat = 'id';
|
|
34
|
+
let linkReturnFormat = 'array';
|
|
35
|
+
const standardMethods = new Set(['fieldsBuilder', 'toArray', 'prepareComponents', 'getPlainHtml', '__construct']);
|
|
36
|
+
for (const file of files) {
|
|
37
|
+
const content = await readFileSafe(file);
|
|
38
|
+
if (!content)
|
|
39
|
+
continue;
|
|
40
|
+
// Extract use-statements (namespace level)
|
|
41
|
+
const useStatements = content.match(/^use\s+[A-Z][^;]+;/gm) || [];
|
|
42
|
+
for (const stmt of useStatements) {
|
|
43
|
+
const clean = stmt.replace(/^use\s+/, '').replace(/;$/, '');
|
|
44
|
+
importCounts.set(clean, (importCounts.get(clean) || 0) + 1);
|
|
45
|
+
}
|
|
46
|
+
// Extract traits (inside class body — "use TraitName;")
|
|
47
|
+
const classBodyMatch = content.match(/class\s+\w+[^{]*\{([\s\S]*)\}/);
|
|
48
|
+
if (classBodyMatch) {
|
|
49
|
+
const classBody = classBodyMatch[1];
|
|
50
|
+
const traitMatches = classBody.match(/^\s+use\s+(\w+);/gm) || [];
|
|
51
|
+
for (const t of traitMatches) {
|
|
52
|
+
const traitName = t.trim().replace(/^use\s+/, '').replace(/;$/, '');
|
|
53
|
+
traitCounts.set(traitName, (traitCounts.get(traitName) || 0) + 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Extract interfaces
|
|
57
|
+
const implMatch = content.match(/class\s+\w+\s+extends\s+\w+\s+implements\s+([^{]+)/);
|
|
58
|
+
if (implMatch) {
|
|
59
|
+
const interfaces = implMatch[1].split(',').map(i => i.trim());
|
|
60
|
+
for (const iface of interfaces) {
|
|
61
|
+
interfaceCounts.set(iface, (interfaceCounts.get(iface) || 0) + 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Extract base class and block type
|
|
65
|
+
const classMatch = content.match(/class\s+(\w+)\s+extends\s+(\w+)/);
|
|
66
|
+
if (classMatch) {
|
|
67
|
+
const className = classMatch[1];
|
|
68
|
+
const parentClass = classMatch[2];
|
|
69
|
+
let blockType = 'block';
|
|
70
|
+
if (parentClass.includes('Component') || file.includes('/Component/'))
|
|
71
|
+
blockType = 'component';
|
|
72
|
+
else if (parentClass.includes('Composite') || file.includes('/Composite/'))
|
|
73
|
+
blockType = 'composite';
|
|
74
|
+
baseClasses[blockType] = parentClass;
|
|
75
|
+
// Class name suffix
|
|
76
|
+
const suffixMatch = className.match(/(Component|Block|Composite)$/);
|
|
77
|
+
if (suffixMatch) {
|
|
78
|
+
classNameSuffixes[blockType] = suffixMatch[1];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Extract NAME constant for naming prefix
|
|
82
|
+
const nameMatch = content.match(/const\s+NAME\s*=\s*['"]([^'"]+)['"]/);
|
|
83
|
+
if (nameMatch) {
|
|
84
|
+
const dotIndex = nameMatch[1].indexOf('.');
|
|
85
|
+
if (dotIndex > -1) {
|
|
86
|
+
const prefix = nameMatch[1].substring(0, dotIndex);
|
|
87
|
+
namingPrefixes[prefix] = prefix;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Property visibility
|
|
91
|
+
const propMatches = content.match(/^\s+(protected|private|public)\s+\$/gm) || [];
|
|
92
|
+
for (const p of propMatches) {
|
|
93
|
+
const vis = p.trim().split(/\s+/)[0];
|
|
94
|
+
visibilityCounts[vis]++;
|
|
95
|
+
}
|
|
96
|
+
// useSettingsOn pattern
|
|
97
|
+
if (content.includes('useSettingsOn')) {
|
|
98
|
+
useSettingsCount++;
|
|
99
|
+
}
|
|
100
|
+
// Extra methods
|
|
101
|
+
const methodMatches = content.match(/public\s+function\s+(\w+)\s*\(/g) || [];
|
|
102
|
+
for (const m of methodMatches) {
|
|
103
|
+
const methodName = m.match(/function\s+(\w+)/)?.[1];
|
|
104
|
+
if (methodName && !standardMethods.has(methodName)) {
|
|
105
|
+
extraMethodCounts.set(methodName, (extraMethodCounts.get(methodName) || 0) + 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Field patterns from fieldsBuilder
|
|
109
|
+
const addFieldMatches = content.match(/->add(\w+)\(['"](\w+)['"]\)/g) || [];
|
|
110
|
+
for (const m of addFieldMatches) {
|
|
111
|
+
const parts = m.match(/->add(\w+)\(['"](\w+)['"]\)/);
|
|
112
|
+
if (parts) {
|
|
113
|
+
const type = acfMethodToType(parts[1]);
|
|
114
|
+
const name = parts[2];
|
|
115
|
+
const key = `${name}:${type}`;
|
|
116
|
+
const prev = fieldPatternCounts.get(key);
|
|
117
|
+
fieldPatternCounts.set(key, {
|
|
118
|
+
name,
|
|
119
|
+
type,
|
|
120
|
+
count: prev ? prev.count + 1 : 1,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Return formats
|
|
125
|
+
const imgReturnMatch = content.match(/setReturnFormat\(['"](\w+)['"]\)/);
|
|
126
|
+
if (imgReturnMatch) {
|
|
127
|
+
imageReturnFormat = imgReturnMatch[1];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const blockCount = files.length;
|
|
131
|
+
const threshold = Math.max(1, Math.floor(blockCount * 0.3));
|
|
132
|
+
// Determine dominant visibility
|
|
133
|
+
const dominantVisibility = Object.entries(visibilityCounts)
|
|
134
|
+
.sort((a, b) => b[1] - a[1])[0][0];
|
|
135
|
+
return {
|
|
136
|
+
blockCount,
|
|
137
|
+
php: {
|
|
138
|
+
imports: sortedByFrequency(importCounts, threshold),
|
|
139
|
+
traits: sortedByFrequency(traitCounts, 1),
|
|
140
|
+
interfaces: sortedByFrequency(interfaceCounts, 1),
|
|
141
|
+
baseClasses,
|
|
142
|
+
propertyVisibility: dominantVisibility,
|
|
143
|
+
useSettingsPattern: useSettingsCount > blockCount / 2,
|
|
144
|
+
extraMethods: sortedByFrequency(extraMethodCounts, threshold),
|
|
145
|
+
},
|
|
146
|
+
naming: {
|
|
147
|
+
blockNamePrefix: namingPrefixes,
|
|
148
|
+
classNameSuffix: classNameSuffixes,
|
|
149
|
+
bemSuffix: {},
|
|
150
|
+
templateSubDir: {},
|
|
151
|
+
},
|
|
152
|
+
fields: {
|
|
153
|
+
commonFieldPatterns: [...fieldPatternCounts.values()]
|
|
154
|
+
.filter(p => p.count >= 2)
|
|
155
|
+
.sort((a, b) => b.count - a.count)
|
|
156
|
+
.map(p => ({ name: p.name, type: p.type, frequency: p.count })),
|
|
157
|
+
imageReturnFormat,
|
|
158
|
+
linkReturnFormat,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// ─── Template Pattern Extraction ────────────────────────────────────────────
|
|
163
|
+
async function extractTemplatePatterns(projectRoot, templatesDir) {
|
|
164
|
+
const dir = join(projectRoot, templatesDir);
|
|
165
|
+
const files = await findFiles(dir, /\.php$/);
|
|
166
|
+
const wrapperTags = new Map();
|
|
167
|
+
const wrapperAttrs = new Map();
|
|
168
|
+
const escapingFns = {};
|
|
169
|
+
const emptyCheckStyles = new Map();
|
|
170
|
+
const imageRenderFns = new Map();
|
|
171
|
+
const snippets = [];
|
|
172
|
+
for (const file of files) {
|
|
173
|
+
const content = await readFileSafe(file);
|
|
174
|
+
if (!content)
|
|
175
|
+
continue;
|
|
176
|
+
// Wrapper tag — first HTML tag after PHP block
|
|
177
|
+
const tagMatch = content.match(/<(\w+)\s+class="/);
|
|
178
|
+
if (tagMatch) {
|
|
179
|
+
wrapperTags.set(tagMatch[1], (wrapperTags.get(tagMatch[1]) || 0) + 1);
|
|
180
|
+
}
|
|
181
|
+
// Wrapper attributes
|
|
182
|
+
const attrMatch = content.match(/<\w+\s+([^>]+)>/);
|
|
183
|
+
if (attrMatch) {
|
|
184
|
+
const attrs = attrMatch[1].match(/\b(data-\w+|id|role|aria-\w+)/g) || [];
|
|
185
|
+
for (const attr of attrs) {
|
|
186
|
+
wrapperAttrs.set(attr, (wrapperAttrs.get(attr) || 0) + 1);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Escaping functions
|
|
190
|
+
const escMatches = content.match(/(esc_html|esc_attr|esc_url|wp_kses|wp_kses_post)\(/g) || [];
|
|
191
|
+
for (const m of escMatches) {
|
|
192
|
+
const fn = m.replace('(', '');
|
|
193
|
+
if (!escapingFns['general'])
|
|
194
|
+
escapingFns['general'] = new Set();
|
|
195
|
+
escapingFns['general'].add(fn);
|
|
196
|
+
}
|
|
197
|
+
// Empty check style
|
|
198
|
+
const checkMatches = content.match(/if\s*\(\s*(!empty|isset|!is_null)/g) || [];
|
|
199
|
+
for (const m of checkMatches) {
|
|
200
|
+
const style = m.match(/(!empty|isset|!is_null)/)?.[1] || '!empty';
|
|
201
|
+
emptyCheckStyles.set(style, (emptyCheckStyles.get(style) || 0) + 1);
|
|
202
|
+
}
|
|
203
|
+
// Image render function
|
|
204
|
+
const imgMatches = content.match(/(wp_get_attachment_image|wp_get_attachment_url|wp_get_attachment_image_src)\(/g) || [];
|
|
205
|
+
for (const m of imgMatches) {
|
|
206
|
+
const fn = m.replace('(', '');
|
|
207
|
+
imageRenderFns.set(fn, (imageRenderFns.get(fn) || 0) + 1);
|
|
208
|
+
}
|
|
209
|
+
// Collect a snippet (first meaningful HTML lines)
|
|
210
|
+
const htmlLines = content.split('\n')
|
|
211
|
+
.filter(l => l.trim() && !l.trim().startsWith('<?php') && !l.trim().startsWith('*') && !l.trim().startsWith('/**'))
|
|
212
|
+
.slice(0, 8);
|
|
213
|
+
if (htmlLines.length > 0 && snippets.length < 5) {
|
|
214
|
+
snippets.push(htmlLines.join('\n'));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const dominantTag = maxEntry(wrapperTags) || 'div';
|
|
218
|
+
const dominantCheck = maxEntry(emptyCheckStyles) || '!empty';
|
|
219
|
+
const dominantImgFn = maxEntry(imageRenderFns) || 'wp_get_attachment_image';
|
|
220
|
+
return {
|
|
221
|
+
wrapperTag: dominantTag,
|
|
222
|
+
wrapperAttributes: [...wrapperAttrs.keys()],
|
|
223
|
+
escapingFunctions: Object.fromEntries(Object.entries(escapingFns).map(([k, v]) => [k, [...v]])),
|
|
224
|
+
emptyCheckStyle: dominantCheck,
|
|
225
|
+
imageRenderFunction: dominantImgFn,
|
|
226
|
+
htmlSnippets: snippets,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
// ─── SCSS Pattern Extraction ────────────────────────────────────────────────
|
|
230
|
+
async function extractScssPatterns(projectRoot, scssDir) {
|
|
231
|
+
const dir = join(projectRoot, scssDir);
|
|
232
|
+
const files = await findFiles(dir, /\.scss$/);
|
|
233
|
+
let hasBem = false;
|
|
234
|
+
const layoutCounts = new Map();
|
|
235
|
+
const spacingVars = new Set();
|
|
236
|
+
const colorVars = new Set();
|
|
237
|
+
const breakpoints = new Set();
|
|
238
|
+
for (const file of files) {
|
|
239
|
+
const content = await readFileSafe(file);
|
|
240
|
+
if (!content)
|
|
241
|
+
continue;
|
|
242
|
+
// BEM detection
|
|
243
|
+
if (content.includes('&__') || content.includes('&--')) {
|
|
244
|
+
hasBem = true;
|
|
245
|
+
}
|
|
246
|
+
// Container layout
|
|
247
|
+
const layoutMatches = content.match(/display:\s*(flex|grid)/g) || [];
|
|
248
|
+
for (const m of layoutMatches) {
|
|
249
|
+
const layout = m.replace('display:', '').trim();
|
|
250
|
+
layoutCounts.set(layout, (layoutCounts.get(layout) || 0) + 1);
|
|
251
|
+
}
|
|
252
|
+
// CSS custom properties
|
|
253
|
+
const varMatches = content.match(/var\(--([^)]+)\)/g) || [];
|
|
254
|
+
for (const m of varMatches) {
|
|
255
|
+
const varName = m.match(/var\(--([^)]+)\)/)?.[1] || '';
|
|
256
|
+
if (varName.match(/spacing|gap|margin|padding/i)) {
|
|
257
|
+
spacingVars.add(`--${varName}`);
|
|
258
|
+
}
|
|
259
|
+
else if (varName.match(/color|bg|background|text|border/i)) {
|
|
260
|
+
colorVars.add(`--${varName}`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Breakpoints
|
|
264
|
+
const bpMatches = content.match(/@include\s+(\w+)|@media\s*\(([^)]+)\)/g) || [];
|
|
265
|
+
for (const m of bpMatches) {
|
|
266
|
+
breakpoints.add(m.trim());
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
methodology: hasBem ? 'BEM' : 'flat',
|
|
271
|
+
containerLayout: maxEntry(layoutCounts) || 'flex',
|
|
272
|
+
spacingVariables: [...spacingVars],
|
|
273
|
+
colorVariables: [...colorVars],
|
|
274
|
+
breakpoints: [...breakpoints],
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
278
|
+
function sortedByFrequency(map, minCount) {
|
|
279
|
+
return [...map.entries()]
|
|
280
|
+
.filter(([, count]) => count >= minCount)
|
|
281
|
+
.sort((a, b) => b[1] - a[1])
|
|
282
|
+
.map(([key]) => key);
|
|
283
|
+
}
|
|
284
|
+
function maxEntry(map) {
|
|
285
|
+
let max = 0;
|
|
286
|
+
let result;
|
|
287
|
+
for (const [key, count] of map) {
|
|
288
|
+
if (count > max) {
|
|
289
|
+
max = count;
|
|
290
|
+
result = key;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
295
|
+
function acfMethodToType(method) {
|
|
296
|
+
const map = {
|
|
297
|
+
Text: 'text', Textarea: 'textarea', Wysiwyg: 'wysiwyg',
|
|
298
|
+
Image: 'image', Gallery: 'gallery', File: 'file',
|
|
299
|
+
Select: 'select', Radio: 'radio', Checkbox: 'checkbox',
|
|
300
|
+
TrueFalse: 'true_false', Link: 'link', Url: 'url',
|
|
301
|
+
Number: 'number', Range: 'range', Email: 'email',
|
|
302
|
+
Repeater: 'repeater', Group: 'group', Relationship: 'relationship',
|
|
303
|
+
PostObject: 'post_object', Taxonomy: 'taxonomy', User: 'user',
|
|
304
|
+
ColorPicker: 'color_picker', DatePicker: 'date_picker',
|
|
305
|
+
DateTimePicker: 'date_time_picker', TimePicker: 'time_picker',
|
|
306
|
+
Oembed: 'oembed',
|
|
307
|
+
};
|
|
308
|
+
return map[method] || method.toLowerCase();
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=pattern-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-extractor.js","sourceRoot":"","sources":["../../src/services/pattern-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUtD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,WAAmB,EACnB,KAAkB;IAElB,MAAM,WAAW,GAAG,sBAAsB,EAAE,CAAC;IAE7C,MAAM,UAAU,GAAG,MAAM,kBAAkB,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,MAAM,uBAAuB,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACpF,MAAM,WAAW,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvE,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;IAC/C,WAAW,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;IACjC,WAAW,CAAC,QAAQ,GAAG,eAAe,CAAC;IACvC,WAAW,CAAC,IAAI,GAAG,WAAW,CAAC;IAC/B,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACvC,WAAW,CAAC,MAAM,GAAG,UAAU,CAAC,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C;AAChB,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,MAAM,GAAG,GAA2B;QAClC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS;QACtD,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;QAChD,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;QACtD,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK;QACjD,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;QAChD,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc;QAClE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM;QAC7D,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa;QACtD,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa;QAC7D,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface RegistrationConfig {
|
|
2
|
+
projectRoot: string;
|
|
3
|
+
rootNamespace: string;
|
|
4
|
+
libraryFile?: string;
|
|
5
|
+
scssMainFile?: string;
|
|
6
|
+
}
|
|
7
|
+
interface RegistrationResult {
|
|
8
|
+
php: {
|
|
9
|
+
success: boolean;
|
|
10
|
+
file: string;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
scss: {
|
|
14
|
+
success: boolean;
|
|
15
|
+
file: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Register a block in both PHP and SCSS.
|
|
21
|
+
*/
|
|
22
|
+
export declare function registerBlock(config: RegistrationConfig, className: string, kebabName: string, subDir: string, suffix: string): Promise<RegistrationResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Detect registration files for the project config tool.
|
|
25
|
+
*/
|
|
26
|
+
export declare function detectRegistrationFiles(projectRoot: string, libraryFileOverride?: string, scssMainFileOverride?: string): Promise<{
|
|
27
|
+
libraryFile: string | null;
|
|
28
|
+
scssMainFile: string | null;
|
|
29
|
+
}>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../../src/services/registration.ts"],"names":[],"mappings":"AAGA,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,kBAAkB;IAC1B,GAAG,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D;AA2RD;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CAI7B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,oBAAoB,CAAC,EAAE,MAAM,GAC5B,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAYtE"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { join, relative } from 'path';
|
|
2
|
+
import { findFiles, readFileSafe, writeFileSafe } from '../utils.js';
|
|
3
|
+
// Patterns used in Coretik projects to register blocks
|
|
4
|
+
const PHP_REGISTRATION_PATTERNS = [
|
|
5
|
+
'$library->add(', // simple library pattern
|
|
6
|
+
'$blocks->push(', // container extend pattern (idetik-v2 style)
|
|
7
|
+
'$our_blocks', // array-based registration
|
|
8
|
+
'pageBuilder.library', // container extend key
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Auto-detect the PHP file where blocks are registered.
|
|
12
|
+
* Supports multiple registration patterns:
|
|
13
|
+
* - $library->add(ClassName::class)
|
|
14
|
+
* - $blocks->push(ClassName::class) inside $container->extend()
|
|
15
|
+
* - Array-based registration with $our_blocks = [...]
|
|
16
|
+
*/
|
|
17
|
+
async function findLibraryFile(projectRoot) {
|
|
18
|
+
// Search in src/ and config/ directories first
|
|
19
|
+
const searchDirs = ['src', 'src/config', 'config'];
|
|
20
|
+
for (const dir of searchDirs) {
|
|
21
|
+
const fullDir = join(projectRoot, dir);
|
|
22
|
+
const phpFiles = await findFiles(fullDir, /\.php$/);
|
|
23
|
+
for (const file of phpFiles) {
|
|
24
|
+
const content = await readFileSafe(file);
|
|
25
|
+
if (content && PHP_REGISTRATION_PATTERNS.some(p => content.includes(p))) {
|
|
26
|
+
return file;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Fallback: check all PHP files (skip vendor/node_modules)
|
|
31
|
+
const rootPhpFiles = await findFiles(projectRoot, /\.php$/);
|
|
32
|
+
for (const file of rootPhpFiles) {
|
|
33
|
+
if (file.includes('vendor/') || file.includes('node_modules/'))
|
|
34
|
+
continue;
|
|
35
|
+
const content = await readFileSafe(file);
|
|
36
|
+
if (content && PHP_REGISTRATION_PATTERNS.some(p => content.includes(p))) {
|
|
37
|
+
return file;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Detect the registration style used in the file.
|
|
44
|
+
*/
|
|
45
|
+
function detectRegistrationStyle(content) {
|
|
46
|
+
if (content.includes('$blocks->push('))
|
|
47
|
+
return 'push';
|
|
48
|
+
if (content.includes('$library->add('))
|
|
49
|
+
return 'add';
|
|
50
|
+
if (content.match(/\$\w+\s*=\s*\[\s*\n.*::class/s))
|
|
51
|
+
return 'array';
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Auto-detect the SCSS file that imports block partials.
|
|
56
|
+
* Supports ITCSS structure (60-components/blocks.scss) and flat structure.
|
|
57
|
+
*/
|
|
58
|
+
async function findScssMainFile(projectRoot) {
|
|
59
|
+
const assetsDir = join(projectRoot, 'assets');
|
|
60
|
+
const scssFiles = await findFiles(assetsDir, /\.scss$/);
|
|
61
|
+
// Priority 1: File that imports block partials (e.g., 60-components/blocks.scss)
|
|
62
|
+
for (const file of scssFiles) {
|
|
63
|
+
const content = await readFileSafe(file);
|
|
64
|
+
if (content && (content.includes("@import 'blocks/") ||
|
|
65
|
+
content.includes('@import "blocks/') ||
|
|
66
|
+
content.includes("@use 'blocks/") ||
|
|
67
|
+
content.includes("@import 'components/blocks/") ||
|
|
68
|
+
content.includes('@import "components/blocks/'))) {
|
|
69
|
+
return file;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Priority 2: Common filenames for block SCSS aggregation
|
|
73
|
+
const candidates = [
|
|
74
|
+
'assets/styles/60-components/blocks.scss', // ITCSS
|
|
75
|
+
'assets/styles/components/blocks.scss',
|
|
76
|
+
'assets/styles/_blocks.scss',
|
|
77
|
+
'assets/styles/components/_blocks.scss',
|
|
78
|
+
'assets/scss/60-components/blocks.scss',
|
|
79
|
+
'assets/styles/main.scss',
|
|
80
|
+
'assets/styles/app.scss',
|
|
81
|
+
'assets/styles/style.scss',
|
|
82
|
+
'assets/scss/main.scss',
|
|
83
|
+
];
|
|
84
|
+
for (const candidate of candidates) {
|
|
85
|
+
const fullPath = join(projectRoot, candidate);
|
|
86
|
+
const content = await readFileSafe(fullPath);
|
|
87
|
+
if (content)
|
|
88
|
+
return fullPath;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Register a block in the PHP library file.
|
|
94
|
+
* Auto-detects registration style (push, add, or array).
|
|
95
|
+
*/
|
|
96
|
+
async function registerPhpBlock(config, className, subDir, suffix) {
|
|
97
|
+
const filePath = config.libraryFile
|
|
98
|
+
? join(config.projectRoot, config.libraryFile)
|
|
99
|
+
: await findLibraryFile(config.projectRoot);
|
|
100
|
+
if (!filePath) {
|
|
101
|
+
return {
|
|
102
|
+
success: false,
|
|
103
|
+
file: '',
|
|
104
|
+
message: 'Could not find PHP library file. Set CORETIK_LIBRARY_FILE env var.',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const content = await readFileSafe(filePath);
|
|
108
|
+
if (!content) {
|
|
109
|
+
return { success: false, file: filePath, message: `Could not read ${filePath}` };
|
|
110
|
+
}
|
|
111
|
+
const fqcn = `${config.rootNamespace}\\${subDir}\\${className}${suffix}`;
|
|
112
|
+
const classRef = `${className}${suffix}::class`;
|
|
113
|
+
// Check if already registered
|
|
114
|
+
if (content.includes(fqcn) || content.includes(classRef)) {
|
|
115
|
+
return {
|
|
116
|
+
success: true,
|
|
117
|
+
file: relative(config.projectRoot, filePath),
|
|
118
|
+
message: `Already registered: ${className}${suffix}`,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const style = detectRegistrationStyle(content);
|
|
122
|
+
let newContent = content;
|
|
123
|
+
if (style === 'array') {
|
|
124
|
+
// Array-based: add FQCN to the array (e.g., $our_blocks = [...])
|
|
125
|
+
// Find the last ::class entry in the array and add after it
|
|
126
|
+
const arrayEntryRegex = /(\s+)([A-Z][\w\\]+::class),?\s*$/gm;
|
|
127
|
+
const matches = [...content.matchAll(arrayEntryRegex)];
|
|
128
|
+
if (matches.length > 0) {
|
|
129
|
+
const lastMatch = matches[matches.length - 1];
|
|
130
|
+
const insertPos = lastMatch.index + lastMatch[0].length;
|
|
131
|
+
const indent = lastMatch[1];
|
|
132
|
+
// Ensure the previous line ends with a comma
|
|
133
|
+
const prevLine = lastMatch[0].trimEnd();
|
|
134
|
+
const needsComma = !prevLine.endsWith(',');
|
|
135
|
+
const prefix = needsComma
|
|
136
|
+
? newContent.slice(0, insertPos).replace(/,?\s*$/, ',\n')
|
|
137
|
+
: newContent.slice(0, insertPos);
|
|
138
|
+
newContent = prefix + `${indent}${fqcn}::class,` + newContent.slice(insertPos);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else if (style === 'push') {
|
|
142
|
+
// Push-based: $blocks->push(ClassName::class)
|
|
143
|
+
const pushRegex = /\$blocks->push\([^)]+\);/g;
|
|
144
|
+
const matches = [...newContent.matchAll(pushRegex)];
|
|
145
|
+
if (matches.length > 0) {
|
|
146
|
+
// Add as a new entry in the array if it uses foreach pattern
|
|
147
|
+
// Find the $our_blocks array or similar
|
|
148
|
+
const arrayRegex = /(\s+)([\w\\]+::class),?\s*\n/g;
|
|
149
|
+
const arrayMatches = [...content.matchAll(arrayRegex)];
|
|
150
|
+
if (arrayMatches.length > 0) {
|
|
151
|
+
const lastEntry = arrayMatches[arrayMatches.length - 1];
|
|
152
|
+
const insertPos = lastEntry.index + lastEntry[0].length;
|
|
153
|
+
const indent = lastEntry[1];
|
|
154
|
+
// Ensure previous line has a comma
|
|
155
|
+
const line = lastEntry[0];
|
|
156
|
+
const needsComma = !line.includes(',');
|
|
157
|
+
if (needsComma) {
|
|
158
|
+
const commaPos = lastEntry.index + lastEntry[0].trimEnd().length;
|
|
159
|
+
newContent = newContent.slice(0, commaPos) + ',' + newContent.slice(commaPos);
|
|
160
|
+
}
|
|
161
|
+
newContent = newContent.slice(0, insertPos) + `${indent}${fqcn}::class,\n` + newContent.slice(insertPos);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else if (style === 'add') {
|
|
166
|
+
// Simple $library->add() pattern
|
|
167
|
+
const addRegex = /\$library->add\([^)]+\);/g;
|
|
168
|
+
const matches = [...newContent.matchAll(addRegex)];
|
|
169
|
+
if (matches.length > 0) {
|
|
170
|
+
const lastAdd = matches[matches.length - 1];
|
|
171
|
+
const insertPos = lastAdd.index + lastAdd[0].length;
|
|
172
|
+
const lineStart = newContent.lastIndexOf('\n', lastAdd.index) + 1;
|
|
173
|
+
const indent = newContent.slice(lineStart, lastAdd.index).match(/^\s*/)?.[0] || ' ';
|
|
174
|
+
newContent = newContent.slice(0, insertPos) + '\n' + indent + `$library->add(${classRef});` + newContent.slice(insertPos);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
return {
|
|
179
|
+
success: false,
|
|
180
|
+
file: relative(config.projectRoot, filePath),
|
|
181
|
+
message: `Could not detect registration pattern in ${relative(config.projectRoot, filePath)}`,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
// Only write if content actually changed
|
|
185
|
+
if (newContent === content) {
|
|
186
|
+
return {
|
|
187
|
+
success: false,
|
|
188
|
+
file: relative(config.projectRoot, filePath),
|
|
189
|
+
message: `Could not insert registration statement in ${relative(config.projectRoot, filePath)}`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
await writeFileSafe(filePath, newContent);
|
|
193
|
+
return {
|
|
194
|
+
success: true,
|
|
195
|
+
file: relative(config.projectRoot, filePath),
|
|
196
|
+
message: `Registered ${className}${suffix} in ${relative(config.projectRoot, filePath)}`,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Register a block's SCSS partial in the SCSS imports file.
|
|
201
|
+
*/
|
|
202
|
+
async function registerScssBlock(config, kebabName) {
|
|
203
|
+
const filePath = config.scssMainFile
|
|
204
|
+
? join(config.projectRoot, config.scssMainFile)
|
|
205
|
+
: await findScssMainFile(config.projectRoot);
|
|
206
|
+
if (!filePath) {
|
|
207
|
+
return {
|
|
208
|
+
success: false,
|
|
209
|
+
file: '',
|
|
210
|
+
message: 'Could not find SCSS imports file. Set CORETIK_SCSS_MAIN_FILE env var.',
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const content = await readFileSafe(filePath);
|
|
214
|
+
if (!content) {
|
|
215
|
+
return { success: false, file: filePath, message: `Could not read ${filePath}` };
|
|
216
|
+
}
|
|
217
|
+
// Check if already imported
|
|
218
|
+
if (content.includes(kebabName)) {
|
|
219
|
+
return {
|
|
220
|
+
success: true,
|
|
221
|
+
file: relative(config.projectRoot, filePath),
|
|
222
|
+
message: `Already imported: ${kebabName}`,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// Detect import style (@import vs @use)
|
|
226
|
+
const usesAtUse = content.includes('@use ');
|
|
227
|
+
const importKeyword = usesAtUse ? '@use' : '@import';
|
|
228
|
+
// Detect the import path pattern from existing imports
|
|
229
|
+
const importPattern = content.match(/@(?:import|use)\s+['"]([^'"]*blocks\/)[^'"]*['"]/);
|
|
230
|
+
const basePath = importPattern ? importPattern[1] : 'blocks/';
|
|
231
|
+
const importLine = `${importKeyword} '${basePath}${kebabName}';`;
|
|
232
|
+
// Add after the last block import line
|
|
233
|
+
const blockImportRegex = new RegExp(`@(?:import|use)\\s+['"][^'"]*blocks/[^'"]*['"];?`, 'g');
|
|
234
|
+
const blockImports = [...content.matchAll(blockImportRegex)];
|
|
235
|
+
let newContent;
|
|
236
|
+
if (blockImports.length > 0) {
|
|
237
|
+
const lastImport = blockImports[blockImports.length - 1];
|
|
238
|
+
const insertPos = lastImport.index + lastImport[0].length;
|
|
239
|
+
newContent = content.slice(0, insertPos) + '\n' + importLine + content.slice(insertPos);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
// No block imports found — append at the end
|
|
243
|
+
newContent = content.trimEnd() + '\n' + importLine + '\n';
|
|
244
|
+
}
|
|
245
|
+
await writeFileSafe(filePath, newContent);
|
|
246
|
+
return {
|
|
247
|
+
success: true,
|
|
248
|
+
file: relative(config.projectRoot, filePath),
|
|
249
|
+
message: `Added ${importLine} to ${relative(config.projectRoot, filePath)}`,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Register a block in both PHP and SCSS.
|
|
254
|
+
*/
|
|
255
|
+
export async function registerBlock(config, className, kebabName, subDir, suffix) {
|
|
256
|
+
const php = await registerPhpBlock(config, className, subDir, suffix);
|
|
257
|
+
const scss = await registerScssBlock(config, kebabName);
|
|
258
|
+
return { php, scss };
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Detect registration files for the project config tool.
|
|
262
|
+
*/
|
|
263
|
+
export async function detectRegistrationFiles(projectRoot, libraryFileOverride, scssMainFileOverride) {
|
|
264
|
+
const libraryFile = libraryFileOverride
|
|
265
|
+
? join(projectRoot, libraryFileOverride)
|
|
266
|
+
: await findLibraryFile(projectRoot);
|
|
267
|
+
const scssMainFile = scssMainFileOverride
|
|
268
|
+
? join(projectRoot, scssMainFileOverride)
|
|
269
|
+
: await findScssMainFile(projectRoot);
|
|
270
|
+
return {
|
|
271
|
+
libraryFile: libraryFile ? relative(projectRoot, libraryFile) : null,
|
|
272
|
+
scssMainFile: scssMainFile ? relative(projectRoot, scssMainFile) : null,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=registration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registration.js","sourceRoot":"","sources":["../../src/services/registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,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