Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Automattic/mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed May 3, 2022
2 parents fa8d279 + 801565c commit c22152c
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 69 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Documentation
on:
pull_request:
paths:
- '.github/workflows/documentation.yml'
- 'package.json'
- 'docs/**'
- 'lib'
- 'test'
- 'website.js'
- 'CHANGELOG.md'
push:
branches:
- master
paths:
- '.github/workflows/documentation.yml'
- 'package.json'
- 'docs/**'
- 'lib'
- 'test'
- 'website.js'
- 'CHANGELOG.md'
permissions:
contents: read

jobs:
test-documentation:
runs-on: ubuntu-20.04
name: Test Generating Docs
steps:
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3

- name: Setup node
uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0
with:
node-version: 16

- run: npm install
- run: npm run docs:clean
- run: npm run docs:generate
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ To contribute to the [guide](http://mongoosejs.com/docs/guide.html) or [quick st
If you'd like to preview your documentation changes, first commit your changes to your local master branch, then execute:

* `npm install`
* `make docclean`
* `make gendocs`
* `node static.js`
* `npm run docs:view`

Visit `http://localhost:8089` and you should see the docs with your local changes. Make sure you `git reset --hard` before committing, because changes to `docs/*` should **not** be in PRs.
Visit `http://localhost:8089` and you should see the docs with your local changes. Make sure you `npm run docs:clean` before committing, because automated generated files to `docs/*` should **not** be in PRs.

### Plugins website

Expand Down
59 changes: 0 additions & 59 deletions Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
"lodash.isequal": "4.5.0",
"lodash.isequalwith": "4.4.0",
"marked": "4.0.14",
"mkdirp": "^1.0.4",
"mocha": "10.0.0",
"moment": "2.x",
"mongodb-memory-server": "8.5.2",
"ncp": "^2.0.0",
"nyc": "15.1.0",
"pug": "3.0.2",
"q": "1.5.1",
Expand All @@ -68,6 +70,21 @@
"lib": "./lib/mongoose"
},
"scripts": {
"docs:clean": "npm run docs:clean:stable",
"docs:clean:stable": "rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:clean:legacy": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
"docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && cp index.html ./tmp",
"docs:copy:tmp:legacy": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x",
"docs:checkout:gh-pages": "git checkout gh-pages",
"docs:checkout:legacy": "git checkout 5.x",
"docs:generate": "node website.js",
"docs:generate:search": "node docs/search.js",
"docs:merge:stable": "git merge master",
"docs:merge:legacy": "git merge 5.x",
"docs:test": "npm run docs:generate && npm run docs:generate:search",
"docs:view": "node website.js && node static.js",
"docs:prepare:publish:stable": "npm run docs:checkout:gh-pages && docs:merge:stable && npm run docs:clean:stable && npm run docs:generate && npm run docs:generate:search",
"docs:prepare:publish:legacy": "npm run docs:checkout:legacy && docs:merge:legacy && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && docs:checkout:gh-pages && docs:copy:tmp:legacy",
"lint": "eslint .",
"lint-js": "eslint . --ext .js",
"lint-ts": "eslint . --ext .ts",
Expand Down
12 changes: 6 additions & 6 deletions release-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

## updating the website

For 5.x
For 6.x

0. Change to the master branch
1. execute `make docs` (when this process completes you'll be on the gh-pages branch)
2. `git commit -a -m 'chore: website 5.x.x'`
1. execute `npm run docs:prepare:publish:stable` (when this process completes you'll be on the gh-pages branch)
2. `git commit -a -m 'chore: website 6.x.x'`
3. `git push origin gh-pages`

For 4.x
For 5.x

0. Change to the 4.x branch
0. Change to the 5.x branch
1. execute `make docs_legacy` (when this process completes you'll be on the gh-pages branch)
2. `git commit -a -m 'chore: website 4.x.x'`
2. `git commit -a -m 'chore: website 5.x.x'`
3. `git push origin gh-pages`

0 comments on commit c22152c

Please sign in to comment.