@getcoherent/core 0.2.0 → 0.2.1
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 +8 -8
- package/LICENSE +0 -21
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;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.1",
|
|
7
7
|
"description": "Core design system engine for Coherent",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.js",
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
],
|
|
33
33
|
"author": "Coherent Design Method",
|
|
34
34
|
"license": "MIT",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "tsup --watch",
|
|
37
|
+
"build": "tsup",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "vitest"
|
|
40
|
+
},
|
|
35
41
|
"dependencies": {
|
|
36
42
|
"handlebars": "^4.7.8",
|
|
37
43
|
"zod": "^3.22.4"
|
|
@@ -41,11 +47,5 @@
|
|
|
41
47
|
"tsup": "^8.0.1",
|
|
42
48
|
"typescript": "^5.3.3",
|
|
43
49
|
"vitest": "^1.2.1"
|
|
44
|
-
},
|
|
45
|
-
"scripts": {
|
|
46
|
-
"dev": "tsup --watch",
|
|
47
|
-
"build": "tsup",
|
|
48
|
-
"typecheck": "tsc --noEmit",
|
|
49
|
-
"test": "vitest"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Sergei Kovtun
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|