@screenbook/core 0.0.1 → 0.1.0

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.cjs CHANGED
@@ -2,7 +2,8 @@ let zod = require("zod");
2
2
 
3
3
  //#region src/types.ts
4
4
  /**
5
- * Schema for screen metadata definition
5
+ * Schema for screen metadata definition (runtime validation)
6
+ * @internal
6
7
  */
7
8
  const screenSchema = zod.z.object({
8
9
  id: zod.z.string().min(1),
@@ -13,6 +14,7 @@ const screenSchema = zod.z.object({
13
14
  dependsOn: zod.z.array(zod.z.string()).optional(),
14
15
  entryPoints: zod.z.array(zod.z.string()).optional(),
15
16
  next: zod.z.array(zod.z.string()).optional(),
17
+ allowCycles: zod.z.boolean().optional(),
16
18
  description: zod.z.string().optional(),
17
19
  links: zod.z.array(zod.z.object({
18
20
  label: zod.z.string(),
@@ -20,7 +22,8 @@ const screenSchema = zod.z.object({
20
22
  })).optional()
21
23
  });
22
24
  /**
23
- * Schema for progressive adoption configuration
25
+ * Schema for progressive adoption configuration (runtime validation)
26
+ * @internal
24
27
  */
25
28
  const adoptionSchema = zod.z.object({
26
29
  mode: zod.z.enum(["full", "progressive"]).default("full"),
@@ -28,7 +31,8 @@ const adoptionSchema = zod.z.object({
28
31
  minimumCoverage: zod.z.number().min(0).max(100).optional()
29
32
  });
30
33
  /**
31
- * Schema for Screenbook configuration
34
+ * Schema for Screenbook configuration (runtime validation)
35
+ * @internal
32
36
  */
33
37
  const configSchema = zod.z.object({
34
38
  outDir: zod.z.string().default(".screenbook"),
package/dist/index.d.cts CHANGED
@@ -3,7 +3,116 @@ import { z } from "zod";
3
3
  //#region src/types.d.ts
4
4
 
5
5
  /**
6
- * Schema for screen metadata definition
6
+ * External link to related resources
7
+ */
8
+ interface ScreenLink {
9
+ /**
10
+ * Display label for the link
11
+ * @example "Figma Design"
12
+ * @example "Storybook"
13
+ */
14
+ label: string;
15
+ /**
16
+ * URL to the external resource
17
+ * @example "https://figma.com/file/..."
18
+ * @example "https://storybook.example.com/?path=/story/billing-invoice"
19
+ */
20
+ url: string;
21
+ }
22
+ /**
23
+ * Screen metadata definition for the screen catalog.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const screen: Screen = {
28
+ * id: "billing.invoice.detail",
29
+ * title: "Invoice Detail",
30
+ * route: "/billing/invoices/:id",
31
+ * owner: ["billing-team"],
32
+ * tags: ["billing", "invoice"],
33
+ * dependsOn: ["InvoiceAPI.getDetail"],
34
+ * next: ["billing.invoice.edit"],
35
+ * }
36
+ * ```
37
+ */
38
+ interface Screen {
39
+ /**
40
+ * Unique identifier for the screen using dot notation
41
+ * @example "billing.invoice.detail"
42
+ * @example "auth.login"
43
+ * @example "settings.profile"
44
+ */
45
+ id: string;
46
+ /**
47
+ * Human-readable title displayed in the screen catalog
48
+ * @example "Invoice Detail"
49
+ * @example "Login"
50
+ * @example "User Profile Settings"
51
+ */
52
+ title: string;
53
+ /**
54
+ * Route path pattern with optional dynamic segments
55
+ * @example "/billing/invoices/:id"
56
+ * @example "/auth/login"
57
+ * @example "/settings/profile"
58
+ */
59
+ route: string;
60
+ /**
61
+ * Team(s) or domain(s) that own this screen
62
+ * @example ["billing-team"]
63
+ * @example ["platform", "billing"]
64
+ */
65
+ owner?: string[];
66
+ /**
67
+ * Tags for categorization and filtering in the catalog
68
+ * @example ["billing", "invoice"]
69
+ * @example ["auth", "security"]
70
+ */
71
+ tags?: string[];
72
+ /**
73
+ * APIs or services this screen depends on for impact analysis
74
+ * @example ["InvoiceAPI.getDetail", "PaymentAPI.getStatus"]
75
+ * @example ["UserAPI.getProfile"]
76
+ */
77
+ dependsOn?: string[];
78
+ /**
79
+ * Screen IDs that can navigate to this screen (incoming edges)
80
+ * @example ["billing.invoice.list"]
81
+ * @example ["dashboard.home", "nav.sidebar"]
82
+ */
83
+ entryPoints?: string[];
84
+ /**
85
+ * Screen IDs this screen can navigate to (outgoing edges)
86
+ * @example ["billing.invoice.edit", "billing.payment.start"]
87
+ * @example ["billing.invoice.list"]
88
+ */
89
+ next?: string[];
90
+ /**
91
+ * Allow circular navigation involving this screen.
92
+ * When true, cycles that include this screen will not trigger warnings.
93
+ * @default false
94
+ * @example true
95
+ */
96
+ allowCycles?: boolean;
97
+ /**
98
+ * Optional description explaining the screen's purpose
99
+ * @example "Displays detailed invoice information including line items and payment status"
100
+ */
101
+ description?: string;
102
+ /**
103
+ * Links to external resources like Storybook, Figma, or documentation
104
+ * @example [{ label: "Figma", url: "https://figma.com/file/..." }]
105
+ */
106
+ links?: ScreenLink[];
107
+ }
108
+ /**
109
+ * Input type for defineScreen function.
110
+ * Same as Screen but used for input validation.
111
+ */
112
+ type ScreenInput = Screen;
113
+ /**
114
+ * Schema for screen metadata definition (runtime validation)
115
+ * @internal
7
116
  */
8
117
  declare const screenSchema: z.ZodObject<{
9
118
  id: z.ZodString;
@@ -14,6 +123,7 @@ declare const screenSchema: z.ZodObject<{
14
123
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
124
  entryPoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
125
  next: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ allowCycles: z.ZodOptional<z.ZodBoolean>;
17
127
  description: z.ZodOptional<z.ZodString>;
18
128
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
129
  label: z.ZodString;
@@ -21,15 +131,43 @@ declare const screenSchema: z.ZodObject<{
21
131
  }, z.core.$strip>>>;
22
132
  }, z.core.$strip>;
23
133
  /**
24
- * Type for screen metadata definition
25
- */
26
- type Screen = z.infer<typeof screenSchema>;
27
- /**
28
- * Input type for defineScreen function (allows partial optional fields)
134
+ * Progressive adoption configuration for gradual rollout.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const adoption: AdoptionConfig = {
139
+ * mode: "progressive",
140
+ * includePatterns: ["src/pages/billing/**"],
141
+ * minimumCoverage: 80,
142
+ * }
143
+ * ```
29
144
  */
30
- type ScreenInput = z.input<typeof screenSchema>;
145
+ interface AdoptionConfig {
146
+ /**
147
+ * Adoption mode for screen metadata coverage
148
+ * - `"full"`: All routes must have screen.meta.ts (default)
149
+ * - `"progressive"`: Only check coverage within includePatterns
150
+ * @default "full"
151
+ * @example "full"
152
+ * @example "progressive"
153
+ */
154
+ mode?: "full" | "progressive";
155
+ /**
156
+ * Glob patterns to include for coverage checking (progressive mode only)
157
+ * @example ["src/pages/billing/**"]
158
+ * @example ["src/pages/auth/**", "src/pages/settings/**"]
159
+ */
160
+ includePatterns?: string[];
161
+ /**
162
+ * Minimum coverage percentage required to pass lint (0-100)
163
+ * @example 80
164
+ * @example 100
165
+ */
166
+ minimumCoverage?: number;
167
+ }
31
168
  /**
32
- * Schema for progressive adoption configuration
169
+ * Schema for progressive adoption configuration (runtime validation)
170
+ * @internal
33
171
  */
34
172
  declare const adoptionSchema: z.ZodObject<{
35
173
  mode: z.ZodDefault<z.ZodEnum<{
@@ -40,11 +178,85 @@ declare const adoptionSchema: z.ZodObject<{
40
178
  minimumCoverage: z.ZodOptional<z.ZodNumber>;
41
179
  }, z.core.$strip>;
42
180
  /**
43
- * Type for progressive adoption configuration
181
+ * Screenbook configuration options.
182
+ */
183
+ interface Config {
184
+ /**
185
+ * Output directory for generated files
186
+ * @default ".screenbook"
187
+ * @example ".screenbook"
188
+ * @example "dist/screenbook"
189
+ */
190
+ outDir: string;
191
+ /**
192
+ * Glob pattern for screen metadata files.
193
+ * Supports colocation: place screen.meta.ts alongside your route files.
194
+ * @default "src/**\/screen.meta.ts"
195
+ * @example "src/**\/screen.meta.ts"
196
+ * @example "app/**\/screen.meta.ts"
197
+ */
198
+ metaPattern: string;
199
+ /**
200
+ * Glob pattern for route files (for generate/lint commands)
201
+ * @example "src/pages/**\/page.tsx"
202
+ * @example "app/**\/page.tsx"
203
+ * @example "src/routes/**\/*.tsx"
204
+ */
205
+ routesPattern?: string;
206
+ /**
207
+ * Patterns to ignore when scanning (glob patterns).
208
+ * Defaults to node_modules and .git directories.
209
+ */
210
+ ignore: string[];
211
+ /**
212
+ * Progressive adoption configuration for gradual rollout
213
+ * @example { mode: "progressive", includePatterns: ["src/pages/billing/**"], minimumCoverage: 80 }
214
+ */
215
+ adoption?: AdoptionConfig;
216
+ }
217
+ /**
218
+ * Input type for defineConfig function.
219
+ * All fields with defaults are optional in input.
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * defineConfig({
224
+ * metaPattern: "app/**\/screen.meta.ts",
225
+ * routesPattern: "app/**\/page.tsx",
226
+ * })
227
+ * ```
44
228
  */
45
- type AdoptionConfig = z.infer<typeof adoptionSchema>;
229
+ interface ConfigInput {
230
+ /**
231
+ * Output directory for generated files
232
+ * @default ".screenbook"
233
+ * @example ".screenbook"
234
+ */
235
+ outDir?: string;
236
+ /**
237
+ * Glob pattern for screen metadata files
238
+ * @default "src/**\/screen.meta.ts"
239
+ * @example "app/**\/screen.meta.ts"
240
+ */
241
+ metaPattern?: string;
242
+ /**
243
+ * Glob pattern for route files (for generate/lint commands)
244
+ * @example "src/pages/**\/page.tsx"
245
+ */
246
+ routesPattern?: string;
247
+ /**
248
+ * Patterns to ignore when scanning.
249
+ * Defaults to node_modules and .git directories.
250
+ */
251
+ ignore?: string[];
252
+ /**
253
+ * Progressive adoption configuration
254
+ */
255
+ adoption?: AdoptionConfig;
256
+ }
46
257
  /**
47
- * Schema for Screenbook configuration
258
+ * Schema for Screenbook configuration (runtime validation)
259
+ * @internal
48
260
  */
49
261
  declare const configSchema: z.ZodObject<{
50
262
  outDir: z.ZodDefault<z.ZodString>;
@@ -60,14 +272,6 @@ declare const configSchema: z.ZodObject<{
60
272
  minimumCoverage: z.ZodOptional<z.ZodNumber>;
61
273
  }, z.core.$strip>>;
62
274
  }, z.core.$strip>;
63
- /**
64
- * Type for Screenbook configuration
65
- */
66
- type Config = z.infer<typeof configSchema>;
67
- /**
68
- * Input type for defineConfig function
69
- */
70
- type ConfigInput = z.input<typeof configSchema>;
71
275
  //#endregion
72
276
  //#region src/defineScreen.d.ts
73
277
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/defineScreen.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;cAAa,cAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;KA0Cb,MAAA,GAAS,CAAA,CAAE,aAAa;;;;KAKxB,WAAA,GAAc,CAAA,CAAE,aAAa;;;;cAK5B,gBAAc,CAAA,CAAA;EApDF,IAAA,cAAA,UAAA,CAAA;IAAA,IAAA,EAAA,MAAA;IA0Cb,WAAM,EAAA,aAAkB;EAKxB,CAAA,CAAA,CAAA;EAKC,eAAA,eAoBX,WAAA,YAAA,CAAA,CAAA;;;;;;KAKU,cAAA,GAAiB,CAAA,CAAE,aAAa;;;;AAzBjB,cA8Bd,YA9Bc,EA8BF,CAAA,CAAA,SA9BE,CAAA;EAyBf,MAAA,cAAc,YAAkB,CAAA;EAK/B,WAAA,cAyBX,YAAA,CAAA;;;;;;;;;;;;;;;KAKU,MAAA,GAAS,CAAA,CAAE,aAAa;;;;KAKxB,WAAA,GAAc,CAAA,CAAE,aAAa;;;;;AArHzC;;;;;;;;;;;;;;;iBCqBgB,YAAA,QAAoB,cAAc;;;;;;;;;;;;;ADrBzB,iBCqCT,YAAA,CDrCS,KAAA,CAAA,ECqCW,WDrCX,CAAA,ECqC8B,MDrC9B"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/defineScreen.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AA+BiB,UA/BA,UAAA,CA6GR;EAOG;AAMZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA3FiB,MAAA;;;;AA4HjB;AA8BA;;;;;;;;;EAA2B,KAAA,EAAA,MAAA;EAAA;AAS3B;AAmDA;AAqCA;;;;;;;;;;;;;;;;;;;;;EAAyB,SAAA,CAAA,EAAA,MAAA,EAAA;EAAA;;;;ACrQzB;EAgBgB,WAAA,CAAA,EAAA,MAAY,EAAA;;;;;;;;;;;;;;;;;;;;;;;UDwEnB;;;;;;KAOG,WAAA,GAAc;;;;;cAMb,cAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCR,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8BJ,gBAAc,CAAA,CAAA;;;;;;;;;;;UASV,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAoCL;;;;;;;;;;;;;;UAeK,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;aA8BL;;;;;;cAOC,cAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;AA1RzB;AA+BA;AAqFA;AAMA;;;;;;;;;;;;iBCrGgB,YAAA,QAAoB,cAAc;;;;;;;;;;;;;iBAgBlC,YAAA,SAAoB,cAAmB"}
package/dist/index.d.mts CHANGED
@@ -3,7 +3,116 @@ import { z } from "zod";
3
3
  //#region src/types.d.ts
4
4
 
5
5
  /**
6
- * Schema for screen metadata definition
6
+ * External link to related resources
7
+ */
8
+ interface ScreenLink {
9
+ /**
10
+ * Display label for the link
11
+ * @example "Figma Design"
12
+ * @example "Storybook"
13
+ */
14
+ label: string;
15
+ /**
16
+ * URL to the external resource
17
+ * @example "https://figma.com/file/..."
18
+ * @example "https://storybook.example.com/?path=/story/billing-invoice"
19
+ */
20
+ url: string;
21
+ }
22
+ /**
23
+ * Screen metadata definition for the screen catalog.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const screen: Screen = {
28
+ * id: "billing.invoice.detail",
29
+ * title: "Invoice Detail",
30
+ * route: "/billing/invoices/:id",
31
+ * owner: ["billing-team"],
32
+ * tags: ["billing", "invoice"],
33
+ * dependsOn: ["InvoiceAPI.getDetail"],
34
+ * next: ["billing.invoice.edit"],
35
+ * }
36
+ * ```
37
+ */
38
+ interface Screen {
39
+ /**
40
+ * Unique identifier for the screen using dot notation
41
+ * @example "billing.invoice.detail"
42
+ * @example "auth.login"
43
+ * @example "settings.profile"
44
+ */
45
+ id: string;
46
+ /**
47
+ * Human-readable title displayed in the screen catalog
48
+ * @example "Invoice Detail"
49
+ * @example "Login"
50
+ * @example "User Profile Settings"
51
+ */
52
+ title: string;
53
+ /**
54
+ * Route path pattern with optional dynamic segments
55
+ * @example "/billing/invoices/:id"
56
+ * @example "/auth/login"
57
+ * @example "/settings/profile"
58
+ */
59
+ route: string;
60
+ /**
61
+ * Team(s) or domain(s) that own this screen
62
+ * @example ["billing-team"]
63
+ * @example ["platform", "billing"]
64
+ */
65
+ owner?: string[];
66
+ /**
67
+ * Tags for categorization and filtering in the catalog
68
+ * @example ["billing", "invoice"]
69
+ * @example ["auth", "security"]
70
+ */
71
+ tags?: string[];
72
+ /**
73
+ * APIs or services this screen depends on for impact analysis
74
+ * @example ["InvoiceAPI.getDetail", "PaymentAPI.getStatus"]
75
+ * @example ["UserAPI.getProfile"]
76
+ */
77
+ dependsOn?: string[];
78
+ /**
79
+ * Screen IDs that can navigate to this screen (incoming edges)
80
+ * @example ["billing.invoice.list"]
81
+ * @example ["dashboard.home", "nav.sidebar"]
82
+ */
83
+ entryPoints?: string[];
84
+ /**
85
+ * Screen IDs this screen can navigate to (outgoing edges)
86
+ * @example ["billing.invoice.edit", "billing.payment.start"]
87
+ * @example ["billing.invoice.list"]
88
+ */
89
+ next?: string[];
90
+ /**
91
+ * Allow circular navigation involving this screen.
92
+ * When true, cycles that include this screen will not trigger warnings.
93
+ * @default false
94
+ * @example true
95
+ */
96
+ allowCycles?: boolean;
97
+ /**
98
+ * Optional description explaining the screen's purpose
99
+ * @example "Displays detailed invoice information including line items and payment status"
100
+ */
101
+ description?: string;
102
+ /**
103
+ * Links to external resources like Storybook, Figma, or documentation
104
+ * @example [{ label: "Figma", url: "https://figma.com/file/..." }]
105
+ */
106
+ links?: ScreenLink[];
107
+ }
108
+ /**
109
+ * Input type for defineScreen function.
110
+ * Same as Screen but used for input validation.
111
+ */
112
+ type ScreenInput = Screen;
113
+ /**
114
+ * Schema for screen metadata definition (runtime validation)
115
+ * @internal
7
116
  */
8
117
  declare const screenSchema: z.ZodObject<{
9
118
  id: z.ZodString;
@@ -14,6 +123,7 @@ declare const screenSchema: z.ZodObject<{
14
123
  dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
124
  entryPoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
125
  next: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ allowCycles: z.ZodOptional<z.ZodBoolean>;
17
127
  description: z.ZodOptional<z.ZodString>;
18
128
  links: z.ZodOptional<z.ZodArray<z.ZodObject<{
19
129
  label: z.ZodString;
@@ -21,15 +131,43 @@ declare const screenSchema: z.ZodObject<{
21
131
  }, z.core.$strip>>>;
22
132
  }, z.core.$strip>;
23
133
  /**
24
- * Type for screen metadata definition
25
- */
26
- type Screen = z.infer<typeof screenSchema>;
27
- /**
28
- * Input type for defineScreen function (allows partial optional fields)
134
+ * Progressive adoption configuration for gradual rollout.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const adoption: AdoptionConfig = {
139
+ * mode: "progressive",
140
+ * includePatterns: ["src/pages/billing/**"],
141
+ * minimumCoverage: 80,
142
+ * }
143
+ * ```
29
144
  */
30
- type ScreenInput = z.input<typeof screenSchema>;
145
+ interface AdoptionConfig {
146
+ /**
147
+ * Adoption mode for screen metadata coverage
148
+ * - `"full"`: All routes must have screen.meta.ts (default)
149
+ * - `"progressive"`: Only check coverage within includePatterns
150
+ * @default "full"
151
+ * @example "full"
152
+ * @example "progressive"
153
+ */
154
+ mode?: "full" | "progressive";
155
+ /**
156
+ * Glob patterns to include for coverage checking (progressive mode only)
157
+ * @example ["src/pages/billing/**"]
158
+ * @example ["src/pages/auth/**", "src/pages/settings/**"]
159
+ */
160
+ includePatterns?: string[];
161
+ /**
162
+ * Minimum coverage percentage required to pass lint (0-100)
163
+ * @example 80
164
+ * @example 100
165
+ */
166
+ minimumCoverage?: number;
167
+ }
31
168
  /**
32
- * Schema for progressive adoption configuration
169
+ * Schema for progressive adoption configuration (runtime validation)
170
+ * @internal
33
171
  */
34
172
  declare const adoptionSchema: z.ZodObject<{
35
173
  mode: z.ZodDefault<z.ZodEnum<{
@@ -40,11 +178,85 @@ declare const adoptionSchema: z.ZodObject<{
40
178
  minimumCoverage: z.ZodOptional<z.ZodNumber>;
41
179
  }, z.core.$strip>;
42
180
  /**
43
- * Type for progressive adoption configuration
181
+ * Screenbook configuration options.
182
+ */
183
+ interface Config {
184
+ /**
185
+ * Output directory for generated files
186
+ * @default ".screenbook"
187
+ * @example ".screenbook"
188
+ * @example "dist/screenbook"
189
+ */
190
+ outDir: string;
191
+ /**
192
+ * Glob pattern for screen metadata files.
193
+ * Supports colocation: place screen.meta.ts alongside your route files.
194
+ * @default "src/**\/screen.meta.ts"
195
+ * @example "src/**\/screen.meta.ts"
196
+ * @example "app/**\/screen.meta.ts"
197
+ */
198
+ metaPattern: string;
199
+ /**
200
+ * Glob pattern for route files (for generate/lint commands)
201
+ * @example "src/pages/**\/page.tsx"
202
+ * @example "app/**\/page.tsx"
203
+ * @example "src/routes/**\/*.tsx"
204
+ */
205
+ routesPattern?: string;
206
+ /**
207
+ * Patterns to ignore when scanning (glob patterns).
208
+ * Defaults to node_modules and .git directories.
209
+ */
210
+ ignore: string[];
211
+ /**
212
+ * Progressive adoption configuration for gradual rollout
213
+ * @example { mode: "progressive", includePatterns: ["src/pages/billing/**"], minimumCoverage: 80 }
214
+ */
215
+ adoption?: AdoptionConfig;
216
+ }
217
+ /**
218
+ * Input type for defineConfig function.
219
+ * All fields with defaults are optional in input.
220
+ *
221
+ * @example
222
+ * ```ts
223
+ * defineConfig({
224
+ * metaPattern: "app/**\/screen.meta.ts",
225
+ * routesPattern: "app/**\/page.tsx",
226
+ * })
227
+ * ```
44
228
  */
45
- type AdoptionConfig = z.infer<typeof adoptionSchema>;
229
+ interface ConfigInput {
230
+ /**
231
+ * Output directory for generated files
232
+ * @default ".screenbook"
233
+ * @example ".screenbook"
234
+ */
235
+ outDir?: string;
236
+ /**
237
+ * Glob pattern for screen metadata files
238
+ * @default "src/**\/screen.meta.ts"
239
+ * @example "app/**\/screen.meta.ts"
240
+ */
241
+ metaPattern?: string;
242
+ /**
243
+ * Glob pattern for route files (for generate/lint commands)
244
+ * @example "src/pages/**\/page.tsx"
245
+ */
246
+ routesPattern?: string;
247
+ /**
248
+ * Patterns to ignore when scanning.
249
+ * Defaults to node_modules and .git directories.
250
+ */
251
+ ignore?: string[];
252
+ /**
253
+ * Progressive adoption configuration
254
+ */
255
+ adoption?: AdoptionConfig;
256
+ }
46
257
  /**
47
- * Schema for Screenbook configuration
258
+ * Schema for Screenbook configuration (runtime validation)
259
+ * @internal
48
260
  */
49
261
  declare const configSchema: z.ZodObject<{
50
262
  outDir: z.ZodDefault<z.ZodString>;
@@ -60,14 +272,6 @@ declare const configSchema: z.ZodObject<{
60
272
  minimumCoverage: z.ZodOptional<z.ZodNumber>;
61
273
  }, z.core.$strip>>;
62
274
  }, z.core.$strip>;
63
- /**
64
- * Type for Screenbook configuration
65
- */
66
- type Config = z.infer<typeof configSchema>;
67
- /**
68
- * Input type for defineConfig function
69
- */
70
- type ConfigInput = z.input<typeof configSchema>;
71
275
  //#endregion
72
276
  //#region src/defineScreen.d.ts
73
277
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/defineScreen.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;cAAa,cAAY,CAAA,CAAA;;;;;;;;;;;;;;;;;;KA0Cb,MAAA,GAAS,CAAA,CAAE,aAAa;;;;KAKxB,WAAA,GAAc,CAAA,CAAE,aAAa;;;;cAK5B,gBAAc,CAAA,CAAA;EApDF,IAAA,cAAA,UAAA,CAAA;IAAA,IAAA,EAAA,MAAA;IA0Cb,WAAM,EAAA,aAAkB;EAKxB,CAAA,CAAA,CAAA;EAKC,eAAA,eAoBX,WAAA,YAAA,CAAA,CAAA;;;;;;KAKU,cAAA,GAAiB,CAAA,CAAE,aAAa;;;;AAzBjB,cA8Bd,YA9Bc,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CHANGED
@@ -2,7 +2,8 @@ import { z } from "zod";
2
2
 
3
3
  //#region src/types.ts
4
4
  /**
5
- * Schema for screen metadata definition
5
+ * Schema for screen metadata definition (runtime validation)
6
+ * @internal
6
7
  */
7
8
  const screenSchema = z.object({
8
9
  id: z.string().min(1),
@@ -13,6 +14,7 @@ const screenSchema = z.object({
13
14
  dependsOn: z.array(z.string()).optional(),
14
15
  entryPoints: z.array(z.string()).optional(),
15
16
  next: z.array(z.string()).optional(),
17
+ allowCycles: z.boolean().optional(),
16
18
  description: z.string().optional(),
17
19
  links: z.array(z.object({
18
20
  label: z.string(),
@@ -20,7 +22,8 @@ const screenSchema = z.object({
20
22
  })).optional()
21
23
  });
22
24
  /**
23
- * Schema for progressive adoption configuration
25
+ * Schema for progressive adoption configuration (runtime validation)
26
+ * @internal
24
27
  */
25
28
  const adoptionSchema = z.object({
26
29
  mode: z.enum(["full", "progressive"]).default("full"),
@@ -28,7 +31,8 @@ const adoptionSchema = z.object({
28
31
  minimumCoverage: z.number().min(0).max(100).optional()
29
32
  });
30
33
  /**
31
- * Schema for Screenbook configuration
34
+ * Schema for Screenbook configuration (runtime validation)
35
+ * @internal
32
36
  */
33
37
  const configSchema = z.object({
34
38
  outDir: z.string().default(".screenbook"),
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/types.ts","../src/defineScreen.ts"],"sourcesContent":["import { z } from \"zod\"\n\n/**\n * Schema for screen metadata definition\n */\nexport const screenSchema = z.object({\n\t/** Unique identifier for the screen (e.g., \"billing.invoice.detail\") */\n\tid: z.string().min(1),\n\n\t/** Human-readable title of the screen */\n\ttitle: z.string().min(1),\n\n\t/** Route path pattern (e.g., \"/billing/invoices/:id\") */\n\troute: z.string().min(1),\n\n\t/** Team(s) or domain(s) that own this screen */\n\towner: z.array(z.string()).optional(),\n\n\t/** Tags for categorization and filtering */\n\ttags: z.array(z.string()).optional(),\n\n\t/** APIs or services this screen depends on */\n\tdependsOn: z.array(z.string()).optional(),\n\n\t/** Screen IDs that can navigate to this screen */\n\tentryPoints: z.array(z.string()).optional(),\n\n\t/** Screen IDs this screen can navigate to */\n\tnext: z.array(z.string()).optional(),\n\n\t/** Optional description of the screen */\n\tdescription: z.string().optional(),\n\n\t/** Links to external resources (Storybook, Figma, etc.) */\n\tlinks: z\n\t\t.array(\n\t\t\tz.object({\n\t\t\t\tlabel: z.string(),\n\t\t\t\turl: z.string().url(),\n\t\t\t}),\n\t\t)\n\t\t.optional(),\n})\n\n/**\n * Type for screen metadata definition\n */\nexport type Screen = z.infer<typeof screenSchema>\n\n/**\n * Input type for defineScreen function (allows partial optional fields)\n */\nexport type ScreenInput = z.input<typeof screenSchema>\n\n/**\n * Schema for progressive adoption configuration\n */\nexport const adoptionSchema = z.object({\n\t/**\n\t * Adoption mode\n\t * - \"full\": All routes must have screen.meta.ts (default)\n\t * - \"progressive\": Only check coverage within includePatterns\n\t */\n\tmode: z.enum([\"full\", \"progressive\"]).default(\"full\"),\n\n\t/**\n\t * Glob patterns to include for coverage checking (progressive mode only)\n\t * @example [\"src/pages/billing/**\"] - Only check billing module\n\t * @example [\"src/pages/auth/**\", \"src/pages/settings/**\"] - Check multiple modules\n\t */\n\tincludePatterns: z.array(z.string()).optional(),\n\n\t/**\n\t * Minimum coverage percentage required to pass lint\n\t * @example 80 - Fail if coverage is below 80%\n\t */\n\tminimumCoverage: z.number().min(0).max(100).optional(),\n})\n\n/**\n * Type for progressive adoption configuration\n */\nexport type AdoptionConfig = z.infer<typeof adoptionSchema>\n\n/**\n * Schema for Screenbook configuration\n */\nexport const configSchema = z.object({\n\t/** Output directory for generated files */\n\toutDir: z.string().default(\".screenbook\"),\n\n\t/**\n\t * Glob pattern for screen metadata files\n\t * Supports colocation: place screen.meta.ts alongside your route files\n\t * @example \"src/**\\/screen.meta.ts\" - scan entire src directory\n\t * @example \"app/**\\/screen.meta.ts\" - for Next.js App Router\n\t */\n\tmetaPattern: z.string().default(\"src/**/screen.meta.ts\"),\n\n\t/**\n\t * Glob pattern for route files (for generate/lint commands)\n\t * @example \"src/pages/**\\/page.tsx\" - Vite/React\n\t * @example \"app/**\\/page.tsx\" - Next.js App Router\n\t * @example \"src/routes/**\\/*.tsx\" - React Router\n\t */\n\troutesPattern: z.string().optional(),\n\n\t/** Patterns to ignore when scanning (glob patterns) */\n\tignore: z.array(z.string()).default([\"**/node_modules/**\", \"**/.git/**\"]),\n\n\t/** Progressive adoption configuration for gradual rollout */\n\tadoption: adoptionSchema.optional(),\n})\n\n/**\n * Type for Screenbook configuration\n */\nexport type Config = z.infer<typeof configSchema>\n\n/**\n * Input type for defineConfig function\n */\nexport type ConfigInput = z.input<typeof configSchema>\n","import {\n\ttype Config,\n\ttype ConfigInput,\n\tconfigSchema,\n\ttype Screen,\n\ttype ScreenInput,\n\tscreenSchema,\n} from \"./types.js\"\n\n/**\n * Define a screen with metadata for the screen catalog.\n *\n * @example\n * ```ts\n * export const screen = defineScreen({\n * id: \"billing.invoice.detail\",\n * title: \"Invoice Detail\",\n * route: \"/billing/invoices/:id\",\n * owner: [\"billing\"],\n * tags: [\"billing\", \"invoice\"],\n * dependsOn: [\"InvoiceAPI.getDetail\"],\n * entryPoints: [\"billing.invoice.list\"],\n * next: [\"billing.invoice.edit\"],\n * })\n * ```\n */\nexport function defineScreen(input: ScreenInput): Screen {\n\treturn screenSchema.parse(input)\n}\n\n/**\n * Define Screenbook configuration.\n *\n * @example\n * ```ts\n * export default defineConfig({\n * screensDir: \"src/screens\",\n * outDir: \".screenbook\",\n * metaPattern: \"**\\/screen.meta.ts\",\n * })\n * ```\n */\nexport function defineConfig(input: ConfigInput = {}): Config {\n\treturn configSchema.parse(input)\n}\n"],"mappings":";;;;;;AAKA,MAAa,eAAe,EAAE,OAAO;CAEpC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;CAGrB,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE;CAGxB,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE;CAGxB,OAAO,E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from \"zod\"\n\n/**\n * External link to related resources\n */\nexport interface ScreenLink {\n\t/**\n\t * Display label for the link\n\t * @example \"Figma Design\"\n\t * @example \"Storybook\"\n\t */\n\tlabel: string\n\t/**\n\t * URL to the external resource\n\t * @example \"https://figma.com/file/...\"\n\t * @example \"https://storybook.example.com/?path=/story/billing-invoice\"\n\t */\n\turl: string\n}\n\n/**\n * Screen metadata definition for the screen catalog.\n *\n * @example\n * ```ts\n * const screen: Screen = {\n * id: \"billing.invoice.detail\",\n * title: \"Invoice Detail\",\n * route: \"/billing/invoices/:id\",\n * owner: [\"billing-team\"],\n * tags: [\"billing\", \"invoice\"],\n * dependsOn: [\"InvoiceAPI.getDetail\"],\n * next: [\"billing.invoice.edit\"],\n * }\n * ```\n */\nexport interface Screen {\n\t/**\n\t * Unique identifier for the screen using dot notation\n\t * @example \"billing.invoice.detail\"\n\t * @example \"auth.login\"\n\t * @example \"settings.profile\"\n\t */\n\tid: string\n\n\t/**\n\t * Human-readable title displayed in the screen catalog\n\t * @example \"Invoice Detail\"\n\t * @example \"Login\"\n\t * @example \"User Profile Settings\"\n\t */\n\ttitle: string\n\n\t/**\n\t * Route path pattern with optional dynamic segments\n\t * @example \"/billing/invoices/:id\"\n\t * @example \"/auth/login\"\n\t * @example \"/settings/profile\"\n\t */\n\troute: string\n\n\t/**\n\t * Team(s) or domain(s) that own this screen\n\t * @example [\"billing-team\"]\n\t * @example [\"platform\", \"billing\"]\n\t */\n\towner?: string[]\n\n\t/**\n\t * Tags for categorization and filtering in the catalog\n\t * @example [\"billing\", \"invoice\"]\n\t * @example [\"auth\", \"security\"]\n\t */\n\ttags?: string[]\n\n\t/**\n\t * APIs or services this screen depends on for impact analysis\n\t * @example [\"InvoiceAPI.getDetail\", \"PaymentAPI.getStatus\"]\n\t * @example [\"UserAPI.getProfile\"]\n\t */\n\tdependsOn?: string[]\n\n\t/**\n\t * Screen IDs that can navigate to this screen (incoming edges)\n\t * @example [\"billing.invoice.list\"]\n\t * @example [\"dashboard.home\", \"nav.sidebar\"]\n\t */\n\tentryPoints?: string[]\n\n\t/**\n\t * Screen IDs this screen can navigate to (outgoing edges)\n\t * @example [\"billing.invoice.edit\", \"billing.payment.start\"]\n\t * @example [\"billing.invoice.list\"]\n\t */\n\tnext?: string[]\n\n\t/**\n\t * Allow circular navigation involving this screen.\n\t * When true, cycles that include this screen will not trigger warnings.\n\t * @default false\n\t * @example true\n\t */\n\tallowCycles?: boolean\n\n\t/**\n\t * Optional description explaining the screen's purpose\n\t * @example \"Displays detailed invoice information including line items and payment status\"\n\t */\n\tdescription?: string\n\n\t/**\n\t * Links to external resources like Storybook, Figma, or documentation\n\t * @example [{ label: \"Figma\", url: \"https://figma.com/file/...\" }]\n\t */\n\tlinks?: ScreenLink[]\n}\n\n/**\n * Input type for defineScreen function.\n * Same as Screen but used for input validation.\n */\nexport type ScreenInput = Screen\n\n/**\n * Schema for screen metadata definition (runtime validation)\n * @internal\n */\nexport const screenSchema = z.object({\n\tid: z.string().min(1),\n\ttitle: z.string().min(1),\n\troute: z.string().min(1),\n\towner: z.array(z.string()).optional(),\n\ttags: z.array(z.string()).optional(),\n\tdependsOn: z.array(z.string()).optional(),\n\tentryPoints: z.array(z.string()).optional(),\n\tnext: z.array(z.string()).optional(),\n\tallowCycles: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\tlinks: z\n\t\t.array(\n\t\t\tz.object({\n\t\t\t\tlabel: z.string(),\n\t\t\t\turl: z.string().url(),\n\t\t\t}),\n\t\t)\n\t\t.optional(),\n})\n\n/**\n * Progressive adoption configuration for gradual rollout.\n *\n * @example\n * ```ts\n * const adoption: AdoptionConfig = {\n * mode: \"progressive\",\n * includePatterns: [\"src/pages/billing/**\"],\n * minimumCoverage: 80,\n * }\n * ```\n */\nexport interface AdoptionConfig {\n\t/**\n\t * Adoption mode for screen metadata coverage\n\t * - `\"full\"`: All routes must have screen.meta.ts (default)\n\t * - `\"progressive\"`: Only check coverage within includePatterns\n\t * @default \"full\"\n\t * @example \"full\"\n\t * @example \"progressive\"\n\t */\n\tmode?: \"full\" | \"progressive\"\n\n\t/**\n\t * Glob patterns to include for coverage checking (progressive mode only)\n\t * @example [\"src/pages/billing/**\"]\n\t * @example [\"src/pages/auth/**\", \"src/pages/settings/**\"]\n\t */\n\tincludePatterns?: string[]\n\n\t/**\n\t * Minimum coverage percentage required to pass lint (0-100)\n\t * @example 80\n\t * @example 100\n\t */\n\tminimumCoverage?: number\n}\n\n/**\n * Schema for progressive adoption configuration (runtime validation)\n * @internal\n */\nexport const adoptionSchema = z.object({\n\tmode: z.enum([\"full\", \"progressive\"]).default(\"full\"),\n\tincludePatterns: z.array(z.string()).optional(),\n\tminimumCoverage: z.number().min(0).max(100).optional(),\n})\n\n/**\n * Screenbook configuration options.\n */\nexport interface Config {\n\t/**\n\t * Output directory for generated files\n\t * @default \".screenbook\"\n\t * @example \".screenbook\"\n\t * @example \"dist/screenbook\"\n\t */\n\toutDir: string\n\n\t/**\n\t * Glob pattern for screen metadata files.\n\t * Supports colocation: place screen.meta.ts alongside your route files.\n\t * @default \"src/**\\/screen.meta.ts\"\n\t * @example \"src/**\\/screen.meta.ts\"\n\t * @example \"app/**\\/screen.meta.ts\"\n\t */\n\tmetaPattern: string\n\n\t/**\n\t * Glob pattern for route files (for generate/lint commands)\n\t * @example \"src/pages/**\\/page.tsx\"\n\t * @example \"app/**\\/page.tsx\"\n\t * @example \"src/routes/**\\/*.tsx\"\n\t */\n\troutesPattern?: string\n\n\t/**\n\t * Patterns to ignore when scanning (glob patterns).\n\t * Defaults to node_modules and .git directories.\n\t */\n\tignore: string[]\n\n\t/**\n\t * Progressive adoption configuration for gradual rollout\n\t * @example { mode: \"progressive\", includePatterns: [\"src/pages/billing/**\"], minimumCoverage: 80 }\n\t */\n\tadoption?: AdoptionConfig\n}\n\n/**\n * Input type for defineConfig function.\n * All fields with defaults are optional in input.\n *\n * @example\n * ```ts\n * defineConfig({\n * metaPattern: \"app/**\\/screen.meta.ts\",\n * routesPattern: \"app/**\\/page.tsx\",\n * })\n * ```\n */\nexport interface ConfigInput {\n\t/**\n\t * Output directory for generated files\n\t * @default \".screenbook\"\n\t * @example \".screenbook\"\n\t */\n\toutDir?: string\n\n\t/**\n\t * Glob pattern for screen metadata files\n\t * @default \"src/**\\/screen.meta.ts\"\n\t * @example \"app/**\\/screen.meta.ts\"\n\t */\n\tmetaPattern?: string\n\n\t/**\n\t * Glob pattern for route files (for generate/lint commands)\n\t * @example \"src/pages/**\\/page.tsx\"\n\t */\n\troutesPattern?: string\n\n\t/**\n\t * Patterns to ignore when scanning.\n\t * Defaults to node_modules and .git directories.\n\t */\n\tignore?: string[]\n\n\t/**\n\t * Progressive adoption configuration\n\t */\n\tadoption?: AdoptionConfig\n}\n\n/**\n * Schema for Screenbook configuration (runtime validation)\n * @internal\n */\nexport const configSchema = z.object({\n\toutDir: z.string().default(\".screenbook\"),\n\tmetaPattern: z.string().default(\"src/**/screen.meta.ts\"),\n\troutesPattern: z.string().optional(),\n\tignore: z.array(z.string()).default([\"**/node_modules/**\", \"**/.git/**\"]),\n\tadoption: adoptionSchema.optional(),\n})\n","import {\n\ttype Config,\n\ttype ConfigInput,\n\tconfigSchema,\n\ttype Screen,\n\ttype ScreenInput,\n\tscreenSchema,\n} from \"./types.js\"\n\n/**\n * Define a screen with metadata for the screen catalog.\n *\n * @example\n * ```ts\n * export const screen = defineScreen({\n * id: \"billing.invoice.detail\",\n * title: \"Invoice Detail\",\n * route: \"/billing/invoices/:id\",\n * owner: [\"billing\"],\n * tags: [\"billing\", \"invoice\"],\n * dependsOn: [\"InvoiceAPI.getDetail\"],\n * entryPoints: [\"billing.invoice.list\"],\n * next: [\"billing.invoice.edit\"],\n * })\n * ```\n */\nexport function defineScreen(input: ScreenInput): Screen {\n\treturn screenSchema.parse(input)\n}\n\n/**\n * Define Screenbook configuration.\n *\n * @example\n * ```ts\n * export default defineConfig({\n * screensDir: \"src/screens\",\n * outDir: \".screenbook\",\n * metaPattern: \"**\\/screen.me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B,aAAa,CAAC;CACzE,UAAU,eAAe,UAAU;CACnC,CAAC;;;;;;;;;;;;;;;;;;;;;AC3QF,SAAgB,aAAa,OAA4B;AACxD,QAAO,aAAa,MAAM,MAAM;;;;;;;;;;;;;;AAejC,SAAgB,aAAa,QAAqB,EAAE,EAAU;AAC7D,QAAO,aAAa,MAAM,MAAM"}
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "name": "@screenbook/core",
3
- "version": "0.0.1",
4
- "description": "Core library for Screenbook - screen metadata definitions and validation",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/index.mjs",
9
- "require": "./dist/index.cjs",
10
- "types": "./dist/index.d.mts"
11
- }
12
- },
13
- "main": "./dist/index.cjs",
14
- "module": "./dist/index.mjs",
15
- "types": "./dist/index.d.mts",
16
- "files": [
17
- "dist"
18
- ],
19
- "dependencies": {
20
- "zod": "^4.0.0"
21
- },
22
- "devDependencies": {
23
- "tsdown": "^0.18.0"
24
- },
25
- "keywords": [
26
- "screenbook",
27
- "screen",
28
- "catalog",
29
- "navigation",
30
- "graph"
31
- ],
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "https://github.com/wadakatu/screenbook.git",
36
- "directory": "packages/core"
37
- },
38
- "homepage": "https://github.com/wadakatu/screenbook#readme",
39
- "bugs": {
40
- "url": "https://github.com/wadakatu/screenbook/issues"
41
- },
42
- "scripts": {
43
- "build": "tsdown",
44
- "dev": "tsdown --watch",
45
- "test": "vitest run",
46
- "test:watch": "vitest"
47
- }
48
- }
2
+ "name": "@screenbook/core",
3
+ "version": "0.1.0",
4
+ "description": "Core library for Screenbook - screen metadata definitions and validation",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.mjs",
9
+ "require": "./dist/index.cjs",
10
+ "types": "./dist/index.d.mts"
11
+ }
12
+ },
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.mjs",
15
+ "types": "./dist/index.d.mts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsdown",
21
+ "dev": "tsdown --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "dependencies": {
26
+ "zod": "^4.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "tsdown": "catalog:"
30
+ },
31
+ "keywords": [
32
+ "screenbook",
33
+ "screen",
34
+ "catalog",
35
+ "navigation",
36
+ "graph"
37
+ ],
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/wadakatu/screenbook.git",
42
+ "directory": "packages/core"
43
+ },
44
+ "homepage": "https://github.com/wadakatu/screenbook#readme",
45
+ "bugs": {
46
+ "url": "https://github.com/wadakatu/screenbook/issues"
47
+ }
48
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Screenbook Contributors
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.