@getcoherent/core 0.2.0 → 0.2.2
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/dist/index.js +20 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5092,17 +5092,23 @@ function loadPages() {
|
|
|
5092
5092
|
const jsonStart = jsonMatch ? raw.indexOf('{', raw.indexOf(jsonMatch[0])) : -1
|
|
5093
5093
|
if (jsonStart === -1) return []
|
|
5094
5094
|
let jsonStr = raw.slice(jsonStart)
|
|
5095
|
-
jsonStr = jsonStr.replace(/\\}\\s*as\\s+const\\s*;?\\s*$/, '}')
|
|
5095
|
+
jsonStr = jsonStr.replace(/\\}\\s*(as\\s+const|satisfies\\s+\\w+)\\s*;?\\s*$/, '}')
|
|
5096
|
+
jsonStr = jsonStr.replace(/,\\s*([\\]\\}])/g, '$1')
|
|
5096
5097
|
const json = JSON.parse(jsonStr)
|
|
5097
|
-
return (json.pages || [])
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5098
|
+
return (json.pages || [])
|
|
5099
|
+
.filter((p: any) => {
|
|
5100
|
+
const route = p.route || '/' + p.id
|
|
5101
|
+
return !route.includes('[') && !route.includes(']')
|
|
5102
|
+
})
|
|
5103
|
+
.map((p: any) => ({
|
|
5104
|
+
name: p.name || p.id,
|
|
5105
|
+
route: p.route || '/' + p.id,
|
|
5106
|
+
sections: p.pageAnalysis?.sections?.map((s: any) => s.name) || [],
|
|
5107
|
+
componentUsage: p.pageAnalysis?.componentUsage || {},
|
|
5108
|
+
iconCount: p.pageAnalysis?.iconCount ?? 0,
|
|
5109
|
+
layoutPattern: p.pageAnalysis?.layoutPattern || null,
|
|
5110
|
+
hasForm: p.pageAnalysis?.hasForm ?? false,
|
|
5111
|
+
}))
|
|
5106
5112
|
} catch {
|
|
5107
5113
|
return []
|
|
5108
5114
|
}
|
|
@@ -6192,6 +6198,10 @@ async function integrateSharedLayoutIntoRootLayout(projectRoot) {
|
|
|
6192
6198
|
result = result.slice(0, lineEnd) + line + "\n" + result.slice(lineEnd);
|
|
6193
6199
|
}
|
|
6194
6200
|
}
|
|
6201
|
+
if (headers.length > 0) {
|
|
6202
|
+
result = result.replace(/\s*<AppNav\s*\/>\s*\n?/g, "\n");
|
|
6203
|
+
result = result.replace(/^import\s.*['"]\.\/AppNav['"]\s*;?\n?/gm, "");
|
|
6204
|
+
}
|
|
6195
6205
|
if (headers.length > 0) {
|
|
6196
6206
|
const bodyOpen = result.indexOf("<body");
|
|
6197
6207
|
if (bodyOpen === -1) return false;
|