@beignet/cli 0.0.12 → 0.0.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/CHANGELOG.md +26 -0
- package/README.md +24 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/inspect.js +174 -0
- package/dist/inspect.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +22 -3
- package/dist/lint.js.map +1 -1
- package/dist/make.d.ts +11 -0
- package/dist/make.d.ts.map +1 -1
- package/dist/make.js +1608 -0
- package/dist/make.js.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +14 -2
- package/dist/mcp.js.map +1 -1
- package/dist/templates/agents.d.ts +4 -3
- package/dist/templates/agents.d.ts.map +1 -1
- package/dist/templates/agents.js +4 -3
- package/dist/templates/agents.js.map +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +1 -0
- package/dist/templates/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +35 -0
- package/src/inspect.ts +361 -0
- package/src/lint.ts +28 -3
- package/src/make.ts +1823 -0
- package/src/mcp.ts +16 -2
- package/src/templates/agents.ts +4 -3
- package/src/templates/index.ts +1 -0
package/src/lint.ts
CHANGED
|
@@ -99,6 +99,19 @@ export async function lintApp(
|
|
|
99
99
|
|
|
100
100
|
if (sourceLayer === "test" || sourceLayer === "unknown") continue;
|
|
101
101
|
|
|
102
|
+
if (isLegacySharedDomainPath(file, config)) {
|
|
103
|
+
const canonicalSharedDomain = sharedDomainPath(config);
|
|
104
|
+
diagnostics.push({
|
|
105
|
+
severity: "error",
|
|
106
|
+
code: "BEIGNET_CANONICAL_STRUCTURE",
|
|
107
|
+
file,
|
|
108
|
+
importPath: canonicalSharedDomain,
|
|
109
|
+
line: 1,
|
|
110
|
+
column: 1,
|
|
111
|
+
message: `root shared-domain files are legacy. Move shared-kernel domain concepts to ${canonicalSharedDomain}.`,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
102
115
|
const lineStarts = computeLineStarts(source);
|
|
103
116
|
for (const reference of importGraph.get(file) ?? []) {
|
|
104
117
|
const diagnostic = lintImport(file, sourceLayer, reference, config);
|
|
@@ -1033,7 +1046,7 @@ function featureImportViolation(
|
|
|
1033
1046
|
|
|
1034
1047
|
return `feature-specific domain files must not import another feature's domain (${stripKnownExtension(
|
|
1035
1048
|
resolvedPath,
|
|
1036
|
-
)}). Move shared concepts to
|
|
1049
|
+
)}). Move shared-kernel domain concepts to ${sharedDomainPath(config)}.`;
|
|
1037
1050
|
}
|
|
1038
1051
|
|
|
1039
1052
|
const domainBannedPackages = new Set([
|
|
@@ -1163,7 +1176,7 @@ function classifyPath(
|
|
|
1163
1176
|
if (isUnder(normalizedPath, portsDir)) return "port";
|
|
1164
1177
|
if (isUnder(normalizedPath, "client")) return "client";
|
|
1165
1178
|
if (isUnder(normalizedPath, "components")) return "component";
|
|
1166
|
-
if (isUnder(normalizedPath,
|
|
1179
|
+
if (isUnder(normalizedPath, legacySharedDomainPath(config))) return "domain";
|
|
1167
1180
|
if (isUnder(normalizedPath, "lib")) return "lib";
|
|
1168
1181
|
|
|
1169
1182
|
const featurePath = featureRelativePath(normalizedPath, featuresPath);
|
|
@@ -1244,7 +1257,7 @@ function featureLayerInfo(
|
|
|
1244
1257
|
return { feature, layer };
|
|
1245
1258
|
}
|
|
1246
1259
|
|
|
1247
|
-
function
|
|
1260
|
+
function legacySharedDomainPath(config: ResolvedBeignetConfig): string {
|
|
1248
1261
|
const featuresDir = directoryPath(config.paths.features);
|
|
1249
1262
|
const featuresParent = directoryPath(path.dirname(featuresDir));
|
|
1250
1263
|
if (!featuresParent || featuresParent === ".") return "domain";
|
|
@@ -1252,6 +1265,18 @@ function sharedDomainPath(config: ResolvedBeignetConfig): string {
|
|
|
1252
1265
|
return path.join(featuresParent, "domain");
|
|
1253
1266
|
}
|
|
1254
1267
|
|
|
1268
|
+
function sharedDomainPath(config: ResolvedBeignetConfig): string {
|
|
1269
|
+
return path.join(directoryPath(config.paths.features), "shared/domain");
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
function isLegacySharedDomainPath(
|
|
1273
|
+
filePath: string,
|
|
1274
|
+
config: ResolvedBeignetConfig,
|
|
1275
|
+
): boolean {
|
|
1276
|
+
const normalizedPath = stripKnownExtension(normalizePath(filePath));
|
|
1277
|
+
return isUnder(normalizedPath, legacySharedDomainPath(config));
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1255
1280
|
function layerLabel(layer: SourceLayer): string {
|
|
1256
1281
|
return layer.replaceAll("-", " ");
|
|
1257
1282
|
}
|