Skip to content
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

v2: move v2 wip to Docusaurus #963

Merged
merged 137 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
d6ecead
first commit
endiliey Jul 27, 2018
06faff3
setup infra
endiliey Jul 27, 2018
94c45e3
feat: add siteConfig loader
endiliey Jul 28, 2018
d2e12a8
feat: add blog loader
endiliey Jul 28, 2018
7116374
chore(loader): prettier & eslint
endiliey Jul 28, 2018
2ab412e
feat: add simple webpack config
endiliey Jul 28, 2018
333574e
feat: prototype dev server
endiliey Jul 28, 2018
0bbe7fd
chore: .gitignore & add config for demo
endiliey Jul 28, 2018
56dfec1
feat(webpack): add better log output
endiliey Jul 28, 2018
e8e1d5e
chore: prettier & eslint
endiliey Jul 28, 2018
b1e785b
feat: prototype building dynamic react route
endiliey Jul 28, 2018
8b38177
chore: remove unused variables
endiliey Jul 29, 2018
a4c8507
chore: add MIT license
endiliey Jul 29, 2018
8cbd23d
chore: remove unused package
endiliey Jul 29, 2018
7ecd4c9
feat: prototype blog post generation in dev server
endiliey Jul 29, 2018
12cded5
refactor: config path
endiliey Jul 30, 2018
f7f063c
feat: add more koa app for webpack-serve add-on
endiliey Jul 30, 2018
a803996
refactor: use cache for blogDatas generation
endiliey Jul 30, 2018
dd5757c
chore: prettier & remove unused
endiliey Jul 30, 2018
c5dfdda
chore: refactor & fix typo
endiliey Aug 1, 2018
0c69604
feat: add koa-static to serve static files
endiliey Aug 1, 2018
82be417
chore: namespace webpack output
endiliey Aug 1, 2018
d9a86a5
feat & refactor: webpack-serve-waitpage and lint
endiliey Aug 1, 2018
9070fb5
refactor: dev
endiliey Aug 1, 2018
dbf78c5
refactor: folder structure & filename
endiliey Aug 1, 2018
50894d8
feat: use webpackbar
endiliey Aug 1, 2018
2ba359f
chore: delay starting webpack-serve by one second
endiliey Aug 1, 2018
75ed92e
chore: add sakura.png to test static file
endiliey Aug 1, 2018
44eb765
chore: update webpack-nicelog to v2
endiliey Aug 4, 2018
45cf88e
refactor: use docusaurus structure
endiliey Aug 5, 2018
b37d992
chore: add dummy blog file
endiliey Aug 5, 2018
05426d4
feat: add react component for markdown->html
endiliey Aug 5, 2018
187a46d
chore: prettier
endiliey Aug 5, 2018
221023f
feat: prototype blog & docs generation on dev
endiliey Aug 5, 2018
dc1e417
fix: blog file should trigger reload
endiliey Aug 5, 2018
36eee29
feat: add home page for available routes
endiliey Aug 5, 2018
9fef99c
refactor: rename loader to load as not to confuse webpack loader
endiliey Aug 6, 2018
e85d323
feat: add very simple default theme
endiliey Aug 7, 2018
e64a06c
feat: simple webpack config
endiliey Aug 7, 2018
698e09b
chore: dotfiles
endiliey Aug 7, 2018
d582895
chore: dependencies
endiliey Aug 7, 2018
f9bc0ff
feat: add React component to render Markdown
endiliey Aug 7, 2018
9e7729a
feat: react router config generation for docs
endiliey Aug 7, 2018
2a7f7e2
chore: eslint fix
endiliey Aug 7, 2018
10f8569
feat: add own webpack markdown to react loader
endiliey Aug 7, 2018
b0f884e
feat: webpack config creator
endiliey Aug 7, 2018
bc706ae
chore: eslinting
endiliey Aug 7, 2018
7508046
feat: add App.js (react router config renderer)
endiliey Aug 7, 2018
4c36e71
feat: add core dev files
endiliey Aug 7, 2018
b079e48
feat: add production entry & template
endiliey Aug 7, 2018
7a69cff
feat: add build command
endiliey Aug 7, 2018
1150c45
refactor: start cli command
endiliey Aug 7, 2018
1d99c22
chore: prettier & lint
endiliey Aug 7, 2018
cf08a20
chore: delete old unused files
endiliey Aug 7, 2018
bc7b283
feat: prototype custom pages site generation
endiliey Aug 7, 2018
33105ba
chore: add README
endiliey Aug 7, 2018
77ec02a
chore: eslint fix
endiliey Aug 7, 2018
fa02f6e
feat: copy static files for production build
endiliey Aug 7, 2018
2996e01
chore: update readme & dependencies
endiliey Aug 8, 2018
a9c3d50
chore: more test files
endiliey Aug 8, 2018
44122cd
refactor: code
endiliey Aug 8, 2018
0fcad83
chore: add blog test file
endiliey Aug 8, 2018
d9def28
fix: use exact path & handle non-index pages
endiliey Aug 8, 2018
1eef464
chore: add pages/tictactoe.js to test reactDOM
endiliey Aug 8, 2018
05c90a2
chore: minimal es6 refactor
endiliey Aug 8, 2018
8538a10
dep: update webpack-nicelog
endiliey Aug 8, 2018
d36c17f
refactor: use alias for docs & eslint
endiliey Aug 8, 2018
687bf09
dep: add bundle analyzer temporarily to check bundle size
endiliey Aug 8, 2018
bf94bf9
test: add test for load config
endiliey Aug 10, 2018
d80a255
test: load docs
endiliey Aug 10, 2018
cfd11fb
test: utils for load
endiliey Aug 10, 2018
8f49360
test: load pages
endiliey Aug 10, 2018
084063e
chore: eslint & prettier nits
endiliey Aug 10, 2018
8a58074
test: genRoutesConfig
endiliey Aug 10, 2018
80204b5
chore: remove bundle analyzer
endiliey Aug 10, 2018
a4cc782
test: test compile dev/prod webpack config
endiliey Aug 10, 2018
15ce4a9
chore: eslint & prettier nits
endiliey Aug 10, 2018
0f28b6f
test: fix load test
endiliey Aug 11, 2018
a4f0ed7
test: more timeout for webpack compile test
endiliey Aug 11, 2018
f07e779
test: compile webpack config for dev and prod
endiliey Aug 11, 2018
d33343b
feat: use ejs to build html template
endiliey Aug 11, 2018
ea706d2
feat: hash the webpack-compiled js file
endiliey Aug 11, 2018
1564eda
feat: add .css webpack loader
endiliey Aug 12, 2018
3eb9823
test: validate generated webpack config instead of compiling
endiliey Aug 12, 2018
bf1e30d
dep: use forked version of static-generator-webpack-plugin
endiliey Aug 12, 2018
406106b
feat: code split & use react helmet
endiliey Aug 23, 2018
e13e1bf
feat: remove/clean your build folder(s) before building
endiliey Aug 23, 2018
1f2c8a3
chore: nits
endiliey Aug 23, 2018
23a85d9
fix: hot reload port should not be hardcoded in case it is used
endiliey Aug 23, 2018
99cc83e
chore: update readme
endiliey Aug 24, 2018
d3e12c9
chore: update docs examples
endiliey Aug 25, 2018
be3d259
chore: better examples
endiliey Aug 25, 2018
3530cbe
test: update test webpack
endiliey Aug 25, 2018
0058b20
chore: add missing dep & nits :(
endiliey Aug 25, 2018
ea37e54
feat: hljs syntax highlighting & nits
endiliey Aug 26, 2018
9dc4cc2
chore: add another react pages examples
endiliey Aug 26, 2018
ef17da7
chore: nits && lint
endiliey Aug 28, 2018
9965eec
feat: throw error if there is wrong field on siteConfig.js
endiliey Aug 29, 2018
8c6bc6d
feat: able to specify host for dev (e.g: 0.0.0.0)
endiliey Aug 29, 2018
2b5ee3e
feat: enable custom theme with eject
endiliey Aug 29, 2018
10b1a38
feat: allow user to modify generated webpack config
endiliey Aug 29, 2018
828d99d
refactor: load theme
endiliey Sep 3, 2018
1ff6733
feat: add loadEnv to check if translation / versioning is enabled
endiliey Sep 4, 2018
d00864d
feat: add @theme/Markdown to allow user modify their own markdown rea…
endiliey Sep 6, 2018
988232e
wip: trans & versioning
endiliey Sep 7, 2018
2141e6e
test: loadPages
endiliey Sep 7, 2018
b477863
chore: prepare for docs sidebar
endiliey Sep 7, 2018
31d333b
test: add easy setup for test cases
endiliey Sep 7, 2018
0f38ae3
feat:docs translation + versioning 💥
endiliey Sep 7, 2018
0cef519
test: fix inconsistent test
endiliey Sep 7, 2018
6851800
fix: docs translation & versioning metadata
endiliey Sep 7, 2018
59fa427
test: add metadata test
endiliey Sep 7, 2018
185f7b1
fix: yarn build error
endiliey Sep 7, 2018
b99605f
feat: allow custom docsUrl & custom permalink
endiliey Sep 11, 2018
20f6921
chore: normalize permalink to remove trailing slash if user permalink…
endiliey Sep 11, 2018
5fcc135
fix: default theme url typo
endiliey Sep 11, 2018
ca623d7
fix: provide correct paths for build
endiliey Sep 13, 2018
0365403
feat: add uglifyjs webpack plugin
endiliey Sep 13, 2018
4d10c3b
test: docs ordering from sidebar
endiliey Sep 14, 2018
760b917
feat: replace relative markdown link to corrrect url
endiliey Sep 14, 2018
e9f2fab
chore: rename data -> metadata for consistency
endiliey Sep 14, 2018
c0194a1
fix: markdown linking for translated & versioned docs
endiliey Sep 14, 2018
11b0d15
feat: pass loaded siteConfig as props for React component
endiliey Sep 14, 2018
318ea5f
feat: add next/prev button for docs according to sidebar
endiliey Sep 14, 2018
e071788
refactor: use <Link /> from react-router for next/prev link
endiliey Sep 14, 2018
6b11281
test: metadata test for next/prev from sidebars
endiliey Sep 14, 2018
5eab627
feat: avoid flash Of Loading component
endiliey Sep 15, 2018
c132c74
chore: naming consistency
endiliey Sep 15, 2018
85f0fd6
feat: add docs sidebar
endiliey Sep 15, 2018
15a810f
chore: nits
endiliey Sep 15, 2018
141d655
refactor: only process translated & versioned if it is enabled
endiliey Sep 16, 2018
dc7ef96
refactor: css extraction
endiliey Sep 16, 2018
4573620
v2: prepare to move
endiliey Sep 17, 2018
b9f2928
Merge branch 'master' of into v2
endiliey Sep 17, 2018
48f273e
v2: ignore v2 folder for now
endiliey Sep 17, 2018
dcb733a
v2: nits
endiliey Sep 17, 2018
0a2368b
Merge branch 'master' of https://github.com/facebook/Docusaurus into v2
endiliey Sep 17, 2018
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
static/**/*.js
build
node_modules
v2
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ yarn.lock
website
docs
docusaurus-init
v2
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v2
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
"__fixtures__"
"__fixtures__",
"v2"
],
"testURL": "http://localhost/"
},
Expand Down
3 changes: 3 additions & 0 deletions v2/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env", "react"]
}
4 changes: 4 additions & 0 deletions v2/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
generated
__fixtures__
dist
website
23 changes: 23 additions & 0 deletions v2/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const OFF = 0;
const WARNING = 1;
const ERROR = 2;

module.exports = {
env: {
browser: true,
commonjs: true,
jest: true,
node: true,
},
extends: ['airbnb', 'prettier'],
rules: {
'no-console': OFF,
'func-names': OFF,
'react/jsx-filename-extension': OFF,
'react/jsx-one-expression-per-line': OFF,
'react/prop-types': OFF,
'react/destructuring-assignment': OFF, // too many lines
'import/no-unresolved': WARNING, // because it couldn't resolve webpack alias
'react/prefer-stateless-function': WARNING,
},
};
10 changes: 10 additions & 0 deletions v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
.vscode
.idea
.eslintcache
node_modules
dist
yarn-error.log
generated
website/node_modules
build
3 changes: 3 additions & 0 deletions v2/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
generated
__fixtures__
dist
8 changes: 8 additions & 0 deletions v2/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bracketSpacing": false,
"jsxBracketSameLine": true,
"parser": "flow",
"printWidth": 80,
"proseWrap": "never",
"singleQuote": true
}
13 changes: 13 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Munseo

## Development Server

```bash
yarn start # open http://localhost:3000/
```

## Production Build

```bash
yarn build # check website/build
```
73 changes: 73 additions & 0 deletions v2/bin/munseo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env node

const chalk = require('chalk');
const semver = require('semver');
const path = require('path');
const program = require('commander');
const {build, eject, init, start} = require('../lib');
const requiredVersion = require('../package.json').engines.node;

if (!semver.satisfies(process.version, requiredVersion)) {
console.log(
chalk.red(`\nMinimum node version not met :)`) +
chalk.yellow(
`\nYou are using Node ${
process.version
}, Requirement: Node ${requiredVersion}.\n`
)
);
process.exit(1);
}

function wrapCommand(fn) {
return (...args) =>
fn(...args).catch(err => {
console.error(chalk.red(err.stack));
process.exitCode = 1;
});
}

program
.version(require('../package.json').version)
.usage('<command> [options]');

program
.command('build [siteDir]')
.description('Build website')
.option(
'-sic, --skip-image-compression <skipImageCompression>',
'Skip compression of image assets (default: false)'
)
.action((siteDir = '.', {skipImageCompression}) => {
wrapCommand(build)(path.resolve(siteDir), {skipImageCompression});
});

program
.command('eject [siteDir]')
.description('copy the default theme into website folder for customization.')
.action((siteDir = '.') => {
wrapCommand(eject)(path.resolve(siteDir));
});

program
.command('init [projectDir]')
.description('Initialize website')
.action((projectDir = '.') => {
wrapCommand(init)(path.resolve(projectDir));
});

program
.command('start [siteDir]')
.description('Start development server')
.option('-p, --port <port>', 'use specified port (default: 3000)')
.option('-h, --host <host>', 'use specified host (default: localhost')
.option('-nw, --no-watch <noWatch>', 'disable live reload (default: false)')
.action((siteDir = '.', {port, noWatch}) => {
wrapCommand(start)(path.resolve(siteDir), {port, noWatch});
});

program.parse(process.argv);

if (!process.argv.slice(2).length) {
program.outputHelp();
}
26 changes: 26 additions & 0 deletions v2/docs/docusaurus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: docusaurus
title: docusaurus
---

<h1 align="center">
<p align="center">Docusaurus</p>
<a href="https://docusaurus.io"><img src="/img/slash-introducing.png" alt="Docusaurus"></a>
</h1>

<p align="center">
<a href="https://www.npmjs.com/package/docusaurus"><a href="#backers" alt="sponsors on Open Collective"><img src="https://opencollective.com/Docusaurus/backers/badge.svg" /></a> <a href="#sponsors" alt="Sponsors on Open Collective"><img src="https://opencollective.com/Docusaurus/sponsors/badge.svg" /></a> <img src="https://img.shields.io/npm/v/docusaurus.svg?style=flat" alt="npm version"></a>
<a href="https://circleci.com/gh/facebook/Docusaurus"><img src="https://circleci.com/gh/facebook/Docusaurus.svg?style=shield" alt="CircleCI Status"></a>
<a href="CONTRIBUTING.md#pull-requests"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
<a href="https://discord.gg/docusaurus"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg" alt="Chat"></a>
<a href="https://github.com/prettier/prettier"><img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a>
<a href="https://github.com/facebook/jest"><img src="https://img.shields.io/badge/tested_with-jest-99424f.svg" alt="Tested with Jest"></a>
</p>

## Introduction

Docusaurus is a project for easily building, deploying, and maintaining open source project websites.

* **Simple to Start** Docusaurus is built to be easy to [get up and running](https://docusaurus.io/docs/en/installation.html) in as little time possible. We've built Docusaurus to handle the website build process so you can focus on your project.
* **Localizable** Docusaurus ships with [localization support](https://docusaurus.io/docs/en/translation.html) via CrowdIn. Empower and grow your international community by translating your documentation.
* **Customizable** While Docusaurus ships with the key pages and sections you need to get started, including a home page, a docs section, a [blog](https://docusaurus.io/docs/en/blog.html), and additional support pages, it is also [customizable](https://docusaurus.io/docs/en/custom-pages.html) as well to ensure you have a site that is [uniquely yours](https://docusaurus.io/docs/en/api-pages.html).
51 changes: 51 additions & 0 deletions v2/docs/foo/bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
id: bar
title: My Title
---

# Remarkable

> Experience real-time editing with Remarkable!

Click the `clear` link to start with a clean slate, or get the `permalink` to share or save your results.

***

# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading


## Horizontal Rules

This is horizontal rule

___

***

***


## Emphasis

**This is bold text**

__This is bold text__

*This is italic text*

_This is italic text_

~~Deleted text~~

Superscript: 19^th^

Subscript: H~2~O

++Inserted text++

==Marked text==
74 changes: 74 additions & 0 deletions v2/docs/foo/baz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
id: baz
title: Test Markdown
---

## Images

![Sakura](/img/sakura.png)

Like links, Images also have a footnote style syntax

![Alt text][id]

With a reference later in the document defining the URL location:

## Links

[link text](http://dev.nodeca.com)

[link with title](http://nodeca.github.io/pica/demo/ "title text!")

Autoconverted link https://github.com/nodeca/pica (enable linkify to see)



## Footnotes

Footnote 1 link[^first].

Footnote 2 link[^second].

Inline footnote^[Text of inline footnote] definition.

Duplicated footnote reference[^second].

[^first]: Footnote **can have markup**

and multiple paragraphs.

[^second]: Footnote text.


## Definition lists

Term 1

: Definition 1
with lazy continuation.

Term 2 with *inline markup*

: Definition 2

{ some code, part of Definition 2 }

Third paragraph of definition 2.

_Compact style:_

Term 1
~ Definition 1

Term 2
~ Definition 2a
~ Definition 2b


## Abbreviations

This is HTML abbreviation example.

It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.

*[HTML]: Hyper Text Markup Language
52 changes: 52 additions & 0 deletions v2/docs/hello.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
id: hello
title: Hello, World !
---

## Relative links

Replace this
[highlight](highlight.md) [docusaurus](docusaurus.md)

Can't replace this
[file](file.md)

Do not replace below

```
[highlight](highlight.md) [docusaurus](docusaurus.md)
```

## Blockquotes

> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.


## Lists

Unordered

+ Create a list by starting a line with `+`, `-`, or `*`
+ Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
* Ac tristique libero volutpat at
+ Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
+ Very easy!

Ordered

1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa


1. You can use sequential numbers...
1. ...or keep all the numbers as `1.`

Start numbering with offset:

57. foo
1. bar
Loading