History

chore: remove dead code and widen lint allowlists

Rhys Sullivan committed 7 months ago

Commit 357bcae1 parent cd6773910 files · +5 −48Browse files

Unified · Split

10 files
  1. .oxlintrc.jsonc +3 −1
  2. apps/executor/src/cli/main.ts +0 −36
  3. packages/platform/sdk-file/src/index.ts +0 −2
  4. packages/platform/sdk/src/executor-effect.ts +0 −1
  5. packages/platform/sdk/src/local/secret-stores.ts +0 −1
  6. packages/platform/sdk/src/local/secrets.ts +0 −1
  7. packages/platform/sdk/src/plugins.ts +0 −1
  8. packages/platform/sdk/src/runtime/source-artifacts.ts +0 −3
  9. plugins/onepassword/http/index.ts +0 −2
  10. tools/oxlint/rules/no-manual-openapi-documents.mjs +2 −0
.oxlintrc.jsonc+3−1
@@ -59,7 +59,9 @@ · 58 unmodified lines
59 // package-graph cycles from test-only dependencies.59 // package-graph cycles from test-only dependencies.
60 "files": [60 "files": [
61 "packages/platform/sdk/src/executor.test.ts",61 "packages/platform/sdk/src/executor.test.ts",
62 "packages/platform/sdk/src/runtime/executor-runtime.test.ts"62 "packages/platform/sdk/src/runtime/executor-runtime.test.ts",
63 "packages/platform/server/src/index.test.ts",
64 "packages/clients/react/src/index.test.tsx"
63 ],65 ],
64 "rules": {66 "rules": {
65 "executor-monorepo/no-cross-workspace-relative-imports": "off"67 "executor-monorepo/no-cross-workspace-relative-imports": "off"
apps/executor/src/cli/main.ts+0−36
@@ -535,42 +535,6 @@ const startServerInBackground = (port: number) => · 534 unmodified lines
535 }),535 }),
536 );536 );
537 537
538type LocalServerPidRecord = {
539 pid?: number;
540 port?: number;
541 host?: string;
542 baseUrl?: string;
543 startedAt?: number;
544 logFile?: string;
545};
546
547const readPidRecord = (): Effect.Effect<
548 LocalServerPidRecord | null,
549 never,
550 FileSystem.FileSystem
551> =>
552 Effect.gen(function* () {
553 const fs = yield* FileSystem.FileSystem;
554 const contents = yield* fs.readFileString(DEFAULT_SERVER_PID_FILE, "utf8").pipe(
555 Effect.catchAll(() => Effect.succeed<string | null>(null)),
556 );
557 if (contents === null) {
558 return null;
559 }
560
561 return JSON.parse(contents) as LocalServerPidRecord;
562 }).pipe(Effect.catchAll(() => Effect.succeed(null)));
563
564const isPidRunning = (pid: number): boolean => {
565 try {
566 process.kill(pid, 0);
567 return true;
568 } catch (error) {
569 return error instanceof Error && "code" in error && error.code === "EPERM";
570 }
571};
572
573
574const readServerLogTail = (538const readServerLogTail = (
575 logFile: string = DEFAULT_SERVER_LOG_FILE,539 logFile: string = DEFAULT_SERVER_LOG_FILE,
576 maxLines: number = 40,540 maxLines: number = 40,
packages/platform/sdk-file/src/index.ts+0−2
@@ -12,7 +12,6 @@ import { · 11 unmodified lines
12} from "@executor/platform-sdk";12} from "@executor/platform-sdk";
13import {13import {
14 createExecutorEffect,14 createExecutorEffect,
15 type CreateExecutorEffectOptions,
16 type ExecutorEffect,15 type ExecutorEffect,
17} from "@executor/platform-sdk/effect";16} from "@executor/platform-sdk/effect";
18import type {17import type {
@@ -247,7 +246,6 @@ export const createLocalExecutorRepositoriesEffect = ( · 228 unmodified lines
247 workspaceContext,246 workspaceContext,
248 fileSystem,247 fileSystem,
249 );248 );
250 const loadedConfig = yield* workspaceConfigStore.load();
251 const pluginRegistry = runtimeOptions.pluginRegistry ?? emptyExecutorPluginRegistry();249 const pluginRegistry = runtimeOptions.pluginRegistry ?? emptyExecutorPluginRegistry();
252 yield* provisionBuiltinSecretStores({250 yield* provisionBuiltinSecretStores({
253 executorState: executorStateStorage.executorState,251 executorState: executorStateStorage.executorState,
packages/platform/sdk/src/executor-effect.ts+0−1
@@ -13,7 +13,6 @@ import type { · 12 unmodified lines
13} from "./executions/contracts";13} from "./executions/contracts";
14import type {14import type {
15 BrowseSecretStorePayload,15 BrowseSecretStorePayload,
16 BrowseSecretStoreResult,
17 CreateSecretPayload,16 CreateSecretPayload,
18 CreateSecretStorePayload,17 CreateSecretStorePayload,
19 CreateSecretResult,18 CreateSecretResult,
packages/platform/sdk/src/local/secret-stores.ts+0−1
@@ -9,7 +9,6 @@ import { · 8 unmodified lines
9 type DeleteSecretStoreResult,9 type DeleteSecretStoreResult,
10 type ImportSecretFromStorePayload,10 type ImportSecretFromStorePayload,
11 type SecretStoreCapabilities,11 type SecretStoreCapabilities,
12 type SecretStore as SecretStoreContract,
13 type UpdateSecretStorePayload,12 type UpdateSecretStorePayload,
14} from "./contracts";13} from "./contracts";
15import {14import {
packages/platform/sdk/src/local/secrets.ts+0−1
@@ -3,7 +3,6 @@ import * as Option from "effect/Option"; · 2 unmodified lines
3 3
4import {4import {
5 SecretMaterialIdSchema,5 SecretMaterialIdSchema,
6 type SecretStore,
7} from "../schema";6} from "../schema";
8import {7import {
9 type CreateSecretPayload,8 type CreateSecretPayload,
packages/platform/sdk/src/plugins.ts+0−1
@@ -13,7 +13,6 @@ import { · 12 unmodified lines
13 type Source as ExecutorSource,13 type Source as ExecutorSource,
14 type SecretMaterial,14 type SecretMaterial,
15 type SecretMaterialPurpose,15 type SecretMaterialPurpose,
16 type SecretRef,
17 type SecretStore,16 type SecretStore,
18} from "./schema";17} from "./schema";
19import type {18import type {
packages/platform/sdk/src/runtime/source-artifacts.ts+0−3
@@ -53,9 +53,6 @@ const ReadableLocalSourceArtifactSchema = Schema.Struct({ · 52 unmodified lines
53 snapshot: Schema.Unknown,53 snapshot: Schema.Unknown,
54});54});
55 55
56type ReadableLocalSourceArtifact =
57 typeof ReadableLocalSourceArtifactSchema.Type;
58
59const decodeReadableLocalSourceArtifactOption = Schema.decodeUnknownOption(56const decodeReadableLocalSourceArtifactOption = Schema.decodeUnknownOption(
60 Schema.parseJson(57 Schema.parseJson(
61 ReadableLocalSourceArtifactSchema,58 ReadableLocalSourceArtifactSchema,
plugins/onepassword/http/index.ts+0−2
@@ -3,8 +3,6 @@ import { · 2 unmodified lines
3 HttpApiBuilder,3 HttpApiBuilder,
4} from "@effect/platform";4} from "@effect/platform";
5import {5import {
6 ControlPlaneBadRequestError,
7 ControlPlaneForbiddenError,
8 ControlPlaneStorageError,6 ControlPlaneStorageError,
9 type ExecutorHttpPlugin,7 type ExecutorHttpPlugin,
10} from "@executor/platform-api";8} from "@executor/platform-api";
tools/oxlint/rules/no-manual-openapi-documents.mjs+2−0
@@ -6,6 +6,8 @@ const MANUAL_OPENAPI_RULE_ALLOWED_PATH_SEGMENTS = [ · 5 unmodified lines
6 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}source-adapter-fixture-matrix.test.ts`,6 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}source-adapter-fixture-matrix.test.ts`,
7 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}source-discovery.test.ts`,7 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}source-discovery.test.ts`,
8 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}executor-tools.test.ts`,8 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}executor-tools.test.ts`,
9 `${path.sep}packages${path.sep}platform${path.sep}sdk${path.sep}src${path.sep}runtime${path.sep}sources${path.sep}openapi-type-contract.test.ts`,
10 `${path.sep}plugins${path.sep}openapi${path.sep}sdk${path.sep}document.test.ts`,
9];11];
10 12
11const OPENAPI_MARKER_KEYS = new Set(["openapi", "swagger"]);13const OPENAPI_MARKER_KEYS = new Set(["openapi", "swagger"]);