From 2c1939744b3b7d58ff97ee6eb0fee37f342f039c Mon Sep 17 00:00:00 2001 From: Thomas Faust Date: Sun, 16 Mar 2025 07:16:53 +0100 Subject: [PATCH] refactor(zitadel-proto): restructure package files and update entry points --- packages/zitadel-proto/package.json | 7 +-- packages/zitadel-proto/{ => src}/index.ts | 0 packages/zitadel-proto/src/v1.ts | 53 +++++++++++++++++++++++ packages/zitadel-proto/src/v2.ts | 49 +++++++++++++++++++++ packages/zitadel-proto/src/v3alpha.ts | 9 ++++ packages/zitadel-proto/tsup.config.ts | 3 +- packages/zitadel-proto/v1.ts | 53 ----------------------- packages/zitadel-proto/v2.ts | 49 --------------------- packages/zitadel-proto/v3alpha.ts | 9 ---- 9 files changed, 115 insertions(+), 117 deletions(-) rename packages/zitadel-proto/{ => src}/index.ts (100%) create mode 100644 packages/zitadel-proto/src/v1.ts create mode 100644 packages/zitadel-proto/src/v2.ts create mode 100644 packages/zitadel-proto/src/v3alpha.ts delete mode 100644 packages/zitadel-proto/v1.ts delete mode 100644 packages/zitadel-proto/v2.ts delete mode 100644 packages/zitadel-proto/v3alpha.ts diff --git a/packages/zitadel-proto/package.json b/packages/zitadel-proto/package.json index 5a1b2fee1d..cc3d37fdb6 100644 --- a/packages/zitadel-proto/package.json +++ b/packages/zitadel-proto/package.json @@ -16,10 +16,7 @@ } }, "files": [ - "index.ts", - "v1.ts", - "v2.ts", - "v3alpha.ts", + "src/**", "zitadel/**", "validate/**", "google/**", @@ -32,7 +29,7 @@ "build": "tsup", "test:cjs": "node test/cjs-test.cjs", "test:esm": "node test/esm-test.mjs", - "test": "pnpm build && pnpm test:cjs && pnpm test:esm" + "test": "pnpm test:cjs && pnpm test:esm" }, "dependencies": { "@bufbuild/protobuf": "^2.2.2" diff --git a/packages/zitadel-proto/index.ts b/packages/zitadel-proto/src/index.ts similarity index 100% rename from packages/zitadel-proto/index.ts rename to packages/zitadel-proto/src/index.ts diff --git a/packages/zitadel-proto/src/v1.ts b/packages/zitadel-proto/src/v1.ts new file mode 100644 index 0000000000..887df5ceb9 --- /dev/null +++ b/packages/zitadel-proto/src/v1.ts @@ -0,0 +1,53 @@ +import * as action from "../zitadel/action_pb.js"; +import * as admin from "../zitadel/admin_pb.js"; +import * as app from "../zitadel/app_pb.js"; +import * as auth_n_key from "../zitadel/auth_n_key_pb.js"; +import * as auth from "../zitadel/auth_pb.js"; +import * as change from "../zitadel/change_pb.js"; +import * as event from "../zitadel/event_pb.js"; +import * as feature from "../zitadel/feature_pb.js"; +import * as idp from "../zitadel/idp_pb.js"; +import * as instance from "../zitadel/instance_pb.js"; +import * as management from "../zitadel/management_pb.js"; +import * as member from "../zitadel/member_pb.js"; +import * as message from "../zitadel/message_pb.js"; +import * as metadata from "../zitadel/metadata_pb.js"; +import * as object from "../zitadel/object_pb.js"; +import * as options from "../zitadel/options_pb.js"; +import * as org from "../zitadel/org_pb.js"; +import * as policy from "../zitadel/policy_pb.js"; +import * as project from "../zitadel/project_pb.js"; +import * as quota from "../zitadel/quota_pb.js"; +import * as settings from "../zitadel/settings_pb.js"; +import * as system from "../zitadel/system_pb.js"; +import * as text from "../zitadel/text_pb.js"; +import * as user from "../zitadel/user_pb.js"; +import * as v1 from "../zitadel/v1_pb.js"; + +export { + action, + admin, + app, + auth, + auth_n_key, + change, + event, + feature, + idp, + instance, + management, + member, + message, + metadata, + object, + options, + org, + policy, + project, + quota, + settings, + system, + text, + user, + v1, +}; diff --git a/packages/zitadel-proto/src/v2.ts b/packages/zitadel-proto/src/v2.ts new file mode 100644 index 0000000000..e2167c4581 --- /dev/null +++ b/packages/zitadel-proto/src/v2.ts @@ -0,0 +1,49 @@ +import * as feature from "../zitadel/feature/v2/feature_pb.js"; +import * as feature_service from "../zitadel/feature/v2/feature_service_pb.js"; +import * as idp from "../zitadel/idp/v2/idp_pb.js"; +import * as idp_service from "../zitadel/idp/v2/idp_service_pb.js"; +import * as object from "../zitadel/object/v2/object_pb.js"; +import * as oidc_authorization from "../zitadel/oidc/v2/authorization_pb.js"; +import * as oidc_service from "../zitadel/oidc/v2/oidc_service_pb.js"; +import * as org from "../zitadel/org/v2/org_pb.js"; +import * as org_service from "../zitadel/org/v2/org_service_pb.js"; +import * as saml_authorization from "../zitadel/saml/v2/authorization_pb.js"; +import * as saml_service from "../zitadel/saml/v2/saml_service_pb.js"; +import * as session from "../zitadel/session/v2/session_pb.js"; +import * as session_service from "../zitadel/session/v2/session_service_pb.js"; +import * as settings from "../zitadel/settings/v2/settings_pb.js"; +import * as settings_service from "../zitadel/settings/v2/settings_service_pb.js"; +import * as user_auth from "../zitadel/user/v2/auth_pb.js"; +import * as user_email from "../zitadel/user/v2/email_pb.js"; +import * as user_idp from "../zitadel/user/v2/idp_pb.js"; +import * as user_password from "../zitadel/user/v2/password_pb.js"; +import * as user_phone from "../zitadel/user/v2/phone_pb.js"; +import * as user_query from "../zitadel/user/v2/query_pb.js"; +import * as user from "../zitadel/user/v2/user_pb.js"; +import * as user_service from "../zitadel/user/v2/user_service_pb.js"; + +export { + feature, + feature_service, + idp, + idp_service, + object, + oidc_authorization, + oidc_service, + org, + org_service, + saml_authorization, + saml_service, + session, + session_service, + settings, + settings_service, + user, + user_auth, + user_email, + user_idp, + user_password, + user_phone, + user_query, + user_service, +}; diff --git a/packages/zitadel-proto/src/v3alpha.ts b/packages/zitadel-proto/src/v3alpha.ts new file mode 100644 index 0000000000..9d787bdc5b --- /dev/null +++ b/packages/zitadel-proto/src/v3alpha.ts @@ -0,0 +1,9 @@ +import * as user_authenticator from "../zitadel/resources/user/v3alpha/authenticator_pb.js"; +import * as user_communication from "../zitadel/resources/user/v3alpha/communication_pb.js"; +import * as user_query from "../zitadel/resources/user/v3alpha/query_pb.js"; +import * as user from "../zitadel/resources/user/v3alpha/user_pb.js"; +import * as user_service from "../zitadel/resources/user/v3alpha/user_service_pb.js"; +import * as user_schema from "../zitadel/resources/userschema/v3alpha/user_schema_pb.js"; +import * as user_schema_service from "../zitadel/resources/userschema/v3alpha/user_schema_service_pb.js"; + +export { user, user_authenticator, user_communication, user_query, user_schema, user_schema_service, user_service }; diff --git a/packages/zitadel-proto/tsup.config.ts b/packages/zitadel-proto/tsup.config.ts index 1fa9c664a7..13a78084c6 100644 --- a/packages/zitadel-proto/tsup.config.ts +++ b/packages/zitadel-proto/tsup.config.ts @@ -1,11 +1,12 @@ import { defineConfig } from "tsup"; export default defineConfig({ - entry: ["index.ts"], + entry: ["src/index.ts", "src/v1.ts", "src/v2.ts", "src/v3alpha.ts"], dts: true, clean: true, minify: false, splitting: false, + treeshake: false, sourcemap: true, format: ["esm", "cjs"], platform: "neutral", diff --git a/packages/zitadel-proto/v1.ts b/packages/zitadel-proto/v1.ts deleted file mode 100644 index bea11ca384..0000000000 --- a/packages/zitadel-proto/v1.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as action from "./zitadel/action_pb.js"; -import * as admin from "./zitadel/admin_pb.js"; -import * as app from "./zitadel/app_pb.js"; -import * as auth_n_key from "./zitadel/auth_n_key_pb.js"; -import * as auth from "./zitadel/auth_pb.js"; -import * as change from "./zitadel/change_pb.js"; -import * as event from "./zitadel/event_pb.js"; -import * as feature from "./zitadel/feature_pb.js"; -import * as idp from "./zitadel/idp_pb.js"; -import * as instance from "./zitadel/instance_pb.js"; -import * as management from "./zitadel/management_pb.js"; -import * as member from "./zitadel/member_pb.js"; -import * as message from "./zitadel/message_pb.js"; -import * as metadata from "./zitadel/metadata_pb.js"; -import * as object from "./zitadel/object_pb.js"; -import * as options from "./zitadel/options_pb.js"; -import * as org from "./zitadel/org_pb.js"; -import * as policy from "./zitadel/policy_pb.js"; -import * as project from "./zitadel/project_pb.js"; -import * as quota from "./zitadel/quota_pb.js"; -import * as settings from "./zitadel/settings_pb.js"; -import * as system from "./zitadel/system_pb.js"; -import * as text from "./zitadel/text_pb.js"; -import * as user from "./zitadel/user_pb.js"; -import * as v1 from "./zitadel/v1_pb.js"; - -export { - action, - admin, - app, - auth, - auth_n_key, - change, - event, - feature, - idp, - instance, - management, - member, - message, - metadata, - object, - options, - org, - policy, - project, - quota, - settings, - system, - text, - user, - v1, -}; diff --git a/packages/zitadel-proto/v2.ts b/packages/zitadel-proto/v2.ts deleted file mode 100644 index 532db0d82e..0000000000 --- a/packages/zitadel-proto/v2.ts +++ /dev/null @@ -1,49 +0,0 @@ -import * as feature from "./zitadel/feature/v2/feature_pb.js"; -import * as feature_service from "./zitadel/feature/v2/feature_service_pb.js"; -import * as idp from "./zitadel/idp/v2/idp_pb.js"; -import * as idp_service from "./zitadel/idp/v2/idp_service_pb.js"; -import * as object from "./zitadel/object/v2/object_pb.js"; -import * as oidc_authorization from "./zitadel/oidc/v2/authorization_pb.js"; -import * as oidc_service from "./zitadel/oidc/v2/oidc_service_pb.js"; -import * as org from "./zitadel/org/v2/org_pb.js"; -import * as org_service from "./zitadel/org/v2/org_service_pb.js"; -import * as saml_authorization from "./zitadel/saml/v2/authorization_pb.js"; -import * as saml_service from "./zitadel/saml/v2/saml_service_pb.js"; -import * as session from "./zitadel/session/v2/session_pb.js"; -import * as session_service from "./zitadel/session/v2/session_service_pb.js"; -import * as settings from "./zitadel/settings/v2/settings_pb.js"; -import * as settings_service from "./zitadel/settings/v2/settings_service_pb.js"; -import * as user_auth from "./zitadel/user/v2/auth_pb.js"; -import * as user_email from "./zitadel/user/v2/email_pb.js"; -import * as user_idp from "./zitadel/user/v2/idp_pb.js"; -import * as user_password from "./zitadel/user/v2/password_pb.js"; -import * as user_phone from "./zitadel/user/v2/phone_pb.js"; -import * as user_query from "./zitadel/user/v2/query_pb.js"; -import * as user from "./zitadel/user/v2/user_pb.js"; -import * as user_service from "./zitadel/user/v2/user_service_pb.js"; - -export { - feature, - feature_service, - idp, - idp_service, - object, - oidc_authorization, - oidc_service, - org, - org_service, - saml_authorization, - saml_service, - session, - session_service, - settings, - settings_service, - user, - user_auth, - user_email, - user_idp, - user_password, - user_phone, - user_query, - user_service, -}; diff --git a/packages/zitadel-proto/v3alpha.ts b/packages/zitadel-proto/v3alpha.ts deleted file mode 100644 index e6b2c33464..0000000000 --- a/packages/zitadel-proto/v3alpha.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as user_authenticator from "./zitadel/resources/user/v3alpha/authenticator_pb.js"; -import * as user_communication from "./zitadel/resources/user/v3alpha/communication_pb.js"; -import * as user_query from "./zitadel/resources/user/v3alpha/query_pb.js"; -import * as user from "./zitadel/resources/user/v3alpha/user_pb.js"; -import * as user_service from "./zitadel/resources/user/v3alpha/user_service_pb.js"; -import * as user_schema from "./zitadel/resources/userschema/v3alpha/user_schema_pb.js"; -import * as user_schema_service from "./zitadel/resources/userschema/v3alpha/user_schema_service_pb.js"; - -export { user, user_authenticator, user_communication, user_query, user_schema, user_schema_service, user_service };