@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.
Files changed (2) hide show
  1. package/dist/index.js +20 -10
  2. 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 || []).map((p: any) => ({
5098
- name: p.name || p.id,
5099
- route: p.route || '/' + p.id,
5100
- sections: p.pageAnalysis?.sections?.map((s: any) => s.name) || [],
5101
- componentUsage: p.pageAnalysis?.componentUsage || {},
5102
- iconCount: p.pageAnalysis?.iconCount ?? 0,
5103
- layoutPattern: p.pageAnalysis?.layoutPattern || null,
5104
- hasForm: p.pageAnalysis?.hasForm ?? false,
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;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.2.0",
6
+ "version": "0.2.2",
7
7
  "description": "Core design system engine for Coherent",
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",