@shivaedev/quality 0.58.0 → 0.60.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/CHANGELOG.md +28 -0
- package/README.md +13 -5
- package/dist/adapters/bodyReference.d.ts +9 -0
- package/dist/adapters/bodyReference.d.ts.map +1 -0
- package/dist/adapters/bodyReference.js +10 -0
- package/dist/adapters/bodyReference.js.map +1 -0
- package/dist/adapters/bodyReferences.d.ts +5 -0
- package/dist/adapters/bodyReferences.d.ts.map +1 -0
- package/dist/adapters/bodyReferences.js +129 -0
- package/dist/adapters/bodyReferences.js.map +1 -0
- package/dist/adapters/engineEscapes.d.ts +10 -0
- package/dist/adapters/engineEscapes.d.ts.map +1 -0
- package/dist/adapters/engineEscapes.js +103 -0
- package/dist/adapters/engineEscapes.js.map +1 -0
- package/dist/adapters/imports/projects.js +1 -1
- package/dist/adapters/imports/projects.js.map +1 -1
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +9 -1
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/run.js +1 -1
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/outcomeAssertions.d.ts +9 -0
- package/dist/adapters/outcomeAssertions.d.ts.map +1 -0
- package/dist/adapters/outcomeAssertions.js +94 -0
- package/dist/adapters/outcomeAssertions.js.map +1 -0
- package/dist/adapters/positiveRefusalFindings.d.ts +4 -0
- package/dist/adapters/positiveRefusalFindings.d.ts.map +1 -0
- package/dist/adapters/positiveRefusalFindings.js +41 -0
- package/dist/adapters/positiveRefusalFindings.js.map +1 -0
- package/dist/adapters/queueReadoutFindings.js +1 -1
- package/dist/adapters/queueReadoutFindings.js.map +1 -1
- package/dist/adapters/rpcBoundaryFindings.d.ts +4 -0
- package/dist/adapters/rpcBoundaryFindings.d.ts.map +1 -0
- package/dist/adapters/rpcBoundaryFindings.js +90 -0
- package/dist/adapters/rpcBoundaryFindings.js.map +1 -0
- package/dist/adapters/serviceAccess.d.ts +4 -0
- package/dist/adapters/serviceAccess.d.ts.map +1 -0
- package/dist/adapters/serviceAccess.js +33 -0
- package/dist/adapters/serviceAccess.js.map +1 -0
- package/dist/{rules/stories/program.d.ts → adapters/storyProgram.d.ts} +1 -1
- package/dist/adapters/storyProgram.d.ts.map +1 -0
- package/dist/{rules/stories/program.js → adapters/storyProgram.js} +14 -5
- package/dist/adapters/storyProgram.js.map +1 -0
- package/dist/adapters/tanstackRoutes.d.ts +11 -0
- package/dist/adapters/tanstackRoutes.d.ts.map +1 -0
- package/dist/adapters/tanstackRoutes.js +65 -0
- package/dist/adapters/tanstackRoutes.js.map +1 -0
- package/dist/adapters/vitePort.d.ts +2 -0
- package/dist/adapters/vitePort.d.ts.map +1 -0
- package/dist/adapters/vitePort.js +5 -0
- package/dist/adapters/vitePort.js.map +1 -0
- package/dist/appViteConfig.d.ts +4 -1
- package/dist/appViteConfig.d.ts.map +1 -1
- package/dist/appViteConfig.js +7 -3
- package/dist/appViteConfig.js.map +1 -1
- package/dist/inventory/routeFiles.d.ts +7 -0
- package/dist/inventory/routeFiles.d.ts.map +1 -0
- package/dist/inventory/routeFiles.js +62 -0
- package/dist/inventory/routeFiles.js.map +1 -0
- package/dist/inventory/shadcnAlias.js +1 -1
- package/dist/inventory/shadcnAlias.js.map +1 -1
- package/dist/rules/builtIn.d.ts +4 -4
- package/dist/rules/builtIn.d.ts.map +1 -1
- package/dist/rules/builtIn.js +4 -0
- package/dist/rules/builtIn.js.map +1 -1
- package/dist/rules/effect/rpcBoundary.d.ts +2 -0
- package/dist/rules/effect/rpcBoundary.d.ts.map +1 -0
- package/dist/rules/effect/rpcBoundary.js +9 -0
- package/dist/rules/effect/rpcBoundary.js.map +1 -0
- package/dist/rules/files/folderNames.d.ts +1 -1
- package/dist/rules/files/folderNames.d.ts.map +1 -1
- package/dist/rules/files/folderNames.js +6 -4
- package/dist/rules/files/folderNames.js.map +1 -1
- package/dist/rules/files/namedAfterExport.d.ts +1 -1
- package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
- package/dist/rules/files/namedAfterExport.js +5 -3
- package/dist/rules/files/namedAfterExport.js.map +1 -1
- package/dist/rules/manifestsExportsShape.d.ts.map +1 -1
- package/dist/rules/manifestsExportsShape.js +2 -1
- package/dist/rules/manifestsExportsShape.js.map +1 -1
- package/dist/rules/manifestsSourceFirst.d.ts.map +1 -1
- package/dist/rules/manifestsSourceFirst.js +4 -4
- package/dist/rules/manifestsSourceFirst.js.map +1 -1
- package/dist/rules/stories/adapterOnlyFakes.js +1 -1
- package/dist/rules/stories/adapterOnlyFakes.js.map +1 -1
- package/dist/rules/stories/engine.d.ts.map +1 -1
- package/dist/rules/stories/engine.js +24 -7
- package/dist/rules/stories/engine.js.map +1 -1
- package/dist/rules/stories/origins.d.ts.map +1 -1
- package/dist/rules/stories/origins.js +1 -1
- package/dist/rules/stories/origins.js.map +1 -1
- package/dist/rules/stories/positiveRefusals.d.ts +2 -0
- package/dist/rules/stories/positiveRefusals.d.ts.map +1 -0
- package/dist/rules/stories/positiveRefusals.js +17 -0
- package/dist/rules/stories/positiveRefusals.js.map +1 -0
- package/dist/rules/stories/usesInputs.d.ts.map +1 -1
- package/dist/rules/stories/usesInputs.js +3 -2
- package/dist/rules/stories/usesInputs.js.map +1 -1
- package/dist/testing/adapters/cli.js +1 -1
- package/dist/testing/adapters/cli.js.map +1 -1
- package/dist/testing/adapters/hookRepository.js +1 -1
- package/dist/testing/adapters/hookRepository.js.map +1 -1
- package/dist/testing/adapters/packageExports.d.ts +1 -1
- package/dist/testing/adapters/packageExports.d.ts.map +1 -1
- package/dist/testing/adapters/packageExports.js +6 -3
- package/dist/testing/adapters/packageExports.js.map +1 -1
- package/package.json +9 -9
- package/src/adapters/bodyReference.ts +19 -0
- package/src/adapters/bodyReferences.ts +134 -0
- package/src/adapters/engineEscapes.ts +120 -0
- package/src/adapters/imports/projects.ts +1 -1
- package/src/adapters/knip/configuration.ts +8 -1
- package/src/adapters/knip/run.ts +1 -1
- package/src/adapters/outcomeAssertions.ts +110 -0
- package/src/adapters/positiveRefusalFindings.ts +52 -0
- package/src/adapters/queueReadoutFindings.ts +1 -1
- package/src/adapters/rpcBoundaryFindings.ts +98 -0
- package/src/adapters/serviceAccess.ts +38 -0
- package/src/{rules/stories/program.ts → adapters/storyProgram.ts} +13 -4
- package/src/adapters/tanstackRoutes.ts +73 -0
- package/src/adapters/vitePort.ts +5 -0
- package/src/appViteConfig.ts +13 -3
- package/src/inventory/routeFiles.ts +78 -0
- package/src/inventory/shadcnAlias.ts +1 -1
- package/src/rules/builtIn.ts +4 -0
- package/src/rules/effect/rpcBoundary.ts +10 -0
- package/src/rules/files/folderNames.ts +7 -5
- package/src/rules/files/namedAfterExport.ts +5 -3
- package/src/rules/manifestsExportsShape.ts +2 -1
- package/src/rules/manifestsSourceFirst.ts +4 -5
- package/src/rules/stories/adapterOnlyFakes.ts +1 -1
- package/src/rules/stories/engine.ts +25 -9
- package/src/rules/stories/origins.ts +1 -1
- package/src/rules/stories/positiveRefusals.ts +17 -0
- package/src/rules/stories/usesInputs.ts +3 -2
- package/src/testing/adapters/cli.ts +1 -1
- package/src/testing/adapters/hookRepository.ts +1 -1
- package/src/testing/adapters/packageExports.ts +6 -3
- package/dist/rules/stories/program.d.ts.map +0 -1
- package/dist/rules/stories/program.js.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { type ImportBinding, importBindings } from "#rules/stories/importBindings.ts";
|
|
3
|
+
import { memberName, unwrapped } from "#rules/stories/syntax.ts";
|
|
4
|
+
|
|
5
|
+
export interface OutcomeAssertion {
|
|
6
|
+
readonly expected: ts.Expression;
|
|
7
|
+
readonly negative: boolean;
|
|
8
|
+
readonly node: ts.Node;
|
|
9
|
+
readonly subject: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function receiver(node: ts.Expression): ts.Expression | undefined {
|
|
13
|
+
const value = unwrapped(node);
|
|
14
|
+
return ts.isPropertyAccessExpression(value) || ts.isElementAccessExpression(value) ? unwrapped(value.expression) : undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function imported(node: ts.Expression, name: string, modules: readonly string[], bindings: ReadonlyMap<string, ImportBinding>): boolean {
|
|
18
|
+
const value = unwrapped(node);
|
|
19
|
+
if (!ts.isIdentifier(value)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
const binding = bindings.get(value.text);
|
|
23
|
+
return binding === undefined ? value.text === name : binding.imported === name && modules.includes(binding.module);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function subject(node: ts.Expression, checker: ts.TypeChecker): string | undefined {
|
|
27
|
+
const value = unwrapped(node);
|
|
28
|
+
if (ts.isYieldExpression(value)) {
|
|
29
|
+
return value.expression === undefined ? undefined : subject(value.expression, checker);
|
|
30
|
+
}
|
|
31
|
+
if (ts.isIdentifier(value)) {
|
|
32
|
+
const declaration = checker.getSymbolAtLocation(value)?.valueDeclaration;
|
|
33
|
+
if (declaration !== undefined && ts.isVariableDeclaration(declaration) && declaration.initializer !== undefined) {
|
|
34
|
+
return subject(declaration.initializer, checker);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const named = ts.isCallExpression(value) ? unwrapped(value.expression) : value;
|
|
38
|
+
const name = ts.isIdentifier(named) ? named.text : memberName(named);
|
|
39
|
+
return name !== undefined && /outcome$/iu.test(name) ? value.getText() : undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function assertion(node: ts.CallExpression, checker: ts.TypeChecker, bindings: ReadonlyMap<string, ImportBinding>): OutcomeAssertion | undefined {
|
|
43
|
+
const matcher = memberName(node.expression);
|
|
44
|
+
if (matcher === undefined || !["toBe", "toEqual", "toMatchObject"].includes(matcher)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let root = receiver(node.expression);
|
|
48
|
+
const negative = root !== undefined && memberName(root) === "not";
|
|
49
|
+
if (negative && root !== undefined) {
|
|
50
|
+
root = receiver(root);
|
|
51
|
+
}
|
|
52
|
+
if (root === undefined || !ts.isCallExpression(root)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const callee = memberName(root.expression) === "soft" ? receiver(root.expression) : root.expression;
|
|
56
|
+
const actual = root.arguments[0];
|
|
57
|
+
const expected = node.arguments[0];
|
|
58
|
+
const key = actual === undefined ? undefined : subject(actual, checker);
|
|
59
|
+
if (
|
|
60
|
+
callee !== undefined
|
|
61
|
+
&& imported(callee, "expect", ["vitest", "@effect/vitest"], bindings)
|
|
62
|
+
&& key !== undefined
|
|
63
|
+
&& expected !== undefined
|
|
64
|
+
&& (!negative || matcher !== "toMatchObject")
|
|
65
|
+
) {
|
|
66
|
+
return { expected, negative, node, subject: key };
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function grouped(node: ts.CallExpression, checker: ts.TypeChecker, bindings: ReadonlyMap<string, ImportBinding>): readonly OutcomeAssertion[] {
|
|
72
|
+
const rows = node.arguments[0];
|
|
73
|
+
if (
|
|
74
|
+
!imported(node.expression, "outcomes", ["@shivaedev/test-story/server/outcomes.ts"], bindings)
|
|
75
|
+
|| rows === undefined
|
|
76
|
+
|| !ts.isArrayLiteralExpression(rows)
|
|
77
|
+
) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const assertions: OutcomeAssertion[] = [];
|
|
81
|
+
for (const row of rows.elements) {
|
|
82
|
+
if (!ts.isArrayLiteralExpression(row)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const read = row.elements[1];
|
|
86
|
+
const expected = row.elements[2];
|
|
87
|
+
const key = read !== undefined && ts.isArrowFunction(read) && !ts.isBlock(read.body) ? subject(read.body, checker) : undefined;
|
|
88
|
+
if (key !== undefined && expected !== undefined) {
|
|
89
|
+
assertions.push({ expected, negative: false, node: row, subject: key });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return assertions;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function outcomeAssertions(body: ts.Node, checker: ts.TypeChecker): readonly OutcomeAssertion[] {
|
|
96
|
+
const bindings = importBindings(body.getSourceFile());
|
|
97
|
+
const assertions: OutcomeAssertion[] = [];
|
|
98
|
+
function visit(node: ts.Node): void {
|
|
99
|
+
if (ts.isFunctionLike(node) && node !== body) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (ts.isCallExpression(node)) {
|
|
103
|
+
const direct = assertion(node, checker, bindings);
|
|
104
|
+
assertions.push(...(direct === undefined ? [] : [direct]), ...grouped(node, checker, bindings));
|
|
105
|
+
}
|
|
106
|
+
ts.forEachChild(node, visit);
|
|
107
|
+
}
|
|
108
|
+
visit(body);
|
|
109
|
+
return assertions;
|
|
110
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import type { Finding, SourceFile } from "#rule.ts";
|
|
3
|
+
import type { storyOrigins } from "#rules/stories/origins.ts";
|
|
4
|
+
import { nodesWhere, unwrapped } from "#rules/stories/syntax.ts";
|
|
5
|
+
import { type OutcomeAssertion, outcomeAssertions } from "./outcomeAssertions.ts";
|
|
6
|
+
|
|
7
|
+
const MESSAGE =
|
|
8
|
+
"Only rules out an outcome. Assert the expected refusal's domain reason or public response positively on the same outcome in this story; an unrelated failure must fail the story too.";
|
|
9
|
+
|
|
10
|
+
function concrete(node: ts.Expression): boolean {
|
|
11
|
+
const value = unwrapped(node);
|
|
12
|
+
return (
|
|
13
|
+
(ts.isStringLiteralLike(value) && value.text.length > 0)
|
|
14
|
+
|| (ts.isObjectLiteralExpression(value)
|
|
15
|
+
&& value.properties.some((property) => ts.isPropertyAssignment(property) && concrete(property.initializer)))
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function sameExpected(left: ts.Expression, right: ts.Expression): boolean {
|
|
20
|
+
const a = unwrapped(left);
|
|
21
|
+
const b = unwrapped(right);
|
|
22
|
+
return ts.isStringLiteralLike(a) && ts.isStringLiteralLike(b) ? a.text === b.text : a.getText() === b.getText();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function confirmsRefusal(positive: OutcomeAssertion, negative: OutcomeAssertion): boolean {
|
|
26
|
+
return (
|
|
27
|
+
!positive.negative && positive.subject === negative.subject && concrete(positive.expected) && !sameExpected(positive.expected, negative.expected)
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function positiveRefusalFindings(file: SourceFile, origins: ReturnType<typeof storyOrigins>): readonly Finding[] {
|
|
32
|
+
const source = origins.source(file.path);
|
|
33
|
+
if (source === undefined) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
return nodesWhere(source, (node) => ts.isCallExpression(node) && origins.origin(node.expression) === "story")
|
|
37
|
+
.filter(ts.isCallExpression)
|
|
38
|
+
.flatMap((story) => {
|
|
39
|
+
const body = story.arguments[2];
|
|
40
|
+
if (body === undefined) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
const assertions = outcomeAssertions(body, origins.checker);
|
|
44
|
+
return assertions
|
|
45
|
+
.filter((negative) => negative.negative && !assertions.some((positive) => confirmsRefusal(positive, negative)))
|
|
46
|
+
.map(({ node }) => ({
|
|
47
|
+
file: file.path,
|
|
48
|
+
line: source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1,
|
|
49
|
+
message: MESSAGE,
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -5,10 +5,10 @@ import { importGraph } from "#imports/graph.ts";
|
|
|
5
5
|
import { packageOf } from "#imports/workspace.ts";
|
|
6
6
|
import { isTestCode } from "#naming/testName.ts";
|
|
7
7
|
import type { RuleInputs } from "#rule.ts";
|
|
8
|
-
import { storyProgram } from "#rules/stories/program.ts";
|
|
9
8
|
import { nodesWhere } from "#rules/stories/syntax.ts";
|
|
10
9
|
import { readPackageManifest } from "./manifestInventory.ts";
|
|
11
10
|
import { queueTestingOrigin } from "./queueTestingOrigin.ts";
|
|
11
|
+
import { storyProgram } from "./storyProgram.ts";
|
|
12
12
|
|
|
13
13
|
const MESSAGE =
|
|
14
14
|
"Reads jobs-testing queue storage. An enqueued job or its state does not prove the work ran. Assert the application's visible result instead; use jobs-testing only to control and settle workers.";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
import { importGraph } from "#imports/graph.ts";
|
|
5
|
+
import { isTestSupport } from "#naming/testName.ts";
|
|
6
|
+
import type { Finding, RuleInputs } from "#rule.ts";
|
|
7
|
+
import { effectProgram } from "#rules/effect/program.ts";
|
|
8
|
+
import { nodesWhere } from "#rules/stories/syntax.ts";
|
|
9
|
+
|
|
10
|
+
function boundaryName(declaration: ts.Declaration | undefined): string | undefined {
|
|
11
|
+
if (declaration === undefined || !ts.isFunctionDeclaration(declaration)) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const name = declaration.name?.text;
|
|
15
|
+
const path = declaration.getSourceFile().fileName.replaceAll("\\", "/");
|
|
16
|
+
return /\/(?:@shivaedev\/)?errors\/(?:src|dist)\/(?:boundary|rpcBoundaryHandlers)\.(?:d\.)?ts$/u.test(path)
|
|
17
|
+
&& (name === "rpcBoundary" || name === "rpcBoundaryHandlers")
|
|
18
|
+
? name
|
|
19
|
+
: undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function handlerBuilder(declaration: ts.Declaration | undefined): boolean {
|
|
23
|
+
if (declaration === undefined) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const path = declaration.getSourceFile().fileName.replaceAll("\\", "/");
|
|
27
|
+
return (
|
|
28
|
+
ts.isMethodSignature(declaration)
|
|
29
|
+
&& ["toLayer", "toLayerHandler", "toHandlers", "of"].includes(declaration.name.getText())
|
|
30
|
+
&& /\/effect\/(?:src|dist(?:\/dts)?)\/(?:unstable\/)?rpc\/RpcGroup\.(?:d\.)?ts$/u.test(path)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function checkSources(inputs: RuleInputs): readonly Finding[] {
|
|
35
|
+
const program = effectProgram(inputs);
|
|
36
|
+
const checker = program.getTypeChecker();
|
|
37
|
+
return inputs.sources.flatMap((file) => {
|
|
38
|
+
const source = program.getSourceFile(join(inputs.root, file.path));
|
|
39
|
+
if (source === undefined) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const calls = nodesWhere(source, ts.isCallExpression)
|
|
43
|
+
.filter(ts.isCallExpression)
|
|
44
|
+
.map((call) => ({ call, declaration: checker.getTypeAtLocation(call.expression).getCallSignatures()[0]?.getDeclaration() }));
|
|
45
|
+
if (
|
|
46
|
+
calls.some(({ declaration }) => handlerBuilder(declaration))
|
|
47
|
+
|| source.statements.some((statement) => ts.isFunctionDeclaration(statement) && boundaryName(statement) === "rpcBoundaryHandlers")
|
|
48
|
+
) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return calls.flatMap(({ call, declaration }): readonly Finding[] => {
|
|
52
|
+
const name = boundaryName(declaration);
|
|
53
|
+
return name === undefined
|
|
54
|
+
? []
|
|
55
|
+
: [
|
|
56
|
+
{
|
|
57
|
+
file: file.path,
|
|
58
|
+
line: source.getLineAndCharacterOfPosition(call.getStart(source)).line + 1,
|
|
59
|
+
message: `Uses ${name} outside a module that builds RPC handlers. Move the boundary into the module calling the RPC group's toLayer, toLayerHandler, toHandlers or of; services must keep their own typed failures.`,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const rpcBoundaryFindings = Effect.fn("RpcBoundary.rpcBoundaryFindings")(function* (inputs: RuleInputs) {
|
|
67
|
+
const candidates = new Set(inputs.sources.filter((source) => source.text.includes("rpcBoundary")).map((source) => source.path));
|
|
68
|
+
if (candidates.size === 0) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
const graph = yield* importGraph(inputs);
|
|
72
|
+
const importers = new Map<string, string[]>();
|
|
73
|
+
for (const edge of graph.edges) {
|
|
74
|
+
if (edge.to.kind === "file" && !edge.type) {
|
|
75
|
+
const paths = importers.get(edge.to.path) ?? [];
|
|
76
|
+
paths.push(edge.from);
|
|
77
|
+
importers.set(edge.to.path, paths);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const path of candidates) {
|
|
81
|
+
for (const importer of importers.get(path) ?? []) {
|
|
82
|
+
candidates.add(importer);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return yield* Effect.sync(() => {
|
|
86
|
+
const groups = new Map<string, RuleInputs["sources"][number][]>();
|
|
87
|
+
for (const source of inputs.sources) {
|
|
88
|
+
if (isTestSupport(source.path) || !/\.[cm]?[jt]sx?$/u.test(source.path) || !candidates.has(source.path)) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const group = /^(?:packages|examples)\/[^/]+/u.exec(source.path)?.[0] ?? ".";
|
|
92
|
+
const sources = groups.get(group) ?? [];
|
|
93
|
+
sources.push(source);
|
|
94
|
+
groups.set(group, sources);
|
|
95
|
+
}
|
|
96
|
+
return [...groups.values()].flatMap((sources) => checkSources({ ...inputs, sources }));
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import type { BodyReference } from "./bodyReference.ts";
|
|
4
|
+
|
|
5
|
+
function nativeService({ module, path }: BodyReference): boolean {
|
|
6
|
+
const name = path[0];
|
|
7
|
+
return name !== undefined && (module === "effect" || module.startsWith("effect/")) && (basename(module) === name || path[1] === name);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function member(value: BodyReference): boolean {
|
|
11
|
+
return value.kind === "service" ? value.path.length > 0 : nativeService(value) && value.path.length > (value.path[0] === value.path[1] ? 2 : 1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function outerExpression(node: ts.Node): ts.Node {
|
|
15
|
+
let use = node;
|
|
16
|
+
while (ts.isParenthesizedExpression(use.parent) || ts.isAsExpression(use.parent) || ts.isNonNullExpression(use.parent)) {
|
|
17
|
+
use = use.parent;
|
|
18
|
+
}
|
|
19
|
+
return use;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function readsService(called: BodyReference | undefined): boolean {
|
|
23
|
+
return called !== undefined && !called.path.at(-1)?.startsWith("provide") && ["effect", "effect/Effect", "effect/Context"].includes(called.module);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function serviceAccess(node: ts.Node, value: BodyReference, reference: (node: ts.Node) => BodyReference | undefined): boolean {
|
|
27
|
+
if (!(value.kind === "service" || (value.kind === "import" && nativeService(value)))) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (value.kind === "service" && value.path.at(-1) === "of") {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (member(value)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const use = outerExpression(node);
|
|
37
|
+
return ts.isYieldExpression(use.parent) || (ts.isCallExpression(use.parent) && readsService(reference(use.parent.expression)));
|
|
38
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import ts from "typescript";
|
|
3
|
+
import { projectsFor } from "#adapters/imports/projects.ts";
|
|
3
4
|
import type { ImportGraph } from "#imports/graph.ts";
|
|
4
5
|
import type { RuleInputs } from "#rule.ts";
|
|
5
6
|
|
|
@@ -17,18 +18,26 @@ export function storyProgram(inputs: RuleInputs, graph: ImportGraph): ts.Program
|
|
|
17
18
|
),
|
|
18
19
|
);
|
|
19
20
|
const options: ts.CompilerOptions = { allowJs: true, noLib: true, types: [] };
|
|
21
|
+
const projectOf = projectsFor(inputs.root);
|
|
20
22
|
const host: ts.CompilerHost = {
|
|
21
23
|
...ts.createCompilerHost(options),
|
|
22
|
-
fileExists: (path) => sources.has(path),
|
|
24
|
+
fileExists: (path) => sources.has(path) || ts.sys.fileExists(path),
|
|
23
25
|
getSourceFile: (path) => {
|
|
24
|
-
const text = sources.get(path);
|
|
26
|
+
const text = sources.get(path) ?? ts.sys.readFile(path);
|
|
25
27
|
return text === undefined ? undefined : ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
|
|
26
28
|
},
|
|
27
|
-
readFile: (path) => sources.get(path),
|
|
29
|
+
readFile: (path) => sources.get(path) ?? ts.sys.readFile(path),
|
|
28
30
|
resolveModuleNames: (names, from) =>
|
|
29
31
|
names.map((name) => {
|
|
30
32
|
const path = targets.get(`${from}:${name}`);
|
|
31
|
-
|
|
33
|
+
if (path !== undefined) {
|
|
34
|
+
return { extension: ts.Extension.Ts, resolvedFileName: path };
|
|
35
|
+
}
|
|
36
|
+
if (!(name.startsWith("@shivaedev/") || name.startsWith(".") || name.startsWith("#"))) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const project = projectOf(from);
|
|
40
|
+
return ts.resolveModuleName(name, from, project.typesOptions, host, project.typesCache).resolvedModule;
|
|
32
41
|
}),
|
|
33
42
|
};
|
|
34
43
|
const program = ts.createProgram([...sources.keys()], options, host);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
const RouterOptions = Schema.Struct({
|
|
5
|
+
routeFileIgnorePattern: Schema.optionalKey(Schema.String),
|
|
6
|
+
routeFileIgnorePrefix: Schema.optionalKey(Schema.String),
|
|
7
|
+
routeFilePrefix: Schema.optionalKey(Schema.String),
|
|
8
|
+
routesDirectory: Schema.optionalKey(Schema.NonEmptyString),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type RouterOptions = typeof RouterOptions.Type;
|
|
12
|
+
|
|
13
|
+
const OPTIONS = new Set(["routeFileIgnorePattern", "routeFileIgnorePrefix", "routeFilePrefix", "routesDirectory"]);
|
|
14
|
+
const PLUGINS = new Set(["tanstackRouter", "TanStackRouterVite"]);
|
|
15
|
+
const PACKAGES = new Set(["@tanstack/router-plugin/vite", "@tanstack/router-vite-plugin"]);
|
|
16
|
+
|
|
17
|
+
function pluginNames(source: ts.SourceFile): ReadonlySet<string> {
|
|
18
|
+
return new Set(
|
|
19
|
+
source.statements.flatMap((statement) => {
|
|
20
|
+
if (!(ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier) && PACKAGES.has(statement.moduleSpecifier.text))) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const clause = statement.importClause;
|
|
24
|
+
const bindings = clause?.namedBindings;
|
|
25
|
+
return [
|
|
26
|
+
...(clause?.name === undefined ? [] : [clause.name.text]),
|
|
27
|
+
...(bindings !== undefined && ts.isNamedImports(bindings)
|
|
28
|
+
? bindings.elements.filter((entry) => PLUGINS.has((entry.propertyName ?? entry.name).text)).map((entry) => entry.name.text)
|
|
29
|
+
: []),
|
|
30
|
+
];
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function literalOptions(node: ts.Expression | undefined): RouterOptions {
|
|
36
|
+
if (node === undefined) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
if (!ts.isObjectLiteralExpression(node)) {
|
|
40
|
+
throw new Error("Use literal TanStack Router options or move them to tsr.config.json so Quality can read the route folder.");
|
|
41
|
+
}
|
|
42
|
+
const entries = node.properties.flatMap((property): readonly (readonly [string, string])[] => {
|
|
43
|
+
if (ts.isSpreadAssignment(property)) {
|
|
44
|
+
throw new Error("Move spread TanStack Router options to tsr.config.json so Quality can read the route folder.");
|
|
45
|
+
}
|
|
46
|
+
const name = property.name;
|
|
47
|
+
if (name === undefined || !(ts.isIdentifier(name) || ts.isStringLiteral(name)) || !OPTIONS.has(name.text)) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
if (!(ts.isPropertyAssignment(property) && ts.isStringLiteralLike(property.initializer))) {
|
|
51
|
+
throw new Error(`TanStack Router ${name.text} must be a literal string for Quality to read it.`);
|
|
52
|
+
}
|
|
53
|
+
return [[name.text, property.initializer.text]];
|
|
54
|
+
});
|
|
55
|
+
return Schema.decodeUnknownSync(RouterOptions)(Object.fromEntries(entries));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function tanstackRoutes(path: string, text: string): readonly RouterOptions[] {
|
|
59
|
+
if (path.endsWith("tsr.config.json")) {
|
|
60
|
+
return [Schema.decodeUnknownSync(Schema.fromJsonString(RouterOptions))(text)];
|
|
61
|
+
}
|
|
62
|
+
const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
|
|
63
|
+
const names = pluginNames(source);
|
|
64
|
+
const options: RouterOptions[] = [];
|
|
65
|
+
function visit(node: ts.Node): void {
|
|
66
|
+
if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && names.has(node.expression.text)) {
|
|
67
|
+
options.push(literalOptions(node.arguments[0]));
|
|
68
|
+
}
|
|
69
|
+
ts.forEachChild(node, visit);
|
|
70
|
+
}
|
|
71
|
+
visit(source);
|
|
72
|
+
return options;
|
|
73
|
+
}
|
package/src/appViteConfig.ts
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { vitePort } from "#adapters/vitePort.ts";
|
|
2
|
+
|
|
3
|
+
export function appViteConfig<TPlugin>(
|
|
4
|
+
plugins: TPlugin[],
|
|
5
|
+
conditions: string[] = [],
|
|
6
|
+
proxyPaths: string[] = [],
|
|
7
|
+
{ webPort = vitePort("VITE_PORT", 5173), apiPort = vitePort("PORT", 3000) }: { webPort?: number; apiPort?: number } = {},
|
|
8
|
+
) {
|
|
2
9
|
return {
|
|
3
10
|
plugins,
|
|
4
11
|
resolve: { conditions, tsconfigPaths: true },
|
|
5
12
|
server: {
|
|
6
13
|
host: "127.0.0.1",
|
|
7
|
-
port:
|
|
14
|
+
port: webPort,
|
|
8
15
|
proxy: Object.fromEntries(
|
|
9
|
-
["/api/auth", "/rpc", ...proxyPaths].map((path) => [
|
|
16
|
+
["/api/auth", "/rpc", ...proxyPaths].map((path) => [
|
|
17
|
+
path,
|
|
18
|
+
{ changeOrigin: false, target: `http://127.0.0.1:${apiPort}`, ws: path === "/rpc" },
|
|
19
|
+
]),
|
|
10
20
|
),
|
|
11
21
|
strictPort: true,
|
|
12
22
|
},
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as NodePath from "@effect/platform-node/NodePath";
|
|
2
|
+
import { Effect, Path } from "effect";
|
|
3
|
+
import { type RouterOptions, tanstackRoutes } from "#adapters/tanstackRoutes.ts";
|
|
4
|
+
import { SetupFailure } from "#failure.ts";
|
|
5
|
+
import { readRequiredText } from "./filesystem.ts";
|
|
6
|
+
import { posix as portable } from "./ignoreScope.ts";
|
|
7
|
+
import { walk } from "./walk.ts";
|
|
8
|
+
|
|
9
|
+
const CONFIG = /^(?:tsr\.config\.json|vite\.config\.[cm]?[jt]s)$/u;
|
|
10
|
+
const CODE = /\.[jt]sx?$/u;
|
|
11
|
+
|
|
12
|
+
interface RouteFolder {
|
|
13
|
+
readonly directory: string;
|
|
14
|
+
readonly ignorePattern: RegExp | undefined;
|
|
15
|
+
readonly ignorePrefix: string;
|
|
16
|
+
readonly prefix: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function owns(file: string, folder: RouteFolder): boolean {
|
|
20
|
+
if (!(CODE.test(file) && file.startsWith(`${folder.directory}/`))) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const parts = file.slice(folder.directory.length + 1).split("/");
|
|
24
|
+
return parts.every(
|
|
25
|
+
(part) =>
|
|
26
|
+
!(part.startsWith(".") || (folder.ignorePrefix !== "" && part.startsWith(folder.ignorePrefix)) || folder.ignorePattern?.test(part))
|
|
27
|
+
&& (folder.prefix === undefined || part.startsWith(folder.prefix)),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const routeFiles = Effect.fn("Inventory.routeFiles")(function* (root: string) {
|
|
32
|
+
const { basename, dirname, relative, resolve } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
33
|
+
const paths = yield* walk(root);
|
|
34
|
+
const configs = paths
|
|
35
|
+
.filter((path) => CONFIG.test(basename(path)))
|
|
36
|
+
.sort((left, right) => Number(basename(right) === "tsr.config.json") - Number(basename(left) === "tsr.config.json"));
|
|
37
|
+
const byApp = new Map<string, RouterOptions>();
|
|
38
|
+
for (const path of configs) {
|
|
39
|
+
const text = yield* readRequiredText(path);
|
|
40
|
+
const options = yield* Effect.try({
|
|
41
|
+
catch: (cause) => new SetupFailure({ cause, message: `cannot read routes from ${path}: ${String(cause)}` }),
|
|
42
|
+
try: () => tanstackRoutes(path, text),
|
|
43
|
+
});
|
|
44
|
+
for (const option of options) {
|
|
45
|
+
const base = dirname(path);
|
|
46
|
+
byApp.set(base, { ...byApp.get(base), ...option });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const folders = yield* Effect.try({
|
|
50
|
+
catch: (cause) => new SetupFailure({ cause, message: `cannot resolve TanStack Router folders: ${String(cause)}` }),
|
|
51
|
+
try: () =>
|
|
52
|
+
[...byApp].map(
|
|
53
|
+
([base, options]): RouteFolder => ({
|
|
54
|
+
directory: portable(relative(root, resolve(base, options.routesDirectory ?? "src/routes"))),
|
|
55
|
+
ignorePattern:
|
|
56
|
+
options.routeFileIgnorePattern === undefined || options.routeFileIgnorePattern === ""
|
|
57
|
+
? undefined
|
|
58
|
+
: new RegExp(options.routeFileIgnorePattern, "u"),
|
|
59
|
+
ignorePrefix: options.routeFileIgnorePrefix ?? "-",
|
|
60
|
+
prefix: options.routeFilePrefix,
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
});
|
|
64
|
+
const files = new Set<string>();
|
|
65
|
+
const ownedFolders = new Set<string>();
|
|
66
|
+
for (const absolute of paths) {
|
|
67
|
+
const file = portable(relative(root, absolute));
|
|
68
|
+
const folder = folders.find((candidate) => owns(file, candidate));
|
|
69
|
+
if (folder === undefined) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
files.add(file);
|
|
73
|
+
for (let current = dirname(file); current.startsWith(`${folder.directory}/`) || current === folder.directory; current = dirname(current)) {
|
|
74
|
+
ownedFolders.add(current);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { files, folders: ownedFolders };
|
|
78
|
+
});
|
|
@@ -72,7 +72,7 @@ export function shadcnAlias(directory: string, alias: string): string {
|
|
|
72
72
|
join(directory, "components.tsx"),
|
|
73
73
|
{
|
|
74
74
|
...options,
|
|
75
|
-
customConditions: ["source", ...(options.customConditions ?? [])],
|
|
75
|
+
customConditions: ["@shivaedev/source", ...(options.customConditions ?? [])],
|
|
76
76
|
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
77
77
|
},
|
|
78
78
|
{
|
package/src/rules/builtIn.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { docsUnversionedInstalls } from "#rules/docs/unversionedInstalls.ts";
|
|
|
10
10
|
import { adapterImports } from "#rules/effect/adapterImports.ts";
|
|
11
11
|
import { effectBoundary } from "#rules/effect/boundary.ts";
|
|
12
12
|
import { failureHonesty } from "#rules/effect/failureHonesty.ts";
|
|
13
|
+
import { rpcBoundary } from "#rules/effect/rpcBoundary.ts";
|
|
13
14
|
import { serviceDefinitionAssembly } from "#rules/effect/serviceDefinitionAssembly.ts";
|
|
14
15
|
import { serviceIds } from "#rules/effect/serviceIds.ts";
|
|
15
16
|
import { serviceParameters } from "#rules/effect/serviceParameters.ts";
|
|
@@ -39,6 +40,7 @@ import { importedChangeKeys } from "#rules/stories/importedChangeKeys.ts";
|
|
|
39
40
|
import { namedValues } from "#rules/stories/namedValues.ts";
|
|
40
41
|
import { noExpect } from "#rules/stories/noExpect.ts";
|
|
41
42
|
import { noLimitImports } from "#rules/stories/noLimitImports.ts";
|
|
43
|
+
import { positiveRefusals } from "#rules/stories/positiveRefusals.ts";
|
|
42
44
|
import { queueReadouts } from "#rules/stories/queueReadouts.ts";
|
|
43
45
|
import { queueSql } from "#rules/stories/queueSql.ts";
|
|
44
46
|
import { storySetup } from "#rules/stories/setup.ts";
|
|
@@ -68,6 +70,7 @@ export const builtInRules = [
|
|
|
68
70
|
adapterImports,
|
|
69
71
|
effectBoundary,
|
|
70
72
|
failureHonesty,
|
|
73
|
+
rpcBoundary,
|
|
71
74
|
serviceDefinitionAssembly,
|
|
72
75
|
serviceIds,
|
|
73
76
|
serviceParameters,
|
|
@@ -126,6 +129,7 @@ export const builtInRules = [
|
|
|
126
129
|
namedValues,
|
|
127
130
|
noLimitImports,
|
|
128
131
|
domainOutcomes,
|
|
132
|
+
positiveRefusals,
|
|
129
133
|
groupedOutcomes,
|
|
130
134
|
waitOnEvents,
|
|
131
135
|
] as const;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { rpcBoundaryFindings } from "#adapters/rpcBoundaryFindings.ts";
|
|
2
|
+
import { defineRule } from "#rule.ts";
|
|
3
|
+
|
|
4
|
+
export const rpcBoundary = defineRule({
|
|
5
|
+
check: rpcBoundaryFindings,
|
|
6
|
+
description:
|
|
7
|
+
"Apply rpcBoundary and rpcBoundaryHandlers only in modules building native RPC handlers; services keep their typed failures. Test-support kits and the handler boundary implementation are accepted. No config exceptions or inline suppressions; baseline existing debt.",
|
|
8
|
+
id: "effect/rpc-boundary",
|
|
9
|
+
registrable: false,
|
|
10
|
+
});
|
|
@@ -2,6 +2,7 @@ import { posix } from "node:path";
|
|
|
2
2
|
import { Effect, Order, Schema } from "effect";
|
|
3
3
|
import { type IgnoreMatcher, ignorePatterns } from "#adapters/ignore.ts";
|
|
4
4
|
import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts";
|
|
5
|
+
import { routeFiles } from "#inventory/routeFiles.ts";
|
|
5
6
|
import { nativeNames } from "#naming/nativeNames.ts";
|
|
6
7
|
import { packageLayout } from "#naming/packageLayout.ts";
|
|
7
8
|
import { KEBAB, PASCAL } from "#naming/words.ts";
|
|
@@ -52,14 +53,14 @@ function groupMessage(name: string): string | undefined {
|
|
|
52
53
|
interface Context {
|
|
53
54
|
readonly content: IgnoreMatcher;
|
|
54
55
|
readonly names: ReadonlyMap<string, string>;
|
|
55
|
-
readonly
|
|
56
|
+
readonly owned: ReadonlySet<string>;
|
|
56
57
|
readonly stems: ReadonlySet<string>;
|
|
57
58
|
readonly toolOwned: IgnoreMatcher;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
function messageFor(folder: string, context: Context): string | undefined {
|
|
61
62
|
const name = posix.basename(folder);
|
|
62
|
-
if (context.
|
|
63
|
+
if (context.owned.has(folder) || context.toolOwned.ignores(`${folder}/`) || isModule(folder, context.stems)) {
|
|
63
64
|
return undefined;
|
|
64
65
|
}
|
|
65
66
|
const packageName = context.names.get(folder);
|
|
@@ -73,13 +74,14 @@ function messageFor(folder: string, context: Context): string | undefined {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
export const folderNames = defineRule({
|
|
76
|
-
check: ({ files, options, readText }) =>
|
|
77
|
+
check: ({ files, options, readText, root }) =>
|
|
77
78
|
Effect.gen(function* () {
|
|
78
79
|
const layout = yield* packageLayout({ files, readText });
|
|
80
|
+
const routes = yield* routeFiles(root);
|
|
79
81
|
const context: Context = {
|
|
80
82
|
content: ignorePatterns([...globPatterns(options.content)]),
|
|
81
83
|
names: layout.names,
|
|
82
|
-
|
|
84
|
+
owned: new Set([...nativeNames(files).folders, ...routes.folders]),
|
|
83
85
|
stems: stemsIn(files),
|
|
84
86
|
toolOwned: ignorePatterns([...globPatterns(options.toolOwned)]),
|
|
85
87
|
};
|
|
@@ -89,7 +91,7 @@ export const folderNames = defineRule({
|
|
|
89
91
|
});
|
|
90
92
|
}),
|
|
91
93
|
description:
|
|
92
|
-
"A package folder is named after its package, a module folder after its main file, a content folder in snake_case and every other folder in kebab-case.",
|
|
94
|
+
"A package folder is named after its package, a module folder after its main file, a content folder in snake_case and every other folder in kebab-case. TanStack Router configuration owns route folder names.",
|
|
93
95
|
id: "files/folder-names",
|
|
94
96
|
options: Schema.toStandardSchemaV1(FolderNamesOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
|
|
95
97
|
validate: validateGlobs,
|