Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

[docs] Use package-based Hexo theme, rather than a Git submodule. #9

Merged
merged 7 commits into from
Mar 12, 2018

Conversation

abernix
Copy link
Member

@abernix abernix commented Mar 12, 2018

This PR is part of a series of mostly-automated PRs whose primary goal is to replace the Hexo theme, which has historically been provided with a Git submodule to the theme repository, with a theme installed via the meteor-theme-hexo package (npm) which was created after the re-convergence of the (previously-separated) Apollo and Meteor themes which took place in meteor/meteor-theme-hexo#51.

I (@abernix) will check each of these automated PRs' Netlify deploy previews and comment on the PR once it is ready to be merged.

Please do not merge this until I've updated with confirmation.

The Apollo repositories which are receiving this PR are those listed at:

https://github.com/meteor/hexo-theme-meteor/#readme

Most of these changes have been incrementally added to other repositories for testing and, now that they've been validated, are now ready (hopefully!) for all repositories.

While this package-based theme could be used by using Hexo's (recently added) inherited config file through the use of comma-delimited --config parameters (one of which would be pointing to the node_modules directory; e.g. hexo --config ../node_modules/module/,_config.yml), a newly-created chexo ("config hexo") package allows this to be, only:

chexo apollo-hexo-config -- start

...where everything after the -- will be passed directly to hexo and interpreted as usual.

Like other automated commits of this type, this also aims to update other Hexo dependencies to their latest stable versions and align all of Apollo's Hexo-based doc configurations with the same patterns.

This PR also introduces Renovate configuration within the docs' package.json (i.e. for repositories which have nested docs or have previously configured Renovate, it does not affect the top-level package.json or renovate.json) in order to accommodate the auto-updating of these dependencies (and the theme!) in the future. If a repository is not configured for Renovate app, it will not be affected by this change, however those that do will automatically have their Hexo-related PRs merged by this new Renovate configuration.

In the event that the repository wishes to setup Renovate to update docs dependencies (recommended!), but does not wish to use Renovate for the rest of the repository, it will be necessary to have a Renovate packageFiles configuration which points to just the docs' package.json (e.g. "packageFiles": ["docs/package.json"]) in either the renovate.json or the package.json's renovate object.

Lastly, please @mention me below if you have any questions about this PR!

abernix added 7 commits March 12, 2018 16:04
It's safe to mark all dependencies of this theme as 'dev' dependencies, as
none of them are needed to be installed in a production setting.

This was done automatically, so in some cases, this merges existing
`devDependencies`, and may also have added a missing `nodemon` `devDependency`
in cases where it was missing.  In other cases, this commit may not have
made such a change.
The theme which the docs in this repository are based on
([`hexo-theme-meteor`](https://github.com/meteor/hexo-theme-meteor)) has been
published to npm.

Additionally, most of the configuration which was once present in this
repository's `_config.yml` file, has been moved into an Apollo-centric theme
configuration npm,
[`apollo-hexo-config`](https://www.npmjs.com/package/apollo-hexo-config) (and
similarly, [GitHub](https://github.com/apollographql/apollo-hexo-config)).

The theme bundled in this npm is a converged version of the two `apollo`
and `master` branches on the `hexo-theme-meteor` repository, which is a result
of the work undertaken in meteor/meteor-theme-hexo#51.

Lastly, this makes use of a new `chexo` npm which acts as a wrapper for `hexo`
but permits the use of an inherited configuration from npm, rather than a
statically defined CLI file parameter (previously with `--config a,b`).
While some repositories which host Hexo docs alongside other code may not have
Renovate setup, it's anticipated that they will in the future, at the very
least for the docs portions of the respective repositories.

By having this `renovate` section in the `package.json` for the Hexo docs, we
can ensure that they will receive the proper treatment and minimize the amount
of manual work necessary on those repositories.

Additionally, this ensures that there is a single point of upstream Apollo-docs
Renovate configuration through the use of the
[`renovate-config-apollo-docs`](https://npm.im/renovate-config-apollo-docs)
package, which inherits further from
[`renovate-config-mdg-docs`](https://npm.im/renovate-config-mdg-docs).

Repositories which already have Renovate setup should benefit automatically
from this new docs-specific configuration.
@abernix abernix merged commit 79e04b3 into master Mar 12, 2018
@abernix abernix deleted the abernix/switch-hexo-to-npm branch March 12, 2018 18:41
@abernix
Copy link
Member Author

abernix commented Mar 12, 2018

Update: I've reviewed the Netlify preview and it looks correct. I'll merge this and monitor its deployment.

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant