Skip to content

Commit

Permalink
feat!: Remove support for external location with new Structurizr vers…
Browse files Browse the repository at this point in the history
…ion (#89)

* build(deps): Bump the maven group across 1 directory with 13 updates

Bumps the maven group with 13 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| io.vertx:vertx-stack-depchain | `4.4.4` | `4.5.9` |
| [com.structurizr:structurizr-client](https://github.com/structurizr/java) | `1.24.1` | `2.2.0` |
| [com.structurizr:structurizr-core](https://github.com/structurizr/java) | `1.24.1` | `2.2.0` |
| [com.structurizr:structurizr-dsl](https://github.com/structurizr/java) | `1.30.2` | `2.2.0` |
| [com.structurizr:structurizr-export](https://github.com/structurizr/java) | `1.15.0` | `2.2.0` |
| commons-cli:commons-cli | `1.5.0` | `1.8.0` |
| [net.sourceforge.plantuml:plantuml](https://github.com/plantuml/plantuml) | `1.2023.10` | `1.2024.6` |
| [org.fusesource.jansi:jansi](https://github.com/fusesource/jansi) | `2.4.0` | `2.4.1` |
| [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) | `3.11.0` | `3.13.0` |
| [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) | `3.1.2` | `3.3.1` |
| [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) | `0.8.10` | `0.8.12` |
| [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) | `3.6.0` | `3.7.1` |
| [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) | `3.3.0` | `3.4.2` |



Updates `io.vertx:vertx-stack-depchain` from 4.4.4 to 4.5.9

Updates `com.structurizr:structurizr-client` from 1.24.1 to 2.2.0
- [Release notes](https://github.com/structurizr/java/releases)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)
- [Commits](structurizr/java@v1.24.1...v2.2.0)

Updates `com.structurizr:structurizr-core` from 1.24.1 to 2.2.0
- [Release notes](https://github.com/structurizr/java/releases)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)
- [Commits](structurizr/java@v1.24.1...v2.2.0)

Updates `com.structurizr:structurizr-dsl` from 1.30.2 to 2.2.0
- [Release notes](https://github.com/structurizr/java/releases)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)
- [Commits](https://github.com/structurizr/java/commits/v2.2.0)

Updates `com.structurizr:structurizr-export` from 1.15.0 to 2.2.0
- [Release notes](https://github.com/structurizr/java/releases)
- [Changelog](https://github.com/structurizr/java/blob/master/changelog.md)
- [Commits](structurizr/java@v1.15.0...v2.2.0)

Updates `commons-cli:commons-cli` from 1.5.0 to 1.8.0

Updates `net.sourceforge.plantuml:plantuml` from 1.2023.10 to 1.2024.6
- [Release notes](https://github.com/plantuml/plantuml/releases)
- [Commits](plantuml/plantuml@v1.2023.10...v1.2024.6)

Updates `org.fusesource.jansi:jansi` from 2.4.0 to 2.4.1
- [Release notes](https://github.com/fusesource/jansi/releases)
- [Changelog](https://github.com/fusesource/jansi/blob/master/changelog.md)
- [Commits](fusesource/jansi@jansi-2.4.0...jansi-2.4.1)

Updates `org.apache.maven.plugins:maven-compiler-plugin` from 3.11.0 to 3.13.0
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](apache/maven-compiler-plugin@maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.13.0)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.1.2 to 3.3.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.1.2...surefire-3.3.1)

Updates `org.jacoco:jacoco-maven-plugin` from 0.8.10 to 0.8.12
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](jacoco/jacoco@v0.8.10...v0.8.12)

Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.6.0 to 3.7.1
- [Release notes](https://github.com/apache/maven-dependency-plugin/releases)
- [Commits](apache/maven-dependency-plugin@maven-dependency-plugin-3.6.0...maven-dependency-plugin-3.7.1)

Updates `org.apache.maven.plugins:maven-jar-plugin` from 3.3.0 to 3.4.2
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](apache/maven-jar-plugin@maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.2)

---
updated-dependencies:
- dependency-name: io.vertx:vertx-stack-depchain
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: com.structurizr:structurizr-client
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: maven
- dependency-name: com.structurizr:structurizr-core
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: maven
- dependency-name: com.structurizr:structurizr-dsl
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: maven
- dependency-name: com.structurizr:structurizr-export
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: maven
- dependency-name: commons-cli:commons-cli
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: net.sourceforge.plantuml:plantuml
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: org.fusesource.jansi:jansi
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: org.jacoco:jacoco-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven
- dependency-name: org.apache.maven.plugins:maven-dependency-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven
...

Signed-off-by: dependabot[bot] <[email protected]>

* feat!: Remove external location support

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Sjöberg <[email protected]>
  • Loading branch information
dependabot[bot] and sasjo authored Jul 30, 2024
1 parent 1e781f0 commit 63c252a
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ EXPOSE 3000

WORKDIR /docs

CMD ["java", "-jar", "/app/structurizr-to-png.jar"]
ENTRYPOINT ["/opt/java/openjdk/bin/java", "-jar", "/app/structurizr-to-png.jar"]
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
Create PNGs from [Structurizr DSL](https://github.com/structurizr/dsl#readme) files.

This project uses [PlantUML](https://plantuml.com) or [Graphviz](https://graphviz.org) to render Structurizr DSL to PNG
images with various rendering strategies. Image rendering is based on exports from the Structurizr CLI. The project
performs some post-processing of the workspace model to support conventions around external software systems.
images with various rendering strategies. Image rendering is based on exports from the Structurizr CLI.

* Tags are mapped to shapes in the [`theme.json`](./src/main/resources/themes/theme.json)
* Systems tagged with `External`, `External System` or `Existing System` will be rendered as external
A default [`theme.json`](./src/main/resources/themes/theme.json) is used when no user provided theme is referenced. The
default theme maps tags to shapes and has some conventions around external systems.

## Features

Expand Down
Binary file modified images/c4plantuml/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/c4plantuml/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/graphviz/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/graphviz/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/structurizr/structurizr-PriceTracker-Container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/structurizr/structurizr-PriceTracker-SystemContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-stack-depchain</artifactId>
<version>4.4.4</version>
<version>4.5.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -83,22 +83,22 @@
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-client</artifactId>
<version>1.24.1</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-core</artifactId>
<version>1.24.1</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-dsl</artifactId>
<version>1.30.2</version>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.structurizr</groupId>
<artifactId>structurizr-export</artifactId>
<version>1.15.0</version>
<version>2.2.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -124,7 +124,7 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
Expand All @@ -137,12 +137,12 @@
<dependency>
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2023.10</version>
<version>1.2024.6</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.4.0</version>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -191,11 +191,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>3.3.1</version>
<configuration>
<argLine>@{argLine} -Dfile.encoding=UTF-8</argLine>
<runOrder>random</runOrder>
Expand All @@ -204,7 +204,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.12</version>
<executions>
<execution>
<id>jacoco-surefire</id>
Expand Down Expand Up @@ -233,7 +233,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.7.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
Expand All @@ -253,7 +253,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/com/extendaretail/dsl2png/WorkspaceReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.structurizr.Workspace;
import com.structurizr.dsl.StructurizrDslParser;
import com.structurizr.dsl.StructurizrDslParserException;
import com.structurizr.model.Location;
import com.structurizr.model.SoftwareSystem;
import com.structurizr.view.ComponentView;
import com.structurizr.view.Configuration;
Expand Down Expand Up @@ -54,7 +53,7 @@ public WorkspaceReader(int themePort) {
public Workspace loadFromDsl(File dslFile) throws IOException, StructurizrDslParserException {
Workspace workspace = parseDsl(dslFile);
addTheme(workspace);
setExternalLocation(workspace);
// setExternalLocation(workspace);
workspace
.getViews()
.getViews()
Expand Down Expand Up @@ -121,12 +120,12 @@ private void addTheme(Workspace workspace) throws IOException {
}
}

private void setExternalLocation(Workspace workspace) {
workspace.getModel().getSoftwareSystems().stream()
.filter(hasExternalTag)
.forEach(
s -> {
s.setLocation(Location.External);
});
}
// private void setExternalLocation(Workspace workspace) {
// workspace.getModel().getSoftwareSystems().stream()
// .filter(hasExternalTag)
// .forEach(
// s -> {
// s.setLocation(Location.External);
// });
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.extendaretail.dsl2png.vertx.MainVerticle;
import com.structurizr.Workspace;
import com.structurizr.dsl.StructurizrDslParserException;
import com.structurizr.model.Location;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.junit5.VertxExtension;
Expand Down Expand Up @@ -42,11 +41,6 @@ void dslWithValidSyntax(TestInfo testInfo, Vertx vertx, VertxTestContext testCon
assertEquals(2, workspace.getModel().getSoftwareSystems().size());
assertEquals(4, workspace.getViews().getViews().size());

// Location should've been decorated.
assertEquals(
Location.External,
workspace.getModel().getSoftwareSystemWithName("Existing System").getLocation());

testContext.completeNow();
});
}
Expand All @@ -61,7 +55,8 @@ void dslWithSyntaxError(TestInfo testInfo, VertxTestContext testContext) throws
() -> new WorkspaceReader(httpPort).loadFromDsl(createInvalidDsl(testInfo)));
assertThat(e)
.hasMessageContaining("Unexpected tokens")
.hasMessageContaining("at line 3: user = personX \"User\" \"A user\"");
.hasMessageContaining("at line 3")
.hasMessageContaining("user = personX \"User\" \"A user\"");
testContext.completeNow();
});
}
Expand Down

0 comments on commit 63c252a

Please sign in to comment.