Skip to content

monorepo: Lerna #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CHANGELOG

`create-react-doc` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。

### 0.2.0

### 0.1.2
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Create React Doc

# Menu dir
## you can also set detailed dir, such as BasicSkill/css
menu: templates/default/Introduction
menu: packages/templates/default/Introduction
## set init open menu keys
# menuOpenKeys:

Expand Down
17 changes: 17 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"packages": ["packages/*"],
"version": "0.0.0",
"command": {
"bootstrap": {
"npmClientArgs": ["--no-package-lock"]
},
"publish": {
"allowBranch": "master",
"message": "chore(release): publish",
"registry": "https://npm.pkg.github.com"
}
},
"//": "set yarn workspaces in root",
"useWorkspaces": true,
"npmClient": "yarn"
}
87 changes: 16 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
{
"name": "create-react-doc",
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"version": "0.1.2",
"description": "Fast static generated site. Just write markdown file.",
"homepage": "",
"bin": {
"react-doc": "bin/react-doc.js"
},
"scripts": {
"release": "release-it --src.tagName='v%s'",
"start": "node bin/react-doc start",
"build": "node bin/react-doc build",
"deploy": "node bin/react-doc deploy"
"bootstrap": "lerna bootstrap",
"//1": "try no ci",
"bootstrap:ci": "lerna bootstrap --no-ci",
"clean": "lerna clean",
"//2": "release-it --src.tagName='v%s'",
"start": "node packages/create-react-doc/index.js start",
"build": "node packages/create-react-doc/index.js build",
"deploy": "node packages/create-react-doc/index.js deploy",
"release": "lerna publish"
},
"repository": {
"type": "git",
Expand All @@ -24,73 +33,9 @@
],
"author": "muyunyun",
"license": "MIT",
"dependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
"@babel/plugin-transform-async-to-generator": "^7.3.4",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/polyfill": "^7.2.5",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.3.4",
"@nuxtjs/friendly-errors-webpack-plugin": "^2.0.2",
"babel-eslint": "^8.0.1",
"babel-loader": "^8.0.5",
"classnames": "^2.2.6",
"colors-cli": "^1.0.13",
"commander": "^2.12.2",
"copy-markdown-image-webpack-plugin": "^2.0.0",
"copy-template-dir": "^1.3.0",
"css-loader": "^0.28.7",
"detect-port": "^1.2.2",
"diana": "^1.0.2",
"directory-tree-md": "^2.0.7",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"file-loader": "^1.1.11",
"fs-extra": "^5.0.0",
"gh-pages": "^1.2.0",
"highlight.js": "^9.12.0",
"html-webpack-plugin": "^3.2.0",
"js-yaml": "^3.14.0",
"less": "^3.0.2",
"less-loader": "^4.1.0",
"loading-cli": "^1.0.6",
"local-ip-url": "^1.0.1",
"mini-css-extract-plugin": "^0.4.0",
"open-browsers": "^1.1.1",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"postcss-flexbugs-fixes": "^3.2.0",
"postcss-loader": "^2.0.9",
"raw-content-replace-loader": "^1.0.1",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-dynamic-loadable": "^1.1.2",
"react-hot-loader": "^4.1.1",
"react-markdown": "^3.3.0",
"react-router-dom": "^4.2.2",
"react-switch": "^5.0.1",
"rimraf": "^2.6.2",
"string-replace-loader": "^2.1.1",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^2.1.1",
"upath": "^1.0.2",
"url-replace-loader": "^1.0.0",
"webpack": "^4.40.2",
"webpack-dev-middleware": "^3.7.1",
"webpack-dev-server": "^3.8.1",
"webpack-hot-dev-clients": "^1.0.4",
"webpackbar": "^4.0.0",
"write": "^1.0.3"
},
"dependencies": {},
"devDependencies": {
"lerna": "^3.22.1",
"release-it": "^10.1.0"
}
}
20 changes: 20 additions & 0 deletions packages/create-react-doc/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.less]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/create-react-doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
.create-react-doc-dist
package-lock.json
.cache
.DS_Store
.crd-dist/

*.bak
*.tem
*.log
*.temp
#.swp
*.*~
~*.*
7 changes: 7 additions & 0 deletions packages/create-react-doc/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.cache
.gitignore
.editorconfig
.create-react-doc-dist
node_modules
package-lock.json
dist
10 changes: 10 additions & 0 deletions packages/create-react-doc/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .npmrc

registry=https://registry.npmjs.org/

# https://github.com/sass/node-sass#binary-configuration-parameters
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

# https://github.com/Medium/phantomjs#deciding-where-to-get-phantomjs
# phantomjs_cdnurl=http://cnpmjs.org/downloads
phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs
10 changes: 10 additions & 0 deletions packages/create-react-doc/.yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# .yarnrc

registry "https://registry.npmjs.org/"

# https://github.com/sass/node-sass#binary-configuration-parameters
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

# https://github.com/Medium/phantomjs#deciding-where-to-get-phantomjs
# phantomjs_cdnurl "http://cnpmjs.org/downloads"
phantomjs_cdnurl "https://npm.taobao.org/dist/phantomjs"
126 changes: 126 additions & 0 deletions packages/create-react-doc/README-en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
_.-"\
_.-" \
,-" \
\ create \
\ \ react \
\ \ doc \
\ \ _.-;
\ \ _.-" :
\ \,-" _.-"
\( _.-"
`--"

[![npm version](https://img.shields.io/npm/v/create-react-doc)](https://badge.fury.io/js/create-react-doc) [![week download](https://img.shields.io/npm/dw/create-react-doc.svg)](https://www.npmjs.com/package/create-react-doc) ![LICENSE MIT](https://img.shields.io/npm/l/create-react-doc.svg)

English | [简体中文](./README.md)

# Create React Doc

Create React Doc is a markdown doc site generator for React. You can write markdown sites or blogs with no build configuration just like [create-react-app](https://github.com/facebook/create-react-app).

## Features

* Write markdown docs with no build configuration.
* Lazy load and Hot load for markdown data.
* Generate menu autoly based file directory.
* Support deploy to [GitHub Pages](https://pages.github.com/).

## Sites built with create-react-doc

* [muyunyun's blog](http://muyunyun.cn/blog)
* [create react doc](http://muyunyun.cn/create-react-doc)

![](http://with.muyunyun.cn/ec330b8ac2175c828be41f446f9f9619.jpg)

## Quick Overview

```bash
npx create-react-doc my-doc
npm install && cd my-doc
npm start
```

Then open [http://localhost:3000/]() to see your doc.
When you're ready to deploy to production, create a minified bundle with npm run build.

## Usage

**create-react-doc** is very easy to use. You don’t need to install or configure tools like webpack or Babel. They are preconfigured and hidden so that you can focus on the doc.

You can choose any one kind way to create a doc site as follow:

### npx

```bash
npx create-react-doc my-doc
```

### npm

```bash
npm init create-react-doc my-doc
```

### yarn

```bash
yarn create create-react-doc my-doc
```

Once the installation is done, you can open your project folder:

```
npm install && cd my-doc
```

Inside the newly created project, you can run some built-in commands:

### `npm start` or `yarn start`

Runs the doc in development mode.
Open [http://localhost:3000]() to view it in the browser.

The page will automatically reload if you make changes to the code.

### `npm run build` or `yarn build`

Builds the doc for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your doc site is ready to be deployed.

### `npm run deploy` or `yarn deploy`

The doc'll deployed to GitHub Pages rely `user`, `repo` in [config.yml](https://github.com/MuYunyun/create-react-doc#configyml)

## config.yml

There is some configuration provided for you to adjust doc sites.

```bash
# Site title
title: Time Flying

# Point Witch files to show as Menu
## you can also set detailed dir, such as BasicSkill/css
menu: React,BasicSkill,Algorithm
## set init open menu keys
menuOpenKeys: /BasicSkill

# Github
## if you want to show editing pages on github or deploy to GitHub Pages, you should config these arguments.
user: MuYunyun
repo: blog
branch: master # the default value of branch is master
deploy_branch: gh-pages # which branch to deploy.(default: gh-pages)
# publish: # if you want upload to gitlab or other git platform, you can set full git url in it

# Available values: en| zh-cn
language: en
```

## Advanced Usage

* If you not want to show some private files, you can set it in `.gitignore`, and the file'll be ignored to show in the docs.
Loading