From 3b6e692864bc9f92772a42c32f4ad19fd95a4364 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Fri, 17 Oct 2025 09:02:04 +0300 Subject: [PATCH 1/7] added support for design system event --- Sources/AnalyticsGen/Models/Event/Event.swift | 1 + Sources/AnalyticsGen/main.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/AnalyticsGen/Models/Event/Event.swift b/Sources/AnalyticsGen/Models/Event/Event.swift index c867482..4adcc05 100644 --- a/Sources/AnalyticsGen/Models/Event/Event.swift +++ b/Sources/AnalyticsGen/Models/Event/Event.swift @@ -13,4 +13,5 @@ struct Event: Decodable { let external: ExternalEvent? let `internal`: InternalEvent? let name: String + let isForDesignSystem: Bool? } diff --git a/Sources/AnalyticsGen/main.swift b/Sources/AnalyticsGen/main.swift index feacd57..76e9066 100644 --- a/Sources/AnalyticsGen/main.swift +++ b/Sources/AnalyticsGen/main.swift @@ -20,6 +20,6 @@ private extension String { // MARK: - Type Properties - static let version = "0.6.9" + static let version = "0.6.10" static let description = "Generate analytics code for you Swift iOS project" } From dba498489a1eadb328f6c9ef4ca1305eb822e193 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Fri, 17 Oct 2025 09:02:45 +0300 Subject: [PATCH 2/7] version up --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f8c3661..ab2691d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PREFIX?=/usr/local PRODUCT_NAME=analyticsgen -PRODUCT_VERSION=0.6.9 +PRODUCT_VERSION=0.6.10 TEMPLATES_NAME=Templates README_NAME=README.md LICENSE_NAME=LICENSE From 3982ecd365ed379fc5b8e80649d8cc8b66c8f1e2 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Fri, 17 Oct 2025 11:22:37 +0300 Subject: [PATCH 3/7] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AnalyticsGen/Generators/Event/DefaultEventGenerator.swift | 3 ++- .../AnalyticsGen/Generators/Event/InternalEventContext.swift | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift index af9a099..3e7be42 100644 --- a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift +++ b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift @@ -143,7 +143,8 @@ final class DefaultEventGenerator: EventGenerator { hasParametersToInit: !internalEvent .parameters .filter { !$0.type.oneOf.isNil || !$0.type.swiftType.isNil } - .isEmpty + .isEmpty, + isForDesignSystem: event.isForDesignSystem ?? false ) ) } diff --git a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift index 48977db..594d2b7 100644 --- a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift +++ b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift @@ -38,4 +38,5 @@ struct InternalEventContext: Encodable { let schemePath: String let parameters: [Parameter]? let hasParametersToInit: Bool + let isForDesignSystem: Bool } From caea18c2d3487f546e6d86d4ffc11f0693252932 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Mon, 20 Oct 2025 13:39:51 +0300 Subject: [PATCH 4/7] hhtmsource proxy --- Sources/AnalyticsGen/Models/Event/Internal/InternalEvent.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/AnalyticsGen/Models/Event/Internal/InternalEvent.swift b/Sources/AnalyticsGen/Models/Event/Internal/InternalEvent.swift index 468726e..c6d9413 100644 --- a/Sources/AnalyticsGen/Models/Event/Internal/InternalEvent.swift +++ b/Sources/AnalyticsGen/Models/Event/Internal/InternalEvent.swift @@ -49,6 +49,7 @@ struct InternalEvent: Decodable { let platform: EventPlatform? let sql: String? let parameters: [InternalEventParameter] + let hhtmSource: InternalEventParameter? // MARK: - @@ -66,6 +67,7 @@ struct InternalEvent: Decodable { self.event = try container.decode(forKey: .event) self.platform = try container.decodeIfPresent(forKey: .platform) self.sql = try container.decodeIfPresent(forKey: .sql) + self.hhtmSource = try container.decodeIfPresent(forKey: .hhtmSource) self.parameters = try container .allKeys From 4fe2d0f379c1ced69ec66b19980333e0a77d14d5 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Mon, 20 Oct 2025 13:47:59 +0300 Subject: [PATCH 5/7] hhtmsource proxy --- .../Generators/Event/DefaultEventGenerator.swift | 11 ++++++++++- .../Generators/Event/InternalEventContext.swift | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift index 3e7be42..ce2ef51 100644 --- a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift +++ b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift @@ -144,7 +144,16 @@ final class DefaultEventGenerator: EventGenerator { .parameters .filter { !$0.type.oneOf.isNil || !$0.type.swiftType.isNil } .isEmpty, - isForDesignSystem: event.isForDesignSystem ?? false + isForDesignSystem: event.isForDesignSystem ?? false, + hhtmSource: internalEvent.hhtmSource.map { hhtmSource in + InternalEventContext.Parameter( + name: hhtmSource.name, + description: hhtmSource.description, + oneOf: hhtmSource.type.oneOf, + const: hhtmSource.type.const, + type: hhtmSource.type.swiftType + ) + } ) ) } diff --git a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift index 594d2b7..9ed4284 100644 --- a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift +++ b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift @@ -39,4 +39,5 @@ struct InternalEventContext: Encodable { let parameters: [Parameter]? let hasParametersToInit: Bool let isForDesignSystem: Bool + let hhtmSource: Parameter? } From a433ac2cf0da64ac9b958a7d13438c9671ad575c Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Tue, 21 Oct 2025 16:35:32 +0300 Subject: [PATCH 6/7] tmp --- .../AnalyticsGen/Generators/Event/DefaultEventGenerator.swift | 1 + Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift | 1 + Sources/AnalyticsGen/Models/Event/Event.swift | 1 + 3 files changed, 3 insertions(+) diff --git a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift index ce2ef51..909519a 100644 --- a/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift +++ b/Sources/AnalyticsGen/Generators/Event/DefaultEventGenerator.swift @@ -145,6 +145,7 @@ final class DefaultEventGenerator: EventGenerator { .filter { !$0.type.oneOf.isNil || !$0.type.swiftType.isNil } .isEmpty, isForDesignSystem: event.isForDesignSystem ?? false, + isDesignSystem: event.isDesignSystem ?? false, hhtmSource: internalEvent.hhtmSource.map { hhtmSource in InternalEventContext.Parameter( name: hhtmSource.name, diff --git a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift index 9ed4284..e0b3fb1 100644 --- a/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift +++ b/Sources/AnalyticsGen/Generators/Event/InternalEventContext.swift @@ -39,5 +39,6 @@ struct InternalEventContext: Encodable { let parameters: [Parameter]? let hasParametersToInit: Bool let isForDesignSystem: Bool + let isDesignSystem: Bool let hhtmSource: Parameter? } diff --git a/Sources/AnalyticsGen/Models/Event/Event.swift b/Sources/AnalyticsGen/Models/Event/Event.swift index 4adcc05..feb9f4b 100644 --- a/Sources/AnalyticsGen/Models/Event/Event.swift +++ b/Sources/AnalyticsGen/Models/Event/Event.swift @@ -14,4 +14,5 @@ struct Event: Decodable { let `internal`: InternalEvent? let name: String let isForDesignSystem: Bool? + let isDesignSystem: Bool? } From 2c7dc0c59d4be75a71827bd5fc9c44a416f5f770 Mon Sep 17 00:00:00 2001 From: Alexander Khodko Date: Mon, 15 Dec 2025 23:27:00 +0300 Subject: [PATCH 7/7] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D1=83=20application?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- Sources/AnalyticsGen/Models/Event/Event.swift | 1 - .../AnalyticsGen/Models/Event/EventApplication.swift | 10 ---------- Sources/AnalyticsGen/main.swift | 2 +- 4 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 Sources/AnalyticsGen/Models/Event/EventApplication.swift diff --git a/Makefile b/Makefile index ab2691d..775237e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PREFIX?=/usr/local PRODUCT_NAME=analyticsgen -PRODUCT_VERSION=0.6.10 +PRODUCT_VERSION=0.6.11 TEMPLATES_NAME=Templates README_NAME=README.md LICENSE_NAME=LICENSE diff --git a/Sources/AnalyticsGen/Models/Event/Event.swift b/Sources/AnalyticsGen/Models/Event/Event.swift index feb9f4b..ac15f20 100644 --- a/Sources/AnalyticsGen/Models/Event/Event.swift +++ b/Sources/AnalyticsGen/Models/Event/Event.swift @@ -4,7 +4,6 @@ struct Event: Decodable { // MARK: - Instance Properties - let application: EventApplication let edition: [EventEdition]? let deprecated: Bool? let category: String diff --git a/Sources/AnalyticsGen/Models/Event/EventApplication.swift b/Sources/AnalyticsGen/Models/Event/EventApplication.swift deleted file mode 100644 index 95d29bb..0000000 --- a/Sources/AnalyticsGen/Models/Event/EventApplication.swift +++ /dev/null @@ -1,10 +0,0 @@ -import Foundation - -enum EventApplication: String, Decodable { - - // MARK: - Enumeration Cases - - case applicant - case employer - case hrMobile = "hr-mobile" -} diff --git a/Sources/AnalyticsGen/main.swift b/Sources/AnalyticsGen/main.swift index 76e9066..8277e10 100644 --- a/Sources/AnalyticsGen/main.swift +++ b/Sources/AnalyticsGen/main.swift @@ -20,6 +20,6 @@ private extension String { // MARK: - Type Properties - static let version = "0.6.10" + static let version = "0.6.11" static let description = "Generate analytics code for you Swift iOS project" }