Now that these s0.server.shields.io entries are set up through the main DNS on Cloudflare, we don't need the shields-server.com domain anymore. One less thing to maintain.
* Improve tutorial file with explaining how to solve an error.
* Fix typo.
* Fix typo.
* Add more information about the fix.
* Apply suggested changes.
* Add missing method in the first example
* Modify the second example that did't compile.
* Add troubleshooting for the localhost and link to the issue solving it.
* Rephrase.
* Update doc/TUTORIAL.md
Co-Authored-By: Caleb Cartwright <calebcartwright@users.noreply.github.com>
* Add get category() function explanation in both examples.
* Update doc/TUTORIAL.md
Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
While working on #2428 I found myself wanting to reload the server frequently. This is working great and reducing my iteration time significantly. I should have tackled this way sooner! 🙊
I’ve left `verbose` on which seems useful, at least in the short term while we’re tuning the configuration.
Close#2426
* Add drone build badge based on travis
* Fix wrong mocked endpoint for done builder
* Refactor service tester using helper method
* Add missing failure status to red statuses
* Remove extraneous invalid svg test from drone
* Test on failure red status in build status spec
* refactor(drone): use json service instead of svg
* refactor(drone): remove status text and extraneous build path in test
* refactor(drone): allow defining self-hosted drone instances
* fix(drone): use proper urls in drone examples
* fix(drone): add drone token authorization for self-hosted instances
* refactor(drone): call render build status badge directly instead of render
* refactor(drone): use server query parameter for self-hosted instances
* fix(drone): separate url and query params in example
* fix(drone): use actual build status message in examples
* fix(drone): add missing message for status code 401
Co-Authored-By: byCedric <me@bycedric.com>
* refactor(drone): remove color from drone tests
* refactor(drone): remove extraneous comments from drone tests
* refactor(drone): remove unused static preview method
* refactor(drone): remove unused static render method
* refactor(drone): reuse render build status badge helper in static previews
* fix(drone): test inaccessible repos on new message
* Modernised JSON format and removed _shields_test style
* Added logoWidth and labelColor fields to JSON response
* Reinstated and updated comment
* Extended expectBadge to accept Joi schemas for all fields
This moves a few helpers from `lib/` to `services/`:
build-status.js
build-status.spec.js
color-formatters.js
color-formatters.spec.js
contributor-count.js
licenses.js
licenses.spec.js
php-version.js
php-version.spec.js
text-formatters.js
text-formatters.spec.js
version.js
version.spec.js
And one from `lib/` to `core/`:
unhandled-rejection.spec.js
The diff is long, but the changes are straightforward.
Ref #2832
This will definitely save time, and ensure more uniformity.
It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.
Closes#2701
While Next.js can handle static sites, we've had a few issues with it, notably a performance hit at runtime and some bugginess around routing and SSR. Gatsby being fully intended for high-performance static sites makes it a great technical fit for the Shields frontend. The `createPages()` API should be a really nice way to add a page for each service family, for example.
This migrates the frontend from Next.js to Gatsby. Gatsby is a powerful tool, which has a bit of downside as there's a lot to dig through. Overall I found configuration easier than Next.js. There are a lot of plugins and for the most part they worked out of the box. The documentation is good.
Links are cleaner now: there is no #. This will break old links though perhaps we could add some redirection to help with that. The only one I’m really concerned about `/#/endpoint`. I’m not sure if folks are deep-linking to the category pages.
There are a lot of enhancements we could add, in order to speed up the site even more. In particular we could think about inlining the SVGs rather than making separate requests for each one.
While Gatsby recommends GraphQL, it's not required. To keep things simple and reduce the learning curve, I did not use it here.
Close#1943Fix#2837Fix#2616
Fixes#2876 with @paulmelnikow's suggestion
Moved imports of `ServiceTester` and `createServiceTester` to a separate file so that dev dependencies are not imported by service classes.
This removes `LONG_CACHE` and its descendants, which was a feature that added `?maxAge` to the live preview badges in the frontend. Since they are all static that is no longer needed, as the static badges all have longer cache timeouts regardless.
In #2698 we decided to put legacy helper functions in `core/legacy`. I think that’s a fine idea, though if we’re going to have a bunch of badge helper functions in there, it seems like it is probably better to keep these two important but esoteric helper functions with the core code to which they are most coupled. So I added `legacy-` to the name, and put them in `core/base-service`.
Continue to implement #2698:
- Add `core/base-service/index.js` (but hold off on moving the things it imports)
- Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits.
- Apply consistent ordering of imports and use of `module.exports` in testers.
- Remove some renaming of imports.
- Remove obsolete tests here and there.
It’s happened twice that `[*]` has ended up in a PR title and the full test run has happened inadvertently. Once was me and once was a new contributor.
This raises the bar on doing it accidentally.
- Replace the idea of color schemes with the idea of named colors (since none of our colorschemes have used `colorA`)
- Pass through the normalized color to `_shields_test` to harmonize with BaseService and simplify testing
- Update service tests
- Move responsibility for color generation into the npm package
- Remove several color helper functions and their tests
- Update gh-badge public API to accept `color` and `labelColor`
This is a precursor to refactoring some of the logo code for #2473.