@getcoherent/core 0.5.13 → 0.5.14
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/LICENSE +21 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +6 -2
- package/package.json +8 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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.
|
package/dist/index.d.ts
CHANGED
|
@@ -2746,6 +2746,8 @@ declare const SharedComponentEntrySchema: z.ZodObject<{
|
|
|
2746
2746
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
2747
2747
|
/** Human-readable description */
|
|
2748
2748
|
description: z.ZodOptional<z.ZodString>;
|
|
2749
|
+
/** TypeScript props interface body, e.g. "{ icon: React.ReactNode; title: string }" */
|
|
2750
|
+
propsInterface: z.ZodOptional<z.ZodString>;
|
|
2749
2751
|
}, "strip", z.ZodTypeAny, {
|
|
2750
2752
|
type: "layout" | "section" | "widget";
|
|
2751
2753
|
name: string;
|
|
@@ -2754,6 +2756,7 @@ declare const SharedComponentEntrySchema: z.ZodObject<{
|
|
|
2754
2756
|
usedIn: string[];
|
|
2755
2757
|
description?: string | undefined;
|
|
2756
2758
|
createdAt?: string | undefined;
|
|
2759
|
+
propsInterface?: string | undefined;
|
|
2757
2760
|
}, {
|
|
2758
2761
|
type: "layout" | "section" | "widget";
|
|
2759
2762
|
name: string;
|
|
@@ -2762,6 +2765,7 @@ declare const SharedComponentEntrySchema: z.ZodObject<{
|
|
|
2762
2765
|
description?: string | undefined;
|
|
2763
2766
|
createdAt?: string | undefined;
|
|
2764
2767
|
usedIn?: string[] | undefined;
|
|
2768
|
+
propsInterface?: string | undefined;
|
|
2765
2769
|
}>;
|
|
2766
2770
|
type SharedComponentEntry = z.infer<typeof SharedComponentEntrySchema>;
|
|
2767
2771
|
/** Root schema for coherent.components.json */
|
|
@@ -2780,6 +2784,8 @@ declare const SharedComponentsManifestSchema: z.ZodObject<{
|
|
|
2780
2784
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
2781
2785
|
/** Human-readable description */
|
|
2782
2786
|
description: z.ZodOptional<z.ZodString>;
|
|
2787
|
+
/** TypeScript props interface body, e.g. "{ icon: React.ReactNode; title: string }" */
|
|
2788
|
+
propsInterface: z.ZodOptional<z.ZodString>;
|
|
2783
2789
|
}, "strip", z.ZodTypeAny, {
|
|
2784
2790
|
type: "layout" | "section" | "widget";
|
|
2785
2791
|
name: string;
|
|
@@ -2788,6 +2794,7 @@ declare const SharedComponentsManifestSchema: z.ZodObject<{
|
|
|
2788
2794
|
usedIn: string[];
|
|
2789
2795
|
description?: string | undefined;
|
|
2790
2796
|
createdAt?: string | undefined;
|
|
2797
|
+
propsInterface?: string | undefined;
|
|
2791
2798
|
}, {
|
|
2792
2799
|
type: "layout" | "section" | "widget";
|
|
2793
2800
|
name: string;
|
|
@@ -2796,6 +2803,7 @@ declare const SharedComponentsManifestSchema: z.ZodObject<{
|
|
|
2796
2803
|
description?: string | undefined;
|
|
2797
2804
|
createdAt?: string | undefined;
|
|
2798
2805
|
usedIn?: string[] | undefined;
|
|
2806
|
+
propsInterface?: string | undefined;
|
|
2799
2807
|
}>, "many">>;
|
|
2800
2808
|
/** Next numeric id for new entries (CID-XXX → nextId = 4 for CID-004) */
|
|
2801
2809
|
nextId: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2808,6 +2816,7 @@ declare const SharedComponentsManifestSchema: z.ZodObject<{
|
|
|
2808
2816
|
usedIn: string[];
|
|
2809
2817
|
description?: string | undefined;
|
|
2810
2818
|
createdAt?: string | undefined;
|
|
2819
|
+
propsInterface?: string | undefined;
|
|
2811
2820
|
}[];
|
|
2812
2821
|
nextId: number;
|
|
2813
2822
|
}, {
|
|
@@ -2819,6 +2828,7 @@ declare const SharedComponentsManifestSchema: z.ZodObject<{
|
|
|
2819
2828
|
description?: string | undefined;
|
|
2820
2829
|
createdAt?: string | undefined;
|
|
2821
2830
|
usedIn?: string[] | undefined;
|
|
2831
|
+
propsInterface?: string | undefined;
|
|
2822
2832
|
}[] | undefined;
|
|
2823
2833
|
nextId?: number | undefined;
|
|
2824
2834
|
}>;
|
|
@@ -3130,6 +3140,7 @@ interface CreateSharedComponentInput {
|
|
|
3130
3140
|
file: string;
|
|
3131
3141
|
usedIn?: string[];
|
|
3132
3142
|
description?: string;
|
|
3143
|
+
propsInterface?: string;
|
|
3133
3144
|
}
|
|
3134
3145
|
/**
|
|
3135
3146
|
* Add a new shared component: allocate CID, set createdAt, append to shared, increment nextId.
|
|
@@ -3539,6 +3550,8 @@ interface GenerateSharedComponentInput {
|
|
|
3539
3550
|
usedIn?: string[];
|
|
3540
3551
|
/** If true, overwrite an existing component with the same name instead of creating a uniquely-named copy. */
|
|
3541
3552
|
overwrite?: boolean;
|
|
3553
|
+
/** TypeScript props interface body, e.g. "{ title: string; icon: React.ReactNode }". */
|
|
3554
|
+
propsInterface?: string;
|
|
3542
3555
|
}
|
|
3543
3556
|
interface GenerateSharedComponentResult {
|
|
3544
3557
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -464,7 +464,9 @@ var SharedComponentEntrySchema = z2.object({
|
|
|
464
464
|
usedIn: z2.array(z2.string()).default([]),
|
|
465
465
|
createdAt: z2.string().datetime().optional(),
|
|
466
466
|
/** Human-readable description */
|
|
467
|
-
description: z2.string().optional()
|
|
467
|
+
description: z2.string().optional(),
|
|
468
|
+
/** TypeScript props interface body, e.g. "{ icon: React.ReactNode; title: string }" */
|
|
469
|
+
propsInterface: z2.string().optional()
|
|
468
470
|
});
|
|
469
471
|
var SharedComponentsManifestSchema = z2.object({
|
|
470
472
|
shared: z2.array(SharedComponentEntrySchema).default([]),
|
|
@@ -1970,6 +1972,7 @@ function createEntry(manifest, input) {
|
|
|
1970
1972
|
file: input.file,
|
|
1971
1973
|
usedIn: input.usedIn ?? [],
|
|
1972
1974
|
description: input.description,
|
|
1975
|
+
propsInterface: input.propsInterface,
|
|
1973
1976
|
createdAt: now
|
|
1974
1977
|
};
|
|
1975
1978
|
const nextManifest = {
|
|
@@ -6818,7 +6821,8 @@ async function generateSharedComponent(projectRoot, input) {
|
|
|
6818
6821
|
type: input.type,
|
|
6819
6822
|
file: filePath,
|
|
6820
6823
|
usedIn: input.usedIn ?? [],
|
|
6821
|
-
description: input.description
|
|
6824
|
+
description: input.description,
|
|
6825
|
+
propsInterface: input.propsInterface
|
|
6822
6826
|
});
|
|
6823
6827
|
await saveManifest(projectRoot, nextManifest);
|
|
6824
6828
|
return { id: entry.id, name: entry.name, file: entry.file };
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.5.
|
|
6
|
+
"version": "0.5.14",
|
|
7
7
|
"description": "Core design system engine for Coherent",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/index.js",
|
|
@@ -32,12 +32,6 @@
|
|
|
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
|
-
},
|
|
41
35
|
"dependencies": {
|
|
42
36
|
"handlebars": "^4.7.8",
|
|
43
37
|
"zod": "^3.22.4"
|
|
@@ -47,5 +41,11 @@
|
|
|
47
41
|
"tsup": "^8.0.1",
|
|
48
42
|
"typescript": "^5.3.3",
|
|
49
43
|
"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
|
+
}
|