@r_masseater/wism 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-DtBrrYjC.mjs → app-Cp80aJat.mjs} +3 -130
- package/dist/app-Cp80aJat.mjs.map +1 -0
- package/dist/cli-CeLKKUBS.mjs +114 -0
- package/dist/cli-CeLKKUBS.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +13 -6
- package/dist/app-DtBrrYjC.mjs.map +0 -1
- package/dist/cli-Dou7Gs_O.mjs +0 -20
- package/dist/cli-Dou7Gs_O.mjs.map +0 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { Array, Boolean,
|
|
3
|
-
import { runMain } from "@r_masseater/node-main";
|
|
4
|
-
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
|
-
import { Argument, Command } from "effect/cli";
|
|
6
|
-
import { resolveConfigFromFile } from "vite-plus";
|
|
2
|
+
import { Array, Boolean, Effect, Function, Match, Option, Order, Predicate, Record, Schema, String as String$1, pipe } from "effect";
|
|
7
3
|
// ../lint-host/src/entities/rule/model/setting.ts
|
|
8
4
|
const NO_OPTIONS = {};
|
|
9
5
|
const settingOf = (entry) => Match.value(entry).pipe(Match.when(Match.string, (severity) => ({
|
|
@@ -17,40 +13,6 @@ const settingOf = (entry) => Match.value(entry).pipe(Match.when(Match.string, (s
|
|
|
17
13
|
const abiOf = (platform) => Match.value(platform).pipe(Match.when("linux", () => "-gnu"), Match.when("win32", () => "-msvc"), Match.orElse(() => ""));
|
|
18
14
|
const platformTarget = `${process.platform}-${process.arch}${abiOf(process.platform)}`;
|
|
19
15
|
const addonFileOf = (binary) => `${binary}.${platformTarget}.node`;
|
|
20
|
-
// ../lint-host/src/features/build-addon/model/build.ts
|
|
21
|
-
const taggedError$2 = Schema.TaggedError;
|
|
22
|
-
var AddonBuildFailed = class extends taggedError$2()("AddonBuildFailed", { message: Schema.String }) {};
|
|
23
|
-
const LIBRARY = {
|
|
24
|
-
linux: (name) => `lib${name}.so`,
|
|
25
|
-
darwin: (name) => `lib${name}.dylib`,
|
|
26
|
-
win32: (name) => `${name}.dll`
|
|
27
|
-
};
|
|
28
|
-
const SUCCESS = 0;
|
|
29
|
-
const cargo = Effect.fn("cargo")(function* cargo(crate, workspace) {
|
|
30
|
-
const exitCode = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).exitCode(ChildProcess.make("cargo", [
|
|
31
|
-
"build",
|
|
32
|
-
"--release",
|
|
33
|
-
"--locked",
|
|
34
|
-
"-p",
|
|
35
|
-
crate
|
|
36
|
-
], {
|
|
37
|
-
cwd: workspace,
|
|
38
|
-
stdout: "inherit",
|
|
39
|
-
stderr: "inherit"
|
|
40
|
-
}));
|
|
41
|
-
const failure = AddonBuildFailed.make({ message: `cargo exited with ${String(exitCode)}` });
|
|
42
|
-
yield* Effect.when(Effect.fail(failure), Effect.sync(() => Number(exitCode) !== SUCCESS));
|
|
43
|
-
});
|
|
44
|
-
Effect.fn("buildAddon")(function* build(options) {
|
|
45
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
46
|
-
const path = yield* Path.Path;
|
|
47
|
-
const library = yield* Effect.fromOption(Record.get(LIBRARY, process.platform)).pipe(Effect.mapError(() => AddonBuildFailed.make({ message: `no native build for ${process.platform}` })));
|
|
48
|
-
yield* cargo(options.crate, options.workspaceDir);
|
|
49
|
-
const output = path.join(options.packageDir, "native");
|
|
50
|
-
yield* fileSystem.makeDirectory(output, { recursive: true });
|
|
51
|
-
const built = library(String$1.replaceAll("-", "_")(options.crate));
|
|
52
|
-
yield* fileSystem.copyFile(path.join(options.workspaceDir, "target", "release", built), path.join(output, addonFileOf(options.binary)));
|
|
53
|
-
});
|
|
54
16
|
// ../lint-host/src/features/load-addon/model/load.ts
|
|
55
17
|
const loadAddon = ({ packageName, binary, from, isAddon, failWith }) => {
|
|
56
18
|
const requireFrom = createRequire(from);
|
|
@@ -64,95 +26,6 @@ const callAddon = ({ addon, name, files, call, failWith }) => addon.pipe(Effect.
|
|
|
64
26
|
try: () => call(loaded),
|
|
65
27
|
catch: failWith(`${name} could not lint`)
|
|
66
28
|
}).pipe(Effect.tap(() => Effect.promise(() => loaded.flushTelemetry())))), Effect.withSpan(`${name}.native`, { attributes: { [`${name}.files`]: files } }));
|
|
67
|
-
// ../lint-host/src/shared/lib/fail.ts
|
|
68
|
-
const taggedError$1 = Schema.TaggedError;
|
|
69
|
-
var NotUtf8Error = class extends taggedError$1()("NotUtf8Error", { path: Schema.String }) {};
|
|
70
|
-
// ../lint-host/src/features/run-cli/model/cli.ts
|
|
71
|
-
const CONFIG_FILES = [
|
|
72
|
-
"vite.config.ts",
|
|
73
|
-
"vite.config.mts",
|
|
74
|
-
"vite.config.js",
|
|
75
|
-
"vite.config.mjs"
|
|
76
|
-
];
|
|
77
|
-
const FAILED = 1;
|
|
78
|
-
const DATA_FIRST_ARITY$1 = 2;
|
|
79
|
-
const STRICT_UTF8 = new TextDecoder("utf-8", { fatal: true });
|
|
80
|
-
const readSectionIn = (source, root) => Effect.gen(function* readConfig() {
|
|
81
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
82
|
-
const path = yield* Path.Path;
|
|
83
|
-
const found = yield* pipe(CONFIG_FILES, Array.map((name) => path.join(root, name)), Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))));
|
|
84
|
-
const loaded = yield* Option.match(Array.head(found), {
|
|
85
|
-
onNone: () => Effect.succeed({}),
|
|
86
|
-
onSome: (file) => Effect.tryPromise({
|
|
87
|
-
try: () => resolveConfigFromFile(file),
|
|
88
|
-
catch: source.failWith(`could not load ${file}`)
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
return source.section(loaded);
|
|
92
|
-
}).pipe(Effect.withSpan(`${source.name}.config`));
|
|
93
|
-
Function.dual(DATA_FIRST_ARITY$1, readSectionIn);
|
|
94
|
-
const trackedFiles = (root, pathspecs) => Effect.gen(function* listFiles() {
|
|
95
|
-
const output = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).string(ChildProcess.make("git", [
|
|
96
|
-
"ls-files",
|
|
97
|
-
"-co",
|
|
98
|
-
"--exclude-standard",
|
|
99
|
-
"-z",
|
|
100
|
-
"--",
|
|
101
|
-
...pathspecs
|
|
102
|
-
], { cwd: root }));
|
|
103
|
-
return pipe(String$1.split(output, "\0"), Array.filter(String$1.isNonEmpty));
|
|
104
|
-
});
|
|
105
|
-
const requestOf = (config, patterns) => Array.match(patterns, {
|
|
106
|
-
onEmpty: () => ({ config }),
|
|
107
|
-
onNonEmpty: (given) => ({
|
|
108
|
-
config,
|
|
109
|
-
patterns: given
|
|
110
|
-
})
|
|
111
|
-
});
|
|
112
|
-
const hasError = (found) => pipe(found, Array.some(({ severity }) => severity === "error"));
|
|
113
|
-
const failWhen = (failed) => Effect.when(Effect.sync(() => {
|
|
114
|
-
process.exitCode = FAILED;
|
|
115
|
-
}), Effect.succeed(failed)).pipe(Effect.asVoid);
|
|
116
|
-
const printAll = (found, format) => Array.match(found, {
|
|
117
|
-
onEmpty: () => Effect.void,
|
|
118
|
-
onNonEmpty: (all) => Console.log(pipe(all, Array.map(format), Array.join("\n")))
|
|
119
|
-
});
|
|
120
|
-
const readerIn = (root, failWith) => Effect.gen(function* reader() {
|
|
121
|
-
const fileSystem = yield* FileSystem.FileSystem;
|
|
122
|
-
const path = yield* Path.Path;
|
|
123
|
-
return (file) => fileSystem.readFile(path.resolve(root, file)).pipe(Effect.mapError(failWith(`could not read ${file}`)), Effect.flatMap((bytes) => Effect.try({
|
|
124
|
-
try: () => STRICT_UTF8.decode(bytes),
|
|
125
|
-
catch: () => NotUtf8Error.make({ path: file })
|
|
126
|
-
})));
|
|
127
|
-
});
|
|
128
|
-
const mainOf = (cli, patterns) => Effect.gen(function* main() {
|
|
129
|
-
const root = process.cwd();
|
|
130
|
-
const config = yield* readSectionIn(cli, root);
|
|
131
|
-
const pathspecs = cli.pathspecs(requestOf(config, patterns));
|
|
132
|
-
const { files, projectFiles } = yield* Effect.all({
|
|
133
|
-
files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),
|
|
134
|
-
projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`))
|
|
135
|
-
}, { concurrency: "unbounded" });
|
|
136
|
-
const read = yield* readerIn(root, cli.failWith);
|
|
137
|
-
const found = yield* cli.lint({
|
|
138
|
-
root,
|
|
139
|
-
files,
|
|
140
|
-
projectFiles,
|
|
141
|
-
config,
|
|
142
|
-
read
|
|
143
|
-
});
|
|
144
|
-
yield* printAll(found, cli.format);
|
|
145
|
-
yield* failWhen(hasError(found));
|
|
146
|
-
});
|
|
147
|
-
const variadicOf = ({ name, description }) => Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());
|
|
148
|
-
const pathspecArgument = () => variadicOf({
|
|
149
|
-
name: "pathspec",
|
|
150
|
-
description: "Git pathspecs of the files to lint, in place of the configured ones"
|
|
151
|
-
});
|
|
152
|
-
const runCli = (cli) => {
|
|
153
|
-
const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) => mainOf(cli, pathspecs)).pipe(Command.withDescription(cli.description));
|
|
154
|
-
runMain(cli.name)(Command.run(command, { version: cli.version }));
|
|
155
|
-
};
|
|
156
29
|
const present = Function.dual(2, (value, build) => Option.match(value, {
|
|
157
30
|
onNone: () => ({}),
|
|
158
31
|
onSome: build
|
|
@@ -363,6 +236,6 @@ const wismPathspecs = pathspecsOf({
|
|
|
363
236
|
":(exclude,attr:linguist-documentation)"
|
|
364
237
|
]
|
|
365
238
|
});
|
|
366
|
-
export { failedWith as a, WismError as i, wismSection as n, format as o, lint as r,
|
|
239
|
+
export { failedWith as a, WismError as i, wismSection as n, format as o, lint as r, wismPathspecs as t };
|
|
367
240
|
|
|
368
|
-
//# sourceMappingURL=app-
|
|
241
|
+
//# sourceMappingURL=app-Cp80aJat.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-Cp80aJat.mjs","names":["Fn","Bool","Arr","Fn","Arr","Str","Arr","Rec","Arr","Str","Arr","Arr"],"sources":["../../lint-host/src/entities/rule/model/setting.ts","../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/load-addon/model/load.ts","../../lint-host/src/shared/lib/present.ts","../../lint-host/src/shared/lib/trace.ts","../../lint-host/src/shared/lib/words.ts","../../lint-host/src/shared/lib/diagnostic.ts","../../lint-host/src/shared/lib/section.ts","../src/entities/rule/model/resolve.ts","../src/app/format.ts","../src/features/run-rules/model/run.ts","../src/shared/lib/errors.ts","../src/shared/native/graph.ts","../src/shared/native/index.ts","../src/app/lint.ts","../src/app/section.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Record as Rec, pipe } from \"effect\";\n\nexport type Severity = \"off\" | \"warn\" | \"error\";\n\nexport type RuleOptions = Readonly<Record<string, unknown>>;\n\nexport type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];\n\nexport interface Setting {\n readonly severity: Severity;\n readonly options: RuleOptions;\n}\n\nconst NO_OPTIONS: RuleOptions = {};\n\nexport const settingOf = (entry: RuleEntry): Setting =>\n Match.value(entry).pipe(\n Match.when(Match.string, (severity): Setting => ({ severity, options: NO_OPTIONS })),\n Match.orElse(([severity, options]): Setting => ({\n severity,\n options: options ?? NO_OPTIONS,\n })),\n );\n\nconst optionsOf = (entry: RuleEntry): Option.Option<RuleOptions> =>\n Match.value(entry).pipe(\n Match.when(Match.string, () => Option.none()),\n Match.orElse(([, options]) => Option.fromUndefinedOr(options)),\n );\n\nconst overridden = (earlier: RuleEntry, later: RuleEntry): RuleEntry =>\n pipe(\n optionsOf(later),\n Option.orElse(() => optionsOf(earlier)),\n Option.match({\n onNone: () => later,\n onSome: (options): RuleEntry => [settingOf(later).severity, options],\n }),\n );\n\nexport const mergedRules = (\n layers: readonly (Readonly<Record<string, RuleEntry>> | undefined)[],\n): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = {};\n for (const [name, later] of pipe(\n layers,\n Arr.flatMap((layer) => Rec.toEntries(layer ?? {})),\n )) {\n merged[name] = pipe(\n Rec.get(merged, name),\n Option.match({\n onNone: () => later,\n onSome: (earlier) => overridden(earlier, later),\n }),\n );\n }\n return merged;\n};\n","import { Match } from \"effect\";\n\nconst abiOf = (platform: string): string =>\n Match.value(platform).pipe(\n Match.when(\"linux\", () => \"-gnu\"),\n Match.when(\"win32\", () => \"-msvc\"),\n Match.orElse(() => \"\"),\n );\n\nexport const platformTarget = `${process.platform}-${process.arch}${abiOf(process.platform)}`;\n\nexport const addonFileOf = (binary: string): string => `${binary}.${platformTarget}.node`;\n","import { createRequire } from \"node:module\";\n\nimport { Effect } from \"effect\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\nimport { addonFileOf, platformTarget } from \"#/shared/lib/target.ts\";\n\nexport interface AddonSource<Addon, Failure> {\n readonly packageName: string;\n readonly binary: string;\n readonly from: string;\n readonly isAddon: (value: unknown) => value is Addon;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const loadAddon = <Addon, Failure>({\n packageName,\n binary,\n from,\n isAddon,\n failWith,\n}: AddonSource<Addon, Failure>): Effect.Effect<Addon, Failure> => {\n const requireFrom = createRequire(from);\n const loadFrom = (specifier: string): Effect.Effect<unknown, Failure> =>\n Effect.try({\n try: (): unknown => requireFrom(specifier),\n catch: failWith(`could not load ${specifier}`),\n });\n return loadFrom(`${packageName}-${platformTarget}`).pipe(\n Effect.catchCause(() => loadFrom(`${packageName}/native/${addonFileOf(binary)}`)),\n Effect.filterOrFail(isAddon, (found) =>\n failWith(`no ${binary} addon for ${platformTarget}`)(found),\n ),\n );\n};\n\nexport interface Telemetered {\n readonly flushTelemetry: () => Promise<void>;\n}\n\nexport interface AddonCall<Addon extends Telemetered, Result, Failure> {\n readonly addon: Effect.Effect<Addon, Failure>;\n readonly name: string;\n readonly files: number;\n readonly call: (addon: Addon) => Result;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const callAddon = <Addon extends Telemetered, Result, Failure>({\n addon,\n name,\n files,\n call,\n failWith,\n}: AddonCall<Addon, Result, Failure>): Effect.Effect<Result, Failure> =>\n addon.pipe(\n Effect.flatMap((loaded) =>\n Effect.try({ try: () => call(loaded), catch: failWith(`${name} could not lint`) }).pipe(\n Effect.tap(() => Effect.promise(() => loaded.flushTelemetry())),\n ),\n ),\n Effect.withSpan(`${name}.native`, { attributes: { [`${name}.files`]: files } }),\n );\n","import { Function as Fn, Option } from \"effect\";\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const present: {\n <Value, Fields extends object>(\n build: (value: Value) => Fields,\n ): (value: Option.Option<Value>) => Partial<Fields>;\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields> => Option.match(value, { onNone: (): Partial<Fields> => ({}), onSome: build }),\n);\n","import { Array as Arr, Boolean as Bool, Effect, Order } from \"effect\";\nimport type { Option } from \"effect\";\n\nconst SAMPLED = \"01\";\nconst NOT_SAMPLED = \"00\";\n\nexport interface Positioned {\n readonly path: string;\n readonly line: number;\n readonly column?: number;\n}\n\nconst LINE_START = 0;\n\nconst flagsOf = (sampled: boolean): string =>\n Bool.match(sampled, { onFalse: () => NOT_SAMPLED, onTrue: () => SAMPLED });\n\nexport const traceparent: Effect.Effect<Option.Option<string>> = Effect.currentSpan.pipe(\n Effect.map((span) => `00-${span.traceId}-${span.spanId}-${flagsOf(span.sampled)}`),\n Effect.option,\n);\n\nconst byPosition: Order.Order<Positioned> = Order.combine(\n Order.mapInput(Order.String, (found: Positioned) => found.path),\n Order.combine(\n Order.mapInput(Order.Number, (found: Positioned) => found.line),\n Order.mapInput(Order.Number, (found: Positioned) => found.column ?? LINE_START),\n ),\n);\n\nexport const sortByPosition = <Found extends Positioned>(found: readonly Found[]): Found[] =>\n Arr.sort(found, byPosition);\n","import { Option, Record as Rec, pipe } from \"effect\";\n\nexport const WORD = 4;\nexport const STRING_WORDS = 2;\nconst EMPTY = 0;\nconst LENGTH = 1;\n\nexport const aligned = (buffer: Uint8Array): Uint8Array =>\n Option.match(\n Option.liftPredicate(buffer, ({ byteOffset }) => byteOffset % WORD === EMPTY),\n {\n onNone: () => Uint8Array.from(buffer),\n onSome: (value) => value,\n },\n );\n\nexport const wordAt =\n (words: Uint32Array) =>\n (index: number): number =>\n words[index] ?? EMPTY;\n\nexport const fieldsOf =\n (header: Uint32Array) =>\n <Name extends string>(fields: Readonly<Record<Name, number>>): Readonly<Record<Name, number>> =>\n pipe(\n fields,\n Rec.map((index) => wordAt(header)(index)),\n );\n\nexport const wordsOf =\n (buffer: Uint8Array) =>\n (at: number, count: number): Uint32Array =>\n new Uint32Array(buffer.buffer, buffer.byteOffset + at * WORD, count);\n\nexport const spanText =\n (words: Uint32Array) =>\n (blob: Uint8Array, encoding: string) =>\n (spansAt: number, unit: number): ((index: number) => string) => {\n const decoder = new TextDecoder(encoding);\n const cache = new Map<number, string>();\n const read = (index: number): string => {\n const at = spansAt + index * STRING_WORDS;\n const offset = wordAt(words)(at) * unit;\n const value = decoder.decode(\n blob.subarray(offset, offset + wordAt(words)(at + LENGTH) * unit),\n );\n cache.set(index, value);\n return value;\n };\n return (index) => Option.getOrElse(Option.fromNullishOr(cache.get(index)), () => read(index));\n };\n","import { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Reportable {\n readonly path: string;\n readonly line: number;\n readonly column?: number | undefined;\n readonly rule: string;\n readonly message: string;\n readonly detail?: string | undefined;\n readonly context?: string | undefined;\n readonly severity: string;\n}\n\nexport const diagnosticDetail = (diagnostic: Reportable): string =>\n pipe(\n [diagnostic.detail, diagnostic.context],\n Arr.flatMap((part) => Option.toArray(Option.fromNullishOr(part))),\n Arr.filter((part) => part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n\nexport const formatDiagnostic = (diagnostic: Reportable): string => {\n const column = pipe(\n Option.fromNullishOr(diagnostic.column),\n Option.map((value) => `:${String(value)}`),\n Option.getOrElse(() => \"\"),\n );\n return `${diagnostic.path}:${String(diagnostic.line)}${column} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}${diagnosticDetail(diagnostic)}`;\n};\n\nexport interface NotUtf8 {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly rule: string;\n readonly message: string;\n readonly severity: \"error\";\n}\n\nexport const notUtf8 =\n (tool: string) =>\n (path: string): NotUtf8 => ({\n path,\n line: 1,\n column: 1,\n rule: \"utf8\",\n message: `The file is not valid UTF-8, so ${tool} cannot read it`,\n severity: \"error\",\n });\n","import { Array as Arr, Function as Fn, Option, Predicate, pipe } from \"effect\";\n\nexport interface SectionRequest<Config extends object> {\n readonly name: string;\n readonly fallback: Config;\n readonly prepare?: (section: Config) => Config;\n}\n\nexport const sectionOf = <Config extends object>({\n name,\n fallback,\n prepare = Fn.identity,\n}: SectionRequest<Config>): ((config: unknown) => Config) => {\n const hasSection = (value: unknown): value is Readonly<Record<string, Config>> =>\n Predicate.hasProperty(value, name) && Predicate.isObject(value[name]);\n return (config) =>\n pipe(\n Option.liftPredicate(config, hasSection),\n Option.flatMapNullishOr((value) => value[name]),\n Option.map(prepare),\n Option.getOrElse(() => fallback),\n );\n};\n\nexport interface Ignoring {\n readonly ignores?: readonly string[] | undefined;\n}\n\nexport interface Pathspecs {\n readonly defaults: readonly string[];\n readonly unowned?: readonly string[];\n}\n\nexport const pathspecsOf =\n ({ defaults, unowned = [] }: Pathspecs) =>\n ({\n config,\n patterns = [],\n }: {\n readonly config: Ignoring;\n readonly patterns?: readonly string[];\n }): readonly string[] => [\n ...Arr.match(patterns, { onEmpty: () => defaults, onNonEmpty: Fn.identity }),\n ...unowned,\n ...pipe(\n config.ignores ?? [],\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n ];\n","import { settingOf } from \"@masseater.dev/lint-host\";\nimport type { Setting } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { Plugin, Rule, RuleEntry, WismConfig } from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\nconst NAME_START = 1;\n\nexport interface ScriptRule {\n readonly id: string;\n readonly rule: Rule;\n readonly setting: Setting;\n}\n\nconst isPluginRule = (id: string): boolean => Str.includes(SEPARATOR)(id);\n\nconst pluginOf = (id: string): string => Arr.headNonEmpty(Str.split(id, SEPARATOR));\n\nconst nameOf = (id: string): string =>\n pipe(Str.split(id, SEPARATOR), Arr.drop(NAME_START), Arr.join(SEPARATOR));\n\nconst scriptOf =\n (plugins: Readonly<Record<string, Plugin>>) =>\n ([id, entry]: readonly [string, RuleEntry]): Option.Option<ScriptRule> =>\n pipe(\n Rec.get(plugins, pluginOf(id)),\n Option.flatMap((plugin) => Rec.get(plugin.rules ?? {}, nameOf(id))),\n Option.map((rule): ScriptRule => ({ id, rule, setting: settingOf(entry) })),\n Option.filter(({ setting }) => setting.severity !== \"off\"),\n );\n\nexport const resolve = (config: WismConfig): readonly ScriptRule[] =>\n pipe(\n Rec.toEntries(config.rules ?? {}),\n Arr.filter(([id]) => isPluginRule(id)),\n Arr.map(scriptOf(config.plugins ?? {})),\n Arr.getSomes,\n );\n\nexport const unknownRules = (config: WismConfig): readonly string[] => {\n const plugins = config.plugins ?? {};\n return pipe(\n Rec.keys(config.rules ?? {}),\n Arr.filter(\n (id) =>\n !isPluginRule(id) ||\n pipe(\n Rec.get(plugins, pluginOf(id)),\n Option.flatMap((plugin) => Rec.get(plugin.rules ?? {}, nameOf(id))),\n Option.isNone,\n ),\n ),\n );\n};\n","import type { Diagnostic } from \"#/shared/config/index.ts\";\n\nexport const format = (diagnostic: Diagnostic): string =>\n `${diagnostic.path}:${String(diagnostic.line)}:${String(diagnostic.column)} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}`;\n","import { Array as Arr, Match, Option, pipe } from \"effect\";\n\nimport type { ScriptRule } from \"#/entities/rule/index.ts\";\nimport type { Diagnostic, GraphEdge, Report } from \"#/shared/config/index.ts\";\n\nconst FIRST = 1;\n\nexport interface Graph {\n readonly files: readonly string[];\n readonly root: string;\n readonly edges: readonly GraphEdge[];\n}\n\nconst severityOf = (rule: ScriptRule): Diagnostic[\"severity\"] =>\n Match.value(rule.setting.severity).pipe(\n Match.when(\"warn\", () => \"warn\" as const),\n Match.orElse(() => \"error\" as const),\n );\n\nconst diagnosticOf =\n (rule: ScriptRule) =>\n (report: Report): Diagnostic => ({\n path: report.path,\n line: Option.getOrElse(Option.fromNullishOr(report.line), () => FIRST),\n column: Option.getOrElse(Option.fromNullishOr(report.column), () => FIRST),\n rule: rule.id,\n message: report.message,\n severity: severityOf(rule),\n });\n\nconst runOne =\n (graph: Graph) =>\n (rule: ScriptRule): readonly Diagnostic[] => {\n const reports: Report[] = [];\n rule.rule.check({\n ...graph,\n options: rule.setting.options,\n report: (report) => {\n reports.push(report);\n },\n });\n return pipe(reports, Arr.map(diagnosticOf(rule)));\n };\n\nexport const runScriptRules =\n (rules: readonly ScriptRule[]) =>\n (graph: Graph): readonly Diagnostic[] =>\n pipe(rules, Arr.flatMap(runOne(graph)));\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class WismError extends taggedError<WismError, { readonly brand: unique symbol }>()(\n \"WismError\",\n {\n message: Schema.String,\n },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): WismError =>\n WismError.make({ message: `${message}: ${String(cause)}` });\n","import { STRING_WORDS, WORD, spanText, wordAt } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport type { GraphEdge, ImportTarget } from \"#/shared/config/index.ts\";\n\nconst HEADER_WORDS = 4;\nconst EDGE_WORDS = 7;\nconst UTF8 = \"utf8\";\nconst BYTE = 1;\nconst HEADER = { edges: 0, strings: 1, blob: 2, notUtf8: 3 } as const;\nconst FIELD = {\n from: 0,\n kind: 1,\n target: 2,\n specifier: 3,\n line: 4,\n column: 5,\n wildcard: 6,\n} as const;\nconst MODULE = 1;\nconst WILDCARD = 1;\nconst MODULE_SEPARATOR = \"::\";\n\nconst spansStart = (words: Uint32Array): number =>\n HEADER_WORDS + wordAt(words)(HEADER.edges) * EDGE_WORDS;\n\nconst stringsOf = (words: Uint32Array): ((index: number) => string) => {\n const spans = spansStart(words);\n const blob = new Uint8Array(\n words.buffer,\n words.byteOffset + (spans + wordAt(words)(HEADER.strings) * STRING_WORDS) * WORD,\n );\n return spanText(words)(blob, UTF8)(spans, BYTE);\n};\n\nconst targetOf = (kind: number, value: string): ImportTarget => {\n if (kind === MODULE) {\n return { type: \"module\", value: Str.split(value, MODULE_SEPARATOR) };\n }\n return { type: \"file\", value };\n};\n\nexport const decodeGraph =\n (files: readonly string[]) =>\n (words: Uint32Array): readonly GraphEdge[] => {\n const text = stringsOf(words);\n const field = (base: number, name: keyof typeof FIELD): number =>\n wordAt(words)(base + FIELD[name]);\n const count = wordAt(words)(HEADER.edges);\n return pipe(\n Arr.makeBy(count, (index) => HEADER_WORDS + index * EDGE_WORDS),\n Arr.take(count),\n Arr.map((base): GraphEdge => ({\n from: Option.getOrElse(Arr.get(files, field(base, \"from\")), () => \"\"),\n specifier: text(field(base, \"specifier\")),\n target: targetOf(field(base, \"kind\"), text(field(base, \"target\"))),\n line: field(base, \"line\"),\n column: field(base, \"column\"),\n wildcard: field(base, \"wildcard\") === WILDCARD,\n })),\n );\n };\n\nexport const decodeNotUtf8 =\n (files: readonly string[]) =>\n (words: Uint32Array): readonly string[] => {\n const start =\n spansStart(words) +\n wordAt(words)(HEADER.strings) * STRING_WORDS +\n Math.ceil(wordAt(words)(HEADER.blob) / WORD);\n const count = wordAt(words)(HEADER.notUtf8);\n return pipe(\n Arr.makeBy(count, (index) => wordAt(words)(start + index)),\n Arr.take(count),\n Arr.flatMap((position) => Option.toArray(Arr.get(files, position))),\n );\n };\n","import { loadAddon } from \"@masseater.dev/lint-host\";\nimport { Predicate } from \"effect\";\nimport type { Effect } from \"effect\";\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { WismError } from \"#/shared/lib/errors.ts\";\n\nexport interface NativeOptions {\n readonly traceparent?: string;\n}\n\nexport interface Native {\n readonly collect: (root: string, files: readonly string[], options: NativeOptions) => Uint32Array;\n readonly flushTelemetry: () => Promise<void>;\n}\n\nconst isNative = (value: unknown): value is Native =>\n Predicate.hasProperty(value, \"collect\") &&\n Predicate.isFunction(value.collect) &&\n Predicate.hasProperty(value, \"flushTelemetry\") &&\n Predicate.isFunction(value.flushTelemetry);\n\nexport const native: Effect.Effect<Native, WismError> = loadAddon({\n packageName: \"@r_masseater/wism\",\n binary: \"wism\",\n from: import.meta.url,\n isAddon: isNative,\n failWith: failedWith,\n});\nexport { decodeGraph, decodeNotUtf8 } from \"./graph.ts\";\n","import { callAddon, notUtf8, present, sortByPosition, traceparent } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Effect, pipe } from \"effect\";\n\nimport { resolve, unknownRules } from \"#/entities/rule/index.ts\";\nimport { runScriptRules } from \"#/features/run-rules/index.ts\";\nimport type { Diagnostic, WismConfig } from \"#/shared/config/index.ts\";\nimport { WismError, failedWith } from \"#/shared/lib/errors.ts\";\nimport { decodeGraph, decodeNotUtf8, native } from \"#/shared/native/index.ts\";\nimport type { NativeOptions } from \"#/shared/native/index.ts\";\n\nexport interface LintInput {\n readonly root: string;\n readonly files: readonly string[];\n readonly config?: WismConfig;\n}\n\nconst checkRules = (config: WismConfig): Effect.Effect<void, WismError> =>\n Arr.match(unknownRules(config), {\n onEmpty: () => Effect.void,\n onNonEmpty: (names) =>\n Effect.fail(\n WismError.make({\n message: `rules that no configured plugin defines: ${Arr.join(names, \", \")}. Name each rule plugin/rule.`,\n }),\n ),\n });\n\nconst collectEdges = Effect.fn(\"wism.collect_edges\")(function* collectEdges(input: LintInput) {\n const parent = yield* traceparent;\n const options: NativeOptions = present(parent, (value) => ({ traceparent: value }));\n const words = yield* callAddon({\n addon: native,\n name: \"wism\",\n files: input.files.length,\n call: (addon) => addon.collect(input.root, input.files, options),\n failWith: failedWith,\n });\n return yield* Effect.sync(() => ({\n edges: decodeGraph(input.files)(words),\n unreadable: decodeNotUtf8(input.files)(words),\n })).pipe(Effect.withSpan(\"wism.decode\"));\n});\n\nexport const lint = Effect.fn(\"wism.lint\")(function* lint(input: LintInput) {\n const config = input.config ?? {};\n yield* checkRules(config);\n const rules = resolve(config);\n if (Arr.isReadonlyArrayEmpty(rules)) {\n return [];\n }\n const { edges, unreadable } = yield* collectEdges(input);\n const found = yield* Effect.sync(() =>\n runScriptRules(rules)({ root: input.root, files: input.files, edges }),\n ).pipe(Effect.withSpan(\"wism.script_rules\", { attributes: { \"wism.edges\": edges.length } }));\n const unread = pipe(unreadable, Arr.map(notUtf8(\"wism\")));\n return sortByPosition<Diagnostic>([...found, ...unread]);\n});\n","import { pathspecsOf, sectionOf } from \"@masseater.dev/lint-host\";\n\nimport type { WismConfig } from \"#/shared/config/index.ts\";\n\nexport const wismSection = sectionOf<WismConfig>({ name: \"wism\", fallback: {} });\n\nexport const wismPathspecs = pathspecsOf({\n defaults: [\".\"],\n unowned: [\n \":(exclude,attr:linguist-vendored)\",\n \":(exclude,attr:linguist-generated)\",\n \":(exclude,attr:linguist-documentation)\",\n ],\n});\n"],"mappings":";;;AAaA,MAAM,aAA0B,CAAC;AAEjC,MAAa,aAAa,UACxB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,SAAS,cAAuB;CAAE;CAAU,SAAS;AAAW,EAAE,GACnF,MAAM,QAAQ,CAAC,UAAU,cAAuB;CAC9C;CACA,SAAS,WAAW;AACtB,EAAE,CACJ;;ACpBF,MAAM,SAAS,aACb,MAAM,MAAM,QAAQ,CAAC,CAAC,KACpB,M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114 @@
|
|
|
1
|
+
import { a as failedWith, n as wismSection, o as format, r as lint, t as wismPathspecs } from "./app-Cp80aJat.mjs";
|
|
2
|
+
import { Array, Console, Effect, FileSystem, Function, Option, Path, Schema, String, pipe } from "effect";
|
|
3
|
+
import { runMain } from "@r_masseater/node-main";
|
|
4
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
|
+
import { Argument, Command } from "effect/cli";
|
|
6
|
+
import { resolveConfigFromFile } from "vite-plus";
|
|
7
|
+
// ../lint-host/src/shared/lib/fail.ts
|
|
8
|
+
const taggedError = Schema.TaggedError;
|
|
9
|
+
var NotUtf8Error = class extends taggedError()("NotUtf8Error", { path: Schema.String }) {};
|
|
10
|
+
// ../lint-host/src/features/run-cli/model/cli.ts
|
|
11
|
+
const CONFIG_FILES = [
|
|
12
|
+
"vite.config.ts",
|
|
13
|
+
"vite.config.mts",
|
|
14
|
+
"vite.config.js",
|
|
15
|
+
"vite.config.mjs"
|
|
16
|
+
];
|
|
17
|
+
const FAILED = 1;
|
|
18
|
+
const DATA_FIRST_ARITY = 2;
|
|
19
|
+
const STRICT_UTF8 = new TextDecoder("utf-8", { fatal: true });
|
|
20
|
+
const readSectionIn = (source, root) => Effect.gen(function* readConfig() {
|
|
21
|
+
const fileSystem = yield* FileSystem.FileSystem;
|
|
22
|
+
const path = yield* Path.Path;
|
|
23
|
+
const found = yield* pipe(CONFIG_FILES, Array.map((name) => path.join(root, name)), Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))));
|
|
24
|
+
const loaded = yield* Option.match(Array.head(found), {
|
|
25
|
+
onNone: () => Effect.succeed({}),
|
|
26
|
+
onSome: (file) => Effect.tryPromise({
|
|
27
|
+
try: () => resolveConfigFromFile(file),
|
|
28
|
+
catch: source.failWith(`could not load ${file}`)
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
return source.section(loaded);
|
|
32
|
+
}).pipe(Effect.withSpan(`${source.name}.config`));
|
|
33
|
+
Function.dual(DATA_FIRST_ARITY, readSectionIn);
|
|
34
|
+
const trackedFiles = (root, pathspecs) => Effect.gen(function* listFiles() {
|
|
35
|
+
const output = yield* (yield* ChildProcessSpawner.ChildProcessSpawner).string(ChildProcess.make("git", [
|
|
36
|
+
"ls-files",
|
|
37
|
+
"-co",
|
|
38
|
+
"--exclude-standard",
|
|
39
|
+
"-z",
|
|
40
|
+
"--",
|
|
41
|
+
...pathspecs
|
|
42
|
+
], { cwd: root }));
|
|
43
|
+
return pipe(String.split(output, "\0"), Array.filter(String.isNonEmpty));
|
|
44
|
+
});
|
|
45
|
+
const requestOf = (config, patterns) => Array.match(patterns, {
|
|
46
|
+
onEmpty: () => ({ config }),
|
|
47
|
+
onNonEmpty: (given) => ({
|
|
48
|
+
config,
|
|
49
|
+
patterns: given
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const hasError = (found) => pipe(found, Array.some(({ severity }) => severity === "error"));
|
|
53
|
+
const failWhen = (failed) => Effect.when(Effect.sync(() => {
|
|
54
|
+
process.exitCode = FAILED;
|
|
55
|
+
}), Effect.succeed(failed)).pipe(Effect.asVoid);
|
|
56
|
+
const printAll = (found, format) => Array.match(found, {
|
|
57
|
+
onEmpty: () => Effect.void,
|
|
58
|
+
onNonEmpty: (all) => Console.log(pipe(all, Array.map(format), Array.join("\n")))
|
|
59
|
+
});
|
|
60
|
+
const readerIn = (root, failWith) => Effect.gen(function* reader() {
|
|
61
|
+
const fileSystem = yield* FileSystem.FileSystem;
|
|
62
|
+
const path = yield* Path.Path;
|
|
63
|
+
return (file) => fileSystem.readFile(path.resolve(root, file)).pipe(Effect.mapError(failWith(`could not read ${file}`)), Effect.flatMap((bytes) => Effect.try({
|
|
64
|
+
try: () => STRICT_UTF8.decode(bytes),
|
|
65
|
+
catch: () => NotUtf8Error.make({ path: file })
|
|
66
|
+
})));
|
|
67
|
+
});
|
|
68
|
+
const mainOf = (cli, patterns) => Effect.gen(function* main() {
|
|
69
|
+
const root = process.cwd();
|
|
70
|
+
const config = yield* readSectionIn(cli, root);
|
|
71
|
+
const pathspecs = cli.pathspecs(requestOf(config, patterns));
|
|
72
|
+
const { files, projectFiles } = yield* Effect.all({
|
|
73
|
+
files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),
|
|
74
|
+
projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`))
|
|
75
|
+
}, { concurrency: "unbounded" });
|
|
76
|
+
const read = yield* readerIn(root, cli.failWith);
|
|
77
|
+
const found = yield* cli.lint({
|
|
78
|
+
root,
|
|
79
|
+
files,
|
|
80
|
+
projectFiles,
|
|
81
|
+
config,
|
|
82
|
+
read
|
|
83
|
+
});
|
|
84
|
+
yield* printAll(found, cli.format);
|
|
85
|
+
yield* failWhen(hasError(found));
|
|
86
|
+
});
|
|
87
|
+
const variadicOf = ({ name, description }) => Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());
|
|
88
|
+
const pathspecArgument = () => variadicOf({
|
|
89
|
+
name: "pathspec",
|
|
90
|
+
description: "Git pathspecs of the files to lint, in place of the configured ones"
|
|
91
|
+
});
|
|
92
|
+
const runCli$1 = (cli) => {
|
|
93
|
+
const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) => mainOf(cli, pathspecs)).pipe(Command.withDescription(cli.description));
|
|
94
|
+
runMain(cli.name)(Command.run(command, { version: cli.version }));
|
|
95
|
+
};
|
|
96
|
+
// package.json
|
|
97
|
+
var version = "0.4.5";
|
|
98
|
+
var description = "A structure and dependency linter for TypeScript, Rust and Markdown, written in Rust and configured from vite.config.ts: directory kinds chosen by marker files, allowed layouts, FSD layers and import rules.";
|
|
99
|
+
// src/app/cli.ts
|
|
100
|
+
const runCli = () => {
|
|
101
|
+
runCli$1({
|
|
102
|
+
name: "wism",
|
|
103
|
+
version,
|
|
104
|
+
description,
|
|
105
|
+
section: wismSection,
|
|
106
|
+
pathspecs: wismPathspecs,
|
|
107
|
+
lint,
|
|
108
|
+
format,
|
|
109
|
+
failWith: failedWith
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
export { runCli };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=cli-CeLKKUBS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-CeLKKUBS.mjs","names":["Arr","Fn","Str","runCli","manifest.version","manifest.description"],"sources":["../../lint-host/src/shared/lib/fail.ts","../../lint-host/src/features/run-cli/model/cli.ts","../package.json","../src/app/cli.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class NotUtf8Error extends taggedError<NotUtf8Error, { readonly brand: unique symbol }>()(\n \"NotUtf8Error\",\n { path: Schema.String },\n) {}\n\nexport type FailWith<Failure> = (message: string) => (cause: unknown) => Failure;\n","import { runMain } from \"@r_masseater/node-main\";\nimport {\n Array as Arr,\n Console,\n Effect,\n FileSystem,\n Function as Fn,\n Option,\n Path,\n Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { NotUtf8Error } from \"#/shared/lib/fail.ts\";\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\n\nconst CONFIG_FILES = [\"vite.config.ts\", \"vite.config.mts\", \"vite.config.js\", \"vite.config.mjs\"];\nconst FAILED = 1;\nconst DATA_FIRST_ARITY = 2;\nconst STRICT_UTF8 = new TextDecoder(\"utf-8\", { fatal: true });\n\nexport interface Reported {\n readonly severity: string;\n}\n\nexport interface LintCall<Config, Failure> {\n readonly root: string;\n readonly files: readonly string[];\n readonly projectFiles: readonly string[];\n readonly config: Config;\n readonly read: (file: string) => Effect.Effect<string, Failure | NotUtf8Error>;\n}\n\nexport interface PathspecRequest<Config> {\n readonly config: Config;\n readonly patterns?: readonly string[];\n}\n\nexport interface SectionSource<Config, Failure> {\n readonly name: string;\n readonly version: string;\n readonly description: string;\n readonly section: (config: unknown) => Config;\n readonly failWith: FailWith<Failure>;\n}\n\nexport interface Cli<Config, Found extends Reported, Failure> extends SectionSource<\n Config,\n Failure\n> {\n readonly pathspecs: (request: PathspecRequest<Config>) => readonly string[];\n readonly lint: (call: LintCall<Config, Failure>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\nexport interface ToolParameter {\n readonly name: string;\n readonly description: string;\n}\n\nexport interface ToolInput {\n readonly flags: ReadonlySet<string>;\n readonly args: readonly string[];\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly input: ToolInput;\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly flags: readonly ToolParameter[];\n readonly argument: ToolParameter;\n readonly scan: (call: ToolCall<Config>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\ntype CliServices = FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner;\n\nconst readSectionIn = <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path> =>\n Effect.gen(function* readConfig() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const found = yield* pipe(\n CONFIG_FILES,\n Arr.map((name) => path.join(root, name)),\n Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))),\n );\n const loaded = yield* Option.match(Arr.head(found), {\n onNone: () => Effect.succeed<unknown>({}),\n onSome: (file) =>\n Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: source.failWith(`could not load ${file}`),\n }),\n });\n return source.section(loaded);\n }).pipe(Effect.withSpan(`${source.name}.config`));\n\n/** @internal */\nexport const readSection: {\n (\n root: string,\n ): <Config, Failure>(\n source: SectionSource<Config, Failure>,\n ) => Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n ): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n} = Fn.dual(DATA_FIRST_ARITY, readSectionIn);\n\nconst trackedFiles = (\n root: string,\n pathspecs: readonly string[],\n): Effect.Effect<readonly string[], PlatformError, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* listFiles() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\"ls-files\", \"-co\", \"--exclude-standard\", \"-z\", \"--\", ...pathspecs],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n });\n\nconst requestOf = <Config>(config: Config, patterns: readonly string[]): PathspecRequest<Config> =>\n Arr.match(patterns, {\n onEmpty: () => ({ config }),\n onNonEmpty: (given) => ({ config, patterns: given }),\n });\n\nconst hasError = (found: readonly Reported[]): boolean =>\n pipe(\n found,\n Arr.some(({ severity }) => severity === \"error\"),\n );\n\nconst failWhen = (failed: boolean): Effect.Effect<void> =>\n Effect.when(\n Effect.sync(() => {\n process.exitCode = FAILED;\n }),\n Effect.succeed(failed),\n ).pipe(Effect.asVoid);\n\nconst printAll = <Found>(\n found: readonly Found[],\n format: (found: Found) => string,\n): Effect.Effect<void> =>\n Arr.match(found, {\n onEmpty: () => Effect.void,\n onNonEmpty: (all) => Console.log(pipe(all, Arr.map(format), Arr.join(\"\\n\"))),\n });\n\nconst readerIn = <Failure>(\n root: string,\n failWith: FailWith<Failure>,\n): Effect.Effect<\n (file: string) => Effect.Effect<string, Failure | NotUtf8Error>,\n never,\n FileSystem.FileSystem | Path.Path\n> =>\n Effect.gen(function* reader() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return (file: string): Effect.Effect<string, Failure | NotUtf8Error> =>\n fileSystem.readFile(path.resolve(root, file)).pipe(\n Effect.mapError(failWith(`could not read ${file}`)),\n Effect.flatMap((bytes) =>\n Effect.try({\n try: () => STRICT_UTF8.decode(bytes),\n catch: () => NotUtf8Error.make({ path: file }),\n }),\n ),\n );\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n patterns: readonly string[],\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(cli, root);\n const pathspecs = cli.pathspecs(requestOf(config, patterns));\n const { files, projectFiles } = yield* Effect.all(\n {\n files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),\n projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`)),\n },\n { concurrency: \"unbounded\" },\n );\n const read = yield* readerIn(root, cli.failWith);\n const found = yield* cli.lint({ root, files, projectFiles, config, read });\n yield* printAll(found, cli.format);\n yield* failWhen(hasError(found));\n });\n\nconst toolMainOf =\n <Config, Found, Failure>(tool: Tool<Config, Found, Failure>) =>\n (input: ToolInput): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(tool, root);\n const found = yield* tool.scan({ root, config, input });\n yield* printAll(found, tool.format);\n yield* failWhen(Arr.isReadonlyArrayNonEmpty(found));\n });\n\nconst variadicOf = ({ name, description }: ToolParameter): Argument.Argument<readonly string[]> =>\n Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());\n\nconst flagsOf = (flags: readonly ToolParameter[]): Readonly<Record<string, Flag.Flag<boolean>>> =>\n Rec.fromEntries(\n pipe(\n flags,\n Arr.map(({ name, description }) => [\n name,\n Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.withDefault(false)),\n ]),\n ),\n );\n\nconst setFlags = (values: Readonly<Record<string, boolean>>): ReadonlySet<string> =>\n new Set(pipe(values, Rec.filter(Fn.identity), Rec.keys));\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n const command = Command.make(\n tool.name,\n { args: variadicOf(tool.argument), flags: flagsOf(tool.flags) },\n ({ args, flags }) => toolMainOf(tool)({ args, flags: setFlags(flags) }),\n ).pipe(Command.withDescription(tool.description));\n runMain(tool.name)(Command.run(command, { version: tool.version }));\n};\n\nconst pathspecArgument = (): Argument.Argument<readonly string[]> =>\n variadicOf({\n name: \"pathspec\",\n description: \"Git pathspecs of the files to lint, in place of the configured ones\",\n });\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) =>\n mainOf(cli, pathspecs),\n ).pipe(Command.withDescription(cli.description));\n runMain(cli.name)(Command.run(command, { version: cli.version }));\n};\n","","import { runCli as runLinter } from \"@masseater.dev/lint-host\";\nimport manifest from \"@r_masseater/wism/package.json\" with { type: \"json\" };\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\n\nimport { format, lint } from \"./index.ts\";\nimport { wismPathspecs, wismSection } from \"./section.ts\";\n\nexport const runCli = (): void => {\n runLinter({\n name: \"wism\",\n version: manifest.version,\n description: manifest.description,\n section: wismSection,\n pathspecs: wismPathspecs,\n lint,\n format,\n failWith: failedWith,\n });\n};\n"],"mappings":";;;;;;;AAEA,MAAM,cAAc,OAAO;AAE3B,IAAa,eAAb,cAAkC,YAA6D,CAAC,CAC9F,gBACA,EAAE,MAAM,OAAO,OAAO,CACxB,CAAC,CAAC,CAAC;;ACcH,MAAM,eAAe;CAAC;CAAkB;CAAmB;CAAkB;AAAiB;AAC9F,MAAM,SAAS;AACf,MAAM,mBAAmB;AACzB,MAAM,cAAc,IAAI,YAAY,SAAS,EAAE,OAAO,KAAK,CAAC;AA6D5D,MAAM,iBACJ,QACA,SAEA,OAAO,IAAI,UAAU,aAAa;CAChC,MAAM,aAAa,OAAO,WAAW;CACrC,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,QAAQ,OAAO,KACnB,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C,KAAK,SAAS,gBAAgB,WAAW,GAAG,SAAS,SAAS,CAAC;AAyBvF,MAAM,yBACJ,WAAW;CACT,MAAM;CACN,aAAa;AACf,CAAC;AAEH,MAAaG,YACX,QACS;CACT,MAAM,UAAU,QAAQ,KAAK,IAAI,MAAM,EAAE,WAAW,iBAAiB,EAAE,IAAI,EAAE,gBAC3E,OAAO,KAAK,SAAS,CACvB,CAAC,CAAC,KAAK,QAAQ,gBAAgB,IAAI,WAAW,CAAC;CAC/C,QAAQ,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAE,SAAS,IAAI,QAAQ,CAAC,CAAC;AAClE;;;;;AE5PA,MAAa,eAAqB;CAChC,SAAU;EACR,MAAM;EACGC;EACIC;EACb,SAAS;EACT,WAAW;EACX;EACA;EACA,UAAU;CACZ,CAAC;AACH"}
|
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as defineRule, t as definePlugin } from "./define-Dvnt_9zv.mjs";
|
|
2
|
-
import { i as WismError, n as wismSection, o as format, r as lint, t as wismPathspecs } from "./app-
|
|
2
|
+
import { i as WismError, n as wismSection, o as format, r as lint, t as wismPathspecs } from "./app-Cp80aJat.mjs";
|
|
3
3
|
export { WismError, definePlugin, defineRule, format, lint, wismPathspecs, wismSection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/wism",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "A structure and dependency linter for TypeScript, Rust and Markdown, written in Rust and configured from vite.config.ts: directory kinds chosen by marker files, allowed layouts, FSD layers and import rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"architecture",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"provenance": true
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@effect/platform-node": "^4.1.
|
|
61
|
-
"@r_masseater/node-main": "^0.2.
|
|
60
|
+
"@effect/platform-node": "^4.1.6",
|
|
61
|
+
"@r_masseater/node-main": "^0.2.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@masseater.dev/lint-host": "0.0.0",
|
|
65
65
|
"@masseater.dev/path-kit": "0.0.0",
|
|
66
66
|
"@r_masseater/vitest-otlp": "0.2.2",
|
|
67
|
-
"@types/node": "26.6.
|
|
67
|
+
"@types/node": "26.6.11",
|
|
68
68
|
"effect": "4.1.5",
|
|
69
69
|
"vite": "npm:@voidzero-dev/vite-plus-core@8.3.8001",
|
|
70
70
|
"vite-plus": "1.8.0"
|
|
@@ -84,8 +84,15 @@
|
|
|
84
84
|
"win32-x64-msvc"
|
|
85
85
|
]
|
|
86
86
|
},
|
|
87
|
+
"upstream": {
|
|
88
|
+
"npm:@feature-sliced/steiger-plugin": {
|
|
89
|
+
"reviewed": "0.8.2",
|
|
90
|
+
"verdict": "adopted",
|
|
91
|
+
"reason": "The rule tests come from steiger commit ebbb3fb. This is the latest release at the time the record was introduced, so confirm the first update against that commit."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
87
94
|
"optionalDependencies": {
|
|
88
|
-
"@r_masseater/wism-linux-x64-gnu": "0.4.
|
|
89
|
-
"@r_masseater/wism-win32-x64-msvc": "0.4.
|
|
95
|
+
"@r_masseater/wism-linux-x64-gnu": "0.4.5",
|
|
96
|
+
"@r_masseater/wism-win32-x64-msvc": "0.4.5"
|
|
90
97
|
}
|
|
91
98
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-DtBrrYjC.mjs","names":["taggedError","Rec","Str","taggedError","DATA_FIRST_ARITY","Arr","Fn","Str","Fn","Bool","Arr","Fn","Arr","Str","Arr","Rec","Arr","Str","Arr","Arr"],"sources":["../../lint-host/src/entities/rule/model/setting.ts","../../lint-host/src/shared/lib/target.ts","../../lint-host/src/features/build-addon/model/build.ts","../../lint-host/src/features/load-addon/model/load.ts","../../lint-host/src/shared/lib/fail.ts","../../lint-host/src/features/run-cli/model/cli.ts","../../lint-host/src/shared/lib/present.ts","../../lint-host/src/shared/lib/trace.ts","../../lint-host/src/shared/lib/words.ts","../../lint-host/src/shared/lib/diagnostic.ts","../../lint-host/src/shared/lib/section.ts","../src/entities/rule/model/resolve.ts","../src/app/format.ts","../src/features/run-rules/model/run.ts","../src/shared/lib/errors.ts","../src/shared/native/graph.ts","../src/shared/native/index.ts","../src/app/lint.ts","../src/app/section.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Record as Rec, pipe } from \"effect\";\n\nexport type Severity = \"off\" | \"warn\" | \"error\";\n\nexport type RuleOptions = Readonly<Record<string, unknown>>;\n\nexport type RuleEntry = Severity | readonly [Severity] | readonly [Severity, RuleOptions];\n\nexport interface Setting {\n readonly severity: Severity;\n readonly options: RuleOptions;\n}\n\nconst NO_OPTIONS: RuleOptions = {};\n\nexport const settingOf = (entry: RuleEntry): Setting =>\n Match.value(entry).pipe(\n Match.when(Match.string, (severity): Setting => ({ severity, options: NO_OPTIONS })),\n Match.orElse(([severity, options]): Setting => ({\n severity,\n options: options ?? NO_OPTIONS,\n })),\n );\n\nconst optionsOf = (entry: RuleEntry): Option.Option<RuleOptions> =>\n Match.value(entry).pipe(\n Match.when(Match.string, () => Option.none()),\n Match.orElse(([, options]) => Option.fromUndefinedOr(options)),\n );\n\nconst overridden = (earlier: RuleEntry, later: RuleEntry): RuleEntry =>\n pipe(\n optionsOf(later),\n Option.orElse(() => optionsOf(earlier)),\n Option.match({\n onNone: () => later,\n onSome: (options): RuleEntry => [settingOf(later).severity, options],\n }),\n );\n\nexport const mergedRules = (\n layers: readonly (Readonly<Record<string, RuleEntry>> | undefined)[],\n): Readonly<Record<string, RuleEntry>> => {\n const merged: Record<string, RuleEntry> = {};\n for (const [name, later] of pipe(\n layers,\n Arr.flatMap((layer) => Rec.toEntries(layer ?? {})),\n )) {\n merged[name] = pipe(\n Rec.get(merged, name),\n Option.match({\n onNone: () => later,\n onSome: (earlier) => overridden(earlier, later),\n }),\n );\n }\n return merged;\n};\n","import { Match } from \"effect\";\n\nconst abiOf = (platform: string): string =>\n Match.value(platform).pipe(\n Match.when(\"linux\", () => \"-gnu\"),\n Match.when(\"win32\", () => \"-msvc\"),\n Match.orElse(() => \"\"),\n );\n\nexport const platformTarget = `${process.platform}-${process.arch}${abiOf(process.platform)}`;\n\nexport const addonFileOf = (binary: string): string => `${binary}.${platformTarget}.node`;\n","import { runMain } from \"@r_masseater/node-main\";\nimport { Effect, FileSystem, Path, Record as Rec, Schema, String as Str } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { addonFileOf } from \"#/shared/lib/target.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nclass AddonBuildFailed extends taggedError<AddonBuildFailed, { readonly brand: unique symbol }>()(\n \"AddonBuildFailed\",\n { message: Schema.String },\n) {}\n\nconst LIBRARY: Readonly<Record<string, (name: string) => string>> = {\n linux: (name) => `lib${name}.so`,\n darwin: (name) => `lib${name}.dylib`,\n win32: (name) => `${name}.dll`,\n};\n\nconst SUCCESS = 0;\n\nexport interface AddonBuild {\n readonly crate: string;\n readonly binary: string;\n readonly packageDir: string;\n readonly workspaceDir: string;\n}\n\nconst cargo = Effect.fn(\"cargo\")(function* cargo(crate: string, workspace: string) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const exitCode = yield* spawner.exitCode(\n ChildProcess.make(\"cargo\", [\"build\", \"--release\", \"--locked\", \"-p\", crate], {\n cwd: workspace,\n stdout: \"inherit\",\n stderr: \"inherit\",\n }),\n );\n const failure = AddonBuildFailed.make({ message: `cargo exited with ${String(exitCode)}` });\n yield* Effect.when(\n Effect.fail(failure),\n Effect.sync(() => Number(exitCode) !== SUCCESS),\n );\n});\n\nconst build = Effect.fn(\"buildAddon\")(function* build(options: AddonBuild) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const library = yield* Effect.fromOption(Rec.get(LIBRARY, process.platform)).pipe(\n Effect.mapError(() =>\n AddonBuildFailed.make({ message: `no native build for ${process.platform}` }),\n ),\n );\n yield* cargo(options.crate, options.workspaceDir);\n const output = path.join(options.packageDir, \"native\");\n yield* fileSystem.makeDirectory(output, { recursive: true });\n const built = library(Str.replaceAll(\"-\", \"_\")(options.crate));\n yield* fileSystem.copyFile(\n path.join(options.workspaceDir, \"target\", \"release\", built),\n path.join(output, addonFileOf(options.binary)),\n );\n});\n\nexport const buildAddon = (options: AddonBuild): void => {\n runMain(`${options.binary}-build`)(build(options));\n};\n","import { createRequire } from \"node:module\";\n\nimport { Effect } from \"effect\";\n\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\nimport { addonFileOf, platformTarget } from \"#/shared/lib/target.ts\";\n\nexport interface AddonSource<Addon, Failure> {\n readonly packageName: string;\n readonly binary: string;\n readonly from: string;\n readonly isAddon: (value: unknown) => value is Addon;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const loadAddon = <Addon, Failure>({\n packageName,\n binary,\n from,\n isAddon,\n failWith,\n}: AddonSource<Addon, Failure>): Effect.Effect<Addon, Failure> => {\n const requireFrom = createRequire(from);\n const loadFrom = (specifier: string): Effect.Effect<unknown, Failure> =>\n Effect.try({\n try: (): unknown => requireFrom(specifier),\n catch: failWith(`could not load ${specifier}`),\n });\n return loadFrom(`${packageName}-${platformTarget}`).pipe(\n Effect.catchCause(() => loadFrom(`${packageName}/native/${addonFileOf(binary)}`)),\n Effect.filterOrFail(isAddon, (found) =>\n failWith(`no ${binary} addon for ${platformTarget}`)(found),\n ),\n );\n};\n\nexport interface Telemetered {\n readonly flushTelemetry: () => Promise<void>;\n}\n\nexport interface AddonCall<Addon extends Telemetered, Result, Failure> {\n readonly addon: Effect.Effect<Addon, Failure>;\n readonly name: string;\n readonly files: number;\n readonly call: (addon: Addon) => Result;\n readonly failWith: FailWith<Failure>;\n}\n\nexport const callAddon = <Addon extends Telemetered, Result, Failure>({\n addon,\n name,\n files,\n call,\n failWith,\n}: AddonCall<Addon, Result, Failure>): Effect.Effect<Result, Failure> =>\n addon.pipe(\n Effect.flatMap((loaded) =>\n Effect.try({ try: () => call(loaded), catch: failWith(`${name} could not lint`) }).pipe(\n Effect.tap(() => Effect.promise(() => loaded.flushTelemetry())),\n ),\n ),\n Effect.withSpan(`${name}.native`, { attributes: { [`${name}.files`]: files } }),\n );\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class NotUtf8Error extends taggedError<NotUtf8Error, { readonly brand: unique symbol }>()(\n \"NotUtf8Error\",\n { path: Schema.String },\n) {}\n\nexport type FailWith<Failure> = (message: string) => (cause: unknown) => Failure;\n","import { runMain } from \"@r_masseater/node-main\";\nimport {\n Array as Arr,\n Console,\n Effect,\n FileSystem,\n Function as Fn,\n Option,\n Path,\n Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\nimport type { PlatformError } from \"effect/PlatformError\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { NotUtf8Error } from \"#/shared/lib/fail.ts\";\nimport type { FailWith } from \"#/shared/lib/fail.ts\";\n\nconst CONFIG_FILES = [\"vite.config.ts\", \"vite.config.mts\", \"vite.config.js\", \"vite.config.mjs\"];\nconst FAILED = 1;\nconst DATA_FIRST_ARITY = 2;\nconst STRICT_UTF8 = new TextDecoder(\"utf-8\", { fatal: true });\n\nexport interface Reported {\n readonly severity: string;\n}\n\nexport interface LintCall<Config, Failure> {\n readonly root: string;\n readonly files: readonly string[];\n readonly projectFiles: readonly string[];\n readonly config: Config;\n readonly read: (file: string) => Effect.Effect<string, Failure | NotUtf8Error>;\n}\n\nexport interface PathspecRequest<Config> {\n readonly config: Config;\n readonly patterns?: readonly string[];\n}\n\nexport interface SectionSource<Config, Failure> {\n readonly name: string;\n readonly version: string;\n readonly description: string;\n readonly section: (config: unknown) => Config;\n readonly failWith: FailWith<Failure>;\n}\n\nexport interface Cli<Config, Found extends Reported, Failure> extends SectionSource<\n Config,\n Failure\n> {\n readonly pathspecs: (request: PathspecRequest<Config>) => readonly string[];\n readonly lint: (call: LintCall<Config, Failure>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\nexport interface ToolParameter {\n readonly name: string;\n readonly description: string;\n}\n\nexport interface ToolInput {\n readonly flags: ReadonlySet<string>;\n readonly args: readonly string[];\n}\n\nexport interface ToolCall<Config> {\n readonly root: string;\n readonly config: Config;\n readonly input: ToolInput;\n}\n\nexport interface Tool<Config, Found, Failure> extends SectionSource<Config, Failure> {\n readonly flags: readonly ToolParameter[];\n readonly argument: ToolParameter;\n readonly scan: (call: ToolCall<Config>) => Effect.Effect<readonly Found[], Failure>;\n readonly format: (found: Found) => string;\n}\n\ntype CliServices = FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner;\n\nconst readSectionIn = <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path> =>\n Effect.gen(function* readConfig() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const found = yield* pipe(\n CONFIG_FILES,\n Arr.map((name) => path.join(root, name)),\n Effect.filter((file) => fileSystem.exists(file).pipe(Effect.orElseSucceed(() => false))),\n );\n const loaded = yield* Option.match(Arr.head(found), {\n onNone: () => Effect.succeed<unknown>({}),\n onSome: (file) =>\n Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: source.failWith(`could not load ${file}`),\n }),\n });\n return source.section(loaded);\n }).pipe(Effect.withSpan(`${source.name}.config`));\n\n/** @internal */\nexport const readSection: {\n (\n root: string,\n ): <Config, Failure>(\n source: SectionSource<Config, Failure>,\n ) => Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n <Config, Failure>(\n source: SectionSource<Config, Failure>,\n root: string,\n ): Effect.Effect<Config, Failure, FileSystem.FileSystem | Path.Path>;\n} = Fn.dual(DATA_FIRST_ARITY, readSectionIn);\n\nconst trackedFiles = (\n root: string,\n pathspecs: readonly string[],\n): Effect.Effect<readonly string[], PlatformError, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* listFiles() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\"ls-files\", \"-co\", \"--exclude-standard\", \"-z\", \"--\", ...pathspecs],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n });\n\nconst requestOf = <Config>(config: Config, patterns: readonly string[]): PathspecRequest<Config> =>\n Arr.match(patterns, {\n onEmpty: () => ({ config }),\n onNonEmpty: (given) => ({ config, patterns: given }),\n });\n\nconst hasError = (found: readonly Reported[]): boolean =>\n pipe(\n found,\n Arr.some(({ severity }) => severity === \"error\"),\n );\n\nconst failWhen = (failed: boolean): Effect.Effect<void> =>\n Effect.when(\n Effect.sync(() => {\n process.exitCode = FAILED;\n }),\n Effect.succeed(failed),\n ).pipe(Effect.asVoid);\n\nconst printAll = <Found>(\n found: readonly Found[],\n format: (found: Found) => string,\n): Effect.Effect<void> =>\n Arr.match(found, {\n onEmpty: () => Effect.void,\n onNonEmpty: (all) => Console.log(pipe(all, Arr.map(format), Arr.join(\"\\n\"))),\n });\n\nconst readerIn = <Failure>(\n root: string,\n failWith: FailWith<Failure>,\n): Effect.Effect<\n (file: string) => Effect.Effect<string, Failure | NotUtf8Error>,\n never,\n FileSystem.FileSystem | Path.Path\n> =>\n Effect.gen(function* reader() {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return (file: string): Effect.Effect<string, Failure | NotUtf8Error> =>\n fileSystem.readFile(path.resolve(root, file)).pipe(\n Effect.mapError(failWith(`could not read ${file}`)),\n Effect.flatMap((bytes) =>\n Effect.try({\n try: () => STRICT_UTF8.decode(bytes),\n catch: () => NotUtf8Error.make({ path: file }),\n }),\n ),\n );\n });\n\nconst mainOf = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n patterns: readonly string[],\n): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(cli, root);\n const pathspecs = cli.pathspecs(requestOf(config, patterns));\n const { files, projectFiles } = yield* Effect.all(\n {\n files: trackedFiles(root, pathspecs).pipe(Effect.withSpan(`${cli.name}.files`)),\n projectFiles: trackedFiles(root, []).pipe(Effect.withSpan(`${cli.name}.project`)),\n },\n { concurrency: \"unbounded\" },\n );\n const read = yield* readerIn(root, cli.failWith);\n const found = yield* cli.lint({ root, files, projectFiles, config, read });\n yield* printAll(found, cli.format);\n yield* failWhen(hasError(found));\n });\n\nconst toolMainOf =\n <Config, Found, Failure>(tool: Tool<Config, Found, Failure>) =>\n (input: ToolInput): Effect.Effect<void, Failure | PlatformError, CliServices> =>\n Effect.gen(function* main() {\n const root = process.cwd();\n const config = yield* readSectionIn(tool, root);\n const found = yield* tool.scan({ root, config, input });\n yield* printAll(found, tool.format);\n yield* failWhen(Arr.isReadonlyArrayNonEmpty(found));\n });\n\nconst variadicOf = ({ name, description }: ToolParameter): Argument.Argument<readonly string[]> =>\n Argument.String(name).pipe(Argument.withDescription(description), Argument.variadic());\n\nconst flagsOf = (flags: readonly ToolParameter[]): Readonly<Record<string, Flag.Flag<boolean>>> =>\n Rec.fromEntries(\n pipe(\n flags,\n Arr.map(({ name, description }) => [\n name,\n Flag.Boolean(name).pipe(Flag.withDescription(description), Flag.withDefault(false)),\n ]),\n ),\n );\n\nconst setFlags = (values: Readonly<Record<string, boolean>>): ReadonlySet<string> =>\n new Set(pipe(values, Rec.filter(Fn.identity), Rec.keys));\n\nexport const runTool = <Config, Found, Failure>(tool: Tool<Config, Found, Failure>): void => {\n const command = Command.make(\n tool.name,\n { args: variadicOf(tool.argument), flags: flagsOf(tool.flags) },\n ({ args, flags }) => toolMainOf(tool)({ args, flags: setFlags(flags) }),\n ).pipe(Command.withDescription(tool.description));\n runMain(tool.name)(Command.run(command, { version: tool.version }));\n};\n\nconst pathspecArgument = (): Argument.Argument<readonly string[]> =>\n variadicOf({\n name: \"pathspec\",\n description: \"Git pathspecs of the files to lint, in place of the configured ones\",\n });\n\nexport const runCli = <Config, Found extends Reported, Failure>(\n cli: Cli<Config, Found, Failure>,\n): void => {\n const command = Command.make(cli.name, { pathspecs: pathspecArgument() }, ({ pathspecs }) =>\n mainOf(cli, pathspecs),\n ).pipe(Command.withDescription(cli.description));\n runMain(cli.name)(Command.run(command, { version: cli.version }));\n};\n","import { Function as Fn, Option } from \"effect\";\n\nconst DATA_FIRST_ARITY = 2;\n\nexport const present: {\n <Value, Fields extends object>(\n build: (value: Value) => Fields,\n ): (value: Option.Option<Value>) => Partial<Fields>;\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Value, Fields extends object>(\n value: Option.Option<Value>,\n build: (value: Value) => Fields,\n ): Partial<Fields> => Option.match(value, { onNone: (): Partial<Fields> => ({}), onSome: build }),\n);\n","import { Array as Arr, Boolean as Bool, Effect, Order } from \"effect\";\nimport type { Option } from \"effect\";\n\nconst SAMPLED = \"01\";\nconst NOT_SAMPLED = \"00\";\n\nexport interface Positioned {\n readonly path: string;\n readonly line: number;\n readonly column?: number;\n}\n\nconst LINE_START = 0;\n\nconst flagsOf = (sampled: boolean): string =>\n Bool.match(sampled, { onFalse: () => NOT_SAMPLED, onTrue: () => SAMPLED });\n\nexport const traceparent: Effect.Effect<Option.Option<string>> = Effect.currentSpan.pipe(\n Effect.map((span) => `00-${span.traceId}-${span.spanId}-${flagsOf(span.sampled)}`),\n Effect.option,\n);\n\nconst byPosition: Order.Order<Positioned> = Order.combine(\n Order.mapInput(Order.String, (found: Positioned) => found.path),\n Order.combine(\n Order.mapInput(Order.Number, (found: Positioned) => found.line),\n Order.mapInput(Order.Number, (found: Positioned) => found.column ?? LINE_START),\n ),\n);\n\nexport const sortByPosition = <Found extends Positioned>(found: readonly Found[]): Found[] =>\n Arr.sort(found, byPosition);\n","import { Option, Record as Rec, pipe } from \"effect\";\n\nexport const WORD = 4;\nexport const STRING_WORDS = 2;\nconst EMPTY = 0;\nconst LENGTH = 1;\n\nexport const aligned = (buffer: Uint8Array): Uint8Array =>\n Option.match(\n Option.liftPredicate(buffer, ({ byteOffset }) => byteOffset % WORD === EMPTY),\n {\n onNone: () => Uint8Array.from(buffer),\n onSome: (value) => value,\n },\n );\n\nexport const wordAt =\n (words: Uint32Array) =>\n (index: number): number =>\n words[index] ?? EMPTY;\n\nexport const fieldsOf =\n (header: Uint32Array) =>\n <Name extends string>(fields: Readonly<Record<Name, number>>): Readonly<Record<Name, number>> =>\n pipe(\n fields,\n Rec.map((index) => wordAt(header)(index)),\n );\n\nexport const wordsOf =\n (buffer: Uint8Array) =>\n (at: number, count: number): Uint32Array =>\n new Uint32Array(buffer.buffer, buffer.byteOffset + at * WORD, count);\n\nexport const spanText =\n (words: Uint32Array) =>\n (blob: Uint8Array, encoding: string) =>\n (spansAt: number, unit: number): ((index: number) => string) => {\n const decoder = new TextDecoder(encoding);\n const cache = new Map<number, string>();\n const read = (index: number): string => {\n const at = spansAt + index * STRING_WORDS;\n const offset = wordAt(words)(at) * unit;\n const value = decoder.decode(\n blob.subarray(offset, offset + wordAt(words)(at + LENGTH) * unit),\n );\n cache.set(index, value);\n return value;\n };\n return (index) => Option.getOrElse(Option.fromNullishOr(cache.get(index)), () => read(index));\n };\n","import { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Reportable {\n readonly path: string;\n readonly line: number;\n readonly column?: number | undefined;\n readonly rule: string;\n readonly message: string;\n readonly detail?: string | undefined;\n readonly context?: string | undefined;\n readonly severity: string;\n}\n\nexport const diagnosticDetail = (diagnostic: Reportable): string =>\n pipe(\n [diagnostic.detail, diagnostic.context],\n Arr.flatMap((part) => Option.toArray(Option.fromNullishOr(part))),\n Arr.filter((part) => part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n\nexport const formatDiagnostic = (diagnostic: Reportable): string => {\n const column = pipe(\n Option.fromNullishOr(diagnostic.column),\n Option.map((value) => `:${String(value)}`),\n Option.getOrElse(() => \"\"),\n );\n return `${diagnostic.path}:${String(diagnostic.line)}${column} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}${diagnosticDetail(diagnostic)}`;\n};\n\nexport interface NotUtf8 {\n readonly path: string;\n readonly line: number;\n readonly column: number;\n readonly rule: string;\n readonly message: string;\n readonly severity: \"error\";\n}\n\nexport const notUtf8 =\n (tool: string) =>\n (path: string): NotUtf8 => ({\n path,\n line: 1,\n column: 1,\n rule: \"utf8\",\n message: `The file is not valid UTF-8, so ${tool} cannot read it`,\n severity: \"error\",\n });\n","import { Array as Arr, Function as Fn, Option, Predicate, pipe } from \"effect\";\n\nexport interface SectionRequest<Config extends object> {\n readonly name: string;\n readonly fallback: Config;\n readonly prepare?: (section: Config) => Config;\n}\n\nexport const sectionOf = <Config extends object>({\n name,\n fallback,\n prepare = Fn.identity,\n}: SectionRequest<Config>): ((config: unknown) => Config) => {\n const hasSection = (value: unknown): value is Readonly<Record<string, Config>> =>\n Predicate.hasProperty(value, name) && Predicate.isObject(value[name]);\n return (config) =>\n pipe(\n Option.liftPredicate(config, hasSection),\n Option.flatMapNullishOr((value) => value[name]),\n Option.map(prepare),\n Option.getOrElse(() => fallback),\n );\n};\n\nexport interface Ignoring {\n readonly ignores?: readonly string[] | undefined;\n}\n\nexport interface Pathspecs {\n readonly defaults: readonly string[];\n readonly unowned?: readonly string[];\n}\n\nexport const pathspecsOf =\n ({ defaults, unowned = [] }: Pathspecs) =>\n ({\n config,\n patterns = [],\n }: {\n readonly config: Ignoring;\n readonly patterns?: readonly string[];\n }): readonly string[] => [\n ...Arr.match(patterns, { onEmpty: () => defaults, onNonEmpty: Fn.identity }),\n ...unowned,\n ...pipe(\n config.ignores ?? [],\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n ];\n","import { settingOf } from \"@masseater.dev/lint-host\";\nimport type { Setting } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport type { Plugin, Rule, RuleEntry, WismConfig } from \"#/shared/config/index.ts\";\n\nconst SEPARATOR = \"/\";\nconst NAME_START = 1;\n\nexport interface ScriptRule {\n readonly id: string;\n readonly rule: Rule;\n readonly setting: Setting;\n}\n\nconst isPluginRule = (id: string): boolean => Str.includes(SEPARATOR)(id);\n\nconst pluginOf = (id: string): string => Arr.headNonEmpty(Str.split(id, SEPARATOR));\n\nconst nameOf = (id: string): string =>\n pipe(Str.split(id, SEPARATOR), Arr.drop(NAME_START), Arr.join(SEPARATOR));\n\nconst scriptOf =\n (plugins: Readonly<Record<string, Plugin>>) =>\n ([id, entry]: readonly [string, RuleEntry]): Option.Option<ScriptRule> =>\n pipe(\n Rec.get(plugins, pluginOf(id)),\n Option.flatMap((plugin) => Rec.get(plugin.rules ?? {}, nameOf(id))),\n Option.map((rule): ScriptRule => ({ id, rule, setting: settingOf(entry) })),\n Option.filter(({ setting }) => setting.severity !== \"off\"),\n );\n\nexport const resolve = (config: WismConfig): readonly ScriptRule[] =>\n pipe(\n Rec.toEntries(config.rules ?? {}),\n Arr.filter(([id]) => isPluginRule(id)),\n Arr.map(scriptOf(config.plugins ?? {})),\n Arr.getSomes,\n );\n\nexport const unknownRules = (config: WismConfig): readonly string[] => {\n const plugins = config.plugins ?? {};\n return pipe(\n Rec.keys(config.rules ?? {}),\n Arr.filter(\n (id) =>\n !isPluginRule(id) ||\n pipe(\n Rec.get(plugins, pluginOf(id)),\n Option.flatMap((plugin) => Rec.get(plugin.rules ?? {}, nameOf(id))),\n Option.isNone,\n ),\n ),\n );\n};\n","import type { Diagnostic } from \"#/shared/config/index.ts\";\n\nexport const format = (diagnostic: Diagnostic): string =>\n `${diagnostic.path}:${String(diagnostic.line)}:${String(diagnostic.column)} ${diagnostic.severity} ${diagnostic.rule} ${diagnostic.message}`;\n","import { Array as Arr, Match, Option, pipe } from \"effect\";\n\nimport type { ScriptRule } from \"#/entities/rule/index.ts\";\nimport type { Diagnostic, GraphEdge, Report } from \"#/shared/config/index.ts\";\n\nconst FIRST = 1;\n\nexport interface Graph {\n readonly files: readonly string[];\n readonly root: string;\n readonly edges: readonly GraphEdge[];\n}\n\nconst severityOf = (rule: ScriptRule): Diagnostic[\"severity\"] =>\n Match.value(rule.setting.severity).pipe(\n Match.when(\"warn\", () => \"warn\" as const),\n Match.orElse(() => \"error\" as const),\n );\n\nconst diagnosticOf =\n (rule: ScriptRule) =>\n (report: Report): Diagnostic => ({\n path: report.path,\n line: Option.getOrElse(Option.fromNullishOr(report.line), () => FIRST),\n column: Option.getOrElse(Option.fromNullishOr(report.column), () => FIRST),\n rule: rule.id,\n message: report.message,\n severity: severityOf(rule),\n });\n\nconst runOne =\n (graph: Graph) =>\n (rule: ScriptRule): readonly Diagnostic[] => {\n const reports: Report[] = [];\n rule.rule.check({\n ...graph,\n options: rule.setting.options,\n report: (report) => {\n reports.push(report);\n },\n });\n return pipe(reports, Arr.map(diagnosticOf(rule)));\n };\n\nexport const runScriptRules =\n (rules: readonly ScriptRule[]) =>\n (graph: Graph): readonly Diagnostic[] =>\n pipe(rules, Arr.flatMap(runOne(graph)));\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class WismError extends taggedError<WismError, { readonly brand: unique symbol }>()(\n \"WismError\",\n {\n message: Schema.String,\n },\n) {}\n\nexport const failedWith =\n (message: string) =>\n (cause: unknown): WismError =>\n WismError.make({ message: `${message}: ${String(cause)}` });\n","import { STRING_WORDS, WORD, spanText, wordAt } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport type { GraphEdge, ImportTarget } from \"#/shared/config/index.ts\";\n\nconst HEADER_WORDS = 4;\nconst EDGE_WORDS = 7;\nconst UTF8 = \"utf8\";\nconst BYTE = 1;\nconst HEADER = { edges: 0, strings: 1, blob: 2, notUtf8: 3 } as const;\nconst FIELD = {\n from: 0,\n kind: 1,\n target: 2,\n specifier: 3,\n line: 4,\n column: 5,\n wildcard: 6,\n} as const;\nconst MODULE = 1;\nconst WILDCARD = 1;\nconst MODULE_SEPARATOR = \"::\";\n\nconst spansStart = (words: Uint32Array): number =>\n HEADER_WORDS + wordAt(words)(HEADER.edges) * EDGE_WORDS;\n\nconst stringsOf = (words: Uint32Array): ((index: number) => string) => {\n const spans = spansStart(words);\n const blob = new Uint8Array(\n words.buffer,\n words.byteOffset + (spans + wordAt(words)(HEADER.strings) * STRING_WORDS) * WORD,\n );\n return spanText(words)(blob, UTF8)(spans, BYTE);\n};\n\nconst targetOf = (kind: number, value: string): ImportTarget => {\n if (kind === MODULE) {\n return { type: \"module\", value: Str.split(value, MODULE_SEPARATOR) };\n }\n return { type: \"file\", value };\n};\n\nexport const decodeGraph =\n (files: readonly string[]) =>\n (words: Uint32Array): readonly GraphEdge[] => {\n const text = stringsOf(words);\n const field = (base: number, name: keyof typeof FIELD): number =>\n wordAt(words)(base + FIELD[name]);\n const count = wordAt(words)(HEADER.edges);\n return pipe(\n Arr.makeBy(count, (index) => HEADER_WORDS + index * EDGE_WORDS),\n Arr.take(count),\n Arr.map((base): GraphEdge => ({\n from: Option.getOrElse(Arr.get(files, field(base, \"from\")), () => \"\"),\n specifier: text(field(base, \"specifier\")),\n target: targetOf(field(base, \"kind\"), text(field(base, \"target\"))),\n line: field(base, \"line\"),\n column: field(base, \"column\"),\n wildcard: field(base, \"wildcard\") === WILDCARD,\n })),\n );\n };\n\nexport const decodeNotUtf8 =\n (files: readonly string[]) =>\n (words: Uint32Array): readonly string[] => {\n const start =\n spansStart(words) +\n wordAt(words)(HEADER.strings) * STRING_WORDS +\n Math.ceil(wordAt(words)(HEADER.blob) / WORD);\n const count = wordAt(words)(HEADER.notUtf8);\n return pipe(\n Arr.makeBy(count, (index) => wordAt(words)(start + index)),\n Arr.take(count),\n Arr.flatMap((position) => Option.toArray(Arr.get(files, position))),\n );\n };\n","import { loadAddon } from \"@masseater.dev/lint-host\";\nimport { Predicate } from \"effect\";\nimport type { Effect } from \"effect\";\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\nimport type { WismError } from \"#/shared/lib/errors.ts\";\n\nexport interface NativeOptions {\n readonly traceparent?: string;\n}\n\nexport interface Native {\n readonly collect: (root: string, files: readonly string[], options: NativeOptions) => Uint32Array;\n readonly flushTelemetry: () => Promise<void>;\n}\n\nconst isNative = (value: unknown): value is Native =>\n Predicate.hasProperty(value, \"collect\") &&\n Predicate.isFunction(value.collect) &&\n Predicate.hasProperty(value, \"flushTelemetry\") &&\n Predicate.isFunction(value.flushTelemetry);\n\nexport const native: Effect.Effect<Native, WismError> = loadAddon({\n packageName: \"@r_masseater/wism\",\n binary: \"wism\",\n from: import.meta.url,\n isAddon: isNative,\n failWith: failedWith,\n});\nexport { decodeGraph, decodeNotUtf8 } from \"./graph.ts\";\n","import { callAddon, notUtf8, present, sortByPosition, traceparent } from \"@masseater.dev/lint-host\";\nimport { Array as Arr, Effect, pipe } from \"effect\";\n\nimport { resolve, unknownRules } from \"#/entities/rule/index.ts\";\nimport { runScriptRules } from \"#/features/run-rules/index.ts\";\nimport type { Diagnostic, WismConfig } from \"#/shared/config/index.ts\";\nimport { WismError, failedWith } from \"#/shared/lib/errors.ts\";\nimport { decodeGraph, decodeNotUtf8, native } from \"#/shared/native/index.ts\";\nimport type { NativeOptions } from \"#/shared/native/index.ts\";\n\nexport interface LintInput {\n readonly root: string;\n readonly files: readonly string[];\n readonly config?: WismConfig;\n}\n\nconst checkRules = (config: WismConfig): Effect.Effect<void, WismError> =>\n Arr.match(unknownRules(config), {\n onEmpty: () => Effect.void,\n onNonEmpty: (names) =>\n Effect.fail(\n WismError.make({\n message: `rules that no configured plugin defines: ${Arr.join(names, \", \")}. Name each rule plugin/rule.`,\n }),\n ),\n });\n\nconst collectEdges = Effect.fn(\"wism.collect_edges\")(function* collectEdges(input: LintInput) {\n const parent = yield* traceparent;\n const options: NativeOptions = present(parent, (value) => ({ traceparent: value }));\n const words = yield* callAddon({\n addon: native,\n name: \"wism\",\n files: input.files.length,\n call: (addon) => addon.collect(input.root, input.files, options),\n failWith: failedWith,\n });\n return yield* Effect.sync(() => ({\n edges: decodeGraph(input.files)(words),\n unreadable: decodeNotUtf8(input.files)(words),\n })).pipe(Effect.withSpan(\"wism.decode\"));\n});\n\nexport const lint = Effect.fn(\"wism.lint\")(function* lint(input: LintInput) {\n const config = input.config ?? {};\n yield* checkRules(config);\n const rules = resolve(config);\n if (Arr.isReadonlyArrayEmpty(rules)) {\n return [];\n }\n const { edges, unreadable } = yield* collectEdges(input);\n const found = yield* Effect.sync(() =>\n runScriptRules(rules)({ root: input.root, files: input.files, edges }),\n ).pipe(Effect.withSpan(\"wism.script_rules\", { attributes: { \"wism.edges\": edges.length } }));\n const unread = pipe(unreadable, Arr.map(notUtf8(\"wism\")));\n return sortByPosition<Diagnostic>([...found, ...unread]);\n});\n","import { pathspecsOf, sectionOf } from \"@masseater.dev/lint-host\";\n\nimport type { WismConfig } from \"#/shared/config/index.ts\";\n\nexport const wismSection = sectionOf<WismConfig>({ name: \"wism\", fallback: {} });\n\nexport const wismPathspecs = pathspecsOf({\n defaults: [\".\"],\n unowned: [\n \":(exclude,attr:linguist-vendored)\",\n \":(exclude,attr:linguist-generated)\",\n \":(exclude,attr:linguist-documentation)\",\n ],\n});\n"],"mappings":";;;;;;;AAaA,MAAM,aAA0B,CAAC;AAEjC,MAAa,aAAa,UACxB,MAAM,MAAM,KAAK,CAAC,CAAC,KACjB,MAAM,KAAK,MAAM,SAAS,cAAuB;CAAE;CAAU,SAAS;AAAW,EAAE,GACnF,MAAM,QAAQ,CAAC,UAAU,cAAuB;CAC9C;CACA,SAAS,WAAW;AACtB,EAAE,CACJ;;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AAO;EAC/D,UAAU;CACZ,CAAC;CACD,OAAO,OAAO,OAAO,YAAY;EAC/B,OAAO,YAAY,MAAM,KAAK,CAAC,CAAC,KAAK;EACrC,YAAY,cAAc,MAAM,KAAK,CAAC,CAAC,KAAK;CAC9C,EAAE,CAAC,CAAC,KAAK,OAAO,SAAS,aAAa,CAAC;AACzC,CAAC;AAED,MAAa,OAAO,OAAO,GAAG,WAAW,CAAC,CAAC,UAAU,KAAK,OAAkB;CAC1E,MAAM,SAAS,MAAM,UAAU,CAAC;CAChC,OAAO,WAAW,MAAM;CACxB,MAAM,QAAQ,QAAQ,MAAM;CAC5B,IAAIA,MAAI,qBAAqB,KAAK,GAChC,OAAO,CAAC;CAEV,MAAM,EAAE,OAAO,eAAe,OAAO,aAAa,KAAK;CACvD,MAAM,QAAQ,OAAO,OAAO,WAC1B,eAAe,KAAK,CAAC,CAAC;EAAE,MAAM,MAAM;EAAM,OAAO,MAAM;EAAO;CAAM,CAAC,CACvE,CAAC,CAAC,KAAK,OAAO,SAAS,qBAAqB,EAAE,YAAY,EAAE,cAAc,MAAM,OAAO,EAAE,CAAC,CAAC;CAC3F,MAAM,SAAS,KAAK,YAAYA,MAAI,IAAI,QAAQ,MAAM,CAAC,CAAC;CACxD,OAAO,eAA2B,CAAC,GAAG,OAAO,GAAG,MAAM,CAAC;AACzD,CAAC;;ACpDD,MAAa,cAAc,UAAsB;CAAE,MAAM;CAAQ,UAAU,CAAC;AAAE,CAAC;AAE/E,MAAa,gBAAgB,YAAY;CACvC,UAAU,CAAC,GAAG;CACd,SAAS;EACP;EACA;EACA;CACF;AACF,CAAC"}
|
package/dist/cli-Dou7Gs_O.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { a as failedWith, n as wismSection, o as format, r as lint, s as runCli$1, t as wismPathspecs } from "./app-DtBrrYjC.mjs";
|
|
2
|
-
// package.json
|
|
3
|
-
var version = "0.4.3";
|
|
4
|
-
var description = "A structure and dependency linter for TypeScript, Rust and Markdown, written in Rust and configured from vite.config.ts: directory kinds chosen by marker files, allowed layouts, FSD layers and import rules.";
|
|
5
|
-
// src/app/cli.ts
|
|
6
|
-
const runCli = () => {
|
|
7
|
-
runCli$1({
|
|
8
|
-
name: "wism",
|
|
9
|
-
version,
|
|
10
|
-
description,
|
|
11
|
-
section: wismSection,
|
|
12
|
-
pathspecs: wismPathspecs,
|
|
13
|
-
lint,
|
|
14
|
-
format,
|
|
15
|
-
failWith: failedWith
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export { runCli };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=cli-Dou7Gs_O.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-Dou7Gs_O.mjs","names":["manifest.version","manifest.description"],"sources":["../package.json","../src/app/cli.ts"],"sourcesContent":["","import { runCli as runLinter } from \"@masseater.dev/lint-host\";\nimport manifest from \"@r_masseater/wism/package.json\" with { type: \"json\" };\n\nimport { failedWith } from \"#/shared/lib/errors.ts\";\n\nimport { format, lint } from \"./index.ts\";\nimport { wismPathspecs, wismSection } from \"./section.ts\";\n\nexport const runCli = (): void => {\n runLinter({\n name: \"wism\",\n version: manifest.version,\n description: manifest.description,\n section: wismSection,\n pathspecs: wismPathspecs,\n lint,\n format,\n failWith: failedWith,\n });\n};\n"],"mappings":";;;;;ACQA,MAAa,eAAqB;CAChC,SAAU;EACR,MAAM;EACGA;EACIC;EACb,SAAS;EACT,WAAW;EACX;EACA;EACA,UAAU;CACZ,CAAC;AACH"}
|