forked from reactjs/react-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] moving documentation to mkdocs.
- Loading branch information
Showing
20 changed files
with
255 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,11 @@ REMOTE="[email protected]:reactjs/react-modal" | |
CURRENT_VERSION:=$(shell jq ".version" package.json) | ||
COVERAGE?=true | ||
|
||
BRANCH=$(shell git rev-parse --abbrev-ref HEAD) | ||
CURRENT_VERSION:=$(shell jq ".version" package.json) | ||
|
||
VERSION:=$(if $(RELEASE),$(shell read -p "Release $(CURRENT_VERSION) -> " V && echo $$V),$(subst /,-,$(BRANCH))) | ||
|
||
help: info | ||
@echo | ||
@echo "Current version: $(CURRENT_VERSION)" | ||
|
@@ -38,10 +43,10 @@ info: | |
deps: deps-project deps-docs | ||
|
||
deps-project: | ||
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install | ||
@$(PKM) install | ||
|
||
deps-docs: | ||
@gitbook install | ||
@pip install --user mkdocs mkdocs-material jsx-lexer | ||
|
||
# Rules for development | ||
|
||
|
@@ -64,47 +69,40 @@ lint: | |
@npm run lint | ||
|
||
docs: build-docs | ||
gitbook serve | ||
mkdocs serve | ||
|
||
# Rules for build and publish | ||
|
||
check-working-tree: | ||
@sh ./scripts/repo_status | ||
|
||
version: | ||
@echo "[Updating react-modal version]" | ||
@sh ./scripts/version $(CURRENT_VERSION) | ||
@$(JQ) '.version' package.json | cut -d\" -f2 > .version | ||
|
||
branch: | ||
@echo "[Release from branch]" | ||
@git branch | grep '^*' | awk '{ print $$2 }' > .branch | ||
@[[ "`cat .branch`" != "master\n" ]] && echo "Current branch: `cat .branch`" || (echo "Fail. Current branch is not master." && exit 1) | ||
@[[ ! -z "`git status -s`" ]] && \ | ||
echo "Stopping publish. There are change to commit or discard." && \ | ||
exit 1 | ||
|
||
changelog: | ||
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION) > `cat .version`]" | ||
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v`cat .version` > .changelog_update | ||
@echo "[Updating CHANGELOG.md $(CURRENT_VERSION)]" | ||
@python3 ./scripts/changelog.py v$(CURRENT_VERSION) v$(VERSION) > .changelog_update | ||
@cat .changelog_update CHANGELOG.md > tmp && mv tmp CHANGELOG.md | ||
@rm .changelog_update | ||
|
||
compile: | ||
@echo "[Compiling source]" | ||
$(BABEL) src --out-dir lib | ||
|
||
build: compile | ||
@echo "[Building dists]" | ||
@./node_modules/.bin/webpack --config ./scripts/webpack.dist.config.js | ||
@npx webpack --config ./scripts/webpack.dist.config.js | ||
|
||
release-commit: | ||
git commit --allow-empty -m "Release v`cat .version`." | ||
git commit --allow-empty -m "Release v$(VERSION)." | ||
@git add . | ||
@git commit --amend -m "`git log -1 --format=%s`" | ||
|
||
release-tag: | ||
git tag "v`cat .version`" | ||
git tag "v$(VERSION)" | ||
|
||
publish-version: release-commit release-tag | ||
@echo "[Publishing]" | ||
git push $(REMOTE) "`cat .branch`" "v`cat .version`" | ||
git push $(REMOTE) "$(BRANCH)" "v$(VERSION)" | ||
npm publish | ||
|
||
pre-publish: clean branch version changelog | ||
|
@@ -122,7 +120,7 @@ init-docs-repo: | |
build-docs: | ||
@echo "[Building documentation]" | ||
@rm -rf _book | ||
@gitbook build -g reactjs/react-modal | ||
@mkdocs build | ||
|
||
pre-publish-docs: clean-docs init-docs-repo deps-docs | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
### Development setup | ||
|
||
`react-modal` uses `make` to build and publish new versions and documentation. | ||
|
||
It works as a checklist for the future releases to keep everything updated such as | ||
`CHANGELOG.md`, `package.json` and `bower.json` and so on. | ||
|
||
The minimun works as a normal `npm script`. | ||
The minimun works as a normal `npm` scripts. | ||
|
||
#### Usage | ||
#### [Usage](#usage) | ||
|
||
Once you clone `react-modal`, you can run `sh bootstrap.sh` to check | ||
and download dependencies not managed by `react-modal` such as `gitbook-cli`. | ||
|
||
It will also show information about the current versions of `node`, `npm`, | ||
`yarn` and `jq` available. | ||
|
||
#### List of `npm` commands: | ||
#### [List of `npm` or `yarn` commands](#npm-yarn-commands) | ||
|
||
$ npm start -s or yarn start # to run examples | ||
$ npm start | ||
$ npm run tests | ||
$ npm run lint | ||
|
||
#### List of `make` commands: | ||
#### [List of `make` commands](#make-commands) | ||
|
||
$ make help # show all make commands available | ||
$ make deps # npm install, gitbook plugins... | ||
$ make serve # to run examples | ||
$ make deps # npm install | ||
$ make serve # start a examples' web server | ||
$ make tests # use when developing | ||
$ make tests-ci # single run | ||
$ make lint # pass lint | ||
$ make lint # execute lint | ||
$ make publish # execute the entire pipeline to publish | ||
$ make publish-docs # execute the pipeline for docs |
Oops, something went wrong.