@likec4/config 1.44.0 → 1.45.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.d.mts CHANGED
@@ -7,7 +7,7 @@ import * as z from 'zod';
7
7
  import { ElementColorValues, RelationshipColorValues, ThemeColorValues, ColorLiteral } from '@likec4/core/styles';
8
8
 
9
9
  declare const ManualLayoutsConfigSchema: z.ZodObject<{
10
- outDir: z.ZodString;
10
+ outDir: z.ZodDefault<z.ZodString>;
11
11
  }, z.core.$strip>;
12
12
  declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
13
13
  name: z.ZodString;
@@ -779,7 +779,7 @@ declare const LikeC4ProjectJsonConfigSchema: z.ZodObject<{
779
779
  }>>>;
780
780
  exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
781
781
  manualLayouts: z.ZodOptional<z.ZodObject<{
782
- outDir: z.ZodString;
782
+ outDir: z.ZodDefault<z.ZodString>;
783
783
  }, z.core.$strip>>;
784
784
  }, z.core.$strip>;
785
785
  type LikeC4ProjectJsonConfig = SimplifyDeep<z.input<typeof LikeC4ProjectJsonConfigSchema>>;
@@ -912,12 +912,6 @@ type LikeC4ProjectConfigInput = SimplifyDeep<z.input<typeof LikeC4ProjectJsonCon
912
912
  * Validates JSON string or JSON object into a LikeC4ProjectConfig object.
913
913
  */
914
914
  declare function validateProjectConfig<C extends string | Record<string, unknown>>(config: C): LikeC4ProjectConfig;
915
- /**
916
- * Converts a LikeC4ProjectConfig object into a LikeC4ProjectJsonConfig object.
917
- * Omit generators property (as it is not serializable)
918
- */
919
- declare function serializableLikeC4ProjectConfig({ generators: _, // omit
920
- ...config }: LikeC4ProjectConfig): LikeC4ProjectJsonConfig;
921
915
 
922
916
  declare const ThemeColorValuesSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<`#${string}` | `rgb(${number},${number},${number})` | `rgba(${number},${number},${number},${number})`, string>>, z.ZodObject<{
923
917
  elements: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<`#${string}` | `rgb(${number},${number},${number})` | `rgba(${number},${number},${number},${number})`, string>>, z.ZodPipe<z.ZodObject<{
@@ -2378,4 +2372,4 @@ declare function defineTheme<const S extends LikeC4ConfigThemeInput>(theme: S):
2378
2372
  */
2379
2373
  declare function defineStyle<const S extends LikeC4StylesConfigInput>(styles: S): LikeC4ProjectStylesConfig;
2380
2374
 
2381
- export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, ManualLayoutsConfigSchema, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, serializableLikeC4ProjectConfig, validateProjectConfig };
2375
+ export { ConfigFilenames, type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type LocateResult, ManualLayoutsConfigSchema, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, validateProjectConfig };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { C as ConfigFilenames, d as defineConfig, c as defineGenerators, e as defineStyle, f as defineTheme, g as defineThemeColor, i as isLikeC4Config, a as isLikeC4JsonConfig, b as isLikeC4NonJsonConfig, s as serializableLikeC4ProjectConfig, v as validateProjectConfig } from './shared/config.FegrYs1S.mjs';
1
+ export { C as ConfigFilenames, d as defineConfig, c as defineGenerators, e as defineStyle, f as defineTheme, g as defineThemeColor, i as isLikeC4Config, a as isLikeC4JsonConfig, b as isLikeC4NonJsonConfig, v as validateProjectConfig } from './shared/config.BF5VHDtl.mjs';
@@ -1,6 +1,6 @@
1
1
  import { URI } from 'vscode-uri';
2
2
  import { LikeC4ProjectConfig } from '../index.mjs';
3
- export { ConfigFilenames, GeneratorFn, GeneratorFnContext, GeneratorFnParams, LikeC4ProjectConfigInput, LikeC4ProjectJsonConfig, LikeC4StylesConfig, LikeC4StylesConfigInput, LocateResult, ManualLayoutsConfigSchema, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, serializableLikeC4ProjectConfig, validateProjectConfig } from '../index.mjs';
3
+ export { ConfigFilenames, GeneratorFn, GeneratorFnContext, GeneratorFnParams, LikeC4ProjectConfigInput, LikeC4ProjectJsonConfig, LikeC4StylesConfig, LikeC4StylesConfigInput, LocateResult, ManualLayoutsConfigSchema, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig, validateProjectConfig } from '../index.mjs';
4
4
  import '@likec4/core';
5
5
  import '@likec4/core/model';
6
6
  import '@likec4/core/types';
@@ -2,8 +2,8 @@ import { invariant } from '@likec4/core';
2
2
  import { bundleRequire } from 'bundle-require';
3
3
  import * as fs from 'node:fs/promises';
4
4
  import { dirname } from 'node:path';
5
- import { a as isLikeC4JsonConfig, v as validateProjectConfig, b as isLikeC4NonJsonConfig, d as defineConfig } from '../shared/config.FegrYs1S.mjs';
6
- export { C as ConfigFilenames, c as defineGenerators, e as defineStyle, f as defineTheme, g as defineThemeColor, i as isLikeC4Config, s as serializableLikeC4ProjectConfig } from '../shared/config.FegrYs1S.mjs';
5
+ import { a as isLikeC4JsonConfig, v as validateProjectConfig, b as isLikeC4NonJsonConfig, d as defineConfig } from '../shared/config.BF5VHDtl.mjs';
6
+ export { C as ConfigFilenames, c as defineGenerators, e as defineStyle, f as defineTheme, g as defineThemeColor, i as isLikeC4Config } from '../shared/config.BF5VHDtl.mjs';
7
7
  import { rootLogger } from '@likec4/log';
8
8
 
9
9
  const logger = rootLogger.getChild("config");
@@ -211,8 +211,13 @@ function normalizeDefaults(defaults) {
211
211
  }
212
212
 
213
213
  const ManualLayoutsConfigSchema = z.object({
214
- outDir: z.string().meta({
215
- description: "Path to the directory where manual layouts will be stored, relative to the folder containing the project config"
214
+ outDir: z.string().default(".likec4").meta({
215
+ description: [
216
+ "Path to the directory where manual layouts will be stored,",
217
+ "relative to the folder containing the project config. ",
218
+ "",
219
+ "Defaults to '.likec4'."
220
+ ].join("\n")
216
221
  })
217
222
  }).meta({
218
223
  id: "manual-layouts-config",
@@ -252,13 +257,6 @@ function validateProjectConfig(config) {
252
257
  }
253
258
  return parsed.data;
254
259
  }
255
- function serializableLikeC4ProjectConfig({
256
- generators: _,
257
- // omit
258
- ...config
259
- }) {
260
- return LikeC4ProjectJsonConfigSchema.parse(config);
261
- }
262
260
 
263
261
  const configJsonFilenames = [
264
262
  ".likec4rc",
@@ -311,4 +309,4 @@ function defineStyle(styles) {
311
309
  return LikeC4StylesConfigSchema.parse(styles);
312
310
  }
313
311
 
314
- export { ConfigFilenames as C, isLikeC4JsonConfig as a, isLikeC4NonJsonConfig as b, defineGenerators as c, defineConfig as d, defineStyle as e, defineTheme as f, defineThemeColor as g, isLikeC4Config as i, serializableLikeC4ProjectConfig as s, validateProjectConfig as v };
312
+ export { ConfigFilenames as C, isLikeC4JsonConfig as a, isLikeC4NonJsonConfig as b, defineGenerators as c, defineConfig as d, defineStyle as e, defineTheme as f, defineThemeColor as g, isLikeC4Config as i, validateProjectConfig as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/config",
3
- "version": "1.44.0",
3
+ "version": "1.45.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -64,8 +64,8 @@
64
64
  "peerDependencies": {
65
65
  "esbuild": "^0.25.11",
66
66
  "vscode-uri": "3.1.0",
67
- "@likec4/core": "1.44.0",
68
- "@likec4/log": "1.44.0"
67
+ "@likec4/core": "1.45.0",
68
+ "@likec4/log": "1.45.0"
69
69
  },
70
70
  "peerDependenciesMeta": {
71
71
  "vscode-uri": {
@@ -76,15 +76,15 @@
76
76
  "@types/node": "~20.19.22",
77
77
  "remeda": "^2.32.0",
78
78
  "tsx": "4.20.6",
79
- "turbo": "2.6.0",
79
+ "turbo": "2.6.1",
80
80
  "typescript": "5.9.3",
81
81
  "unbuild": "3.5.0",
82
82
  "nano-spawn": "^1.0.3",
83
- "vitest": "4.0.8",
84
- "@likec4/core": "1.44.0",
85
- "@likec4/devops": "1.42.0",
86
- "@likec4/log": "1.44.0",
87
- "@likec4/tsconfig": "1.44.0"
83
+ "vitest": "4.0.13",
84
+ "@likec4/log": "1.45.0",
85
+ "@likec4/core": "1.45.0",
86
+ "@likec4/tsconfig": "1.45.0",
87
+ "@likec4/devops": "1.42.0"
88
88
  },
89
89
  "scripts": {
90
90
  "typecheck": "tsc -b --verbose",
package/schema.json CHANGED
@@ -448,13 +448,11 @@
448
448
  "type": "object",
449
449
  "properties": {
450
450
  "outDir": {
451
- "description": "Path to the directory where manual layouts will be stored, relative to the folder containing the project config",
451
+ "description": "Path to the directory where manual layouts will be stored,\nrelative to the folder containing the project config. \n\nDefaults to '.likec4'.",
452
+ "default": ".likec4",
452
453
  "type": "string"
453
454
  }
454
- },
455
- "required": [
456
- "outDir"
457
- ]
455
+ }
458
456
  }
459
457
  }
460
458
  }
package/src/index.ts CHANGED
@@ -14,7 +14,7 @@ export type {
14
14
  LikeC4StylesConfigInput,
15
15
  } from './schema.theme'
16
16
 
17
- export { serializableLikeC4ProjectConfig, validateProjectConfig } from './schema'
17
+ export { validateProjectConfig } from './schema'
18
18
 
19
19
  export {
20
20
  ConfigFilenames,
package/src/schema.ts CHANGED
@@ -20,9 +20,14 @@ import { LikeC4StylesConfigSchema } from './schema.theme'
20
20
  export const ManualLayoutsConfigSchema = z
21
21
  .object({
22
22
  outDir: z.string()
23
+ .default('.likec4')
23
24
  .meta({
24
- description:
25
- 'Path to the directory where manual layouts will be stored, relative to the folder containing the project config',
25
+ description: [
26
+ 'Path to the directory where manual layouts will be stored,',
27
+ 'relative to the folder containing the project config. ',
28
+ '',
29
+ 'Defaults to \'.likec4\'.',
30
+ ].join('\n'),
26
31
  }),
27
32
  })
28
33
  .meta({
@@ -244,14 +249,3 @@ export function validateProjectConfig<C extends string | Record<string, unknown>
244
249
  }
245
250
  return parsed.data as unknown as LikeC4ProjectConfig
246
251
  }
247
-
248
- /**
249
- * Converts a LikeC4ProjectConfig object into a LikeC4ProjectJsonConfig object.
250
- * Omit generators property (as it is not serializable)
251
- */
252
- export function serializableLikeC4ProjectConfig({
253
- generators: _, // omit
254
- ...config
255
- }: LikeC4ProjectConfig): LikeC4ProjectJsonConfig {
256
- return LikeC4ProjectJsonConfigSchema.parse(config) as unknown as LikeC4ProjectJsonConfig
257
- }