Commit Graph

114 Commits

Author SHA1 Message Date
Paul Melnikow
2177eb7546 Docs: Drop .svg extensions (#3787) 2019-07-25 19:39:35 -05:00
Paul Melnikow
cfbd2c30df SVG by default (#3717)
Make cleaner badge URLs by omitting the `.svg` extension.

Closes #2674
2019-07-24 12:57:39 -05:00
Paul Melnikow
6cbc7b587a Document the production Redis hosting (#3710)
Close #3332
2019-07-13 08:39:07 -05:00
Paul Melnikow
aa135d370f Auto-annotate live and mock tests (#3661)
Close #2555
2019-07-07 17:06:01 -04:00
Paul Melnikow
9b3db0774b Deprecate shields-server.com domain (#3666)
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.
2019-07-07 16:37:42 -04:00
Paul Melnikow
66c7f13e38 Drop gif + png, and redirect png to raster.shields.io (#3644)
1. Remove rasterization support from the server. This responsibility is delegated to a raster server which proxies the SVG badges and renders them.
2. When a raster server URL is configured, 301 redirect all .png badges to the identical URL on the raster server.
    `https://img.shields.io/npm/v/express.png?style=flat-square` ↪️`https://raster.shields.io/npm/v/express.png?style=flat-square`
3. For configured redirects, redirect to the canonical URL on the raster server.
    `https://img.shields.io/vso/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2.png?style=flat-square`
    ↪️`https://img.shields.io/azure-devops/build/totodem/8cf3ec0e-d0c2-4fcd-8206-ad204f254a96/2.png?style=flat-square`
4. Redirect the "legacy badge old version" to the appropriate URL on the raster server.
5. When no raster server is configured (e.g. PRs), render an SVG containing **404 | raster badges not available** for all `.png` badges. (Note that the raster server can be self-hosted; however, this is deferred to a later PR.)
5. Drop support for jpg and gif which are very infrequently used (see #3112). Render an SVG containing **410 | jpg no longer available**.
7. ~~Remove raster dependencies.~~ Remove the raster cache (which is only used in the CLI, and therefore pointless).
8. Move the LRUCache code out of the npm package.
8. A wee bit of refactoring in `server.js`.

Ref #3112
Close #3631
2019-07-06 16:41:46 -04:00
Paul Melnikow
5d06503844 Update Zeit members list (#3646) 2019-07-05 14:51:57 -04:00
Paul Melnikow
f693ef019d Document raster server production hosting (#3643)
Ref #3631
2019-07-05 13:54:05 -04:00
chris48s
d78edaf5b5 add/improve some JSDoc comments on core API (#3595) 2019-06-25 22:42:01 +01:00
Pierre-Yves B
1e207f1886 Tutorial improvements and fixes (#3593) 2019-06-23 17:52:41 +01:00
chris48s
8621fe42d7 Upgrade Joi (#3505)
* upgrade joi
* find & replace ALL THE THINGS
* update related deps
2019-06-02 21:59:55 +01:00
chris48s
52e90af310 improve docs on examples (#3496)
closes #3440
2019-05-28 18:17:59 +01:00
Josep Bernad
17446efb45 Improvements in the TUTORIAL.md file (#3435)
* 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>
2019-05-15 19:40:18 +01:00
Marcin Mielnicki
65d42d5cb1 Remove IP filtering documentation for metrics (#3406) 2019-05-01 22:50:27 +02:00
Paul Melnikow
73ed7778fd Automatically reload the server when it changes (#3401)
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
2019-05-01 16:39:25 -04:00
Pierre-Yves B
2806eb8a00 Legacy services clean up (#3367)
* Deleted remaining legacy service bits

* Removed badge from README

* Removed no longer needed try/catch

* Deleted refactoring script

* Switched to const

* Reinstated doc

* Ran Prettier
2019-04-27 19:25:01 +01:00
Paul Melnikow
8ad0b105b1 Make the config from env more obvious at first glance; explain cascading config (#3355) 2019-04-23 13:57:23 -04:00
Cedric van Putten
483ecf24de [Drone] Add Drone build badge (#3240)
* 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
2019-04-16 11:33:15 -05:00
Pierre-Yves B
25f8541e5b JSON format modernisation and _shields_test removal (#3272)
* 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
2019-04-07 18:57:55 +01:00
Marcin Mielnicki
e43593e3bb OVH link fix (#3207) 2019-03-17 18:10:42 +01:00
Paul Melnikow
612831a2d8 Remove legacy analytics (#3179)
We're getting good results from #3093, so there's no reason to keep maintaining this code.

Ref #1848 #2068
2019-03-08 00:05:37 -05:00
Paul Melnikow
e159d90516 Reorganize a couple of the legacy helpers [npm node jenkinsplugin dynamic] (#3163) 2019-03-05 20:43:33 -06:00
Pierre-Yves B
eb453401e3 Updated remaining documentation (#3141) 2019-03-03 10:42:14 -06:00
Caleb Cartwright
f0eac60191 doc: updated tutorial links and code snippets (#3124) 2019-03-01 16:00:18 -06:00
Henry Poydar
513b69272e Update instructions for self-hosting Shields with Heroku (#3123) 2019-02-28 18:13:44 -06:00
Paul Melnikow
fafb22efee Move "good" badge helpers from lib/ to services/ (#3101)
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
2019-02-27 20:47:46 -05:00
Pierre-Yves B
81fbd4ed49 Introduced expectBadge helper (#3097) 2019-02-27 08:02:14 +00:00
chris48s
92039e413d add notes to logo docs about brand guidelines (#3088) 2019-02-25 20:02:07 +00:00
Paul Melnikow
4bd16f93e8 Sort imports and requires (#3056)
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
2019-02-21 22:14:40 -05:00
Paul Melnikow
d2861b2438 Switch to npm ci (#3034) 2019-02-18 17:28:09 -06:00
Paul Melnikow
0f22c0af25 Store the deprecation date inline (#3029) 2019-02-18 16:59:08 -05:00
Paul Melnikow
d8ce045ead Adopt Gatsby (#2906)
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 #1943 
Fix #2837 Fix #2616
2019-02-06 16:37:55 -05:00
Caleb Cartwright
855c9cd261 Remove dev dep imports in production code (#2937)
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.
2019-02-05 21:51:55 -05:00
Paul Melnikow
e083dd3ce5 deprecatedService: rename url to route for consistency; test on [versioneye] (#2938) 2019-02-05 21:37:00 -05:00
Paul Melnikow
3a7bddbc26 Consolidate service definition schema, removing support for previewUrl (#2895)
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.
2019-01-30 18:35:11 -06:00
Paul Melnikow
f32306d982 Update production DNS access doc (#2899)
* Update production DNS access doc

Thanks @olivierlacan!

* Add link to DNS registrar

* Updates
2019-01-30 17:41:44 -06:00
chris48s
a47fb2895d update logo guidance (#2888)
Ref #2510
2019-01-29 15:29:51 -06:00
Paul Melnikow
e10e8b1b6d Code walkthrough (#2877)
Updated based on comments received in the Google Doc.

Close #2684
2019-01-28 15:03:05 -06:00
Paul Melnikow
fc12b591db Reorganize BaseService-related modules (#2831)
Ref #2698
2019-01-22 23:52:13 -05:00
Paul Melnikow
aac2a4d5ad Move legacy request helpers (#2829)
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`.
2019-01-21 22:14:22 -05:00
Paul Melnikow
226fa67a02 Create shortcut for BaseService-related imports (#2809)
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.
2019-01-21 15:41:24 -05:00
Paul Melnikow
97e719f226 Make it harder to accidentally trigger all the service tests (#2789)
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.
2019-01-16 16:58:17 -05:00
Paul Melnikow
4597d77015 Refactor badge color functions (#2742)
- 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.
2019-01-15 16:43:33 -05:00
Pierre-Yves B
55ce947a35 Extended usage of build-status.js tomore services (#2763)
* Extended usage of build-status.js

* Removed remaining status arguments
2019-01-15 20:27:18 +00:00
Paul Melnikow
b3606724fd Wildcard to run all service tests [*] (#2739)
Close #2685.
2019-01-11 16:11:46 -05:00
James Cahill
3f118f8442 TUTORIAL.md - use localhost instead of others (#2735)
Seeing as npm start now uses localhost instead of instead of 127.0.0.1 or [::], just updating it in the tutorial.
2019-01-11 13:57:51 -05:00
Paul Melnikow
d1c5378bf0 Integrate new path-to-regexp with trailing optionals (#2644)
Fix #2497

Ref pillarjs/path-to-regexp#176
2019-01-08 18:50:47 -05:00
Jan Keromnes
3ab2862922 Fix a few typos (#2697)
* Fix typos (using 'codespell -w')

* Properly capitalize Git and GitHub in TUTORIAL.md
2019-01-08 12:08:50 -05:00
Paul Melnikow
ebfd6cf8ee We don't use Docker in production (#2690)
I found an old note to myself to document this.
2019-01-07 22:00:36 -05:00
Paul Melnikow
1e267f891d Document production hosting (#2661) 2019-01-07 20:55:49 -05:00