diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index fc64e1115..66e34e630 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -39,7 +39,7 @@ lint: - linters: [ALL] paths: - analyze/wasm/** - - protocol/gen/** + - protocol/proto/** - "**/LICENSE" - "**/CHANGELOG.md" - .github/CODEOWNERS diff --git a/protocol/.gitignore b/protocol/.gitignore index e58045176..ea5b151cb 100644 --- a/protocol/.gitignore +++ b/protocol/.gitignore @@ -136,6 +136,4 @@ client.js client.d.ts convert.js convert.d.ts -proto.js -proto.d.ts test/*.js diff --git a/protocol/client.ts b/protocol/client.ts index 5f10cedb1..ad4eb998b 100644 --- a/protocol/client.ts +++ b/protocol/client.ts @@ -13,11 +13,11 @@ import { ArcjetRule, ArcjetStack, } from "./index.js"; -import { DecideService } from "./gen/es/decide/v1alpha1/decide_connect.js"; +import { DecideService } from "./proto/decide/v1alpha1/decide_connect.js"; import { DecideRequest, ReportRequest, -} from "./gen/es/decide/v1alpha1/decide_pb.js"; +} from "./proto/decide/v1alpha1/decide_pb.js"; // TODO: Dedupe with `errorMessage` in core function errorMessage(err: unknown): string { diff --git a/protocol/convert.ts b/protocol/convert.ts index 869fea8b3..979b1ff79 100644 --- a/protocol/convert.ts +++ b/protocol/convert.ts @@ -48,7 +48,7 @@ import { RuleState, SDKStack, ShieldReason, -} from "./gen/es/decide/v1alpha1/decide_pb.js"; +} from "./proto/decide/v1alpha1/decide_pb.js"; export function ArcjetModeToProtocol(mode: ArcjetMode) { switch (mode) { diff --git a/protocol/index.ts b/protocol/index.ts index 4e809daa0..c42864881 100644 --- a/protocol/index.ts +++ b/protocol/index.ts @@ -1,5 +1,5 @@ import { typeid } from "typeid-js"; -import { Reason } from "./gen/es/decide/v1alpha1/decide_pb.js"; +import { Reason } from "./proto/decide/v1alpha1/decide_pb.js"; type RequiredProps = Required> & Omit; diff --git a/protocol/package.json b/protocol/package.json index aebb1138c..7462c4955 100644 --- a/protocol/package.json +++ b/protocol/package.json @@ -27,7 +27,7 @@ "files": [ "LICENSE", "README.md", - "gen/", + "proto/", "*.js", "*.d.ts", "*.ts", diff --git a/protocol/gen/es/decide/v1alpha1/decide_connect.d.ts b/protocol/proto/decide/v1alpha1/decide_connect.d.ts similarity index 100% rename from protocol/gen/es/decide/v1alpha1/decide_connect.d.ts rename to protocol/proto/decide/v1alpha1/decide_connect.d.ts diff --git a/protocol/gen/es/decide/v1alpha1/decide_connect.js b/protocol/proto/decide/v1alpha1/decide_connect.js similarity index 100% rename from protocol/gen/es/decide/v1alpha1/decide_connect.js rename to protocol/proto/decide/v1alpha1/decide_connect.js diff --git a/protocol/gen/es/decide/v1alpha1/decide_pb.d.ts b/protocol/proto/decide/v1alpha1/decide_pb.d.ts similarity index 99% rename from protocol/gen/es/decide/v1alpha1/decide_pb.d.ts rename to protocol/proto/decide/v1alpha1/decide_pb.d.ts index 66b85896d..56317c5cf 100644 --- a/protocol/gen/es/decide/v1alpha1/decide_pb.d.ts +++ b/protocol/proto/decide/v1alpha1/decide_pb.d.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.8.0 +// @generated by protoc-gen-es v1.10.0 // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/protocol/gen/es/decide/v1alpha1/decide_pb.js b/protocol/proto/decide/v1alpha1/decide_pb.js similarity index 99% rename from protocol/gen/es/decide/v1alpha1/decide_pb.js rename to protocol/proto/decide/v1alpha1/decide_pb.js index 724335c97..159790ed2 100644 --- a/protocol/gen/es/decide/v1alpha1/decide_pb.js +++ b/protocol/proto/decide/v1alpha1/decide_pb.js @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.8.0 +// @generated by protoc-gen-es v1.10.0 // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/protocol/rollup.config.js b/protocol/rollup.config.js index a8e7fc8bc..97c2bfe1e 100644 --- a/protocol/rollup.config.js +++ b/protocol/rollup.config.js @@ -7,16 +7,16 @@ export default createConfig(import.meta.url, { // This externalizes the auto-generated protobuf code so it is not // processed by rollup resolveId(source) { - if (source === "./gen/es/decide/v1alpha1/decide_pb.js") { + if (source === "./proto/decide/v1alpha1/decide_pb.js") { return { id: source, external: true }; } - if (source === "../gen/es/decide/v1alpha1/decide_pb.js") { + if (source === "../proto/decide/v1alpha1/decide_pb.js") { return { id: source, external: true }; } - if (source === "./gen/es/decide/v1alpha1/decide_connect.js") { + if (source === "./proto/decide/v1alpha1/decide_connect.js") { return { id: source, external: true }; } - if (source === "../gen/es/decide/v1alpha1/decide_connect.js") { + if (source === "../proto/decide/v1alpha1/decide_connect.js") { return { id: source, external: true }; } return null; diff --git a/protocol/test/client.test.ts b/protocol/test/client.test.ts index a366719e6..af5ee535d 100644 --- a/protocol/test/client.test.ts +++ b/protocol/test/client.test.ts @@ -8,7 +8,7 @@ import { } from "@jest/globals"; import { createClient } from "../client.js"; import { createRouterTransport } from "@connectrpc/connect"; -import { DecideService } from "../gen/es/decide/v1alpha1/decide_connect.js"; +import { DecideService } from "../proto/decide/v1alpha1/decide_connect.js"; import { Conclusion, DecideRequest, @@ -20,7 +20,7 @@ import { RuleResult, RuleState, SDKStack, -} from "../gen/es/decide/v1alpha1/decide_pb.js"; +} from "../proto/decide/v1alpha1/decide_pb.js"; import { ArcjetAllowDecision, ArcjetChallengeDecision, diff --git a/protocol/test/convert.test.ts b/protocol/test/convert.test.ts index dd1c6dab7..40f087b74 100644 --- a/protocol/test/convert.test.ts +++ b/protocol/test/convert.test.ts @@ -33,7 +33,7 @@ import { RuleResult, RuleState, SDKStack, -} from "../gen/es/decide/v1alpha1/decide_pb.js"; +} from "../proto/decide/v1alpha1/decide_pb.js"; import { ArcjetAllowDecision, ArcjetBotReason,