@cms0/shared 0.0.1 → 0.0.3

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/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # @cms0/shared
2
+
3
+ ## 0.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0f52b27: Fix `@cms0/cms0` publish/build and TypeScript consumption issues:
8
+
9
+ - Generate a fallback schema descriptor file before TypeScript compilation when `src/generated/schema-descriptor.ts` is missing in clean CI.
10
+ - Correct package `exports` type/import paths to point to `dist/types` and `dist/esm` so consumers can resolve `@cms0/cms0` and `@cms0/cms0/config` declarations properly.
11
+ - Fix `@cms0/shared` package exports to resolve from `dist` instead of `src`, so SSR bundlers (including Next.js Turbopack) don’t try to compile source TypeScript from `node_modules`.
12
+
13
+ ## 0.0.2
14
+
15
+ ### Patch Changes
16
+
17
+ - bef5ec7: Ensure the admin server binary is executable in Docker images.
18
+ - 2ee81b6: Fix rich text editor transaction sync issues and stabilize localized field test behavior.
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@cms0/shared",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
8
8
  "main": "dist/index.js",
9
- "types": "./src/index.ts",
9
+ "types": "./dist/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./src/index.ts",
13
- "import": "./src/index.ts",
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
14
  "require": "./dist/index.js"
15
15
  },
16
16
  "./*": {
17
- "types": "./src/*.ts",
18
- "import": "./src/*.ts",
17
+ "types": "./dist/*.d.ts",
18
+ "import": "./dist/*.js",
19
19
  "require": "./dist/*.js"
20
20
  }
21
21
  },
package/src/validation.ts CHANGED
@@ -7,7 +7,7 @@ const customTypeSchemas: Record<string, ZodType<any>> = {
7
7
  Url: z.string().url(),
8
8
  };
9
9
 
10
- export type PrimitiveType = "string" | "number" | "boolean";
10
+ export type PrimitiveType = "string" | "number" | "boolean" | "json";
11
11
  // Type definitions for descriptor elements
12
12
  export type FieldDescriptor =
13
13
  | {
@@ -15,6 +15,7 @@ export type FieldDescriptor =
15
15
  type: PrimitiveType;
16
16
  optional?: boolean;
17
17
  nullable?: boolean;
18
+ customType?: string;
18
19
  }
19
20
  | { kind: "modelRef"; model: string; optional?: boolean; nullable?: boolean }
20
21
  | {
@@ -23,6 +24,7 @@ export type FieldDescriptor =
23
24
  properties: Record<string, FieldDescriptor>;
24
25
  optional?: boolean;
25
26
  nullable?: boolean;
27
+ customType?: string;
26
28
  }
27
29
  | {
28
30
  kind?: "array";
@@ -30,6 +32,7 @@ export type FieldDescriptor =
30
32
  items: FieldDescriptor;
31
33
  optional?: boolean;
32
34
  nullable?: boolean;
35
+ customType?: string;
33
36
  };
34
37
 
35
38
  export type ModelDescriptor = {
@@ -42,6 +45,10 @@ export type RootDescriptor = FieldDescriptor;
42
45
  export type FullDescriptor = {
43
46
  models: Record<string, ModelDescriptor>;
44
47
  roots: Record<string, RootDescriptor>;
48
+ metadata?: {
49
+ locales?: string[];
50
+ defaultLocale?: string;
51
+ };
45
52
  };
46
53
 
47
54
  function convertDescriptorToZod(
@@ -64,6 +71,8 @@ function convertDescriptorToZod(
64
71
  return applyOptionality(z.number());
65
72
  case "boolean":
66
73
  return applyOptionality(z.boolean());
74
+ case "json":
75
+ return applyOptionality(z.any());
67
76
  }
68
77
  }
69
78