1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00

31 Commits

Author SHA1 Message Date
Pierre-Yves Bigourdan
6b0b88d29a
Update c8 configuration (#10361)
* Update c8 configuration

* Update .gitignore
2024-07-13 20:59:51 +02:00
chris48s
50ea7068a8
migrate frontend to docusaurus (#9014)
* delete loads of really important stuff that we definitely need

* v basic MVP smoosh docusaurus PoC into repo

* TODO

* delete more really important stuff

* TODO

* tidyup: use run-s

* don't redirect images used in frontend to raster proxy

* fix routing

* preserve the /endpoint link

* delete the blog (for now)

I would quite like to re-add this at some point
but its not really the top priority thing right now

* content edits

* appease the lint gods

* update danger rules

* remove placeholder

* cypress tests

* dockerhub --> ghcr

* Revert "dockerhub --> ghcr"

This reverts commit ef74cbb26b1c24ce987a8975e60313682f9161f8.

* downgrade lockfile format

* implement defs/BASE_URL

* fix e2e build

* actually fix cypress tests

* always run cypress tests on build

* this never worked

* add command for docusaurus:clear

* delete more code we don't need any more

* update ESLint/prettier config

* delete unsused exports

* documentation updates

* delete a fairly large chunk of our dependency tree

* allow base_url as build arg to Dockerfile

* fixup dockerfile

* work out base url at runtime if not set

doing this at image build time is not the right approach

* remove gatsby monorepo from closebot

* rename HomepageFeatures to homepage-features
2023-06-17 10:59:07 +01:00
chris48s
148b51d554
Export OpenAPI definitions from service examples; affects [dynamic endpoint static] (#8966)
* WIP export OpenAPI definitions from service examples

* allow services to optionally define an OpenApi Paths Object instead of examples

* make use of param descriptions and required query params

* convert other 'core' services to declare openApi..

..instead of examples

* tweak descriptions for standard query params

* move stuff around, add a high-level integration test for category2openapi

* update simple-icons text refs #9054

* remove legacy param names
2023-04-11 18:37:16 +01:00
chris48s
091ccfdbcd
migrate token pooling to postgres (#8922)
* add ability to store token pool in Postgres DB

* update transitive ansi-regex dependencies
2023-02-23 17:18:39 +00:00
Pierre-Yves B
23c0406bed
Migrate from CommonJS to ESM (#6651) 2021-07-09 12:53:55 +01:00
Paul Melnikow
90eb4fc73f
Update a few remaining references to gh-badges and remove nowignore (#4945)
I was hoping I'd find something in here that would fix the install issue on Heroku but I don't think any of this is it.
2020-04-24 18:14:09 +00:00
Pierre-Yves B
097bf87e41
Make it easier to benchmark and profile the code (#4780)
* Make it easier to benchmark and profile the code

* Remove unnecessary escape

* Clarify that the backend server is started without the frontend

* Add missing NODE_CONFIG_ENV environment variable

* Add error message when user has not included console.time statements

* Fix lint issue

* Handle multiple console.time statements

* Switch NODE_CONFIG_ENV to test

* Switch to const as variable never re-assigned
2020-03-22 20:45:53 +01:00
chris48s
38cdc0033f
adopt JSDoc, eslint-plugin-jsdoc (#3645)
eslint-plugin-jsdoc:
- install eslint-plugin-jsdoc
- config file
- fix lint/style errors

JSDoc:
- add JSDoc as a dev dependency
- get everything rendering nicely with JSDoc
- config, build command + ignores
2019-07-11 20:14:47 +01:00
Marcin Mielnicki
c81b482082
End to end tests (#3262)
* Frontend test using Cypress

* test:end-to-end script added

* cypress and eslint-plugin-cypress moved to dev dependencies

* Run end-to-end tests at CI using end2end script

* cypress/screenshots/ added to gitignore

* end2end job added

* Dedicated docker image for Cypress

* Store videos and screenshots

* Prepare and store junit report

* Use junit reporter

* Code refactoring

* Code refactoring

* Code refactoring

* lint-staged for json, md and yml files

* Format json config

* Assert that PyPI - License is displayed

* Do not create fixtures
2019-04-02 22:25:37 +02: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
Paul Melnikow
1e267f891d
Document production hosting (#2661) 2019-01-07 20:55:49 -05:00
Paul Melnikow
fa5309400d
PaaS, CI, and production-friendly config (#2626)
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv).

`private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.
2019-01-06 10:42:09 -05:00
James Cahill
4baf16cbed Visual Studio Code gitignore + recommended extensions (#2581)
* Add vscode to gitignore

* Update gitignore and add recommended extensions
2018-12-29 12:06:01 -05:00
Paul Melnikow
2045489019
Service definition export format (#2397)
Three main goals:

1. In the front end:
      a. Show form fields and automatically assemble badge URLs (#701)
      c. Group together examples for the same service
      b. Show deprecated services
2. Make it easy to changing the schema of `examples`, thanks to 100% validation. One challenge with frameworks is that when there are typos things fail silently which is pretty unfriendly to developers. The validation should really help with that. (This caught one bug in AUR, though I fixed it in #2405 which landed first.)
3. Produce a service definition export for external tool builders. (#776)
4. Build toward harmony between the front-end data structure and the `examples` key in the service classes. I aliased `staticPreview` to `staticExample` which starts this process.

The old format:

- Lacked a consistent machine-readable representation of the fields.
- Flattened multiple examples for the same service were flattened.
- Excluded deprecated services.

The new format improves a few things, too:

- It cleans up the naming. Since this file evolved over time, the names were a bit muddled (i.e. what was an example vs a preview).
- It duplicated information (like `.svg`). (I can imagine dropping the `.svg` from our badge URLs someday, which would make the URLs easier to read and maintain.)
- For a human reading the YAML file, providing the static example as a deconstructed object is more readable.

Here are a couple snippets:

```yml
  - category: build
    name: AppVeyorCi
    isDeprecated: false
    route:
      format: '([^/]+/[^/]+)(?:/(.+))?'
      queryParams: []
    examples:
      - title: AppVeyor
        example: {path: /appveyor/ci/gruntjs/grunt, queryParams: {}}
        preview: {label: build, message: passing, color: brightgreen}
        keywords: []
      - title: AppVeyor branch
        example: {path: /appveyor/ci/gruntjs/grunt/master, queryParams: {}}
        preview: {label: build, message: passing, color: brightgreen}
        keywords: []
  - category: downloads
    name: AmoDownloads
    isDeprecated: false
    examples:
      - title: Mozilla Add-on
        example: {path: /amo/d/dustman, queryParams: {}}
        preview: {path: /amo/d/dustman, queryParams: {}}
        keywords: [amo, firefox]
```
2018-12-02 11:21:30 -05:00
chris48s
b68ac16092
Move NPM package files out of /lib ; affects [resharper nuget myget dub chocolatey github] (#2300)
* move gh-badges files out of /lib

As far as possible, this is just moving files
around and updating paths however there are 2
functional changes in this commit:
- remove use of lib/register-chai-plugins.spec
  in badge-cli.spec.js
- remove use of starRating()
  in text-measurer.spec.js

* update service tests that use colorscheme.json

* split package.json in two

* clean up import

* don't hard-code path

* start a changelog

* put a license file in the package dir

* re-organise documentation 📚

* don't pack test files

* remove favicon from Makefile

* give package its own test command

* link the docs better in README
2018-11-15 18:48:01 +00:00
Paul Melnikow
5a62ed59fe
List the named logos in the frontend (#1794)
Fix #1787
2018-07-23 15:19:55 -05:00
Paul Melnikow
ac7c418222
Extract examples from new-style services (#1582)
Instead of centralizing examples, specify them from within a service.

* Avoid duplication in service loading + refactor
* Avoid duplication in URLs, rename uri -> url in BaseService
2018-03-30 03:07:44 -05:00
Paul Melnikow
4b5bf03fea
Rewrite frontend in React (#1273)
I rewrote the frontend in React using a module bundler. It's matched feature-for-feature with the current frontend, with only slight changes in the styling. I did not fuss about making the styling identical; the badge popup looks particularly different.

This makes the front end much easier to develop. I'm really looking forward to implementing #701, to which this paves the way.

This makes light use of Next.js, which provides webpack config and dev/build tooling. We’ll probably replace it with create-react-app or our own webpack setup because unfortunately it comes with a lot of runtime overhead (the build is 400k).

Let’s open new issues for bugs and features, and track other follow-ups here: https://github.com/badges/shields/projects/1
2017-11-28 11:34:17 -05:00
Paul Melnikow
b411f08ad1 Generate badge examples from data + code (#1163)
This pull request sets us up to generate the badge examples dynamically from data and code.

Right now, try.html is still checked in, mostly for the benefit of reading this diff, though it should be removed on the next pass to avoid unnecessary complexity at merge time.
2017-10-20 17:33:12 -04:00
James Z.M. Gao
e2ee910383 Add support for sonatype nexus (#1017)
Close #783
2017-09-27 20:48:51 -04:00
Adriaan Groenenboom
15f24fbcce Improve Docker run (envsubst, Alpine, documented env file) (#870)
* Add template for secret.json

- Move to faster and lighter Alpine base image

* Update documentation

* Update documentation

* Fix Github token config for secret.json

* Extend env file for Docker runtime configuration

- Update documentation
- Add gh_token for GH personal access token to secret template

* Change http to https in infoSite

* Update .dockerignore

* Update .gitignore

* Update dockerignore

* Remove ENV directive from Dockerfile

- Environment is needed at runtime, not at buildtime

* Docker: contain secret.json in private/

- Incorporates fix from 7c8b0e3d

* Use localhost in example env

* Use baseUrl in GitHub redirect

* Move GH personal token retrieval up

- To remove duplicate Promise.then()

* Typo in shields.example.env
2017-05-07 11:13:02 -07:00
Paul Melnikow
cca46b7e94 Generate index.html only on gh-pages when deploying
- Build index.html at deploy time
- Update corresponding documentation references
- Since index.html is untracked, git add needs -f
- Clarify gh-pages generated commit message
- Improve Makefile dependencies related to website generation

As discussed in #936, tracking the index.html causes makes PRs longer / noisier
and causes extra merge conflicts. More importantly, it causes contributors to
inadvertently edit the wrong file, which causes extra work (#949) or
contributions to be lost (#898).

Since there's no need for index.html in development (everything uses try.html) a
logical solution is to generate and commit the index.html at deploy time.

Recording compiled or generated files in a deploy commit is a reasonable
practice for git-based deploys (Heroku, gh-pages, and others).

The old version of this was slightly "unsafe" for my taste, in that it depended
on the local copy of gh-pages (if it existed) and master. The new version just
replaces gh-pages with master + the new commit.

Closes #936.

Fixes #954 (the PR).
2017-04-25 23:40:08 +02:00
Cr@zy
a079b682e3 Add badges for Uptime Robot (#947)
* numberOfDays optional (default 30) for Uptime Robot ratio
* Require a monitor key, not a user key
* Update gitignore for Jetbrains
2017-04-20 09:31:03 -04:00
Paul Melnikow
7c4b2b67e6 Add github standard node gitignores 2017-03-29 19:49:19 +02:00
Thaddee Tyl
7c8b0e3d32 Contain all private files in private/ 2017-02-05 16:24:35 +01:00
Thaddee Tyl
ec2a35266b Hide GitHub user tokens 2016-06-15 23:57:59 +02:00
Thaddee Tyl
461944a7a5 ServerScript 2015-09-01 15:54:38 +02:00
Thaddee Tyl
51598f8516 Hide the secret.json file. 2014-06-03 17:33:18 +02:00
Thaddee Tyl
90a1ad1071 Ignore the Redis folder. 2014-04-07 23:34:49 +00:00
Thaddee Tyl
9330684b2e Ignore project-specific files. 2014-02-27 10:26:51 +01:00
Mathias Bynens
2b99c27e8d Add SVGO to the pipeline 2014-01-02 18:25:34 +01:00