Download hugo submodule and its deps when running npm i

This commit adds a bit of helper code to the top-level package.json to
always ensure that the `themes/docsy` submodule is checked out and that
its nodejs dependencies are installed. Thus, we can remove the need to
download git submodules directly. Instead they will be loaded when running
`npm i`.

We also don't need to load submodules recursively anymore, as docsy has
removed any submodules from its repo since the last time we updated the
theme.

The `--depth 1` bit of `git submodule update --init --depth 1` tells git
to only check out the latest commit of any submodules - saving bandwidth
and space.
This commit is contained in:
Andrew Morgan 2022-11-01 17:57:31 +00:00
parent 6e4c18480f
commit 3313b6a0a5
3 changed files with 7 additions and 9 deletions

View file

@ -115,8 +115,6 @@ jobs:
extended: true
- name: "📥 Source checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "⚙️ npm"
run: |
npm i
@ -161,8 +159,6 @@ jobs:
extended: true
- name: "📥 Source checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "⚙️ npm"
run: |
npm i

View file

@ -65,15 +65,14 @@ place after an MSC has been accepted, not as part of a proposal itself.
Alternatively, use the Docker image at
https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required
to process the SCSS.)
2. Run `git submodule update --init --recursive` for good measure.
3. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed.
4. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals"
2. Run `npm i` to install the dependencies. Note that this will require NodeJS to be installed.
3. Run `npm run get-proposals` to seed proposal data. This is merely for populating the content of the "Spec Change Proposals"
page and is not required.
5. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313
4. Run `hugo serve` (or `docker run --rm -it -v $(pwd):/src -p 1313:1313
klakegg/hugo:ext serve`) to run a local webserver which builds whenever a file
change is detected. If watching doesn't appear to be working for you, try
adding `--disableFastRender` to the commandline.
6. Edit the specification 🙂
5. Edit the specification 🙂
We use a highly customized [Docsy](https://www.docsy.dev/) theme for our generated site, which uses Bootstrap and Font
Awesome. If you're looking at making design-related changes to the spec site, please coordinate with us in

View file

@ -5,6 +5,9 @@
"main": "none.js",
"scripts": {
"get-proposals": "node ./scripts/proposals.js",
"get:submodule": "git submodule update --init --depth 1",
"_prepare:docsy": "cd themes/docsy && npm install",
"prepare": "npm run get:submodule && npm run _prepare:docsy",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {