laymos 0.0.4 → 0.0.6
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/architecture-analysis-schema/architecture-analysis-schema.d.ts +12 -12
- package/dist/architecture-analysis-schema/architecture-analysis-schema.d.ts.map +1 -1
- package/dist/architecture-analysis-schema/architecture-analysis-schema.js +2 -2
- package/dist/architecture-analysis-schema/index.d.ts +1 -1
- package/dist/architecture-analysis-schema/index.d.ts.map +1 -1
- package/dist/architecture-analysis-schema/index.js +1 -1
- package/dist/architecture-analysis-schema/project-config-schema.d.ts +42 -5
- package/dist/architecture-analysis-schema/project-config-schema.d.ts.map +1 -1
- package/dist/architecture-analysis-schema/project-config-schema.js +119 -70
- package/dist/domain/project-config/index.d.ts +1 -1
- package/dist/domain/project-config/index.d.ts.map +1 -1
- package/dist/domain/project-config/index.js +1 -1
- package/dist/domain/project-config/project-config.d.ts +2 -2
- package/dist/domain/project-config/project-config.d.ts.map +1 -1
- package/dist/domain/project-config/project-config.js +4 -4
- package/package.json +10 -10
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { LayerAnalysisSchema, type ForbiddenImport, type LayerAnalysis, type LayerDefinition } from './layer-analysis-schema.js';
|
|
3
3
|
import { ModuleAnalysisSchema, type AnalyzedModule, type AnalyzedModuleGraph, type ModuleAnalysis, type ModuleDefinition, type ModuleDependency, type ModuleGraphDefinition, type ModuleShape, type ModuleViolation, type ObservedModuleKind } from './module-analysis-schema.js';
|
|
4
|
-
import { ConfigValidationIssueSchema, ProjectConfigSchema, type Config, type ConfigValidationIssue, type ModuleConfig, type ModuleGraphConfig } from './project-config-schema.js';
|
|
4
|
+
import { ConfigValidationIssueSchema, ProjectConfigInputSchema, ProjectConfigSchema, type Config, type ConfigValidationIssue, type ModuleConfig, type ModuleGraphConfig } from './project-config-schema.js';
|
|
5
5
|
export declare const ArchitectureAnalysisSchema: Schema.Struct<{
|
|
6
6
|
readonly config: Schema.Struct<{
|
|
7
7
|
readonly $schema: Schema.optional<Schema.String>;
|
|
8
8
|
readonly sourceRoots: Schema.$Array<Schema.String>;
|
|
9
|
-
readonly ignoredPaths: Schema
|
|
9
|
+
readonly ignoredPaths: Schema.$Array<Schema.String>;
|
|
10
10
|
readonly storiesPath: Schema.optional<Schema.String>;
|
|
11
11
|
readonly layers: Schema.$Record<Schema.String, Schema.Struct<{
|
|
12
12
|
readonly paths: Schema.$Array<Schema.String>;
|
|
13
13
|
readonly description: Schema.optional<Schema.String>;
|
|
14
|
-
readonly modules: Schema
|
|
15
|
-
readonly shared: Schema.
|
|
16
|
-
readonly exposed: Schema.
|
|
17
|
-
}
|
|
18
|
-
readonly moduleGraphs: Schema
|
|
14
|
+
readonly modules: Schema.$Record<Schema.String, Schema.Struct<{
|
|
15
|
+
readonly shared: Schema.Boolean;
|
|
16
|
+
readonly exposed: Schema.Boolean;
|
|
17
|
+
}>>;
|
|
18
|
+
readonly moduleGraphs: Schema.$Record<Schema.String, Schema.Struct<{
|
|
19
19
|
readonly description: Schema.optional<Schema.String>;
|
|
20
20
|
readonly path: Schema.String;
|
|
21
21
|
readonly modules: Schema.$Record<Schema.String, Schema.Struct<{
|
|
22
|
-
readonly shared: Schema.
|
|
23
|
-
readonly exposed: Schema.
|
|
22
|
+
readonly shared: Schema.Boolean;
|
|
23
|
+
readonly exposed: Schema.Boolean;
|
|
24
24
|
}>>;
|
|
25
|
-
readonly rules: Schema
|
|
26
|
-
}
|
|
25
|
+
readonly rules: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
26
|
+
}>>;
|
|
27
27
|
}>>;
|
|
28
28
|
readonly layerGraphs: Schema.$Record<Schema.String, Schema.Struct<{
|
|
29
29
|
readonly description: Schema.optional<Schema.String>;
|
|
@@ -104,6 +104,6 @@ export declare const ArchitectureAnalysisSchema: Schema.Struct<{
|
|
|
104
104
|
}>;
|
|
105
105
|
}>;
|
|
106
106
|
export type ArchitectureAnalysis = typeof ArchitectureAnalysisSchema.Type;
|
|
107
|
-
export { ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigSchema, };
|
|
107
|
+
export { ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigInputSchema, ProjectConfigSchema, };
|
|
108
108
|
export type { AnalyzedModule, AnalyzedModuleGraph, Config, ConfigValidationIssue, ForbiddenImport, LayerAnalysis, LayerDefinition, ModuleAnalysis, ModuleConfig, ModuleDefinition, ModuleDependency, ModuleGraphConfig, ModuleGraphDefinition, ModuleShape, ModuleViolation, ObservedModuleKind, };
|
|
109
109
|
//# sourceMappingURL=architecture-analysis-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-analysis-schema.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/architecture-analysis-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAC;AAE1E,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,CAAC;AACF,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"architecture-analysis-schema.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/architecture-analysis-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAC;AAE1E,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,GACpB,CAAC;AACF,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { LayerAnalysisSchema, } from './layer-analysis-schema.js';
|
|
3
3
|
import { ModuleAnalysisSchema, } from './module-analysis-schema.js';
|
|
4
|
-
import { ConfigValidationIssueSchema, ProjectConfigSchema, } from './project-config-schema.js';
|
|
4
|
+
import { ConfigValidationIssueSchema, ProjectConfigInputSchema, ProjectConfigSchema, } from './project-config-schema.js';
|
|
5
5
|
export const ArchitectureAnalysisSchema = Schema.Struct({
|
|
6
6
|
config: ProjectConfigSchema,
|
|
7
7
|
layerAnalysis: LayerAnalysisSchema,
|
|
8
8
|
moduleAnalysis: ModuleAnalysisSchema,
|
|
9
9
|
});
|
|
10
|
-
export { ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigSchema, };
|
|
10
|
+
export { ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigInputSchema, ProjectConfigSchema, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Browser and RPC consumers use this canonical Architecture Analysis contract. */
|
|
2
|
-
export { ArchitectureAnalysisSchema, ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigSchema, } from './architecture-analysis-schema.js';
|
|
2
|
+
export { ArchitectureAnalysisSchema, ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigInputSchema, ProjectConfigSchema, } from './architecture-analysis-schema.js';
|
|
3
3
|
/** Renderers and analyzers share these browser-safe data shapes. */
|
|
4
4
|
export type { AnalyzedModule, AnalyzedModuleGraph, ArchitectureAnalysis, Config, ConfigValidationIssue, ForbiddenImport, LayerAnalysis, LayerDefinition, ModuleAnalysis, ModuleConfig, ModuleDefinition, ModuleDependency, ModuleGraphConfig, ModuleGraphDefinition, ModuleShape, ModuleViolation, ObservedModuleKind, } from './architecture-analysis-schema.js';
|
|
5
5
|
export { ModuleSourceFileSchema, ModuleSourceSnapshotSchema, } from './module-source-schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,oEAAoE;AACpE,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,oEAAoE;AACpE,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Browser and RPC consumers use this canonical Architecture Analysis contract. */
|
|
2
|
-
export { ArchitectureAnalysisSchema, ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigSchema, } from './architecture-analysis-schema.js';
|
|
2
|
+
export { ArchitectureAnalysisSchema, ConfigValidationIssueSchema, LayerAnalysisSchema, ModuleAnalysisSchema, ProjectConfigInputSchema, ProjectConfigSchema, } from './architecture-analysis-schema.js';
|
|
3
3
|
export { ModuleSourceFileSchema, ModuleSourceSnapshotSchema, } from './module-source-schema.js';
|
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
declare const ModuleSchema: Schema.Struct<{
|
|
3
|
-
readonly shared: Schema.
|
|
4
|
-
readonly exposed: Schema.
|
|
3
|
+
readonly shared: Schema.Boolean;
|
|
4
|
+
readonly exposed: Schema.Boolean;
|
|
5
5
|
}>;
|
|
6
6
|
declare const ModuleGraphSchema: Schema.Struct<{
|
|
7
7
|
readonly description: Schema.optional<Schema.String>;
|
|
8
8
|
readonly path: Schema.String;
|
|
9
9
|
readonly modules: Schema.$Record<Schema.String, Schema.Struct<{
|
|
10
|
-
readonly shared: Schema.
|
|
11
|
-
readonly exposed: Schema.
|
|
10
|
+
readonly shared: Schema.Boolean;
|
|
11
|
+
readonly exposed: Schema.Boolean;
|
|
12
12
|
}>>;
|
|
13
|
-
readonly rules: Schema
|
|
13
|
+
readonly rules: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
14
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The wire contract. Every key is required and no field carries decoding
|
|
17
|
+
* middleware, so an encoded Config round-trips byte-for-byte and stays
|
|
18
|
+
* decodable by a Schema runtime other than the one that built this module.
|
|
19
|
+
*/
|
|
15
20
|
export declare const ProjectConfigSchema: Schema.Struct<{
|
|
21
|
+
readonly $schema: Schema.optional<Schema.String>;
|
|
22
|
+
readonly sourceRoots: Schema.$Array<Schema.String>;
|
|
23
|
+
readonly ignoredPaths: Schema.$Array<Schema.String>;
|
|
24
|
+
readonly storiesPath: Schema.optional<Schema.String>;
|
|
25
|
+
readonly layers: Schema.$Record<Schema.String, Schema.Struct<{
|
|
26
|
+
readonly paths: Schema.$Array<Schema.String>;
|
|
27
|
+
readonly description: Schema.optional<Schema.String>;
|
|
28
|
+
readonly modules: Schema.$Record<Schema.String, Schema.Struct<{
|
|
29
|
+
readonly shared: Schema.Boolean;
|
|
30
|
+
readonly exposed: Schema.Boolean;
|
|
31
|
+
}>>;
|
|
32
|
+
readonly moduleGraphs: Schema.$Record<Schema.String, Schema.Struct<{
|
|
33
|
+
readonly description: Schema.optional<Schema.String>;
|
|
34
|
+
readonly path: Schema.String;
|
|
35
|
+
readonly modules: Schema.$Record<Schema.String, Schema.Struct<{
|
|
36
|
+
readonly shared: Schema.Boolean;
|
|
37
|
+
readonly exposed: Schema.Boolean;
|
|
38
|
+
}>>;
|
|
39
|
+
readonly rules: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
40
|
+
}>>;
|
|
41
|
+
}>>;
|
|
42
|
+
readonly layerGraphs: Schema.$Record<Schema.String, Schema.Struct<{
|
|
43
|
+
readonly description: Schema.optional<Schema.String>;
|
|
44
|
+
readonly rules: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
45
|
+
}>>;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* The authoring contract for laymos.config.json, where optional keys fall back
|
|
49
|
+
* to their documented defaults. Decodes to the same value as
|
|
50
|
+
* {@link ProjectConfigSchema}.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ProjectConfigInputSchema: Schema.Struct<{
|
|
16
53
|
readonly $schema: Schema.optional<Schema.String>;
|
|
17
54
|
readonly sourceRoots: Schema.$Array<Schema.String>;
|
|
18
55
|
readonly ignoredPaths: Schema.withDecodingDefaultKey<Schema.$Array<Schema.String>, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config-schema.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/project-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"project-config-schema.d.ts","sourceRoot":"","sources":["../../src/architecture-analysis-schema/project-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiBxC,QAAA,MAAM,YAAY;;;EAGY,CAAC;AAqC/B,QAAA,MAAM,iBAAiB;;;;;;;;EAOY,CAAC;AA2HpC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;EASK,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,CAAC;AAEtC,MAAM,MAAM,MAAM,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;AAE9D,eAAO,MAAM,2BAA2B;;;EAatC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,OAAO,2BAA2B,CAAC,IAAI,CAAC"}
|
|
@@ -1,59 +1,85 @@
|
|
|
1
1
|
import { Effect, Schema } from 'effect';
|
|
2
|
-
const
|
|
3
|
-
shared: Schema.Boolean.annotate({
|
|
4
|
-
description: 'Whether peers in the same Layer may import this Module. Illegal inside a Module Graph, where Rules govern peer access.',
|
|
5
|
-
}).pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
6
|
-
exposed: Schema.Boolean.annotate({
|
|
7
|
-
description: 'Whether other Layers may import this Module.',
|
|
8
|
-
}).pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
9
|
-
}).annotate({
|
|
2
|
+
const moduleAnnotations = {
|
|
10
3
|
title: 'Module',
|
|
11
4
|
description: 'A Configured Module keyed by its canonical source file or directory — project-relative when declared in a Layer, Module Graph-relative when declared in a Module Graph. Both flags default to false, so a Module is importable by nobody until it says otherwise.',
|
|
5
|
+
};
|
|
6
|
+
const SharedSchema = Schema.Boolean.annotate({
|
|
7
|
+
description: 'Whether peers in the same Layer may import this Module. Illegal inside a Module Graph, where Rules govern peer access.',
|
|
8
|
+
});
|
|
9
|
+
const ExposedSchema = Schema.Boolean.annotate({
|
|
10
|
+
description: 'Whether other Layers may import this Module.',
|
|
11
|
+
});
|
|
12
|
+
const ModuleSchema = Schema.Struct({
|
|
13
|
+
shared: SharedSchema,
|
|
14
|
+
exposed: ExposedSchema,
|
|
15
|
+
}).annotate(moduleAnnotations);
|
|
16
|
+
const ModuleInputSchema = Schema.Struct({
|
|
17
|
+
shared: SharedSchema.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
18
|
+
exposed: ExposedSchema.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
19
|
+
}).annotate(moduleAnnotations);
|
|
20
|
+
const moduleGraphAnnotations = {
|
|
21
|
+
title: 'Module Graph',
|
|
22
|
+
description: 'A named, bounded set of Modules inside one Layer describing one capability too large for a single Module. Unlike a LayerGraph it is a disjoint unit: its Rules are never unioned with another Graph’s, are not transitive, and are checked for cycles on their own.',
|
|
23
|
+
};
|
|
24
|
+
const graphDescriptionField = Schema.optional(Schema.String).annotate({
|
|
25
|
+
description: 'Human-readable summary of this Module Graph.',
|
|
26
|
+
});
|
|
27
|
+
const graphPathField = Schema.String.annotate({
|
|
28
|
+
description: 'Canonical project-relative directory rooting this Module Graph. Every member lives below it and every file below it must belong to a member.',
|
|
12
29
|
});
|
|
30
|
+
const graphModulesDescription = 'Every member of this Module Graph, keyed relative to its path. At least two members, at least one exposed, and no member may be Shared.';
|
|
31
|
+
const graphRulesDescription = 'Maps a member key to the member keys it may directly depend on. Rules are default-deny and, unlike LayerGraph Rules, are NOT transitive: only declared edges are permitted. They must be acyclic within this Module Graph.';
|
|
32
|
+
const GraphRulesSchema = Schema.Record(Schema.String, Schema.Array(Schema.String)).annotate({ description: graphRulesDescription });
|
|
13
33
|
const ModuleGraphSchema = Schema.Struct({
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
path: Schema.String.annotate({
|
|
18
|
-
description: 'Canonical project-relative directory rooting this Module Graph. Every member lives below it and every file below it must belong to a member.',
|
|
19
|
-
}),
|
|
34
|
+
description: graphDescriptionField,
|
|
35
|
+
path: graphPathField,
|
|
20
36
|
modules: Schema.Record(Schema.String, ModuleSchema)
|
|
21
|
-
.annotate({
|
|
22
|
-
description: 'Every member of this Module Graph, keyed relative to its path. At least two members, at least one exposed, and no member may be Shared.',
|
|
23
|
-
})
|
|
37
|
+
.annotate({ description: graphModulesDescription })
|
|
24
38
|
.pipe(Schema.check(Schema.isMinProperties(2))),
|
|
25
|
-
rules:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
rules: GraphRulesSchema,
|
|
40
|
+
}).annotate(moduleGraphAnnotations);
|
|
41
|
+
const ModuleGraphInputSchema = Schema.Struct({
|
|
42
|
+
description: graphDescriptionField,
|
|
43
|
+
path: graphPathField,
|
|
44
|
+
modules: Schema.Record(Schema.String, ModuleInputSchema)
|
|
45
|
+
.annotate({ description: graphModulesDescription })
|
|
46
|
+
.pipe(Schema.check(Schema.isMinProperties(2))),
|
|
47
|
+
rules: GraphRulesSchema.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
48
|
+
}).annotate(moduleGraphAnnotations);
|
|
49
|
+
const layerAnnotations = {
|
|
50
|
+
title: 'Layer',
|
|
51
|
+
description: 'A named, configured group of project-relative paths, owning the Modules and Module Graphs declared within it.',
|
|
52
|
+
};
|
|
53
|
+
const layerPathsField = Schema.Array(Schema.String)
|
|
54
|
+
.annotate({
|
|
55
|
+
description: 'Canonical project-relative paths belonging to this Layer. No declared Layer scopes may overlap, within one Layer or across Layers.',
|
|
56
|
+
})
|
|
57
|
+
.pipe(Schema.check(Schema.isMinLength(1)));
|
|
58
|
+
const layerDescriptionField = Schema.optional(Schema.String).annotate({
|
|
59
|
+
description: 'Human-readable summary of this Layer.',
|
|
33
60
|
});
|
|
61
|
+
const layerModulesDescription = 'Every free-form Configured Module in this Layer, keyed by canonical project-relative source file or directory.';
|
|
62
|
+
const layerModuleGraphsDescription = 'Every Module Graph in this Layer, keyed by id.';
|
|
34
63
|
const LayerSchema = Schema.Struct({
|
|
35
|
-
paths:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.pipe(Schema.check(Schema.isMinLength(1))),
|
|
40
|
-
description: Schema.optional(Schema.String).annotate({
|
|
41
|
-
description: 'Human-readable summary of this Layer.',
|
|
64
|
+
paths: layerPathsField,
|
|
65
|
+
description: layerDescriptionField,
|
|
66
|
+
modules: Schema.Record(Schema.String, ModuleSchema).annotate({
|
|
67
|
+
description: layerModulesDescription,
|
|
42
68
|
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
69
|
+
moduleGraphs: Schema.Record(Schema.String, ModuleGraphSchema).annotate({
|
|
70
|
+
description: layerModuleGraphsDescription,
|
|
71
|
+
}),
|
|
72
|
+
}).annotate(layerAnnotations);
|
|
73
|
+
const LayerInputSchema = Schema.Struct({
|
|
74
|
+
paths: layerPathsField,
|
|
75
|
+
description: layerDescriptionField,
|
|
76
|
+
modules: Schema.Record(Schema.String, ModuleInputSchema)
|
|
77
|
+
.annotate({ description: layerModulesDescription })
|
|
47
78
|
.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
48
|
-
moduleGraphs: Schema.Record(Schema.String,
|
|
49
|
-
.annotate({
|
|
50
|
-
description: 'Every Module Graph in this Layer, keyed by id.',
|
|
51
|
-
})
|
|
79
|
+
moduleGraphs: Schema.Record(Schema.String, ModuleGraphInputSchema)
|
|
80
|
+
.annotate({ description: layerModuleGraphsDescription })
|
|
52
81
|
.pipe(Schema.withDecodingDefaultKey(Effect.succeed({}))),
|
|
53
|
-
}).annotate(
|
|
54
|
-
title: 'Layer',
|
|
55
|
-
description: 'A named, configured group of project-relative paths, owning the Modules and Module Graphs declared within it.',
|
|
56
|
-
});
|
|
82
|
+
}).annotate(layerAnnotations);
|
|
57
83
|
const LayerGraphSchema = Schema.Struct({
|
|
58
84
|
description: Schema.optional(Schema.String).annotate({
|
|
59
85
|
description: 'Human-readable summary of this LayerGraph.',
|
|
@@ -65,35 +91,58 @@ const LayerGraphSchema = Schema.Struct({
|
|
|
65
91
|
title: 'LayerGraph',
|
|
66
92
|
description: 'A named set of Rules representing one responsibility (e.g. core architecture, test boundaries). This is an organizational grouping, not an enforcement boundary — enforcement unions every Rule declared across every LayerGraph in the project.',
|
|
67
93
|
});
|
|
68
|
-
|
|
69
|
-
$schema: Schema.optional(Schema.String).annotate({
|
|
70
|
-
description: 'JSON Schema URL, used by editors for autocomplete and validation.',
|
|
71
|
-
}),
|
|
72
|
-
sourceRoots: Schema.Array(Schema.String)
|
|
73
|
-
.annotate({
|
|
74
|
-
description: 'Canonical project-relative files or folders that define the complete static analysis universe.',
|
|
75
|
-
})
|
|
76
|
-
.pipe(Schema.check(Schema.isMinLength(1))),
|
|
77
|
-
ignoredPaths: Schema.Array(Schema.String)
|
|
78
|
-
.annotate({
|
|
79
|
-
description: 'Canonical project-relative files or folders explicitly excluded from the analysis universe.',
|
|
80
|
-
})
|
|
81
|
-
.pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
|
|
82
|
-
storiesPath: Schema.optional(Schema.String).annotate({
|
|
83
|
-
description: 'Canonical project-relative folder holding every Story file and the index.ts entry point exposing the Story Collection. Implicitly an Ignored path.',
|
|
84
|
-
}),
|
|
85
|
-
layers: Schema.Record(Schema.String, LayerSchema)
|
|
86
|
-
.annotate({
|
|
87
|
-
description: 'Every Layer in the project, keyed by id, each owning its Modules and Module Graphs.',
|
|
88
|
-
})
|
|
89
|
-
.pipe(Schema.check(Schema.isMinProperties(1))),
|
|
90
|
-
layerGraphs: Schema.Record(Schema.String, LayerGraphSchema).annotate({
|
|
91
|
-
description: 'Every LayerGraph in the project, keyed by id. An empty set denies every cross-Layer dependency.',
|
|
92
|
-
}),
|
|
93
|
-
}).annotate({
|
|
94
|
+
const projectConfigAnnotations = {
|
|
94
95
|
title: 'Laymos Config',
|
|
95
96
|
description: "Declares a project's Layers, their Modules and Module Graphs, and its LayerGraphs.",
|
|
97
|
+
};
|
|
98
|
+
const schemaField = Schema.optional(Schema.String).annotate({
|
|
99
|
+
description: 'JSON Schema URL, used by editors for autocomplete and validation.',
|
|
100
|
+
});
|
|
101
|
+
const sourceRootsField = Schema.Array(Schema.String)
|
|
102
|
+
.annotate({
|
|
103
|
+
description: 'Canonical project-relative files or folders that define the complete static analysis universe.',
|
|
104
|
+
})
|
|
105
|
+
.pipe(Schema.check(Schema.isMinLength(1)));
|
|
106
|
+
const IgnoredPathsSchema = Schema.Array(Schema.String).annotate({
|
|
107
|
+
description: 'Canonical project-relative files or folders explicitly excluded from the analysis universe.',
|
|
108
|
+
});
|
|
109
|
+
const storiesPathField = Schema.optional(Schema.String).annotate({
|
|
110
|
+
description: 'Canonical project-relative folder holding every Story file and the index.ts entry point exposing the Story Collection. Implicitly an Ignored path.',
|
|
111
|
+
});
|
|
112
|
+
const layersDescription = 'Every Layer in the project, keyed by id, each owning its Modules and Module Graphs.';
|
|
113
|
+
const layerGraphsField = Schema.Record(Schema.String, LayerGraphSchema).annotate({
|
|
114
|
+
description: 'Every LayerGraph in the project, keyed by id. An empty set denies every cross-Layer dependency.',
|
|
96
115
|
});
|
|
116
|
+
/**
|
|
117
|
+
* The wire contract. Every key is required and no field carries decoding
|
|
118
|
+
* middleware, so an encoded Config round-trips byte-for-byte and stays
|
|
119
|
+
* decodable by a Schema runtime other than the one that built this module.
|
|
120
|
+
*/
|
|
121
|
+
export const ProjectConfigSchema = Schema.Struct({
|
|
122
|
+
$schema: schemaField,
|
|
123
|
+
sourceRoots: sourceRootsField,
|
|
124
|
+
ignoredPaths: IgnoredPathsSchema,
|
|
125
|
+
storiesPath: storiesPathField,
|
|
126
|
+
layers: Schema.Record(Schema.String, LayerSchema)
|
|
127
|
+
.annotate({ description: layersDescription })
|
|
128
|
+
.pipe(Schema.check(Schema.isMinProperties(1))),
|
|
129
|
+
layerGraphs: layerGraphsField,
|
|
130
|
+
}).annotate(projectConfigAnnotations);
|
|
131
|
+
/**
|
|
132
|
+
* The authoring contract for laymos.config.json, where optional keys fall back
|
|
133
|
+
* to their documented defaults. Decodes to the same value as
|
|
134
|
+
* {@link ProjectConfigSchema}.
|
|
135
|
+
*/
|
|
136
|
+
export const ProjectConfigInputSchema = Schema.Struct({
|
|
137
|
+
$schema: schemaField,
|
|
138
|
+
sourceRoots: sourceRootsField,
|
|
139
|
+
ignoredPaths: IgnoredPathsSchema.pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
|
|
140
|
+
storiesPath: storiesPathField,
|
|
141
|
+
layers: Schema.Record(Schema.String, LayerInputSchema)
|
|
142
|
+
.annotate({ description: layersDescription })
|
|
143
|
+
.pipe(Schema.check(Schema.isMinProperties(1))),
|
|
144
|
+
layerGraphs: layerGraphsField,
|
|
145
|
+
}).annotate(projectConfigAnnotations);
|
|
97
146
|
export const ConfigValidationIssueSchema = Schema.Struct({
|
|
98
147
|
kind: Schema.Literals([
|
|
99
148
|
'path',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ProjectConfigSchema } from './project-config.js';
|
|
1
|
+
export { ProjectConfigInputSchema, ProjectConfigSchema, } from './project-config.js';
|
|
2
2
|
export type { Config } from './project-config.js';
|
|
3
3
|
export type { ConfigValidationIssue } from './project-config.js';
|
|
4
4
|
export { decodeProjectConfig } from './project-config.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/project-config/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/project-config/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Config readers use the canonical runtime contract for a Laymos Config.
|
|
2
|
-
export { ProjectConfigSchema } from './project-config.js';
|
|
2
|
+
export { ProjectConfigInputSchema, ProjectConfigSchema, } from './project-config.js';
|
|
3
3
|
// Config readers use this decoder so the domain schema remains authoritative.
|
|
4
4
|
export { decodeProjectConfig } from './project-config.js';
|
|
5
5
|
// Config readers use this to reject contradictory architecture declarations.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
-
import { ProjectConfigSchema, type Config, type ConfigValidationIssue } from '../../architecture-analysis-schema/index.js';
|
|
2
|
+
import { ProjectConfigInputSchema, ProjectConfigSchema, type Config, type ConfigValidationIssue } from '../../architecture-analysis-schema/index.js';
|
|
3
3
|
import { resolveConfig } from './resolve.js';
|
|
4
|
-
export { ProjectConfigSchema };
|
|
4
|
+
export { ProjectConfigInputSchema, ProjectConfigSchema };
|
|
5
5
|
export { resolveConfig };
|
|
6
6
|
export type { ResolvedConfig } from './resolve.js';
|
|
7
7
|
export type { Config, ConfigValidationIssue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../../src/domain/project-config/project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../../src/domain/project-config/project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,KAAK,MAAM,EACX,KAAK,qBAAqB,EAC3B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;AAE9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAEjD;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GACb,SAAS,qBAAqB,EAAE,CAElC;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GACtB,SAAS,qBAAqB,EAAE,CAoBlC;AAED,wBAAgB,uBAAuB,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAM3E"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
-
import { ProjectConfigSchema, } from '../../architecture-analysis-schema/index.js';
|
|
2
|
+
import { ProjectConfigInputSchema, ProjectConfigSchema, } from '../../architecture-analysis-schema/index.js';
|
|
3
3
|
import { resolveConfig } from './resolve.js';
|
|
4
4
|
import { validateProjectConfig } from './validation/index.js';
|
|
5
|
-
export { ProjectConfigSchema };
|
|
5
|
+
export { ProjectConfigInputSchema, ProjectConfigSchema };
|
|
6
6
|
export { resolveConfig };
|
|
7
7
|
export function decodeProjectConfig(input) {
|
|
8
|
-
return Schema.decodeUnknownEffect(
|
|
8
|
+
return Schema.decodeUnknownEffect(ProjectConfigInputSchema)(input);
|
|
9
9
|
}
|
|
10
10
|
export function validateConfig(config) {
|
|
11
11
|
return validateProjectConfig(config);
|
|
@@ -31,7 +31,7 @@ export function validateLoadedConfig(config, files) {
|
|
|
31
31
|
];
|
|
32
32
|
}
|
|
33
33
|
export function projectConfigJsonSchema() {
|
|
34
|
-
const standard = Schema.toStandardJSONSchemaV1(
|
|
34
|
+
const standard = Schema.toStandardJSONSchemaV1(ProjectConfigInputSchema);
|
|
35
35
|
return {
|
|
36
36
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
37
37
|
...standard['~standard'].jsonSchema.input({ target: 'draft-07' }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laymos",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Enforces architectural dependency rules and explores source dependencies.",
|
|
6
6
|
"repository": {
|
|
@@ -47,24 +47,24 @@
|
|
|
47
47
|
"LICENSE"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@effect/platform-node": "4.0.0-
|
|
51
|
-
"@effect/platform-node-shared": "4.0.0-
|
|
52
|
-
"oxc-parser": "0.
|
|
50
|
+
"@effect/platform-node": "4.0.0-rc.110",
|
|
51
|
+
"@effect/platform-node-shared": "4.0.0-rc.110",
|
|
52
|
+
"oxc-parser": "0.144.0",
|
|
53
53
|
"oxc-resolver": "11.24.2",
|
|
54
|
-
"tsx": "4.23.
|
|
54
|
+
"tsx": "4.23.12",
|
|
55
55
|
"yoctocolors": "2.2.0",
|
|
56
|
-
"@pkishorez/effect-tracer": "0.0.
|
|
56
|
+
"@pkishorez/effect-tracer": "0.0.6"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@types/node": "26.
|
|
59
|
+
"@types/node": "26.2.0",
|
|
60
60
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
61
|
-
"effect": "4.0.0-
|
|
62
|
-
"tsx": "4.23.
|
|
61
|
+
"effect": "4.0.0-rc.110",
|
|
62
|
+
"tsx": "4.23.12",
|
|
63
63
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
64
64
|
"vitest": "4.1.10"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"effect": "4.0.0-
|
|
67
|
+
"effect": "4.0.0-rc.110"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|