@shivaedev/quality 0.73.3 → 0.74.1
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 +16 -0
- package/README.md +9 -1
- package/dist/adapters/buildEntryPaths.d.ts +1 -1
- package/dist/adapters/buildEntryPaths.d.ts.map +1 -1
- package/dist/adapters/buildEntryPaths.js +9 -6
- package/dist/adapters/buildEntryPaths.js.map +1 -1
- package/dist/adapters/buildEntryValue.d.ts +1 -0
- package/dist/adapters/buildEntryValue.d.ts.map +1 -1
- package/dist/adapters/buildEntryValue.js +1 -1
- package/dist/adapters/buildEntryValue.js.map +1 -1
- package/dist/adapters/buildHelper.d.ts +1 -0
- package/dist/adapters/buildHelper.d.ts.map +1 -1
- package/dist/adapters/buildHelper.js +9 -8
- package/dist/adapters/buildHelper.js.map +1 -1
- package/dist/adapters/bundlerExternals.d.ts +4 -0
- package/dist/adapters/bundlerExternals.d.ts.map +1 -0
- package/dist/adapters/bundlerExternals.js +46 -0
- package/dist/adapters/bundlerExternals.js.map +1 -0
- package/dist/adapters/bundlerSources.d.ts +1 -0
- package/dist/adapters/bundlerSources.d.ts.map +1 -1
- package/dist/adapters/bundlerSources.js +17 -4
- package/dist/adapters/bundlerSources.js.map +1 -1
- package/dist/adapters/bundlerTargets.d.ts +8 -0
- package/dist/adapters/bundlerTargets.d.ts.map +1 -0
- package/dist/adapters/{bundlerEntries.js → bundlerTargets.js} +20 -17
- package/dist/adapters/bundlerTargets.js.map +1 -0
- package/dist/adapters/importedCall.d.ts +4 -0
- package/dist/adapters/importedCall.d.ts.map +1 -1
- package/dist/adapters/importedCall.js +6 -3
- package/dist/adapters/importedCall.js.map +1 -1
- package/dist/adapters/knip/configuration.d.ts +4 -1
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +36 -5
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +10 -5
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/reachableBuilds.d.ts +9 -0
- package/dist/adapters/reachableBuilds.d.ts.map +1 -0
- package/dist/adapters/{reachableBuildEntries.js → reachableBuilds.js} +15 -11
- package/dist/adapters/reachableBuilds.js.map +1 -0
- package/dist/adapters/spawnedEntries.d.ts.map +1 -1
- package/dist/adapters/spawnedEntries.js +4 -5
- package/dist/adapters/spawnedEntries.js.map +1 -1
- package/dist/config/decode.d.ts +1 -0
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +1 -0
- package/dist/config/decode.js.map +1 -1
- package/dist/config/load.d.ts +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +1 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/resolve.d.ts +1 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +1 -0
- package/dist/engine/session.js.map +1 -1
- package/dist/inventory/programmaticBuilds.d.ts +4 -0
- package/dist/inventory/programmaticBuilds.d.ts.map +1 -0
- package/dist/inventory/programmaticBuilds.js +13 -0
- package/dist/inventory/programmaticBuilds.js.map +1 -0
- package/dist/rule.d.ts +1 -0
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/files/namedAfterExport.js +2 -2
- package/dist/rules/files/namedAfterExport.js.map +1 -1
- package/dist/testing/ruleChecks.d.ts +16 -0
- package/dist/testing/ruleChecks.d.ts.map +1 -0
- package/dist/testing/ruleChecks.js +42 -0
- package/dist/testing/ruleChecks.js.map +1 -0
- package/dist/testing/ruleStory.d.ts +7 -11
- package/dist/testing/ruleStory.d.ts.map +1 -1
- package/dist/testing/ruleStory.js +3 -19
- package/dist/testing/ruleStory.js.map +1 -1
- package/package.json +3 -3
- package/src/adapters/buildEntryPaths.ts +10 -6
- package/src/adapters/buildEntryValue.ts +1 -1
- package/src/adapters/buildHelper.ts +10 -9
- package/src/adapters/bundlerExternals.ts +57 -0
- package/src/adapters/bundlerSources.ts +23 -4
- package/src/adapters/{bundlerEntries.ts → bundlerTargets.ts} +38 -18
- package/src/adapters/importedCall.ts +7 -3
- package/src/adapters/knip/configuration.ts +47 -5
- package/src/adapters/knip/run.ts +10 -5
- package/src/adapters/{reachableBuildEntries.ts → reachableBuilds.ts} +19 -10
- package/src/adapters/spawnedEntries.ts +4 -5
- package/src/config/decode.ts +1 -0
- package/src/config/load.ts +2 -0
- package/src/config.ts +1 -0
- package/src/engine/session.ts +1 -0
- package/src/inventory/{programmaticEntries.ts → programmaticBuilds.ts} +5 -3
- package/src/rule.ts +1 -0
- package/src/rules/files/namedAfterExport.ts +2 -2
- package/src/testing/ruleChecks.ts +57 -0
- package/src/testing/ruleStory.ts +4 -26
- package/dist/adapters/bundlerEntries.d.ts +0 -4
- package/dist/adapters/bundlerEntries.d.ts.map +0 -1
- package/dist/adapters/bundlerEntries.js.map +0 -1
- package/dist/adapters/reachableBuildEntries.d.ts +0 -5
- package/dist/adapters/reachableBuildEntries.d.ts.map +0 -1
- package/dist/adapters/reachableBuildEntries.js.map +0 -1
- package/dist/inventory/programmaticEntries.d.ts +0 -4
- package/dist/inventory/programmaticEntries.d.ts.map +0 -1
- package/dist/inventory/programmaticEntries.js +0 -11
- package/dist/inventory/programmaticEntries.js.map +0 -1
package/src/adapters/knip/run.ts
CHANGED
|
@@ -4,13 +4,13 @@ import process from "node:process";
|
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { Effect, FileSystem, Stream } from "effect";
|
|
6
6
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
7
|
-
import { knipConfiguration } from "#adapters/knip/configuration.ts";
|
|
7
|
+
import { declaredEntries, knipConfiguration } from "#adapters/knip/configuration.ts";
|
|
8
8
|
import { entryPointFindings } from "#adapters/knip/entryPointFindings.ts";
|
|
9
9
|
import { KNIP_ISSUES } from "#adapters/knip/findings.ts";
|
|
10
10
|
import { knipReport } from "#adapters/knip/report.ts";
|
|
11
11
|
import { sourceConfig } from "#adapters/knip/sourceConfig.ts";
|
|
12
12
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
13
|
-
import {
|
|
13
|
+
import { programmaticBuilds } from "#inventory/programmaticBuilds.ts";
|
|
14
14
|
import { toolOwnedFiles } from "#inventory/toolOwnedFiles.ts";
|
|
15
15
|
import type { RuleInputs } from "#rule.ts";
|
|
16
16
|
|
|
@@ -27,9 +27,14 @@ export const runKnip = Effect.fn("Knip.runKnip")(function* (inputs: RuleInputs)
|
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
29
29
|
const files = yield* toolOwnedFiles(inputs.root);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
30
|
+
const builds = yield* programmaticBuilds(inputs);
|
|
31
|
+
const declared = declaredEntries(inputs);
|
|
32
|
+
const configuration = yield* Effect.promise(() => knipConfiguration(inputs, files, builds, declared));
|
|
33
|
+
const checked = new Set([
|
|
34
|
+
...inputs.files,
|
|
35
|
+
...declared,
|
|
36
|
+
...Object.keys(configuration.workspaces).map((directory) => posix.join(directory, "package.json")),
|
|
37
|
+
]);
|
|
33
38
|
const findings = yield* Effect.scoped(
|
|
34
39
|
Effect.gen(function* () {
|
|
35
40
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { bundlerModules, bundlerSources } from "#adapters/bundlerSources.ts";
|
|
2
|
+
import { bundlerTargets } from "#adapters/bundlerTargets.ts";
|
|
3
3
|
import { spawnedEntries } from "#adapters/spawnedEntries.ts";
|
|
4
4
|
import type { ImportGraph } from "#imports/graph.ts";
|
|
5
5
|
import type { PackageLayout } from "#naming/packageLayout.ts";
|
|
@@ -39,22 +39,31 @@ function importsOf(graph: ImportGraph): ReadonlyMap<string, readonly string[]> {
|
|
|
39
39
|
return imports;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export
|
|
42
|
+
export interface ReachableBuilds {
|
|
43
|
+
readonly entries: ReadonlySet<string>;
|
|
44
|
+
readonly externals: ReadonlyMap<string, ReadonlySet<string>>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function reachableBuilds(inputs: RuleInputs, graph: ImportGraph, layout: PackageLayout): ReachableBuilds {
|
|
43
48
|
const imports = importsOf(graph);
|
|
44
49
|
const sources = new Map(inputs.sources.map((source) => [source.path, source]));
|
|
45
50
|
const syntax = bundlerSources(inputs.sources, graph);
|
|
51
|
+
const modules = bundlerModules(syntax, inputs.sources, graph);
|
|
46
52
|
const entries = new Set<string>();
|
|
53
|
+
const externals = new Map<string, ReadonlySet<string>>();
|
|
47
54
|
for (const [directory, scripts] of scriptsByPackage(layout)) {
|
|
48
|
-
|
|
55
|
+
const targets = [...reachable(scripts, imports)].flatMap((path) => {
|
|
49
56
|
const source = sources.get(path);
|
|
50
57
|
if (source === undefined) {
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
const bundled = syntax.has(path) ? bundlerEntries(source, inputs.root, directory, syntax) : [];
|
|
54
|
-
for (const entry of [...bundled, ...spawnedEntries(source, inputs.root, directory)].filter((target) => sources.has(target))) {
|
|
55
|
-
entries.add(entry);
|
|
58
|
+
return [];
|
|
56
59
|
}
|
|
60
|
+
const bundled = syntax.has(path) ? bundlerTargets(source, inputs.root, directory, syntax, modules) : { entries: [], externals: [] };
|
|
61
|
+
return [{ entries: [...bundled.entries, ...spawnedEntries(source, inputs.root, directory)], externals: bundled.externals }];
|
|
62
|
+
});
|
|
63
|
+
for (const entry of targets.flatMap((target) => target.entries).filter((target) => sources.has(target))) {
|
|
64
|
+
entries.add(entry);
|
|
57
65
|
}
|
|
66
|
+
externals.set(directory, new Set(targets.flatMap((target) => target.externals)));
|
|
58
67
|
}
|
|
59
|
-
return entries;
|
|
68
|
+
return { entries, externals };
|
|
60
69
|
}
|
|
@@ -8,15 +8,15 @@ import { parse } from "#rules/parse.ts";
|
|
|
8
8
|
|
|
9
9
|
const COMMANDS = new Set(["spawn", "spawnSync", "execFile", "execFileSync", "fork"]);
|
|
10
10
|
|
|
11
|
-
function entriesOf(call: ts.CallExpression, cwd: string,
|
|
11
|
+
function entriesOf(call: ts.CallExpression, cwd: string, root: string): readonly string[] {
|
|
12
12
|
const imported = importedCall(call);
|
|
13
13
|
if (imported === undefined || !/^(?:node:)?child_process$/u.test(imported.module) || !COMMANDS.has(imported.name)) {
|
|
14
14
|
return [];
|
|
15
15
|
}
|
|
16
16
|
const options = call.arguments[2] === undefined ? undefined : buildEntryValue(call.arguments[2]);
|
|
17
17
|
const working = options !== undefined && ts.isObjectLiteralExpression(options) ? buildOption(options, "cwd") : undefined;
|
|
18
|
-
const directories = working === undefined ? [cwd] : buildEntryPaths(working, cwd,
|
|
19
|
-
const targets = call.arguments.slice(0, 2).flatMap((argument) => buildEntryPaths(argument, cwd,
|
|
18
|
+
const directories = working === undefined ? [cwd] : buildEntryPaths(working, cwd, root);
|
|
19
|
+
const targets = call.arguments.slice(0, 2).flatMap((argument) => buildEntryPaths(argument, cwd, root));
|
|
20
20
|
return targets.flatMap((target) => directories.map((folder) => posix.resolve(cwd, folder, target)));
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -27,10 +27,9 @@ export function spawnedEntries(file: SourceFile, root: string, directory: string
|
|
|
27
27
|
}
|
|
28
28
|
const entries: string[] = [];
|
|
29
29
|
const cwd = posix.join(root, directory);
|
|
30
|
-
const path = posix.join(root, file.path);
|
|
31
30
|
function visit(node: ts.Node): void {
|
|
32
31
|
if (ts.isCallExpression(node)) {
|
|
33
|
-
entries.push(...entriesOf(node, cwd,
|
|
32
|
+
entries.push(...entriesOf(node, cwd, root).map((target) => posix.relative(root, target)));
|
|
34
33
|
}
|
|
35
34
|
ts.forEachChild(node, visit);
|
|
36
35
|
}
|
package/src/config/decode.ts
CHANGED
|
@@ -26,6 +26,7 @@ const LocalRule = Schema.declare(isRule, { expected: "a rule made with defineRul
|
|
|
26
26
|
|
|
27
27
|
const ConfigInput = Schema.Struct({
|
|
28
28
|
baseline: Schema.optionalKey(Schema.String),
|
|
29
|
+
entries: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
29
30
|
exceptions: Schema.optionalKey(Schema.Array(ExceptionDeclaration)),
|
|
30
31
|
extensions: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
31
32
|
local: Schema.optionalKey(Schema.Array(LocalRule)),
|
package/src/config/load.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { Declaration } from "#rules/suppressions/biome/declarations.ts";
|
|
|
14
14
|
export interface ResolvedConfig extends ResolvedRules, InventoryScope {
|
|
15
15
|
readonly baseline: string;
|
|
16
16
|
readonly biomeDeclarations: readonly Declaration[];
|
|
17
|
+
readonly entries: readonly string[];
|
|
17
18
|
readonly exceptions: readonly ExceptionDeclaration[];
|
|
18
19
|
readonly file: string;
|
|
19
20
|
readonly nonEffectFolders: readonly string[];
|
|
@@ -33,6 +34,7 @@ function resolved(root: string, file: string, config: ConfigInput, rules: Resolv
|
|
|
33
34
|
...rules,
|
|
34
35
|
baseline: config.baseline ?? "quality-baseline.jsonl",
|
|
35
36
|
biomeDeclarations: biomeDeclarations(config),
|
|
37
|
+
entries: config.entries ?? [],
|
|
36
38
|
exceptions: config.exceptions ?? [],
|
|
37
39
|
exclude: [],
|
|
38
40
|
extensions: config.extensions ?? DEFAULT_EXTENSIONS,
|
package/src/config.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type BuiltInRules = typeof builtInRules;
|
|
|
16
16
|
|
|
17
17
|
export interface QualityConfig<TLocal extends readonly RegisteredRule<unknown>[] = readonly RegisteredRule<unknown>[]> {
|
|
18
18
|
readonly baseline?: string;
|
|
19
|
+
readonly entries?: readonly string[];
|
|
19
20
|
readonly exceptions?: readonly ExceptionDeclaration[];
|
|
20
21
|
readonly extensions?: readonly string[];
|
|
21
22
|
readonly local?: TLocal;
|
package/src/engine/session.ts
CHANGED
|
@@ -38,6 +38,7 @@ export const scan = Effect.fn("Engine.scan")(function* (
|
|
|
38
38
|
setManifestFiles(readText, inventory.manifestFiles);
|
|
39
39
|
const inputs = {
|
|
40
40
|
configFile: relative(config.root, config.file),
|
|
41
|
+
entries: config.entries,
|
|
41
42
|
exceptions: config.exceptions,
|
|
42
43
|
files: inventory.files,
|
|
43
44
|
nonEffectFolders: config.nonEffectFolders,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { reachableBuilds } from "#adapters/reachableBuilds.ts";
|
|
3
3
|
import { importGraph } from "#imports/graph.ts";
|
|
4
4
|
import { packageLayout } from "#naming/packageLayout.ts";
|
|
5
5
|
import { isTestCode } from "#naming/testName.ts";
|
|
6
6
|
import type { RuleInputs } from "#rule.ts";
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const programmaticBuilds = Effect.fn("Inventory.programmaticBuilds")(function* (inputs: RuleInputs) {
|
|
9
9
|
const layout = yield* packageLayout(inputs);
|
|
10
10
|
const scripts = new Set([...layout.scripts, ...inputs.sources.filter((file) => isTestCode(file.path)).map((file) => file.path)]);
|
|
11
|
-
return scripts.size === 0
|
|
11
|
+
return scripts.size === 0
|
|
12
|
+
? { entries: new Set<string>(), externals: new Map<string, ReadonlySet<string>>() }
|
|
13
|
+
: reachableBuilds(inputs, yield* importGraph(inputs), { ...layout, scripts });
|
|
12
14
|
});
|
package/src/rule.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface SourceFile {
|
|
|
24
24
|
|
|
25
25
|
export interface RuleInputs {
|
|
26
26
|
readonly configFile?: string;
|
|
27
|
+
readonly entries?: readonly string[];
|
|
27
28
|
readonly exceptions?: readonly ExceptionDeclaration[];
|
|
28
29
|
readonly files: readonly string[];
|
|
29
30
|
readonly nonEffectFolders?: readonly string[];
|
|
@@ -5,7 +5,7 @@ import { isToolConfig } from "#adapters/isToolConfig.ts";
|
|
|
5
5
|
import { serviceAssemblyImports } from "#adapters/serviceAssemblyImports.ts";
|
|
6
6
|
import { directServiceDefinitions } from "#adapters/serviceAssemblySyntax.ts";
|
|
7
7
|
import { GlobDeclarations, globPatterns, validateGlobs } from "#config/globs.ts";
|
|
8
|
-
import {
|
|
8
|
+
import { programmaticBuilds } from "#inventory/programmaticBuilds.ts";
|
|
9
9
|
import { routeFiles } from "#inventory/routeFiles.ts";
|
|
10
10
|
import { knownDataExports } from "#naming/adapters/plainData.ts";
|
|
11
11
|
import { constantModule } from "#naming/constantModule.ts";
|
|
@@ -116,7 +116,7 @@ export const namedAfterExport = defineRule({
|
|
|
116
116
|
Effect.gen(function* () {
|
|
117
117
|
const { options, root, sources } = inputs;
|
|
118
118
|
const layout = yield* packageLayout(inputs);
|
|
119
|
-
const entries = yield*
|
|
119
|
+
const { entries } = yield* programmaticBuilds(inputs);
|
|
120
120
|
const routes = yield* routeFiles(root);
|
|
121
121
|
const toolOwned = ignorePatterns([...DEFAULT_TOOL_OWNED, ...globPatterns(options.toolOwned)]);
|
|
122
122
|
return sources
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Cause, Effect, Path } from "effect";
|
|
2
|
+
import { configureRegistered } from "#adapters/rule.ts";
|
|
3
|
+
import type { Findings, RegisteredRule, Rule, RuleInputs } from "#rule.ts";
|
|
4
|
+
import type { Run } from "#testing/adapters/cli.ts";
|
|
5
|
+
import { scanned } from "#testing/adapters/imports.ts";
|
|
6
|
+
|
|
7
|
+
export interface RuleEngine {
|
|
8
|
+
answer: Run | undefined;
|
|
9
|
+
failure: string | undefined;
|
|
10
|
+
findings: Findings | undefined;
|
|
11
|
+
readonly root: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function ruleChecks(engine: RuleEngine, tell: (line: string) => void) {
|
|
15
|
+
return {
|
|
16
|
+
check: Effect.fn("RuleStory.check")(function* <TInput>(
|
|
17
|
+
rule: Rule<string, TInput>,
|
|
18
|
+
options?: TInput,
|
|
19
|
+
directory = ".",
|
|
20
|
+
entries?: readonly string[],
|
|
21
|
+
) {
|
|
22
|
+
tell(options === undefined ? `quality checks ${rule.id}` : `quality checks ${rule.id} with ${JSON.stringify(options)}`);
|
|
23
|
+
const configured = yield* Effect.promise(() => rule.configure(options));
|
|
24
|
+
if (configured._tag === "Invalid") {
|
|
25
|
+
return yield* Effect.die(new Error(`${rule.id} refused its options: ${configured.issues.join("; ")}`));
|
|
26
|
+
}
|
|
27
|
+
const path = yield* Path.Path;
|
|
28
|
+
const scannedInputs = yield* Effect.promise(() => scanned(path.join(engine.root, directory)));
|
|
29
|
+
const inputs: RuleInputs = entries === undefined ? scannedInputs : { ...scannedInputs, entries };
|
|
30
|
+
engine.findings = yield* configured.check(inputs);
|
|
31
|
+
return engine.findings;
|
|
32
|
+
}),
|
|
33
|
+
checkOutcome: Effect.fn("RuleStory.checkOutcome")(function* <TInput>(rule: Rule<string, TInput>, entries: readonly string[]) {
|
|
34
|
+
tell(`quality checks ${rule.id} with declared entries`);
|
|
35
|
+
const configured = yield* Effect.promise(() => rule.configure(undefined));
|
|
36
|
+
if (configured._tag === "Invalid") {
|
|
37
|
+
return yield* Effect.die(new Error(`${rule.id} refused its options: ${configured.issues.join("; ")}`));
|
|
38
|
+
}
|
|
39
|
+
const inputs = yield* Effect.promise(() => scanned(engine.root));
|
|
40
|
+
const result = yield* Effect.exit(configured.check({ ...inputs, entries }));
|
|
41
|
+
if (result._tag === "Failure") {
|
|
42
|
+
engine.failure = Cause.pretty(result.cause);
|
|
43
|
+
return "failed";
|
|
44
|
+
}
|
|
45
|
+
engine.failure = undefined;
|
|
46
|
+
engine.findings = result.value;
|
|
47
|
+
return "passed";
|
|
48
|
+
}),
|
|
49
|
+
failureMessage: () =>
|
|
50
|
+
engine.failure === undefined ? Effect.die(new Error("Run a failed check before reading its failure message")) : Effect.succeed(engine.failure),
|
|
51
|
+
optionIssues: Effect.fn("RuleStory.optionIssues")(function* (rule: RegisteredRule, options: unknown) {
|
|
52
|
+
tell(`quality configures ${rule.id} with ${JSON.stringify(options)}`);
|
|
53
|
+
const configured = yield* Effect.promise(() => configureRegistered(rule, options));
|
|
54
|
+
return configured._tag === "Invalid" ? configured.issues : [];
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
}
|
package/src/testing/ruleStory.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { Effect, FileSystem, Path } from "effect";
|
|
2
2
|
import { storyKit } from "@shivaedev/test-story/server/storyKit.ts";
|
|
3
|
-
import { configureRegistered } from "#adapters/rule.ts";
|
|
4
3
|
import { services } from "#cli/runMain.ts";
|
|
5
|
-
import type { Finding
|
|
4
|
+
import type { Finding } from "#rule.ts";
|
|
6
5
|
import { type Run, runQuality } from "#testing/adapters/cli.ts";
|
|
7
|
-
import { scanned } from "#testing/adapters/imports.ts";
|
|
8
6
|
import { packageRoot, type SeedFile } from "#testing/adapters/tree.ts";
|
|
9
|
-
|
|
10
|
-
interface RuleEngine {
|
|
11
|
-
answer: Run | undefined;
|
|
12
|
-
findings: Findings | undefined;
|
|
13
|
-
readonly root: string;
|
|
14
|
-
}
|
|
7
|
+
import { type RuleEngine, ruleChecks } from "#testing/ruleChecks.ts";
|
|
15
8
|
|
|
16
9
|
const writeAll = Effect.fn("RuleStory.writeAll")(function* (root: string, files: readonly SeedFile[]) {
|
|
17
10
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -64,7 +57,7 @@ export function makeRuleStory() {
|
|
|
64
57
|
Effect.gen(function* () {
|
|
65
58
|
const fs = yield* FileSystem.FileSystem;
|
|
66
59
|
const root = yield* fs.makeTempDirectoryScoped({ prefix: "quality-rule-" });
|
|
67
|
-
const engine: RuleEngine = { answer: undefined, findings: undefined, root };
|
|
60
|
+
const engine: RuleEngine = { answer: undefined, failure: undefined, findings: undefined, root };
|
|
68
61
|
return engine;
|
|
69
62
|
}),
|
|
70
63
|
inspect: ({ findings }) => ({ findings }),
|
|
@@ -72,17 +65,7 @@ export function makeRuleStory() {
|
|
|
72
65
|
name: "Quality rule",
|
|
73
66
|
stages: ["repository"],
|
|
74
67
|
verbs: (engine, story) => ({
|
|
75
|
-
|
|
76
|
-
story.tell(options === undefined ? `quality checks ${rule.id}` : `quality checks ${rule.id} with ${JSON.stringify(options)}`);
|
|
77
|
-
const configured = yield* Effect.promise(() => rule.configure(options));
|
|
78
|
-
if (configured._tag === "Invalid") {
|
|
79
|
-
return yield* Effect.die(new Error(`${rule.id} refused its options: ${configured.issues.join("; ")}`));
|
|
80
|
-
}
|
|
81
|
-
const path = yield* Path.Path;
|
|
82
|
-
const inputs = yield* Effect.promise(() => scanned(path.join(engine.root, directory)));
|
|
83
|
-
engine.findings = yield* configured.check(inputs);
|
|
84
|
-
return engine.findings;
|
|
85
|
-
}),
|
|
68
|
+
...ruleChecks(engine, story.tell),
|
|
86
69
|
findings: () => checked(engine),
|
|
87
70
|
gate: Effect.fn("RuleStory.gate")(function* () {
|
|
88
71
|
story.tell("quality runs the repository gate");
|
|
@@ -99,11 +82,6 @@ export function makeRuleStory() {
|
|
|
99
82
|
),
|
|
100
83
|
locations: () => Effect.map(checked(engine), (findings) => findings.map(locationOf)),
|
|
101
84
|
messages: () => Effect.map(checked(engine), (findings) => findings.map((finding) => finding.message)),
|
|
102
|
-
optionIssues: Effect.fn("RuleStory.optionIssues")(function* (rule: RegisteredRule, options: unknown) {
|
|
103
|
-
story.tell(`quality configures ${rule.id} with ${JSON.stringify(options)}`);
|
|
104
|
-
const configured = yield* Effect.promise(() => configureRegistered(rule, options));
|
|
105
|
-
return configured._tag === "Invalid" ? configured.issues : [];
|
|
106
|
-
}),
|
|
107
85
|
removes: Effect.fn("RuleStory.removes")(function* (path: string) {
|
|
108
86
|
story.tell(`the author removes ${path}`);
|
|
109
87
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import type { SourceFile } from "#rule.ts";
|
|
3
|
-
export declare function bundlerEntries(file: SourceFile, root: string, directory: string, sources?: ReadonlyMap<string, ts.SourceFile>): readonly string[];
|
|
4
|
-
//# sourceMappingURL=bundlerEntries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundlerEntries.d.ts","sourceRoot":"","sources":["../../src/adapters/bundlerEntries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAM5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAgD3C,wBAAgB,cAAc,CAC7B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAa,GACrD,SAAS,MAAM,EAAE,CAgCnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundlerEntries.js","sourceRoot":"","sources":["../../src/adapters/bundlerEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAsB,eAAe,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAE3D,SAAS,YAAY,CAAC,IAAa;IAClC,OAAO,C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AS,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvH,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAC1B,CACD,CAAC;YACF,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YACpD,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBACvD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACzF,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1F,CAAC;QACF,CAAC;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,KAAK,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ImportGraph } from "#imports/graph.ts";
|
|
2
|
-
import type { PackageLayout } from "#naming/packageLayout.ts";
|
|
3
|
-
import type { RuleInputs } from "#rule.ts";
|
|
4
|
-
export declare function reachableBuildEntries(inputs: RuleInputs, graph: ImportGraph, layout: PackageLayout): ReadonlySet<string>;
|
|
5
|
-
//# sourceMappingURL=reachableBuildEntries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reachableBuildEntries.d.ts","sourceRoot":"","sources":["../../src/adapters/reachableBuildEntries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAoC3C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAkBxH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reachableBuildEntries.js","sourceRoot":"","sources":["../../src/adapters/reachableBuildEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,SAAS,gBAAgB,CAAC,MAAqB;IAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC5C,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;QAC5G,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACvF,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OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import type { RuleInputs } from "#rule.ts";
|
|
3
|
-
export declare const programmaticEntries: (inputs: RuleInputs) => Effect.Effect<ReadonlySet<string>, import("../adapters/ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
|
|
4
|
-
//# sourceMappingURL=programmaticEntries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"programmaticEntries.d.ts","sourceRoot":"","sources":["../../src/inventory/programmaticEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,mBAAmB,yIAI9B,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { reachableBuildEntries } from "#adapters/reachableBuildEntries.ts";
|
|
3
|
-
import { importGraph } from "#imports/graph.ts";
|
|
4
|
-
import { packageLayout } from "#naming/packageLayout.ts";
|
|
5
|
-
import { isTestCode } from "#naming/testName.ts";
|
|
6
|
-
export const programmaticEntries = Effect.fn("Inventory.programmaticEntries")(function* (inputs) {
|
|
7
|
-
const layout = yield* packageLayout(inputs);
|
|
8
|
-
const scripts = new Set([...layout.scripts, ...inputs.sources.filter((file) => isTestCode(file.path)).map((file) => file.path)]);
|
|
9
|
-
return scripts.size === 0 ? new Set() : reachableBuildEntries(inputs, yield* importGraph(inputs), { ...layout, scripts });
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=programmaticEntries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"programmaticEntries.js","sourceRoot":"","sources":["../../src/inventory/programmaticEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAkB;IAC1G,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjI,OAAO,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AACnI,CAAC,CAAC,CAAC"}
|