From 499f70a1c871fa87cff39b819e8e36e9cefc02ba Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 13 Sep 2023 13:57:52 -0300 Subject: [PATCH] Move Zinc extensions to its own package --- .../BaselineOfStargate.class.st | 68 +++++++++++-------- .../UUID.extension.st | 2 +- .../ZnHeaders.extension.st | 2 +- .../ZnRequest.extension.st | 6 +- .../ZnResponse.extension.st | 2 +- .../ZnUrl.extension.st | 4 +- source/Stargate-Zinc-Extensions/package.st | 1 + 7 files changed, 47 insertions(+), 38 deletions(-) rename source/{Stargate-Model => Stargate-Zinc-Extensions}/UUID.extension.st (71%) rename source/{Stargate-Model => Stargate-Zinc-Extensions}/ZnHeaders.extension.st (80%) rename source/{Stargate-Model => Stargate-Zinc-Extensions}/ZnRequest.extension.st (77%) rename source/{Stargate-Model => Stargate-Zinc-Extensions}/ZnResponse.extension.st (71%) rename source/{Stargate-Model => Stargate-Zinc-Extensions}/ZnUrl.extension.st (62%) create mode 100644 source/Stargate-Zinc-Extensions/package.st diff --git a/source/BaselineOfStargate/BaselineOfStargate.class.st b/source/BaselineOfStargate/BaselineOfStargate.class.st index ee16e17..01637d4 100644 --- a/source/BaselineOfStargate/BaselineOfStargate.class.st +++ b/source/BaselineOfStargate/BaselineOfStargate.class.st @@ -27,6 +27,24 @@ BaselineOfStargate >> projectClass [ ^ MetacelloCypressBaselineProject ] +{ #category : #baselines } +BaselineOfStargate >> setUpCorePackages: spec [ + + spec + package: 'Stargate-Model' with: [ + spec requires: + #( 'Buoy-Deployment' 'Hyperspace-Deployment' + 'Teapot-Deployment' 'JSONWebToken-Deployment' ) ]; + group: 'Core' with: 'Stargate-Model'; + group: 'Deployment' with: 'Stargate-Model'. + + spec + package: 'Stargate-Zinc-Extensions' + with: [ spec requires: 'Stargate-Model' ]; + group: 'Core' with: 'Stargate-Zinc-Extensions'; + group: 'Deployment' with: 'Stargate-Zinc-Extensions' +] + { #category : #baselines } BaselineOfStargate >> setUpDependencies: spec [ @@ -69,62 +87,52 @@ BaselineOfStargate >> setUpDependencies: spec [ { #category : #baselines } BaselineOfStargate >> setUpDeploymentPackages: spec [ + self setUpCorePackages: spec. spec - package: 'Stargate-Model' with: [ - spec requires: - #( 'Buoy-Deployment' 'Hyperspace-Deployment' 'Teapot-Deployment' 'JSONWebToken-Deployment' ) - ]; - group: 'Core' with: 'Stargate-Model'; - group: 'Deployment' with: 'Stargate-Model'. - - spec - package: 'Stargate-HealthCheck' with: [ spec requires: 'Stargate-Model' ]; + package: 'Stargate-HealthCheck' with: [ spec requires: 'Core' ]; group: 'HealthCheck' with: 'Stargate-HealthCheck'; group: 'Deployment' with: 'HealthCheck'. - spec - package: 'Stargate-Metrics' with: [ spec requires: 'Stargate-Model' ]; + package: 'Stargate-Metrics' with: [ spec requires: 'Core' ]; group: 'Metrics' with: 'Stargate-Metrics'; group: 'Deployment' with: 'Metrics'. - spec - package: 'Stargate-Metrics-HTTP' with: [ spec requires: 'Stargate-Metrics' ]; + package: 'Stargate-Metrics-HTTP' + with: [ spec requires: 'Stargate-Metrics' ]; group: 'Metrics-HTTP' with: 'Stargate-Metrics-HTTP'; group: 'Deployment' with: 'Metrics-HTTP'. - spec - package: 'Stargate-JSON-RPC' with: [ spec requires: #( 'Stargate-Model' 'JRPC-Deployment' ) ]; + package: 'Stargate-JSON-RPC' + with: [ spec requires: #( 'Core' 'JRPC-Deployment' ) ]; group: 'JSON-RPC' with: 'Stargate-JSON-RPC'; group: 'Deployment' with: 'JSON-RPC'. - spec - package: 'Stargate-Application-Control' with: [ spec requires: #( 'Stargate-Model' - 'JSON-RPC' ) ]; + package: 'Stargate-Application-Control' + with: [ spec requires: #( 'Core' 'JSON-RPC' ) ]; group: 'Application-Control' with: 'Stargate-Application-Control'; group: 'Deployment' with: 'Application-Control'. - spec - package: 'Stargate-Application-Info' with: [ spec requires: 'Stargate-Model' ]; + package: 'Stargate-Application-Info' + with: [ spec requires: 'Core' ]; group: 'Application-Info' with: 'Stargate-Application-Info'; group: 'Deployment' with: 'Application-Info'. - spec package: 'Stargate-Application-Configuration' - with: [ spec requires: #( 'Stargate-Model' 'Launchpad-Deployment' ) ]; - group: 'Application-Configuration' with: 'Stargate-Application-Configuration'; + with: [ spec requires: #( 'Core' 'Launchpad-Deployment' ) ]; + group: 'Application-Configuration' + with: 'Stargate-Application-Configuration'; group: 'Deployment' with: 'Application-Configuration'. - spec - package: 'Stargate-Loggers' with: [ spec requires: #( 'Stargate-Model' 'Launchpad-Deployment' ) ]; + package: 'Stargate-Loggers' + with: [ spec requires: #( 'Core' 'Launchpad-Deployment' ) ]; group: 'Loggers' with: 'Stargate-Loggers'; group: 'Deployment' with: 'Loggers'. - spec - package: 'Stargate-API-Skeleton' with: [ + package: 'Stargate-API-Skeleton' with: [ spec requires: - #( 'Metrics-HTTP' 'Application-Control' 'Application-Info' 'Application-Configuration' - 'Launchpad-Deployment' 'ZTimestamp-Core' ) - ]; + #( 'Metrics-HTTP' 'Application-Control' 'Application-Info' + 'Application-Configuration' 'Launchpad-Deployment' + 'ZTimestamp-Core' ) ]; group: 'Deployment' with: 'Stargate-API-Skeleton' ] diff --git a/source/Stargate-Model/UUID.extension.st b/source/Stargate-Zinc-Extensions/UUID.extension.st similarity index 71% rename from source/Stargate-Model/UUID.extension.st rename to source/Stargate-Zinc-Extensions/UUID.extension.st index f63b556..d8f8475 100644 --- a/source/Stargate-Model/UUID.extension.st +++ b/source/Stargate-Zinc-Extensions/UUID.extension.st @@ -1,6 +1,6 @@ Extension { #name : #UUID } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } UUID >> neoJsonOn: neoJSONWriter [ neoJSONWriter writeString: self printString diff --git a/source/Stargate-Model/ZnHeaders.extension.st b/source/Stargate-Zinc-Extensions/ZnHeaders.extension.st similarity index 80% rename from source/Stargate-Model/ZnHeaders.extension.st rename to source/Stargate-Zinc-Extensions/ZnHeaders.extension.st index c59e9d2..dc87ba4 100644 --- a/source/Stargate-Model/ZnHeaders.extension.st +++ b/source/Stargate-Zinc-Extensions/ZnHeaders.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ZnHeaders } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnHeaders >> at: headerName addSeparatedWithComma: aValue [ self at: headerName put: aValue ifPresentMerge: [ :existing :new | existing , ', ' , new ] diff --git a/source/Stargate-Model/ZnRequest.extension.st b/source/Stargate-Zinc-Extensions/ZnRequest.extension.st similarity index 77% rename from source/Stargate-Model/ZnRequest.extension.st rename to source/Stargate-Zinc-Extensions/ZnRequest.extension.st index b012166..08b15e4 100644 --- a/source/Stargate-Model/ZnRequest.extension.st +++ b/source/Stargate-Zinc-Extensions/ZnRequest.extension.st @@ -1,18 +1,18 @@ Extension { #name : #ZnRequest } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnRequest >> setUrlTemplate: urlTemplate [ self headers at: #'X-Stargate-URL-Template' put: urlTemplate asString ] -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnRequest >> urlTemplateIfAbsent: aBlock [ ^ self headers at: #'X-Stargate-URL-Template' ifAbsent: aBlock ] -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnRequest >> withAcceptHeaderDo: aBlock ifAbsent: failBlock [ | headerValue | diff --git a/source/Stargate-Model/ZnResponse.extension.st b/source/Stargate-Zinc-Extensions/ZnResponse.extension.st similarity index 71% rename from source/Stargate-Model/ZnResponse.extension.st rename to source/Stargate-Zinc-Extensions/ZnResponse.extension.st index f0544c4..1b7a009 100644 --- a/source/Stargate-Model/ZnResponse.extension.st +++ b/source/Stargate-Zinc-Extensions/ZnResponse.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ZnResponse } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnResponse class >> forbidden [ ^ self statusLine: ZnStatusLine forbidden diff --git a/source/Stargate-Model/ZnUrl.extension.st b/source/Stargate-Zinc-Extensions/ZnUrl.extension.st similarity index 62% rename from source/Stargate-Model/ZnUrl.extension.st rename to source/Stargate-Zinc-Extensions/ZnUrl.extension.st index 537b602..cbf1ebf 100644 --- a/source/Stargate-Model/ZnUrl.extension.st +++ b/source/Stargate-Zinc-Extensions/ZnUrl.extension.st @@ -1,12 +1,12 @@ Extension { #name : #ZnUrl } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnUrl >> asWebOrigin [ ^ WebOrigin basedOn: self ] -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Zinc-Extensions' } ZnUrl >> hasValidOrigin [ ^ WebOrigin hasValidOrigin: self diff --git a/source/Stargate-Zinc-Extensions/package.st b/source/Stargate-Zinc-Extensions/package.st new file mode 100644 index 0000000..9bbfc8a --- /dev/null +++ b/source/Stargate-Zinc-Extensions/package.st @@ -0,0 +1 @@ +Package { #name : #'Stargate-Zinc-Extensions' }