Skip to content

Commit

Permalink
Merge branch 'release-1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhoadley committed Jul 6, 2023
2 parents f29328f + fc14fe8 commit 24c980a
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
The format here is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1] - 2023-07-06
### Changed
- Updated some dependency versions (Surefire, JUnit).

### Fixed
- Changed `log4j-slf4j-impl``slf4j-api` (but adds
`log4j-slf4j2-impl` for unit tests).
- Fixed issue with over-eager property truncation, leading to
occasional invalid CSS.

## [1.0] - 2021-12-29
### Changed
- Updated some dependency versions.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependency:
<dependency>
<groupId>net.logicsquad</groupId>
<artifactId>minifier</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>

If you're building a Maven project, and just want to minify project
Expand Down
29 changes: 23 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.logicsquad</groupId>
<artifactId>minifier</artifactId>
<version>1.0</version>
<version>1.1</version>
<name>Minifier</name>
<description>Java-based minification for web resources.</description>
<url>https://github.com/logicsquad/minifier</url>
Expand Down Expand Up @@ -193,7 +193,7 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.1.2</version>
<executions>
<execution>
<id>default-test</id>
Expand Down Expand Up @@ -300,16 +300,33 @@
</plugins>
</reporting>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.1</version>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/net/logicsquad/minifier/css/CSSMinifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ public Selector(String selector)
if (contents.length() == 1) {
throw new EmptySelectorBodyException(selector);
}
contents = contents.substring(0, contents.length() - 2);
contents = contents.substring(0, contents.length() - 1);
if (contents.charAt(contents.length() - 1) == ';') {
contents = contents.substring(0, contents.length() - 1);
}

this.properties = new Property[0];
this.properties = parseProperties(contents).toArray(this.properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class CSSMinifierTest extends AbstractMinifierTest {
/**
* Indexes for input/output resources
*/
private static final List<String> RESOURCES = Arrays.asList("01", "02", "03", "04", "05", "06", "07", "08", "09",
"10", "11", "12", "13", "14", "15", "16", "17", "18");
private static final List<String> RESOURCES = Arrays.asList("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24", "25");

/**
* Extension for resource files
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/input/test-19.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hacked-var {
color: var(--vert)
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-20.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hacked-content:before {
content: "Quantité x"
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-21.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hacked-important {
width: 50% !important
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-22.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.background-linear {
background: linear-gradient(0deg, rgba(152, 152, 139, 0.468207351299895) 0%, rgba(255, 255, 255, 0) 100%);
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-23.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.grid-template {
grid-template-columns: repeat(5, minmax(15%, 1fr));
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-24.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.calc {
top: calc((40px - 1.75rem) / 2);
}
3 changes: 3 additions & 0 deletions src/test/resources/input/test-25.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
status=error
name=PropertiesConfig

filters=threshold

filter.threshold.type=ThresholdFilter
filter.threshold.level=debug

appenders=console

appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c %m%n

rootLogger.level=info
rootLogger.appenderRefs=stdout
rootLogger.appenderRef.stdout.ref=STDOUT
1 change: 1 addition & 0 deletions src/test/resources/output/test-19.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.hacked-var{color:var(--vert)}
1 change: 1 addition & 0 deletions src/test/resources/output/test-20.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.hacked-content:before{content:"Quantité x"}
1 change: 1 addition & 0 deletions src/test/resources/output/test-21.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.hacked-important{width:50%!important}
1 change: 1 addition & 0 deletions src/test/resources/output/test-22.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/test/resources/output/test-23.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.grid-template{grid-template-columns:repeat(5,minmax(15%,1fr))}
1 change: 1 addition & 0 deletions src/test/resources/output/test-24.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.calc{top:calc((40px - 1.75rem) / 2)}
1 change: 1 addition & 0 deletions src/test/resources/output/test-25.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24c980a

Please sign in to comment.