@shivaedev/quality 0.46.0 → 0.47.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 +13 -0
- package/dist/{biome → adapters/biome}/run.d.ts +1 -2
- package/dist/adapters/biome/run.d.ts.map +1 -0
- package/dist/{biome → adapters/biome}/run.js +1 -1
- package/dist/adapters/biome/run.js.map +1 -0
- package/dist/baseline/installDriver.d.ts +2 -1
- package/dist/baseline/installDriver.d.ts.map +1 -1
- package/dist/baseline/installDriver.js.map +1 -1
- package/dist/biome/recommendedRules.d.ts +2 -2
- package/dist/biome/recommendedRules.d.ts.map +1 -1
- package/dist/biome/recommendedRules.js +1 -1
- package/dist/biome/recommendedRules.js.map +1 -1
- package/dist/biome/report.d.ts +2 -1
- package/dist/biome/report.d.ts.map +1 -1
- package/dist/biome/report.js +6 -5
- package/dist/biome/report.js.map +1 -1
- package/dist/cli/fix.d.ts +2 -2
- package/dist/cli/fix.d.ts.map +1 -1
- package/dist/cli/runMain.d.ts +3 -3
- package/dist/cli/runMain.d.ts.map +1 -1
- package/dist/cli/runMain.js.map +1 -1
- package/dist/cli/shrink.d.ts +3 -3
- package/dist/cli/shrink.d.ts.map +1 -1
- package/dist/cli/shrink.js.map +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +1 -1
- package/dist/engine/session.js.map +1 -1
- package/dist/git/base.d.ts +2 -1
- package/dist/git/base.d.ts.map +1 -1
- package/dist/git/base.js +6 -6
- package/dist/git/base.js.map +1 -1
- package/dist/git/command.d.ts +2 -3
- package/dist/git/command.d.ts.map +1 -1
- package/dist/git/command.js +6 -6
- package/dist/git/command.js.map +1 -1
- package/dist/git/history.d.ts +2 -2
- package/dist/git/history.d.ts.map +1 -1
- package/dist/git/history.js.map +1 -1
- package/dist/hooks/forwarding.js +2 -2
- package/dist/hooks/location.js +3 -3
- package/dist/hooks/uninstall.js +2 -2
- package/dist/hooks/uninstall.js.map +1 -1
- package/dist/imports/withoutGenerated.d.ts +4 -2
- package/dist/imports/withoutGenerated.d.ts.map +1 -1
- package/dist/imports/withoutGenerated.js +22 -35
- package/dist/imports/withoutGenerated.js.map +1 -1
- package/dist/inventory/collect.d.ts +4 -3
- package/dist/inventory/collect.d.ts.map +1 -1
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/shadcnFolders.d.ts +4 -2
- package/dist/inventory/shadcnFolders.d.ts.map +1 -1
- package/dist/inventory/shadcnFolders.js.map +1 -1
- package/dist/inventory/trackedPaths.d.ts +5 -3
- package/dist/inventory/trackedPaths.d.ts.map +1 -1
- package/dist/inventory/trackedPaths.js +22 -24
- package/dist/inventory/trackedPaths.js.map +1 -1
- package/dist/inventory/walk.d.ts +5 -3
- package/dist/inventory/walk.d.ts.map +1 -1
- package/dist/inventory/walk.js +3 -9
- package/dist/inventory/walk.js.map +1 -1
- package/dist/manifests/sorted.d.ts +5 -3
- package/dist/manifests/sorted.d.ts.map +1 -1
- package/dist/manifests/sorted.js.map +1 -1
- package/dist/rules/builtIn.d.ts +2 -2
- package/dist/rules/imports/resolvable.d.ts +1 -1
- package/dist/rules/imports/resolvable.d.ts.map +1 -1
- package/dist/rules/imports/resolvable.js +4 -3
- package/dist/rules/imports/resolvable.js.map +1 -1
- package/dist/rules/suppressions/noIgnoreDeprecations.d.ts +1 -1
- package/dist/rules/suppressions/noIgnoreDeprecations.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/{biome → adapters/biome}/run.ts +1 -1
- package/src/baseline/installDriver.ts +6 -2
- package/src/biome/recommendedRules.ts +1 -1
- package/src/biome/report.ts +7 -6
- package/src/cli/fix.ts +1 -1
- package/src/cli/runMain.ts +4 -2
- package/src/cli/shrink.ts +4 -4
- package/src/engine/session.ts +4 -2
- package/src/git/base.ts +16 -13
- package/src/git/command.ts +10 -9
- package/src/git/history.ts +6 -2
- package/src/hooks/forwarding.ts +2 -2
- package/src/hooks/location.ts +3 -3
- package/src/hooks/uninstall.ts +2 -2
- package/src/imports/withoutGenerated.ts +25 -38
- package/src/inventory/collect.ts +4 -3
- package/src/inventory/shadcnFolders.ts +4 -2
- package/src/inventory/trackedPaths.ts +22 -24
- package/src/inventory/walk.ts +7 -11
- package/src/manifests/sorted.ts +4 -2
- package/src/rules/imports/resolvable.ts +4 -3
- package/dist/biome/run.d.ts.map +0 -1
- package/dist/biome/run.js.map +0 -1
|
@@ -1,52 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { basename, posix, relative } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { SetupFailure } from "#failure.ts";
|
|
4
4
|
import { emptyScope, verdictFor, withIgnoreFile } from "#inventory/ignoreScope.ts";
|
|
5
|
+
import { trackedPaths } from "#inventory/trackedPaths.ts";
|
|
5
6
|
const IGNORE_FILE = ".gitignore";
|
|
6
7
|
const LEADING_DOT = /^\.\//u;
|
|
7
8
|
const TRAILING_SLASHES = /\/+$/u;
|
|
8
9
|
const NODE_MODULES = "node_modules";
|
|
9
|
-
const NOT_A_REPOSITORY = "not a git repository";
|
|
10
10
|
const PLACEHOLDERS = new Set([".gitkeep", ".keep"]);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const contents = await reader.readText(posix.join(directory, IGNORE_FILE));
|
|
11
|
+
const withIgnoreFileIn = Effect.fn("Imports.withIgnoreFileIn")(function* (reader, scope, directory) {
|
|
12
|
+
const contents = yield* Effect.promise(() => reader.readText(posix.join(directory, IGNORE_FILE)));
|
|
14
13
|
return contents === undefined || contents === "" ? scope : withIgnoreFile(scope, posix.join(reader.root, directory), contents);
|
|
15
|
-
}
|
|
16
|
-
|
|
14
|
+
});
|
|
15
|
+
const ignored = Effect.fn("Imports.ignored")(function* (reader, file) {
|
|
17
16
|
const parts = file.split("/");
|
|
18
17
|
let scope = emptyScope;
|
|
19
18
|
for (const index of parts.keys()) {
|
|
20
|
-
scope =
|
|
19
|
+
scope = yield* withIgnoreFileIn(reader, scope, parts.slice(0, index).join("/") || ".");
|
|
21
20
|
if (verdictFor(scope, posix.join(reader.root, ...parts.slice(0, index + 1)), index < parts.length - 1) === "ignored") {
|
|
22
21
|
return true;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
return false;
|
|
26
|
-
}
|
|
27
|
-
async function tracked(root, folder) {
|
|
28
|
-
try {
|
|
29
|
-
const { stdout } = await run("git", ["ls-files", "-z", "--", folder], { cwd: root });
|
|
30
|
-
return stdout.split("\0").filter(Boolean);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
if (error instanceof Error && "stderr" in error && String(error.stderr).includes(NOT_A_REPOSITORY)) {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
25
|
+
});
|
|
39
26
|
function under(folder, path) {
|
|
40
27
|
return path?.startsWith(`${folder}/`) === true;
|
|
41
28
|
}
|
|
42
|
-
|
|
43
|
-
const verdicts =
|
|
29
|
+
const contentIssue = Effect.fn("Imports.contentIssue")(function* (reader, folder, named) {
|
|
30
|
+
const verdicts = yield* Effect.forEach(named, (file) => ignored(reader, file), { concurrency: "unbounded" });
|
|
44
31
|
if (verdicts.includes(false)) {
|
|
45
32
|
return `"${folder}" is not ignored by git, so it holds source, not generated output`;
|
|
46
33
|
}
|
|
47
|
-
const kept = (
|
|
48
|
-
return kept === undefined ? undefined : `"${folder}" holds files git tracks, such as ${kept}, so it is not generated output`;
|
|
49
|
-
}
|
|
34
|
+
const kept = (yield* trackedPaths(reader.root, folder)).find((file) => !PLACEHOLDERS.has(basename(file)));
|
|
35
|
+
return kept === undefined ? undefined : `"${folder}" holds files git tracks, such as ${relative(reader.root, kept)}, so it is not generated output`;
|
|
36
|
+
});
|
|
50
37
|
function placeIssue(graph, folder) {
|
|
51
38
|
if (folder === "" || folder.startsWith("../") || posix.isAbsolute(folder)) {
|
|
52
39
|
return `"${folder}" is no folder inside the repository`;
|
|
@@ -58,21 +45,21 @@ function placeIssue(graph, folder) {
|
|
|
58
45
|
? undefined
|
|
59
46
|
: `"${folder}" holds no file that an import names`;
|
|
60
47
|
}
|
|
61
|
-
|
|
48
|
+
const issueOf = Effect.fn("Imports.issueOf")(function* (reader, graph, folder) {
|
|
62
49
|
const misplaced = placeIssue(graph, folder);
|
|
63
50
|
if (misplaced !== undefined) {
|
|
64
51
|
return misplaced;
|
|
65
52
|
}
|
|
66
53
|
const named = [...new Set(graph.edges.flatMap((edge) => (edge.to.kind === "file" && under(folder, edge.to.path) ? [edge.to.path] : [])))];
|
|
67
|
-
return
|
|
68
|
-
}
|
|
54
|
+
return yield* contentIssue(reader, folder, named);
|
|
55
|
+
});
|
|
69
56
|
// A generated folder may be empty until its generator runs, so a relative import of a missing file in it resolves.
|
|
70
|
-
export
|
|
57
|
+
export const withoutGenerated = Effect.fn("Imports.withoutGenerated")(function* (reader, graph, declared) {
|
|
71
58
|
const folders = declared.map((folder) => posix.normalize(folder).replace(LEADING_DOT, "").replace(TRAILING_SLASHES, ""));
|
|
72
|
-
const issues = (
|
|
59
|
+
const issues = (yield* Effect.forEach(folders, (folder) => issueOf(reader, graph, folder), { concurrency: "unbounded" })).flatMap((issue) => issue ?? []);
|
|
73
60
|
if (issues.length > 0) {
|
|
74
|
-
|
|
61
|
+
return yield* new SetupFailure({ message: `the generated folders are invalid:\n${issues.map((issue) => ` - ${issue}`).join("\n")}` });
|
|
75
62
|
}
|
|
76
63
|
return graph.unresolved.filter((request) => !folders.some((folder) => under(folder, request.missing)));
|
|
77
|
-
}
|
|
64
|
+
});
|
|
78
65
|
//# sourceMappingURL=withoutGenerated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withoutGenerated.js","sourceRoot":"","sources":["../../src/imports/withoutGenerated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"withoutGenerated.js","source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ACvB,OAAO,KAAK,CAAC,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,uCAAuC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACxI,CAAC;IACD,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Effect
|
|
2
|
-
import type {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { SetupFailure } from "#failure.ts";
|
|
3
|
+
import type { RuleServices, SourceFile } from "#rule.ts";
|
|
3
4
|
import { FilesystemFailure } from "./filesystem.ts";
|
|
4
5
|
export interface InventoryScope {
|
|
5
6
|
readonly exclude: readonly string[];
|
|
@@ -11,5 +12,5 @@ export interface Inventory {
|
|
|
11
12
|
readonly manifestFiles: readonly string[];
|
|
12
13
|
readonly sources: readonly SourceFile[];
|
|
13
14
|
}
|
|
14
|
-
export declare const collectInventory: (root: string, scope: InventoryScope) => Effect.Effect<Inventory, FilesystemFailure,
|
|
15
|
+
export declare const collectInventory: (root: string, scope: InventoryScope) => Effect.Effect<Inventory, FilesystemFailure | SetupFailure, RuleServices>;
|
|
15
16
|
//# sourceMappingURL=collect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/inventory/collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/inventory/collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAkC,MAAM,iBAAiB,CAAC;AAMpF,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACxC;AAwBD,eAAO,MAAM,gBAAgB,mHAoB3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect.js","sourceRoot":"","sources":["../../src/inventory/collect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"collect.js","sourceRoot":"","sources":["../../src/inventory/collect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAA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AAC,CAAC;SACzC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC;SAC5E,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACrB,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YACpB,OAAO,CAAC,CAAC;QACV,CAAC;QACD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACJ,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3G,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACxH,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Effect
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { SetupFailure } from "#failure.ts";
|
|
3
|
+
import type { RuleServices } from "#rule.ts";
|
|
2
4
|
import { FilesystemFailure } from "./filesystem.ts";
|
|
3
|
-
export declare const shadcnFolders: (root: string) => Effect.Effect<readonly string[], FilesystemFailure,
|
|
5
|
+
export declare const shadcnFolders: (root: string) => Effect.Effect<readonly string[], FilesystemFailure | SetupFailure, RuleServices>;
|
|
4
6
|
//# sourceMappingURL=shadcnFolders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcnFolders.d.ts","sourceRoot":"","sources":["../../src/inventory/shadcnFolders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"shadcnFolders.d.ts","sourceRoot":"","sources":["../../src/inventory/shadcnFolders.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAC;AAOtE,eAAO,MAAM,aAAa,oGAoBxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcnFolders.js","sourceRoot":"","sources":["../../src/inventory/shadcnFolders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"shadcnFolders.js","sourceRoot":"","sources":["../../src/inventory/shadcnFolders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM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AM,KAAK,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClE,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;gBAC9F,CAAC;gBACD,OAAO,MAAM,CAAC;YACf,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { SetupFailure } from "#failure.ts";
|
|
3
|
+
export declare const trackedPaths: (directory: string, path?: any) => Effect.Effect<string[], SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner>;
|
|
4
|
+
export declare const ignoredTrackedPaths: (directory: string) => Effect.Effect<string[], SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner>;
|
|
5
|
+
export declare const ignoredPaths: (directory: string) => Effect.Effect<string[] | undefined, SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner>;
|
|
4
6
|
//# sourceMappingURL=trackedPaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackedPaths.d.ts","sourceRoot":"","sources":["../../src/inventory/trackedPaths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trackedPaths.d.ts","sourceRoot":"","sources":["../../src/inventory/trackedPaths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiB3C,eAAO,MAAM,YAAY,4IAEvB,CAAC;AAEH,eAAO,MAAM,mBAAmB,gIAE9B,CAAC;AAEH,eAAO,MAAM,YAAY,4IAGvB,CAAC"}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
1
|
import { join, resolve } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.filter(Boolean)
|
|
11
|
-
.map((path) => join(directory, path));
|
|
12
|
-
}
|
|
13
|
-
catch (error) {
|
|
14
|
-
if (error instanceof Error && "stderr" in error && String(error.stderr).includes("not a git repository")) {
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { SetupFailure } from "#failure.ts";
|
|
4
|
+
import { run } from "#git/command.ts";
|
|
5
|
+
const listedPaths = Effect.fn("Inventory.listedPaths")(function* (directory, options, path = ".") {
|
|
6
|
+
const result = yield* run(directory, ["ls-files", "-z", ...options, "--", path]);
|
|
7
|
+
if (result.code !== 0) {
|
|
8
|
+
if (result.stderr.includes("not a git repository")) {
|
|
15
9
|
return undefined;
|
|
16
10
|
}
|
|
17
|
-
|
|
11
|
+
return yield* new SetupFailure({ message: `git ls-files exited ${result.code}: ${result.stderr.trim()}` });
|
|
18
12
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
return result.stdout
|
|
14
|
+
.split("\0")
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.map((file) => join(directory, file));
|
|
17
|
+
});
|
|
18
|
+
export const trackedPaths = Effect.fn("Inventory.trackedPaths")(function* (directory, path = ".") {
|
|
19
|
+
return (yield* listedPaths(directory, [], path)) ?? [];
|
|
20
|
+
});
|
|
21
|
+
export const ignoredTrackedPaths = Effect.fn("Inventory.ignoredTrackedPaths")(function* (directory) {
|
|
22
|
+
return (yield* listedPaths(directory, ["--cached", "--ignored", "--exclude-standard"])) ?? [];
|
|
23
|
+
});
|
|
24
|
+
export const ignoredPaths = Effect.fn("Inventory.ignoredPaths")(function* (directory) {
|
|
25
|
+
const paths = yield* listedPaths(directory, ["--others", "--ignored", "--exclude-standard", "--directory"]);
|
|
28
26
|
return paths?.map((path) => resolve(path));
|
|
29
|
-
}
|
|
27
|
+
});
|
|
30
28
|
//# sourceMappingURL=trackedPaths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackedPaths.js","sourceRoot":"","sources":["../../src/inventory/trackedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"trackedPaths.js","sourceRoot":"","sources":["../../src/inventory/trackedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB,EAAE,OAA0B,EAAE,IAAI,GAAG,GAAG;IAC1H,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACjF,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACvB,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;YACpD,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,KAAK,CAAC,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,uBAAuB,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;IACD,OAAO,MAAM,CAAC,MAAM;SAClB,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB,EAAE,IAAI,GAAG,GAAG;IACvG,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB;IACzG,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/F,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB;IAC3F,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5G,OAAO,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC"}
|
package/dist/inventory/walk.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Effect, FileSystem } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { SetupFailure } from "#failure.ts";
|
|
3
|
+
import type { RuleServices } from "#rule.ts";
|
|
4
|
+
import { type FilesystemFailure } from "./filesystem.ts";
|
|
3
5
|
import { type IgnoreScope } from "./ignoreScope.ts";
|
|
4
6
|
export declare function ignoreScopeAt(dir: string, inherited?: IgnoreScope): Effect.Effect<IgnoreScope, FilesystemFailure, FileSystem.FileSystem>;
|
|
5
|
-
export declare const scopeAbove: (root: string, dir: string) => Effect.Effect<IgnoreScope, FilesystemFailure,
|
|
6
|
-
export declare const walk: (dir: string, inherited?: IgnoreScope | undefined) => Effect.Effect<readonly string[], FilesystemFailure,
|
|
7
|
+
export declare const scopeAbove: (root: string, dir: string) => Effect.Effect<IgnoreScope, FilesystemFailure | SetupFailure, RuleServices>;
|
|
8
|
+
export declare const walk: (dir: string, inherited?: IgnoreScope | undefined) => Effect.Effect<readonly string[], FilesystemFailure | SetupFailure, RuleServices>;
|
|
7
9
|
//# sourceMappingURL=walk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../src/inventory/walk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAkC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../src/inventory/walk.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAkC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAc,KAAK,WAAW,EAA0C,MAAM,kBAAkB,CAAC;AAKxG,wBAAgB,aAAa,CAC5B,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,WAAwB,GACjC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,UAAU,CAAC,CAOtE;AAED,eAAO,MAAM,UAAU,2GAiBrB,CAAC;AAEH,eAAO,MAAM,IAAI,wIAgBf,CAAC"}
|
package/dist/inventory/walk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, join, relative, sep } from "node:path";
|
|
2
2
|
import { Effect, FileSystem } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { orWhenAbsent, readOptionalText } from "./filesystem.js";
|
|
4
4
|
import { emptyScope, insideKept, verdictFor, withIgnoreFile } from "./ignoreScope.js";
|
|
5
5
|
import { ignoredPaths, trackedPaths } from "./trackedPaths.js";
|
|
6
6
|
const SKIPPED = new Set([".git", ".worktrees", "node_modules"]);
|
|
@@ -11,10 +11,7 @@ export function ignoreScopeAt(dir, inherited = emptyScope) {
|
|
|
11
11
|
return Effect.map(readOptionalText(join(dir, ".gitignore")), (contents) => contents === undefined || contents === "" ? inherited : withIgnoreFile(inherited, dir, contents));
|
|
12
12
|
}
|
|
13
13
|
export const scopeAbove = Effect.fnUntraced(function* (root, dir) {
|
|
14
|
-
const ignored = yield*
|
|
15
|
-
catch: (cause) => new FilesystemFailure({ message: `cannot list ignored files in ${dir}: ${String(cause)}`, path: dir }),
|
|
16
|
-
try: () => ignoredPaths(dir),
|
|
17
|
-
});
|
|
14
|
+
const ignored = yield* ignoredPaths(dir);
|
|
18
15
|
if (ignored !== undefined) {
|
|
19
16
|
return { ...emptyScope, ignored: new Set(ignored) };
|
|
20
17
|
}
|
|
@@ -29,10 +26,7 @@ export const walk = Effect.fnUntraced(function* (dir, inherited) {
|
|
|
29
26
|
if ((yield* orWhenAbsent(dir, fs.stat(dir), undefined)) === undefined) {
|
|
30
27
|
return [];
|
|
31
28
|
}
|
|
32
|
-
const paths = yield*
|
|
33
|
-
catch: (cause) => new FilesystemFailure({ message: `cannot list tracked files in ${dir}: ${String(cause)}`, path: dir }),
|
|
34
|
-
try: () => trackedPaths(dir),
|
|
35
|
-
});
|
|
29
|
+
const paths = yield* trackedPaths(dir);
|
|
36
30
|
const tracked = new Set(paths);
|
|
37
31
|
for (const path of paths) {
|
|
38
32
|
for (let folder = dirname(path); folder !== dir && folder !== dirname(folder); folder = dirname(folder)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../src/inventory/walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../src/inventory/walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAG5C,OAAO,EAA0B,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAoB,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC;AAEhE,MAAM,UAAU,aAAa,CAC5B,GAAW,EACX,SAAS,GAAgB,UAAU;IAEnC,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAC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nD,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Effect
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { ManifestFailure } from "#adapters/manifestInventory.ts";
|
|
3
|
+
import type { SetupFailure } from "#failure.ts";
|
|
3
4
|
import { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
5
|
+
import type { RuleServices } from "#rule.ts";
|
|
4
6
|
export type Sorting = {
|
|
5
7
|
readonly _tag: "Sorted";
|
|
6
8
|
} | {
|
|
7
9
|
readonly _tag: "Unsorted";
|
|
8
10
|
readonly sorted: string;
|
|
9
11
|
};
|
|
10
|
-
export declare function manifestsIn(root: string): Effect.Effect<readonly string[], FilesystemFailure,
|
|
12
|
+
export declare function manifestsIn(root: string): Effect.Effect<readonly string[], FilesystemFailure | SetupFailure, RuleServices>;
|
|
11
13
|
export declare function sortingOf(text: string): Sorting;
|
|
12
|
-
export declare const sortManifests: (root: string) => Effect.Effect<number, FilesystemFailure | ManifestFailure,
|
|
14
|
+
export declare const sortManifests: (root: string) => Effect.Effect<number, FilesystemFailure | ManifestFailure | SetupFailure, RuleServices>;
|
|
13
15
|
//# sourceMappingURL=sorted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted.d.ts","sourceRoot":"","sources":["../../src/manifests/sorted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sorted.d.ts","sourceRoot":"","sources":["../../src/manifests/sorted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAc,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAEhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,iBAAiB,GAAG,YAAY,EAAE,YAAY,CAAC,CAO1H;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG/C;AAED,eAAO,MAAM,aAAa,2GAgCxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sorted.js","sourceRoot":"","sources":["../../src/manifests/sorted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3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AC,CAAC,IAAI,CACN,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACzB,KAAK,YAAY,eAAe;QAC/B,CAAC,CAAC,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,eAAe,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC;QACjF,CAAC,CAAC,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,eAAe,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CACpF,CACD,CACD,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;AACvC,CAAC,CAAC,CAAC"}
|
package/dist/rules/builtIn.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const builtInRules: readonly [import("../rule.ts").Rule<"code/unu
|
|
|
6
6
|
}, never>, import("../rule.ts").Rule<"comments/no-line-reference", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"comments/no-pr-reference", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"comments/no-banner", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"comments/no-todo", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"comments/no-environment-pragma", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"comments/max-per-file", {
|
|
7
7
|
readonly allow?: readonly string[];
|
|
8
8
|
readonly max?: number;
|
|
9
|
-
}, never>, import("../rule.ts").Rule<"docs/references", undefined, never>, import("../rule.ts").Rule<"docs/unversioned-installs", undefined, never>, import("../rule.ts").Rule<"suppressions/no-inline", undefined, never>, import("../rule.ts").Rule<"suppressions/no-double-cast", undefined, never>, import("../rule.ts").Rule<"suppressions/no-ignore-deprecations", undefined, import("
|
|
9
|
+
}, never>, import("../rule.ts").Rule<"docs/references", undefined, never>, import("../rule.ts").Rule<"docs/unversioned-installs", undefined, never>, import("../rule.ts").Rule<"suppressions/no-inline", undefined, never>, import("../rule.ts").Rule<"suppressions/no-double-cast", undefined, never>, import("../rule.ts").Rule<"suppressions/no-ignore-deprecations", undefined, import("../rule.ts").RuleServices>, import("../rule.ts").Rule<"suppressions/biome-overrides", {
|
|
10
10
|
readonly declared?: readonly {
|
|
11
11
|
readonly includes: readonly [string, ...string[]];
|
|
12
12
|
readonly reason: string;
|
|
@@ -16,7 +16,7 @@ export declare const builtInRules: readonly [import("../rule.ts").Rule<"code/unu
|
|
|
16
16
|
readonly fences?: readonly import("../imports/fences/model.ts").Fence[];
|
|
17
17
|
}, never>, import("../rule.ts").Rule<"imports/runtime", undefined, never>, import("../rule.ts").Rule<"imports/resolvable", {
|
|
18
18
|
readonly generated?: readonly string[];
|
|
19
|
-
},
|
|
19
|
+
}, import("effect/process/ChildProcessSpawner").ChildProcessSpawner>, import("../rule.ts").Rule<"imports/manifest", undefined, never>, import("../rule.ts").Rule<"imports/aliased", undefined, never>, import("../rule.ts").Rule<"imports/no-test-code", undefined, never>, import("../rule.ts").Rule<"manifests/valid", undefined, never>, import("../rule.ts").Rule<"manifests/sorted", undefined, never>, import("../rule.ts").Rule<"manifests/source-first", undefined, never>, import("../rule.ts").Rule<"manifests/exports-shape", undefined, never>, import("../rule.ts").Rule<"manifests/application", undefined, never>, import("../rule.ts").Rule<"files/named-after-export", {
|
|
20
20
|
readonly toolOwned?: readonly string[];
|
|
21
21
|
}, never>, import("../rule.ts").Rule<"files/folder-names", {
|
|
22
22
|
readonly content?: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvable.d.ts","sourceRoot":"","sources":["../../../src/rules/imports/resolvable.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"resolvable.d.ts","sourceRoot":"","sources":["../../../src/rules/imports/resolvable.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB;;oEAc5B,CAAC"}
|
|
@@ -6,15 +6,16 @@ const ResolvableOptions = Schema.Struct({
|
|
|
6
6
|
generated: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed([]))),
|
|
7
7
|
});
|
|
8
8
|
export const importsResolvable = defineRule({
|
|
9
|
-
check:
|
|
10
|
-
const
|
|
9
|
+
check: Effect.fn("Imports.check")(function* ({ options, ...inputs }) {
|
|
10
|
+
const graph = yield* Effect.promise(() => importGraph(inputs));
|
|
11
|
+
const unresolved = yield* withoutGenerated(inputs, graph, options.generated);
|
|
11
12
|
return unresolved.map((request) => ({
|
|
12
13
|
file: request.from,
|
|
13
14
|
line: request.line,
|
|
14
15
|
message: `Cannot resolve "${request.specifier}". Fix the path, install or declare the package, or declare the module in a .d.ts file among the sources.`,
|
|
15
16
|
subject: request.specifier,
|
|
16
17
|
}));
|
|
17
|
-
},
|
|
18
|
+
}),
|
|
18
19
|
description: "Every import resolves to a file, a package or a declared module, so no edge of the import graph goes unchecked.",
|
|
19
20
|
id: "imports/resolvable",
|
|
20
21
|
options: Schema.toStandardSchemaV1(ResolvableOptions, { parseOptions: { errors: "all", onExcessProperty: "error" } }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvable.js","sourceRoot":"","sources":["../../../src/rules/imports/resolvable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9F,CAAC,CAAC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AS;SAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,WAAW,EAAE,iHAAiH;IAC9H,EAAE,EAAE,oBAAoB;IACxB,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC;CACrH,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const noIgnoreDeprecations: import("#rule.ts").Rule<"suppressions/no-ignore-deprecations", undefined, import("
|
|
1
|
+
export declare const noIgnoreDeprecations: import("#rule.ts").Rule<"suppressions/no-ignore-deprecations", undefined, import("#rule.ts").RuleServices>;
|
|
2
2
|
//# sourceMappingURL=noIgnoreDeprecations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noIgnoreDeprecations.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noIgnoreDeprecations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"noIgnoreDeprecations.d.ts","sourceRoot":"","sources":["../../../src/rules/suppressions/noIgnoreDeprecations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB,4GAc/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/quality",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@effect/platform-node": "4.0.6",
|
|
63
63
|
"@effect/platform-node-shared": "4.0.6",
|
|
64
64
|
"@effect/vitest": "4.0.6",
|
|
65
|
-
"@shivaedev/test-story": "0.25.
|
|
65
|
+
"@shivaedev/test-story": "0.25.1",
|
|
66
66
|
"@types/node": "24.19.2",
|
|
67
67
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
68
68
|
"effect": "4.0.6",
|
|
@@ -2,9 +2,9 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { Effect, Stream } from "effect";
|
|
4
4
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
|
+
import { withExceptionConfig } from "#biome/exceptionConfig.ts";
|
|
5
6
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
6
7
|
import { shadcnFolders } from "#inventory/shadcnFolders.ts";
|
|
7
|
-
import { withExceptionConfig } from "./exceptionConfig.ts";
|
|
8
8
|
|
|
9
9
|
export interface BiomeRun {
|
|
10
10
|
readonly code: number;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Console, Effect } from "effect";
|
|
2
|
+
import type { ChildProcessSpawner } from "effect/process";
|
|
2
3
|
import type { SetupFailure } from "#failure.ts";
|
|
3
|
-
import {
|
|
4
|
+
import { gitOrFail } from "#git/command.ts";
|
|
4
5
|
import { hookCommand, type Launch, shellWords } from "#hooks/command.ts";
|
|
5
6
|
|
|
6
|
-
export const installDriver = Effect.fn("Baseline.installDriver")(function* (
|
|
7
|
+
export const installDriver = Effect.fn("Baseline.installDriver")(function* (
|
|
8
|
+
cwd: string,
|
|
9
|
+
launch: Launch,
|
|
10
|
+
): Effect.fn.Return<void, SetupFailure, ChildProcessSpawner.ChildProcessSpawner> {
|
|
7
11
|
const root = (yield* gitOrFail(cwd, ["rev-parse", "--show-toplevel"])).trim();
|
|
8
12
|
const command = hookCommand(root, launch, undefined);
|
|
9
13
|
const driver = `${shellWords([...command.runner, command.launcher, "baseline", "merge"])} "%O" "%A" "%B"`;
|
package/src/biome/report.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { relative, sep } from "node:path";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
+
import { type BiomeRun, runBiome } from "#adapters/biome/run.ts";
|
|
3
4
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
5
|
+
import { SetupFailure } from "#failure.ts";
|
|
4
6
|
import { ignoredTrackedPaths } from "#inventory/trackedPaths.ts";
|
|
5
7
|
import { recognizeDiagnostics } from "./recognizeDiagnostics.ts";
|
|
6
|
-
import { type BiomeRun, runBiome } from "./run.ts";
|
|
7
8
|
|
|
8
9
|
const Position = Schema.Struct({ column: Schema.optionalKey(Schema.Int), line: Schema.Int });
|
|
9
10
|
|
|
@@ -27,8 +28,8 @@ const decodeReport = Schema.decodeUnknownOption(Schema.fromJsonString(Report));
|
|
|
27
28
|
|
|
28
29
|
export const FAILING: ReadonlySet<string> = new Set(["error", "fatal"]);
|
|
29
30
|
|
|
30
|
-
function failure(args: readonly string[], run: BiomeRun, missing: string, output: string):
|
|
31
|
-
return new
|
|
31
|
+
function failure(args: readonly string[], run: BiomeRun, missing: string, output: string): SetupFailure {
|
|
32
|
+
return new SetupFailure({ message: `biome ${args.join(" ")} exited ${run.code} without ${missing}:\n${output.trim()}` });
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
// Biome exits with an error but prints an empty report when no file was processed, so only a failing diagnostic explains a failed run.
|
|
@@ -46,10 +47,10 @@ const reportFor = Effect.fn("Biome.reportFor")(function* (
|
|
|
46
47
|
const run = yield* runBiome(root, command, exceptions);
|
|
47
48
|
const report = decodeReport(run.stdout.trim());
|
|
48
49
|
if (report._tag === "None") {
|
|
49
|
-
return yield* Effect.
|
|
50
|
+
return yield* Effect.fail(failure(command, run, "a report", [run.stdout, run.stderr].join("\n")));
|
|
50
51
|
}
|
|
51
52
|
if (unexplained(run, report.value)) {
|
|
52
|
-
return yield* Effect.
|
|
53
|
+
return yield* Effect.fail(failure(command, run, "a failing diagnostic", run.stderr));
|
|
53
54
|
}
|
|
54
55
|
return report.value;
|
|
55
56
|
});
|
|
@@ -59,7 +60,7 @@ export const biomeReport = Effect.fn("Biome.biomeReport")(function* (
|
|
|
59
60
|
args: readonly string[],
|
|
60
61
|
exceptions: readonly ExceptionDeclaration[] = [],
|
|
61
62
|
) {
|
|
62
|
-
const [report, tracked] = yield* Effect.all([reportFor(root, args, ["."], exceptions),
|
|
63
|
+
const [report, tracked] = yield* Effect.all([reportFor(root, args, ["."], exceptions), ignoredTrackedPaths(root)], {
|
|
63
64
|
concurrency: "unbounded",
|
|
64
65
|
});
|
|
65
66
|
const paths = tracked
|
package/src/cli/fix.ts
CHANGED
|
@@ -16,7 +16,7 @@ function isBinary(bytes: Uint8Array): boolean {
|
|
|
16
16
|
return bytes.includes(0);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function snapshotOf(root: string): Effect.Effect<ReadonlyMap<string, string>, SetupFailure,
|
|
19
|
+
export function snapshotOf(root: string): Effect.Effect<ReadonlyMap<string, string>, SetupFailure, RuleServices> {
|
|
20
20
|
return Effect.gen(function* () {
|
|
21
21
|
const fs = yield* FileSystem.FileSystem;
|
|
22
22
|
const decoder = new TextDecoder();
|