workspace-conformance 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,72 @@
1
1
  import { CompilerOptions } from "ts-morph";
2
2
  import { ConfigFileOptions, LayoutConfig, RankSkipOptions, Section } from "@exadev/config";
3
3
  import { z } from "zod";
4
+ import { IViolation } from "dependency-cruiser";
5
+ //#region src/github.d.ts
6
+ /**
7
+ * A repository on GitHub.
8
+ */
9
+ interface RepositorySlug {
10
+ readonly owner: string;
11
+ readonly name: string;
12
+ }
13
+ /**
14
+ * The repository settings the settings checks read.
15
+ */
16
+ interface RepositorySettings {
17
+ readonly defaultBranch: string;
18
+ readonly allowRebaseMerge: boolean;
19
+ readonly allowSquashMerge: boolean;
20
+ readonly allowMergeCommit: boolean;
21
+ }
22
+ /**
23
+ * The rules that apply to a branch, whichever ruleset they come from, reduced to what the settings checks read.
24
+ */
25
+ interface BranchRules {
26
+ /**
27
+ * One entry per `required_status_checks` rule.
28
+ */
29
+ readonly requiredStatusChecks: readonly {
30
+ readonly contexts: readonly string[];
31
+ readonly strict: boolean;
32
+ }[];
33
+ /**
34
+ * One entry per `pull_request` rule. `allowedMergeMethods` is undefined when the rule does not restrict them.
35
+ */
36
+ readonly pullRequests: readonly {
37
+ readonly requiredReviewThreadResolution: boolean;
38
+ readonly allowedMergeMethods: readonly string[] | undefined;
39
+ }[];
40
+ }
41
+ /**
42
+ * What the settings checks need from GitHub, so a test or another host can supply it without a network. The real implementation is {@link createGitHubClient}. Both methods reject when the repository or branch cannot be read.
43
+ */
44
+ interface GitHubClient {
45
+ readonly repository: (slug: RepositorySlug) => Promise<RepositorySettings>;
46
+ readonly branchRules: (slug: RepositorySlug, branch: string) => Promise<BranchRules>;
47
+ }
48
+ /**
49
+ * Options of {@link createGitHubClient}.
50
+ */
51
+ interface GitHubClientOptions {
52
+ /**
53
+ * A token that can read the repository's settings and rulesets. The API reports the merge-method settings only to a token with write access to the repository, so a token without it makes {@link GitHubClient.repository} reject.
54
+ */
55
+ readonly token: string;
56
+ /**
57
+ * The API root. `https://api.github.com` when omitted.
58
+ */
59
+ readonly apiUrl?: string;
60
+ /**
61
+ * The `fetch` to use. The global one when omitted.
62
+ */
63
+ readonly fetch?: typeof fetch;
64
+ }
65
+ /**
66
+ * A {@link GitHubClient} over the REST API.
67
+ */
68
+ export declare function createGitHubClient(options: GitHubClientOptions): GitHubClient;
69
+ //#endregion
4
70
  //#region src/check.d.ts
5
71
  /**
6
72
  * A position in a file, both numbers counted from 1.
@@ -52,6 +118,237 @@ type CheckFunction<Options> = (context: CheckContext<Options>) => Promise<readon
52
118
  * A check that also needs the resolved workspace layout.
53
119
  */
54
120
  type LayoutCheckFunction<Options> = (context: LayoutCheckContext<Options>) => Promise<readonly Violation[]>;
121
+ /**
122
+ * What a check that reads repository settings through the GitHub API receives.
123
+ */
124
+ interface GitHubCheckContext<Options> extends CheckContext<Options> {
125
+ readonly github: GitHubClient;
126
+ }
127
+ /**
128
+ * A check that reads repository settings through the GitHub API. Its violations name the repository (`owner/name`) as the file.
129
+ */
130
+ type GitHubCheckFunction<Options> = (context: GitHubCheckContext<Options>) => Promise<readonly Violation[]>;
131
+ //#endregion
132
+ //#region src/migrations/adapters.d.ts
133
+ /**
134
+ * Which of several things in a deploy tool's config the generator's output belongs to.
135
+ */
136
+ interface DeploySelector {
137
+ /**
138
+ * The binding of the database, when the config declares more than one.
139
+ */
140
+ readonly database?: string;
141
+ /**
142
+ * The named environment whose settings apply instead of the top-level ones.
143
+ */
144
+ readonly environment?: string;
145
+ }
146
+ /**
147
+ * What a deploy tool's config says about the directory it applies migrations from.
148
+ */
149
+ type DeployDirectory = {
150
+ readonly directory: string;
151
+ readonly none?: never;
152
+ } | {
153
+ readonly none: string;
154
+ readonly directory?: never;
155
+ };
156
+ /**
157
+ * A schema generator, for the cross-check between where it writes migrations and where the deploy tool applies them from. The data of a config file is already read; an adapter only knows where in it the directory is.
158
+ */
159
+ interface GeneratorAdapter {
160
+ /**
161
+ * The names the config file may have, by precedence. The extension decides how the file is read.
162
+ */
163
+ readonly configFiles: readonly [string, ...string[]];
164
+ /**
165
+ * Matches a shell command that applies migrations with the generator itself, bypassing the deploy tool.
166
+ */
167
+ readonly applyCommand: RegExp;
168
+ /**
169
+ * The command as it is written, for messages.
170
+ */
171
+ readonly applyCommandName: string;
172
+ /**
173
+ * The directory the generator writes migrations to, as the config writes it (relative to the config file's directory) or the generator's default when the config sets none. Throws `ConformanceError` when the config is not of a shape the adapter can read.
174
+ */
175
+ readonly outputDirectory: (config: unknown, file: string) => string;
176
+ }
177
+ /**
178
+ * A deploy tool that applies migrations from a directory.
179
+ */
180
+ interface DeployToolAdapter {
181
+ /**
182
+ * The names the config file may have, by precedence. The extension decides how the file is read.
183
+ */
184
+ readonly configFiles: readonly [string, ...string[]];
185
+ /**
186
+ * The directory the tool applies migrations from, as the config writes it (relative to the config file's directory) or the tool's default when the config sets none. Throws `ConformanceError` when the config is not of a shape the adapter can read or `selector` is needed and absent.
187
+ */
188
+ readonly migrationsDirectory: (config: unknown, file: string, selector: DeploySelector) => DeployDirectory;
189
+ }
190
+ /**
191
+ * The generators that have an adapter.
192
+ */
193
+ declare const generatorNames: readonly ["drizzle-kit"];
194
+ /**
195
+ * The deploy tools that have an adapter.
196
+ */
197
+ declare const deployToolNames: readonly ["wrangler"];
198
+ type GeneratorName = (typeof generatorNames)[number];
199
+ type DeployToolName = (typeof deployToolNames)[number];
200
+ export declare const generators: Readonly<Record<GeneratorName, GeneratorAdapter>>;
201
+ export declare const deployTools: Readonly<Record<DeployToolName, DeployToolAdapter>>;
202
+ //#endregion
203
+ //#region src/workflows/model.d.ts
204
+ /**
205
+ * How much of a scope the `GITHUB_TOKEN` is granted.
206
+ */
207
+ type PermissionAccess = "read" | "write" | "none";
208
+ /**
209
+ * The `permissions` of a workflow or job as written. A scope missing from a `scopes` mapping is `none`, because GitHub sets every scope that is not specified to `none` as soon as any is specified. When nothing is declared the token gets the repository's default permissions, a setting the workflow file cannot show.
210
+ */
211
+ type Permissions = {
212
+ readonly kind: "default";
213
+ } | {
214
+ readonly kind: "all";
215
+ readonly access: "read" | "write";
216
+ } | {
217
+ readonly kind: "scopes";
218
+ readonly scopes: ReadonlyMap<string, PermissionAccess>;
219
+ };
220
+ /**
221
+ * The access `permissions` grants to `scope`, or `undefined` when the permissions are not declared and the repository default applies.
222
+ */
223
+ export declare function accessOf(permissions: Permissions, scope: string): PermissionAccess | undefined;
224
+ /**
225
+ * What a job's `runs-on` names: literal labels, labels that are expressions, and a runner group.
226
+ */
227
+ interface RunsOn {
228
+ readonly labels: readonly string[];
229
+ readonly expressions: readonly string[];
230
+ readonly group: string | undefined;
231
+ }
232
+ /**
233
+ * One step of a job. Every value is the text written in the file; expressions are not evaluated.
234
+ */
235
+ interface Step {
236
+ readonly index: number;
237
+ readonly id: string | undefined;
238
+ readonly name: string | undefined;
239
+ readonly uses: string | undefined;
240
+ readonly run: string | undefined;
241
+ readonly with: Readonly<Record<string, string>>;
242
+ readonly env: Readonly<Record<string, string>>;
243
+ readonly condition: string | undefined;
244
+ readonly location: SourceLocation;
245
+ }
246
+ /**
247
+ * One job. A job that calls a reusable workflow has `uses` and no steps.
248
+ */
249
+ interface Job {
250
+ readonly id: string;
251
+ readonly name: string | undefined;
252
+ /**
253
+ * The jobs named by `needs`, directly.
254
+ */
255
+ readonly needs: readonly string[];
256
+ readonly condition: string | undefined;
257
+ readonly permissions: Permissions;
258
+ readonly env: Readonly<Record<string, string>>;
259
+ readonly runsOn: RunsOn;
260
+ readonly timeoutMinutes: string | undefined;
261
+ readonly uses: string | undefined;
262
+ readonly with: Readonly<Record<string, string>>;
263
+ readonly outputs: Readonly<Record<string, string>>;
264
+ readonly steps: readonly Step[];
265
+ readonly location: SourceLocation;
266
+ }
267
+ /**
268
+ * A parsed workflow file.
269
+ */
270
+ interface Workflow {
271
+ /**
272
+ * The path relative to the directory the checks run in, with `/` separators.
273
+ */
274
+ readonly file: string;
275
+ readonly name: string | undefined;
276
+ /**
277
+ * The events in `on`, each with its configuration (`undefined` for an event written without any).
278
+ */
279
+ readonly triggers: ReadonlyMap<string, unknown>;
280
+ /**
281
+ * Where each event of `triggers` is written.
282
+ */
283
+ readonly triggerLocations: ReadonlyMap<string, SourceLocation>;
284
+ readonly permissions: Permissions;
285
+ readonly env: Readonly<Record<string, string>>;
286
+ readonly jobs: readonly Job[];
287
+ /**
288
+ * The `value` of each output a reusable workflow declares under `on.workflow_call.outputs`.
289
+ */
290
+ readonly callOutputs: Readonly<Record<string, string>>;
291
+ }
292
+ /**
293
+ * Parse the text of a workflow file into the model the checks read. It throws `ConformanceError` when the file is not YAML or is not shaped like a workflow, since a check cannot judge what it cannot read.
294
+ */
295
+ export declare function parseWorkflow(file: string, source: string): Workflow;
296
+ /**
297
+ * The permissions that apply to a job: its own when it declares any, else the workflow's. A job's declaration replaces the workflow's whole, it is not merged with it.
298
+ */
299
+ export declare function effectivePermissions(workflow: Workflow, job: Job): Permissions;
300
+ /**
301
+ * The environment a step runs with: the workflow's, the job's and the step's, the later winning.
302
+ */
303
+ export declare function effectiveEnv(workflow: Workflow, job: Job, step: Step | undefined): Readonly<Record<string, string>>;
304
+ /**
305
+ * Every job `jobId` waits for, directly or through other jobs, not including itself. A `needs` that names no job of the workflow is followed no further.
306
+ */
307
+ export declare function transitiveNeeds(workflow: Workflow, jobId: string): ReadonlySet<string>;
308
+ /**
309
+ * A `uses` value: a local action or workflow, a Docker image, or a repository reference.
310
+ */
311
+ type UsesReference = {
312
+ readonly kind: "local";
313
+ readonly path: string;
314
+ } | {
315
+ readonly kind: "docker";
316
+ readonly image: string;
317
+ readonly digest: string | undefined;
318
+ } | {
319
+ readonly kind: "remote";
320
+ readonly owner: string;
321
+ readonly repository: string;
322
+ readonly path: string;
323
+ readonly ref: string | undefined;
324
+ };
325
+ /**
326
+ * Split a `uses` value into its parts.
327
+ */
328
+ export declare function parseUses(uses: string): UsesReference;
329
+ //#endregion
330
+ //#region src/workflows/load.d.ts
331
+ /**
332
+ * Which workflow files a check reads.
333
+ */
334
+ interface WorkflowSelection {
335
+ /**
336
+ * Globs of the workflow files, relative to the directory the checks run in. `.github/workflows/*.yml` and `.github/workflows/*.yaml` when omitted.
337
+ */
338
+ readonly workflows?: readonly string[];
339
+ /**
340
+ * Globs of files that are left out.
341
+ */
342
+ readonly exclude?: readonly string[];
343
+ }
344
+ /**
345
+ * Where GitHub looks for workflows: only this directory, and only the files directly in it.
346
+ */
347
+ export declare const DEFAULT_WORKFLOWS: readonly string[];
348
+ /**
349
+ * Read and parse the selected workflow files, sorted by path.
350
+ */
351
+ export declare function loadWorkflows(cwd: string, selection: WorkflowSelection): Promise<readonly Workflow[]>;
55
352
  //#endregion
56
353
  //#region src/options.d.ts
57
354
  /**
@@ -177,6 +474,188 @@ interface DockerfilePackageManagerOptions {
177
474
  */
178
475
  readonly packageJson?: string;
179
476
  }
477
+ /**
478
+ * Options of the `migrations-directory` check: the directory a schema generator writes migrations to is the one the deploy tool applies them from, and no script applies them with the generator.
479
+ */
480
+ interface MigrationsDirectoryOptions {
481
+ /**
482
+ * The schema generator, which has an adapter that knows its config file and where in it the output directory is.
483
+ */
484
+ readonly generator: GeneratorName;
485
+ /**
486
+ * The deploy tool, which has an adapter that knows its config file and where in it the migrations directory is.
487
+ */
488
+ readonly deployTool: DeployToolName;
489
+ /**
490
+ * The generator's config file, relative to the directory the checks run in. The first of the adapter's default file names that exists when omitted.
491
+ */
492
+ readonly generatorConfig?: string;
493
+ /**
494
+ * The deploy tool's config file. The first of the adapter's default file names that exists when omitted.
495
+ */
496
+ readonly deployConfig?: string;
497
+ /**
498
+ * The binding of the database the generator writes migrations for. Needed when the deploy config declares more than one; the only one is used when omitted.
499
+ */
500
+ readonly database?: string;
501
+ /**
502
+ * The named environment of the deploy config to read instead of its top-level settings.
503
+ */
504
+ readonly environment?: string;
505
+ /**
506
+ * Globs of the `package.json` files whose scripts are searched for the generator's apply command. Every `package.json` at any depth when omitted.
507
+ */
508
+ readonly packageJsons?: readonly string[];
509
+ }
510
+ /**
511
+ * Options of the `workflow-job-ordering` check: the jobs that release, deploy and report a required check are ordered so a failure stops what follows. Jobs are named by id; a role whose jobs are absent from a workflow is not judged there.
512
+ */
513
+ interface WorkflowJobOrderingOptions extends WorkflowSelection {
514
+ /**
515
+ * Ids of release jobs, which must wait for every deploy job. `release` when omitted.
516
+ */
517
+ readonly releaseJobs?: readonly string[];
518
+ /**
519
+ * Ids of deploy jobs. `deploy` when omitted.
520
+ */
521
+ readonly deployJobs?: readonly string[];
522
+ /**
523
+ * Ids of jobs that deploy documentation, which must wait for every release job and check out the default branch afresh. `docs-deploy` when omitted.
524
+ */
525
+ readonly docsDeployJobs?: readonly string[];
526
+ /**
527
+ * Ids of junction jobs: the one job that reports a single required check for the whole workflow. `required-checks` when omitted.
528
+ */
529
+ readonly junctionJobs?: readonly string[];
530
+ /**
531
+ * Ids of jobs a junction job need not wait for, such as a release job that only runs after the junction's own checks or a job that runs on demand only.
532
+ */
533
+ readonly junctionExempt?: readonly string[];
534
+ /**
535
+ * The default branch a documentation job must check out when it names a branch literally. `main` when omitted. The `github.event.repository.default_branch` expression is always accepted.
536
+ */
537
+ readonly defaultBranch?: string;
538
+ }
539
+ /**
540
+ * Options of the `workflow-skippable-jobs` check: a path filter must not leave a required check pending or skip a job without a junction job to report for it.
541
+ */
542
+ interface WorkflowSkippableJobsOptions extends WorkflowSelection {
543
+ /**
544
+ * Ids of junction jobs. `required-checks` when omitted.
545
+ */
546
+ readonly junctionJobs?: readonly string[];
547
+ /**
548
+ * The actions whose outputs say which paths changed, as `owner/repository`. `dorny/paths-filter`, `tj-actions/changed-files` and `step-security/changed-files` when omitted.
549
+ */
550
+ readonly pathFilterActions?: readonly string[];
551
+ }
552
+ /**
553
+ * Options of the `workflow-runner-resolution` check: a self-hosted or custom runner label is resolved once and read, not repeated.
554
+ */
555
+ interface WorkflowRunnerResolutionOptions extends WorkflowSelection {
556
+ /**
557
+ * Regular expressions, as source text, for the labels GitHub hosts itself and that may be repeated freely. `ubuntu`, `windows` and `macos` images, `-latest`, versioned, `-arm`, `-intel`, `-xlarge`, `-large` and `-slim` forms, when omitted. Setting it replaces that default.
558
+ */
559
+ readonly hostedLabels?: readonly string[];
560
+ }
561
+ /**
562
+ * Options of the `workflow-version-single-source` check.
563
+ */
564
+ type WorkflowVersionSingleSourceOptions = WorkflowSelection;
565
+ /**
566
+ * Options of the `workflow-credentials` check.
567
+ */
568
+ type WorkflowCredentialsOptions = WorkflowSelection;
569
+ /**
570
+ * Options of the `workflow-repository-dispatch` check: what a handler of `repository_dispatch` may do.
571
+ */
572
+ interface WorkflowRepositoryDispatchOptions extends WorkflowSelection {
573
+ /**
574
+ * Branch names that count as the default branch when a push names one literally. `main` and `master` when omitted. The `github.event.repository.default_branch` expression always counts.
575
+ */
576
+ readonly defaultBranches?: readonly string[];
577
+ /**
578
+ * Set when the repository has a rule requiring status checks on the default branch, which is what makes `gh pr merge --auto` wait. The file cannot show it, so by default an auto merge in a handler is reported; the `settings-required-checks` check verifies the rule itself.
579
+ */
580
+ readonly assumeRequiredChecks?: boolean;
581
+ }
582
+ /**
583
+ * Options of the `workflow-update-bot-cooldown` check: the update bots wait before proposing a release.
584
+ */
585
+ interface WorkflowUpdateBotCooldownOptions {
586
+ /**
587
+ * The Dependabot config, relative to the directory the checks run in. `.github/dependabot.yml`, else `.github/dependabot.yaml`, when omitted.
588
+ */
589
+ readonly dependabot?: string;
590
+ /**
591
+ * The Renovate config. `renovate.json`, `.renovaterc.json`, `.renovaterc` and `.github/renovate.json`, the first that exists, when omitted.
592
+ */
593
+ readonly renovate?: string;
594
+ }
595
+ /**
596
+ * Options of the `workflow-merge-group` check.
597
+ */
598
+ type WorkflowMergeGroupOptions = WorkflowSelection;
599
+ /**
600
+ * How strictly a reference must be pinned: to a full commit SHA, or any ref (tag, branch or SHA).
601
+ */
602
+ type PinningLevel = "sha" | "ref";
603
+ /**
604
+ * Options of the `workflow-action-pinning` check: the pinning policy for what workflows `uses`.
605
+ */
606
+ interface WorkflowActionPinningOptions extends WorkflowSelection {
607
+ /**
608
+ * What an action or reusable workflow from outside `organisations` must be pinned to. `sha` when omitted.
609
+ */
610
+ readonly thirdParty?: PinningLevel;
611
+ /**
612
+ * What an action or reusable workflow owned by one of `organisations` must be pinned to. `ref` when omitted.
613
+ */
614
+ readonly sameOrganisation?: PinningLevel;
615
+ /**
616
+ * The owners (users or organisations) that count as the same organisation. None when omitted, so nothing is relaxed unless it is named.
617
+ */
618
+ readonly organisations?: readonly string[];
619
+ /**
620
+ * Repositories exempt from the policy, as `owner/repository` or `owner/*`.
621
+ */
622
+ readonly allow?: readonly string[];
623
+ }
624
+ /**
625
+ * What the settings checks need to find the repository.
626
+ */
627
+ interface SettingsOptions {
628
+ /**
629
+ * The repository as `owner/name`. The `origin` remote of the working directory when omitted.
630
+ */
631
+ readonly repository?: string;
632
+ /**
633
+ * The branch whose rules are read. The repository's default branch when omitted.
634
+ */
635
+ readonly branch?: string;
636
+ }
637
+ /**
638
+ * Options of the `settings-merge-methods` check.
639
+ */
640
+ interface SettingsMergeMethodsOptions extends SettingsOptions {
641
+ /**
642
+ * The only merge method the repository allows. `rebase` when omitted.
643
+ */
644
+ readonly allowed?: "rebase" | "squash" | "merge";
645
+ }
646
+ /**
647
+ * Options of the `settings-required-checks` check.
648
+ */
649
+ interface SettingsRequiredChecksOptions extends SettingsOptions, WorkflowSelection {
650
+ /**
651
+ * Ids of the junction jobs whose check names must be required. `required-checks` when omitted.
652
+ */
653
+ readonly junctionJobs?: readonly string[];
654
+ }
655
+ /**
656
+ * Options of the `settings-review-thread-resolution` check.
657
+ */
658
+ type SettingsReviewThreadResolutionOptions = SettingsOptions;
180
659
  /**
181
660
  * The options of every check, by check name.
182
661
  */
@@ -192,6 +671,19 @@ interface CheckOptionsByName {
192
671
  readonly "single-storybook": SingleStorybookOptions;
193
672
  readonly "commit-types": CommitTypesOptions;
194
673
  readonly "dockerfile-package-manager": DockerfilePackageManagerOptions;
674
+ readonly "migrations-directory": MigrationsDirectoryOptions;
675
+ readonly "workflow-job-ordering": WorkflowJobOrderingOptions;
676
+ readonly "workflow-skippable-jobs": WorkflowSkippableJobsOptions;
677
+ readonly "workflow-runner-resolution": WorkflowRunnerResolutionOptions;
678
+ readonly "workflow-version-single-source": WorkflowVersionSingleSourceOptions;
679
+ readonly "workflow-credentials": WorkflowCredentialsOptions;
680
+ readonly "workflow-repository-dispatch": WorkflowRepositoryDispatchOptions;
681
+ readonly "workflow-update-bot-cooldown": WorkflowUpdateBotCooldownOptions;
682
+ readonly "workflow-merge-group": WorkflowMergeGroupOptions;
683
+ readonly "workflow-action-pinning": WorkflowActionPinningOptions;
684
+ readonly "settings-merge-methods": SettingsMergeMethodsOptions;
685
+ readonly "settings-required-checks": SettingsRequiredChecksOptions;
686
+ readonly "settings-review-thread-resolution": SettingsReviewThreadResolutionOptions;
195
687
  }
196
688
  /**
197
689
  * The name of a check.
@@ -238,6 +730,116 @@ export declare const commitTypes: CheckFunction<CommitTypesOptions>;
238
730
  */
239
731
  export declare const dockerfilePackageManager: CheckFunction<DockerfilePackageManagerOptions>;
240
732
  //#endregion
733
+ //#region src/workspace/packages.d.ts
734
+ /**
735
+ * A package directory found under the workspace root, before the layout classifies it.
736
+ */
737
+ interface DiscoveredPackage {
738
+ /**
739
+ * Relative to the workspace root, with `/` separators.
740
+ */
741
+ readonly dir: string;
742
+ /**
743
+ * The manifest's `name`; a manifest may omit it.
744
+ */
745
+ readonly name: string | undefined;
746
+ }
747
+ /**
748
+ * A workspace package as the layout sees it.
749
+ */
750
+ interface WorkspacePackage extends DiscoveredPackage {
751
+ /**
752
+ * The name of the group whose root is the longest prefix of the package directory.
753
+ */
754
+ readonly group: string;
755
+ /**
756
+ * The rank from `nameRanks`, else the group's rank, else `defaultRank`; `undefined` when none of them applies.
757
+ */
758
+ readonly rank: number | undefined;
759
+ /**
760
+ * The slice the group's `slice` rule derives; `undefined` for a group without one and for a package that yields none.
761
+ */
762
+ readonly slice: string | undefined;
763
+ }
764
+ /**
765
+ * Classify discovered packages by the layout: group, rank and slice. Pure.
766
+ *
767
+ * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
768
+ */
769
+ export declare function classifyPackages(discovered: readonly DiscoveredPackage[], layout: LayoutConfig): readonly WorkspacePackage[];
770
+ //#endregion
771
+ //#region src/workspace/rules.d.ts
772
+ /**
773
+ * A forbidden-dependency rule in the shape dependency-cruiser takes: a dependency from a file matching `from` to a file matching `to` is a violation.
774
+ */
775
+ interface ImportRule {
776
+ readonly name: string;
777
+ readonly severity: "error";
778
+ readonly comment: string;
779
+ readonly from: {
780
+ readonly path?: string;
781
+ };
782
+ readonly to: {
783
+ readonly path?: string;
784
+ readonly circular?: boolean;
785
+ readonly couldNotResolve?: boolean;
786
+ };
787
+ }
788
+ /**
789
+ * A regular expression, as source text, matching every file inside any of the packages. The trailing `/` keeps `packages/a` from matching `packages/ab`.
790
+ */
791
+ export declare function packagesPattern(packages: readonly WorkspacePackage[]): string;
792
+ /**
793
+ * One rule per rank that has a higher rank above it: files of a package at that rank may not import a package at a strictly higher rank. A rule compares no numbers, so the ordering is expanded into path alternations here. Each rule comes with a `-by-name` rule for imports that do not resolve to a file.
794
+ */
795
+ export declare function uphillRules(packages: readonly WorkspacePackage[]): readonly ImportRule[];
796
+ /**
797
+ * One rule per rank with a package more than `rankSkip.maxDistance` ranks below it that is not an exempt rank.
798
+ */
799
+ export declare function rankSkipRules(packages: readonly WorkspacePackage[], rankSkip: RankSkipOptions): readonly ImportRule[];
800
+ /**
801
+ * One rule per slice: a package in it may not import a package that has a different slice. A package without a slice is in none and is never restricted.
802
+ */
803
+ export declare function crossSliceRules(packages: readonly WorkspacePackage[]): readonly ImportRule[];
804
+ /**
805
+ * Two rules per isolated pair, one for each direction.
806
+ */
807
+ export declare function isolatedGroupRules(packages: readonly WorkspacePackage[], isolatedGroups: NonNullable<LayoutConfig["isolatedGroups"]>): readonly ImportRule[];
808
+ /**
809
+ * The rule that forbids any import cycle among the packages' files.
810
+ */
811
+ export declare function cycleRule(): ImportRule;
812
+ //#endregion
813
+ //#region src/checks/import-graph.d.ts
814
+ /**
815
+ * What a check's report may need to know about the workspace the graph was cruised over.
816
+ */
817
+ interface ImportScope {
818
+ readonly cwd: string;
819
+ /**
820
+ * The workspace root; finding paths are relative to it.
821
+ */
822
+ readonly root: string;
823
+ readonly packages: readonly WorkspacePackage[];
824
+ }
825
+ /**
826
+ * How an import check takes part in a shared cruise: the rules it adds and how it reads its own findings. Findings are routed to a check by the names of the rules it generated, so those names must differ from every other check's.
827
+ */
828
+ interface ImportCheckSpec {
829
+ /**
830
+ * The check's name; the violation code is `<name>/<reason>`.
831
+ */
832
+ readonly name: string;
833
+ /**
834
+ * The forbidden rules for the workspace's packages. Throws `ConformanceError` when the layout does not configure what the check needs.
835
+ */
836
+ readonly rules: (packages: readonly WorkspacePackage[], layout: LayoutConfig) => readonly ImportRule[];
837
+ /**
838
+ * The violations for the findings of this check's rules, in a stable order.
839
+ */
840
+ readonly report: (findings: readonly IViolation[], scope: ImportScope) => readonly Violation[];
841
+ }
842
+ //#endregion
241
843
  //#region src/checks/import-cross-slice.d.ts
242
844
  /**
243
845
  * A package imports a package in a different slice.
@@ -276,12 +878,124 @@ export declare const importUphill: LayoutCheckFunction<ImportGraphOptions>;
276
878
  */
277
879
  export declare const instructionSymlinks: CheckFunction<InstructionSymlinksOptions>;
278
880
  //#endregion
881
+ //#region src/checks/migrations-directory.d.ts
882
+ /**
883
+ * The directory a schema generator writes migrations to is the one the deploy tool applies them from, and no script applies them with the generator instead of the deploy tool. The generator and the deploy tool are named in the options and each has an adapter that knows its config file names and where in them the directory is; both directories are resolved against the directory of the file that sets them.
884
+ *
885
+ * The config files are read as data: JSON, JSONC and TOML are parsed, and a module (a generator's TypeScript config) is evaluated, so it must be trusted.
886
+ */
887
+ export declare const migrationsDirectory: CheckFunction<MigrationsDirectoryOptions>;
888
+ //#endregion
889
+ //#region src/checks/settings-merge-methods.d.ts
890
+ /**
891
+ * Only one merge method is available for a pull request into the branch, `rebase` unless the options say otherwise. A method is available when the repository allows it and no `pull_request` rule that applies to the branch leaves it out of its allowed methods.
892
+ *
893
+ * Limits: it reads the repository settings and the rules of rulesets that apply to the branch; classic branch protection and a merge queue's own merge method are not read, so a repository whose queue owns the strategy is judged by what it still allows for a direct merge.
894
+ */
895
+ export declare const settingsMergeMethods: GitHubCheckFunction<SettingsMergeMethodsOptions>;
896
+ //#endregion
897
+ //#region src/checks/settings-required-checks.d.ts
898
+ /**
899
+ * The branch requires the check of every junction job of the workflows, and requires branches to be up to date before merging (strict mode). The check name of a job is its `name`, else its id.
900
+ *
901
+ * The junction job is the one that reports for the whole workflow, so requiring it requires everything it needs, including jobs a path filter may skip. Codes: `no-required-checks` (no `required_status_checks` rule applies), `required-check-missing` (a junction job's check is not among the required ones), `not-strict` (no rule sets the strict policy) and `no-junction-job` (no workflow has a job with an id from `junctionJobs`).
902
+ *
903
+ * Limits: it reads the rules of rulesets that apply to the branch; classic branch protection is not read, so a repository that uses it is reported as having no required checks. A junction job in a reusable workflow, or a name that is an expression, is not resolved.
904
+ */
905
+ export declare const settingsRequiredChecks: GitHubCheckFunction<SettingsRequiredChecksOptions>;
906
+ //#endregion
907
+ //#region src/checks/settings-review-thread-resolution.d.ts
908
+ /**
909
+ * A pull request cannot merge while a review conversation is unresolved: a `pull_request` rule that applies to the branch sets `required_review_thread_resolution`.
910
+ *
911
+ * Limits: it reads the rules of rulesets; classic branch protection is not read.
912
+ */
913
+ export declare const settingsReviewThreadResolution: GitHubCheckFunction<SettingsReviewThreadResolutionOptions>;
914
+ //#endregion
279
915
  //#region src/checks/single-storybook.d.ts
280
916
  /**
281
917
  * At most one Storybook exists, in the permitted directory (the workspace root unless the options say otherwise), and none in a package such as a UI package. A Storybook is a `.storybook` directory.
282
918
  */
283
919
  export declare const singleStorybook: CheckFunction<SingleStorybookOptions>;
284
920
  //#endregion
921
+ //#region src/checks/workflow-action-pinning.d.ts
922
+ /**
923
+ * Every `uses` of a step or job follows the pinning policy. By default an action or reusable workflow from outside the organisations in the options must be pinned by full commit SHA (a Docker image by digest), and one owned by an organisation listed in `organisations` may use any ref; `thirdParty` and `sameOrganisation` set either to `sha` or `ref`, and `allow` exempts repositories. Local actions and workflows (`./...`) are not judged.
924
+ *
925
+ * The check encodes whichever policy the options state and is never silent about it: with nothing configured every remote reference must be a SHA. Limits: it checks the form of the ref, not that the SHA belongs to the repository or to a release; a SHA written with a trailing version comment is read as the SHA; composite actions are not read.
926
+ */
927
+ export declare const workflowActionPinning: CheckFunction<WorkflowActionPinningOptions>;
928
+ //#endregion
929
+ //#region src/checks/workflow-credentials.d.ts
930
+ /**
931
+ * Credentials are granted to the steps that need them, and a publish with no token cannot quietly use one.
932
+ *
933
+ * `workflow-credentials/attestation-permissions`: a step of `actions/attest`, `actions/attest-build-provenance` or `actions/attest-sbom` needs `id-token: write` and `attestations: write` in the job's effective permissions. Permissions a job declares replace the workflow's; permissions declared nowhere are the repository's default, which the file cannot show and which never includes `id-token`, so they are reported.
934
+ *
935
+ * `workflow-credentials/tokenless-publish-unprotected`: a job with `id-token: write` that publishes (`npm`, `pnpm` or `yarn npm publish`, with options such as `-r` or `--filter <package>` before `publish`, `semantic-release`, `changeset publish`, `lerna publish`, bare or run through `pnpm`, `pnpm exec`, `yarn` or `npx`) and passes no token must blank `NODE_AUTH_TOKEN` and `NPM_TOKEN` (set them to `''` at step, job or workflow level) or request provenance (`--provenance`, `NPM_CONFIG_PROVENANCE: true`, or `publishConfig.provenance: true` in the `package.json` of the working directory). The npm CLI replaces any configured token with the one from the OIDC exchange, but when the exchange fails it falls back to whatever token the environment holds, silently. Only blanking the variables prevents that fallback. Provenance does not: npm signs it with the CI's own OIDC identity (through Sigstore), separately from the registry token, so a fallback publish still goes ahead with the inherited token and carries an attestation of where it was built. Requesting provenance is accepted because it makes such a publish traceable, not because it makes it safe.
936
+ *
937
+ * Limits: `registry-url` is not reported, because it does not stop the exchange (see the README); a job that calls a reusable workflow is not read; a publish inside a script file or composite action is not seen; provenance set in a `package.json` other than the one in the working directory is not read; a job is tokenless only when no token variable is non-empty anywhere in the job, so a publish that uses a secret is left alone.
938
+ */
939
+ export declare const workflowCredentials: CheckFunction<WorkflowCredentialsOptions>;
940
+ //#endregion
941
+ //#region src/checks/workflow-job-ordering.d.ts
942
+ /**
943
+ * The jobs that release, deploy and report a required check are ordered so that a failure stops what follows: a release job needs the deploy job, a documentation deploy job needs the release job and checks out the default branch afresh, and one junction job with `if: always()` needs every other job and fails only on `failure` or `cancelled`.
944
+ *
945
+ * Jobs are recognised by id (see the options), and a role with no job in a workflow is not judged there. Ordering is judged through the transitive `needs` graph; the junction job must list every job directly, because `needs.*.result` only covers direct needs, except jobs that never run for a pull request or a merge group (an `if` on `github.ref` or `github.event_name` that mentions neither `pull_request` nor `merge_group`, where an `&&` needs one such operand and an `||` needs every operand to be), jobs that need such a job or the junction job itself, and the ids in `junctionExempt`. What the junction job decides on is read as text: it must read the results of its needs (`needs.*.result`, `needs.<job>.result` or `toJSON(needs)`) and name both `'failure'` and `'cancelled'`, or use the `re-actors/alls-green` action; a result read in a way the text does not show is reported as incomplete.
946
+ */
947
+ export declare const workflowJobOrdering: CheckFunction<WorkflowJobOrderingOptions>;
948
+ //#endregion
949
+ //#region src/checks/workflow-merge-group.d.ts
950
+ /**
951
+ * A workflow that checks pull requests also runs for the merge queue: GitHub starts no run of it for a queued pull request unless the workflow has a `merge_group` trigger, and a required check that never reports blocks the queue.
952
+ *
953
+ * A workflow is taken to produce required checks when it is triggered by `pull_request`; `pull_request_target` is left out, since it runs trusted code against untrusted input and is not a place for required checks. The file cannot show which checks are required, so a `pull_request` workflow whose checks are not required is reported too: narrow the check with `workflows` and `exclude`. A `merge_group` trigger on a workflow with no `pull_request` trigger is not judged. Limits: a `merge_group` trigger takes only `branches` filters (`paths` is a filter of `push`, `pull_request` and `pull_request_target`), so a workflow path-filtered for pull requests still runs in the queue once it has the trigger; the `branches` filter of a `merge_group` trigger is not read.
954
+ */
955
+ export declare const workflowMergeGroup: CheckFunction<WorkflowMergeGroupOptions>;
956
+ //#endregion
957
+ //#region src/checks/workflow-repository-dispatch.d.ts
958
+ /**
959
+ * A workflow that handles `repository_dispatch` can be started by anyone with write access through the API, so what it does with the repository is held to a higher bar.
960
+ *
961
+ * `workflow-repository-dispatch/pushes-default-branch`: a `git push` to the default branch, or one with no refspec while the default branch is checked out, or `git-auto-commit-action` on it. `auto-merge-without-required-checks`: `gh pr merge --auto`, which merges at once when the base branch requires no checks (the file cannot show the rule; `assumeRequiredChecks` states it, and `settings-required-checks` verifies it). `default-token-triggers-nothing`: a push (the checkout leaves `GITHUB_TOKEN` in git config unless it is given a `token`, and a push to a URL carrying its own credentials does not use it) or a pull request opened as `GITHUB_TOKEN`; events created with it start no workflows, apart from `workflow_dispatch` and `repository_dispatch`, so the pushed commit gets no checks. `dispatch-other-repository-with-default-token`: a dispatch to a repository other than `github.repository` with `GITHUB_TOKEN`, whose access is limited to its own repository. Dispatching in the same repository with `GITHUB_TOKEN` is allowed by GitHub and is not reported.
962
+ *
963
+ * Limits: commands are read as text, so a script file or composite action is not seen; a push is judged by its command line, so a branch created by a helper is not seen, and a quoted word that contains a space is not read as one word; a dispatch target written literally as this repository's own name is reported, since the file does not know the name; a job that calls a reusable workflow is not read.
964
+ */
965
+ export declare const workflowRepositoryDispatch: CheckFunction<WorkflowRepositoryDispatchOptions>;
966
+ //#endregion
967
+ //#region src/checks/workflow-runner-resolution.d.ts
968
+ /**
969
+ * A self-hosted or custom runner label named literally in more than one job of a workflow is resolved once instead: a resolver job decides the runner and the others read it with `fromJson(needs.<resolver>.outputs.<name>)`. The resolver must have a `timeout-minutes` and its output a literal fallback that names only hosted runner labels, so jobs still get a runner when resolution fails or the self-hosted fleet is down.
970
+ *
971
+ * A label is custom when it matches none of `hostedLabels`; the default patterns recognise GitHub's standard images, so a larger runner is named by a custom label and counts. Labels are compared within a workflow file, not across files. A resolver that is a reusable workflow is followed when it is a file of this repository (the output is traced through `on.workflow_call.outputs` to the job that sets it); a resolver in another repository cannot be read and is not judged. An output is taken to have a fallback when its expression has `||` followed by a string literal, and the last such literal is read as JSON (a label or a list of labels) and matched against `hostedLabels`; a fallback that is not valid JSON, or names any other label, is reported.
972
+ */
973
+ export declare const workflowRunnerResolution: CheckFunction<WorkflowRunnerResolutionOptions>;
974
+ //#endregion
975
+ //#region src/checks/workflow-skippable-jobs.d.ts
976
+ /**
977
+ * Keeping work off a pull request must not leave a required check without a result. A `paths` or `paths-ignore` filter on the trigger of a workflow with a junction job skips the whole workflow, so the required check stays pending forever; a job whose own `if` reads a path filter's outputs is skipped, which is only safe when a junction job with `if: always()` needs it and reports for it. Filter the steps of the job instead and the job still runs and reports.
978
+ *
979
+ * Limits: a workflow is taken to produce a required check when it has a junction job, so a trigger path filter in a workflow without one is not reported; a path filter is recognised by the actions in the options, so a script that computes changed paths itself is not seen, and a job gated on the output of such a script is not reported; only the filters of the `pull_request` and `pull_request_target` triggers are read, so a `paths` filter on `push` is not reported; only `needs.<job>.outputs` in the job's own `if` is read. Whether the junction job really reports is judged by `workflow-job-ordering`.
980
+ */
981
+ export declare const workflowSkippableJobs: CheckFunction<WorkflowSkippableJobsOptions>;
982
+ //#endregion
983
+ //#region src/checks/workflow-update-bot-cooldown.d.ts
984
+ /**
985
+ * The update bots wait before proposing a release, so a compromised release is withdrawn before it is installed. Dependabot: every `updates` entry needs a `cooldown` with `default-days` or one of the `semver-*-days` above zero. Renovate: `minimumReleaseAge` must be set to a duration above zero at the top level or in a `packageRules` entry.
986
+ *
987
+ * Limits: the bots' own rules differ, since Dependabot's cooldown does not apply to security updates, and a Renovate preset is not resolved (an `extends` entry counts only when its name contains `minimumReleaseAge`), so a setting that comes from a preset under another name is reported. Renovate configs in JSON5 syntax beyond comments and trailing commas, and a `renovate` key in `package.json`, are not read. A repository with neither bot has nothing to report.
988
+ */
989
+ export declare const workflowUpdateBotCooldown: CheckFunction<WorkflowUpdateBotCooldownOptions>;
990
+ //#endregion
991
+ //#region src/checks/workflow-version-single-source.d.ts
992
+ /**
993
+ * A setup step keeps a runtime version in the workflow when a version file already says it: `.nvmrc` for Node, `.tool-versions` for any tool it lists. The step reads the file instead (`node-version-file`, or `mise` or `asdf` actions), so there is one place to change.
994
+ *
995
+ * A version is a literal when it contains no expression, so `${{ matrix.node }}` is not reported: a matrix tests versions on purpose. A range or alias such as `lts/*` is a literal. Only the setup actions listed in the README are recognised, only the files in the working directory are looked for, and composite actions are not read.
996
+ */
997
+ export declare const workflowVersionSingleSource: CheckFunction<WorkflowVersionSingleSourceOptions>;
998
+ //#endregion
285
999
  //#region src/config.d.ts
286
1000
  /**
287
1001
  * The `checks` map of the `conformance` section: a check runs when its name is present with an options object (`{}` for the defaults), and `false` turns it off, which lets a config that extends another switch one of its checks off.
@@ -319,23 +1033,49 @@ interface RunInput {
319
1033
  readonly checks: ChecksConfig;
320
1034
  readonly layout: LayoutConfig | undefined;
321
1035
  readonly configFiles: ConfigFileOptions | undefined;
1036
+ /**
1037
+ * The client the settings checks read through; `undefined` when the run is offline.
1038
+ */
1039
+ readonly github: GitHubClient | undefined;
322
1040
  }
323
1041
  /**
324
- * A check bound to its place in the `checks` map.
1042
+ * What every registered check has, whichever way it runs.
325
1043
  */
326
- interface RegisteredCheck<Name extends CheckName> {
1044
+ interface RegisteredCheckBase<Name extends CheckName> {
327
1045
  readonly name: Name;
328
1046
  readonly description: string;
329
1047
  /**
330
1048
  * Whether the check reads the workspace layout, and so needs the `layout` section.
331
1049
  */
332
1050
  readonly requiresLayout: boolean;
1051
+ /**
1052
+ * Whether the check reads the repository's settings through the GitHub API, and so runs only when the run is given a client.
1053
+ */
1054
+ readonly requiresGitHub: boolean;
333
1055
  /**
334
1056
  * Whether the `checks` map turns this check on.
335
1057
  */
336
1058
  readonly isEnabled: (checks: ChecksConfig) => boolean;
1059
+ }
1060
+ /**
1061
+ * A check that runs on its own.
1062
+ */
1063
+ interface StandaloneCheck<Name extends CheckName> extends RegisteredCheckBase<Name> {
337
1064
  readonly run: (input: RunInput) => Promise<readonly Violation[]>;
338
1065
  }
1066
+ /**
1067
+ * An import check. It has no `run` of its own: it always joins a cruise shared with the other import checks of the run, so there is one path from the registry to dependency-cruiser.
1068
+ */
1069
+ interface ImportGraphCheck<Name extends CheckName> extends RegisteredCheckBase<Name> {
1070
+ readonly importGraph: {
1071
+ readonly spec: ImportCheckSpec;
1072
+ readonly optionsOf: (checks: ChecksConfig) => ImportGraphOptions | undefined;
1073
+ };
1074
+ }
1075
+ /**
1076
+ * A check bound to its place in the `checks` map.
1077
+ */
1078
+ type RegisteredCheck<Name extends CheckName> = StandaloneCheck<Name> | ImportGraphCheck<Name>;
339
1079
  /**
340
1080
  * Every check, by name, in the order they run. The key is the name used in the `checks` map, on the command line and in violation codes.
341
1081
  */
@@ -382,6 +1122,10 @@ interface RunChecksOptions {
382
1122
  * How config files are loaded: the sections loaded from `cwd` and the config files a check evaluates itself, such as the commitlint and release configs of `commit-types`. Only `alias` and `fsCache` apply to the latter.
383
1123
  */
384
1124
  readonly configFiles?: ConfigFileOptions;
1125
+ /**
1126
+ * The client the settings checks (`settings-*`) read the repository through. They run only when it is given, so a run without it stays offline and needs no token; naming one of them in `checks` without a client is an error.
1127
+ */
1128
+ readonly github?: GitHubClient;
385
1129
  }
386
1130
  /**
387
1131
  * The violations of one check.
@@ -478,84 +1222,4 @@ export declare function proveExhaustive(input: {
478
1222
  readonly compilerOptions?: CompilerOptions;
479
1223
  }): ExhaustivenessProof;
480
1224
  //#endregion
481
- //#region src/workspace/packages.d.ts
482
- /**
483
- * A package directory found under the workspace root, before the layout classifies it.
484
- */
485
- interface DiscoveredPackage {
486
- /**
487
- * Relative to the workspace root, with `/` separators.
488
- */
489
- readonly dir: string;
490
- /**
491
- * The manifest's `name`; a manifest may omit it.
492
- */
493
- readonly name: string | undefined;
494
- }
495
- /**
496
- * A workspace package as the layout sees it.
497
- */
498
- interface WorkspacePackage extends DiscoveredPackage {
499
- /**
500
- * The name of the group whose root is the longest prefix of the package directory.
501
- */
502
- readonly group: string;
503
- /**
504
- * The rank from `nameRanks`, else the group's rank, else `defaultRank`; `undefined` when none of them applies.
505
- */
506
- readonly rank: number | undefined;
507
- /**
508
- * The slice the group's `slice` rule derives; `undefined` for a group without one and for a package that yields none.
509
- */
510
- readonly slice: string | undefined;
511
- }
512
- /**
513
- * Classify discovered packages by the layout: group, rank and slice. Pure.
514
- *
515
- * A package no group owns is a configuration error, because every check would otherwise skip it without saying so. Nested package directories are one too: the checks attribute a file to the package whose directory is its prefix, which is ambiguous for a package inside another. A `namePrefix` slice takes the longest slice value that a `segment` group produced and that prefixes the package's unscoped name; a package without a name has no such slice.
516
- */
517
- export declare function classifyPackages(discovered: readonly DiscoveredPackage[], layout: LayoutConfig): readonly WorkspacePackage[];
518
- //#endregion
519
- //#region src/workspace/rules.d.ts
520
- /**
521
- * A forbidden-dependency rule in the shape dependency-cruiser takes: a dependency from a file matching `from` to a file matching `to` is a violation.
522
- */
523
- interface ImportRule {
524
- readonly name: string;
525
- readonly severity: "error";
526
- readonly comment: string;
527
- readonly from: {
528
- readonly path?: string;
529
- };
530
- readonly to: {
531
- readonly path?: string;
532
- readonly circular?: boolean;
533
- readonly couldNotResolve?: boolean;
534
- };
535
- }
536
- /**
537
- * A regular expression, as source text, matching every file inside any of the packages. The trailing `/` keeps `packages/a` from matching `packages/ab`.
538
- */
539
- export declare function packagesPattern(packages: readonly WorkspacePackage[]): string;
540
- /**
541
- * One rule per rank that has a higher rank above it: files of a package at that rank may not import a package at a strictly higher rank. A rule compares no numbers, so the ordering is expanded into path alternations here. Each rule comes with a `-by-name` rule for imports that do not resolve to a file.
542
- */
543
- export declare function uphillRules(packages: readonly WorkspacePackage[]): readonly ImportRule[];
544
- /**
545
- * One rule per rank with a package more than `rankSkip.maxDistance` ranks below it that is not an exempt rank.
546
- */
547
- export declare function rankSkipRules(packages: readonly WorkspacePackage[], rankSkip: RankSkipOptions): readonly ImportRule[];
548
- /**
549
- * One rule per slice: a package in it may not import a package that has a different slice. A package without a slice is in none and is never restricted.
550
- */
551
- export declare function crossSliceRules(packages: readonly WorkspacePackage[]): readonly ImportRule[];
552
- /**
553
- * Two rules per isolated pair, one for each direction.
554
- */
555
- export declare function isolatedGroupRules(packages: readonly WorkspacePackage[], isolatedGroups: NonNullable<LayoutConfig["isolatedGroups"]>): readonly ImportRule[];
556
- /**
557
- * The rule that forbids any import cycle among the packages' files.
558
- */
559
- export declare function cycleRule(): ImportRule;
560
- //#endregion
561
- export type { AggregateMappersOptions, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DiscoveredPackage, DockerfilePackageManagerOptions, ExhaustivenessProof, ImportGraphOptions, InstructionSymlinksOptions, LayoutCheckContext, LayoutCheckFunction, RegisteredCheck, RunChecksOptions, RunResult, SingleStorybookOptions, SourceLocation, TypeErrorReport, Violation, WorkspacePackage };
1225
+ export type { AggregateMappersOptions, BranchRules, CaseRemoval, CheckContext, CheckFunction, CheckName, CheckOptionsByName, CheckResult, ChecksConfig, CommandTypesOptions, CommitTypesOptions, ConformanceConfig, DeployDirectory, DeploySelector, DeployToolAdapter, DeployToolName, DiscoveredPackage, DockerfilePackageManagerOptions, ExhaustivenessProof, GeneratorAdapter, GeneratorName, GitHubCheckContext, GitHubCheckFunction, GitHubClient, GitHubClientOptions, ImportGraphOptions, InstructionSymlinksOptions, Job, LayoutCheckContext, LayoutCheckFunction, MigrationsDirectoryOptions, PermissionAccess, Permissions, PinningLevel, RegisteredCheck, RepositorySettings, RepositorySlug, RunChecksOptions, RunResult, RunsOn, SettingsMergeMethodsOptions, SettingsOptions, SettingsRequiredChecksOptions, SettingsReviewThreadResolutionOptions, SingleStorybookOptions, SourceLocation, Step, TypeErrorReport, UsesReference, Violation, Workflow, WorkflowActionPinningOptions, WorkflowCredentialsOptions, WorkflowJobOrderingOptions, WorkflowMergeGroupOptions, WorkflowRepositoryDispatchOptions, WorkflowRunnerResolutionOptions, WorkflowSelection, WorkflowSkippableJobsOptions, WorkflowUpdateBotCooldownOptions, WorkflowVersionSingleSourceOptions, WorkspacePackage };