@shivaedev/quality 0.74.3 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +16 -5
- package/dist/adapters/asciiFindings.d.ts +1 -1
- package/dist/adapters/asciiFindings.d.ts.map +1 -1
- package/dist/adapters/asciiFindings.js +1 -1
- package/dist/adapters/asciiFindings.js.map +1 -1
- package/dist/adapters/biome/configs.d.ts +4 -1
- package/dist/adapters/biome/configs.d.ts.map +1 -1
- package/dist/adapters/biome/configs.js +32 -27
- package/dist/adapters/biome/configs.js.map +1 -1
- package/dist/adapters/biome/presetConfig.d.ts +2 -2
- package/dist/adapters/biome/presetConfig.d.ts.map +1 -1
- package/dist/adapters/biome/presetConfig.js +5 -5
- package/dist/adapters/biome/presetConfig.js.map +1 -1
- package/dist/adapters/biome/resolvePackage.d.ts +2 -2
- package/dist/adapters/biome/resolvePackage.d.ts.map +1 -1
- package/dist/adapters/biome/resolvePackage.js +5 -4
- package/dist/adapters/biome/resolvePackage.js.map +1 -1
- package/dist/adapters/biome/rootConfig.d.ts +3 -2
- package/dist/adapters/biome/rootConfig.d.ts.map +1 -1
- package/dist/adapters/biome/rootConfig.js +4 -3
- package/dist/adapters/biome/rootConfig.js.map +1 -1
- package/dist/adapters/biome/toolContractDefaults.d.ts +1 -1
- package/dist/adapters/biome/toolContractDefaults.d.ts.map +1 -1
- package/dist/adapters/biome/toolContractDefaults.js +2 -5
- package/dist/adapters/biome/toolContractDefaults.js.map +1 -1
- package/dist/adapters/builtinName.d.ts +2 -0
- package/dist/adapters/builtinName.d.ts.map +1 -0
- package/dist/adapters/builtinName.js +9 -0
- package/dist/adapters/builtinName.js.map +1 -0
- package/dist/adapters/catalogWorkspace.d.ts +1 -1
- package/dist/adapters/catalogWorkspace.d.ts.map +1 -1
- package/dist/adapters/catalogWorkspace.js +1 -1
- package/dist/adapters/catalogWorkspace.js.map +1 -1
- package/dist/adapters/commandLine.d.ts +15 -0
- package/dist/adapters/commandLine.d.ts.map +1 -0
- package/dist/adapters/commandLine.js +10 -0
- package/dist/adapters/commandLine.js.map +1 -0
- package/dist/adapters/contentHashedModule.d.ts +2 -0
- package/dist/adapters/contentHashedModule.d.ts.map +1 -0
- package/dist/adapters/contentHashedModule.js +9 -0
- package/dist/adapters/contentHashedModule.js.map +1 -0
- package/dist/adapters/databaseUrlFindings.d.ts +1 -1
- package/dist/adapters/databaseUrlFindings.d.ts.map +1 -1
- package/dist/adapters/domEnvironment.config.d.ts.map +1 -0
- package/dist/adapters/domEnvironment.config.js.map +1 -0
- package/dist/adapters/freshObject.d.ts +3 -0
- package/dist/adapters/freshObject.d.ts.map +1 -0
- package/dist/adapters/freshObject.js +53 -0
- package/dist/adapters/freshObject.js.map +1 -0
- package/dist/adapters/imports/resolve.d.ts.map +1 -1
- package/dist/adapters/imports/resolve.js +2 -1
- package/dist/adapters/imports/resolve.js.map +1 -1
- package/dist/adapters/knip/configuration.d.ts +3 -2
- package/dist/adapters/knip/configuration.d.ts.map +1 -1
- package/dist/adapters/knip/configuration.js +13 -8
- package/dist/adapters/knip/configuration.js.map +1 -1
- package/dist/adapters/knip/entryPointFindings.d.ts +1 -1
- package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -1
- package/dist/adapters/knip/entryPointFindings.js +4 -4
- package/dist/adapters/knip/entryPointFindings.js.map +1 -1
- package/dist/adapters/knip/run.d.ts +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +2 -2
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/knip/sourceConfig.d.ts +1 -1
- package/dist/adapters/knip/sourceConfig.d.ts.map +1 -1
- package/dist/adapters/knip/sourceConfig.js +1 -1
- package/dist/adapters/knip/sourceConfig.js.map +1 -1
- package/dist/adapters/manifestInventory.d.ts +45 -4
- package/dist/adapters/manifestInventory.d.ts.map +1 -1
- package/dist/adapters/manifestInventory.js +26 -32
- package/dist/adapters/manifestInventory.js.map +1 -1
- package/dist/adapters/manifestReader.d.ts +2 -2
- package/dist/adapters/manifestReader.d.ts.map +1 -1
- package/dist/adapters/manifestReader.js +3 -4
- package/dist/adapters/manifestReader.js.map +1 -1
- package/dist/adapters/manifestSorting.d.ts +8 -0
- package/dist/adapters/manifestSorting.d.ts.map +1 -0
- package/dist/adapters/manifestSorting.js +6 -0
- package/dist/adapters/manifestSorting.js.map +1 -0
- package/dist/adapters/outsideImportFindings.d.ts +4 -1
- package/dist/adapters/outsideImportFindings.d.ts.map +1 -1
- package/dist/adapters/outsideImportFindings.js +1 -1
- package/dist/adapters/outsideImportFindings.js.map +1 -1
- package/dist/adapters/queueReadoutFindings.d.ts +1 -1
- package/dist/adapters/queueReadoutFindings.d.ts.map +1 -1
- package/dist/adapters/queueReadoutFindings.js +1 -1
- package/dist/adapters/queueReadoutFindings.js.map +1 -1
- package/dist/adapters/repositoryPathFindings.d.ts +1 -1
- package/dist/adapters/repositoryPathFindings.d.ts.map +1 -1
- package/dist/adapters/repositoryPathFindings.js +1 -1
- package/dist/adapters/repositoryPathFindings.js.map +1 -1
- package/dist/adapters/rpcBoundaryFindings.d.ts +1 -1
- package/dist/adapters/rpcBoundaryFindings.d.ts.map +1 -1
- package/dist/adapters/rule.d.ts +1 -1
- package/dist/adapters/rule.d.ts.map +1 -1
- package/dist/adapters/rule.js +2 -3
- package/dist/adapters/rule.js.map +1 -1
- package/dist/adapters/runMain.d.ts.map +1 -0
- package/dist/adapters/runMain.js.map +1 -0
- package/dist/adapters/serviceIdFindings.d.ts +1 -1
- package/dist/adapters/serviceIdFindings.d.ts.map +1 -1
- package/dist/adapters/serviceIdFindings.js +1 -1
- package/dist/adapters/serviceIdFindings.js.map +1 -1
- package/dist/adapters/sharedErrorFindings.d.ts +1 -1
- package/dist/adapters/sharedErrorFindings.d.ts.map +1 -1
- package/dist/adapters/sharedErrorFindings.js +1 -1
- package/dist/adapters/sharedErrorFindings.js.map +1 -1
- package/dist/adapters/sharedErrorModules.d.ts +2 -1
- package/dist/adapters/sharedErrorModules.d.ts.map +1 -1
- package/dist/adapters/sharedErrorModules.js +4 -3
- package/dist/adapters/sharedErrorModules.js.map +1 -1
- package/dist/adapters/testProjects.js +2 -2
- package/dist/adapters/testProjects.js.map +1 -1
- package/dist/adapters/unitIoGuard.config.d.ts.map +1 -0
- package/dist/adapters/unitIoGuard.config.js.map +1 -0
- package/dist/appTestConfig.d.ts +2 -1
- package/dist/appTestConfig.d.ts.map +1 -1
- package/dist/appTestConfig.js +2 -3
- package/dist/appTestConfig.js.map +1 -1
- package/dist/baseline/format.d.ts +1 -1
- package/dist/baseline/format.d.ts.map +1 -1
- package/dist/baseline/format.js +2 -2
- package/dist/baseline/format.js.map +1 -1
- package/dist/baseline/legacy.d.ts +1 -1
- package/dist/baseline/legacy.d.ts.map +1 -1
- package/dist/baseline/legacy.js +2 -2
- package/dist/baseline/legacy.js.map +1 -1
- package/dist/baseline/looseStagedEntries.js +2 -2
- package/dist/baseline/looseStagedEntries.js.map +1 -1
- package/dist/baseline/merge.js +1 -1
- package/dist/baseline/merge.js.map +1 -1
- package/dist/biome/report.d.ts +1 -1
- package/dist/biome/report.d.ts.map +1 -1
- package/dist/biome/withoutEntryPointImports.d.ts +1 -1
- package/dist/biome/withoutEntryPointImports.d.ts.map +1 -1
- package/dist/biome/withoutEntryPointImports.js +2 -2
- package/dist/biome/withoutEntryPointImports.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +3 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/lint.d.ts +8 -1
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +9 -4
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/migrateBaseline.d.ts.map +1 -1
- package/dist/cli/migrateBaseline.js +1 -3
- package/dist/cli/migrateBaseline.js.map +1 -1
- package/dist/cli/migrateExceptions.d.ts.map +1 -1
- package/dist/cli/migrateExceptions.js +7 -10
- package/dist/cli/migrateExceptions.js.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/decode.d.ts +1 -1
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/load.js +1 -1
- package/dist/config/load.js.map +1 -1
- package/dist/decoded.d.ts +1 -1
- package/dist/decoded.d.ts.map +1 -1
- package/dist/decoded.js +2 -2
- package/dist/decoded.js.map +1 -1
- package/dist/docs/importFindings.d.ts +4 -3
- package/dist/docs/importFindings.d.ts.map +1 -1
- package/dist/docs/importFindings.js.map +1 -1
- package/dist/docs/linkFindings.d.ts +3 -2
- package/dist/docs/linkFindings.d.ts.map +1 -1
- package/dist/docs/linkFindings.js.map +1 -1
- package/dist/engine/baselineFile.js +1 -1
- package/dist/engine/baselineFile.js.map +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +1 -1
- package/dist/engine/session.js.map +1 -1
- package/dist/exceptions/MigrationFailure.d.ts +9 -0
- package/dist/exceptions/MigrationFailure.d.ts.map +1 -0
- package/dist/exceptions/MigrationFailure.js +4 -0
- package/dist/exceptions/MigrationFailure.js.map +1 -0
- package/dist/exceptions/biomeFindings.d.ts +3 -2
- package/dist/exceptions/biomeFindings.d.ts.map +1 -1
- package/dist/exceptions/biomeFindings.js +2 -2
- package/dist/exceptions/biomeFindings.js.map +1 -1
- package/dist/exceptions/declaration.d.ts +1 -1
- package/dist/exceptions/declaration.d.ts.map +1 -1
- package/dist/exceptions/migrateBiome.d.ts +3 -1
- package/dist/exceptions/migrateBiome.d.ts.map +1 -1
- package/dist/exceptions/migrateBiome.js +5 -3
- package/dist/exceptions/migrateBiome.js.map +1 -1
- package/dist/exceptions/migrateConfig.d.ts +3 -1
- package/dist/exceptions/migrateConfig.d.ts.map +1 -1
- package/dist/exceptions/migrateConfig.js +40 -25
- package/dist/exceptions/migrateConfig.js.map +1 -1
- package/dist/exceptions/registry.d.ts +1 -1
- package/dist/exceptions/registry.d.ts.map +1 -1
- package/dist/exceptions/registry.js +1 -1
- package/dist/exceptions/registry.js.map +1 -1
- package/dist/hooks/preCommit.d.ts.map +1 -1
- package/dist/hooks/preCommit.js +9 -8
- package/dist/hooks/preCommit.js.map +1 -1
- package/dist/imports/browserGlobals.d.ts +1 -1
- package/dist/imports/browserGlobals.d.ts.map +1 -1
- package/dist/imports/browserGlobals.js +7 -2
- package/dist/imports/browserGlobals.js.map +1 -1
- package/dist/imports/browserNames.d.ts +3 -1
- package/dist/imports/browserNames.d.ts.map +1 -1
- package/dist/imports/browserNames.js +9 -5
- package/dist/imports/browserNames.js.map +1 -1
- package/dist/imports/departures.d.ts +1 -1
- package/dist/imports/departures.d.ts.map +1 -1
- package/dist/imports/departures.js +1 -1
- package/dist/imports/departures.js.map +1 -1
- package/dist/imports/fences/BoundaryFailure.d.ts +10 -0
- package/dist/imports/fences/BoundaryFailure.d.ts.map +1 -0
- package/dist/imports/fences/BoundaryFailure.js +4 -0
- package/dist/imports/fences/BoundaryFailure.js.map +1 -0
- package/dist/imports/fences/check.d.ts +1 -1
- package/dist/imports/fences/check.d.ts.map +1 -1
- package/dist/imports/fences/check.js +2 -2
- package/dist/imports/fences/check.js.map +1 -1
- package/dist/imports/fences/compilePolicy.d.ts +3 -1
- package/dist/imports/fences/compilePolicy.d.ts.map +1 -1
- package/dist/imports/fences/compilePolicy.js +4 -2
- package/dist/imports/fences/compilePolicy.js.map +1 -1
- package/dist/imports/fences/declarations.d.ts +1 -1
- package/dist/imports/fences/declarations.d.ts.map +1 -1
- package/dist/imports/fences/discover.d.ts +3 -1
- package/dist/imports/fences/discover.d.ts.map +1 -1
- package/dist/imports/fences/discover.js +32 -26
- package/dist/imports/fences/discover.js.map +1 -1
- package/dist/imports/fences/match.d.ts.map +1 -1
- package/dist/imports/fences/match.js +2 -1
- package/dist/imports/fences/match.js.map +1 -1
- package/dist/imports/globMatcher.d.ts +10 -1
- package/dist/imports/globMatcher.d.ts.map +1 -1
- package/dist/imports/globMatcher.js +39 -42
- package/dist/imports/globMatcher.js.map +1 -1
- package/dist/imports/graph.d.ts +1 -1
- package/dist/imports/graph.d.ts.map +1 -1
- package/dist/imports/graph.js +1 -1
- package/dist/imports/graph.js.map +1 -1
- package/dist/imports/packageName.d.ts +0 -1
- package/dist/imports/packageName.d.ts.map +1 -1
- package/dist/imports/packageName.js +1 -8
- package/dist/imports/packageName.js.map +1 -1
- package/dist/imports/pnpmWorkspacePatterns.d.ts +12 -2
- package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -1
- package/dist/imports/pnpmWorkspacePatterns.js +31 -32
- package/dist/imports/pnpmWorkspacePatterns.js.map +1 -1
- package/dist/imports/runtime.d.ts +2 -2
- package/dist/imports/runtime.d.ts.map +1 -1
- package/dist/imports/runtime.js +2 -2
- package/dist/imports/runtime.js.map +1 -1
- package/dist/imports/segmentsMatch.d.ts +5 -0
- package/dist/imports/segmentsMatch.d.ts.map +1 -0
- package/dist/imports/segmentsMatch.js +16 -0
- package/dist/imports/segmentsMatch.js.map +1 -0
- package/dist/imports/withoutGenerated.d.ts +1 -1
- package/dist/imports/withoutGenerated.d.ts.map +1 -1
- package/dist/imports/withoutGenerated.js +1 -1
- package/dist/imports/withoutGenerated.js.map +1 -1
- package/dist/imports/workspace.d.ts +2 -1
- package/dist/imports/workspace.d.ts.map +1 -1
- package/dist/imports/workspace.js +17 -15
- package/dist/imports/workspace.js.map +1 -1
- package/dist/inventory/programmaticBuilds.d.ts +1 -1
- package/dist/inventory/programmaticBuilds.d.ts.map +1 -1
- package/dist/manifests/deliveredDependencies.d.ts +3 -0
- package/dist/manifests/deliveredDependencies.d.ts.map +1 -0
- package/dist/manifests/deliveredDependencies.js +8 -0
- package/dist/manifests/deliveredDependencies.js.map +1 -0
- package/dist/manifests/entryPoints.d.ts +2 -1
- package/dist/manifests/entryPoints.d.ts.map +1 -1
- package/dist/manifests/entryPoints.js +9 -8
- package/dist/manifests/entryPoints.js.map +1 -1
- package/dist/manifests/sorted.d.ts +0 -7
- package/dist/manifests/sorted.d.ts.map +1 -1
- package/dist/manifests/sorted.js +3 -10
- package/dist/manifests/sorted.js.map +1 -1
- package/dist/naming/developmentCode.d.ts +1 -1
- package/dist/naming/developmentCode.d.ts.map +1 -1
- package/dist/naming/developmentCode.js +2 -2
- package/dist/naming/developmentCode.js.map +1 -1
- package/dist/naming/packageLayout.d.ts +2 -1
- package/dist/naming/packageLayout.d.ts.map +1 -1
- package/dist/naming/packageLayout.js +4 -1
- package/dist/naming/packageLayout.js.map +1 -1
- package/dist/naming/packageTests.d.ts +1 -1
- package/dist/naming/packageTests.d.ts.map +1 -1
- package/dist/naming/packageTests.js +2 -2
- package/dist/naming/packageTests.js.map +1 -1
- package/dist/naming/testCode.d.ts +1 -1
- package/dist/naming/testCode.d.ts.map +1 -1
- package/dist/naming/testCode.js +1 -1
- package/dist/naming/testCode.js.map +1 -1
- package/dist/report/recap.d.ts +4 -0
- package/dist/report/recap.d.ts.map +1 -0
- package/dist/report/recap.js +23 -0
- package/dist/report/recap.js.map +1 -0
- package/dist/report/render.d.ts +1 -0
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js +1 -1
- package/dist/report/render.js.map +1 -1
- package/dist/rule.d.ts +2 -2
- package/dist/rule.d.ts.map +1 -1
- package/dist/rules/biome.js +1 -1
- package/dist/rules/biome.js.map +1 -1
- package/dist/rules/docs/references.d.ts.map +1 -1
- package/dist/rules/docs/references.js +6 -10
- package/dist/rules/docs/references.js.map +1 -1
- package/dist/rules/docs/unversionedInstalls.d.ts.map +1 -1
- package/dist/rules/docs/unversionedInstalls.js +1 -1
- package/dist/rules/docs/unversionedInstalls.js.map +1 -1
- package/dist/rules/effect/boundary.d.ts.map +1 -1
- package/dist/rules/effect/boundary.js +1 -1
- package/dist/rules/effect/boundary.js.map +1 -1
- package/dist/rules/effect/failureFindings.d.ts +1 -1
- package/dist/rules/effect/failureFindings.d.ts.map +1 -1
- package/dist/rules/effect/failureFindings.js +9 -3
- package/dist/rules/effect/failureFindings.js.map +1 -1
- package/dist/rules/effect/failureHonesty.d.ts.map +1 -1
- package/dist/rules/effect/failureHonesty.js +3 -2
- package/dist/rules/effect/failureHonesty.js.map +1 -1
- package/dist/rules/effect/serviceParameters.js +2 -2
- package/dist/rules/effect/serviceParameters.js.map +1 -1
- package/dist/rules/effect/successRecovery.d.ts +1 -0
- package/dist/rules/effect/successRecovery.d.ts.map +1 -1
- package/dist/rules/effect/successRecovery.js +23 -0
- package/dist/rules/effect/successRecovery.js.map +1 -1
- package/dist/rules/files/packageImports.d.ts +2 -1
- package/dist/rules/files/packageImports.d.ts.map +1 -1
- package/dist/rules/files/packageImports.js +1 -1
- package/dist/rules/files/packageImports.js.map +1 -1
- package/dist/rules/files/stylesheetImporters.d.ts +2 -1
- package/dist/rules/files/stylesheetImporters.d.ts.map +1 -1
- package/dist/rules/files/stylesheetImporters.js +1 -1
- package/dist/rules/files/stylesheetImporters.js.map +1 -1
- package/dist/rules/imports/manifest.js +4 -4
- package/dist/rules/imports/manifest.js.map +1 -1
- package/dist/rules/imports/runtime.d.ts.map +1 -1
- package/dist/rules/imports/runtime.js +2 -3
- package/dist/rules/imports/runtime.js.map +1 -1
- package/dist/rules/manifestsApplication.d.ts.map +1 -1
- package/dist/rules/manifestsApplication.js +8 -9
- package/dist/rules/manifestsApplication.js.map +1 -1
- package/dist/rules/manifestsDependencyPins.js +1 -1
- package/dist/rules/manifestsDependencyPins.js.map +1 -1
- package/dist/rules/manifestsExportsShape.js +2 -2
- package/dist/rules/manifestsExportsShape.js.map +1 -1
- package/dist/rules/manifestsNoTestKits.d.ts.map +1 -1
- package/dist/rules/manifestsNoTestKits.js +1 -1
- package/dist/rules/manifestsNoTestKits.js.map +1 -1
- package/dist/rules/manifestsSorted.js +2 -2
- package/dist/rules/manifestsSorted.js.map +1 -1
- package/dist/rules/manifestsSourceFirst.js +1 -1
- package/dist/rules/manifestsSourceFirst.js.map +1 -1
- package/dist/rules/manifestsValid.d.ts.map +1 -1
- package/dist/rules/manifestsValid.js +1 -1
- package/dist/rules/manifestsValid.js.map +1 -1
- package/dist/rules/stories/authSql.js +1 -1
- package/dist/rules/stories/authSql.js.map +1 -1
- package/dist/rules/stories/engine.js +1 -1
- package/dist/rules/stories/engine.js.map +1 -1
- package/dist/rules/stories/prerequisites.d.ts +2 -1
- package/dist/rules/stories/prerequisites.d.ts.map +1 -1
- package/dist/rules/stories/prerequisites.js +4 -3
- package/dist/rules/stories/prerequisites.js.map +1 -1
- package/dist/rules/stories/queueSql.d.ts.map +1 -1
- package/dist/rules/stories/queueSql.js +3 -2
- package/dist/rules/stories/queueSql.js.map +1 -1
- package/dist/rules/stories/sources.d.ts +2 -2
- package/dist/rules/stories/sources.d.ts.map +1 -1
- package/dist/rules/stories/sources.js +1 -1
- package/dist/rules/stories/sources.js.map +1 -1
- package/dist/rules/stories/specs.js +1 -1
- package/dist/rules/stories/specs.js.map +1 -1
- package/dist/rules/stories/sqlText.d.ts +3 -1
- package/dist/rules/stories/sqlText.d.ts.map +1 -1
- package/dist/rules/stories/sqlText.js +12 -11
- package/dist/rules/stories/sqlText.js.map +1 -1
- package/dist/rules/suppressions/biome/declarations.d.ts +1 -1
- package/dist/rules/suppressions/biome/declarations.d.ts.map +1 -1
- package/dist/rules/suppressions/biome/declarations.js +1 -1
- package/dist/rules/suppressions/biome/declarations.js.map +1 -1
- package/dist/rules/suppressions/biomeOverrides.js +1 -1
- package/dist/rules/suppressions/biomeOverrides.js.map +1 -1
- package/dist/rules/suppressions/noDoubleCast.js +1 -1
- package/dist/rules/suppressions/noDoubleCast.js.map +1 -1
- package/dist/rules/suppressions/noInline.d.ts.map +1 -1
- package/dist/rules/suppressions/noInline.js +11 -4
- package/dist/rules/suppressions/noInline.js.map +1 -1
- package/dist/rules/suppressions/readonlyWrite.d.ts.map +1 -1
- package/dist/rules/suppressions/readonlyWrite.js +2 -1
- package/dist/rules/suppressions/readonlyWrite.js.map +1 -1
- package/dist/testing/adapters/cli.js +1 -1
- package/dist/testing/adapters/cli.js.map +1 -1
- package/dist/testing/adapters/imports.js +2 -2
- package/dist/testing/adapters/imports.js.map +1 -1
- package/dist/testing/adapters/run.js +1 -1
- package/dist/testing/adapters/run.js.map +1 -1
- package/dist/testing/adapters/tree.d.ts +1 -0
- package/dist/testing/adapters/tree.d.ts.map +1 -1
- package/dist/testing/adapters/tree.js +3 -0
- package/dist/testing/adapters/tree.js.map +1 -1
- package/dist/testing/ruleStory.js +1 -1
- package/dist/testing/ruleStory.js.map +1 -1
- package/docs/debt-and-hooks.md +3 -1
- package/package.json +5 -5
- package/src/adapters/asciiFindings.ts +1 -1
- package/src/adapters/biome/configs.ts +50 -28
- package/src/adapters/biome/presetConfig.ts +5 -5
- package/src/adapters/biome/resolvePackage.ts +5 -4
- package/src/adapters/biome/rootConfig.ts +7 -3
- package/src/adapters/biome/toolContractDefaults.ts +4 -5
- package/src/adapters/builtinName.ts +10 -0
- package/src/adapters/catalogWorkspace.ts +1 -1
- package/src/adapters/commandLine.ts +10 -0
- package/src/adapters/contentHashedModule.ts +9 -0
- package/src/adapters/freshObject.ts +61 -0
- package/src/adapters/imports/resolve.ts +2 -1
- package/src/adapters/knip/configuration.ts +17 -9
- package/src/adapters/knip/entryPointFindings.ts +7 -7
- package/src/adapters/knip/run.ts +2 -2
- package/src/adapters/knip/sourceConfig.ts +1 -3
- package/src/adapters/manifestInventory.ts +37 -32
- package/src/adapters/manifestReader.ts +4 -5
- package/src/adapters/manifestSorting.ts +8 -0
- package/src/adapters/outsideImportFindings.ts +5 -3
- package/src/adapters/queueReadoutFindings.ts +1 -1
- package/src/adapters/repositoryPathFindings.ts +1 -1
- package/src/adapters/rule.ts +3 -4
- package/src/adapters/serviceIdFindings.ts +1 -1
- package/src/adapters/sharedErrorFindings.ts +1 -1
- package/src/adapters/sharedErrorModules.ts +4 -3
- package/src/adapters/testProjects.ts +2 -2
- package/src/appTestConfig.ts +4 -4
- package/src/baseline/format.ts +2 -2
- package/src/baseline/legacy.ts +2 -2
- package/src/baseline/looseStagedEntries.ts +2 -2
- package/src/baseline/merge.ts +1 -1
- package/src/biome/withoutEntryPointImports.ts +2 -2
- package/src/cli/args.ts +3 -6
- package/src/cli/lint.ts +24 -16
- package/src/cli/migrateBaseline.ts +1 -3
- package/src/cli/migrateExceptions.ts +10 -11
- package/src/cli.ts +1 -1
- package/src/config/decode.ts +1 -1
- package/src/config/load.ts +1 -1
- package/src/decoded.ts +4 -6
- package/src/docs/importFindings.ts +5 -4
- package/src/docs/linkFindings.ts +8 -3
- package/src/engine/baselineFile.ts +1 -1
- package/src/engine/session.ts +3 -3
- package/src/exceptions/MigrationFailure.ts +5 -0
- package/src/exceptions/biomeFindings.ts +7 -3
- package/src/exceptions/declaration.ts +1 -1
- package/src/exceptions/migrateBiome.ts +10 -4
- package/src/exceptions/migrateConfig.ts +66 -29
- package/src/exceptions/registry.ts +2 -2
- package/src/hooks/preCommit.ts +12 -11
- package/src/imports/browserGlobals.ts +8 -2
- package/src/imports/browserNames.ts +13 -5
- package/src/imports/departures.ts +1 -1
- package/src/imports/fences/BoundaryFailure.ts +6 -0
- package/src/imports/fences/check.ts +2 -2
- package/src/imports/fences/compilePolicy.ts +5 -3
- package/src/imports/fences/discover.ts +41 -26
- package/src/imports/fences/match.ts +2 -1
- package/src/imports/globMatcher.ts +51 -50
- package/src/imports/graph.ts +1 -1
- package/src/imports/packageName.ts +1 -10
- package/src/imports/pnpmWorkspacePatterns.ts +44 -39
- package/src/imports/runtime.ts +3 -4
- package/src/imports/segmentsMatch.ts +19 -0
- package/src/imports/withoutGenerated.ts +1 -1
- package/src/imports/workspace.ts +25 -17
- package/src/manifests/deliveredDependencies.ts +11 -0
- package/src/manifests/entryPoints.ts +25 -13
- package/src/manifests/sorted.ts +5 -16
- package/src/naming/developmentCode.ts +2 -2
- package/src/naming/packageLayout.ts +6 -6
- package/src/naming/packageTests.ts +2 -2
- package/src/naming/testCode.ts +8 -11
- package/src/report/recap.ts +29 -0
- package/src/report/render.ts +1 -1
- package/src/rule.ts +2 -2
- package/src/rules/biome.ts +1 -1
- package/src/rules/docs/references.ts +8 -15
- package/src/rules/docs/unversionedInstalls.ts +1 -4
- package/src/rules/effect/boundary.ts +16 -19
- package/src/rules/effect/failureFindings.ts +12 -3
- package/src/rules/effect/failureHonesty.ts +3 -2
- package/src/rules/effect/serviceParameters.ts +2 -2
- package/src/rules/effect/successRecovery.ts +26 -0
- package/src/rules/files/packageImports.ts +3 -6
- package/src/rules/files/stylesheetImporters.ts +3 -6
- package/src/rules/imports/manifest.ts +6 -6
- package/src/rules/imports/runtime.ts +2 -3
- package/src/rules/manifestsApplication.ts +12 -14
- package/src/rules/manifestsDependencyPins.ts +1 -1
- package/src/rules/manifestsExportsShape.ts +2 -2
- package/src/rules/manifestsNoTestKits.ts +1 -4
- package/src/rules/manifestsSorted.ts +2 -2
- package/src/rules/manifestsSourceFirst.ts +1 -1
- package/src/rules/manifestsValid.ts +2 -3
- package/src/rules/stories/authSql.ts +1 -1
- package/src/rules/stories/engine.ts +1 -1
- package/src/rules/stories/prerequisites.ts +4 -3
- package/src/rules/stories/queueSql.ts +12 -9
- package/src/rules/stories/sources.ts +1 -1
- package/src/rules/stories/specs.ts +1 -1
- package/src/rules/stories/sqlText.ts +16 -12
- package/src/rules/suppressions/biome/declarations.ts +2 -2
- package/src/rules/suppressions/biomeOverrides.ts +1 -1
- package/src/rules/suppressions/noDoubleCast.ts +1 -1
- package/src/rules/suppressions/noInline.ts +15 -7
- package/src/rules/suppressions/readonlyWrite.ts +2 -1
- package/src/testing/adapters/cli.ts +1 -1
- package/src/testing/adapters/imports.ts +2 -2
- package/src/testing/adapters/run.ts +1 -1
- package/src/testing/adapters/tree.ts +4 -0
- package/src/testing/ruleStory.ts +1 -1
- package/dist/cli/runMain.d.ts.map +0 -1
- package/dist/cli/runMain.js.map +0 -1
- package/dist/domEnvironment.config.d.ts.map +0 -1
- package/dist/domEnvironment.config.js.map +0 -1
- package/dist/unitIoGuard.config.d.ts.map +0 -1
- package/dist/unitIoGuard.config.js.map +0 -1
- /package/dist/{domEnvironment.config.d.ts → adapters/domEnvironment.config.d.ts} +0 -0
- /package/dist/{domEnvironment.config.js → adapters/domEnvironment.config.js} +0 -0
- /package/dist/{cli → adapters}/runMain.d.ts +0 -0
- /package/dist/{cli → adapters}/runMain.js +0 -0
- /package/dist/{unitIoGuard.config.d.ts → adapters/unitIoGuard.config.d.ts} +0 -0
- /package/dist/{unitIoGuard.config.js → adapters/unitIoGuard.config.js} +0 -0
- /package/src/{domEnvironment.config.ts → adapters/domEnvironment.config.ts} +0 -0
- /package/src/{cli → adapters}/runMain.ts +0 -0
- /package/src/{unitIoGuard.config.ts → adapters/unitIoGuard.config.ts} +0 -0
package/src/cli.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from "node:process";
|
|
3
|
+
import { runMain } from "#adapters/runMain.ts";
|
|
3
4
|
import { program } from "#cli/program.ts";
|
|
4
|
-
import { runMain } from "#cli/runMain.ts";
|
|
5
5
|
|
|
6
6
|
runMain(program(process.argv.slice(2), { cwd: process.cwd(), launch: { options: process.execArgv, script: process.argv[1] ?? "" } }));
|
package/src/config/decode.ts
CHANGED
|
@@ -38,6 +38,6 @@ const ConfigInput = Schema.Struct({
|
|
|
38
38
|
|
|
39
39
|
export type ConfigInput = typeof ConfigInput.Type;
|
|
40
40
|
|
|
41
|
-
export function decodeConfig(value: unknown):
|
|
41
|
+
export function decodeConfig(value: unknown): Decoded<ConfigInput> {
|
|
42
42
|
return decodeWith(ConfigInput, value);
|
|
43
43
|
}
|
package/src/config/load.ts
CHANGED
|
@@ -53,7 +53,7 @@ export const loadConfig = Effect.fn("Config.loadConfig")(function* (
|
|
|
53
53
|
const { dirname } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
54
54
|
|
|
55
55
|
const { file, loaded } = yield* readConfig(cwd, path);
|
|
56
|
-
const config = yield* validOrFail(file,
|
|
56
|
+
const config = yield* validOrFail(file, decodeConfig(loaded));
|
|
57
57
|
const rules = yield* validOrFail(file, yield* resolveRules(config));
|
|
58
58
|
return resolved(dirname(file), file, config, rules);
|
|
59
59
|
});
|
package/src/decoded.ts
CHANGED
|
@@ -4,13 +4,11 @@ import { SetupFailure } from "#failure.ts";
|
|
|
4
4
|
|
|
5
5
|
export type Decoded<TValue> = { readonly _tag: "Valid"; readonly value: TValue } | { readonly _tag: "Invalid"; readonly issues: readonly string[] };
|
|
6
6
|
|
|
7
|
-
export function decodeWith<TSchema extends Schema.ConstraintDecoder<unknown>>(schema: TSchema, value: unknown):
|
|
7
|
+
export function decodeWith<TSchema extends Schema.ConstraintDecoder<unknown>>(schema: TSchema, value: unknown): Decoded<TSchema["Type"]> {
|
|
8
8
|
const result = Schema.decodeUnknownResult(schema, { errors: "all", onExcessProperty: "error" })(value);
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
: { _tag: "Invalid", issues: SchemaIssue.makeFormatterStandardSchemaV1()(result.failure.issue).issues.map(describeIssue) },
|
|
13
|
-
);
|
|
9
|
+
return Result.isSuccess(result)
|
|
10
|
+
? { _tag: "Valid", value: result.success }
|
|
11
|
+
: { _tag: "Invalid", issues: SchemaIssue.makeFormatterStandardSchemaV1()(result.failure.issue).issues.map(describeIssue) };
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
export function validOrFail<TValue>(file: string, decoded: Decoded<TValue>): Effect.Effect<TValue, SetupFailure> {
|
|
@@ -4,13 +4,14 @@ import { type DocumentedModule, documentedModule } from "#docs/documentedModule.
|
|
|
4
4
|
import { exportsName } from "#docs/exportsName.ts";
|
|
5
5
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
6
6
|
import type { WorkspacePackage } from "#imports/workspace.ts";
|
|
7
|
-
import type {
|
|
7
|
+
import type { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
8
|
+
import type { Finding, RuleInputs } from "#rule.ts";
|
|
8
9
|
|
|
9
10
|
export interface ImportContext {
|
|
10
11
|
readonly exports: ReadonlyMap<string, unknown>;
|
|
11
12
|
readonly owner: string | undefined;
|
|
12
13
|
readonly packages: ReadonlyMap<string, WorkspacePackage>;
|
|
13
|
-
readonly readText:
|
|
14
|
+
readonly readText: RuleInputs["readText"];
|
|
14
15
|
readonly root: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -25,7 +26,7 @@ function problem(
|
|
|
25
26
|
entry: DocumentedImport,
|
|
26
27
|
module: DocumentedModule,
|
|
27
28
|
owner: WorkspacePackage,
|
|
28
|
-
): Effect.Effect<string | undefined> {
|
|
29
|
+
): Effect.Effect<string | undefined, FilesystemFailure> {
|
|
29
30
|
if (module.kind === "missing") {
|
|
30
31
|
return Effect.succeed(`"${entry.specifier}" names no module of ${owner.name}. Use the path of a module its package.json "exports" maps.`);
|
|
31
32
|
}
|
|
@@ -38,7 +39,7 @@ function problem(
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export function importFindings(context: ImportContext, file: string, markdown: string): Effect.Effect<readonly Finding[]> {
|
|
42
|
+
export function importFindings(context: ImportContext, file: string, markdown: string): Effect.Effect<readonly Finding[], FilesystemFailure> {
|
|
42
43
|
const entries = documentedImports(markdown, { owner: context.owner, packages: (name) => context.packages.has(name) });
|
|
43
44
|
const unique = [...new Map(entries.map((entry) => [`${entry.line} ${entry.specifier} ${entry.name ?? ""}`, entry])).values()];
|
|
44
45
|
return Effect.map(
|
package/src/docs/linkFindings.ts
CHANGED
|
@@ -4,10 +4,11 @@ import ts from "typescript";
|
|
|
4
4
|
import type { MarkdownLine } from "#docs/markdownLines.ts";
|
|
5
5
|
import { markdownLinks } from "#docs/markdownLinks.ts";
|
|
6
6
|
import { type Repository, repositoryLink } from "#docs/repositoryLink.ts";
|
|
7
|
+
import type { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
7
8
|
import type { Finding } from "#rule.ts";
|
|
8
9
|
|
|
9
10
|
export interface LinkContext {
|
|
10
|
-
readonly anchors: (path: string) => Effect.Effect<ReadonlySet<string> | undefined>;
|
|
11
|
+
readonly anchors: (path: string) => Effect.Effect<ReadonlySet<string> | undefined, FilesystemFailure>;
|
|
11
12
|
readonly published: string | undefined;
|
|
12
13
|
readonly repository: Repository | undefined;
|
|
13
14
|
readonly root: string;
|
|
@@ -64,7 +65,7 @@ function placement(context: LinkContext, target: string, to: Destination): strin
|
|
|
64
65
|
return undefined;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
function problem(context: LinkContext, target: string, to: Destination): Effect.Effect<string | undefined> {
|
|
68
|
+
function problem(context: LinkContext, target: string, to: Destination): Effect.Effect<string | undefined, FilesystemFailure> {
|
|
68
69
|
const misplaced = placement(context, target, to);
|
|
69
70
|
const anchor = to.anchor;
|
|
70
71
|
if (misplaced !== undefined || anchor === undefined || anchor === "" || !to.path.endsWith(".md")) {
|
|
@@ -77,7 +78,11 @@ function problem(context: LinkContext, target: string, to: Destination): Effect.
|
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
export function linkFindings(
|
|
81
|
+
export function linkFindings(
|
|
82
|
+
context: LinkContext,
|
|
83
|
+
file: string,
|
|
84
|
+
lines: readonly MarkdownLine[],
|
|
85
|
+
): Effect.Effect<readonly Finding[], FilesystemFailure> {
|
|
81
86
|
return Effect.map(
|
|
82
87
|
Effect.forEach(markdownLinks(lines), (link) => {
|
|
83
88
|
const to = destination(file, link.target, context.repository);
|
|
@@ -26,7 +26,7 @@ export const readBaseline = Effect.fn("Engine.readBaseline")(function* (
|
|
|
26
26
|
if (raw === undefined) {
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
const entries = yield* validOrFail(path,
|
|
29
|
+
const entries = yield* validOrFail(path, decodeBaseline(raw));
|
|
30
30
|
for (const entry of entries) {
|
|
31
31
|
const expected = shardOf(entry.file, config.baseline);
|
|
32
32
|
if (expected !== path) {
|
package/src/engine/session.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as NodePath from "@effect/platform-node/NodePath";
|
|
2
|
-
import { Effect, Path
|
|
2
|
+
import { Effect, Path } from "effect";
|
|
3
3
|
import { setManifestFiles } from "#adapters/manifestInventory.ts";
|
|
4
4
|
import { manifestReader } from "#adapters/manifestReader.ts";
|
|
5
5
|
import { loadConfig, type ResolvedConfig } from "#config/load.ts";
|
|
@@ -30,7 +30,7 @@ function setup<TValue, TRequirements>(effect: Effect.Effect<TValue, Error, TRequ
|
|
|
30
30
|
|
|
31
31
|
export const scan = Effect.fn("Engine.scan")(function* (
|
|
32
32
|
config: ResolvedConfig,
|
|
33
|
-
): Effect.fn.Return<Pick<Session, "inventory" | "staleRegistry" | "violations">, SetupFailure, RuleServices
|
|
33
|
+
): Effect.fn.Return<Pick<Session, "inventory" | "staleRegistry" | "violations">, SetupFailure, RuleServices> {
|
|
34
34
|
const { relative } = yield* Path.Path.pipe(Effect.provide(NodePath.layer));
|
|
35
35
|
|
|
36
36
|
const inventory = yield* setup(collectInventory(config.root, config));
|
|
@@ -49,7 +49,7 @@ export const scan = Effect.fn("Engine.scan")(function* (
|
|
|
49
49
|
const violations = yield* runRules(config.active, inputs);
|
|
50
50
|
const staleRegistry = yield* setup(staleBiomeExceptions(inputs));
|
|
51
51
|
return { inventory, staleRegistry, violations };
|
|
52
|
-
}
|
|
52
|
+
});
|
|
53
53
|
|
|
54
54
|
export const openSession = Effect.fn("Engine.openSession")(function* (
|
|
55
55
|
cwd: string,
|
|
@@ -2,6 +2,7 @@ import { Effect } from "effect";
|
|
|
2
2
|
import { biomeReport } from "#biome/report.ts";
|
|
3
3
|
import { withoutEntryPointImports } from "#biome/withoutEntryPointImports.ts";
|
|
4
4
|
import type { StaleRegistryEntry } from "#exceptions/registry.ts";
|
|
5
|
+
import type { FilesystemFailure } from "#inventory/filesystem.ts";
|
|
5
6
|
import type { Finding, RuleInputs } from "#rule.ts";
|
|
6
7
|
|
|
7
8
|
export const staleBiomeExceptions = Effect.fn("Exceptions.staleBiomeExceptions")(function* (inputs: RuleInputs) {
|
|
@@ -9,7 +10,7 @@ export const staleBiomeExceptions = Effect.fn("Exceptions.staleBiomeExceptions")
|
|
|
9
10
|
const declared = declarations.flatMap(({ files, reason, rules }) =>
|
|
10
11
|
rules.filter((rule) => /^biome\/(?:lint|assist)\//u.test(rule)).flatMap((rule) => files.map((file) => ({ file, reason, rule }))),
|
|
11
12
|
);
|
|
12
|
-
const texts = yield* Effect.forEach(declared, ({ file }) =>
|
|
13
|
+
const texts = yield* Effect.forEach(declared, ({ file }) => inputs.readText(file), { concurrency: "unbounded" });
|
|
13
14
|
const entries = declared.filter((_, index) => texts[index] !== undefined);
|
|
14
15
|
if (entries.length === 0) {
|
|
15
16
|
return [];
|
|
@@ -29,8 +30,11 @@ export const staleBiomeExceptions = Effect.fn("Exceptions.staleBiomeExceptions")
|
|
|
29
30
|
);
|
|
30
31
|
});
|
|
31
32
|
|
|
32
|
-
const missingBiomeFile = Effect.fn("Exceptions.missingBiomeFile")(function* (
|
|
33
|
-
|
|
33
|
+
const missingBiomeFile = Effect.fn("Exceptions.missingBiomeFile")(function* (
|
|
34
|
+
inputs: RuleInputs,
|
|
35
|
+
file: string,
|
|
36
|
+
): Effect.fn.Return<readonly Finding[], FilesystemFailure> {
|
|
37
|
+
const text = yield* inputs.readText(file);
|
|
34
38
|
return text === undefined
|
|
35
39
|
? [{ file, message: `This Biome exception names a missing file. Remove it from exceptions in ${inputs.configFile ?? "quality.config.ts"}.` }]
|
|
36
40
|
: [];
|
|
@@ -33,6 +33,6 @@ export type ExceptionDeclaration = typeof ExceptionDeclaration.Type;
|
|
|
33
33
|
|
|
34
34
|
const ExceptionDeclarations = Schema.Array(ExceptionDeclaration);
|
|
35
35
|
|
|
36
|
-
export function decodeExceptions(value: unknown):
|
|
36
|
+
export function decodeExceptions(value: unknown): Decoded<readonly ExceptionDeclaration[]> {
|
|
37
37
|
return decodeWith(ExceptionDeclarations, value);
|
|
38
38
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
1
2
|
import ts from "typescript";
|
|
3
|
+
import { MigrationFailure } from "#exceptions/MigrationFailure.ts";
|
|
2
4
|
import type { Declaration } from "#rules/suppressions/biome/declarations.ts";
|
|
3
5
|
|
|
4
6
|
function nameOf(property: ts.ObjectLiteralElementLike): string | undefined {
|
|
@@ -34,11 +36,13 @@ function settingPath(rule: string): readonly string[] {
|
|
|
34
36
|
return tool === "files" ? ["files", "includes"] : [tool === "lint" ? "linter" : "assist", tool === "lint" ? "rules" : "actions", group, name];
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
export function migrateBiome(text: string, file: string, declarations: readonly Declaration[]): string {
|
|
39
|
+
export function migrateBiome(text: string, file: string, declarations: readonly Declaration[]): Result.Result<string, MigrationFailure> {
|
|
38
40
|
const source = ts.parseJsonText(file, text);
|
|
39
41
|
const root = source.statements[0]?.expression;
|
|
40
42
|
if (ts.parseConfigFileTextToJson(file, text).error !== undefined || root === undefined || !ts.isObjectLiteralExpression(root)) {
|
|
41
|
-
|
|
43
|
+
return Result.fail(
|
|
44
|
+
new MigrationFailure({ message: `Cannot migrate invalid Biome config ${file}. Repair it, then run quality exceptions migrate again.` }),
|
|
45
|
+
);
|
|
42
46
|
}
|
|
43
47
|
const globals = declarations.filter((entry) => entry.rule === "files/includes");
|
|
44
48
|
const stripped = strip(
|
|
@@ -46,7 +50,7 @@ export function migrateBiome(text: string, file: string, declarations: readonly
|
|
|
46
50
|
globals.map((entry) => settingPath(entry.rule)),
|
|
47
51
|
);
|
|
48
52
|
if (!ts.isObjectLiteralExpression(stripped)) {
|
|
49
|
-
|
|
53
|
+
return Result.fail(new MigrationFailure({ message: `Cannot migrate ${file}.` }));
|
|
50
54
|
}
|
|
51
55
|
const properties = stripped.properties.flatMap((property) => {
|
|
52
56
|
if (nameOf(property) !== "overrides" || !ts.isPropertyAssignment(property) || !ts.isArrayLiteralExpression(property.initializer)) {
|
|
@@ -74,5 +78,7 @@ export function migrateBiome(text: string, file: string, declarations: readonly
|
|
|
74
78
|
? []
|
|
75
79
|
: [ts.factory.updatePropertyAssignment(property, property.name, ts.factory.updateArrayLiteralExpression(property.initializer, overrides))];
|
|
76
80
|
});
|
|
77
|
-
return
|
|
81
|
+
return Result.succeed(
|
|
82
|
+
`${ts.createPrinter().printNode(ts.EmitHint.Expression, ts.factory.updateObjectLiteralExpression(root, properties), source)}\n`,
|
|
83
|
+
);
|
|
78
84
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
1
2
|
import ts from "typescript";
|
|
2
3
|
import type { ExceptionDeclaration } from "#exceptions/declaration.ts";
|
|
4
|
+
import { MigrationFailure } from "#exceptions/MigrationFailure.ts";
|
|
5
|
+
|
|
6
|
+
interface KeptProperty {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly text: string;
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
function objectOf(expression: ts.Expression): ts.ObjectLiteralExpression | undefined {
|
|
5
12
|
if (ts.isObjectLiteralExpression(expression)) {
|
|
@@ -13,52 +20,82 @@ function objectOf(expression: ts.Expression): ts.ObjectLiteralExpression | undef
|
|
|
13
20
|
: undefined;
|
|
14
21
|
}
|
|
15
22
|
|
|
16
|
-
function nameOf(property: ts.ObjectLiteralElementLike): string | undefined {
|
|
23
|
+
function nameOf(property: ts.ObjectLiteralElementLike): Result.Result<string | undefined, MigrationFailure> {
|
|
17
24
|
const name = property.name;
|
|
18
25
|
if (name === undefined) {
|
|
19
|
-
return undefined;
|
|
26
|
+
return Result.succeed(undefined);
|
|
20
27
|
}
|
|
21
28
|
if (ts.isComputedPropertyName(name)) {
|
|
22
29
|
if (ts.isStringLiteral(name.expression) || ts.isNoSubstitutionTemplateLiteral(name.expression) || ts.isNumericLiteral(name.expression)) {
|
|
23
|
-
return name.expression.text;
|
|
30
|
+
return Result.succeed(name.expression.text);
|
|
24
31
|
}
|
|
25
|
-
|
|
32
|
+
return Result.fail(
|
|
33
|
+
new MigrationFailure({
|
|
34
|
+
message: "Cannot migrate a computed property automatically. Use literal property keys, then run quality exceptions migrate again.",
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
26
37
|
}
|
|
27
|
-
return ts.isStringLiteral(name) || ts.isIdentifier(name) || ts.isNumericLiteral(name) ? name.text : undefined;
|
|
38
|
+
return Result.succeed(ts.isStringLiteral(name) || ts.isIdentifier(name) || ts.isNumericLiteral(name) ? name.text : undefined);
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
function keptRules(initializer: ts.ObjectLiteralExpression, source: ts.SourceFile): Result.Result<readonly KeptProperty[], MigrationFailure> {
|
|
42
|
+
return Result.map(
|
|
43
|
+
Result.all(initializer.properties.map((rule) => Result.map(nameOf(rule), (name) => (name === "suppressions/biome-overrides" ? [] : [rule])))),
|
|
44
|
+
(kept) => {
|
|
45
|
+
const rules = kept.flat();
|
|
46
|
+
return rules.length === 0 ? [] : [{ name: "rules", text: `rules: {\n${rules.map((rule) => rule.getFullText(source).trim()).join(",\n")}\n}` }];
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function keptProperty(
|
|
52
|
+
property: ts.ObjectLiteralElementLike,
|
|
53
|
+
source: ts.SourceFile,
|
|
54
|
+
file: string,
|
|
55
|
+
hasDeclarations: boolean,
|
|
56
|
+
): Result.Result<readonly KeptProperty[], MigrationFailure> {
|
|
57
|
+
return Result.flatMap(nameOf(property), (name): Result.Result<readonly KeptProperty[], MigrationFailure> => {
|
|
44
58
|
if (name === "registry" || name === "exceptions") {
|
|
45
|
-
return [];
|
|
59
|
+
return Result.succeed([]);
|
|
46
60
|
}
|
|
47
61
|
if (name !== "rules" || !hasDeclarations) {
|
|
48
|
-
return [{ name: name ?? "", text: property.getFullText(source).trim() }];
|
|
62
|
+
return Result.succeed([{ name: name ?? "", text: property.getFullText(source).trim() }]);
|
|
49
63
|
}
|
|
50
64
|
if (
|
|
51
65
|
!(ts.isPropertyAssignment(property) && ts.isObjectLiteralExpression(property.initializer))
|
|
52
66
|
|| property.initializer.properties.some(ts.isSpreadAssignment)
|
|
53
67
|
) {
|
|
54
|
-
|
|
68
|
+
return Result.fail(new MigrationFailure({ message: `Inline the rules object in ${file}, then run quality exceptions migrate again.` }));
|
|
55
69
|
}
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
return keptRules(property.initializer, source);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function migrateConfig(
|
|
75
|
+
text: string | undefined,
|
|
76
|
+
file: string,
|
|
77
|
+
exceptions: readonly ExceptionDeclaration[],
|
|
78
|
+
hasDeclarations: boolean,
|
|
79
|
+
): Result.Result<string, MigrationFailure> {
|
|
80
|
+
if (text === undefined) {
|
|
81
|
+
return Result.succeed(`export default { exceptions: ${JSON.stringify(exceptions, null, "\t")} };\n`);
|
|
82
|
+
}
|
|
83
|
+
const source = ts.createSourceFile(file, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
84
|
+
const exported = source.statements.find(ts.isExportAssignment);
|
|
85
|
+
const object = exported === undefined ? undefined : objectOf(exported.expression);
|
|
86
|
+
if (object === undefined || object.properties.some(ts.isSpreadAssignment)) {
|
|
87
|
+
return Result.fail(
|
|
88
|
+
new MigrationFailure({
|
|
89
|
+
message: `Cannot migrate ${file} automatically. Export an object or defineConfig({ ... }) without spreads, then run quality exceptions migrate again.`,
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return Result.map(Result.all(object.properties.map((property) => keptProperty(property, source, file, hasDeclarations))), (kept) => {
|
|
94
|
+
const properties = kept.flat();
|
|
95
|
+
const next = properties.map((property) => property.text);
|
|
96
|
+
const index = properties.findIndex((property) => property.name > "exceptions");
|
|
97
|
+
next.splice(index < 0 ? next.length : index, 0, `exceptions: ${JSON.stringify(exceptions, null, "\t")}`);
|
|
98
|
+
const replacement = `{\n${next.join(",\n")}\n}`;
|
|
99
|
+
return text.slice(0, object.getStart(source)) + replacement + text.slice(object.end);
|
|
58
100
|
});
|
|
59
|
-
const next = properties.map((property) => property.text);
|
|
60
|
-
const index = properties.findIndex((property) => property.name > "exceptions");
|
|
61
|
-
next.splice(index < 0 ? next.length : index, 0, `exceptions: ${JSON.stringify(exceptions, null, "\t")}`);
|
|
62
|
-
const replacement = `{\n${next.join(",\n")}\n}`;
|
|
63
|
-
return text.slice(0, object.getStart(source)) + replacement + text.slice(object.end);
|
|
64
101
|
}
|
|
@@ -13,8 +13,8 @@ export type RegistryEntry = typeof RegistryEntry.Type;
|
|
|
13
13
|
|
|
14
14
|
const RegistryFile = Schema.fromJsonString(Schema.Array(RegistryEntry));
|
|
15
15
|
|
|
16
|
-
export function decodeRegistry(raw: string | undefined):
|
|
17
|
-
return raw === undefined ?
|
|
16
|
+
export function decodeRegistry(raw: string | undefined): Decoded<readonly RegistryEntry[]> {
|
|
17
|
+
return raw === undefined ? { _tag: "Valid", value: [] } : decodeWith(RegistryFile, raw);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface StaleRegistryEntry {
|
package/src/hooks/preCommit.ts
CHANGED
|
@@ -3,9 +3,11 @@ import { Console, Effect, Path } from "effect";
|
|
|
3
3
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
4
4
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
5
5
|
import { manifestReader } from "#adapters/manifestReader.ts";
|
|
6
|
-
import {
|
|
6
|
+
import { reportLint } from "#cli/lint.ts";
|
|
7
7
|
import { loadConfig } from "#config/load.ts";
|
|
8
|
+
import { passes } from "#engine/evaluate.ts";
|
|
8
9
|
import { GateFailed, SetupFailure } from "#failure.ts";
|
|
10
|
+
import { recap } from "#report/recap.ts";
|
|
9
11
|
|
|
10
12
|
const COMMIT_AGAIN =
|
|
11
13
|
"help: fix what the output above reports, then commit again; `quality hooks pre-commit` repeats these checks without committing.";
|
|
@@ -15,10 +17,10 @@ const commitScripts = Effect.fnUntraced(function* (root: string) {
|
|
|
15
17
|
|
|
16
18
|
const file = join(root, "package.json");
|
|
17
19
|
const readText = yield* manifestReader(root);
|
|
18
|
-
const manifest = yield* Effect.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const manifest = yield* Effect.mapError(
|
|
21
|
+
readPackageManifest(readText, file),
|
|
22
|
+
(cause) => new SetupFailure({ cause, message: `${file} is invalid: ${cause.message}` }),
|
|
23
|
+
);
|
|
22
24
|
if (manifest === undefined) {
|
|
23
25
|
return { manager: "npm", scripts: [] };
|
|
24
26
|
}
|
|
@@ -27,7 +29,7 @@ const commitScripts = Effect.fnUntraced(function* (root: string) {
|
|
|
27
29
|
return yield* new SetupFailure({ message: `${file}: unsupported packageManager "${manager}". Use npm, pnpm, yarn or bun.` });
|
|
28
30
|
}
|
|
29
31
|
return { manager, scripts: ["typecheck", "quality:commit"].filter((script) => manifest.scripts?.[script] !== undefined) };
|
|
30
|
-
}
|
|
32
|
+
});
|
|
31
33
|
|
|
32
34
|
const runScript = Effect.fnUntraced(
|
|
33
35
|
function* (root: string, manager: string, script: string) {
|
|
@@ -44,10 +46,8 @@ const runScript = Effect.fnUntraced(
|
|
|
44
46
|
export const preCommitHook = Effect.fn("Hooks.preCommitHook")(function* (cwd: string, path: string | undefined) {
|
|
45
47
|
const config = yield* loadConfig(cwd, path);
|
|
46
48
|
const { manager, scripts } = yield* commitScripts(config.root);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
Effect.catchTag("GateFailed", () => Effect.succeed(false)),
|
|
50
|
-
);
|
|
49
|
+
const { context, outcome } = yield* reportLint(cwd, path, true);
|
|
50
|
+
const linted = passes(outcome);
|
|
51
51
|
const failed = linted ? [] : ["quality lint"];
|
|
52
52
|
for (const script of scripts) {
|
|
53
53
|
const command = `${manager} run ${script}`;
|
|
@@ -58,7 +58,8 @@ export const preCommitHook = Effect.fn("Hooks.preCommitHook")(function* (cwd: st
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
if (failed.length > 0) {
|
|
61
|
-
|
|
61
|
+
const findings = linted ? [] : [recap(outcome, context)];
|
|
62
|
+
yield* Console.error([...findings, `quality: pre-commit failed: ${failed.join(", ")}.`, COMMIT_AGAIN].join("\n"));
|
|
62
63
|
return yield* new GateFailed();
|
|
63
64
|
}
|
|
64
65
|
});
|
|
@@ -102,7 +102,7 @@ function superclassesOf(node: ts.HeritageClause): readonly ts.Expression[] {
|
|
|
102
102
|
return node.types.map((base) => base.expression);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
const globalsIn = Effect.fn("Imports.globalsIn")(function* (file: SourceFile, browser: ReadonlySet<string>) {
|
|
106
106
|
const parsed = parse(file);
|
|
107
107
|
if (parsed === undefined) {
|
|
108
108
|
return [];
|
|
@@ -123,7 +123,7 @@ export const browserGlobals = Effect.fn("Imports.browserGlobals")(function* (fil
|
|
|
123
123
|
}
|
|
124
124
|
const direct = globalName(node, checker);
|
|
125
125
|
const names = [...destructuredNames(node, checker), ...(direct === undefined ? [] : [direct])];
|
|
126
|
-
for (const name of names.filter((candidate) =>
|
|
126
|
+
for (const name of names.filter((candidate) => browser.has(candidate))) {
|
|
127
127
|
findings.push({
|
|
128
128
|
file: file.path,
|
|
129
129
|
line: source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1,
|
|
@@ -136,3 +136,9 @@ export const browserGlobals = Effect.fn("Imports.browserGlobals")(function* (fil
|
|
|
136
136
|
visit(source);
|
|
137
137
|
return findings;
|
|
138
138
|
}, Effect.provide(ImportCompiler.layer));
|
|
139
|
+
|
|
140
|
+
export const browserGlobals = Effect.fn("Imports.browserGlobals")(function* (files: readonly SourceFile[]) {
|
|
141
|
+
const browser = yield* browserNames();
|
|
142
|
+
const findings = yield* Effect.forEach(files, (file) => globalsIn(file, browser));
|
|
143
|
+
return findings.flat();
|
|
144
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { dirname, join } from "node:path";
|
|
2
|
+
import { Effect, type FileSystem } from "effect";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
+
import { type FilesystemFailure, readRequiredText } from "#inventory/filesystem.ts";
|
|
4
5
|
|
|
5
6
|
const portable = new Set([
|
|
6
7
|
"AbortController",
|
|
@@ -66,9 +67,8 @@ const portable = new Set([
|
|
|
66
67
|
"structuredClone",
|
|
67
68
|
]);
|
|
68
69
|
|
|
69
|
-
function namesInDom(): readonly string[] {
|
|
70
|
-
const
|
|
71
|
-
const source = ts.createSourceFile(path, readFileSync(path, "utf8"), ts.ScriptTarget.Latest, true);
|
|
70
|
+
function namesInDom(path: string, text: string): readonly string[] {
|
|
71
|
+
const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true);
|
|
72
72
|
return source.statements.flatMap((statement) => {
|
|
73
73
|
if (ts.isVariableStatement(statement)) {
|
|
74
74
|
return statement.declarationList.declarations.flatMap(({ name }) => (ts.isIdentifier(name) ? [name.text] : []));
|
|
@@ -77,4 +77,12 @@ function namesInDom(): readonly string[] {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
export const browserNames
|
|
80
|
+
export const browserNames = Effect.fn("Imports.browserNames")(function* (): Effect.fn.Return<
|
|
81
|
+
ReadonlySet<string>,
|
|
82
|
+
FilesystemFailure,
|
|
83
|
+
FileSystem.FileSystem
|
|
84
|
+
> {
|
|
85
|
+
const path = join(dirname(ts.getDefaultLibFilePath({})), "lib.dom.d.ts");
|
|
86
|
+
const text = yield* readRequiredText(path);
|
|
87
|
+
return new Set(namesInDom(path, text).filter((name) => !portable.has(name)));
|
|
88
|
+
});
|
|
@@ -11,7 +11,7 @@ export interface Departure extends SpecifierSite {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const departures = Effect.fn("Imports.departures")(function* (inputs: RuleInputs) {
|
|
14
|
-
const packages = yield*
|
|
14
|
+
const packages = yield* workspacePackages(inputs);
|
|
15
15
|
const compiler = yield* ImportCompiler;
|
|
16
16
|
return yield* compiler.departures(inputs, packages);
|
|
17
17
|
}, Effect.provide(ImportCompiler.layer));
|
|
@@ -7,7 +7,7 @@ import type { RuleInputs } from "#rule.ts";
|
|
|
7
7
|
|
|
8
8
|
export const checkFences = Effect.fn("Imports.checkFences")(function* (inputs: RuleInputs, configured: readonly Fence[]) {
|
|
9
9
|
const graph = yield* importGraph(inputs);
|
|
10
|
-
const fences = [...configured, ...(yield*
|
|
11
|
-
const policy = compilePolicy(fences, { files: inputs.files, packages: graph.packages });
|
|
10
|
+
const fences = [...configured, ...(yield* discoverFences(inputs, graph.packages))];
|
|
11
|
+
const policy = yield* Effect.fromResult(compilePolicy(fences, { files: inputs.files, packages: graph.packages }));
|
|
12
12
|
return policy.flatMap((compiled) => compiled.evaluate(graph));
|
|
13
13
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Result } from "effect";
|
|
1
2
|
import type { Endpoint } from "#imports/Endpoint.ts";
|
|
3
|
+
import { BoundaryFailure } from "#imports/fences/BoundaryFailure.ts";
|
|
2
4
|
import { type CompiledFence, compileFence, type FenceGraph } from "#imports/fences/evaluate.ts";
|
|
3
5
|
import type { PolicyScope } from "#imports/fences/match.ts";
|
|
4
6
|
import type { Chain, ExampleStep, Fence } from "#imports/fences/model.ts";
|
|
@@ -66,14 +68,14 @@ function declarationIssues(fences: readonly Fence[]): readonly string[] {
|
|
|
66
68
|
]);
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
export function compilePolicy(fences: readonly Fence[], scope: PolicyScope): readonly CompiledFence[] {
|
|
71
|
+
export function compilePolicy(fences: readonly Fence[], scope: PolicyScope): Result.Result<readonly CompiledFence[], BoundaryFailure> {
|
|
70
72
|
const issues = [...declarationIssues(fences)];
|
|
71
73
|
const policy = fences.map((fence) => compileFence({ issues, scope }, fence));
|
|
72
74
|
if (issues.length === 0) {
|
|
73
75
|
issues.push(...fences.flatMap((fence) => exampleIssues(policy, fence, scope)));
|
|
74
76
|
}
|
|
75
77
|
if (issues.length > 0) {
|
|
76
|
-
|
|
78
|
+
return Result.fail(new BoundaryFailure({ message: `the fence policy is invalid:\n${issues.map((issue) => ` - ${issue}`).join("\n")}` }));
|
|
77
79
|
}
|
|
78
|
-
return policy;
|
|
80
|
+
return Result.succeed(policy);
|
|
79
81
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
1
|
import { posix, resolve } from "node:path";
|
|
3
|
-
import {
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { contentHashedModule } from "#adapters/contentHashedModule.ts";
|
|
4
|
+
import { BoundaryFailure } from "#imports/fences/BoundaryFailure.ts";
|
|
4
5
|
import { decodeDeclarations } from "#imports/fences/declarations.ts";
|
|
5
6
|
import type { Fence } from "#imports/fences/model.ts";
|
|
6
7
|
import type { WorkspacePackage } from "#imports/workspace.ts";
|
|
@@ -8,30 +9,44 @@ import type { RuleInputs } from "#rule.ts";
|
|
|
8
9
|
|
|
9
10
|
const BOUNDARY_FILE = "quality.fences.config.ts";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const text = await inputs.readText(file);
|
|
15
|
-
if (text === undefined) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
const url = pathToFileURL(resolve(inputs.root, file));
|
|
19
|
-
url.searchParams.set("content", createHash("sha256").update(text).digest("hex"));
|
|
20
|
-
const loaded: unknown = await import(url.href);
|
|
21
|
-
if (typeof loaded !== "object" || loaded === null || !("default" in loaded)) {
|
|
22
|
-
throw new Error("export an array of fence() declarations as the default export");
|
|
23
|
-
}
|
|
24
|
-
const decoded = await decodeDeclarations(loaded.default);
|
|
25
|
-
if (decoded._tag === "Invalid") {
|
|
26
|
-
throw new Error(`export an array of fence() declarations:\n${decoded.issues.join("\n")}`);
|
|
27
|
-
}
|
|
28
|
-
return decoded.value;
|
|
29
|
-
} catch (cause) {
|
|
30
|
-
throw new Error(`cannot load boundary at ${file}: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
|
|
31
|
-
}
|
|
12
|
+
function messageOf(cause: unknown): string {
|
|
13
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
32
14
|
}
|
|
33
15
|
|
|
34
|
-
|
|
35
|
-
const
|
|
16
|
+
const boundaryAt = Effect.fn("Fences.boundaryAt")(function* (inputs: RuleInputs, file: string) {
|
|
17
|
+
const text = yield* inputs.readText(file);
|
|
18
|
+
if (text === undefined) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const url = contentHashedModule(resolve(inputs.root, file), text);
|
|
22
|
+
const loaded: unknown = yield* Effect.tryPromise({
|
|
23
|
+
catch: (cause) => new BoundaryFailure({ cause, message: messageOf(cause) }),
|
|
24
|
+
try: () => import(url),
|
|
25
|
+
});
|
|
26
|
+
if (typeof loaded !== "object" || loaded === null || !("default" in loaded)) {
|
|
27
|
+
return yield* new BoundaryFailure({ message: "export an array of fence() declarations as the default export" });
|
|
28
|
+
}
|
|
29
|
+
const decoded = decodeDeclarations(loaded.default);
|
|
30
|
+
if (decoded._tag === "Invalid") {
|
|
31
|
+
return yield* new BoundaryFailure({ message: `export an array of fence() declarations:\n${decoded.issues.join("\n")}` });
|
|
32
|
+
}
|
|
33
|
+
return decoded.value;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const loadBoundary = Effect.fn("Fences.loadBoundary")(function* (
|
|
37
|
+
inputs: RuleInputs,
|
|
38
|
+
directory: string,
|
|
39
|
+
): Effect.fn.Return<readonly Fence[], BoundaryFailure> {
|
|
40
|
+
const file = posix.join(directory, BOUNDARY_FILE);
|
|
41
|
+
return yield* Effect.mapError(
|
|
42
|
+
boundaryAt(inputs, file),
|
|
43
|
+
(cause) => new BoundaryFailure({ cause, message: `cannot load boundary at ${file}: ${cause.message}` }),
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const discoverFences = Effect.fn("Fences.discoverFences")(function* (inputs: RuleInputs, packages: readonly WorkspacePackage[]) {
|
|
48
|
+
const boundaries = yield* Effect.forEach([".", ...packages.map((owner) => owner.directory)], (directory) => loadBoundary(inputs, directory), {
|
|
49
|
+
concurrency: "unbounded",
|
|
50
|
+
});
|
|
36
51
|
return boundaries.flat();
|
|
37
|
-
}
|
|
52
|
+
});
|