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

17 Commits

Author SHA1 Message Date
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
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
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
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
Caleb Cartwright
f0eac60191
doc: updated tutorial links and code snippets (#3124) 2019-03-01 16:00:18 -06:00
Paul Melnikow
d2861b2438 Switch to npm ci (#3034) 2019-02-18 17:28:09 -06: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
dcbe1cf906
Prettier: Ignore a couple generated files which aren’t checked in (#2680) 2019-01-07 20:40:24 -05:00
Paul Melnikow
8c7404a571
Run Prettier on the rest of the things (#2662) 2019-01-07 18:33:17 -05:00
Paul Melnikow
94611fb0e4
Rewrite server deploy script (#1793)
To run this requires renaming `private/secret.json` to `private/secret-production.json` in the working tree used for deployment.

Goals:

- Ensure production secrets are not used in development
- Avoid modifying the current working tree
- Avoid branch switching: make sure the current ref gets deployed
    - If something other than `master` is deployed, leave `HEAD` alone; don't reset to `master`
- Ensure the build runs before server deploy (#1941)

This makes use of Git working trees, which is a relatively new but stable feature in Git. I was initially reluctant to use git worktree, mostly because I don't like adding new tooling that isn't necessary. The other alternative I experimented with was copying or re-cloning to an entirely separate working copy. This was messier and more brittle than using `git worktree`.
2018-10-30 17:08:52 -04:00
Paul Melnikow
1b307864b4
Prettify the files in the project root (#2041)
Follow on to #2009
2018-09-02 12:10:23 -07:00
Paul Melnikow
1deeb365a5
Update uri -> url in the front end + examples (#2006)
This continues a consistency update we’ve been making to standardize on URL based on a recommendation from WHATWG: https://url.spec.whatwg.org/#goals

This also helps with copying and pasting between all-badge-examples and new-style services, where it’s otherwise easy to make a mistake.

Ref: #1322 #1341
2018-08-29 14:27:50 -07:00
Paul Melnikow
ab051b3804
Turn on prettier (except repo root) (#1167)
* Use prettier-check
* Update semi option
    See discussion https://github.com/badges/shields/issues/948#issuecomment-349205606
* Developer documentation
* Run the same steps in both `main` jobs
* Move integration tests from `danger` to `main` where they belong
2018-08-08 17:49:06 -04:00
Paul Melnikow
5359adfb3f
Do not prettify package.json (#1795)
This causes extremely strange failures in CircleCI. `npm install`, oddly, rewrites and reformats package.json. We hash package.json to determine the cache keys, and oddly enough Circle computes a new hash when we write the cache. `npm-install` writes to one cache key. The tasks that follow read from another. Nothing runs.

I'm running into this because I'm using prettier auto-format on another project, and the presence of a `.prettierrc` means it's started trying to format Shields code.

In separate news, I'm loving auto-formatting!
2018-07-23 14:35:52 -05:00
Paul Melnikow
91eaa2958c Move gh-badges CLI into lib/ 2017-10-30 21:46:50 -04:00
Paul Melnikow
2809ff6888 Configure prettier and eslint-config-standard (#1123) 2017-10-09 14:46:30 -04:00