@r_masseater/vite-plus-adopt 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -140,6 +140,7 @@ TypeScript 5 をこのリポの依存に入れないため、作る仕組みは
140
140
  | fallow | `fallow` セクション | セクションを一時ファイルに書いて `-c` で渡し、使う側の `fallow` で全体・`dead-code --no-production`・`dupes`・`security` を検査し、コンポーネントの props の受け渡しの指摘も失敗にする |
141
141
 
142
142
  基準のコミットは環境変数 `VPA_BASE` で渡す。無いときや解決できないときは `origin/main` を使う。
143
+ CI の浅い clone や partial clone のように履歴を持たないときは、Betterleaks は `HEAD` のツリーを丸ごと検査する。
143
144
  `vpa --staged` は `git diff --cached` を Betterleaks に渡し、`vpa --commit-msg <ファイル>` はそのコミットメッセージを `commitlint` セクションで検査する。`#` で始まる行は読まない。
144
145
  postinstall が動いていないと、Betterleaks・actionlint・zizmor の検査は `allowBuilds` に足すよう告げて失敗する。
145
146
  バイナリのバージョンは `src/binaries.ts` で固定し、vite-plus-adopt のバージョンを上げて変える。
package/dist/cli.mjs CHANGED
@@ -46,7 +46,7 @@ const lintCommitMessageFile = Function.dual(DATA_FIRST_ARITY_3$3, (config, root,
46
46
  return yield* lintCommitMessages(config, root, [message]);
47
47
  }));
48
48
  // src/process.ts
49
- const SUCCESS = 0;
49
+ const SUCCESS$1 = 0;
50
50
  const stdinOf = (input) => pipe(Option.fromNullishOr(input), Option.match({
51
51
  onNone: () => "ignore",
52
52
  onSome: (text) => Stream.make(new TextEncoder().encode(text))
@@ -60,7 +60,7 @@ const runCaptured = ({ root, file, args, env = {}, input, output = "all" }) => E
60
60
  }));
61
61
  const [text, exitCode] = yield* Effect.all([handle[output].pipe(Stream.decodeText, Stream.mkString), handle.exitCode], { concurrency: "unbounded" });
62
62
  return {
63
- valid: exitCode === SUCCESS,
63
+ valid: exitCode === SUCCESS$1,
64
64
  output: text
65
65
  };
66
66
  }).pipe(Effect.scoped);
@@ -324,15 +324,58 @@ const scanSecrets = ({ config, root, args, input }) => Effect.gen(function* scan
324
324
  input
325
325
  });
326
326
  }).pipe(Effect.scoped);
327
- const betterleaksCheck = withSection("betterleaks", (config, { root, base }) => scanSecrets({
328
- config,
329
- root,
330
- args: [
331
- "git",
332
- ".",
333
- `--revision=${base}..HEAD`
334
- ]
327
+ const SUCCESS = 0;
328
+ const lacksHistory = (root) => Effect.gen(function* history() {
329
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
330
+ const shallow = yield* spawner.string(ChildProcess.make("git", ["rev-parse", "--is-shallow-repository"], { cwd: root }));
331
+ const promisor = yield* spawner.exitCode(ChildProcess.make("git", [
332
+ "config",
333
+ "--get",
334
+ "remote.origin.promisor"
335
+ ], { cwd: root }));
336
+ return String.trim(shallow) === "true" || promisor === SUCCESS;
337
+ });
338
+ const succeeded = (tool, run) => run.pipe(Effect.flatMap((code) => {
339
+ if (code === SUCCESS) return Effect.void;
340
+ return Effect.fail(toolFailed(tool)(`exit code ${code}`));
335
341
  }));
342
+ const scanCommittedTree = (config, root) => Effect.gen(function* tree() {
343
+ const fs = yield* FileSystem.FileSystem;
344
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
345
+ const directory = yield* fs.makeTempDirectoryScoped({ prefix: "vpa-betterleaks-" });
346
+ const archive = `${directory}.tar`;
347
+ yield* succeeded("git archive", spawner.exitCode(ChildProcess.make("git", [
348
+ "archive",
349
+ "--format=tar",
350
+ "-o",
351
+ archive,
352
+ "HEAD"
353
+ ], { cwd: root })));
354
+ yield* succeeded("tar", spawner.exitCode(ChildProcess.make("tar", [
355
+ "-xf",
356
+ archive,
357
+ "-C",
358
+ directory
359
+ ])));
360
+ yield* fs.remove(archive);
361
+ return yield* scanSecrets({
362
+ config,
363
+ root,
364
+ args: [directory]
365
+ });
366
+ }).pipe(Effect.scoped);
367
+ const betterleaksCheck = withSection("betterleaks", (config, { root, base }) => lacksHistory(root).pipe(Effect.flatMap((partial) => {
368
+ if (partial) return scanCommittedTree(config, root);
369
+ return scanSecrets({
370
+ config,
371
+ root,
372
+ args: [
373
+ "git",
374
+ ".",
375
+ `--revision=${base}..HEAD`
376
+ ]
377
+ });
378
+ })));
336
379
  const STAGED_DIFF = [
337
380
  "diff",
338
381
  "--cached",
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":["DATA_FIRST_ARITY_3","Fn","Arr","Fn","Arr","DATA_FIRST_ARITY","Arr","Rec","describe","Str","Fn","DATA_FIRST_ARITY","Fn","Str","Arr","DATA_FIRST_ARITY_3","Arr","Fn","Str","Arr","Rec","Str","Arr","Arr","Fn","DATA_FIRST_ARITY","Fn","DATA_FIRST_ARITY_3","Arr","Fn","lint","Rec","Fn","Arr","Arr","Arr","Arr","Fn","Rec"],"sources":["../src/commitlint.ts","../src/process.ts","../src/section-check.ts","../src/fallow-check.ts","../src/dependency-rules.ts","../src/git.ts","../src/steiger.ts","../src/workspace.ts","../src/repository-checks.ts","../src/betterleaks.ts","../src/vendored.ts","../src/secret-checks.ts","../src/markdownlint.ts","../src/textlint.ts","../src/text-checks.ts","../src/workflow-checks.ts","../src/checks.ts","../src/run-checks.ts","../src/vpa.ts","../src/cli.ts"],"sourcesContent":["import format from \"@commitlint/format\";\nimport lint from \"@commitlint/lint\";\nimport load from \"@commitlint/load\";\nimport type { LintOptions, QualifiedConfig } from \"@commitlint/types\";\nimport { Array as Arr, Effect, FileSystem, Option, Predicate, pipe, Function as Fn } from \"effect\";\nimport type { PlatformError } from \"effect\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { CommitlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst COMMENT_CHAR = \"#\";\n\nconst parserOptionsOf = (loaded: QualifiedConfig): NonNullable<LintOptions[\"parserOpts\"]> => {\n const preset = pipe(\n Option.fromNullishOr(loaded.parserPreset),\n Option.map(({ parserOpts }) => parserOpts),\n Option.filter(Predicate.isObject),\n Option.getOrElse(() => ({})),\n );\n return { ...preset, commentChar: COMMENT_CHAR };\n};\n\nconst lintOptionsOf = (loaded: QualifiedConfig): LintOptions => ({\n parserOpts: parserOptionsOf(loaded),\n plugins: loaded.plugins,\n ignores: loaded.ignores ?? [],\n defaultIgnores: loaded.defaultIgnores ?? true,\n});\n\nconst lintCommitMessages: {\n (\n root: string,\n messages: readonly string[],\n ): (config: CommitlintConfig) => Effect.Effect<Report, VpToolsError>;\n (\n config: CommitlintConfig,\n root: string,\n messages: readonly string[],\n ): Effect.Effect<Report, VpToolsError>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: CommitlintConfig,\n root: string,\n messages: readonly string[],\n ): Effect.Effect<Report, VpToolsError> =>\n Effect.gen(function* lintMessages() {\n const loaded = yield* attempt(\"commitlint\")(() => load(config, { cwd: root }));\n const results = yield* pipe(\n messages,\n Effect.forEach((message) =>\n attempt(\"commitlint\")(() => lint(message, loaded.rules, lintOptionsOf(loaded))),\n ),\n );\n return {\n valid: pipe(\n results,\n Arr.every((result) => result.valid),\n ),\n output: format({ results }, { color: false }),\n };\n }),\n);\n\nconst lintCommitMessageFile: {\n (\n root: string,\n messageFile: string,\n ): (\n config: CommitlintConfig,\n ) => Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem>;\n (\n config: CommitlintConfig,\n root: string,\n messageFile: string,\n ): Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: CommitlintConfig,\n root: string,\n messageFile: string,\n ): Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem> =>\n Effect.gen(function* read() {\n const fs = yield* FileSystem.FileSystem;\n const message = yield* fs.readFileString(messageFile);\n return yield* lintCommitMessages(config, root, [message]);\n }),\n);\n\n/** @internal */\nexport { lintCommitMessageFile, lintCommitMessages };\n","import { Effect, Option, Stream, pipe } from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport type { Report } from \"./report.ts\";\n\nconst SUCCESS = 0;\n\ninterface Invocation {\n readonly root: string;\n readonly file: string;\n readonly args: readonly string[];\n readonly env?: Readonly<Record<string, string>>;\n readonly input?: string | undefined;\n readonly output?: \"all\" | \"stdout\";\n}\n\nconst stdinOf = (input: string | undefined): ChildProcess.CommandInput =>\n pipe(\n Option.fromNullishOr(input),\n Option.match({\n onNone: (): ChildProcess.CommandInput => \"ignore\",\n onSome: (text) => Stream.make(new TextEncoder().encode(text)),\n }),\n );\n\nconst runCaptured = ({\n root,\n file,\n args,\n env = {},\n input,\n output = \"all\",\n}: Invocation): Effect.Effect<\n Report,\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n> =>\n Effect.gen(function* run() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const handle = yield* spawner.spawn(\n ChildProcess.make(file, args, { cwd: root, env, extendEnv: true, stdin: stdinOf(input) }),\n );\n const [text, exitCode] = yield* Effect.all(\n [handle[output].pipe(Stream.decodeText, Stream.mkString), handle.exitCode],\n { concurrency: \"unbounded\" },\n );\n return { valid: exitCode === SUCCESS, output: text };\n }).pipe(Effect.scoped);\n\n/** @internal */\nexport { runCaptured };\n/** @internal */\nexport type { Invocation };\n","import { Effect, Function as Fn, Option, pipe } from \"effect\";\n\nimport type { Check, CheckContext, CheckError, CheckServices } from \"./check.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { ToolSection, ToolSections } from \"./types.ts\";\n\ntype SectionRun<Key extends ToolSection> = (\n section: NonNullable<ToolSections[Key]>,\n context: CheckContext,\n) => Effect.Effect<Report, CheckError, CheckServices>;\n\nconst DATA_FIRST_ARITY = 2;\n\nconst withSection: {\n <Key extends ToolSection>(run: SectionRun<Key>): (key: Key) => Check;\n <Key extends ToolSection>(key: Key, run: SectionRun<Key>): Check;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Key extends ToolSection>(key: Key, run: SectionRun<Key>): Check =>\n (context) =>\n pipe(\n Option.fromNullishOr(context.config[key]),\n Option.match({\n onNone: () => Effect.succeedNone,\n onSome: (section) => Effect.asSome(run(section, context)),\n }),\n ),\n);\n\n/** @internal */\nexport { withSection };\n/** @internal */\nexport type { SectionRun };\n","import { Effect, FileSystem, Path, Schema, Array as Arr, pipe } from \"effect\";\n\nimport type { CheckError, CheckServices } from \"./check.ts\";\nimport { toJson } from \"./json.ts\";\nimport { runCaptured } from \"./process.ts\";\nimport type { Report } from \"./report.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport type { FallowConfig } from \"./types.ts\";\n\nconst QUIET = [\"--fail-on-issues\", \"--quiet\", \"--format\", \"compact\"];\n\nconst RUNS: readonly (readonly string[])[] = [\n [\"--skip\", \"dupes\", ...QUIET],\n [\"dead-code\", \"--no-production\", ...QUIET],\n [\"dupes\", ...QUIET],\n [\"security\", \"--fail-on-issues\", \"--quiet\"],\n];\n\nconst SMELLS = Schema.Array(Schema.Unknown).pipe(Schema.withDecodingDefaultKey(Effect.succeed([])));\n\nconst COMPONENT_SMELLS = Schema.Struct({\n prop_drilling_chains: SMELLS,\n thin_wrappers: SMELLS,\n duplicate_prop_shapes: SMELLS,\n});\n\nconst decodeSmells = Schema.decodeUnknownEffect(Schema.fromJsonString(COMPONENT_SMELLS));\n\nconst componentSmells = (\n root: string,\n configFile: string,\n): Effect.Effect<Report, CheckError, CheckServices> =>\n runCaptured({\n root,\n file: \"fallow\",\n args: [\"dead-code\", \"--no-production\", \"--quiet\", \"--format\", \"json\", \"-c\", configFile],\n output: \"stdout\",\n }).pipe(\n Effect.flatMap((report) => decodeSmells(report.output)),\n Effect.map((smells) => {\n const found = [\n ...smells.prop_drilling_chains,\n ...smells.thin_wrappers,\n ...smells.duplicate_prop_shapes,\n ];\n return {\n valid: Arr.isReadonlyArrayEmpty(found),\n output: toJson(smells),\n };\n }),\n );\n\nconst runFallow = (\n config: FallowConfig,\n root: string,\n): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* fallow() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const directory = yield* fs.makeTempDirectoryScoped({ prefix: \"vpa-fallow-\" });\n const configFile = path.join(directory, \".fallowrc.json\");\n const configText = yield* Schema.encodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(\n config,\n ).pipe(Effect.orDie);\n yield* fs.writeFileString(configFile, configText);\n const reports = yield* pipe(\n RUNS,\n Effect.forEach((args) =>\n runCaptured({ root, file: \"fallow\", args: [...args, \"-c\", configFile] }),\n ),\n );\n const smells = yield* componentSmells(root, configFile);\n const all = [...reports, smells];\n return {\n valid: pipe(\n all,\n Arr.every((report) => report.valid),\n ),\n output: pipe(\n all,\n Arr.filter((report) => !report.valid),\n Arr.map((report) => report.output),\n Arr.join(\"\\n\"),\n ),\n };\n }).pipe(Effect.scoped);\n\nconst fallowCheck = withSection(\"fallow\", (config, { root }) => runFallow(config, root));\n\n/** @internal */\nexport { fallowCheck };\n","import {\n Array as Arr,\n Option,\n Predicate,\n Record as Rec,\n String as Str,\n pipe,\n Function as Fn,\n} from \"effect\";\nimport { minimatch } from \"minimatch\";\nimport { intersects, valid, validRange } from \"semver\";\n\nimport type { AllowedDependencies, DependencyRules } from \"./types.ts\";\nimport type { Dependency } from \"./workspace.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst SINGLE = 1;\n\nconst bannedBy =\n (dependencies: readonly Dependency[]) =>\n ([reason, globs]: readonly [string, readonly string[]]): readonly string[] => {\n const isBanned = (name: string): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(name, glob)),\n );\n return pipe(\n dependencies,\n Arr.filter((dependency) => isBanned(dependency.name)),\n Arr.map(\n (dependency) =>\n `${dependency.manifest} ${dependency.field}.${dependency.name} is banned: ${reason}`,\n ),\n );\n };\n\nconst MANIFEST = \"package.json\";\n\nconst matchesAny =\n (globs: readonly string[]) =>\n (value: string): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(value, glob)),\n );\n\nconst inWorkspace =\n (globs: readonly string[]) =>\n (dependency: Dependency): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(dependency.manifest, `${glob}/${MANIFEST}`)),\n );\n\nconst inFields =\n (fields: AllowedDependencies[\"fields\"]) =>\n (dependency: Dependency): boolean =>\n pipe(\n Option.fromNullishOr(fields),\n Option.match({\n onNone: () => true,\n onSome: (names) => Arr.contains(names, dependency.field),\n }),\n );\n\nconst allowedBy =\n (dependency: Dependency) =>\n ({ workspaces, dependencies, fields }: AllowedDependencies): boolean =>\n inWorkspace(workspaces)(dependency) &&\n matchesAny(dependencies)(dependency.name) &&\n inFields(fields)(dependency);\n\nconst isAllowed =\n (rules: DependencyRules) =>\n (dependency: Dependency): boolean =>\n pipe(Rec.values(rules.allowed ?? {}), Arr.some(allowedBy(dependency)));\n\nconst bannedProblems = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly string[] => {\n const allowed = isAllowed(rules);\n const checked = pipe(dependencies, Arr.filter(Predicate.not(allowed)));\n return pipe(Rec.toEntries(rules.banned ?? {}), Arr.flatMap(bannedBy(checked)));\n};\n\nconst inWorkspaces =\n (globs: readonly string[]) =>\n (dependency: Dependency): boolean =>\n dependency.field === \"dependencies\" && inWorkspace(globs)(dependency);\n\nconst exactGlobs = (rules: DependencyRules): readonly string[] =>\n pipe(Rec.values(rules.exactDependencies ?? {}), Arr.flatten);\n\nconst notExactBy =\n (dependencies: readonly Dependency[]) =>\n ([reason, globs]: readonly [string, readonly string[]]): readonly string[] =>\n pipe(\n dependencies,\n Arr.filter(inWorkspaces(globs)),\n Arr.filter((dependency) => valid(dependency.specifier) === null),\n Arr.map(\n (dependency) =>\n `${dependency.manifest} dependencies.${dependency.name} must be an exact version: ${reason}`,\n ),\n );\n\nconst exactProblems = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly string[] =>\n pipe(Rec.toEntries(rules.exactDependencies ?? {}), Arr.flatMap(notExactBy(dependencies)));\n\nconst groupByName = (dependencies: readonly Dependency[]): readonly (readonly Dependency[])[] =>\n Rec.values(Arr.groupBy(dependencies, ({ name }) => name));\n\nconst describe = (dependencies: readonly Dependency[]): string => {\n const name = pipe(\n Arr.head(dependencies),\n Option.match({ onNone: () => \"\", onSome: (dependency) => dependency.name }),\n );\n const uses = pipe(\n dependencies,\n Arr.map((dependency) => `${dependency.manifest} ${dependency.field} ${dependency.specifier}`),\n Arr.join(\", \"),\n );\n return `${name}: ${uses}`;\n};\n\nconst mismatchProblems = (dependencies: readonly Dependency[]): readonly string[] =>\n pipe(\n groupByName(dependencies),\n Arr.filter(\n (group) =>\n new Set(\n pipe(\n group,\n Arr.map(({ specifier }) => specifier),\n ),\n ).size > SINGLE,\n ),\n Arr.map((group) => `different specifiers for ${describe(group)}`),\n );\n\nconst isDisjoint = (ranges: readonly Dependency[]): boolean =>\n pipe(\n ranges,\n Arr.some((left) =>\n pipe(\n ranges,\n Arr.some((right) => !intersects(left.specifier, right.specifier)),\n ),\n ),\n );\n\nconst disjointRangeProblems = (peers: readonly Dependency[]): readonly string[] =>\n pipe(\n groupByName(peers),\n Arr.map((group) =>\n pipe(\n group,\n Arr.filter(({ specifier }) => validRange(specifier) !== null),\n ),\n ),\n Arr.filter(isDisjoint),\n Arr.map((ranges) => `peer ranges do not intersect for ${describe(ranges)}`),\n );\n\nconst isPeer = ({ field }: Dependency): boolean => field === \"peerDependencies\";\n\nconst versionProblems = (\n rules: DependencyRules,\n pinned: readonly Dependency[],\n): readonly string[] => {\n if (rules.peerRanges !== \"intersect\") {\n return mismatchProblems(pinned);\n }\n const others = pipe(pinned, Arr.filter(Predicate.not(isPeer)));\n const peers = pipe(pinned, Arr.filter(isPeer));\n return [...mismatchProblems(others), ...disjointRangeProblems(peers)];\n};\n\nconst comparedDependencies = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly Dependency[] => {\n const isExact = inWorkspaces(exactGlobs(rules));\n return pipe(\n dependencies,\n Arr.filter(({ specifier }) => !Str.startsWith(\"workspace:\")(specifier)),\n Arr.filter(Predicate.not(isExact)),\n );\n};\n\nconst checkDependencies: {\n (dependencies: readonly Dependency[]): (rules: DependencyRules) => readonly string[];\n (rules: DependencyRules, dependencies: readonly Dependency[]): readonly string[];\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (rules: DependencyRules, dependencies: readonly Dependency[]): readonly string[] => [\n ...bannedProblems(rules, dependencies),\n ...exactProblems(rules, dependencies),\n ...versionProblems(rules, comparedDependencies(rules, dependencies)),\n ],\n);\n\nexport { checkDependencies };\n","import { Effect, Array as Arr, String as Str, pipe, Function as Fn } from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst listGitFiles: {\n (\n pathspecs: readonly string[],\n ): (\n root: string,\n ) => Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n (\n root: string,\n pathspecs: readonly string[],\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n root: string,\n pathspecs: readonly string[],\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n > =>\n Effect.gen(function* list() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\n \"-c\",\n \"core.quotePath=false\",\n \"ls-files\",\n \"-co\",\n \"--exclude-standard\",\n \"-z\",\n \"--\",\n ...pathspecs,\n ],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }),\n);\n\nconst listCommitMessages: {\n (\n range: string,\n ): (\n root: string,\n ) => Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n (\n root: string,\n range: string,\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n root: string,\n range: string,\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n > =>\n Effect.gen(function* messages() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\"git\", [\"log\", \"-z\", \"--first-parent\", \"--format=%B\", range, \"--\"], {\n cwd: root,\n }),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }),\n);\n\n/** @internal */\nexport { listCommitMessages, listGitFiles };\n","import { Effect, Path, Array as Arr, pipe, Function as Fn } from \"effect\";\nimport { linter, processConfiguration } from \"steiger\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { SteigerConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\ninterface Diagnostic {\n readonly severity: string;\n readonly message: string;\n readonly ruleName: string;\n readonly location: { readonly path: string };\n}\n\nconst formatDiagnostic =\n (relative: (file: string) => string) =>\n (diagnostic: Diagnostic): string =>\n `${diagnostic.severity} ${relative(diagnostic.location.path)}: ${diagnostic.message} (${diagnostic.ruleName})`;\n\nconst reportOf = (\n diagnostics: readonly Diagnostic[],\n relative: (file: string) => string,\n): Report => ({\n valid: pipe(\n diagnostics,\n Arr.every((diagnostic) => diagnostic.severity !== \"error\"),\n ),\n output: pipe(diagnostics, Arr.map(formatDiagnostic(relative)), Arr.join(\"\\n\")),\n});\n\nconst checkSlices: {\n (\n root: string,\n targets: readonly string[],\n ): (config: SteigerConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: SteigerConfig,\n root: string,\n targets: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: SteigerConfig,\n root: string,\n targets: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* check() {\n const path = yield* Path.Path;\n processConfiguration([...config], root);\n const perTarget = yield* pipe(\n targets,\n Effect.forEach((target) =>\n attempt(\"steiger\")(() => linter.run(path.resolve(root, target))),\n ),\n );\n return reportOf(Arr.flatten(perTarget), (file) => path.relative(root, file));\n }),\n);\n\n/** @internal */\nexport { checkSlices };\n","import {\n Effect,\n FileSystem,\n Path,\n Schema,\n Array as Arr,\n Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport type { ChildProcessSpawner } from \"effect/process\";\nimport { parse } from \"yaml\";\n\nimport { listGitFiles } from \"./git.ts\";\n\nconst DEPENDENCY_FIELDS = [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n] as const;\n\ntype DependencyField = (typeof DEPENDENCY_FIELDS)[number];\n\ninterface Dependency {\n readonly manifest: string;\n readonly field: DependencyField;\n readonly name: string;\n readonly specifier: string;\n}\n\ntype WorkspaceServices =\n | ChildProcessSpawner.ChildProcessSpawner\n | FileSystem.FileSystem\n | Path.Path;\n\nconst Manifest = Schema.Record(Schema.String, Schema.Unknown);\n\nconst decodeSpecifiers = Schema.decodeUnknownEffect(Schema.Record(Schema.String, Schema.String));\n\nconst Workspace = Schema.Struct({\n packages: Schema.optionalKey(Schema.Array(Schema.String)),\n});\n\nconst decodeManifest = Schema.decodeEffect(Schema.fromJsonString(Manifest));\n\nconst decodeWorkspace = Schema.decodeUnknownEffect(Workspace);\n\nconst NEGATION = \"!\";\n\nconst manifestPathspec = (pattern: string): string => {\n if (Str.startsWith(NEGATION)(pattern)) {\n return `:(glob,exclude)${Str.slice(NEGATION.length)(pattern)}/package.json`;\n }\n return `:(glob)${pattern}/package.json`;\n};\n\nconst listManifests = (\n root: string,\n): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError | Schema.SchemaError,\n WorkspaceServices\n> =>\n Effect.gen(function* list() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const text = yield* fs.readFileString(path.join(root, \"pnpm-workspace.yaml\"));\n const raw: unknown = parse(text);\n const workspace = yield* decodeWorkspace(raw);\n const found = yield* listGitFiles(\n root,\n pipe(workspace.packages ?? [], Arr.map(manifestPathspec)),\n );\n return [\"package.json\", ...Arr.sort(found, Str.Order)];\n });\n\nconst dependenciesOf =\n (manifest: string) =>\n (fields: typeof Manifest.Type): Effect.Effect<readonly Dependency[], Schema.SchemaError> =>\n pipe(\n DEPENDENCY_FIELDS,\n Effect.forEach((field) =>\n decodeSpecifiers(fields[field] ?? {}).pipe(\n Effect.map((specifiers) =>\n pipe(\n Rec.toEntries(specifiers),\n Arr.map(([name, specifier]) => ({ manifest, field, name, specifier })),\n ),\n ),\n ),\n ),\n Effect.map(Arr.flatten),\n );\n\nconst listDependencies = (\n root: string,\n): Effect.Effect<\n readonly Dependency[],\n PlatformError.PlatformError | Schema.SchemaError,\n WorkspaceServices\n> =>\n Effect.gen(function* list() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const manifests = yield* listManifests(root);\n const parsed = yield* pipe(\n manifests,\n Effect.forEach((manifest) =>\n fs\n .readFileString(path.join(root, manifest))\n .pipe(Effect.flatMap(decodeManifest), Effect.flatMap(dependenciesOf(manifest))),\n ),\n );\n return Arr.flatten(parsed);\n });\n\n/** @internal */\nexport { listDependencies };\n/** @internal */\nexport type { Dependency, DependencyField, WorkspaceServices };\n","import { Effect, Array as Arr, String as Str, pipe } from \"effect\";\nimport { minimatch } from \"minimatch\";\n\nimport { checkDependencies } from \"./dependency-rules.ts\";\nimport { listGitFiles } from \"./git.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport { checkSlices } from \"./steiger.ts\";\nimport { listDependencies } from \"./workspace.ts\";\n\nconst ancestorsOf = (file: string): readonly string[] =>\n pipe(\n Str.split(file, \"/\"),\n Arr.initNonEmpty,\n Arr.scan(\"\", (parent, segment) => Arr.join(Arr.filter([parent, segment], Str.isNonEmpty), \"/\")),\n Arr.filter(Str.isNonEmpty),\n );\n\nconst matchingDirectories = (\n root: string,\n patterns: readonly string[],\n): ReturnType<typeof listGitFiles> =>\n listGitFiles(root, []).pipe(\n Effect.map((files) =>\n pipe(\n files,\n Arr.flatMap(ancestorsOf),\n Arr.dedupe,\n Arr.filter((directory) =>\n pipe(\n patterns,\n Arr.some((pattern) => minimatch(directory, pattern)),\n ),\n ),\n ),\n ),\n );\n\nconst steigerCheck = withSection(\"steiger\", (section, { root }) =>\n matchingDirectories(root, section.paths).pipe(\n Effect.flatMap((targets) => checkSlices(section.rules, root, targets)),\n ),\n);\n\nconst dependenciesCheck = withSection(\"dependencyRules\", (rules, { root }) =>\n listDependencies(root).pipe(\n Effect.map((dependencies) => {\n const problems = checkDependencies(rules, dependencies);\n return { valid: Arr.isReadonlyArrayEmpty(problems), output: Arr.join(problems, \"\\n\") };\n }),\n ),\n);\n\n/** @internal */\nexport { dependenciesCheck, steigerCheck };\n","import { Array as Arr, pipe } from \"effect\";\nimport { stringify } from \"smol-toml\";\n\nimport type { BetterleaksConfig } from \"./types.ts\";\n\nconst toBetterleaksToml = (config: BetterleaksConfig): string => {\n const { ignoredSecrets: _ignoredSecrets, ...rest } = config;\n return stringify(rest);\n};\n\nconst toIgnoreFile = (config: BetterleaksConfig): string =>\n pipe(\n config.ignoredSecrets ?? [],\n Arr.map((digest) => `${digest}\\n`),\n Arr.join(\"\"),\n );\n\nexport { toBetterleaksToml, toIgnoreFile };\n","import { Effect, Function as Fn } from \"effect\";\nimport type { FileSystem, Path, PlatformError } from \"effect\";\nimport type { ChildProcessSpawner } from \"effect/process\";\n\nimport type { Binary } from \"./binaries.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport { locateBinary } from \"./install.ts\";\nimport { runCaptured } from \"./process.ts\";\nimport type { Invocation } from \"./process.ts\";\nimport type { Report } from \"./report.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst runVendored: {\n (\n invocation: Omit<Invocation, \"file\">,\n ): (\n binary: Binary,\n ) => Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n >;\n (\n binary: Binary,\n invocation: Omit<Invocation, \"file\">,\n ): Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n binary: Binary,\n invocation: Omit<Invocation, \"file\">,\n ): Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n > => locateBinary(binary).pipe(Effect.flatMap((file) => runCaptured({ ...invocation, file }))),\n);\n\n/** @internal */\nexport { runVendored };\n","import { Effect, FileSystem, Function as Fn } from \"effect\";\nimport type { PlatformError, Scope } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { toBetterleaksToml, toIgnoreFile } from \"./betterleaks.ts\";\nimport { BETTERLEAKS } from \"./binaries.ts\";\nimport type { CheckError, CheckServices } from \"./check.ts\";\nimport type { Report } from \"./report.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport type { BetterleaksConfig } from \"./types.ts\";\nimport { runVendored } from \"./vendored.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst ignoreFileArgs = (\n config: BetterleaksConfig,\n): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n FileSystem.FileSystem | Scope.Scope\n> =>\n Effect.gen(function* ignoreFile() {\n const digests = toIgnoreFile(config);\n if (digests === \"\") {\n return [];\n }\n const fs = yield* FileSystem.FileSystem;\n const file = yield* fs.makeTempFileScoped({ prefix: \"betterleaksignore-\" });\n yield* fs.writeFileString(file, digests);\n return [\"--ignore-file\", file];\n });\n\nconst scanSecrets = ({\n config,\n root,\n args,\n input,\n}: {\n readonly config: BetterleaksConfig;\n readonly root: string;\n readonly args: readonly string[];\n readonly input?: string;\n}): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* scan() {\n const ignore = yield* ignoreFileArgs(config);\n return yield* runVendored(BETTERLEAKS, {\n root,\n args: [...args, \"--redact\", \"--no-banner\", ...ignore],\n env: { BETTERLEAKS_CONFIG_TOML: toBetterleaksToml(config) },\n input,\n });\n }).pipe(Effect.scoped);\n\nconst betterleaksCheck = withSection(\"betterleaks\", (config, { root, base }) =>\n scanSecrets({ config, root, args: [\"git\", \".\", `--revision=${base}..HEAD`] }),\n);\n\nconst STAGED_DIFF = [\n \"diff\",\n \"--cached\",\n \"--no-ext-diff\",\n \"--no-textconv\",\n \"--no-color\",\n \"--src-prefix=a/\",\n \"--dst-prefix=b/\",\n];\n\nconst scanStagedSecrets: {\n (root: string): (config: BetterleaksConfig) => Effect.Effect<Report, CheckError, CheckServices>;\n (config: BetterleaksConfig, root: string): Effect.Effect<Report, CheckError, CheckServices>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (config: BetterleaksConfig, root: string): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* staged() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const diff = yield* spawner.string(ChildProcess.make(\"git\", STAGED_DIFF, { cwd: root }));\n return yield* scanSecrets({ config, root, args: [\"stdin\", \"--git-diff\"], input: diff });\n }),\n);\n\n/** @internal */\nexport { betterleaksCheck, scanStagedSecrets };\n","import { Effect, Option, Path, Array as Arr, Record as Rec, pipe, Function as Fn } from \"effect\";\nimport type { LintError, Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { MarkdownlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst formatError =\n (file: string) =>\n (error: LintError): string => {\n const detail = pipe(\n [error.errorDetail, error.errorContext],\n Arr.filter((part): part is string => part !== null && part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n return `${file}:${error.lineNumber} ${Arr.join(error.ruleNames, \"/\")} ${error.ruleDescription}${detail}`;\n };\n\nconst optionsOf = (config: MarkdownlintConfig, files: readonly string[]): Options => ({\n files: [...files],\n ...pipe(\n Option.fromNullishOr(config.config),\n Option.match({ onNone: () => ({}), onSome: (rules) => ({ config: rules }) }),\n ),\n ...pipe(\n Option.fromNullishOr(config.customRules),\n Option.match({ onNone: () => ({}), onSome: (rules) => ({ customRules: [...rules] }) }),\n ),\n});\n\nconst lintMarkdown: {\n (\n root: string,\n files: readonly string[],\n ): (config: MarkdownlintConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: MarkdownlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: MarkdownlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* markdown() {\n const path = yield* Path.Path;\n const absolute = pipe(\n files,\n Arr.map((file) => path.join(root, file)),\n );\n const results = yield* attempt(\"markdownlint\")(() => lint(optionsOf(config, absolute)));\n const linesOf = ([file, errors]: readonly [\n string,\n readonly LintError[],\n ]): readonly string[] => {\n const format = formatError(path.relative(root, file));\n return pipe(errors, Arr.map(format));\n };\n const lines = pipe(Rec.toEntries(results), Arr.flatMap(linesOf));\n return { valid: Arr.isArrayEmpty(lines), output: Arr.join(lines, \"\\n\") };\n }),\n);\n\n/** @internal */\nexport { lintMarkdown };\n","import { loadPackagesFromRawConfig } from \"@textlint/config-loader\";\nimport type { TextlintLoadPackagesFromRawConfigResult } from \"@textlint/config-loader\";\nimport { TextlintKernelDescriptor } from \"@textlint/kernel\";\nimport { Effect, Path, Array as Arr, pipe, Function as Fn } from \"effect\";\nimport { createLinter, loadLinterFormatter } from \"textlint\";\nimport { builtInPlugins } from \"textlint/lib/src/loader/TextlintrcLoader.js\";\n\nimport { attempt } from \"./attempt.ts\";\nimport { toolFailed } from \"./errors.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { TextlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst descriptorOf = (\n loaded: TextlintLoadPackagesFromRawConfigResult,\n root: string,\n): Effect.Effect<TextlintKernelDescriptor, VpToolsError> => {\n if (!loaded.ok) {\n return Effect.fail(toolFailed(\"textlint\")(loaded.error.message));\n }\n return Effect.succeed(\n new TextlintKernelDescriptor({\n rules: loaded.config.rules,\n filterRules: loaded.config.filterRules,\n plugins: [...builtInPlugins, ...loaded.config.plugins],\n configBaseDir: root,\n }),\n );\n};\n\nconst lintTexts: {\n (\n root: string,\n files: readonly string[],\n ): (config: TextlintConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: TextlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: TextlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* lint() {\n const path = yield* Path.Path;\n const { ignores: _ignores, ...rawConfig } = config;\n const loaded = yield* attempt(\"textlint\")(() =>\n loadPackagesFromRawConfig({ rawConfig, node_moduleDir: path.join(root, \"node_modules\") }),\n );\n const descriptor = yield* descriptorOf(loaded, root);\n const absolute = pipe(\n files,\n Arr.map((file) => path.join(root, file)),\n );\n const results = yield* attempt(\"textlint\")(() =>\n createLinter({ descriptor }).lintFiles([...absolute]),\n );\n const formatter = yield* attempt(\"textlint\")(() =>\n loadLinterFormatter({ formatterName: \"stylish\", color: false }),\n );\n return {\n valid: pipe(\n results,\n Arr.every((result) => Arr.isArrayEmpty(result.messages)),\n ),\n output: formatter.format(results),\n };\n }),\n);\n\n/** @internal */\nexport { lintTexts };\n","import { Effect, Array as Arr, pipe } from \"effect\";\n\nimport { lintCommitMessages } from \"./commitlint.ts\";\nimport { listCommitMessages, listGitFiles } from \"./git.ts\";\nimport { lintMarkdown } from \"./markdownlint.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport { lintTexts } from \"./textlint.ts\";\n\nconst MARKDOWN = \"*.md\";\n\nconst markdownFiles = (\n root: string,\n ignores: readonly string[] = [],\n): ReturnType<typeof listGitFiles> =>\n listGitFiles(root, [\n MARKDOWN,\n ...pipe(\n ignores,\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n ]);\n\nconst textlintCheck = withSection(\"textlint\", (config, { root }) =>\n markdownFiles(root, config.ignores).pipe(\n Effect.flatMap((files) => lintTexts(config, root, files)),\n ),\n);\n\nconst markdownlintCheck = withSection(\"markdownlint\", (config, { root }) =>\n markdownFiles(root, config.ignores).pipe(\n Effect.flatMap((files) => lintMarkdown(config, root, files)),\n ),\n);\n\nconst commitlintCheck = withSection(\"commitlint\", (config, { root, base }) =>\n listCommitMessages(root, `${base}..HEAD`).pipe(\n Effect.flatMap((messages) => lintCommitMessages(config, root, messages)),\n ),\n);\n\n/** @internal */\nexport { commitlintCheck, markdownlintCheck, textlintCheck };\n","import { Config, Effect, FileSystem, Option, Path, pipe } from \"effect\";\n\nimport { ACTIONLINT, ZIZMOR } from \"./binaries.ts\";\nimport type { Binary } from \"./binaries.ts\";\nimport type { Check } from \"./check.ts\";\nimport { runVendored } from \"./vendored.ts\";\n\nconst WORKFLOWS = \".github/workflows\";\n\nconst onWorkflows =\n (binary: Binary, args: Effect.Effect<readonly string[]>): Check =>\n ({ root }) =>\n Effect.gen(function* workflows() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n if (!(yield* fs.exists(path.join(root, WORKFLOWS)))) {\n return Option.none();\n }\n const resolvedArgs = yield* args;\n const ran = yield* runVendored(binary, { root, args: resolvedArgs });\n return Option.some(ran);\n });\n\nconst actionlintCheck = onWorkflows(ACTIONLINT, Effect.succeed([]));\n\nconst zizmorArgs = Effect.gen(function* zizmorArgs() {\n const remote = yield* Config.option(Config.String(\"CLAUDE_CODE_REMOTE\")).pipe(Effect.orDie);\n return pipe(\n remote,\n Option.match({\n onNone: () => [\".github\"],\n onSome: () => [\"--no-online-audits\", \".github\"],\n }),\n );\n});\n\nconst zizmorCheck = onWorkflows(ZIZMOR, zizmorArgs);\n\n/** @internal */\nexport { actionlintCheck, zizmorCheck };\n","import type { NamedCheck } from \"./check.ts\";\nimport { fallowCheck } from \"./fallow-check.ts\";\nimport { dependenciesCheck, steigerCheck } from \"./repository-checks.ts\";\nimport { betterleaksCheck } from \"./secret-checks.ts\";\nimport { commitlintCheck, markdownlintCheck, textlintCheck } from \"./text-checks.ts\";\nimport { actionlintCheck, zizmorCheck } from \"./workflow-checks.ts\";\n\nconst CHECKS: readonly NamedCheck[] = [\n { name: \"betterleaks\", run: betterleaksCheck },\n { name: \"commitlint\", run: commitlintCheck },\n { name: \"actionlint\", run: actionlintCheck },\n { name: \"zizmor\", run: zizmorCheck },\n { name: \"dependencies\", run: dependenciesCheck },\n { name: \"steiger\", run: steigerCheck },\n { name: \"textlint\", run: textlintCheck },\n { name: \"markdownlint\", run: markdownlintCheck },\n { name: \"fallow\", run: fallowCheck },\n];\n\nexport { CHECKS };\n","import type { Stdio } from \"effect\";\nimport { Config, Effect, Option, Array as Arr, pipe } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport type { CheckContext, CheckError, CheckServices, NamedCheck } from \"./check.ts\";\nimport { CHECKS } from \"./checks.ts\";\nimport { loadViteConfig } from \"./config.ts\";\nimport { checksFailed } from \"./errors.ts\";\nimport { writeTo } from \"./output.ts\";\nimport type { Report } from \"./report.ts\";\n\nconst DEFAULT_BASE = \"origin/main\";\nconst RESOLVED = 0;\n\nconst isCommit = (\n root: string,\n revision: string,\n): Effect.Effect<boolean, never, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* verify() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const exitCode = yield* spawner.exitCode(\n ChildProcess.make(\"git\", [\"rev-parse\", \"-q\", \"--verify\", `${revision}^{commit}`], {\n cwd: root,\n }),\n );\n return exitCode === RESOLVED;\n }).pipe(Effect.orElseSucceed(() => false));\n\nconst resolveBase = (\n root: string,\n): Effect.Effect<string, never, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* base() {\n const configured = yield* Config.option(Config.String(\"VPA_BASE\")).pipe(Effect.orDie);\n if (Option.isSome(configured) && (yield* isCommit(root, configured.value))) {\n return configured.value;\n }\n return DEFAULT_BASE;\n });\n\ninterface Outcome {\n readonly name: string;\n readonly report: Report;\n}\n\nconst describe = ({ name, report }: Outcome): string => {\n if (report.valid) {\n return `✓ ${name}`;\n }\n return `✗ ${name}\\n${report.output}`;\n};\n\nconst runCheck =\n (context: CheckContext) =>\n ({ name, run }: NamedCheck): Effect.Effect<Option.Option<Outcome>, CheckError, CheckServices> =>\n run(context).pipe(Effect.map(Option.map((report) => ({ name, report }))));\n\nconst runAllChecks = (root: string): Effect.Effect<void, CheckError, CheckServices | Stdio.Stdio> =>\n Effect.gen(function* all() {\n const config = yield* loadViteConfig(root);\n const base = yield* resolveBase(root);\n const outcomes = yield* pipe(\n CHECKS,\n Effect.forEach(runCheck({ root, config, base }), { concurrency: \"unbounded\" }),\n Effect.map(Arr.getSomes),\n );\n yield* writeTo(\"stdout\", `${pipe(outcomes, Arr.map(describe), Arr.join(\"\\n\"))}\\n`);\n return yield* pipe(\n outcomes,\n Arr.filter(({ report }) => !report.valid),\n Arr.map(({ name }) => name),\n Arr.match({\n onEmpty: () => Effect.void,\n onNonEmpty: (failed) => Effect.fail(checksFailed(`Failed: ${Arr.join(failed, \", \")}`)),\n }),\n );\n });\n\n/** @internal */\nexport { runAllChecks };\n","import { Effect, Option, Array as Arr, Record as Rec, pipe, Function as Fn } from \"effect\";\n\nimport type { CommandEffect } from \"./command.ts\";\nimport { lintCommitMessageFile } from \"./commitlint.ts\";\nimport { loadSection } from \"./config.ts\";\nimport { checksFailed } from \"./errors.ts\";\nimport { finish } from \"./output.ts\";\nimport { runAllChecks } from \"./run-checks.ts\";\nimport { scanStagedSecrets } from \"./secret-checks.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst USAGE = pipe(\n [\n \"Usage: vpa run every check configured in vite.config.ts\",\n \" vpa --staged scan the staged changes for secrets (pre-commit)\",\n \" vpa --commit-msg <file> lint a commit message (commit-msg)\",\n ],\n Arr.join(\"\\n\"),\n);\n\nconst usage: CommandEffect = Effect.fail(checksFailed(USAGE));\n\nconst stagedSecrets = (root: string): CommandEffect =>\n loadSection(root, \"betterleaks\").pipe(\n Effect.flatMap((config) => scanStagedSecrets(config, root)),\n Effect.flatMap(finish),\n );\n\nconst commitMessage = (root: string, rest: readonly string[]): CommandEffect =>\n pipe(\n Arr.head(rest),\n Option.match({\n onNone: () => usage,\n onSome: (file) =>\n loadSection(root, \"commitlint\").pipe(\n Effect.flatMap((config) => lintCommitMessageFile(config, root, file)),\n Effect.flatMap(finish),\n ),\n }),\n );\n\nconst HOOKS: Readonly<Record<string, (root: string, rest: readonly string[]) => CommandEffect>> = {\n \"--staged\": stagedSecrets,\n \"--commit-msg\": commitMessage,\n};\n\nconst runVpa: {\n (args: readonly string[]): (root: string) => CommandEffect;\n (root: string, args: readonly string[]): CommandEffect;\n} = Fn.dual(DATA_FIRST_ARITY, (root: string, args: readonly string[]): CommandEffect =>\n pipe(\n args,\n Arr.match({\n onEmpty: () => runAllChecks(root),\n onNonEmpty: ([flag, ...rest]) =>\n pipe(\n Rec.get(HOOKS, flag),\n Option.match({ onNone: () => usage, onSome: (hook) => hook(root, rest) }),\n ),\n }),\n ),\n);\n\n/** @internal */\nexport { runVpa };\n","import { Effect, Path, Stdio } from \"effect\";\n\nimport { runCli } from \"./run-cli.ts\";\nimport { runVpa } from \"./vpa.ts\";\n\nrunCli(\n Effect.gen(function* main() {\n const stdio = yield* Stdio.Stdio;\n const path = yield* Path.Path;\n const args = yield* stdio.args;\n return yield* runVpa(path.resolve(\".\"), args);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,MAAMA,uBAAqB;AAE3B,MAAM,eAAe;AAErB,MAAM,mBAAmB,WAAoE;CAO3F,OAAO;EAAE,GANM,KACb,OAAO,cAAc,OAAO,YAAY,GACxC,OAAO,KAAK,EAAE,iBAAiB,UAAU,GACzC,OAAO,OAAO,UAAU,QAAQ,GAChC,OAAO,iBAAiB,CAAC,EAAE,CAEZ;EAAG,aAAa;CAAa;AAChD;AAEA,MAAM,iBAAiB,YAA0C;CAC/D,YAAY,gBAAgB,MAAM;CAClC,SAAS,OAAO;CAChB,SAAS,OAAO,WAAW,CAAC;CAC5B,gBAAgB,OAAO,kBAAkB;AAC3C;AAEA,MAAM,qBAUFC,SAAG,KACLD,uBAEE,QACA,MACA,aAEA,OAAO,IAAI,UAAU,eAAe;CAClC,MAAM,SAAS,OAAO,QAAQ,YAAY,CAAC,OAAO,KAAK,QAAQ,EAAE,KAAK,KAAK,CAAC,CAAC;CAC7E,MAAM,UAAU,OAAO,KACrB,UACA,OAAO,SAAS,YACd,QAAQ,YAAY,CAAC,OAAO,KAAK,SAAS,OAAO,OAAO,cAAc,MAAM,CAAC,CAAC,CAChF,CACF;CACA,OAAO;EACL,OAAO,KACL,SACAE,MAAI,OAAO,WAAW,OAAO,KAAK,CACpC;EACA,QAAQ,OAAO,EAAE,QAAQ,GAAG,EAAE,OAAO,MAAM,CAAC;CAC9C;AACF,CAAC,CACL;AAEA,MAAM,wBAYFD,SAAG,KACLD,uBAEE,QACA,MACA,gBAEA,OAAO,IAAI,UAAU,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ARITY_3","Arr","Fn","Str","Arr","Rec","Str","Arr","Arr","Fn","DATA_FIRST_ARITY","Str","Fn","DATA_FIRST_ARITY_3","Arr","Fn","lint","Rec","Fn","Arr","Arr","Arr","Arr","Fn","Rec"],"sources":["../src/commitlint.ts","../src/process.ts","../src/section-check.ts","../src/fallow-check.ts","../src/dependency-rules.ts","../src/git.ts","../src/steiger.ts","../src/workspace.ts","../src/repository-checks.ts","../src/betterleaks.ts","../src/vendored.ts","../src/secret-checks.ts","../src/markdownlint.ts","../src/textlint.ts","../src/text-checks.ts","../src/workflow-checks.ts","../src/checks.ts","../src/run-checks.ts","../src/vpa.ts","../src/cli.ts"],"sourcesContent":["import format from \"@commitlint/format\";\nimport lint from \"@commitlint/lint\";\nimport load from \"@commitlint/load\";\nimport type { LintOptions, QualifiedConfig } from \"@commitlint/types\";\nimport { Array as Arr, Effect, FileSystem, Option, Predicate, pipe, Function as Fn } from \"effect\";\nimport type { PlatformError } from \"effect\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { CommitlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst COMMENT_CHAR = \"#\";\n\nconst parserOptionsOf = (loaded: QualifiedConfig): NonNullable<LintOptions[\"parserOpts\"]> => {\n const preset = pipe(\n Option.fromNullishOr(loaded.parserPreset),\n Option.map(({ parserOpts }) => parserOpts),\n Option.filter(Predicate.isObject),\n Option.getOrElse(() => ({})),\n );\n return { ...preset, commentChar: COMMENT_CHAR };\n};\n\nconst lintOptionsOf = (loaded: QualifiedConfig): LintOptions => ({\n parserOpts: parserOptionsOf(loaded),\n plugins: loaded.plugins,\n ignores: loaded.ignores ?? [],\n defaultIgnores: loaded.defaultIgnores ?? true,\n});\n\nconst lintCommitMessages: {\n (\n root: string,\n messages: readonly string[],\n ): (config: CommitlintConfig) => Effect.Effect<Report, VpToolsError>;\n (\n config: CommitlintConfig,\n root: string,\n messages: readonly string[],\n ): Effect.Effect<Report, VpToolsError>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: CommitlintConfig,\n root: string,\n messages: readonly string[],\n ): Effect.Effect<Report, VpToolsError> =>\n Effect.gen(function* lintMessages() {\n const loaded = yield* attempt(\"commitlint\")(() => load(config, { cwd: root }));\n const results = yield* pipe(\n messages,\n Effect.forEach((message) =>\n attempt(\"commitlint\")(() => lint(message, loaded.rules, lintOptionsOf(loaded))),\n ),\n );\n return {\n valid: pipe(\n results,\n Arr.every((result) => result.valid),\n ),\n output: format({ results }, { color: false }),\n };\n }),\n);\n\nconst lintCommitMessageFile: {\n (\n root: string,\n messageFile: string,\n ): (\n config: CommitlintConfig,\n ) => Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem>;\n (\n config: CommitlintConfig,\n root: string,\n messageFile: string,\n ): Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: CommitlintConfig,\n root: string,\n messageFile: string,\n ): Effect.Effect<Report, VpToolsError | PlatformError.PlatformError, FileSystem.FileSystem> =>\n Effect.gen(function* read() {\n const fs = yield* FileSystem.FileSystem;\n const message = yield* fs.readFileString(messageFile);\n return yield* lintCommitMessages(config, root, [message]);\n }),\n);\n\n/** @internal */\nexport { lintCommitMessageFile, lintCommitMessages };\n","import { Effect, Option, Stream, pipe } from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport type { Report } from \"./report.ts\";\n\nconst SUCCESS = 0;\n\ninterface Invocation {\n readonly root: string;\n readonly file: string;\n readonly args: readonly string[];\n readonly env?: Readonly<Record<string, string>>;\n readonly input?: string | undefined;\n readonly output?: \"all\" | \"stdout\";\n}\n\nconst stdinOf = (input: string | undefined): ChildProcess.CommandInput =>\n pipe(\n Option.fromNullishOr(input),\n Option.match({\n onNone: (): ChildProcess.CommandInput => \"ignore\",\n onSome: (text) => Stream.make(new TextEncoder().encode(text)),\n }),\n );\n\nconst runCaptured = ({\n root,\n file,\n args,\n env = {},\n input,\n output = \"all\",\n}: Invocation): Effect.Effect<\n Report,\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n> =>\n Effect.gen(function* run() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const handle = yield* spawner.spawn(\n ChildProcess.make(file, args, { cwd: root, env, extendEnv: true, stdin: stdinOf(input) }),\n );\n const [text, exitCode] = yield* Effect.all(\n [handle[output].pipe(Stream.decodeText, Stream.mkString), handle.exitCode],\n { concurrency: \"unbounded\" },\n );\n return { valid: exitCode === SUCCESS, output: text };\n }).pipe(Effect.scoped);\n\n/** @internal */\nexport { runCaptured };\n/** @internal */\nexport type { Invocation };\n","import { Effect, Function as Fn, Option, pipe } from \"effect\";\n\nimport type { Check, CheckContext, CheckError, CheckServices } from \"./check.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { ToolSection, ToolSections } from \"./types.ts\";\n\ntype SectionRun<Key extends ToolSection> = (\n section: NonNullable<ToolSections[Key]>,\n context: CheckContext,\n) => Effect.Effect<Report, CheckError, CheckServices>;\n\nconst DATA_FIRST_ARITY = 2;\n\nconst withSection: {\n <Key extends ToolSection>(run: SectionRun<Key>): (key: Key) => Check;\n <Key extends ToolSection>(key: Key, run: SectionRun<Key>): Check;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n <Key extends ToolSection>(key: Key, run: SectionRun<Key>): Check =>\n (context) =>\n pipe(\n Option.fromNullishOr(context.config[key]),\n Option.match({\n onNone: () => Effect.succeedNone,\n onSome: (section) => Effect.asSome(run(section, context)),\n }),\n ),\n);\n\n/** @internal */\nexport { withSection };\n/** @internal */\nexport type { SectionRun };\n","import { Effect, FileSystem, Path, Schema, Array as Arr, pipe } from \"effect\";\n\nimport type { CheckError, CheckServices } from \"./check.ts\";\nimport { toJson } from \"./json.ts\";\nimport { runCaptured } from \"./process.ts\";\nimport type { Report } from \"./report.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport type { FallowConfig } from \"./types.ts\";\n\nconst QUIET = [\"--fail-on-issues\", \"--quiet\", \"--format\", \"compact\"];\n\nconst RUNS: readonly (readonly string[])[] = [\n [\"--skip\", \"dupes\", ...QUIET],\n [\"dead-code\", \"--no-production\", ...QUIET],\n [\"dupes\", ...QUIET],\n [\"security\", \"--fail-on-issues\", \"--quiet\"],\n];\n\nconst SMELLS = Schema.Array(Schema.Unknown).pipe(Schema.withDecodingDefaultKey(Effect.succeed([])));\n\nconst COMPONENT_SMELLS = Schema.Struct({\n prop_drilling_chains: SMELLS,\n thin_wrappers: SMELLS,\n duplicate_prop_shapes: SMELLS,\n});\n\nconst decodeSmells = Schema.decodeUnknownEffect(Schema.fromJsonString(COMPONENT_SMELLS));\n\nconst componentSmells = (\n root: string,\n configFile: string,\n): Effect.Effect<Report, CheckError, CheckServices> =>\n runCaptured({\n root,\n file: \"fallow\",\n args: [\"dead-code\", \"--no-production\", \"--quiet\", \"--format\", \"json\", \"-c\", configFile],\n output: \"stdout\",\n }).pipe(\n Effect.flatMap((report) => decodeSmells(report.output)),\n Effect.map((smells) => {\n const found = [\n ...smells.prop_drilling_chains,\n ...smells.thin_wrappers,\n ...smells.duplicate_prop_shapes,\n ];\n return {\n valid: Arr.isReadonlyArrayEmpty(found),\n output: toJson(smells),\n };\n }),\n );\n\nconst runFallow = (\n config: FallowConfig,\n root: string,\n): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* fallow() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const directory = yield* fs.makeTempDirectoryScoped({ prefix: \"vpa-fallow-\" });\n const configFile = path.join(directory, \".fallowrc.json\");\n const configText = yield* Schema.encodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(\n config,\n ).pipe(Effect.orDie);\n yield* fs.writeFileString(configFile, configText);\n const reports = yield* pipe(\n RUNS,\n Effect.forEach((args) =>\n runCaptured({ root, file: \"fallow\", args: [...args, \"-c\", configFile] }),\n ),\n );\n const smells = yield* componentSmells(root, configFile);\n const all = [...reports, smells];\n return {\n valid: pipe(\n all,\n Arr.every((report) => report.valid),\n ),\n output: pipe(\n all,\n Arr.filter((report) => !report.valid),\n Arr.map((report) => report.output),\n Arr.join(\"\\n\"),\n ),\n };\n }).pipe(Effect.scoped);\n\nconst fallowCheck = withSection(\"fallow\", (config, { root }) => runFallow(config, root));\n\n/** @internal */\nexport { fallowCheck };\n","import {\n Array as Arr,\n Option,\n Predicate,\n Record as Rec,\n String as Str,\n pipe,\n Function as Fn,\n} from \"effect\";\nimport { minimatch } from \"minimatch\";\nimport { intersects, valid, validRange } from \"semver\";\n\nimport type { AllowedDependencies, DependencyRules } from \"./types.ts\";\nimport type { Dependency } from \"./workspace.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst SINGLE = 1;\n\nconst bannedBy =\n (dependencies: readonly Dependency[]) =>\n ([reason, globs]: readonly [string, readonly string[]]): readonly string[] => {\n const isBanned = (name: string): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(name, glob)),\n );\n return pipe(\n dependencies,\n Arr.filter((dependency) => isBanned(dependency.name)),\n Arr.map(\n (dependency) =>\n `${dependency.manifest} ${dependency.field}.${dependency.name} is banned: ${reason}`,\n ),\n );\n };\n\nconst MANIFEST = \"package.json\";\n\nconst matchesAny =\n (globs: readonly string[]) =>\n (value: string): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(value, glob)),\n );\n\nconst inWorkspace =\n (globs: readonly string[]) =>\n (dependency: Dependency): boolean =>\n pipe(\n globs,\n Arr.some((glob) => minimatch(dependency.manifest, `${glob}/${MANIFEST}`)),\n );\n\nconst inFields =\n (fields: AllowedDependencies[\"fields\"]) =>\n (dependency: Dependency): boolean =>\n pipe(\n Option.fromNullishOr(fields),\n Option.match({\n onNone: () => true,\n onSome: (names) => Arr.contains(names, dependency.field),\n }),\n );\n\nconst allowedBy =\n (dependency: Dependency) =>\n ({ workspaces, dependencies, fields }: AllowedDependencies): boolean =>\n inWorkspace(workspaces)(dependency) &&\n matchesAny(dependencies)(dependency.name) &&\n inFields(fields)(dependency);\n\nconst isAllowed =\n (rules: DependencyRules) =>\n (dependency: Dependency): boolean =>\n pipe(Rec.values(rules.allowed ?? {}), Arr.some(allowedBy(dependency)));\n\nconst bannedProblems = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly string[] => {\n const allowed = isAllowed(rules);\n const checked = pipe(dependencies, Arr.filter(Predicate.not(allowed)));\n return pipe(Rec.toEntries(rules.banned ?? {}), Arr.flatMap(bannedBy(checked)));\n};\n\nconst inWorkspaces =\n (globs: readonly string[]) =>\n (dependency: Dependency): boolean =>\n dependency.field === \"dependencies\" && inWorkspace(globs)(dependency);\n\nconst exactGlobs = (rules: DependencyRules): readonly string[] =>\n pipe(Rec.values(rules.exactDependencies ?? {}), Arr.flatten);\n\nconst notExactBy =\n (dependencies: readonly Dependency[]) =>\n ([reason, globs]: readonly [string, readonly string[]]): readonly string[] =>\n pipe(\n dependencies,\n Arr.filter(inWorkspaces(globs)),\n Arr.filter((dependency) => valid(dependency.specifier) === null),\n Arr.map(\n (dependency) =>\n `${dependency.manifest} dependencies.${dependency.name} must be an exact version: ${reason}`,\n ),\n );\n\nconst exactProblems = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly string[] =>\n pipe(Rec.toEntries(rules.exactDependencies ?? {}), Arr.flatMap(notExactBy(dependencies)));\n\nconst groupByName = (dependencies: readonly Dependency[]): readonly (readonly Dependency[])[] =>\n Rec.values(Arr.groupBy(dependencies, ({ name }) => name));\n\nconst describe = (dependencies: readonly Dependency[]): string => {\n const name = pipe(\n Arr.head(dependencies),\n Option.match({ onNone: () => \"\", onSome: (dependency) => dependency.name }),\n );\n const uses = pipe(\n dependencies,\n Arr.map((dependency) => `${dependency.manifest} ${dependency.field} ${dependency.specifier}`),\n Arr.join(\", \"),\n );\n return `${name}: ${uses}`;\n};\n\nconst mismatchProblems = (dependencies: readonly Dependency[]): readonly string[] =>\n pipe(\n groupByName(dependencies),\n Arr.filter(\n (group) =>\n new Set(\n pipe(\n group,\n Arr.map(({ specifier }) => specifier),\n ),\n ).size > SINGLE,\n ),\n Arr.map((group) => `different specifiers for ${describe(group)}`),\n );\n\nconst isDisjoint = (ranges: readonly Dependency[]): boolean =>\n pipe(\n ranges,\n Arr.some((left) =>\n pipe(\n ranges,\n Arr.some((right) => !intersects(left.specifier, right.specifier)),\n ),\n ),\n );\n\nconst disjointRangeProblems = (peers: readonly Dependency[]): readonly string[] =>\n pipe(\n groupByName(peers),\n Arr.map((group) =>\n pipe(\n group,\n Arr.filter(({ specifier }) => validRange(specifier) !== null),\n ),\n ),\n Arr.filter(isDisjoint),\n Arr.map((ranges) => `peer ranges do not intersect for ${describe(ranges)}`),\n );\n\nconst isPeer = ({ field }: Dependency): boolean => field === \"peerDependencies\";\n\nconst versionProblems = (\n rules: DependencyRules,\n pinned: readonly Dependency[],\n): readonly string[] => {\n if (rules.peerRanges !== \"intersect\") {\n return mismatchProblems(pinned);\n }\n const others = pipe(pinned, Arr.filter(Predicate.not(isPeer)));\n const peers = pipe(pinned, Arr.filter(isPeer));\n return [...mismatchProblems(others), ...disjointRangeProblems(peers)];\n};\n\nconst comparedDependencies = (\n rules: DependencyRules,\n dependencies: readonly Dependency[],\n): readonly Dependency[] => {\n const isExact = inWorkspaces(exactGlobs(rules));\n return pipe(\n dependencies,\n Arr.filter(({ specifier }) => !Str.startsWith(\"workspace:\")(specifier)),\n Arr.filter(Predicate.not(isExact)),\n );\n};\n\nconst checkDependencies: {\n (dependencies: readonly Dependency[]): (rules: DependencyRules) => readonly string[];\n (rules: DependencyRules, dependencies: readonly Dependency[]): readonly string[];\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (rules: DependencyRules, dependencies: readonly Dependency[]): readonly string[] => [\n ...bannedProblems(rules, dependencies),\n ...exactProblems(rules, dependencies),\n ...versionProblems(rules, comparedDependencies(rules, dependencies)),\n ],\n);\n\nexport { checkDependencies };\n","import { Effect, Array as Arr, String as Str, pipe, Function as Fn } from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst listGitFiles: {\n (\n pathspecs: readonly string[],\n ): (\n root: string,\n ) => Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n (\n root: string,\n pathspecs: readonly string[],\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n root: string,\n pathspecs: readonly string[],\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n > =>\n Effect.gen(function* list() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\n \"git\",\n [\n \"-c\",\n \"core.quotePath=false\",\n \"ls-files\",\n \"-co\",\n \"--exclude-standard\",\n \"-z\",\n \"--\",\n ...pathspecs,\n ],\n { cwd: root },\n ),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }),\n);\n\nconst listCommitMessages: {\n (\n range: string,\n ): (\n root: string,\n ) => Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n (\n root: string,\n range: string,\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n root: string,\n range: string,\n ): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner\n > =>\n Effect.gen(function* messages() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const output = yield* spawner.string(\n ChildProcess.make(\"git\", [\"log\", \"-z\", \"--first-parent\", \"--format=%B\", range, \"--\"], {\n cwd: root,\n }),\n );\n return pipe(Str.split(output, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }),\n);\n\n/** @internal */\nexport { listCommitMessages, listGitFiles };\n","import { Effect, Path, Array as Arr, pipe, Function as Fn } from \"effect\";\nimport { linter, processConfiguration } from \"steiger\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { SteigerConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\ninterface Diagnostic {\n readonly severity: string;\n readonly message: string;\n readonly ruleName: string;\n readonly location: { readonly path: string };\n}\n\nconst formatDiagnostic =\n (relative: (file: string) => string) =>\n (diagnostic: Diagnostic): string =>\n `${diagnostic.severity} ${relative(diagnostic.location.path)}: ${diagnostic.message} (${diagnostic.ruleName})`;\n\nconst reportOf = (\n diagnostics: readonly Diagnostic[],\n relative: (file: string) => string,\n): Report => ({\n valid: pipe(\n diagnostics,\n Arr.every((diagnostic) => diagnostic.severity !== \"error\"),\n ),\n output: pipe(diagnostics, Arr.map(formatDiagnostic(relative)), Arr.join(\"\\n\")),\n});\n\nconst checkSlices: {\n (\n root: string,\n targets: readonly string[],\n ): (config: SteigerConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: SteigerConfig,\n root: string,\n targets: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: SteigerConfig,\n root: string,\n targets: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* check() {\n const path = yield* Path.Path;\n processConfiguration([...config], root);\n const perTarget = yield* pipe(\n targets,\n Effect.forEach((target) =>\n attempt(\"steiger\")(() => linter.run(path.resolve(root, target))),\n ),\n );\n return reportOf(Arr.flatten(perTarget), (file) => path.relative(root, file));\n }),\n);\n\n/** @internal */\nexport { checkSlices };\n","import {\n Effect,\n FileSystem,\n Path,\n Schema,\n Array as Arr,\n Record as Rec,\n String as Str,\n pipe,\n} from \"effect\";\nimport type { PlatformError } from \"effect\";\nimport type { ChildProcessSpawner } from \"effect/process\";\nimport { parse } from \"yaml\";\n\nimport { listGitFiles } from \"./git.ts\";\n\nconst DEPENDENCY_FIELDS = [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n] as const;\n\ntype DependencyField = (typeof DEPENDENCY_FIELDS)[number];\n\ninterface Dependency {\n readonly manifest: string;\n readonly field: DependencyField;\n readonly name: string;\n readonly specifier: string;\n}\n\ntype WorkspaceServices =\n | ChildProcessSpawner.ChildProcessSpawner\n | FileSystem.FileSystem\n | Path.Path;\n\nconst Manifest = Schema.Record(Schema.String, Schema.Unknown);\n\nconst decodeSpecifiers = Schema.decodeUnknownEffect(Schema.Record(Schema.String, Schema.String));\n\nconst Workspace = Schema.Struct({\n packages: Schema.optionalKey(Schema.Array(Schema.String)),\n});\n\nconst decodeManifest = Schema.decodeEffect(Schema.fromJsonString(Manifest));\n\nconst decodeWorkspace = Schema.decodeUnknownEffect(Workspace);\n\nconst NEGATION = \"!\";\n\nconst manifestPathspec = (pattern: string): string => {\n if (Str.startsWith(NEGATION)(pattern)) {\n return `:(glob,exclude)${Str.slice(NEGATION.length)(pattern)}/package.json`;\n }\n return `:(glob)${pattern}/package.json`;\n};\n\nconst listManifests = (\n root: string,\n): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError | Schema.SchemaError,\n WorkspaceServices\n> =>\n Effect.gen(function* list() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const text = yield* fs.readFileString(path.join(root, \"pnpm-workspace.yaml\"));\n const raw: unknown = parse(text);\n const workspace = yield* decodeWorkspace(raw);\n const found = yield* listGitFiles(\n root,\n pipe(workspace.packages ?? [], Arr.map(manifestPathspec)),\n );\n return [\"package.json\", ...Arr.sort(found, Str.Order)];\n });\n\nconst dependenciesOf =\n (manifest: string) =>\n (fields: typeof Manifest.Type): Effect.Effect<readonly Dependency[], Schema.SchemaError> =>\n pipe(\n DEPENDENCY_FIELDS,\n Effect.forEach((field) =>\n decodeSpecifiers(fields[field] ?? {}).pipe(\n Effect.map((specifiers) =>\n pipe(\n Rec.toEntries(specifiers),\n Arr.map(([name, specifier]) => ({ manifest, field, name, specifier })),\n ),\n ),\n ),\n ),\n Effect.map(Arr.flatten),\n );\n\nconst listDependencies = (\n root: string,\n): Effect.Effect<\n readonly Dependency[],\n PlatformError.PlatformError | Schema.SchemaError,\n WorkspaceServices\n> =>\n Effect.gen(function* list() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const manifests = yield* listManifests(root);\n const parsed = yield* pipe(\n manifests,\n Effect.forEach((manifest) =>\n fs\n .readFileString(path.join(root, manifest))\n .pipe(Effect.flatMap(decodeManifest), Effect.flatMap(dependenciesOf(manifest))),\n ),\n );\n return Arr.flatten(parsed);\n });\n\n/** @internal */\nexport { listDependencies };\n/** @internal */\nexport type { Dependency, DependencyField, WorkspaceServices };\n","import { Effect, Array as Arr, String as Str, pipe } from \"effect\";\nimport { minimatch } from \"minimatch\";\n\nimport { checkDependencies } from \"./dependency-rules.ts\";\nimport { listGitFiles } from \"./git.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport { checkSlices } from \"./steiger.ts\";\nimport { listDependencies } from \"./workspace.ts\";\n\nconst ancestorsOf = (file: string): readonly string[] =>\n pipe(\n Str.split(file, \"/\"),\n Arr.initNonEmpty,\n Arr.scan(\"\", (parent, segment) => Arr.join(Arr.filter([parent, segment], Str.isNonEmpty), \"/\")),\n Arr.filter(Str.isNonEmpty),\n );\n\nconst matchingDirectories = (\n root: string,\n patterns: readonly string[],\n): ReturnType<typeof listGitFiles> =>\n listGitFiles(root, []).pipe(\n Effect.map((files) =>\n pipe(\n files,\n Arr.flatMap(ancestorsOf),\n Arr.dedupe,\n Arr.filter((directory) =>\n pipe(\n patterns,\n Arr.some((pattern) => minimatch(directory, pattern)),\n ),\n ),\n ),\n ),\n );\n\nconst steigerCheck = withSection(\"steiger\", (section, { root }) =>\n matchingDirectories(root, section.paths).pipe(\n Effect.flatMap((targets) => checkSlices(section.rules, root, targets)),\n ),\n);\n\nconst dependenciesCheck = withSection(\"dependencyRules\", (rules, { root }) =>\n listDependencies(root).pipe(\n Effect.map((dependencies) => {\n const problems = checkDependencies(rules, dependencies);\n return { valid: Arr.isReadonlyArrayEmpty(problems), output: Arr.join(problems, \"\\n\") };\n }),\n ),\n);\n\n/** @internal */\nexport { dependenciesCheck, steigerCheck };\n","import { Array as Arr, pipe } from \"effect\";\nimport { stringify } from \"smol-toml\";\n\nimport type { BetterleaksConfig } from \"./types.ts\";\n\nconst toBetterleaksToml = (config: BetterleaksConfig): string => {\n const { ignoredSecrets: _ignoredSecrets, ...rest } = config;\n return stringify(rest);\n};\n\nconst toIgnoreFile = (config: BetterleaksConfig): string =>\n pipe(\n config.ignoredSecrets ?? [],\n Arr.map((digest) => `${digest}\\n`),\n Arr.join(\"\"),\n );\n\nexport { toBetterleaksToml, toIgnoreFile };\n","import { Effect, Function as Fn } from \"effect\";\nimport type { FileSystem, Path, PlatformError } from \"effect\";\nimport type { ChildProcessSpawner } from \"effect/process\";\n\nimport type { Binary } from \"./binaries.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport { locateBinary } from \"./install.ts\";\nimport { runCaptured } from \"./process.ts\";\nimport type { Invocation } from \"./process.ts\";\nimport type { Report } from \"./report.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst runVendored: {\n (\n invocation: Omit<Invocation, \"file\">,\n ): (\n binary: Binary,\n ) => Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n >;\n (\n binary: Binary,\n invocation: Omit<Invocation, \"file\">,\n ): Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n >;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (\n binary: Binary,\n invocation: Omit<Invocation, \"file\">,\n ): Effect.Effect<\n Report,\n VpToolsError | PlatformError.PlatformError,\n ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path\n > => locateBinary(binary).pipe(Effect.flatMap((file) => runCaptured({ ...invocation, file }))),\n);\n\n/** @internal */\nexport { runVendored };\n","import { Effect, FileSystem, Function as Fn, String as Str } from \"effect\";\nimport type { PlatformError, Scope } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { toBetterleaksToml, toIgnoreFile } from \"./betterleaks.ts\";\nimport { BETTERLEAKS } from \"./binaries.ts\";\nimport type { CheckError, CheckServices } from \"./check.ts\";\nimport { toolFailed } from \"./errors.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport type { BetterleaksConfig } from \"./types.ts\";\nimport { runVendored } from \"./vendored.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst ignoreFileArgs = (\n config: BetterleaksConfig,\n): Effect.Effect<\n readonly string[],\n PlatformError.PlatformError,\n FileSystem.FileSystem | Scope.Scope\n> =>\n Effect.gen(function* ignoreFile() {\n const digests = toIgnoreFile(config);\n if (digests === \"\") {\n return [];\n }\n const fs = yield* FileSystem.FileSystem;\n const file = yield* fs.makeTempFileScoped({ prefix: \"betterleaksignore-\" });\n yield* fs.writeFileString(file, digests);\n return [\"--ignore-file\", file];\n });\n\nconst scanSecrets = ({\n config,\n root,\n args,\n input,\n}: {\n readonly config: BetterleaksConfig;\n readonly root: string;\n readonly args: readonly string[];\n readonly input?: string;\n}): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* scan() {\n const ignore = yield* ignoreFileArgs(config);\n return yield* runVendored(BETTERLEAKS, {\n root,\n args: [...args, \"--redact\", \"--no-banner\", ...ignore],\n env: { BETTERLEAKS_CONFIG_TOML: toBetterleaksToml(config) },\n input,\n });\n }).pipe(Effect.scoped);\n\nconst SUCCESS = 0;\n\nconst lacksHistory = (\n root: string,\n): Effect.Effect<boolean, PlatformError.PlatformError, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* history() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const shallow = yield* spawner.string(\n ChildProcess.make(\"git\", [\"rev-parse\", \"--is-shallow-repository\"], { cwd: root }),\n );\n const promisor = yield* spawner.exitCode(\n ChildProcess.make(\"git\", [\"config\", \"--get\", \"remote.origin.promisor\"], { cwd: root }),\n );\n return Str.trim(shallow) === \"true\" || promisor === SUCCESS;\n });\n\nconst succeeded = <Failure, Services>(\n tool: string,\n run: Effect.Effect<number, Failure, Services>,\n): Effect.Effect<void, Failure | VpToolsError, Services> =>\n run.pipe(\n Effect.flatMap((code) => {\n if (code === SUCCESS) {\n return Effect.void;\n }\n return Effect.fail(toolFailed(tool)(`exit code ${code}`));\n }),\n );\n\nconst scanCommittedTree = (\n config: BetterleaksConfig,\n root: string,\n): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* tree() {\n const fs = yield* FileSystem.FileSystem;\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const directory = yield* fs.makeTempDirectoryScoped({ prefix: \"vpa-betterleaks-\" });\n const archive = `${directory}.tar`;\n yield* succeeded(\n \"git archive\",\n spawner.exitCode(\n ChildProcess.make(\"git\", [\"archive\", \"--format=tar\", \"-o\", archive, \"HEAD\"], { cwd: root }),\n ),\n );\n yield* succeeded(\n \"tar\",\n spawner.exitCode(ChildProcess.make(\"tar\", [\"-xf\", archive, \"-C\", directory])),\n );\n yield* fs.remove(archive);\n return yield* scanSecrets({ config, root, args: [directory] });\n }).pipe(Effect.scoped);\n\nconst betterleaksCheck = withSection(\"betterleaks\", (config, { root, base }) =>\n lacksHistory(root).pipe(\n Effect.flatMap((partial) => {\n if (partial) {\n return scanCommittedTree(config, root);\n }\n return scanSecrets({ config, root, args: [\"git\", \".\", `--revision=${base}..HEAD`] });\n }),\n ),\n);\n\nconst STAGED_DIFF = [\n \"diff\",\n \"--cached\",\n \"--no-ext-diff\",\n \"--no-textconv\",\n \"--no-color\",\n \"--src-prefix=a/\",\n \"--dst-prefix=b/\",\n];\n\nconst scanStagedSecrets: {\n (root: string): (config: BetterleaksConfig) => Effect.Effect<Report, CheckError, CheckServices>;\n (config: BetterleaksConfig, root: string): Effect.Effect<Report, CheckError, CheckServices>;\n} = Fn.dual(\n DATA_FIRST_ARITY,\n (config: BetterleaksConfig, root: string): Effect.Effect<Report, CheckError, CheckServices> =>\n Effect.gen(function* staged() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const diff = yield* spawner.string(ChildProcess.make(\"git\", STAGED_DIFF, { cwd: root }));\n return yield* scanSecrets({ config, root, args: [\"stdin\", \"--git-diff\"], input: diff });\n }),\n);\n\n/** @internal */\nexport { betterleaksCheck, scanStagedSecrets };\n","import { Effect, Option, Path, Array as Arr, Record as Rec, pipe, Function as Fn } from \"effect\";\nimport type { LintError, Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\n\nimport { attempt } from \"./attempt.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { MarkdownlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst formatError =\n (file: string) =>\n (error: LintError): string => {\n const detail = pipe(\n [error.errorDetail, error.errorContext],\n Arr.filter((part): part is string => part !== null && part !== \"\"),\n Arr.map((part) => ` [${part}]`),\n Arr.join(\"\"),\n );\n return `${file}:${error.lineNumber} ${Arr.join(error.ruleNames, \"/\")} ${error.ruleDescription}${detail}`;\n };\n\nconst optionsOf = (config: MarkdownlintConfig, files: readonly string[]): Options => ({\n files: [...files],\n ...pipe(\n Option.fromNullishOr(config.config),\n Option.match({ onNone: () => ({}), onSome: (rules) => ({ config: rules }) }),\n ),\n ...pipe(\n Option.fromNullishOr(config.customRules),\n Option.match({ onNone: () => ({}), onSome: (rules) => ({ customRules: [...rules] }) }),\n ),\n});\n\nconst lintMarkdown: {\n (\n root: string,\n files: readonly string[],\n ): (config: MarkdownlintConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: MarkdownlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: MarkdownlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* markdown() {\n const path = yield* Path.Path;\n const absolute = pipe(\n files,\n Arr.map((file) => path.join(root, file)),\n );\n const results = yield* attempt(\"markdownlint\")(() => lint(optionsOf(config, absolute)));\n const linesOf = ([file, errors]: readonly [\n string,\n readonly LintError[],\n ]): readonly string[] => {\n const format = formatError(path.relative(root, file));\n return pipe(errors, Arr.map(format));\n };\n const lines = pipe(Rec.toEntries(results), Arr.flatMap(linesOf));\n return { valid: Arr.isArrayEmpty(lines), output: Arr.join(lines, \"\\n\") };\n }),\n);\n\n/** @internal */\nexport { lintMarkdown };\n","import { loadPackagesFromRawConfig } from \"@textlint/config-loader\";\nimport type { TextlintLoadPackagesFromRawConfigResult } from \"@textlint/config-loader\";\nimport { TextlintKernelDescriptor } from \"@textlint/kernel\";\nimport { Effect, Path, Array as Arr, pipe, Function as Fn } from \"effect\";\nimport { createLinter, loadLinterFormatter } from \"textlint\";\nimport { builtInPlugins } from \"textlint/lib/src/loader/TextlintrcLoader.js\";\n\nimport { attempt } from \"./attempt.ts\";\nimport { toolFailed } from \"./errors.ts\";\nimport type { VpToolsError } from \"./errors.ts\";\nimport type { Report } from \"./report.ts\";\nimport type { TextlintConfig } from \"./types.ts\";\n\nconst DATA_FIRST_ARITY_3 = 3;\n\nconst descriptorOf = (\n loaded: TextlintLoadPackagesFromRawConfigResult,\n root: string,\n): Effect.Effect<TextlintKernelDescriptor, VpToolsError> => {\n if (!loaded.ok) {\n return Effect.fail(toolFailed(\"textlint\")(loaded.error.message));\n }\n return Effect.succeed(\n new TextlintKernelDescriptor({\n rules: loaded.config.rules,\n filterRules: loaded.config.filterRules,\n plugins: [...builtInPlugins, ...loaded.config.plugins],\n configBaseDir: root,\n }),\n );\n};\n\nconst lintTexts: {\n (\n root: string,\n files: readonly string[],\n ): (config: TextlintConfig) => Effect.Effect<Report, VpToolsError, Path.Path>;\n (\n config: TextlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path>;\n} = Fn.dual(\n DATA_FIRST_ARITY_3,\n (\n config: TextlintConfig,\n root: string,\n files: readonly string[],\n ): Effect.Effect<Report, VpToolsError, Path.Path> =>\n Effect.gen(function* lint() {\n const path = yield* Path.Path;\n const { ignores: _ignores, ...rawConfig } = config;\n const loaded = yield* attempt(\"textlint\")(() =>\n loadPackagesFromRawConfig({ rawConfig, node_moduleDir: path.join(root, \"node_modules\") }),\n );\n const descriptor = yield* descriptorOf(loaded, root);\n const absolute = pipe(\n files,\n Arr.map((file) => path.join(root, file)),\n );\n const results = yield* attempt(\"textlint\")(() =>\n createLinter({ descriptor }).lintFiles([...absolute]),\n );\n const formatter = yield* attempt(\"textlint\")(() =>\n loadLinterFormatter({ formatterName: \"stylish\", color: false }),\n );\n return {\n valid: pipe(\n results,\n Arr.every((result) => Arr.isArrayEmpty(result.messages)),\n ),\n output: formatter.format(results),\n };\n }),\n);\n\n/** @internal */\nexport { lintTexts };\n","import { Effect, Array as Arr, pipe } from \"effect\";\n\nimport { lintCommitMessages } from \"./commitlint.ts\";\nimport { listCommitMessages, listGitFiles } from \"./git.ts\";\nimport { lintMarkdown } from \"./markdownlint.ts\";\nimport { withSection } from \"./section-check.ts\";\nimport { lintTexts } from \"./textlint.ts\";\n\nconst MARKDOWN = \"*.md\";\n\nconst markdownFiles = (\n root: string,\n ignores: readonly string[] = [],\n): ReturnType<typeof listGitFiles> =>\n listGitFiles(root, [\n MARKDOWN,\n ...pipe(\n ignores,\n Arr.map((glob) => `:(glob,exclude)${glob}`),\n ),\n ]);\n\nconst textlintCheck = withSection(\"textlint\", (config, { root }) =>\n markdownFiles(root, config.ignores).pipe(\n Effect.flatMap((files) => lintTexts(config, root, files)),\n ),\n);\n\nconst markdownlintCheck = withSection(\"markdownlint\", (config, { root }) =>\n markdownFiles(root, config.ignores).pipe(\n Effect.flatMap((files) => lintMarkdown(config, root, files)),\n ),\n);\n\nconst commitlintCheck = withSection(\"commitlint\", (config, { root, base }) =>\n listCommitMessages(root, `${base}..HEAD`).pipe(\n Effect.flatMap((messages) => lintCommitMessages(config, root, messages)),\n ),\n);\n\n/** @internal */\nexport { commitlintCheck, markdownlintCheck, textlintCheck };\n","import { Config, Effect, FileSystem, Option, Path, pipe } from \"effect\";\n\nimport { ACTIONLINT, ZIZMOR } from \"./binaries.ts\";\nimport type { Binary } from \"./binaries.ts\";\nimport type { Check } from \"./check.ts\";\nimport { runVendored } from \"./vendored.ts\";\n\nconst WORKFLOWS = \".github/workflows\";\n\nconst onWorkflows =\n (binary: Binary, args: Effect.Effect<readonly string[]>): Check =>\n ({ root }) =>\n Effect.gen(function* workflows() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n if (!(yield* fs.exists(path.join(root, WORKFLOWS)))) {\n return Option.none();\n }\n const resolvedArgs = yield* args;\n const ran = yield* runVendored(binary, { root, args: resolvedArgs });\n return Option.some(ran);\n });\n\nconst actionlintCheck = onWorkflows(ACTIONLINT, Effect.succeed([]));\n\nconst zizmorArgs = Effect.gen(function* zizmorArgs() {\n const remote = yield* Config.option(Config.String(\"CLAUDE_CODE_REMOTE\")).pipe(Effect.orDie);\n return pipe(\n remote,\n Option.match({\n onNone: () => [\".github\"],\n onSome: () => [\"--no-online-audits\", \".github\"],\n }),\n );\n});\n\nconst zizmorCheck = onWorkflows(ZIZMOR, zizmorArgs);\n\n/** @internal */\nexport { actionlintCheck, zizmorCheck };\n","import type { NamedCheck } from \"./check.ts\";\nimport { fallowCheck } from \"./fallow-check.ts\";\nimport { dependenciesCheck, steigerCheck } from \"./repository-checks.ts\";\nimport { betterleaksCheck } from \"./secret-checks.ts\";\nimport { commitlintCheck, markdownlintCheck, textlintCheck } from \"./text-checks.ts\";\nimport { actionlintCheck, zizmorCheck } from \"./workflow-checks.ts\";\n\nconst CHECKS: readonly NamedCheck[] = [\n { name: \"betterleaks\", run: betterleaksCheck },\n { name: \"commitlint\", run: commitlintCheck },\n { name: \"actionlint\", run: actionlintCheck },\n { name: \"zizmor\", run: zizmorCheck },\n { name: \"dependencies\", run: dependenciesCheck },\n { name: \"steiger\", run: steigerCheck },\n { name: \"textlint\", run: textlintCheck },\n { name: \"markdownlint\", run: markdownlintCheck },\n { name: \"fallow\", run: fallowCheck },\n];\n\nexport { CHECKS };\n","import type { Stdio } from \"effect\";\nimport { Config, Effect, Option, Array as Arr, pipe } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport type { CheckContext, CheckError, CheckServices, NamedCheck } from \"./check.ts\";\nimport { CHECKS } from \"./checks.ts\";\nimport { loadViteConfig } from \"./config.ts\";\nimport { checksFailed } from \"./errors.ts\";\nimport { writeTo } from \"./output.ts\";\nimport type { Report } from \"./report.ts\";\n\nconst DEFAULT_BASE = \"origin/main\";\nconst RESOLVED = 0;\n\nconst isCommit = (\n root: string,\n revision: string,\n): Effect.Effect<boolean, never, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* verify() {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const exitCode = yield* spawner.exitCode(\n ChildProcess.make(\"git\", [\"rev-parse\", \"-q\", \"--verify\", `${revision}^{commit}`], {\n cwd: root,\n }),\n );\n return exitCode === RESOLVED;\n }).pipe(Effect.orElseSucceed(() => false));\n\nconst resolveBase = (\n root: string,\n): Effect.Effect<string, never, ChildProcessSpawner.ChildProcessSpawner> =>\n Effect.gen(function* base() {\n const configured = yield* Config.option(Config.String(\"VPA_BASE\")).pipe(Effect.orDie);\n if (Option.isSome(configured) && (yield* isCommit(root, configured.value))) {\n return configured.value;\n }\n return DEFAULT_BASE;\n });\n\ninterface Outcome {\n readonly name: string;\n readonly report: Report;\n}\n\nconst describe = ({ name, report }: Outcome): string => {\n if (report.valid) {\n return `✓ ${name}`;\n }\n return `✗ ${name}\\n${report.output}`;\n};\n\nconst runCheck =\n (context: CheckContext) =>\n ({ name, run }: NamedCheck): Effect.Effect<Option.Option<Outcome>, CheckError, CheckServices> =>\n run(context).pipe(Effect.map(Option.map((report) => ({ name, report }))));\n\nconst runAllChecks = (root: string): Effect.Effect<void, CheckError, CheckServices | Stdio.Stdio> =>\n Effect.gen(function* all() {\n const config = yield* loadViteConfig(root);\n const base = yield* resolveBase(root);\n const outcomes = yield* pipe(\n CHECKS,\n Effect.forEach(runCheck({ root, config, base }), { concurrency: \"unbounded\" }),\n Effect.map(Arr.getSomes),\n );\n yield* writeTo(\"stdout\", `${pipe(outcomes, Arr.map(describe), Arr.join(\"\\n\"))}\\n`);\n return yield* pipe(\n outcomes,\n Arr.filter(({ report }) => !report.valid),\n Arr.map(({ name }) => name),\n Arr.match({\n onEmpty: () => Effect.void,\n onNonEmpty: (failed) => Effect.fail(checksFailed(`Failed: ${Arr.join(failed, \", \")}`)),\n }),\n );\n });\n\n/** @internal */\nexport { runAllChecks };\n","import { Effect, Option, Array as Arr, Record as Rec, pipe, Function as Fn } from \"effect\";\n\nimport type { CommandEffect } from \"./command.ts\";\nimport { lintCommitMessageFile } from \"./commitlint.ts\";\nimport { loadSection } from \"./config.ts\";\nimport { checksFailed } from \"./errors.ts\";\nimport { finish } from \"./output.ts\";\nimport { runAllChecks } from \"./run-checks.ts\";\nimport { scanStagedSecrets } from \"./secret-checks.ts\";\n\nconst DATA_FIRST_ARITY = 2;\n\nconst USAGE = pipe(\n [\n \"Usage: vpa run every check configured in vite.config.ts\",\n \" vpa --staged scan the staged changes for secrets (pre-commit)\",\n \" vpa --commit-msg <file> lint a commit message (commit-msg)\",\n ],\n Arr.join(\"\\n\"),\n);\n\nconst usage: CommandEffect = Effect.fail(checksFailed(USAGE));\n\nconst stagedSecrets = (root: string): CommandEffect =>\n loadSection(root, \"betterleaks\").pipe(\n Effect.flatMap((config) => scanStagedSecrets(config, root)),\n Effect.flatMap(finish),\n );\n\nconst commitMessage = (root: string, rest: readonly string[]): CommandEffect =>\n pipe(\n Arr.head(rest),\n Option.match({\n onNone: () => usage,\n onSome: (file) =>\n loadSection(root, \"commitlint\").pipe(\n Effect.flatMap((config) => lintCommitMessageFile(config, root, file)),\n Effect.flatMap(finish),\n ),\n }),\n );\n\nconst HOOKS: Readonly<Record<string, (root: string, rest: readonly string[]) => CommandEffect>> = {\n \"--staged\": stagedSecrets,\n \"--commit-msg\": commitMessage,\n};\n\nconst runVpa: {\n (args: readonly string[]): (root: string) => CommandEffect;\n (root: string, args: readonly string[]): CommandEffect;\n} = Fn.dual(DATA_FIRST_ARITY, (root: string, args: readonly string[]): CommandEffect =>\n pipe(\n args,\n Arr.match({\n onEmpty: () => runAllChecks(root),\n onNonEmpty: ([flag, ...rest]) =>\n pipe(\n Rec.get(HOOKS, flag),\n Option.match({ onNone: () => usage, onSome: (hook) => hook(root, rest) }),\n ),\n }),\n ),\n);\n\n/** @internal */\nexport { runVpa };\n","import { Effect, Path, Stdio } from \"effect\";\n\nimport { runCli } from \"./run-cli.ts\";\nimport { runVpa } from \"./vpa.ts\";\n\nrunCli(\n Effect.gen(function* main() {\n const stdio = yield* Stdio.Stdio;\n const path = yield* Path.Path;\n const args = yield* stdio.args;\n return yield* runVpa(path.resolve(\".\"), args);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYA,MAAMA,uBAAqB;AAE3B,MAAM,eAAe;AAErB,MAAM,mBAAmB,WAAoE;CAO3F,OAAO;EAAE,GANM,KACb,OAAO,cAAc,OAA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KAAK,IAAI,GACb,OAAO,MAAM;CACX,cAAc;CACd,SAAS,SACP,YAAY,MAAM,YAAY,CAAC,CAAC,KAC9B,OAAO,SAAS,WAAW,sBAAsB,QAAQ,MAAM,IAAI,CAAC,GACpE,OAAO,QAAQ,MAAM,CACvB;AACJ,CAAC,CACH;AAEF,MAAM,QAA4F;CAChG,YAAY;CACZ,gBAAgB;AAClB;AAEA,MAAM,SAGFC,SAAG,KAAK,mBAAmB,MAAc,SAC3C,KACE,MACAD,MAAI,MAAM;CACR,eAAe,aAAa,IAAI;CAChC,aAAa,CAAC,MAAM,GAAG,UACrB,KACEE,OAAI,IAAI,OAAO,IAAI,GACnB,OAAO,MAAM;EAAE,cAAc;EAAO,SAAS,SAAS,KAAK,MAAM,IAAI;CAAE,CAAC,CAC1E;AACJ,CAAC,CACH,CACF;;ACzDA,OACE,OAAO,IAAI,UAAU,OAAO;CAC1B,MAAM,QAAQ,OAAO,MAAM;CAC3B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,OAAO,OAAO,MAAM;CAC1B,OAAO,OAAO,OAAO,KAAK,QAAQ,GAAG,GAAG,IAAI;AAC9C,CAAC,CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/vite-plus-adopt",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Adopt Betterleaks, actionlint, zizmor, commitlint, textlint, Steiger and dependency checks into Vite+ through the settings in vite.config.ts, and ship the Feature-Sliced Design Steiger plugin and @arethetypeswrong/core for TypeScript 7.",
5
5
  "keywords": [
6
6
  "actionlint",
@@ -65,12 +65,12 @@
65
65
  "@loaderkit/resolve": "1.0.6",
66
66
  "@textlint/config-loader": "15.8.0",
67
67
  "@textlint/kernel": "15.8.0",
68
- "cjs-module-lexer": "1.4.3",
68
+ "cjs-module-lexer": "2.3.0",
69
69
  "effect": "4.1.2",
70
70
  "fastest-levenshtein": "^1.0.16",
71
71
  "fflate": "^0.8.3",
72
72
  "markdownlint": "0.42.1",
73
- "minimatch": "11.0.3",
73
+ "minimatch": "11.0.5",
74
74
  "pluralize": "8.0.0",
75
75
  "semver": "7.8.6",
76
76
  "smol-toml": "1.9.1",
@@ -78,8 +78,8 @@
78
78
  "textlint": "15.8.0",
79
79
  "tsconfck": "3.1.6",
80
80
  "typescript": "7.1.0-beta",
81
- "validate-npm-package-name": "5.0.1",
82
- "web-tree-sitter": "0.26.13",
81
+ "validate-npm-package-name": "8.0.0",
82
+ "web-tree-sitter": "0.27.1",
83
83
  "yaml": "2.9.1"
84
84
  },
85
85
  "devDependencies": {
@@ -105,7 +105,7 @@
105
105
  "!dist/fsd.mjs",
106
106
  "!dist/attw.mjs"
107
107
  ],
108
- "limit": "10402 B"
108
+ "limit": "10698 B"
109
109
  },
110
110
  {
111
111
  "name": "fsd",