Streamline Packagist Badge titles in frontend.
Always add the general topic/category to each badge title.
Closes#5039
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Validate input to BadgeFactory.create() (#3875)
* validate input to create()
* remove deprecated properties (#3881)
* remove BadgeFactory class (#3884)
* Template literal templates (#4459)
- Remove use of the doT template library and move to generating SVG output using javascript template literals.
- Drop SVGO and mostly manually implement the optimisations.
- Add a bunch more tests
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
* drop raster support in package CLI (#4523)
* drop raster support in package CLI
* update docs
* rename gh-badges package to badge-maker
* rename gh-badges dir to badge-maker
* update relative imports and other refs to in parent dir
'gh-badges' --> 'badge-maker'
* update snyk service tests
This change is only tangentially related
We've used the shields repo as an example for these tests so
moving files around in our repo has a knock-on effect on them
* add missing type hints to dev style page
* write the changelog/migration guide for v3
* use extension in README CLI example
* update CLI help
whoops - missed this in #4523
* bump version
* update for self-hosting users
* README updates
* drop .format param from CLI, always output SVG
* Change text[] to label and message, Remove JSON output
- Change text[] to label and message
- Fix message only badge
- Remove JSON output format
- Update the docs
* update package-lock
* rename 'template' to 'style'
* handle invalid styles in coalesceBadge
* ensure makeBadge is passed a string for template in coalesceBadge()
issue #4925
* fix (logo/no label text/label color specified) case
issue #4926
* add example of (logo/no label text/label color specified) to style debug page
* update type defs
* padding fix for FTB style
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
* ignore case if we fall back to string sorting versions
* if no latest MaybeSemVer, try latest pre-MaybeSemVer
* filter versions before we pass it to latestMaybeSemVer()
* Add [OffsetEarth] trees service
* Add mocked tests for [OffsetEarth] tree service
* Update [OffsetEarth] trees name to be more unique
* Add [OffsetEarth] carbon offset service
* Update [OffsetEarth] services to use floorCount()
* Clean up [OffsetEarth] loops and unnecessary code
* Update [OffsetEarth] services to use proper APIs
* Fix order of imports in [OffsetEarth] services
* Update [OffsetEarth] tests to be more robust
* Update [OffsetEarth] tests to check colour
* Update to use unmocked [OffsetEarth] tests
* Update to use nonNegativeInteger in [OffsetEarth]
* Apply additional [OffsetEarth] review comments
* Update [OffsetEarth] references to username
Co-authored-by: Pierre-Yves B <PyvesDev@gmail.com>
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* fix: node service has bad colors #4809
* chore: minor service test rename
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* fix: spiget invalid response for external downloads #4840
* Changed the background color if resource is external and use proper Spiget API for the test
* Fix invalid mocked response for spiget service tests
Co-authored-by: Pierre-Yves B <PyvesDev@gmail.com>
* Add POEditor badge for language translation progress
* Add example, tests, and documentation key for POEditor
* Remove redundant required() as indicated in PR review
* Throw errors instead of rendering red badge
* small wording tweak: mention read-only again
Co-authored-by: chris48s <chris.shaw480@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Add [Treeware] trees service
* Add tests for the [Treeware] tree service
* Update [Treeware] tree test to use package
* Update [Treeware] badge description
* Update [Treeware] test to remove timeout
* Update [Treeware] tree service to use queryParams
* Apply review comments to [Treeware] tests
* Update [Treeware] test to check colour
* allow resolve PHP version from jobs in Travis CI config
* get version from jobs
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Add pkgreview.dev services
* 🐛 FIX: Fix badges for pkgnames containing @ symbol
* 🐛 FIX: parseFloat the rating
* 🐛 FIX: Fix LGTM alerts
Alert: 2 for Incomplete string escaping or encoding
* Update services/pkgreview/package-rating.service.js
Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* 🐛 FIX: Rollback to Joi.number() temporarily
* 👌 IMPROVE: Follow guidelines properly.
Not completely done, yet.
* 🐛 FIX: Handle response timed out error
* 👌 IMPROVE: Merge star and rating badge logic
* 🐛 FIX: Fix according to the maintainer's review
* ✅ TEST: Write a test
* ✅ TEST: Write one more dummy test
* 👌 IMPROVE: Improve message color scheme. Add logic to it. use color-formatters.
* ✅ TEST: Complete Test Suitew
* 👌 IMPROVE: Make fixes according to the review
* ✅ TEST: Write nice tests
* ✅ TEST: Fix test regex
* 👌 IMPROVE: Do according to the review
* ✅ TEST: Fix test regex and don't test Bad Requested Badge
* ✅ TEST: Fix tests :)
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Add a test for #4640
* Set prerelease=false for /r/* Nexus 3 badges
* Fix the test following PR discussion
Co-authored-by: Pierre-Yves B. <PyvesDev@gmail.com>
* move getLatestRelease logic from [GitHubRelease] to common-fetch
- so that the sorting and prerelease logic can be used for other
services too, like commits-since
* add sort and prerelease query params to [GitHubCommitsSince]
- they only work when using the 'latest' version of course
- uses same logic as release service
* reuse queryParamSchema from common-fetch for [GitHubTag]
- as they were the exact same schema
* refactor [GitHubCommitsSince] tests to use withRegex
- and the same variable everywhere
* split out release/tag logic from common-fetch to common-release (affects [GitHubCommitsSince], [GitHubRelease], [GitHubTag])
- this logic is only used for code related to releases & tags, so made
sense as a split point
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Add [Docker] image size badge
* Add [Docker] version/tag badge
* [Docker] allow version badge to retrieve results from multiple pages
* [Docker] allow size badge to retrieve results from multiple pages
* [Docker] clean up size and version badges before squash
* [Docker] Size badge change API call to explicit tag
* [Docker] Conditionally include tag route param for badges
* [Docker] Implement feedback for size and version badges
* [Docker] Implement feedback round 2 for size and version badges
* [Docker] Optimise API lookups and remove date sorting on tag badge
* [Docker] Implement feedback round 3 for version badge
* [Docker] Implement feedback round 4 for version badge
* [Docker] Adjust unit and service tests for version badge
* [Docker] Move unit test data into fixtures
* [Docker] Fix Docker version badge route prefix
* [Docker] Add date and semver lookup for size badge
* [Docker] Implement feedback round 5 for version badge
* [Docker] Implement feedback round 6
* [Docker] Tweak error messaging for consistent wording
* [Docker] Adjust badge titles
* [Docker] Guard and treat images with missing digest
* [Docker] Guard and treat images with missing digest
* VisualStudioAppCenterBuilds
* [vsacb] Add schema, documentation and use buildStatus for rendering
* Add VSACReleasesVersion badge and test
* Make tests green again, add another nock test and fix category
* Add VSAC Releases Size badge and test
* Add VSAC Base class
* [vsacb] use base fetch function
* Add VSACR OSVersion service and tests
* Finishing touches
* Change slug from VSAC to Visual-Studio-App-Center
* Use prettyBytes for rendering
* CQ
* Use bytes response directly
* Remove superfluous required statement
* Improve os version badge format
* Switch to nock for build test
Co-authored-by: Pierre-Yves B. <PyvesDev@gmail.com>
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>