mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 06:04:03 +00:00
refactor(ports): give the bundle resource operation policy a port owner (#11533)
This commit is contained in:
1 parent
54d55c7a23
commit
a0e89a8970
8 files changed
+42
-33
No files matched your search
@@ -99,11 +99,11 @@ import {
|
||||
} from "../BinaryTargetResolver.js";
|
||||
import { resolveAppBundleResourceRoot } from "../AppBundleExecutable.js";
|
||||
import type { ResolvedAppBundleResourceRoot } from "../../domain/apple/bundleResourceRoot.js";
|
||||
import {
|
||||
BUNDLE_RESOURCE_OPERATIONS,
|
||||
type ActiveBundleResourceSession,
|
||||
type BundleResourceClientFactory,
|
||||
import type {
|
||||
ActiveBundleResourceSession,
|
||||
BundleResourceClientFactory,
|
||||
} from "./BundleResourceSession.js";
|
||||
import { BUNDLE_RESOURCE_OPERATIONS } from "../../ports/BundleResourceOperations.js";
|
||||
|
||||
interface SessionRun {
|
||||
readonly client: AnalysisClient;
|
||||
|
||||
@@ -8,28 +8,10 @@ import { analysisErrorWithCloseRejections } from "../../domain/analysisErrorClea
|
||||
import { err, ok } from "../../domain/result.js";
|
||||
import type { ResolvedAppBundleResourceRoot } from "../../domain/apple/bundleResourceRoot.js";
|
||||
import { closeAnalysisClient } from "../../providers/AnalysisClientCleanup.js";
|
||||
|
||||
export const BUNDLE_NATIVE_RESOURCE_OPERATIONS = new Set<AnalysisOperation>([
|
||||
"inspect_plist",
|
||||
]);
|
||||
|
||||
export const BUNDLE_ARTIFACT_RESOURCE_OPERATIONS = new Set<AnalysisOperation>([
|
||||
"decode_interface_builder",
|
||||
"inspect_asset_catalog",
|
||||
"inspect_keyed_archive",
|
||||
]);
|
||||
|
||||
export const BUNDLE_RESOURCE_OPERATIONS = new Set<AnalysisOperation>([
|
||||
...BUNDLE_NATIVE_RESOURCE_OPERATIONS,
|
||||
...BUNDLE_ARTIFACT_RESOURCE_OPERATIONS,
|
||||
]);
|
||||
|
||||
/** Share the dispatch owner's resource-session operation policy with discovery. */
|
||||
export const isBundleResourceOperation = (name: string): boolean => {
|
||||
for (const operation of BUNDLE_RESOURCE_OPERATIONS)
|
||||
if (operation === name) return true;
|
||||
return false;
|
||||
};
|
||||
import {
|
||||
BUNDLE_NATIVE_RESOURCE_OPERATIONS,
|
||||
BUNDLE_RESOURCE_OPERATIONS,
|
||||
} from "../../ports/BundleResourceOperations.js";
|
||||
|
||||
/** Provider-specific owner of the four read-only app-resource operations. */
|
||||
export interface BundleResourceClientFactory {
|
||||
|
||||
Reference in new issue
Block a user