Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge minimessage #622

Merged
merged 367 commits into from Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
367 commits
Select commit Hold shift + click to select a range
516b3d4
start to fix the escape stuff
MiniDigger Nov 15, 2020
26fd9e5
add unit test for #45
MiniDigger Nov 15, 2020
7db0ca3
add api for customizing the transformation registry, implements #36
MiniDigger Nov 15, 2020
c0fc98c
fix style merging for templates
MiniDigger Nov 20, 2020
1df80a5
build: Bump to gradle 6.7.1, start using indra
zml2008 Nov 24, 2020
aad156c
improve escape handling
MiniDigger Nov 24, 2020
acf7f0e
fix unintentional build changes
MiniDigger Nov 24, 2020
b6eea1c
Add MiniMessage#parse(String, Object...) and test
aecsocket Nov 24, 2020
c8e6c93
Add Tag convenience aliases
MiniDigger Nov 24, 2020
dca858e
Introduce markdown flavors
MiniDigger Nov 24, 2020
7cfd484
build: Bump adventure to 4.2.0
zml2008 Nov 26, 2020
7790a51
add more tag convenience aliases
MiniDigger Nov 26, 2020
358086b
change default markdown flavor to legacy, plus other stuff
MiniDigger Nov 26, 2020
0336789
add placeholder resolve, implements #47
MiniDigger Nov 26, 2020
b80a44a
Add changelog entry
MiniDigger Nov 26, 2020
8a45b1b
disable dum unit test for now
MiniDigger Nov 26, 2020
9c894cc
chore: apply kyori checkstyle to project
zml2008 Nov 27, 2020
28df9af
Add obfuscated alias
MiniDigger Nov 28, 2020
36e6371
add missing break
MiniDigger Nov 28, 2020
a143097
add lenient mode
MiniDigger Nov 28, 2020
56e6ae2
Bump adventure from 4.2.0 to 4.3.0
dependabot[bot] Dec 4, 2020
45d7c54
Merge pull request #61 from KyoriPowered/dependabot/gradle/adventure-…
zml2008 Dec 4, 2020
fb39039
build: Fix actions runs on PRs
zml2008 Dec 5, 2020
8ef86e7
JavaDoc: Explain how MiniMessage handles replacing placeholders
Dec 19, 2020
07efa45
better error handling for malformed strings that don't ever close a t…
MiniDigger Dec 20, 2020
947c064
fix checkstyle
MiniDigger Dec 20, 2020
518ad4a
add simple benchmark
MiniDigger Dec 20, 2020
980810f
Fix varargs object parser method, improve test
aecsocket Dec 31, 2020
7d35a02
Improve MiniMessage#parse(String, Object...): add raw template suppor…
aecsocket Jan 5, 2021
fcffe6c
catch unbalanced placeholder objects
MiniDigger Jan 5, 2021
0b943ed
Use a Consumer<List<String>> instead of a Consumer<String> for error …
jpenilla Dec 5, 2020
9ba93aa
change order of one time transformation application to fix template a…
MiniDigger Jan 5, 2021
4a5ca0b
include font on serialization, fixes #71
MiniDigger Jan 5, 2021
e146411
expand non strict mode, fix stylelint
MiniDigger Jan 5, 2021
4e5d52c
Improve handling of invalid gradients
jpenilla Dec 5, 2020
c6277c9
build: Bump Gradle to 6.8
zml2008 Jan 8, 2021
c584fc1
bit more error handling for insertion and keybind tokens
MiniDigger Jan 12, 2021
4512e36
fix non ending components in non strict mode
MiniDigger Jan 12, 2021
6aaf925
hey my name is checkstyle and I hate humanity
MiniDigger Jan 12, 2021
2ce3924
hey my name is checkstyle and I hate humanity (2)
MiniDigger Jan 12, 2021
dbf6cfa
chore: Bump adventure to 4.4.0
zml2008 Jan 18, 2021
ce97c79
test: Make tests independent of JSON syntax
zml2008 Jan 23, 2021
5bbf893
build: Update checkstyle to match adventure
zml2008 Jan 23, 2021
f86eaa4
Bump indraVersion from 1.2.1 to 1.3.1
dependabot[bot] Feb 4, 2021
c3165d1
Merge pull request #75 from KyoriPowered/dependabot/gradle/indraVersi…
zml2008 Feb 4, 2021
3999d48
Don't escape the whole tag if an excaped start is followed by a real …
MiniDigger Feb 7, 2021
146e7ce
fix checkstyle
MiniDigger Feb 7, 2021
4e28ca4
adjust error message for wrongly typed placeholders
MiniDigger Feb 20, 2021
48b5f66
fix unit test (thanks kash!) and made the message even more clear
MiniDigger Feb 20, 2021
00e6319
fix: make unbalanced placeholder final
PhilCCMG Feb 22, 2021
47e074a
Merge pull request #81 from PhilCCMG/master
kashike Feb 22, 2021
65cf826
Bump adventure from 4.4.0 to 4.5.1
dependabot[bot] Feb 24, 2021
7956125
Merge pull request #83 from KyoriPowered/dependabot/gradle/adventure-…
kashike Feb 24, 2021
dc70b3d
properly check if hover event is a component, closes #42 for now
MiniDigger Feb 27, 2021
2630d1f
Treat invalid close tags as strings, closes #26
MiniDigger Feb 27, 2021
cff9fac
Bump adventure from 4.5.1 to 4.6.0
dependabot[bot] Mar 2, 2021
8bbcab5
Merge pull request #85 from KyoriPowered/dependabot/gradle/adventure-…
kashike Mar 2, 2021
80bd695
Bump adventure from 4.6.0 to 4.7.0
dependabot[bot] Mar 9, 2021
16b8993
fix invalid test, add new (disabled) test, see #92
MiniDigger Mar 16, 2021
6faaf9c
optimize custom placeholder handling
MiniDigger Mar 16, 2021
0078d3d
Throw UnsupportedOperationException instead of creating invalid hover…
jpenilla Apr 1, 2021
1da8d50
Fix quote escaping and implement show_item/show_entity hover events
jpenilla Apr 2, 2021
76611ee
Throw on unknown HoverEvent.Action type
jpenilla Apr 2, 2021
e666d93
Implement show item/entity serialization
jpenilla Apr 2, 2021
6873e58
build: Bump to Gradle 7, indra 2
zml2008 May 15, 2021
0523f5d
Merge pull request #95 from jpenilla/fix-quotes-show-item-entity
zml2008 May 15, 2021
74ba48a
Remove println accidentally left in hover handler
zml2008 May 16, 2021
7666817
Bump junit-jupiter-engine from 5.7.1 to 5.7.2
dependabot[bot] May 17, 2021
8ce83b3
Bump junit-jupiter-api from 5.7.1 to 5.7.2
dependabot[bot] May 17, 2021
33e6590
Handle TranslatableComponent arguments in MiniMessageSerializer
jpenilla May 17, 2021
e0bf753
Fixed the wrong order of templates translation
Sceri Apr 15, 2021
a497148
fix serializer to support children components correctly. and update t…
Ehhthan Apr 3, 2021
d9bb766
add alias for fake spelling of gray, closes #87
MiniDigger May 21, 2021
068b9de
add (disabled) unit test for #91
MiniDigger May 21, 2021
c3fa19c
use context for recursive parsing, pass templates if needed, closes #103
MiniDigger May 21, 2021
be91893
apply transformations to one time transformations of the end of the i…
MiniDigger May 21, 2021
feb0160
allow templates to be used inside pre tags, closes #98
MiniDigger May 21, 2021
2a05cd9
escape pre end tags in string templates, since this is most likely ne…
MiniDigger May 21, 2021
2922bc6
add unit test for #93 and #68
MiniDigger May 21, 2021
898f119
Add dark_grey alias (#112)
Andre601 May 21, 2021
708ef78
build: Adventure 4.7.0 -> 4.8.1
zml2008 Jun 12, 2021
3f21b76
Implement JavaCC parser for MiniMessage format
DenWav May 23, 2021
6dfc0d6
Fix some checkstyle errors and remove accidental dependency
DenWav May 23, 2021
8e113eb
Tell IntelliJ the generated source dir is generated
DenWav May 23, 2021
5482d98
Slightly optimize and cleanup parser
DenWav May 23, 2021
987482d
refactor a ton of stuff to plug it into the new parser
MiniDigger May 23, 2021
9d5316d
start fixing some unit tests
MiniDigger May 23, 2021
a0d9608
moooar tests
MiniDigger May 23, 2021
81c95f0
Include Tokens in elements to allow better error messages
DenWav May 23, 2021
bf4214e
Allow URLs in tag values without quotes
DenWav May 23, 2021
2c0736b
fun
MiniDigger May 23, 2021
dddb04c
Drop javacc in favor of a manually written parser
DenWav May 26, 2021
ef1f164
Fix braces test
DenWav May 26, 2021
5470fee
Add some comments etc
DenWav May 26, 2021
a354bb0
work on a bunch of unit tests
MiniDigger May 26, 2021
d289a02
add lazy templates (#114)
MiniDigger May 26, 2021
7d87e4f
checkstyle stuff
MiniDigger May 26, 2021
c2e6e8a
Bump me.champeau.jmh from 0.6.4 to 0.6.5 (#115)
MiniDigger May 27, 2021
dc90ac4
Fix escaping outside of TagParts and implement <reset>
DenWav May 28, 2021
9a293ff
Validate tag content at parse time, and properly handle templates
DenWav May 28, 2021
32ba234
reimplement gradients and rainbows, fix gradient tests
MiniDigger May 28, 2021
5a9a941
codestyle
MiniDigger May 28, 2021
507b2d8
more tests, more cleanup
MiniDigger May 28, 2021
1730c0b
add todo, don't let jmh run for too long, am trying to get work done …
MiniDigger May 28, 2021
33781c7
Verify transformations when determining if a tag is valid
DenWav May 29, 2021
1649ca2
Fix import
DenWav May 29, 2021
13b03e1
fix a few more unit tests
MiniDigger May 29, 2021
e6457cc
merge empty components that have only one child
MiniDigger May 29, 2021
8e9dbe7
add a new failing unit test
MiniDigger May 29, 2021
4b21772
Add error cases for strict mode requiring closing braces and add debug
DenWav May 30, 2021
6d4c94d
Rework templates so template contents are never parsed
DenWav May 31, 2021
47e0de5
Reformat code
DenWav May 31, 2021
0abb12a
Simplify modifying transformers and tree flattening logic
DenWav May 31, 2021
38472ec
Fix bare escape character cause index out of bounds
DenWav May 31, 2021
8112886
Fix formatting and checkstyle issues
DenWav Jun 1, 2021
2639bfc
codestyle changes
kashike Jun 8, 2021
f825953
Move from checkerqual to jetbrains annotations
broccolai Jun 9, 2021
a79bf69
build: Adventure 4.7.0 -> 4.8.1
zml2008 Jun 12, 2021
4cf817c
Make TransformationRegistry immutable (#122)
broccolai Jun 22, 2021
be52db0
Fix #125 repeated text with unclosed rainbow tag
jpenilla Jul 17, 2021
8a9c911
add test
jpenilla Jul 17, 2021
1563d89
fix indent
jpenilla Jul 17, 2021
483ca78
Fix gradient/rainbow transformations continuing after colored inner text
jpenilla Jul 17, 2021
bfc3004
actually allow creating custom transformations
MiniDigger Aug 3, 2021
bb33ba0
use polyglot-version-catalogs
MiniDigger Aug 3, 2021
ccfd6c5
checkstyle
MiniDigger Aug 3, 2021
6c9e7ed
wat
MiniDigger Aug 3, 2021
016677a
add note about the web viewer
MiniDigger Aug 3, 2021
642678f
fix reset alias
MiniDigger Aug 6, 2021
54d9f76
Only escape when needed, fixes #134
kezz Aug 6, 2021
ab2943b
Fix closing pre tag with another tag immediately after
rymiel Aug 4, 2021
ccd73a8
fix trailing slashes causing out of bounds, closes #138
MiniDigger Aug 9, 2021
c4a7e8c
build: Bump Gradle version to 7.2
zml2008 Aug 18, 2021
0935e70
Fix colour and c not being parsed the same way as color
rymiel Sep 2, 2021
62486b8
large test that covers all aliases of color with both hex and named
rymiel Sep 2, 2021
902e55f
empty lines are forbidden
rymiel Sep 2, 2021
24d7b79
Bump me.champeau.jmh from 0.6.5 to 0.6.6
dependabot[bot] Sep 3, 2021
05215d7
Merge pull request #148 from rymiel/color-alias
zml2008 Sep 4, 2021
a53795f
Merge pull request #150 from KyoriPowered/dependabot/gradle/me.champe…
zml2008 Sep 4, 2021
76f29f5
build: adventure 4.9.0
zml2008 Sep 5, 2021
fadbc25
Be more strict about null values passed to templates
zml2008 Sep 6, 2021
cc82414
build: adventure 4.9.1
zml2008 Sep 7, 2021
2333c41
chore: Remove markdown support
kezz Sep 2, 2021
77a6dee
change the control flow in font parsing to something that makes a lit…
rymiel Sep 21, 2021
bef5e8f
add test for custom namespace fonts
rymiel Sep 25, 2021
ad344c5
Make MiniMessageImpl package-private
zml2008 Sep 25, 2021
5d1de4b
MiniMessage.get -> MiniMessage.miniMessage
zml2008 Sep 25, 2021
91cbaa9
Context.ogMessage -> Context.originalMessage
zml2008 Sep 25, 2021
4ee4d7a
attempt to tackle #137
MiniDigger Aug 9, 2021
08b8b2e
fix style
zml2008 Sep 26, 2021
16b481c
it fails differently, idk
zml2008 Sep 26, 2021
1a6af4a
oh test passes now
zml2008 Sep 26, 2021
26df05f
Fix GH-147 as well
zml2008 Sep 26, 2021
7194722
Merge pull request #155 from rymiel/font-tag-args-fix
zml2008 Sep 26, 2021
c3102ee
fix MiniMessage.toBuilder
zml2008 Sep 26, 2021
96a7e38
Merge pull request #158 from KyoriPowered/feature/api-cleanup
zml2008 Sep 26, 2021
be3cff6
Merge pull request #159 from KyoriPowered/issue/137
zml2008 Sep 27, 2021
93248ac
fix gradients with fewer chars then colors, closes #160
MiniDigger Sep 27, 2021
34f2d11
Fix test for gh137, since it now works as expected
MiniDigger Sep 27, 2021
a182702
Reversed Rainbow (#152)
TreyRuffy Sep 27, 2021
9b647c6
tweak handling of pre and reset to avoid magic strings
zml2008 Sep 28, 2021
a5acad2
more magic literal removal
zml2008 Sep 28, 2021
9524467
transformation: Move to static factory method rather than mutable state
zml2008 Oct 1, 2021
eef6370
Reduce usage of canParse methods in our transformations
zml2008 Oct 1, 2021
1fc206b
move away from references to name and args in transformations
zml2008 Oct 1, 2021
3156fd7
field ordering!
zml2008 Oct 2, 2021
b1cfd37
Improve TransformationRegistry ergonomics, plus nullability on the MM…
zml2008 Oct 2, 2021
29ce396
Explicitly make all tags case-insensitive by lowercasing input
zml2008 Oct 3, 2021
9b69346
Merge pull request #164 from KyoriPowered/feature/transformation-cleanup
zml2008 Oct 3, 2021
b3e8bae
test: Remove dependency on the gson serializer, in favor of the multi…
zml2008 Oct 3, 2021
8d472d5
Use direct color references in the color transformation
zml2008 Oct 3, 2021
5c2e823
build: Get rid of the javacc configuration
zml2008 Oct 3, 2021
5f58747
build: Bump adventure to 4.9.2
zml2008 Oct 4, 2021
bfbdb20
Lift "parent node is root" out of the while loop.
rymiel Oct 5, 2021
d38cd4c
Link issue being tested to test
rymiel Oct 5, 2021
06aae61
Avoid referencing internal API from public API in
zml2008 Oct 6, 2021
d933e2e
Merge pull request #167 from rymiel/fix-165
zml2008 Oct 6, 2021
9be1fa1
api: Introduce new TemplateResolver system
kezz Oct 6, 2021
a11dcb5
Remove unused protected Transformation::merge method.
rymiel Oct 9, 2021
d826747
Merge pull request #170 from rymiel/remove-unused-merge-method
kashike Oct 9, 2021
5392ca5
serialize closing tags in exact reverse order of opening tags
rymiel Oct 11, 2021
3aa770f
Merge pull request #173 from rymiel/closing-tag-order
zml2008 Oct 11, 2021
cf2ad6b
Merge pull request #144 from kezz/fix/string-placeholders
zml2008 Oct 16, 2021
8df44f4
Run strings through the parser for stripping and escaping tokens
zml2008 Oct 18, 2021
f03bbec
use tokens for escape and strip
zml2008 Oct 19, 2021
5c5ee73
Add api to pass templates to the strip/escape tokens methods
zml2008 Oct 22, 2021
83c80b0
Merge pull request #175 from KyoriPowered/feature/strip-escape
zml2008 Oct 22, 2021
d446160
Resolve deprecated API use in tests
zml2008 Oct 22, 2021
1e19b78
Implement a "resolve string templates" method in the token parser
rymiel Oct 23, 2021
235b004
Utilize the string template resolver for TagParts
rymiel Oct 23, 2021
007d39e
grr space
rymiel Oct 23, 2021
3c079cb
Avoid creating a dummy TextNode
rymiel Oct 23, 2021
3b2a565
Directly resolve token content instead of creating a node
rymiel Oct 23, 2021
4210a8c
i mentioned a test in the previous commit but forgot to stage it
rymiel Oct 23, 2021
82bad11
Use child tokens properly
rymiel Oct 23, 2021
2a09227
Add newline between cases
rymiel Oct 23, 2021
a68f840
Lowercase string template checks
rymiel Oct 23, 2021
2709ca1
Merge pull request #177 from rymiel/resolve-string-templates
zml2008 Oct 23, 2021
71ca2c3
Extra tests for coverage
rymiel Oct 23, 2021
5706805
Fix test following the merge of #177
rymiel Oct 23, 2021
ab62718
Merge pull request #176 from rymiel/coverage
zml2008 Oct 23, 2021
ecad6cd
Add new field into Context passed in via MiniMessage.Builder which ru…
rymiel Oct 1, 2021
beb8ee3
Hacky compact test thingy. It makes the tests pass but it is A LIE be…
rymiel Oct 1, 2021
1a69a64
Assume compacting method is NotNull (set to identity function in Cont…
rymiel Oct 1, 2021
432da52
resolve conflict with changes made to master
rymiel Oct 5, 2021
6ebf861
Fix some rebase issues
rymiel Oct 23, 2021
2c8a5b5
resolve checkstyle
rymiel Oct 23, 2021
a4e5a1f
Apply suggestions from code review
rymiel Oct 23, 2021
dec9d15
null stuffs
rymiel Oct 23, 2021
6790926
rename to postProcessor and make it an UnaryOperator
rymiel Oct 23, 2021
7011854
actually delete the old `flatten` function we're replacing.
rymiel Oct 23, 2021
8880754
kezz moment
rymiel Oct 23, 2021
22328c4
Null stuff fixes from code review
rymiel Oct 24, 2021
bac79ca
Third iteration of null stuff from code review
rymiel Oct 24, 2021
abc1082
Merge pull request #163 from rymiel/compact
zml2008 Oct 24, 2021
98349fb
build: Bump adventure to 4.9.3
zml2008 Oct 31, 2021
2d2bc84
chore: Remove pre tags
kezz Oct 31, 2021
a66ff9d
fix: Recursively resolve string templates
kezz Oct 31, 2021
8ddbfc7
fix: Enforce lowercase template keys
kezz Nov 12, 2021
6b95908
test: Add unit tests to assert errors
kezz Nov 12, 2021
624b046
fix: use root locale in toLowercase in Template
broccolai Nov 28, 2021
73ddc5a
There are no more bugs.
kashike Nov 28, 2021
d4bfd10
Merge pull request #191 from KyoriPowered/fix/uppercase-in-templates
kezz Nov 28, 2021
bf1aea9
chore: rename all template references to placeholder
broccolai Nov 29, 2021
e5f7e70
tooling: add editorconfig
broccolai Nov 29, 2021
1d895c6
publishing: stop publishing snapshots
broccolai Nov 29, 2021
4336f43
chore: remove all deprecations
broccolai Nov 29, 2021
9420292
cleanup: move Placholder into placeholder package
broccolai Nov 29, 2021
4ae11f3
add newline to .editorconfig
broccolai Dec 2, 2021
40a585a
Merge pull request #198 from KyoriPowered/chore/rename-template-to-pl…
broccolai Dec 2, 2021
7490924
publishing: stop publishing snapshots
broccolai Nov 29, 2021
8859978
Merge pull request #199 from KyoriPowered/publishing/disable
zml2008 Dec 2, 2021
7ecd35e
Merge branch 'master' into fix/recursively-resolve-string-placeholders
broccolai Dec 2, 2021
de13326
chore: rename more "Template" namings
broccolai Dec 2, 2021
1ee8b82
Allow explicitly setting decorations to false, closes #133
MiniDigger Sep 28, 2021
0edb4dc
rebase, add more debug
MiniDigger Dec 3, 2021
67b929f
🤦‍♂️
MiniDigger Dec 3, 2021
484ccdf
support ! shorthand
MiniDigger Dec 3, 2021
0456406
error with both shorthand and long version is used
MiniDigger Dec 3, 2021
a6671f2
add a test to make sure closing works as expected
MiniDigger Dec 3, 2021
444b00f
support f shorthand
MiniDigger Dec 3, 2021
b38a471
fix checkstyle, add serializer support
MiniDigger Dec 3, 2021
88f0043
Merge pull request #187 from KyoriPowered/fix/recursively-resolve-str…
kezz Dec 6, 2021
ee98562
remove world-ending, non-standard truthy and falsey values
kezz Dec 6, 2021
fe85807
Merge pull request #162 from KyoriPowered/feature/133
broccolai Dec 6, 2021
117cad9
Fix eclipse AP file generation
zml2008 Oct 31, 2021
84ee5fb
Add 'text-minimessage/' from commit 'fe85807160ebd82e12b7425e919c8ed2…
zml2008 Dec 7, 2021
a2a082b
text-minimessage: Update build for merge into main repository
zml2008 Dec 7, 2021
e03f979
build-logic: add a few more developers
kashike Dec 7, 2021
4894359
text-minimessage: Update @since tags for merge
zml2008 Dec 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 7 additions & 18 deletions .gitignore
@@ -1,22 +1,11 @@
/.gradle/
/.idea/
/build/
/api/build/
/api/out/
/api/run/
/bom/build/
/build-logic/.gradle/
/build-logic/build/
/extra-kotlin/build/
/extra-kotlin/out/
/key/build/
/key/out/
/nbt/build/
/nbt/out/
/run/
/serializer-configurate*/build/
/serializer-configurate*/out/
/text-serializer-*/build/
/text-serializer-*/out/
/build/
/*/build/
/*/out/
/*/run/
/.idea/
/*.iml
/*/.factorypath
/*/.settings/
/*/.classpath
1 change: 1 addition & 0 deletions bom/build.gradle.kts
Expand Up @@ -18,6 +18,7 @@ dependencies {
"nbt",
"serializer-configurate3",
"serializer-configurate4",
"text-minimessage",
"text-serializer-gson",
"text-serializer-gson-legacy-impl",
"text-serializer-legacy",
Expand Down
Expand Up @@ -36,6 +36,11 @@ indra {
developer {
id.set("Electroid")
}

developer {
id.set("minidigger")
name.set("MiniDigger")
}
}
}
}
Expand Down
Expand Up @@ -148,4 +148,14 @@ tasks {
jacocoTestReport {
dependsOn(test)
}

// Non-incremental
named("eclipseFactorypath", com.diffplug.gradle.eclipse.apt.GenerateEclipseFactorypath::class) {
doFirst {
val inFile = inputFile
if (inFile != null && inFile.exists()) {
inFile.delete()
}
}
}
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Expand Up @@ -14,6 +14,7 @@ sequenceOf(
"nbt",
"serializer-configurate3",
"serializer-configurate4",
"text-minimessage",
"text-serializer-gson",
"text-serializer-gson-legacy-impl",
"text-serializer-legacy",
Expand Down
41 changes: 41 additions & 0 deletions text-minimessage/CHANGELOG.md
@@ -0,0 +1,41 @@
# Changelog

# 4.1.0 (xx.11.2020) - the bye bye regex release

* Rewrote the whole parser to use less regex and more formal grammar!
This means, that the whole parser is much more robust now.
* Added a transformation registry, to disable certain tags and add your own ones!
* Added placeholder resolvers, to better integrate placeholder apis!
* Added markdown flavors, to allow supporting multiple ones. DiscordFlavor for example supports ||sploilers||!
* Added a bunch of convenience aliases, `<strikethrough>` becomes `<st>`. For the full list, see the docs.
* Added ability to handle malformed input lenient or strict
* Slightly better escape handling (more work to come...)
* More unit tests!
* Updated adventure to 4.2

This doesn't even look that much, now that I wrote this all down, but this release has over three thousand new lines and almost one thousand deleted lines!
This small lib contains now almost five thousand lines of code and one hundred unit tests!

# 4.0.0 (xx.07.2020) - the lost release

* MiniMessage is now part of the Kyori organization!
* Add support for hex colors, rainbows and gradients
* Add templates, a new type of placeholder that works with components
* Dropped bungee impl
* Moved markdown ext into the main project
* Refactored the project, MiniMessage is now the main api
* Moved docs to the adventure docs page https://docs.adventure.kyori.net/minimessage.html
* Moved the project to gradle to align with other kyori projects

# 2.1.0 (12.06.2020) - the rgb release

* Move packages around to avoid confusion between bungee and text impls
* Allow the usage of single quotes to define inner components
* Use localized toLower/Uppercase methods (@mikroskeem)
* Use map lookup over valueOf when resolving stuff (@mikroskeem)
* Add new color tag syntax (in preparation for 1.16 hex colors) (@mikroskeem)
* Support reset tags
* Support pre tags
* Support placeholders in lang tags
* Add [docs](/DOCS.md)
* Add changelog (this, lol)
17 changes: 17 additions & 0 deletions text-minimessage/build.gradle.kts
@@ -0,0 +1,17 @@
plugins {
id("adventure.common-conventions")
id("me.champeau.jmh")
}

description = "A string-based, user-friendly format for representing Minecraft: Java Edition chat components."

dependencies {
api(project(":adventure-api"))
testImplementation(project(":adventure-text-serializer-plain"))
}

tasks.checkstyleJmh {
exclude("**")
}

applyJarMetadata("net.kyori.adventure.text.minimessage")
@@ -0,0 +1,64 @@
/*
* This file is part of adventure, licensed under the MIT License.
*
* Copyright (c) 2017-2021 KyoriPowered
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.kyori.adventure.text.minimessage.benchmark;

import java.util.concurrent.TimeUnit;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.placeholder.PlaceholderResolver;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;

@Fork(value = 1, warmups = 1)
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class MiniMessageBenchmark {

@Benchmark
public Component testNiceMix() {
final String input = "<yellow><test> random <gradient:red:blue:green><bold>stranger</gradient></bold><click:run_command:test command><underlined><red>click here</click><blue> to <rainbow><b>FEEL</rainbow></underlined> it";
return MiniMessage.miniMessage().parse(input);
}

@Benchmark
public Component testSimple() {
final String input = "<yellow><test><bold>stranger";
return MiniMessage.miniMessage().deserialize(input, PlaceholderResolver.resolving("test", "test2"));
}

@Benchmark
public Component testGradient() {
final String input = "<gradient:red:blue:green>COLORS ARE COOL";
return MiniMessage.miniMessage().parse(input);
}

@Benchmark
public Component testRainbow() {
final String input = "<rainbow>COLORS ARE COOL";
return MiniMessage.miniMessage().parse(input);
}
}