Commit Graph

111 Commits

Author SHA1 Message Date
Paul Melnikow
a0492c5283 Remove unused callback-based error helpers (#3371) 2019-04-29 13:35:57 -04:00
chris48s
5f29f6a175 case-insentitive asset name compare in [githubdownloads] (#3377)
closes #3364
2019-04-29 15:05:27 +01:00
Pierre-Yves B
499fb8dbaf Fixed color of GitHub forks badge (#3366) 2019-04-27 13:48:47 -04:00
Paul Melnikow
2215693557 Rewrite [GithubTag] (#3360)
Ref #2863
2019-04-25 11:23:16 -04:00
Paul Melnikow
f8aeb56129 Unify order of more services (#3358)
Ref #3353
2019-04-24 15:08:26 -04:00
Paul Melnikow
ca22d01606 Rewrite [GithubDownloads] (#3351)
For consistency with other download badges, I changed some formatting:

-  **downloads | 24k total** -> **downloads | 24k**
- **downloads | 3k** -> **downloads@latest | 3k**
- **downloads | 3k v0.29.0** -> **downloads@v0.29.0 | 3k**

Ref #2863
2019-04-22 22:55:31 -04:00
Paul Melnikow
f13326dddf Rewrite [githubcommitssince]; also test [githubrelease] (#3350) 2019-04-22 18:54:58 -05:00
Paul Melnikow
b069dbbaad Use route patterns in [snap-ci nsp gratipay githubmanifest codacy cauditor bithound] (#3327)
Ref #3329
2019-04-18 18:15:48 -05:00
Tesla_Ice_Zhang
e12e625141 Add pull request merge/open/closed badge (#3295) 2019-04-14 09:57:26 -05:00
Paul Melnikow
ab95e8415f Rewrite [GitHubForks] (#3299) 2019-04-13 20:12:31 -04: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
Denis Duliçi
48e454c63d Fixed GitHub release downloads, run [GithubDownloads] (#3256)
* fixed github release downloads

* npm run prettier code push.

* master package-lock.json file
2019-04-03 17:28:48 -05:00
Caleb Cartwright
7f24e93671 refactor [GithubIssueDetail] (#3259)
* refactor(GithubIssueDetail): ported to new service model

* refactor(GithubIssueDetail): updates based on PR discussions

* refactor(GithubIssueDetail): minor updates and additional tests

* refactor(GithubIssueDetail): minor updates to render functions per PR disc.
2019-04-03 11:59:49 -05:00
Caleb Cartwright
4b81f824d9 refactor(GithubIssues) (#3263) 2019-04-03 10:26:03 -05:00
chris48s
96d416068c rewrite Github Languages, split into [githubcodesize githublanguagecount githubtoplanguage] (#3225) 2019-03-25 20:54:58 -04:00
chris48s
4f5268aa0f refactor [githubreleasedate] (#3206) 2019-03-18 17:36:17 -05:00
chris48s
6e203d2455 refactor [githubreposize] (#3205) 2019-03-16 12:43:52 -05:00
chris48s
2b29c226e0 refactor [githublastcommit] (#3199) 2019-03-13 00:17:39 -04:00
chris48s
9496b6d84c refactor [githubsize] (#3198) 2019-03-12 18:51:46 +00:00
Paul Melnikow
3733de6232 Rewrite GitHub commit status (#3186)
* WIP

* Parse the error response

* Clarify

* Restore one test

* Add a schema
2019-03-10 18:43:37 -05:00
Paul Melnikow
3baf0a8037 Rewrite [GithubCommitActivity] (#3183) 2019-03-08 18:39:11 -06:00
Caleb Cartwright
c52ea44450 fix: GH followers example style (#3158) 2019-03-04 23:07:13 -05:00
Caleb Cartwright
33786fa891 refactor [GitHubFollowers] (#3157) 2019-03-04 22:49:55 -05:00
Caleb Cartwright
726830f067 Add ability to transform query params in redirct service, run [Endpoint GitHubReleaseRedirect SensioLabs VSO] (#3125)
* feat(redirector): added transformQueryParams to redirector

* refactor: renamed to transformPath in redirector

* Rename targetUrl to targetPath

Co-Authored-By: calebcartwright <calebcartwright@users.noreply.github.com>

* feat(redirector): handle param conflicts
2019-03-04 18:11:37 -06:00
Caleb Cartwright
f6e061f150 Refactor [GitHubWatchers] (#3136) 2019-03-02 22:19:11 +00:00
Paul Melnikow
97358c1399 Rewrite [GitHubStars] (#3119)
* Refactor [GithubStars]

* Add test of link array
2019-02-28 18:18:32 -06:00
Pierre-Yves B
1f29c22d3d Migrated most service tests to use new expectBadge (#3122) 2019-02-28 21:43:23 +00: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
Paul Melnikow
e4fe8c0c5f Rewrite [GithubSearch] (#3099) 2019-02-25 15:24:41 -05:00
Paul Melnikow
9fa9785568 Rewrite [GithubRelease] (#3098) 2019-02-25 14:33:52 -05:00
Paul Melnikow
f831fba4d4 Rewrite [GitHubLicense] (#3095) 2019-02-24 16:04:24 -05: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
33aefcfaf8 Minor cleanup related to colorB -> color (#3066)
As `color` is now the canonical, it makes sense to update some of these tests to say `colorB` instead.

Ref #3012
2019-02-20 23:34:22 -05:00
Pierre-Yves B
27696d4691 Require constructors to be called with new (#3052) 2019-02-20 09:49:42 +00:00
Paul Melnikow
24bc7bcfc3 Combine some badge examples using drop-downs, tweak some titles (#3037)
This updates several badges to take advantage of the change from #2882.
2019-02-18 23:04:25 -05:00
Pierre-Yves B
e9f8700607 Fix [GithubManifest] and [GithubPackageJson] when static auth is not configured (#3035)
* Fixed fetchJsonFromRepo function when static auth is not configured

* Removed redundant await
2019-02-18 20:02:52 -06:00
Pierre-Yves B
bc96f0e25f Example keywords validation (#2956)
This pull request closes #2551: making sure that the keywords don't already appear in the example's title.

I also added validation that checks that they are at least two characters long, as this is enforced by the homepage when type your search.
2019-02-13 13:14:12 -04: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
cdeba2fdf9 Fix some service tests [circle dependabot githubissues] (#2936) 2019-02-05 21:49:40 -05:00
Pierre-Yves B
ea833a83c4 [GitHubCommitActivity] improvements and examples (#2920) 2019-02-04 20:27:52 -05:00
Paul Melnikow
eef3d36f52 Convert remaining preview URLs (#2887)
Close #1961
2019-01-29 21:13:15 -06:00
Paul Melnikow
5b122ddd73 Social badge support for static previews (#2871)
The static previews don't support the social badges. Adding that lets us remove support for `exampleUrl`. Close #2479.

This includes `style` and `namedLogo` in the service-definition export and updates the frontend to use it. To accomplish this, it passes `namedLogo` through `coalesceBadge`. After logo resolution is moved to `makeBadge` this duplication can be removed, as `logo` will no longer be needed in the result of `coalesceBadge`.
2019-01-28 22:44:25 -06:00
Paul Melnikow
47e8cc3de3 Refactor route functions in BaseService (#2860)
The route helper functions are fairly well isolated from the rest of BaseService, with a few convenient entry points. They are easier to test in isolation.

The way the code was written before, `pathToRegexp` was invoked once for every request, which seems inefficient.

`route` was validated when it was used, though it seems more helpful to validate it up front.

This breaks out `_makeFullUrl`, `_regex`, `_regexFromPath` into new helper functions `makeFullUrl`, `assertValidRoute`, `prepareRoute`, and `namedParamsForMatch`.

It adds validation to route, and updates the services without patterns to include one, in order to pass the new validation rules.
2019-01-26 02:38:12 -05:00
Paul Melnikow
c7844ca7bb Fix a preview badge (#2836) 2019-01-21 23:04:52 -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
chris48s
fba846986a fix logo imports in [github twitter liberapay] (#2817)
this was moved in #2796 but we missed updating some of the imports
2019-01-20 23:19:12 -05:00
Paul Melnikow
26d0495ee6 Add logo support for the endpoint badge and refactor logo functions (#2796) 2019-01-20 20:22:46 +00:00
Paul Melnikow
5ff7beb3bf Reorganize token pooling code (#2792)
Ref #2698
2019-01-18 06:18:31 -05:00
Paul Melnikow
7d4acba5c1 Validate namedParams in examples (#2786)
Fix #2784
2019-01-16 19:38:36 -05:00