mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-24 03:39:11 +00:00
Compare commits
27 Commits
@now/go@1.
...
@now/next@
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eed5574e0 | ||
|
|
91e6b85cec | ||
|
|
3ae83172ec | ||
|
|
7c51446e5e | ||
|
|
400a5c73e8 | ||
|
|
ec917ace69 | ||
|
|
f5e0afdd7e | ||
|
|
c1b4c62714 | ||
|
|
5e4bdfbe11 | ||
|
|
bd4a0cbd32 | ||
|
|
7ff9adc90e | ||
|
|
b279f1ffae | ||
|
|
344cc103ee | ||
|
|
83249b3685 | ||
|
|
79e7a9f477 | ||
|
|
b3dce70271 | ||
|
|
cff8d8b8a0 | ||
|
|
da892100d9 | ||
|
|
72e87ee6e4 | ||
|
|
3f9afad167 | ||
|
|
1527447914 | ||
|
|
9ca35df5fb | ||
|
|
05b2e2216c | ||
|
|
167fd5750a | ||
|
|
4a3cd7ec72 | ||
|
|
9aef718917 | ||
|
|
3cdc261802 |
6
.github/workflows/cancel.yml
vendored
6
.github/workflows/cancel.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Cancel
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- '*'
|
||||
- '!master'
|
||||
|
||||
@@ -11,8 +11,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: styfle/cancel-workflow-action@0.2.0
|
||||
- uses: styfle/cancel-workflow-action@0.3.1
|
||||
with:
|
||||
workflow_id: 435869
|
||||
workflow_id: 849295, 849296, 849297, 849298
|
||||
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}
|
||||
|
||||
|
||||
117
.github/workflows/continuous-integration.yml
vendored
117
.github/workflows/continuous-integration.yml
vendored
@@ -1,117 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test-unit:
|
||||
name: Unit Tests
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/setup-node@v1
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn run test-lint
|
||||
- run: yarn run test-unit --clean false
|
||||
- name: Upload Artifact
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: test-unit-output
|
||||
path: packages/now-cli/.nyc_output
|
||||
|
||||
test-integration:
|
||||
name: Integration Tests
|
||||
timeout-minutes: 120
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn test-integration-once --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
|
||||
test-now-cli:
|
||||
name: Now CLI Tests
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
|
||||
test-now-dev:
|
||||
name: "`now dev` Tests"
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-now-dev --clean false
|
||||
|
||||
coverage:
|
||||
name: Coverage
|
||||
timeout-minutes: 5
|
||||
needs: [test-unit, test-now-cli, test-now-dev, test-integration]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: test-unit-output
|
||||
path: packages/now-cli/.nyc_output
|
||||
- run: yarn install
|
||||
- run: yarn workspace now run coverage
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
36
.github/workflows/test-integration-cli.yml
vendored
Normal file
36
.github/workflows/test-integration-cli.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: CLI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: CLI
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-cli --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
33
.github/workflows/test-integration-dev.yml
vendored
Normal file
33
.github/workflows/test-integration-dev.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Dev
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- name: Install Hugo
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: yarn test-integration-dev --clean false
|
||||
25
.github/workflows/test-integration-once.yml
vendored
Normal file
25
.github/workflows/test-integration-once.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: E2E
|
||||
timeout-minutes: 120
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn test-integration-once --clean false
|
||||
env:
|
||||
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||
33
.github/workflows/test-unit.yml
vendored
Normal file
33
.github/workflows/test-unit.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Unit
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '!*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Unit
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: [10, 12]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: git fetch origin master --depth=10
|
||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||
- uses: actions/setup-node@v1
|
||||
- run: yarn install
|
||||
- run: yarn run build
|
||||
- run: yarn run test-lint
|
||||
- run: yarn run test-unit --clean false
|
||||
- run: yarn workspace now run coverage
|
||||
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
8
codecov.yml
Normal file
8
codecov.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
codecov:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project: off
|
||||
patch: off
|
||||
|
||||
6
examples/dojo/.dojorc
Normal file
6
examples/dojo/.dojorc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"build-app": {},
|
||||
"test-intern": {},
|
||||
"create-app": {},
|
||||
"create-widget": {}
|
||||
}
|
||||
4
examples/dojo/.gitignore
vendored
Normal file
4
examples/dojo/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
_build/
|
||||
output/
|
||||
.cert/
|
||||
25
examples/dojo/README.md
Normal file
25
examples/dojo/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Dojo Example
|
||||
|
||||
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Dojo project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Dojo on Now, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init dojo
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
Once initialized, you can deploy the Dojo example with just a single command:
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
26
examples/dojo/package.json
Normal file
26
examples/dojo/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "dojo",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "dojo build --mode dev --watch --serve",
|
||||
"build": "dojo build --mode dist",
|
||||
"build:dev": "dojo build --mode dev",
|
||||
"test": "dojo test",
|
||||
"test:unit": "dojo build --mode unit && dojo test --unit --config local",
|
||||
"test:functional": "dojo build --mode functional && dojo test --functional --config local",
|
||||
"test:all": "dojo build --mode unit && dojo build --mode functional && dojo test --all --config local"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dojo/framework": "^6.0.0",
|
||||
"@dojo/themes": "^6.0.0",
|
||||
"@dojo/widgets": "^6.0.0",
|
||||
"tslib": "~1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dojo/cli": "^6.0.0",
|
||||
"@dojo/cli-build-app": "^6.0.0",
|
||||
"@dojo/cli-test-intern": "^6.0.0",
|
||||
"@types/node": "~9.6.5",
|
||||
"typescript": "~3.4.5"
|
||||
}
|
||||
}
|
||||
3
examples/dojo/src/App.m.css
Normal file
3
examples/dojo/src/App.m.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
1
examples/dojo/src/App.m.css.d.ts
vendored
Normal file
1
examples/dojo/src/App.m.css.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const root: string;
|
||||
27
examples/dojo/src/App.ts
Normal file
27
examples/dojo/src/App.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { create, v, w } from '@dojo/framework/core/vdom';
|
||||
import theme from '@dojo/framework/core/middleware/theme';
|
||||
import Outlet from '@dojo/framework/routing/Outlet';
|
||||
import dojo from '@dojo/themes/dojo';
|
||||
|
||||
import Menu from './widgets/Menu';
|
||||
import Home from './widgets/Home';
|
||||
import About from './widgets/About';
|
||||
import Profile from './widgets/Profile';
|
||||
|
||||
import * as css from './App.m.css';
|
||||
|
||||
const factory = create({ theme });
|
||||
|
||||
export default factory(function App({ middleware: { theme } }) {
|
||||
if (!theme.get()) {
|
||||
theme.set(dojo);
|
||||
}
|
||||
return v('div', { classes: [css.root] }, [
|
||||
w(Menu, {}),
|
||||
v('div', [
|
||||
w(Outlet, { key: 'home', id: 'home', renderer: () => w(Home, {}) }),
|
||||
w(Outlet, { key: 'about', id: 'about', renderer: () => w(About, {}) }),
|
||||
w(Outlet, { key: 'profile', id: 'profile', renderer: () => w(Profile, { username: 'Dojo User' }) })
|
||||
])
|
||||
]);
|
||||
});
|
||||
11
examples/dojo/src/index.html
Normal file
11
examples/dojo/src/index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-us" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>dojo</title>
|
||||
<meta name="theme-color" content="#222127">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
6
examples/dojo/src/main.css
Normal file
6
examples/dojo/src/main.css
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Put your styles and imports here */
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
13
examples/dojo/src/main.ts
Normal file
13
examples/dojo/src/main.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import renderer, { w } from '@dojo/framework/core/vdom';
|
||||
import Registry from '@dojo/framework/core/Registry';
|
||||
import { registerRouterInjector } from '@dojo/framework/routing/RouterInjector';
|
||||
import '@dojo/themes/dojo/index.css';
|
||||
|
||||
import routes from './routes';
|
||||
import App from './App';
|
||||
|
||||
const registry = new Registry();
|
||||
registerRouterInjector(routes, registry);
|
||||
|
||||
const r = renderer(() => w(App, {}));
|
||||
r.mount({ registry });
|
||||
15
examples/dojo/src/routes.ts
Normal file
15
examples/dojo/src/routes.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export default [
|
||||
{
|
||||
path: 'home',
|
||||
outlet: 'home',
|
||||
defaultRoute: true
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
outlet: 'about'
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
outlet: 'profile'
|
||||
}
|
||||
];
|
||||
9
examples/dojo/src/widgets/About.ts
Normal file
9
examples/dojo/src/widgets/About.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { v, create } from '@dojo/framework/core/vdom';
|
||||
|
||||
import * as css from './styles/About.m.css';
|
||||
|
||||
const factory = create();
|
||||
|
||||
export default factory(function Profile() {
|
||||
return v('h1', { classes: [css.root] }, ['About Page']);
|
||||
});
|
||||
9
examples/dojo/src/widgets/Home.ts
Normal file
9
examples/dojo/src/widgets/Home.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { v, create } from '@dojo/framework/core/vdom';
|
||||
|
||||
import * as css from './styles/Home.m.css';
|
||||
|
||||
const factory = create();
|
||||
|
||||
export default factory(function Profile() {
|
||||
return v('h1', { classes: [css.root] }, ['Home Page']);
|
||||
});
|
||||
39
examples/dojo/src/widgets/Menu.ts
Normal file
39
examples/dojo/src/widgets/Menu.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { create, w } from '@dojo/framework/core/vdom';
|
||||
import Link from '@dojo/framework/routing/ActiveLink';
|
||||
import Toolbar from '@dojo/widgets/toolbar';
|
||||
|
||||
import * as css from './styles/Menu.m.css';
|
||||
|
||||
const factory = create();
|
||||
|
||||
export default factory(function Menu() {
|
||||
return w(Toolbar, { heading: 'My Dojo App!', collapseWidth: 600 }, [
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'home',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['Home']
|
||||
),
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'about',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['About']
|
||||
),
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'profile',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['Profile']
|
||||
)
|
||||
]);
|
||||
});
|
||||
14
examples/dojo/src/widgets/Profile.ts
Normal file
14
examples/dojo/src/widgets/Profile.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { v, create } from '@dojo/framework/core/vdom';
|
||||
|
||||
import * as css from './styles/Profile.m.css';
|
||||
|
||||
export interface ProfileProperties {
|
||||
username: string;
|
||||
}
|
||||
|
||||
const factory = create().properties<ProfileProperties>();
|
||||
|
||||
export default factory(function Profile({ properties }) {
|
||||
const { username } = properties();
|
||||
return v('h1', { classes: [css.root] }, [`Welcome ${username}!`]);
|
||||
});
|
||||
3
examples/dojo/src/widgets/styles/About.m.css
Normal file
3
examples/dojo/src/widgets/styles/About.m.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
1
examples/dojo/src/widgets/styles/About.m.css.d.ts
vendored
Normal file
1
examples/dojo/src/widgets/styles/About.m.css.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const root: string;
|
||||
3
examples/dojo/src/widgets/styles/Home.m.css
Normal file
3
examples/dojo/src/widgets/styles/Home.m.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
1
examples/dojo/src/widgets/styles/Home.m.css.d.ts
vendored
Normal file
1
examples/dojo/src/widgets/styles/Home.m.css.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const root: string;
|
||||
23
examples/dojo/src/widgets/styles/Menu.m.css
Normal file
23
examples/dojo/src/widgets/styles/Menu.m.css
Normal file
@@ -0,0 +1,23 @@
|
||||
.root {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
color: #4db3ff;
|
||||
background-color:#ccddee;
|
||||
}
|
||||
|
||||
.link {
|
||||
min-width: 140px;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
padding: 18px;
|
||||
color: black;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.selected {
|
||||
color: darkorange;
|
||||
}
|
||||
3
examples/dojo/src/widgets/styles/Menu.m.css.d.ts
vendored
Normal file
3
examples/dojo/src/widgets/styles/Menu.m.css.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export const root: string;
|
||||
export const link: string;
|
||||
export const selected: string;
|
||||
3
examples/dojo/src/widgets/styles/Profile.m.css
Normal file
3
examples/dojo/src/widgets/styles/Profile.m.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
1
examples/dojo/src/widgets/styles/Profile.m.css.d.ts
vendored
Normal file
1
examples/dojo/src/widgets/styles/Profile.m.css.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export const root: string;
|
||||
1
examples/dojo/tests/functional/all.ts
Normal file
1
examples/dojo/tests/functional/all.ts
Normal file
@@ -0,0 +1 @@
|
||||
import './main';
|
||||
1
examples/dojo/tests/functional/main.ts
Normal file
1
examples/dojo/tests/functional/main.ts
Normal file
@@ -0,0 +1 @@
|
||||
/* Write your app tests here */
|
||||
46
examples/dojo/tests/unit/App.ts
Normal file
46
examples/dojo/tests/unit/App.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
const { describe, it } = intern.getInterface('bdd');
|
||||
import harness from '@dojo/framework/testing/harness';
|
||||
import { v, w } from '@dojo/framework/core/vdom';
|
||||
import Outlet from '@dojo/framework/routing/Outlet';
|
||||
|
||||
import Menu from '../../src/widgets/Menu';
|
||||
import Home from '../../src/widgets/Home';
|
||||
import About from '../../src/widgets/About';
|
||||
import Profile from '../../src/widgets/Profile';
|
||||
|
||||
import App from '../../src/App';
|
||||
import * as css from '../../src/App.m.css';
|
||||
|
||||
describe('App', () => {
|
||||
it('default renders correctly', () => {
|
||||
const h = harness(() => w(App, {}));
|
||||
h.expect(() =>
|
||||
v('div', { classes: [css.root] }, [
|
||||
w(Menu, {}),
|
||||
v('div', [
|
||||
w(Outlet, { key: 'home', id: 'home', renderer: () => w(Home, {}) }),
|
||||
w(Outlet, { key: 'about', id: 'about', renderer: () => w(About, {}) }),
|
||||
w(Outlet, { key: 'profile', id: 'profile', renderer: () => w(Profile, { username: 'Dojo User' }) })
|
||||
])
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
it('home outlet renderer', () => {
|
||||
const h = harness(() => w(App, {}));
|
||||
const renderer = h.trigger('@home', 'renderer');
|
||||
h.expect(() => w(Home, {}), () => renderer);
|
||||
});
|
||||
|
||||
it('about outlet renderer', () => {
|
||||
const h = harness(() => w(App, {}));
|
||||
const renderer = h.trigger('@about', 'renderer');
|
||||
h.expect(() => w(About, {}), () => renderer);
|
||||
});
|
||||
|
||||
it('profile outlet renderer', () => {
|
||||
const h = harness(() => w(App, {}));
|
||||
const renderer = h.trigger('@profile', 'renderer');
|
||||
h.expect(() => w(Profile, { username: 'Dojo User' }), () => renderer);
|
||||
});
|
||||
});
|
||||
2
examples/dojo/tests/unit/all.ts
Normal file
2
examples/dojo/tests/unit/all.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import './App';
|
||||
import './widgets/all';
|
||||
1
examples/dojo/tests/unit/main.ts
Normal file
1
examples/dojo/tests/unit/main.ts
Normal file
@@ -0,0 +1 @@
|
||||
/* Write your app tests here */
|
||||
13
examples/dojo/tests/unit/widgets/About.ts
Normal file
13
examples/dojo/tests/unit/widgets/About.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const { describe, it } = intern.getInterface('bdd');
|
||||
import harness from '@dojo/framework/testing/harness';
|
||||
import { w, v } from '@dojo/framework/core/vdom';
|
||||
|
||||
import About from '../../../src/widgets/About';
|
||||
import * as css from '../../../src/widgets/styles/About.m.css';
|
||||
|
||||
describe('About', () => {
|
||||
it('default renders correctly', () => {
|
||||
const h = harness(() => w(About, {}));
|
||||
h.expect(() => v('h1', { classes: [css.root] }, ['About Page']));
|
||||
});
|
||||
});
|
||||
13
examples/dojo/tests/unit/widgets/Home.ts
Normal file
13
examples/dojo/tests/unit/widgets/Home.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const { describe, it } = intern.getInterface('bdd');
|
||||
import harness from '@dojo/framework/testing/harness';
|
||||
import { w, v } from '@dojo/framework/core/vdom';
|
||||
|
||||
import Home from '../../../src/widgets/Home';
|
||||
import * as css from '../../../src/widgets/styles/Home.m.css';
|
||||
|
||||
describe('Home', () => {
|
||||
it('default renders correctly', () => {
|
||||
const h = harness(() => w(Home, {}));
|
||||
h.expect(() => v('h1', { classes: [css.root] }, ['Home Page']));
|
||||
});
|
||||
});
|
||||
45
examples/dojo/tests/unit/widgets/Menu.ts
Normal file
45
examples/dojo/tests/unit/widgets/Menu.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
const { describe, it } = intern.getInterface('bdd');
|
||||
import harness from '@dojo/framework/testing/harness';
|
||||
import { w } from '@dojo/framework/core/vdom';
|
||||
import Link from '@dojo/framework/routing/ActiveLink';
|
||||
import Toolbar from '@dojo/widgets/toolbar';
|
||||
|
||||
import Menu from '../../../src/widgets/Menu';
|
||||
import * as css from '../../../src/widgets/styles/Menu.m.css';
|
||||
|
||||
describe('Menu', () => {
|
||||
it('default renders correctly', () => {
|
||||
const h = harness(() => w(Menu, {}));
|
||||
h.expect(() =>
|
||||
w(Toolbar, { heading: 'My Dojo App!', collapseWidth: 600 }, [
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'home',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['Home']
|
||||
),
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'about',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['About']
|
||||
),
|
||||
w(
|
||||
Link,
|
||||
{
|
||||
to: 'profile',
|
||||
classes: [css.link],
|
||||
activeClasses: [css.selected]
|
||||
},
|
||||
['Profile']
|
||||
)
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
13
examples/dojo/tests/unit/widgets/Profile.ts
Normal file
13
examples/dojo/tests/unit/widgets/Profile.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const { describe, it } = intern.getInterface('bdd');
|
||||
import harness from '@dojo/framework/testing/harness';
|
||||
import { w, v } from '@dojo/framework/core/vdom';
|
||||
|
||||
import Profile from '../../../src/widgets/Profile';
|
||||
import * as css from '../../../src/widgets/styles/Profile.m.css';
|
||||
|
||||
describe('Profile', () => {
|
||||
it('default renders correctly', () => {
|
||||
const h = harness(() => w(Profile, { username: 'Dojo User' }));
|
||||
h.expect(() => v('h1', { classes: [css.root] }, ['Welcome Dojo User!']));
|
||||
});
|
||||
});
|
||||
4
examples/dojo/tests/unit/widgets/all.ts
Normal file
4
examples/dojo/tests/unit/widgets/all.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import './About';
|
||||
import './Home';
|
||||
import './Profile';
|
||||
import './Menu';
|
||||
31
examples/dojo/tsconfig.json
Normal file
31
examples/dojo/tsconfig.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": false,
|
||||
"experimentalDecorators": true,
|
||||
"jsx": "react",
|
||||
"jsxFactory": "tsx",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es5",
|
||||
"es2015.promise",
|
||||
"es2015.iterable",
|
||||
"es2015.symbol",
|
||||
"es2015.symbol.wellknown"
|
||||
],
|
||||
"module": "umd",
|
||||
"moduleResolution": "node",
|
||||
"noUnusedLocals": true,
|
||||
"outDir": "_build/",
|
||||
"removeComments": false,
|
||||
"importHelpers": true,
|
||||
"downlevelIteration": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "es5",
|
||||
"types": [ "intern" ]
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./tests/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
"react-router": "^5.1.2",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"react-scripts": "3.3.0",
|
||||
"typescript": "3.7.4"
|
||||
"typescript": "3.8.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
"build": "node utils/run.js build all",
|
||||
"test-lint": "node utils/run.js test-lint",
|
||||
"test-unit": "node utils/run.js test-unit",
|
||||
"test-integration": "node utils/run.js test-integration",
|
||||
"test-integration-cli": "node utils/run.js test-integration-cli",
|
||||
"test-integration-once": "node utils/run.js test-integration-once",
|
||||
"test-integration-now-dev": "node utils/run.js test-integration-now-dev",
|
||||
"test-integration-dev": "node utils/run.js test-integration-dev",
|
||||
"lint": "eslint . --ext .ts,.js"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
@@ -112,7 +112,35 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Docusaurus",
|
||||
"name": "Docusaurus 2",
|
||||
"slug": "docusaurus-2",
|
||||
"demo": "https://docusaurus.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
|
||||
"tagline": "Docusaurus makes it easy to maintain Open Source documentation websites.",
|
||||
"description": "A static Docusaurus site that makes it easy to maintain OSS documentation.",
|
||||
"website": "https://v2.docusaurus.io",
|
||||
"detectors": {
|
||||
"some": [
|
||||
{
|
||||
"path": "package.json",
|
||||
"matchContent": "\"(dev)?(d|D)ependencies\":\\s*{[^}]*\"@docusaurus\\/core\":\\s*\".+?\"[^}]*}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"buildCommand": {
|
||||
"placeholder": "`npm run build` or `docusaurus build`"
|
||||
},
|
||||
"devCommand": {
|
||||
"value": "docusaurus start --port $PORT"
|
||||
},
|
||||
"outputDirectory": {
|
||||
"value": "build"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Docusaurus 1",
|
||||
"slug": "docusaurus",
|
||||
"demo": "https://docusaurus.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
|
||||
@@ -124,10 +152,6 @@
|
||||
{
|
||||
"path": "package.json",
|
||||
"matchContent": "\"(dev)?(d|D)ependencies\":\\s*{[^}]*\"docusaurus\":\\s*\".+?\"[^}]*}"
|
||||
},
|
||||
{
|
||||
"path": "package.json",
|
||||
"matchContent": "\"(dev)?(d|D)ependencies\":\\s*{[^}]*\"@docusaurus\\/core\":\\s*\".+?\"[^}]*}"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -171,6 +195,37 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Dojo",
|
||||
"slug": "dojo",
|
||||
"demo": "https://dojo.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/dojo.svg",
|
||||
"tagline": "Dojo is a modern progressive, TypeScript first framework.",
|
||||
"description": "A Dojo app, created with the Dojo CLI's cli-create-app command.",
|
||||
"website": "https://dojo.io",
|
||||
"detectors": {
|
||||
"some": [
|
||||
{
|
||||
"path": "package.json",
|
||||
"matchContent": "\"(dev)?(d|D)ependencies\":\\s*{[^}]*\"@dojo\\/framework\":\\s*\".+?\"[^}]*}"
|
||||
},
|
||||
{
|
||||
"path": ".dojorc"
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"buildCommand": {
|
||||
"placeholder": "`npm run build` or `dojo build`"
|
||||
},
|
||||
"devCommand": {
|
||||
"value": "dojo build -m dev -w -s -p $PORT"
|
||||
},
|
||||
"outputDirectory": {
|
||||
"value": "output/dist"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Ember",
|
||||
"slug": "ember",
|
||||
|
||||
BIN
packages/frameworks/logos/dojo.png
Normal file
BIN
packages/frameworks/logos/dojo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@now/frameworks",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.13-canary.0",
|
||||
"main": "frameworks.json",
|
||||
"license": "UNLICENSED"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "now",
|
||||
"version": "17.1.0",
|
||||
"version": "17.1.2-canary.4",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Now",
|
||||
@@ -13,9 +13,9 @@
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"test-unit": "nyc ava test/unit.js test/dev-builder.unit.js test/dev-router.unit.js test/dev-server.unit.js --serial --fail-fast --verbose",
|
||||
"test-integration": "ava test/integration.js --serial --fail-fast",
|
||||
"test-integration-cli": "ava test/integration.js --serial --fail-fast",
|
||||
"test-integration-v1": "ava test/integration-v1.js --serial --fail-fast",
|
||||
"test-integration-now-dev": "ava test/dev/integration.js --serial --fail-fast --verbose",
|
||||
"test-integration-dev": "ava test/dev/integration.js --serial --fail-fast --verbose",
|
||||
"prepublishOnly": "yarn build",
|
||||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
|
||||
"build": "ts-node ./scripts/build.ts",
|
||||
|
||||
@@ -40,7 +40,7 @@ const help = () => {
|
||||
)} Login token
|
||||
-S, --scope Set a custom scope
|
||||
-n, --no-verify Don't wait until instance count meets the previous alias constraints
|
||||
|
||||
-N, --next Show next page of results
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
${chalk.gray('–')} Add a new alias to ${chalk.underline('my-api.now.sh')}
|
||||
@@ -81,6 +81,12 @@ const help = () => {
|
||||
${chalk.cyan(
|
||||
`$ now alias ls aliasId --json > ${chalk.underline('rules.json')}`
|
||||
)}
|
||||
|
||||
${chalk.gray('–')} Paginate results, where ${chalk.dim(
|
||||
'`1584722256178`'
|
||||
)} is the time in milliseconds since the UNIX epoch.
|
||||
|
||||
${chalk.cyan(`$ now alias ls --next 1584722256178`)}
|
||||
`);
|
||||
};
|
||||
|
||||
@@ -100,9 +106,11 @@ export default async function main(ctx) {
|
||||
'--no-verify': Boolean,
|
||||
'--rules': String,
|
||||
'--yes': Boolean,
|
||||
'--next': Number,
|
||||
'-n': '--no-verify',
|
||||
'-r': '--rules',
|
||||
'-y': '--yes',
|
||||
'-N': '--next',
|
||||
});
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
|
||||
@@ -16,7 +16,7 @@ export default async function ls(ctx, opts, args, output) {
|
||||
} = ctx;
|
||||
const { currentTeam } = config;
|
||||
const { apiUrl } = ctx;
|
||||
const { '--debug': debugEnabled } = opts;
|
||||
const { '--debug': debugEnabled, '--next': nextTimestamp } = opts;
|
||||
const client = new Client({
|
||||
apiUrl,
|
||||
token,
|
||||
@@ -36,8 +36,17 @@ export default async function ls(ctx, opts, args, output) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
const now = new Now({ apiUrl, token, debug: debugEnabled, currentTeam });
|
||||
if (typeof nextTimestamp !== undefined && Number.isNaN(nextTimestamp)) {
|
||||
output.error('Please provide a number for flag --next');
|
||||
return 1;
|
||||
}
|
||||
|
||||
const now = new Now({
|
||||
apiUrl,
|
||||
token,
|
||||
debug: debugEnabled,
|
||||
currentTeam,
|
||||
});
|
||||
const lsStamp = stamp();
|
||||
let cancelWait;
|
||||
|
||||
@@ -58,7 +67,11 @@ export default async function ls(ctx, opts, args, output) {
|
||||
: `Fetching aliases under ${chalk.bold(contextName)}`
|
||||
);
|
||||
|
||||
const aliases = await getAliases(now);
|
||||
const { aliases, pagination } = await getAliases(
|
||||
now,
|
||||
undefined,
|
||||
nextTimestamp
|
||||
);
|
||||
if (cancelWait) cancelWait();
|
||||
|
||||
if (args[0]) {
|
||||
@@ -84,15 +97,16 @@ export default async function ls(ctx, opts, args, output) {
|
||||
output.print(`${printPathAliasTable(rules)}\n`);
|
||||
}
|
||||
} else {
|
||||
aliases.sort((a, b) => new Date(b.created) - new Date(a.created));
|
||||
output.log(
|
||||
`${plural('alias', aliases.length, true)} found under ${chalk.bold(
|
||||
contextName
|
||||
)} ${lsStamp()}`
|
||||
);
|
||||
output.log(`aliases found under ${chalk.bold(contextName)} ${lsStamp()}`);
|
||||
console.log(printAliasTable(aliases));
|
||||
}
|
||||
|
||||
if (pagination && aliases.length === 20) {
|
||||
output.log(
|
||||
`To display the next page use the flag --next ${pagination.next}`
|
||||
);
|
||||
}
|
||||
|
||||
now.close();
|
||||
return 0;
|
||||
}
|
||||
@@ -111,7 +125,7 @@ function printAliasTable(aliases) {
|
||||
? a.deployment.url
|
||||
: chalk.gray('–'),
|
||||
a.alias,
|
||||
ms(Date.now() - new Date(a.created)),
|
||||
ms(Date.now() - new Date(a.createdAt)),
|
||||
]),
|
||||
],
|
||||
{
|
||||
|
||||
@@ -46,6 +46,7 @@ export const latestHelp = () => `
|
||||
)} Path to the global ${'`.now`'} directory
|
||||
-d, --debug Debug mode [off]
|
||||
-f, --force Force a new deployment even if nothing has changed
|
||||
--force-with-cache Force a new deployment even if nothing has changed but retain build cache
|
||||
-t ${chalk.underline('TOKEN')}, --token=${chalk.underline(
|
||||
'TOKEN'
|
||||
)} Login token
|
||||
@@ -97,6 +98,7 @@ export const latestHelp = () => `
|
||||
|
||||
export const latestArgs = {
|
||||
'--force': Boolean,
|
||||
'--force-with-cache': Boolean,
|
||||
'--public': Boolean,
|
||||
'--no-clipboard': Boolean,
|
||||
'--env': [String],
|
||||
|
||||
@@ -506,6 +506,7 @@ export default async function main(
|
||||
env: deploymentEnv,
|
||||
build: { env: deploymentBuildEnv },
|
||||
forceNew: argv['--force'],
|
||||
forceNewWithCache: argv['--force-with-cache'],
|
||||
quiet,
|
||||
wantsPublic: argv['--public'] || localConfig.public,
|
||||
isFile,
|
||||
@@ -576,7 +577,7 @@ export default async function main(
|
||||
}
|
||||
|
||||
if (deployment.readyState === 'CANCELED') {
|
||||
output.log('The deployment has been canceled.');
|
||||
output.print('The deployment has been canceled.\n');
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ let paths: string[];
|
||||
|
||||
// Options
|
||||
let forceNew: boolean;
|
||||
let forceNewWithCache: boolean;
|
||||
let deploymentName: string;
|
||||
let sessionAffinity: string;
|
||||
let log: any;
|
||||
@@ -238,6 +239,7 @@ export default async function main(
|
||||
|
||||
// Options
|
||||
forceNew = argv.force;
|
||||
forceNewWithCache = argv['force-with-cache'];
|
||||
deploymentName = argv.name;
|
||||
sessionAffinity = argv['session-affinity'];
|
||||
debugEnabled = argv.debug;
|
||||
@@ -741,6 +743,7 @@ async function sync({
|
||||
meta: metadata,
|
||||
followSymlinks,
|
||||
forceNew,
|
||||
forceNewWithCache,
|
||||
forwardNpm,
|
||||
quiet,
|
||||
scale,
|
||||
|
||||
@@ -45,6 +45,7 @@ const help = () => {
|
||||
'TOKEN'
|
||||
)} Login token
|
||||
-S, --scope Set a custom scope
|
||||
-N, --next Show next page of results
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
@@ -61,6 +62,12 @@ const help = () => {
|
||||
if it's configured with these nameservers (no need to ${chalk.dim(
|
||||
'`domain add`'
|
||||
)}).
|
||||
|
||||
${chalk.gray('–')} Paginate results, where ${chalk.dim(
|
||||
'`1584722256178`'
|
||||
)} is the time in milliseconds since the UNIX epoch.
|
||||
|
||||
${chalk.cyan(`$ now domains ls --next 1584722256178`)}
|
||||
`);
|
||||
};
|
||||
|
||||
@@ -72,7 +79,7 @@ const COMMAND_CONFIG = {
|
||||
move: ['move'],
|
||||
rm: ['rm', 'remove'],
|
||||
transferIn: ['transfer-in'],
|
||||
verify: ['verify']
|
||||
verify: ['verify'],
|
||||
};
|
||||
|
||||
export default async function main(ctx: NowContext) {
|
||||
@@ -83,7 +90,9 @@ export default async function main(ctx: NowContext) {
|
||||
'--cdn': Boolean,
|
||||
'--code': String,
|
||||
'--no-cdn': Boolean,
|
||||
'--yes': Boolean
|
||||
'--yes': Boolean,
|
||||
'--next': Number,
|
||||
'-N': '--next',
|
||||
});
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ms from 'ms';
|
||||
import chalk from 'chalk';
|
||||
import plural from 'pluralize';
|
||||
import table from 'text-table';
|
||||
|
||||
import Client from '../../util/client';
|
||||
@@ -13,6 +12,7 @@ import { Domain, NowContext } from '../../types';
|
||||
|
||||
type Options = {
|
||||
'--debug': boolean;
|
||||
'--next': number;
|
||||
};
|
||||
|
||||
export default async function ls(
|
||||
@@ -21,13 +21,21 @@ export default async function ls(
|
||||
args: string[],
|
||||
output: Output
|
||||
) {
|
||||
const { authConfig: { token }, config } = ctx;
|
||||
const {
|
||||
authConfig: { token },
|
||||
config,
|
||||
} = ctx;
|
||||
const { currentTeam } = config;
|
||||
const { apiUrl } = ctx;
|
||||
const debug = opts['--debug'];
|
||||
const { '--debug': debug, '--next': nextTimestamp } = opts;
|
||||
const client = new Client({ apiUrl, token, currentTeam, debug });
|
||||
let contextName = null;
|
||||
|
||||
if (typeof nextTimestamp !== undefined && Number.isNaN(nextTimestamp)) {
|
||||
output.error('Please provide a number for flag --next');
|
||||
return 1;
|
||||
}
|
||||
|
||||
try {
|
||||
({ contextName } = await getScope(client));
|
||||
} catch (err) {
|
||||
@@ -48,16 +56,24 @@ export default async function ls(
|
||||
return 1;
|
||||
}
|
||||
|
||||
const domains = await getDomains(client, contextName);
|
||||
const { domains, pagination } = await getDomains(
|
||||
client,
|
||||
contextName,
|
||||
nextTimestamp
|
||||
);
|
||||
output.log(
|
||||
`${plural('domain', domains.length, true)} found under ${chalk.bold(
|
||||
contextName
|
||||
)} ${chalk.gray(lsStamp())}\n`
|
||||
`Domains found under ${chalk.bold(contextName)} ${chalk.gray(lsStamp())}\n`
|
||||
);
|
||||
if (domains.length > 0) {
|
||||
console.log(`${formatDomainsTable(domains)}\n`);
|
||||
}
|
||||
|
||||
if (pagination && domains.length === 20) {
|
||||
output.log(
|
||||
`To display the next page use the flag --next ${pagination.next}`
|
||||
);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -71,18 +87,18 @@ function formatDomainsTable(domains: Domain[]) {
|
||||
chalk.gray('serviceType'),
|
||||
chalk.gray('verified'),
|
||||
chalk.gray('cdn'),
|
||||
chalk.gray('age')
|
||||
chalk.gray('age'),
|
||||
].map(s => chalk.dim(s)),
|
||||
...domains.map(domain => {
|
||||
const url = chalk.bold(domain.name);
|
||||
const time = chalk.gray(ms(current.getTime() - domain.createdAt));
|
||||
return ['', url, domain.serviceType, domain.verified, true, time];
|
||||
})
|
||||
}),
|
||||
],
|
||||
{
|
||||
align: ['l', 'l', 'l', 'l', 'l'],
|
||||
hsep: ' '.repeat(4),
|
||||
stringLength: strlen
|
||||
stringLength: strlen,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,12 +111,26 @@ async function removeDomain(
|
||||
|
||||
for (const id of aliasIds) {
|
||||
output.debug(`Removing alias ${id}`);
|
||||
await removeAliasById(client, id);
|
||||
try {
|
||||
await removeAliasById(client, id);
|
||||
} catch (error) {
|
||||
// Ignore if the alias does not exist anymore
|
||||
if (error.status !== 404) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const id of certIds) {
|
||||
output.debug(`Removing cert ${id}`);
|
||||
await deleteCertById(output, client, id);
|
||||
try {
|
||||
await deleteCertById(output, client, id);
|
||||
} catch (error) {
|
||||
// Ignore if the cert does not exist anymore
|
||||
if (error.status !== 404) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (suffix) {
|
||||
|
||||
@@ -185,7 +185,7 @@ function prepareFolder(cwd: string, folder: string, force?: boolean) {
|
||||
folder
|
||||
)}" already exists and is not an empty directory. You may use ${cmd(
|
||||
'--force'
|
||||
)} or ${cmd('--f')} to override it.`
|
||||
)} or ${cmd('-f')} to override it.`
|
||||
);
|
||||
}
|
||||
} else if (dest !== cwd) {
|
||||
|
||||
@@ -222,7 +222,7 @@ export default async function main(ctx) {
|
||||
debug(
|
||||
'No deployments: attempting to find aliases that matches supplied app name'
|
||||
);
|
||||
const aliases = await getAliases(now);
|
||||
const { aliases } = await getAliases(now);
|
||||
const item = aliases.find(e => e.uid === app || e.alias === app);
|
||||
|
||||
if (item) {
|
||||
|
||||
@@ -238,3 +238,9 @@ export interface ProjectLink {
|
||||
projectId: string;
|
||||
orgId: string;
|
||||
}
|
||||
|
||||
export interface PaginationOptions {
|
||||
prev: number;
|
||||
count: number;
|
||||
next?: number;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ export default async function deploymentIsAliased(
|
||||
client: Client,
|
||||
deployment: Deployment
|
||||
) {
|
||||
const aliases = await getAliases(client);
|
||||
const { aliases } = await getAliases(client);
|
||||
return aliases.some(alias => alias.deploymentId === deployment.uid);
|
||||
}
|
||||
|
||||
@@ -7,11 +7,16 @@ type Response = {
|
||||
|
||||
export default async function getAliases(
|
||||
client: Client,
|
||||
deploymentId?: string
|
||||
deploymentId?: string,
|
||||
next?: number
|
||||
) {
|
||||
let aliasUrl = `/v3/now/aliases?limit=20`;
|
||||
if (next) {
|
||||
aliasUrl += `&until=${next}`;
|
||||
}
|
||||
const to = deploymentId
|
||||
? `/now/deployments/${deploymentId}/aliases`
|
||||
: '/now/aliases';
|
||||
: aliasUrl;
|
||||
const payload = await client.fetch<Response>(to);
|
||||
return payload.aliases || [];
|
||||
return payload;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ import getAliases from './get-aliases';
|
||||
import { Alias } from '../../types';
|
||||
|
||||
export default async function getDomainAliases(client: Client, domain: string) {
|
||||
const aliases = await getAliases(client);
|
||||
const { aliases } = await getAliases(client);
|
||||
return aliases.filter((alias: Alias) => alias.alias.endsWith(domain));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export default class Client extends EventEmitter {
|
||||
_apiUrl: string;
|
||||
_debug: boolean;
|
||||
_forceNew: boolean;
|
||||
_forceNewWithCache: boolean;
|
||||
_output: Output;
|
||||
_token: string;
|
||||
currentTeam?: string;
|
||||
@@ -30,18 +31,21 @@ export default class Client extends EventEmitter {
|
||||
token,
|
||||
currentTeam,
|
||||
forceNew = false,
|
||||
forceNewWithCache = false,
|
||||
debug = false,
|
||||
}: {
|
||||
apiUrl: string;
|
||||
token: string;
|
||||
currentTeam?: string;
|
||||
forceNew?: boolean;
|
||||
forceNewWithCache?: boolean;
|
||||
debug?: boolean;
|
||||
}) {
|
||||
super();
|
||||
this._token = token;
|
||||
this._debug = debug;
|
||||
this._forceNew = forceNew;
|
||||
this._forceNewWithCache = forceNewWithCache;
|
||||
this._output = createOutput({ debug });
|
||||
this._apiUrl = apiUrl;
|
||||
this._onRetry = this._onRetry.bind(this);
|
||||
|
||||
@@ -66,6 +66,7 @@ export default async function processDeployment({
|
||||
quiet: boolean;
|
||||
nowConfig?: NowConfig;
|
||||
force?: boolean;
|
||||
forceNewWithCache?: boolean;
|
||||
org: Org;
|
||||
projectName: string;
|
||||
isSettingUpProject: boolean;
|
||||
@@ -82,6 +83,7 @@ export default async function processDeployment({
|
||||
requestBody,
|
||||
deployStamp,
|
||||
force,
|
||||
forceNewWithCache,
|
||||
nowConfig,
|
||||
quiet,
|
||||
} = args;
|
||||
@@ -99,6 +101,7 @@ export default async function processDeployment({
|
||||
userAgent: ua,
|
||||
path: paths[0],
|
||||
force,
|
||||
forceNewWithCache,
|
||||
skipAutoDetectionConfirmation,
|
||||
};
|
||||
|
||||
@@ -205,6 +208,9 @@ export default async function processDeployment({
|
||||
}
|
||||
|
||||
if (event.type === 'canceled') {
|
||||
if (queuedSpinner) {
|
||||
queuedSpinner();
|
||||
}
|
||||
if (buildSpinner) {
|
||||
buildSpinner();
|
||||
}
|
||||
|
||||
@@ -42,6 +42,6 @@ function getAddDomainName(domainNames: string[]) {
|
||||
}
|
||||
|
||||
async function getDomainNames(client: Client, contextName: string) {
|
||||
const domains = await getDomains(client, contextName);
|
||||
const { domains } = await getDomains(client, contextName);
|
||||
return domains.map(domain => domain.name).sort((a, b) => a.localeCompare(b));
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
import chalk from 'chalk';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain, PaginationOptions } from '../../types';
|
||||
import Client from '../client';
|
||||
import wait from '../output/wait';
|
||||
|
||||
type Response = {
|
||||
domains: Domain[];
|
||||
pagination: PaginationOptions;
|
||||
};
|
||||
|
||||
export default async function getDomains(client: Client, contextName: string) {
|
||||
export default async function getDomains(
|
||||
client: Client,
|
||||
contextName: string,
|
||||
next?: number
|
||||
) {
|
||||
let domainUrl = `/v5/domains?limit=20`;
|
||||
if (next) {
|
||||
domainUrl += `&until=${next}`;
|
||||
}
|
||||
const cancelWait = wait(`Fetching domains under ${chalk.bold(contextName)}`);
|
||||
const { domains } = await client.fetch<Response>('/v4/domains');
|
||||
const domains = await client.fetch<Response>(domainUrl);
|
||||
cancelWait();
|
||||
return domains.sort(
|
||||
(domainA, domainB) => domainB.createdAt - domainA.createdAt
|
||||
);
|
||||
return domains;
|
||||
}
|
||||
|
||||
@@ -29,12 +29,20 @@ const IS_WIN = process.platform.startsWith('win');
|
||||
const SEP = IS_WIN ? '\\' : '/';
|
||||
|
||||
export default class Now extends EventEmitter {
|
||||
constructor({ apiUrl, token, currentTeam, forceNew = false, debug = false }) {
|
||||
constructor({
|
||||
apiUrl,
|
||||
token,
|
||||
currentTeam,
|
||||
forceNew = false,
|
||||
forceNewWithCache = false,
|
||||
debug = false,
|
||||
}) {
|
||||
super();
|
||||
|
||||
this._token = token;
|
||||
this._debug = debug;
|
||||
this._forceNew = forceNew;
|
||||
this._forceNewWithCache = forceNewWithCache;
|
||||
this._output = createOutput({ debug });
|
||||
this._apiUrl = apiUrl;
|
||||
this._onRetry = this._onRetry.bind(this);
|
||||
@@ -64,6 +72,7 @@ export default class Now extends EventEmitter {
|
||||
env,
|
||||
build,
|
||||
forceNew = false,
|
||||
forceNewWithCache = false,
|
||||
target = null,
|
||||
deployStamp,
|
||||
projectSettings,
|
||||
@@ -155,6 +164,7 @@ export default class Now extends EventEmitter {
|
||||
meta,
|
||||
public: wantsPublic || nowConfig.public,
|
||||
forceNew,
|
||||
forceNewWithCache,
|
||||
name,
|
||||
project,
|
||||
description,
|
||||
@@ -180,6 +190,7 @@ export default class Now extends EventEmitter {
|
||||
quiet,
|
||||
nowConfig,
|
||||
force: forceNew,
|
||||
forceNewWithCache: forceNewWithCache,
|
||||
org,
|
||||
projectName: name,
|
||||
isSettingUpProject,
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
*/node_modules
|
||||
*.log
|
||||
@@ -1,12 +1,20 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
node_modules
|
||||
|
||||
lib/core/metadata.js
|
||||
lib/core/MetadataBlog.js
|
||||
|
||||
translated_docs
|
||||
build/
|
||||
yarn.lock
|
||||
node_modules
|
||||
i18n/*
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
@@ -1,19 +1,33 @@
|
||||
# Docusauras Example
|
||||
# Website
|
||||
|
||||
This directory is a brief example of a [Docusauras](https://docusaurus.io/) site that can be deployed to ZEIT Now with zero configuration.
|
||||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
|
||||
|
||||
## How we created this example
|
||||
### Installation
|
||||
|
||||
To get started with Docusauras on Now, you can use the [Docusauras CLI](https://docusaurus.io/docs/en/installation) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ docusauras-init
|
||||
```
|
||||
$ yarn
|
||||
```
|
||||
|
||||
## Deploying this Example
|
||||
### Local Development
|
||||
|
||||
Once initialized, you can deploy the Docusauras example with just a single command:
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
$ yarn start
|
||||
```
|
||||
|
||||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
### Deployment
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: Blog Title
|
||||
author: Blog Author
|
||||
authorURL: http://twitter.com/
|
||||
authorFBID: 100002976521003
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum massa eget nulla aliquet sagittis. Proin odio tortor, vulputate ut odio in, ultrices ultricies augue. Cras ornare ultrices lorem malesuada iaculis. Etiam sit amet libero tempor, pulvinar mauris sed, sollicitudin sapien.
|
||||
|
||||
<!--truncate-->
|
||||
|
||||
Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut.
|
||||
|
||||
Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra.
|
||||
|
||||
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum.
|
||||
|
||||
Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis.
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
title: New Blog Post
|
||||
author: Blog Author
|
||||
authorURL: http://twitter.com/
|
||||
authorFBID: 100002976521003
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum massa eget nulla aliquet sagittis. Proin odio tortor, vulputate ut odio in, ultrices ultricies augue. Cras ornare ultrices lorem malesuada iaculis. Etiam sit amet libero tempor, pulvinar mauris sed, sollicitudin sapien.
|
||||
|
||||
<!--truncate-->
|
||||
|
||||
Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut.
|
||||
|
||||
Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra.
|
||||
|
||||
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum.
|
||||
|
||||
Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis.
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Adding RSS Support - RSS Truncation Test
|
||||
author: Eric Nakagawa
|
||||
authorURL: http://twitter.com/ericnakagawa
|
||||
authorFBID: 661277173
|
||||
---
|
||||
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
This should be truncated.
|
||||
<!--truncate-->
|
||||
This line should never render in XML.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: Adding RSS Support
|
||||
author: Eric Nakagawa
|
||||
authorURL: http://twitter.com/ericnakagawa
|
||||
authorFBID: 661277173
|
||||
---
|
||||
|
||||
This is a test post.
|
||||
|
||||
A whole bunch of other information.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: New Version 1.0.0
|
||||
author: Eric Nakagawa
|
||||
authorURL: http://twitter.com/ericnakagawa
|
||||
authorFBID: 661277173
|
||||
---
|
||||
|
||||
This blog post will test file name parsing issues when periods are present.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
id: hola
|
||||
title: Hola
|
||||
author: Gao Wei
|
||||
author_title: Docusaurus Core Team
|
||||
author_url: https://github.com/wgao19
|
||||
author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4
|
||||
tags: [hola, docusaurus]
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: hello-world
|
||||
title: Hello
|
||||
author: Endilie Yacop Sucipto
|
||||
author_title: Maintainer of Docusaurus
|
||||
author_url: https://github.com/endiliey
|
||||
author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
|
||||
tags: [hello, docusaurus]
|
||||
---
|
||||
|
||||
Welcome to this blog. This blog is created with [**Docusaurus 2 alpha**](https://v2.docusaurus.io/).
|
||||
|
||||
<!--truncate-->
|
||||
|
||||
This is a test post.
|
||||
|
||||
A whole bunch of other information.
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
id: welcome
|
||||
title: Welcome
|
||||
author: Yangshun Tay
|
||||
author_title: Front End Engineer @ Facebook
|
||||
author_url: https://github.com/yangshun
|
||||
author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4
|
||||
tags: [facebook, hello, docusaurus]
|
||||
---
|
||||
|
||||
Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well!
|
||||
|
||||
Delete the whole directory if you don't want the blog features. As simple as that!
|
||||
@@ -1,108 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
class Footer extends React.Component {
|
||||
docUrl(doc, language) {
|
||||
const baseUrl = this.props.config.baseUrl;
|
||||
const docsUrl = this.props.config.docsUrl;
|
||||
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
|
||||
const langPart = `${language ? `${language}/` : ''}`;
|
||||
return `${baseUrl}${docsPart}${langPart}${doc}`;
|
||||
}
|
||||
|
||||
pageUrl(doc, language) {
|
||||
const baseUrl = this.props.config.baseUrl;
|
||||
return baseUrl + (language ? `${language}/` : '') + doc;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<footer className="nav-footer" id="footer">
|
||||
<section className="sitemap">
|
||||
<a href={this.props.config.baseUrl} className="nav-home">
|
||||
{this.props.config.footerIcon && (
|
||||
<img
|
||||
src={this.props.config.baseUrl + this.props.config.footerIcon}
|
||||
alt={this.props.config.title}
|
||||
width="66"
|
||||
height="58"
|
||||
/>
|
||||
)}
|
||||
</a>
|
||||
<div>
|
||||
<h5>Docs</h5>
|
||||
<a href={this.docUrl('doc1.html', this.props.language)}>
|
||||
Getting Started (or other categories)
|
||||
</a>
|
||||
<a href={this.docUrl('doc2.html', this.props.language)}>
|
||||
Guides (or other categories)
|
||||
</a>
|
||||
<a href={this.docUrl('doc3.html', this.props.language)}>
|
||||
API Reference (or other categories)
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<h5>Community</h5>
|
||||
<a href={this.pageUrl('users.html', this.props.language)}>
|
||||
User Showcase
|
||||
</a>
|
||||
<a
|
||||
href="https://stackoverflow.com/questions/tagged/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
Stack Overflow
|
||||
</a>
|
||||
<a href="https://discordapp.com/">Project Chat</a>
|
||||
<a
|
||||
href="https://twitter.com/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<h5>More</h5>
|
||||
<a href={`${this.props.config.baseUrl}blog`}>Blog</a>
|
||||
<a href="https://github.com/">GitHub</a>
|
||||
<a
|
||||
className="github-button"
|
||||
href={this.props.config.repoUrl}
|
||||
data-icon="octicon-star"
|
||||
data-count-href="/facebook/docusaurus/stargazers"
|
||||
data-show-count="true"
|
||||
data-count-aria-label="# stargazers on GitHub"
|
||||
aria-label="Star this project on GitHub"
|
||||
>
|
||||
Star
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<a
|
||||
href="https://opensource.facebook.com/"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
className="fbOpenSource"
|
||||
>
|
||||
<img
|
||||
src={`${this.props.config.baseUrl}img/oss_logo.png`}
|
||||
alt="Facebook Open Source"
|
||||
width="170"
|
||||
height="45"
|
||||
/>
|
||||
</a>
|
||||
<section className="copyright">{this.props.config.copyright}</section>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Footer;
|
||||
@@ -1,29 +1,182 @@
|
||||
---
|
||||
id: doc1
|
||||
title: Latin-ish
|
||||
sidebar_label: Example Page
|
||||
title: Style Guide
|
||||
sidebar_label: Style Guide
|
||||
---
|
||||
|
||||
Check the [documentation](https://docusaurus.io) for how to use Docusaurus.
|
||||
You can write content using [GitHub-flavored Markdown syntax](https://github.github.com/gfm/).
|
||||
|
||||
## Lorem
|
||||
## Markdown Syntax
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum massa eget nulla aliquet sagittis. Proin odio tortor, vulputate ut odio in, ultrices ultricies augue. Cras ornare ultrices lorem malesuada iaculis. Etiam sit amet libero tempor, pulvinar mauris sed, sollicitudin sapien.
|
||||
To serve as an example page when styling markdown based Docusaurus sites.
|
||||
|
||||
## Mauris In Code
|
||||
## Headers
|
||||
|
||||
```
|
||||
Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut.
|
||||
# H1 - Create the best documentation
|
||||
|
||||
## H2 - Create the best documentation
|
||||
|
||||
### H3 - Create the best documentation
|
||||
|
||||
#### H4 - Create the best documentation
|
||||
|
||||
##### H5 - Create the best documentation
|
||||
|
||||
###### H6 - Create the best documentation
|
||||
|
||||
---
|
||||
|
||||
## Emphasis
|
||||
|
||||
Emphasis, aka italics, with _asterisks_ or _underscores_.
|
||||
|
||||
Strong emphasis, aka bold, with **asterisks** or **underscores**.
|
||||
|
||||
Combined emphasis with **asterisks and _underscores_**.
|
||||
|
||||
Strikethrough uses two tildes. ~~Scratch this.~~
|
||||
|
||||
---
|
||||
|
||||
## Lists
|
||||
|
||||
1. First ordered list item
|
||||
1. Another item ⋅⋅\* Unordered sub-list.
|
||||
1. Actual numbers don't matter, just that it's a number ⋅⋅1. Ordered sub-list
|
||||
1. And another item.
|
||||
|
||||
⋅⋅⋅You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
|
||||
|
||||
⋅⋅⋅To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅ ⋅⋅⋅Note that this line is separate, but within the same paragraph.⋅⋅ ⋅⋅⋅(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
|
||||
|
||||
- Unordered list can use asterisks
|
||||
|
||||
* Or minuses
|
||||
|
||||
- Or pluses
|
||||
|
||||
---
|
||||
|
||||
## Links
|
||||
|
||||
[I'm an inline-style link](https://www.google.com)
|
||||
|
||||
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
|
||||
|
||||
[I'm a reference-style link][arbitrary case-insensitive reference text]
|
||||
|
||||
[I'm a relative reference to a repository file](../blob/master/LICENSE)
|
||||
|
||||
[You can use numbers for reference-style link definitions][1]
|
||||
|
||||
Or leave it empty and use the [link text itself].
|
||||
|
||||
URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or <http://www.example.com> and sometimes example.com (but not on Github, for example).
|
||||
|
||||
Some text to show that the reference links can follow later.
|
||||
|
||||
[arbitrary case-insensitive reference text]: https://www.mozilla.org
|
||||
[1]: http://slashdot.org
|
||||
[link text itself]: http://www.reddit.com
|
||||
|
||||
---
|
||||
|
||||
## Images
|
||||
|
||||
Here's our logo (hover to see the title text):
|
||||
|
||||
Inline-style: 
|
||||
|
||||
Reference-style: ![alt text][logo]
|
||||
|
||||
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png 'Logo Title Text 2'
|
||||
|
||||
---
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
var s = 'JavaScript syntax highlighting';
|
||||
alert(s);
|
||||
```
|
||||
|
||||
## Nulla
|
||||
```python
|
||||
s = "Python syntax highlighting"
|
||||
print(s)
|
||||
```
|
||||
|
||||
Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra.
|
||||
```
|
||||
No language indicated, so no syntax highlighting.
|
||||
But let's throw in a <b>tag</b>.
|
||||
```
|
||||
|
||||
## Orci
|
||||
```js {2}
|
||||
function highlightMe() {
|
||||
console.log('This line can be highlighted!');
|
||||
}
|
||||
```
|
||||
|
||||
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum.
|
||||
---
|
||||
|
||||
## Phasellus
|
||||
## Tables
|
||||
|
||||
Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis.
|
||||
Colons can be used to align columns.
|
||||
|
||||
| Tables | Are | Cool |
|
||||
| ------------- | :-----------: | -----: |
|
||||
| col 3 is | right-aligned | \$1600 |
|
||||
| col 2 is | centered | \$12 |
|
||||
| zebra stripes | are neat | \$1 |
|
||||
|
||||
There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.
|
||||
|
||||
| Markdown | Less | Pretty |
|
||||
| -------- | --------- | ---------- |
|
||||
| _Still_ | `renders` | **nicely** |
|
||||
| 1 | 2 | 3 |
|
||||
|
||||
---
|
||||
|
||||
## Blockquotes
|
||||
|
||||
> Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.
|
||||
|
||||
Quote break.
|
||||
|
||||
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can _put_ **Markdown** into a blockquote.
|
||||
|
||||
---
|
||||
|
||||
## Inline HTML
|
||||
|
||||
<dl>
|
||||
<dt>Definition list</dt>
|
||||
<dd>Is something people use sometimes.</dd>
|
||||
|
||||
<dt>Markdown in HTML</dt>
|
||||
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
|
||||
</dl>
|
||||
|
||||
---
|
||||
|
||||
## Line Breaks
|
||||
|
||||
Here's a line for us to start with.
|
||||
|
||||
This line is separated from the one above by two newlines, so it will be a _separate paragraph_.
|
||||
|
||||
This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the _same paragraph_.
|
||||
|
||||
---
|
||||
|
||||
## Admonitions
|
||||
|
||||
:::note This is a note :::
|
||||
|
||||
:::tip This is a tip :::
|
||||
|
||||
:::important This is important :::
|
||||
|
||||
:::caution This is a caution :::
|
||||
|
||||
:::warning This is a warning :::
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
id: doc2
|
||||
title: document number 2
|
||||
title: Document Number 2
|
||||
---
|
||||
|
||||
This is a link to [another document.](doc3.md)
|
||||
This is a link to an [external page.](http://www.example.com)
|
||||
This is a link to [another document.](doc3.md) This is a link to an [external page.](http://www.example.com)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
id: doc3
|
||||
title: This is document number 3
|
||||
title: This is Document Number 3
|
||||
---
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
|
||||
Duis et egestas libero, imperdiet faucibus ipsum. Sed posuere eget urna vel feugiat. Vivamus a arcu sagittis, fermentum urna dapibus, congue lectus. Fusce vulputate porttitor nisl, ac cursus elit volutpat vitae. Nullam vitae ipsum egestas, convallis quam non, porta nibh. Morbi gravida erat nec neque bibendum, eu pellentesque velit posuere. Fusce aliquam erat eu massa eleifend tristique.
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
id: doc4
|
||||
title: Other Document
|
||||
---
|
||||
|
||||
this is another document
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
id: doc5
|
||||
title: Fifth Document
|
||||
---
|
||||
|
||||
Another one
|
||||
17
packages/now-cli/test/dev/fixtures/23-docusaurus/docs/mdx.md
Normal file
17
packages/now-cli/test/dev/fixtures/23-docusaurus/docs/mdx.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: mdx
|
||||
title: Powered by MDX
|
||||
---
|
||||
|
||||
You can write JSX and use React components within your Markdown thanks to [MDX](https://mdxjs.com/).
|
||||
|
||||
export const Highlight = ({children, color}) => ( <span style={{
|
||||
backgroundColor: color,
|
||||
borderRadius: '2px',
|
||||
color: '#fff',
|
||||
padding: '0.2rem',
|
||||
}}> {children} </span> );
|
||||
|
||||
<Highlight color="#25c2a0">Docusaurus green</Highlight> and <Highlight color="#1877F2">Facebook blue</Highlight> are my favorite colors.
|
||||
|
||||
I can write **Markdown** alongside my _JSX_!
|
||||
@@ -0,0 +1,96 @@
|
||||
module.exports = {
|
||||
title: 'My Site',
|
||||
tagline: 'The tagline of my site',
|
||||
url: 'https://your-docusaurus-test-site.com',
|
||||
baseUrl: '/',
|
||||
favicon: 'img/favicon.ico',
|
||||
organizationName: 'facebook', // Usually your GitHub org/user name.
|
||||
projectName: 'docusaurus', // Usually your repo name.
|
||||
themeConfig: {
|
||||
navbar: {
|
||||
title: 'My Site',
|
||||
logo: {
|
||||
alt: 'My Site Logo',
|
||||
src: 'img/logo.svg',
|
||||
},
|
||||
links: [
|
||||
{
|
||||
to: 'docs/doc1',
|
||||
activeBasePath: 'docs',
|
||||
label: 'Docs',
|
||||
position: 'left',
|
||||
},
|
||||
{ to: 'blog', label: 'Blog', position: 'left' },
|
||||
{
|
||||
href: 'https://github.com/facebook/docusaurus',
|
||||
label: 'GitHub',
|
||||
position: 'right',
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
style: 'dark',
|
||||
links: [
|
||||
{
|
||||
title: 'Docs',
|
||||
items: [
|
||||
{
|
||||
label: 'Style Guide',
|
||||
to: 'docs/doc1',
|
||||
},
|
||||
{
|
||||
label: 'Second Doc',
|
||||
to: 'docs/doc2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
items: [
|
||||
{
|
||||
label: 'Stack Overflow',
|
||||
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
||||
},
|
||||
{
|
||||
label: 'Discord',
|
||||
href: 'https://discordapp.com/invite/docusaurus',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Social',
|
||||
items: [
|
||||
{
|
||||
label: 'Blog',
|
||||
to: 'blog',
|
||||
},
|
||||
{
|
||||
label: 'GitHub',
|
||||
href: 'https://github.com/facebook/docusaurus',
|
||||
},
|
||||
{
|
||||
label: 'Twitter',
|
||||
href: 'https://twitter.com/docusaurus',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
[
|
||||
'@docusaurus/preset-classic',
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve('./sidebars.js'),
|
||||
editUrl:
|
||||
'https://github.com/facebook/docusaurus/edit/master/website/',
|
||||
},
|
||||
theme: {
|
||||
customCss: require.resolve('./src/css/custom.css'),
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
@@ -1,14 +1,30 @@
|
||||
{
|
||||
"name": "23-docusaurus",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"examples": "docusaurus-examples",
|
||||
"start": "docusaurus-start",
|
||||
"build": "docusaurus-build",
|
||||
"publish-gh-pages": "docusaurus-publish",
|
||||
"write-translations": "docusaurus-write-translations",
|
||||
"version": "docusaurus-version",
|
||||
"rename-version": "docusaurus-rename-version"
|
||||
"start": "docusaurus start",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy"
|
||||
},
|
||||
"devDependencies": {
|
||||
"docusaurus": "^1.11.1"
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.0-alpha.48",
|
||||
"@docusaurus/preset-classic": "2.0.0-alpha.48",
|
||||
"classnames": "2.2.6",
|
||||
"react": "16.8.4",
|
||||
"react-dom": "16.8.4"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
function Help(props) {
|
||||
const {config: siteConfig, language = ''} = props;
|
||||
const {baseUrl, docsUrl} = siteConfig;
|
||||
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
|
||||
const langPart = `${language ? `${language}/` : ''}`;
|
||||
const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`;
|
||||
|
||||
const supportLinks = [
|
||||
{
|
||||
content: `Learn more using the [documentation on this site.](${docUrl(
|
||||
'doc1.html',
|
||||
)})`,
|
||||
title: 'Browse Docs',
|
||||
},
|
||||
{
|
||||
content: 'Ask questions about the documentation and project',
|
||||
title: 'Join the community',
|
||||
},
|
||||
{
|
||||
content: "Find out what's new with this project",
|
||||
title: 'Stay up to date',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="docMainWrapper wrapper">
|
||||
<Container className="mainContainer documentContainer postContainer">
|
||||
<div className="post">
|
||||
<header className="postHeader">
|
||||
<h1>Need help?</h1>
|
||||
</header>
|
||||
<p>This project is maintained by a dedicated group of people.</p>
|
||||
<GridBlock contents={supportLinks} layout="threeColumn" />
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = Help;
|
||||
@@ -1,212 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
class HomeSplash extends React.Component {
|
||||
render() {
|
||||
const {siteConfig, language = ''} = this.props;
|
||||
const {baseUrl, docsUrl} = siteConfig;
|
||||
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
|
||||
const langPart = `${language ? `${language}/` : ''}`;
|
||||
const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`;
|
||||
|
||||
const SplashContainer = props => (
|
||||
<div className="homeContainer">
|
||||
<div className="homeSplashFade">
|
||||
<div className="wrapper homeWrapper">{props.children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const Logo = props => (
|
||||
<div className="projectLogo">
|
||||
<img src={props.img_src} alt="Project Logo" />
|
||||
</div>
|
||||
);
|
||||
|
||||
const ProjectTitle = () => (
|
||||
<h2 className="projectTitle">
|
||||
{siteConfig.title}
|
||||
<small>{siteConfig.tagline}</small>
|
||||
</h2>
|
||||
);
|
||||
|
||||
const PromoSection = props => (
|
||||
<div className="section promoSection">
|
||||
<div className="promoRow">
|
||||
<div className="pluginRowBlock">{props.children}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const Button = props => (
|
||||
<div className="pluginWrapper buttonWrapper">
|
||||
<a className="button" href={props.href} target={props.target}>
|
||||
{props.children}
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<SplashContainer>
|
||||
<Logo img_src={`${baseUrl}img/undraw_monitor.svg`} />
|
||||
<div className="inner">
|
||||
<ProjectTitle siteConfig={siteConfig} />
|
||||
<PromoSection>
|
||||
<Button href="#try">Try It Out</Button>
|
||||
<Button href={docUrl('doc1.html')}>Example Link</Button>
|
||||
<Button href={docUrl('doc2.html')}>Example Link 2</Button>
|
||||
</PromoSection>
|
||||
</div>
|
||||
</SplashContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Index extends React.Component {
|
||||
render() {
|
||||
const {config: siteConfig, language = ''} = this.props;
|
||||
const {baseUrl} = siteConfig;
|
||||
|
||||
const Block = props => (
|
||||
<Container
|
||||
padding={['bottom', 'top']}
|
||||
id={props.id}
|
||||
background={props.background}>
|
||||
<GridBlock
|
||||
align="center"
|
||||
contents={props.children}
|
||||
layout={props.layout}
|
||||
/>
|
||||
</Container>
|
||||
);
|
||||
|
||||
const FeatureCallout = () => (
|
||||
<div
|
||||
className="productShowcaseSection paddingBottom"
|
||||
style={{textAlign: 'center'}}>
|
||||
<h2>Feature Callout</h2>
|
||||
<MarkdownBlock>These are features of this project</MarkdownBlock>
|
||||
</div>
|
||||
);
|
||||
|
||||
const TryOut = () => (
|
||||
<Block id="try">
|
||||
{[
|
||||
{
|
||||
content:
|
||||
'To make your landing page more attractive, use illustrations! Check out ' +
|
||||
'[**unDraw**](https://undraw.co/) which provides you with customizable illustrations which are free to use. ' +
|
||||
'The illustrations you see on this page are from unDraw.',
|
||||
image: `${baseUrl}img/undraw_code_review.svg`,
|
||||
imageAlign: 'left',
|
||||
title: 'Wonderful SVG Illustrations',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Description = () => (
|
||||
<Block background="dark">
|
||||
{[
|
||||
{
|
||||
content:
|
||||
'This is another description of how this project is useful',
|
||||
image: `${baseUrl}img/undraw_note_list.svg`,
|
||||
imageAlign: 'right',
|
||||
title: 'Description',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const LearnHow = () => (
|
||||
<Block background="light">
|
||||
{[
|
||||
{
|
||||
content:
|
||||
'Each new Docusaurus project has **randomly-generated** theme colors.',
|
||||
image: `${baseUrl}img/undraw_youtube_tutorial.svg`,
|
||||
imageAlign: 'right',
|
||||
title: 'Randomly Generated Theme Colors',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Features = () => (
|
||||
<Block layout="fourColumn">
|
||||
{[
|
||||
{
|
||||
content: 'This is the content of my feature',
|
||||
image: `${baseUrl}img/undraw_react.svg`,
|
||||
imageAlign: 'top',
|
||||
title: 'Feature One',
|
||||
},
|
||||
{
|
||||
content: 'The content of my second feature',
|
||||
image: `${baseUrl}img/undraw_operating_system.svg`,
|
||||
imageAlign: 'top',
|
||||
title: 'Feature Two',
|
||||
},
|
||||
]}
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Showcase = () => {
|
||||
if ((siteConfig.users || []).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const showcase = siteConfig.users
|
||||
.filter(user => user.pinned)
|
||||
.map(user => (
|
||||
<a href={user.infoLink} key={user.infoLink}>
|
||||
<img src={user.image} alt={user.caption} title={user.caption} />
|
||||
</a>
|
||||
));
|
||||
|
||||
const pageUrl = page => baseUrl + (language ? `${language}/` : '') + page;
|
||||
|
||||
return (
|
||||
<div className="productShowcaseSection paddingBottom">
|
||||
<h2>Who is Using This?</h2>
|
||||
<p>This project is used by all these people</p>
|
||||
<div className="logos">{showcase}</div>
|
||||
<div className="more-users">
|
||||
<a className="button" href={pageUrl('users.html')}>
|
||||
More {siteConfig.title} Users
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HomeSplash siteConfig={siteConfig} language={language} />
|
||||
<div className="mainContainer">
|
||||
<Features />
|
||||
<FeatureCallout />
|
||||
<LearnHow />
|
||||
<TryOut />
|
||||
<Description />
|
||||
<Showcase />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Index;
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary.js');
|
||||
|
||||
const Container = CompLibrary.Container;
|
||||
|
||||
class Users extends React.Component {
|
||||
render() {
|
||||
const {config: siteConfig} = this.props;
|
||||
if ((siteConfig.users || []).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const editUrl = `${siteConfig.repoUrl}/edit/master/website/siteConfig.js`;
|
||||
const showcase = siteConfig.users.map(user => (
|
||||
<a href={user.infoLink} key={user.infoLink}>
|
||||
<img src={user.image} alt={user.caption} title={user.caption} />
|
||||
</a>
|
||||
));
|
||||
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<Container padding={['bottom', 'top']}>
|
||||
<div className="showcaseSection">
|
||||
<div className="prose">
|
||||
<h1>Who is Using This?</h1>
|
||||
<p>This project is used by many folks</p>
|
||||
</div>
|
||||
<div className="logos">{showcase}</div>
|
||||
<p>Are you using this project?</p>
|
||||
<a href={editUrl} className="button">
|
||||
Add your company
|
||||
</a>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Users;
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
someSidebar: {
|
||||
Docusaurus: ['doc1', 'doc2', 'doc3'],
|
||||
Features: ['mdx'],
|
||||
},
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"docs": {
|
||||
"Docusaurus": ["doc1"],
|
||||
"First Category": ["doc2"],
|
||||
"Second Category": ["doc3"]
|
||||
},
|
||||
"docs-other": {
|
||||
"First Category": ["doc4", "doc5"]
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// See https://docusaurus.io/docs/site-config for all the possible
|
||||
// site configuration options.
|
||||
const path = require('path');
|
||||
|
||||
// List of projects/orgs using your project for the users page.
|
||||
const users = [
|
||||
{
|
||||
caption: 'User1',
|
||||
// You will need to prepend the image path with your baseUrl
|
||||
// if it is not '/', like: '/test-site/img/image.jpg'.
|
||||
image: '/img/undraw_open_source.svg',
|
||||
infoLink: 'https://www.facebook.com',
|
||||
pinned: true,
|
||||
},
|
||||
];
|
||||
|
||||
const siteConfig = {
|
||||
// We need to keep the docs folder in the same folder
|
||||
// as the package.json file for now
|
||||
customDocsPath: path.basename(__dirname) + '/docs',
|
||||
|
||||
title: 'Test Site', // Title for your website.
|
||||
tagline: 'A website for testing',
|
||||
url: 'https://your-docusaurus-test-site.com', // Your website URL
|
||||
baseUrl: '/', // Base URL for your project */
|
||||
// For github.io type URLs, you would set the url and baseUrl like:
|
||||
// url: 'https://facebook.github.io',
|
||||
// baseUrl: '/test-site/',
|
||||
|
||||
// Used for publishing and more
|
||||
projectName: 'test-site',
|
||||
organizationName: 'facebook',
|
||||
// For top-level user or org sites, the organization is still the same.
|
||||
// e.g., for the https://JoelMarcey.github.io site, it would be set like...
|
||||
// organizationName: 'JoelMarcey'
|
||||
|
||||
// For no header links in the top nav bar -> headerLinks: [],
|
||||
headerLinks: [
|
||||
{doc: 'doc1', label: 'Docs'},
|
||||
{doc: 'doc4', label: 'API'},
|
||||
{page: 'help', label: 'Help'},
|
||||
{blog: true, label: 'Blog'},
|
||||
],
|
||||
|
||||
// If you have users set above, you add it here:
|
||||
users,
|
||||
|
||||
/* path to images for header/footer */
|
||||
headerIcon: 'img/favicon.ico',
|
||||
footerIcon: 'img/favicon.ico',
|
||||
favicon: 'img/favicon.ico',
|
||||
|
||||
/* Colors for website */
|
||||
colors: {
|
||||
primaryColor: '#03453a',
|
||||
secondaryColor: '#023028',
|
||||
},
|
||||
|
||||
/* Custom fonts for website */
|
||||
/*
|
||||
fonts: {
|
||||
myFont: [
|
||||
"Times New Roman",
|
||||
"Serif"
|
||||
],
|
||||
myOtherFont: [
|
||||
"-apple-system",
|
||||
"system-ui"
|
||||
]
|
||||
},
|
||||
*/
|
||||
|
||||
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
|
||||
copyright: `Copyright © ${new Date().getFullYear()} Your Name or Your Company Name`,
|
||||
|
||||
highlight: {
|
||||
// Highlight.js theme to use for syntax highlighting in code blocks.
|
||||
theme: 'default',
|
||||
},
|
||||
|
||||
// Add custom scripts here that would be placed in <script> tags.
|
||||
scripts: ['https://buttons.github.io/buttons.js'],
|
||||
|
||||
// On page navigation for the current documentation page.
|
||||
onPageNav: 'separate',
|
||||
// No .html extensions for paths.
|
||||
cleanUrl: true,
|
||||
|
||||
// Open Graph and Twitter card images.
|
||||
ogImage: 'img/undraw_online.svg',
|
||||
twitterImage: 'img/undraw_tweetstorm.svg',
|
||||
|
||||
// Show documentation's last contributor's name.
|
||||
// enableUpdateBy: true,
|
||||
|
||||
// Show documentation's last update time.
|
||||
// enableUpdateTime: true,
|
||||
|
||||
// You may provide arbitrary config keys to be used as needed by your
|
||||
// template. For example, if you need your repo's URL...
|
||||
// repoUrl: 'https://github.com/facebook/test-site',
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
||||
@@ -0,0 +1,25 @@
|
||||
/* stylelint-disable docusaurus/copyright-header */
|
||||
/**
|
||||
* Any CSS included here will be global. The classic template
|
||||
* bundles Infima by default. Infima is a CSS framework designed to
|
||||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
:root {
|
||||
--ifm-color-primary: #25c2a0;
|
||||
--ifm-color-primary-dark: rgb(33, 175, 144);
|
||||
--ifm-color-primary-darker: rgb(31, 165, 136);
|
||||
--ifm-color-primary-darkest: rgb(26, 136, 112);
|
||||
--ifm-color-primary-light: rgb(70, 203, 174);
|
||||
--ifm-color-primary-lighter: rgb(102, 212, 189);
|
||||
--ifm-color-primary-lightest: rgb(146, 224, 208);
|
||||
--ifm-code-font-size: 95%;
|
||||
}
|
||||
|
||||
.docusaurus-highlight-code-line {
|
||||
background-color: rgb(72, 77, 91);
|
||||
display: block;
|
||||
margin: 0 calc(-1 * var(--ifm-pre-padding));
|
||||
padding: 0 var(--ifm-pre-padding);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Layout from '@theme/Layout';
|
||||
import Link from '@docusaurus/Link';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const features = [
|
||||
{
|
||||
title: <>Easy to Use</>,
|
||||
imageUrl: 'img/undraw_docusaurus_mountain.svg',
|
||||
description: (
|
||||
<>
|
||||
Docusaurus was designed from the ground up to be easily installed and
|
||||
used to get your website up and running quickly.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: <>Focus on What Matters</>,
|
||||
imageUrl: 'img/undraw_docusaurus_tree.svg',
|
||||
description: (
|
||||
<>
|
||||
Docusaurus lets you focus on your docs, and we'll do the chores. Go
|
||||
ahead and move your docs into the <code>docs</code> directory.
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: <>Powered by React</>,
|
||||
imageUrl: 'img/undraw_docusaurus_react.svg',
|
||||
description: (
|
||||
<>
|
||||
Extend or customize your website layout by reusing React. Docusaurus can
|
||||
be extended while reusing the same header and footer.
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
function Feature({ imageUrl, title, description }) {
|
||||
const imgUrl = useBaseUrl(imageUrl);
|
||||
return (
|
||||
<div className={classnames('col col--4', styles.feature)}>
|
||||
{imgUrl && (
|
||||
<div className="text--center">
|
||||
<img className={styles.featureImage} src={imgUrl} alt={title} />
|
||||
</div>
|
||||
)}
|
||||
<h3>{title}</h3>
|
||||
<p>{description}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Home() {
|
||||
const context = useDocusaurusContext();
|
||||
const { siteConfig = {} } = context;
|
||||
return (
|
||||
<Layout
|
||||
title={`Hello from ${siteConfig.title}`}
|
||||
description="Description will go into a meta tag in <head />"
|
||||
>
|
||||
<header className={classnames('hero hero--primary', styles.heroBanner)}>
|
||||
<div className="container">
|
||||
<h1 className="hero__title">{siteConfig.title}</h1>
|
||||
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
||||
<div className={styles.buttons}>
|
||||
<Link
|
||||
className={classnames(
|
||||
'button button--outline button--secondary button--lg',
|
||||
styles.getStarted
|
||||
)}
|
||||
to={useBaseUrl('docs/doc1')}
|
||||
>
|
||||
Get Started
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
{features && features.length && (
|
||||
<section className={styles.features}>
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
{features.map((props, idx) => (
|
||||
<Feature key={idx} {...props} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
</main>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Home;
|
||||
@@ -0,0 +1,36 @@
|
||||
/* stylelint-disable docusaurus/copyright-header */
|
||||
/**
|
||||
* CSS files with the .module.css suffix will be treated as CSS modules
|
||||
* and scoped locally.
|
||||
*/
|
||||
|
||||
.heroBanner {
|
||||
padding: 4rem 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 966px) {
|
||||
.heroBanner {
|
||||
padding: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.features {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 2rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.featureImage {
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/* your custom css */
|
||||
|
||||
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1023px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1400px) {
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1500px) {
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 17 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user