mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-24 11:49:13 +00:00
Compare commits
275 Commits
@now/node@
...
@now/next@
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfb7c9e632 | ||
|
|
06e8472cf7 | ||
|
|
92404135d8 | ||
|
|
8b5cc23d7c | ||
|
|
e10b42bfdc | ||
|
|
36f7ec4836 | ||
|
|
f89d1c463e | ||
|
|
5dc652eba9 | ||
|
|
821b2bd50b | ||
|
|
8d5f6f1fa3 | ||
|
|
617f610c07 | ||
|
|
3229ba0106 | ||
|
|
d16a6e4716 | ||
|
|
4e5156fb0b | ||
|
|
3c013cc36b | ||
|
|
1ed83135be | ||
|
|
0e71ff2df1 | ||
|
|
d8e98ee476 | ||
|
|
1bc1e8a9b1 | ||
|
|
274fdeb49a | ||
|
|
d15c90b42f | ||
|
|
5be2917c47 | ||
|
|
5f08b24546 | ||
|
|
cc3026ffcb | ||
|
|
8cb6e56679 | ||
|
|
7da5ff4b1d | ||
|
|
5d1069d464 | ||
|
|
6e1a72f557 | ||
|
|
6f97a2cc7a | ||
|
|
6e402bffc3 | ||
|
|
e41d0f8e68 | ||
|
|
1a046744f2 | ||
|
|
a9bf011f2c | ||
|
|
60c76b3290 | ||
|
|
c7ff1e7044 | ||
|
|
e2deaef54a | ||
|
|
b2c7386c83 | ||
|
|
3dce84c3cf | ||
|
|
443b1ac158 | ||
|
|
be3dca3d94 | ||
|
|
cb135e4329 | ||
|
|
55c73b68bb | ||
|
|
eb793ba139 | ||
|
|
00908e8ebe | ||
|
|
5ce7ff86a4 | ||
|
|
4b34ee2993 | ||
|
|
646bd288ba | ||
|
|
8aba6f1ff8 | ||
|
|
35e5e328aa | ||
|
|
bdd4953d62 | ||
|
|
e938b298e2 | ||
|
|
b67f324e10 | ||
|
|
1dfa286af5 | ||
|
|
d4391bd4cc | ||
|
|
53eb71f26d | ||
|
|
92ffd654b5 | ||
|
|
36b83f1606 | ||
|
|
7a79f620c0 | ||
|
|
f3b286ecf3 | ||
|
|
adf31c3fcc | ||
|
|
deacdfc47c | ||
|
|
ac9badbe9e | ||
|
|
62beb0f78d | ||
|
|
5f9777f4af | ||
|
|
e00db4437a | ||
|
|
b0e4f2590d | ||
|
|
f0d58eac8c | ||
|
|
dae830d2b6 | ||
|
|
e3071e4e29 | ||
|
|
073d7ece23 | ||
|
|
071258ba33 | ||
|
|
c0e00dc69a | ||
|
|
6e5c136337 | ||
|
|
60428cd4cf | ||
|
|
c6b9d80eec | ||
|
|
953bdc10e5 | ||
|
|
becdbd2136 | ||
|
|
da9bb31259 | ||
|
|
8cbf036921 | ||
|
|
8f66e4a308 | ||
|
|
9627b612f2 | ||
|
|
8a9ded6d61 | ||
|
|
d89c772bd5 | ||
|
|
32137586b9 | ||
|
|
9a3e435175 | ||
|
|
01d5a10ebd | ||
|
|
040658fbfa | ||
|
|
51c00286a4 | ||
|
|
c3e274fc2f | ||
|
|
fe633c528a | ||
|
|
5e306d49f8 | ||
|
|
274259b7dd | ||
|
|
230e96c687 | ||
|
|
8c0c6e546d | ||
|
|
5e8541b936 | ||
|
|
300558f24e | ||
|
|
829f7d8aeb | ||
|
|
340f7db68a | ||
|
|
2fe987b5da | ||
|
|
5b3aa48cd6 | ||
|
|
080d96bfa1 | ||
|
|
7d9bf682b4 | ||
|
|
a913a4f59f | ||
|
|
2042c96d98 | ||
|
|
4ca0ff8426 | ||
|
|
554cc42d83 | ||
|
|
3f9e30d031 | ||
|
|
5a9ca8644c | ||
|
|
3f362d4b50 | ||
|
|
7360886c9a | ||
|
|
5b8a1b47b0 | ||
|
|
0506b262d2 | ||
|
|
17c4569f41 | ||
|
|
888ff83309 | ||
|
|
7191421470 | ||
|
|
e9c9aa5ce1 | ||
|
|
d98f3d8140 | ||
|
|
fbf659e4e1 | ||
|
|
6f7069aadd | ||
|
|
cef2c889f6 | ||
|
|
e42d6c422a | ||
|
|
2e9241b454 | ||
|
|
257a3b07fc | ||
|
|
df9322b392 | ||
|
|
28b5476bf3 | ||
|
|
70a61f045f | ||
|
|
238a8a8593 | ||
|
|
6f2d5c0045 | ||
|
|
fc798da398 | ||
|
|
0804483316 | ||
|
|
4a087f842e | ||
|
|
01c7bf0059 | ||
|
|
6c439516db | ||
|
|
0db4ee69ef | ||
|
|
aec8a7ac9a | ||
|
|
882bc8cb99 | ||
|
|
9aad701dfd | ||
|
|
f224f574be | ||
|
|
e201eaa315 | ||
|
|
b0ed1f2be0 | ||
|
|
4ac33e1c03 | ||
|
|
27ca517666 | ||
|
|
734e9c072d | ||
|
|
8db54f3093 | ||
|
|
886c0718d6 | ||
|
|
e160a2f21f | ||
|
|
e09a418423 | ||
|
|
52d4464368 | ||
|
|
4dc635e5f2 | ||
|
|
510fb7ee7e | ||
|
|
243451e94b | ||
|
|
11bbda977d | ||
|
|
62c050f394 | ||
|
|
bd5a013312 | ||
|
|
1823cf452e | ||
|
|
c426d72ccf | ||
|
|
ddf59c052d | ||
|
|
1dcf6e7fb1 | ||
|
|
d4f4792988 | ||
|
|
7e1f2bd10e | ||
|
|
a80a1d0c1d | ||
|
|
8ff747b4d7 | ||
|
|
aa63b5a581 | ||
|
|
2094ec3c99 | ||
|
|
bf30d10211 | ||
|
|
ccc03c9c6e | ||
|
|
4b7367e2dc | ||
|
|
00aa56a095 | ||
|
|
56ae93a2a5 | ||
|
|
adb32a09d3 | ||
|
|
3358d8e44c | ||
|
|
c3bd2698e8 | ||
|
|
a7baa4761d | ||
|
|
5dd2daa970 | ||
|
|
dd36a489ed | ||
|
|
2e742209e3 | ||
|
|
8d13464cba | ||
|
|
20fdcfa0af | ||
|
|
fac004f83c | ||
|
|
5fee4bbad1 | ||
|
|
18e4b18839 | ||
|
|
b8627fd384 | ||
|
|
4e2db6f8a5 | ||
|
|
b685a3afdd | ||
|
|
aea3f58970 | ||
|
|
b0bb90dc11 | ||
|
|
2132c2463f | ||
|
|
60bf6e2420 | ||
|
|
9badc9048c | ||
|
|
a74c1921f8 | ||
|
|
e6044f2e8d | ||
|
|
78d1afa25e | ||
|
|
4792adf524 | ||
|
|
4d8a99141b | ||
|
|
7954ddc1d0 | ||
|
|
216a1fd9d2 | ||
|
|
e5add6750c | ||
|
|
b7533650e1 | ||
|
|
6272f5ce5c | ||
|
|
bde0538efe | ||
|
|
5e6775fca0 | ||
|
|
e05e0dc40e | ||
|
|
96dbc6d348 | ||
|
|
0a63bd47e8 | ||
|
|
35dd50eb61 | ||
|
|
f70ed94c8c | ||
|
|
fb0c8600a2 | ||
|
|
5023bdd25d | ||
|
|
bf4917ccf2 | ||
|
|
64aff3aef4 | ||
|
|
62b87d1ed1 | ||
|
|
5872114c87 | ||
|
|
ce04246051 | ||
|
|
02b03d4533 | ||
|
|
ea396a2c20 | ||
|
|
8c083acf78 | ||
|
|
4edc1ff2ca | ||
|
|
ce76dc980d | ||
|
|
fc4cb9a044 | ||
|
|
a83eb5e729 | ||
|
|
1ab6af86c8 | ||
|
|
b95d2bdcdc | ||
|
|
29222fda9d | ||
|
|
13b22b38fd | ||
|
|
9f9d5546ef | ||
|
|
22d93baf20 | ||
|
|
a63ea8c884 | ||
|
|
41023c488e | ||
|
|
ebffc8af43 | ||
|
|
e7cb9fc5e2 | ||
|
|
bf92ffc1a7 | ||
|
|
4f88089cfe | ||
|
|
c0416189eb | ||
|
|
e2105cec87 | ||
|
|
6cb89c3cab | ||
|
|
9a1877de56 | ||
|
|
ea36b9e11c | ||
|
|
478104cf99 | ||
|
|
c1dd0cfaba | ||
|
|
15ce92b9e7 | ||
|
|
dd1b5f3421 | ||
|
|
b8a11be1a5 | ||
|
|
1e308dc6ce | ||
|
|
117ce28ddc | ||
|
|
85296de51d | ||
|
|
0b659326d9 | ||
|
|
f35f244deb | ||
|
|
9ee86df69d | ||
|
|
daa5cbdd4b | ||
|
|
17b7a7bea9 | ||
|
|
bcbe0d8060 | ||
|
|
3fdea52ff9 | ||
|
|
3cd5a87e20 | ||
|
|
4625f66ebd | ||
|
|
0c6c6677a7 | ||
|
|
2db627b79d | ||
|
|
7064f4ee40 | ||
|
|
bf06e9c63c | ||
|
|
c65336e63b | ||
|
|
ac72e944a7 | ||
|
|
fdb74b7971 | ||
|
|
b7eca1d069 | ||
|
|
4930028674 | ||
|
|
14a82717f1 | ||
|
|
9a31d49bc9 | ||
|
|
f8ddda9a4a | ||
|
|
9d0b0c6e41 | ||
|
|
7e584be2cd | ||
|
|
4dd640636c | ||
|
|
0a3ed02a33 | ||
|
|
97792dbad0 | ||
|
|
25ab63c969 | ||
|
|
6e06b13bf3 | ||
|
|
6cf5892e27 | ||
|
|
f65b7ec546 |
@@ -1,501 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
install:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
GOPATH: $HOME/go
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "yarn.lock" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v1-dependencies-
|
||||
- run:
|
||||
name: Updating apt packages
|
||||
command: sudo apt-get update
|
||||
- run:
|
||||
name: Installing the latest version of Go
|
||||
command: sudo apt-get install golang-go
|
||||
- run:
|
||||
name: Installing Dependencies
|
||||
command: yarn install --check-files --frozen-lockfile
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
- packages/gatsby-plugin-now/node_modules
|
||||
- packages/now-build-utils/node_modules
|
||||
- packages/now-cgi/node_modules
|
||||
- packages/now-cli/node_modules
|
||||
- packages/now-client/node_modules
|
||||
- packages/now-go/node_modules
|
||||
- packages/now-next/node_modules
|
||||
- packages/now-node/node_modules
|
||||
- packages/now-node-bridge/node_modules
|
||||
- packages/now-python/node_modules
|
||||
- packages/now-routing-utils/node_modules
|
||||
- packages/now-ruby/node_modules
|
||||
- packages/now-static-build/node_modules
|
||||
key: v1-dependencies-{{ checksum "yarn.lock" }}
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- node_modules
|
||||
- packages/gatsby-plugin-now/node_modules
|
||||
- packages/now-build-utils/node_modules
|
||||
- packages/now-cgi/node_modules
|
||||
- packages/now-cli/node_modules
|
||||
- packages/now-client/node_modules
|
||||
- packages/now-go/node_modules
|
||||
- packages/now-next/node_modules
|
||||
- packages/now-node/node_modules
|
||||
- packages/now-node-bridge/node_modules
|
||||
- packages/now-python/node_modules
|
||||
- packages/now-routing-utils/node_modules
|
||||
- packages/now-ruby/node_modules
|
||||
- packages/now-static-build/node_modules
|
||||
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Linking dependencies
|
||||
command: yarn bootstrap
|
||||
- run:
|
||||
name: Building
|
||||
command: yarn build
|
||||
- store_artifacts:
|
||||
path: packages/now-cli/dist
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- packages/gatsby-plugin-now/test/fixtures
|
||||
- packages/now-build-utils/dist
|
||||
- packages/now-cgi/dist
|
||||
- packages/now-cli/dist
|
||||
- packages/now-cli/assets
|
||||
- packages/now-client/dist
|
||||
- packages/now-go/dist
|
||||
- packages/now-next/dist
|
||||
- packages/now-node/dist
|
||||
- packages/now-node/test/fixtures/15-helpers/ts/types.d.ts
|
||||
- packages/now-node/test/fixtures/11-symlinks/symlink
|
||||
- packages/now-node-bridge/index.js
|
||||
- packages/now-node-bridge/bridge.js
|
||||
- packages/now-python/dist
|
||||
- packages/now-routing-utils/dist
|
||||
- packages/now-ruby/dist
|
||||
- packages/now-static-build/dist
|
||||
- packages/now-static-build/test/fixtures/10a-gatsby-redirects/plugins
|
||||
|
||||
test-lint:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Compiling `now dev` HTML error templates
|
||||
command: node packages/now-cli/scripts/compile-templates.js
|
||||
- run:
|
||||
name: Linting Code
|
||||
command: yarn test-lint
|
||||
|
||||
test-integration-macos-node-8:
|
||||
macos:
|
||||
xcode: '9.0.1'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-macos-node-10:
|
||||
macos:
|
||||
xcode: '10.0.0'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-macos-node-12:
|
||||
macos:
|
||||
xcode: '10.3.0'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-linux-node-8:
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-linux-node-10:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-linux-node-12:
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests
|
||||
command: yarn test-integration --clean false
|
||||
|
||||
test-integration-macos-now-dev-node-8:
|
||||
macos:
|
||||
xcode: '9.0.1'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: 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:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-macos-now-dev-node-10:
|
||||
macos:
|
||||
xcode: '10.0.0'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: 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:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-macos-now-dev-node-12:
|
||||
macos:
|
||||
xcode: '10.3.0'
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: 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:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-linux-now-dev-node-8:
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-linux-now-dev-node-10:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-linux-now-dev-node-12:
|
||||
docker:
|
||||
- image: circleci/node:12
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Downloading Hugo
|
||||
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||
- run:
|
||||
name: Running Integration Tests for `now dev`
|
||||
command: yarn test-integration-now-dev --clean false
|
||||
|
||||
test-integration-once:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Integration Tests Once
|
||||
command: yarn test-integration-once --clean false
|
||||
|
||||
test-unit:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Compiling `now dev` HTML error templates
|
||||
command: node packages/now-cli/scripts/compile-templates.js
|
||||
- run:
|
||||
name: Output version
|
||||
command: node --version
|
||||
- run:
|
||||
name: Running Unit Tests
|
||||
command: yarn test-unit --clean false
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths:
|
||||
- packages/now-cli/.nyc_output
|
||||
|
||||
coverage:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Run coverage report
|
||||
command: yarn workspace now run coverage
|
||||
|
||||
source-maps:
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
working_directory: ~/repo
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Installing Sentry CLI
|
||||
command: npm install -g @sentry/cli
|
||||
- run:
|
||||
name: Creating a New Sentry Release
|
||||
command: sentry-cli releases new now-cli@`git describe --tags`
|
||||
- run:
|
||||
name: Upload Sourcemap Files
|
||||
command: sentry-cli releases files now-cli@`git describe --tags` upload-sourcemaps ./dist
|
||||
- run:
|
||||
name: Finalize Sentry Release
|
||||
command: sentry-cli releases finalize now-cli@`git describe --tags`
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
unscheduled:
|
||||
jobs:
|
||||
- install:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- build:
|
||||
requires:
|
||||
- install
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-lint:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-node-8:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-node-10:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-node-12:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-node-8:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-node-10:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-node-12:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-now-dev-node-8:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-now-dev-node-10:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-macos-now-dev-node-12:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-now-dev-node-8:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-now-dev-node-10:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-linux-now-dev-node-12:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- test-integration-once:
|
||||
requires:
|
||||
- build
|
||||
- test-unit:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- coverage:
|
||||
requires:
|
||||
- test-integration-macos-node-8
|
||||
- test-integration-macos-node-10
|
||||
- test-integration-macos-node-12
|
||||
- test-integration-linux-node-8
|
||||
- test-integration-linux-node-10
|
||||
- test-integration-linux-node-12
|
||||
- test-integration-macos-now-dev-node-8
|
||||
- test-integration-macos-now-dev-node-10
|
||||
- test-integration-macos-now-dev-node-12
|
||||
- test-integration-linux-now-dev-node-8
|
||||
- test-integration-linux-now-dev-node-10
|
||||
- test-integration-linux-now-dev-node-12
|
||||
- test-integration-once
|
||||
- test-unit
|
||||
- test-lint
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"modules": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
"prettier/@typescript-eslint"
|
||||
],
|
||||
"env": {
|
||||
"node": true,
|
||||
"jest": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
"require-atomic-updates": 0,
|
||||
"@typescript-eslint/ban-ts-ignore": 0,
|
||||
"@typescript-eslint/camelcase": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/no-use-before-define": 0
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.js"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["packages/now-cli/**/*"],
|
||||
"rules": {
|
||||
"lines-between-class-members": 0,
|
||||
"no-async-promise-executor": 0,
|
||||
"no-control-regex": 0,
|
||||
"no-empty": 0,
|
||||
"prefer-const": 0,
|
||||
"prefer-destructuring": 0,
|
||||
"@typescript-eslint/ban-types": 0,
|
||||
"@typescript-eslint/consistent-type-assertions": 0,
|
||||
"@typescript-eslint/member-delimiter-style": 0,
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-inferrable-types": 0,
|
||||
"@typescript-eslint/no-var-requires": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["packages/now-client/**/*"],
|
||||
"rules": {
|
||||
"prefer-const": 0,
|
||||
"require-atomic-updates": 0,
|
||||
"@typescript-eslint/ban-ts-ignore": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,3 +1,7 @@
|
||||
# Ignore test fixtures in GitHub Languages
|
||||
# See https://github.com/github/linguist#vendored-code
|
||||
packages/*/test/* linguist-vendored
|
||||
|
||||
# Go build fails with Windows line endings.
|
||||
*.go text eol=lf
|
||||
go.mod text eol=lf
|
||||
|
||||
13
.github/CODEOWNERS
vendored
13
.github/CODEOWNERS
vendored
@@ -2,6 +2,8 @@
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
* @tootallnate @leo
|
||||
/.github/workflows @AndyBitz @styfle
|
||||
/packages/frameworks @AndyBitz
|
||||
/packages/now-cli/src/commands/dev/ @tootallnate @leo @styfle @AndyBitz
|
||||
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
|
||||
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
|
||||
@@ -10,9 +12,16 @@
|
||||
/packages/now-build-utils @styfle @AndyBitz
|
||||
/packages/now-node @styfle @tootallnate @lucleray
|
||||
/packages/now-node-bridge @styfle @tootallnate @lucleray
|
||||
/packages/now-next @Timer
|
||||
/packages/now-next @Timer @ijjk
|
||||
/packages/now-go @styfle @sophearak
|
||||
/packages/now-python @styfle @sophearak
|
||||
/packages/now-ruby @styfle @coetry @nathancahill
|
||||
/packages/now-static-build @styfle @AndyBitz
|
||||
/packages/now-routing-utils @dav-is
|
||||
/packages/now-routing-utils @styfle @dav-is @ijjk
|
||||
|
||||
/examples @msweeneydev @timothyis
|
||||
/examples/create-react-app @Timer
|
||||
/examples/nextjs @timneutkens
|
||||
/examples/hugo @msweeneydev @timothyis @styfle
|
||||
/examples/jekyll @msweeneydev @timothyis @sarupbanskota
|
||||
/examples/zola @msweeneydev @timothyis @styfle
|
||||
|
||||
36
CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
vendored
36
CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
vendored
@@ -1,28 +1,28 @@
|
||||
## Code of Conduct
|
||||
|
||||
### Our Pledge
|
||||
### Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
### Our Standards
|
||||
### Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
@@ -31,44 +31,44 @@ include:
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
### Our Responsibilities
|
||||
### Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
### Scope
|
||||
### Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
### Enforcement
|
||||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [abuse@zeit.co](mailto:abuse@zeit.co). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
### Attribution
|
||||
### Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
9
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
9
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
@@ -94,3 +94,12 @@ Sometimes you want to test changes to a Builder against an existing project, may
|
||||
4. Run `now *.tgz` to upload the tarball file and get a URL
|
||||
5. Edit any existing `now.json` project and replace `use` with the URL
|
||||
6. Run `now` or `now dev` to deploy with the experimental Builder
|
||||
|
||||
## Add a New Framework
|
||||
|
||||
You can add support for a new Framework by creating a Pull Request for this repository and following the steps below:
|
||||
|
||||
1. Add the Framework to the `@now/frameworks` package: The file is located in `packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the Output Directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
|
||||
2. Add an example to the `examples/` directory: The name of the directory should equal the slug of the framework used in `@now/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
|
||||
3. Update the `@now/static-build` package: The file `packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
|
||||
4. After your Pull Request has been merged and released, other users can select the example on the ZEIT Now dashboard and deploy it.
|
||||
25
.github/EXAMPLE_README_TEMPLATE.md
vendored
Normal file
25
.github/EXAMPLE_README_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# [Name] Example
|
||||
|
||||
This directory is a brief example of a [Name](site-link) site that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own [Name] project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with [Name] on Now, you can use the [CLI Tool Used](CLI-link) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init charge
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
Once initialized, you can deploy the [Name] example with just a single command:
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
18
.github/workflows/cancel.yml
vendored
Normal file
18
.github/workflows/cancel.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Cancel
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '!master'
|
||||
|
||||
jobs:
|
||||
cancel:
|
||||
name: 'Cancel Previous Runs'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 3
|
||||
steps:
|
||||
- uses: styfle/cancel-workflow-action@0.2.0
|
||||
with:
|
||||
workflow_id: 435869
|
||||
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}
|
||||
|
||||
109
.github/workflows/continuous-integration.yml
vendored
Normal file
109
.github/workflows/continuous-integration.yml
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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: 10
|
||||
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
|
||||
15
.github/workflows/publish.yml
vendored
15
.github/workflows/publish.yml
vendored
@@ -4,25 +4,18 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- canary
|
||||
tags:
|
||||
- '!*'
|
||||
|
||||
jobs:
|
||||
Publish:
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Checkout
|
||||
uses: actions/setup-node@v1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: 10
|
||||
- name: Install
|
||||
run: yarn install --check-files --frozen-lockfile
|
||||
- name: Build
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,4 +22,5 @@ packages/now-cli/test/fixtures/integration
|
||||
test/lib/deployment/failed-page.txt
|
||||
.DS_Store
|
||||
.next
|
||||
.env
|
||||
public
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
*
|
||||
|
||||
# general
|
||||
!utils/
|
||||
!utils/run.js
|
||||
!.yarnrc
|
||||
!run.js
|
||||
!yarn.lock
|
||||
!package.json
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||

|
||||

|
||||
|
||||
[](https://circleci.com/gh/zeit/workflows/now/tree/master)
|
||||
[](https://github.com/zeit/now/actions?workflow=CI)
|
||||
[](https://spectrum.chat/zeit)
|
||||
|
||||
## Usage
|
||||
@@ -16,13 +16,12 @@ To quickly start a new project, run the following commands:
|
||||
```
|
||||
now init # Pick an example project to clone
|
||||
cd <PROJECT> # Change directory to the newly created project
|
||||
now dev # Run locally during development
|
||||
now # Deploy to the cloud
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs).
|
||||
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs/now-cli).
|
||||
|
||||
## Caught a Bug?
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
// Currently we read & parse the README file from zeit/now-examples
|
||||
// TODO: create a `manifest.json` for zeit/now-examples
|
||||
import Frameworks, { Framework } from '../../../packages/frameworks';
|
||||
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
/**
|
||||
* Fetch and parse the `Frameworks and Libraries` table
|
||||
* in the README file of zeit/now-examples
|
||||
*/
|
||||
export async function getExampleList() {
|
||||
const response = await fetch(
|
||||
`https://raw.githubusercontent.com/zeit/now-examples/master/manifest.json`
|
||||
);
|
||||
|
||||
if (response.status !== 200) {
|
||||
console.log('manifest.json missing in zeit/now-examples');
|
||||
return null;
|
||||
}
|
||||
|
||||
return response.json();
|
||||
interface Example {
|
||||
example: string;
|
||||
path: string;
|
||||
demo: string;
|
||||
description: string;
|
||||
tagline: string;
|
||||
framework: string;
|
||||
}
|
||||
|
||||
export async function getExampleList(): Promise<Example[]> {
|
||||
return (Frameworks as Framework[])
|
||||
.filter(f => f.demo)
|
||||
.map(framework => {
|
||||
return {
|
||||
example: framework.name,
|
||||
path: `/${framework.slug}`,
|
||||
demo: framework.demo,
|
||||
description: framework.description,
|
||||
tagline: framework.tagline,
|
||||
framework: framework.slug,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ export async function getGitHubRepoInfo(repo: Repo) {
|
||||
const response = await fetch(`https://api.github.com/repos/${repo.repo}`, {
|
||||
headers: {
|
||||
Accept: 'application/vnd.github.machine-man-preview+json',
|
||||
// If we don't use a personal access token,
|
||||
// it will get rate limited very easily.
|
||||
Authorization: `Bearer ${process.env.GITHUB_ACCESS_TOKEN}`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -48,9 +51,9 @@ export async function getGitHubRepoInfo(repo: Repo) {
|
||||
data.subdir = repo.path.slice(subdirPath.length).split('/');
|
||||
}
|
||||
|
||||
if (data.id === 'zeit/now-examples' && data.subdir) {
|
||||
if (data.id === 'zeit/now' && data.subdir && data.subdir[0] === 'examples') {
|
||||
// from our examples, add `homepage` and `description` fields
|
||||
const example = data.subdir[0];
|
||||
const example = data.subdir[1];
|
||||
const exampleList = await getExampleList();
|
||||
|
||||
for (const item of exampleList) {
|
||||
@@ -58,7 +61,6 @@ export async function getGitHubRepoInfo(repo: Repo) {
|
||||
data.homepage = item.demo;
|
||||
data.description = item.description;
|
||||
data.exampleName = item.example;
|
||||
data.icon = item.icon;
|
||||
data.tagline = item.tagline;
|
||||
data.framework = item.framework;
|
||||
return data;
|
||||
|
||||
@@ -21,6 +21,7 @@ export const mapOldToNew: { [key: string]: string[] } = {
|
||||
'nuxt-static': ['nuxtjs'],
|
||||
static: ['vanilla'],
|
||||
typescript: ['gatsby-functions'],
|
||||
umi: ['umijs'],
|
||||
'vanilla-go': ['vanilla-functions'],
|
||||
'vanilla-json-api': ['svelte-functions'],
|
||||
'vue-ssr': ['vue'],
|
||||
|
||||
9
api/_lib/util/assert-env.ts
Normal file
9
api/_lib/util/assert-env.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function assertEnv(name: string) {
|
||||
const value = process.env[name];
|
||||
|
||||
if (!value) {
|
||||
throw new Error(`Missing env "${name}"`);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
43
api/_lib/util/error-handler.ts
Normal file
43
api/_lib/util/error-handler.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { init, captureException, withScope } from '@sentry/node';
|
||||
import { assertEnv } from './assert-env';
|
||||
|
||||
const serviceName = 'api-frameworks';
|
||||
|
||||
let sentryInitDone = false;
|
||||
|
||||
function initSentry() {
|
||||
if (sentryInitDone) {
|
||||
return;
|
||||
}
|
||||
|
||||
sentryInitDone = true;
|
||||
|
||||
init({
|
||||
dsn: assertEnv('SENTRY_DSN'),
|
||||
environment: process.env.NODE_ENV || 'production',
|
||||
release: `${serviceName}`,
|
||||
});
|
||||
}
|
||||
|
||||
export function errorHandler(error: Error, extras?: { [key: string]: any }) {
|
||||
if (!process.env.SENTRY_DSN) {
|
||||
return;
|
||||
}
|
||||
|
||||
initSentry();
|
||||
|
||||
try {
|
||||
withScope(scope => {
|
||||
scope.setTag('service', serviceName);
|
||||
scope.setTag('function_name', assertEnv('AWS_LAMBDA_FUNCTION_NAME'));
|
||||
|
||||
for (const [k, v] of Object.entries(extras)) {
|
||||
scope.setExtra(k, v);
|
||||
}
|
||||
|
||||
captureException(error);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(`Failed to report error to Sentry: ${e}`);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { NowRequest, NowResponse } from '@now/node';
|
||||
import { errorHandler } from './error-handler';
|
||||
|
||||
type Handler = (req: NowRequest, res: NowResponse) => Promise<any>;
|
||||
|
||||
@@ -24,6 +25,20 @@ export function withApiHandler(handler: Handler): Handler {
|
||||
});
|
||||
}
|
||||
|
||||
return handler(req, res);
|
||||
try {
|
||||
const result = await handler(req, res);
|
||||
return result;
|
||||
} catch (error) {
|
||||
errorHandler(error, {
|
||||
url: req.url,
|
||||
});
|
||||
|
||||
return res.status(500).json({
|
||||
error: {
|
||||
code: 'unexpected_error',
|
||||
message: 'An unexpected error occurred.',
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,22 +44,9 @@ export default withApiHandler(async function(req: NowRequest, res: NowResponse)
|
||||
}
|
||||
|
||||
const example = segment.slice(0, -ext.length);
|
||||
let directory;
|
||||
|
||||
if (Number(req.query.version) === 1) {
|
||||
// The old cli is pinned to a specific commit hash
|
||||
await extract('https://github.com/zeit/now-examples/archive/7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3.zip', TMP_DIR);
|
||||
directory = `${TMP_DIR}/now-examples-7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3/${example}`;
|
||||
} else {
|
||||
await extract('https://github.com/zeit/now-examples/archive/master.zip', TMP_DIR);
|
||||
directory = `${TMP_DIR}/now-examples-master/${example}`;
|
||||
|
||||
if (!isDirectory(directory)) {
|
||||
// Use `now` instead of `now-examples` if the searched example does not exist
|
||||
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
|
||||
directory = `${TMP_DIR}/now-master/examples/${example}`;
|
||||
}
|
||||
}
|
||||
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
|
||||
const directory = `${TMP_DIR}/now-master/examples/${example}`;
|
||||
|
||||
if (!isDirectory(directory)) {
|
||||
return notFound(res, `Example '${example}' was not found.`);
|
||||
|
||||
@@ -8,27 +8,8 @@ export default withApiHandler(async function(
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
) {
|
||||
if (Number(req.query.version) === 1) {
|
||||
// The old cli is pinned to a specific commit hash
|
||||
await extract(
|
||||
'https://github.com/zeit/now-examples/archive/7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3.zip',
|
||||
'/tmp'
|
||||
);
|
||||
const exampleList = summary(
|
||||
'/tmp/now-examples-7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3'
|
||||
);
|
||||
return res.send(exampleList);
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
extract('https://github.com/zeit/now/archive/master.zip', '/tmp'),
|
||||
extract('https://github.com/zeit/now-examples/archive/master.zip', '/tmp'),
|
||||
]);
|
||||
|
||||
const exampleList = new Set([
|
||||
...summary('/tmp/now-master/examples'),
|
||||
...summary('/tmp/now-examples-master'),
|
||||
]);
|
||||
await extract('https://github.com/zeit/now/archive/master.zip', '/tmp');
|
||||
const exampleList = summary('/tmp/now-master/examples');
|
||||
|
||||
const existingExamples = Array.from(exampleList).map(key => ({
|
||||
name: key,
|
||||
|
||||
@@ -2,17 +2,19 @@ import { NowRequest, NowResponse } from '@now/node';
|
||||
import { withApiHandler } from './_lib/util/with-api-handler';
|
||||
import frameworkList, { Framework } from '../packages/frameworks';
|
||||
|
||||
const frameworks: Framework[] = (frameworkList as Framework[]).map(
|
||||
framework => {
|
||||
delete framework.detectors;
|
||||
const frameworks = (frameworkList as Framework[]).map(frameworkItem => {
|
||||
const framework = {
|
||||
...frameworkItem,
|
||||
hasDetectors: Boolean(frameworkItem.detectors),
|
||||
detectors: undefined,
|
||||
};
|
||||
|
||||
if (framework.logo) {
|
||||
framework.logo = `https://res.cloudinary.com/zeit-inc/image/fetch/${framework.logo}`;
|
||||
}
|
||||
|
||||
return framework;
|
||||
if (framework.logo) {
|
||||
framework.logo = `https://res.cloudinary.com/zeit-inc/image/fetch/${framework.logo}`;
|
||||
}
|
||||
);
|
||||
|
||||
return framework;
|
||||
});
|
||||
|
||||
export default withApiHandler(async function(
|
||||
req: NowRequest,
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
"description": "API for the zeit/now repo",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "yarn --cwd .. && node ../run.js build all"
|
||||
"build": "yarn --cwd .. && node ../utils/run.js build all"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/node": "5.11.1",
|
||||
"got": "10.2.1",
|
||||
"node-fetch": "2.6.0",
|
||||
"parse-github-url": "1.0.2",
|
||||
|
||||
119
api/yarn.lock
119
api/yarn.lock
@@ -9,6 +9,85 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@sentry/apm@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.11.1.tgz#cc89fa4150056fbf009f92eca94fccc3980db34e"
|
||||
integrity sha512-4iZH11p/7w9IMLT9hqNY1+EqLESltiIoF6/YsbpK93sXWGEs8VQ83IuvGuKWxajvHgDmj4ND0TxIliTsYqTqFw==
|
||||
dependencies:
|
||||
"@sentry/browser" "5.11.1"
|
||||
"@sentry/hub" "5.11.1"
|
||||
"@sentry/minimal" "5.11.1"
|
||||
"@sentry/types" "5.11.0"
|
||||
"@sentry/utils" "5.11.1"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/browser@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.11.1.tgz#337ffcb52711b23064c847a07629e966f54a5ebb"
|
||||
integrity sha512-oqOX/otmuP92DEGRyZeBuQokXdeT9HQRxH73oqIURXXNLMP3PWJALSb4HtT4AftEt/2ROGobZLuA4TaID6My/Q==
|
||||
dependencies:
|
||||
"@sentry/core" "5.11.1"
|
||||
"@sentry/types" "5.11.0"
|
||||
"@sentry/utils" "5.11.1"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/core@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.11.1.tgz#9e2da485e196ae32971545c1c49ee6fe719930e2"
|
||||
integrity sha512-BpvPosVNT20Xso4gAV54Lu3KqDmD20vO63HYwbNdST5LUi8oYV4JhvOkoBraPEM2cbBwQvwVcFdeEYKk4tin9A==
|
||||
dependencies:
|
||||
"@sentry/hub" "5.11.1"
|
||||
"@sentry/minimal" "5.11.1"
|
||||
"@sentry/types" "5.11.0"
|
||||
"@sentry/utils" "5.11.1"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/hub@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.11.1.tgz#ddcb865563fae53852d405885c46b4c6de68a91b"
|
||||
integrity sha512-ucKprYCbGGLLjVz4hWUqHN9KH0WKUkGf5ZYfD8LUhksuobRkYVyig0ZGbshECZxW5jcDTzip4Q9Qimq/PkkXBg==
|
||||
dependencies:
|
||||
"@sentry/types" "5.11.0"
|
||||
"@sentry/utils" "5.11.1"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/minimal@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.11.1.tgz#0e705d01a567282d8fbbda2aed848b4974cc3cec"
|
||||
integrity sha512-HK8zs7Pgdq7DsbZQTThrhQPrJsVWzz7MaluAbQA0rTIAJ3TvHKQpsVRu17xDpjZXypqWcKCRsthDrC4LxDM1Bg==
|
||||
dependencies:
|
||||
"@sentry/hub" "5.11.1"
|
||||
"@sentry/types" "5.11.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/node@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.11.1.tgz#2a9c18cd1209cfdf7a69b9d91303413149d2c910"
|
||||
integrity sha512-FbJs0blJ36gEzE0rc2yBfA/KE+kXOLl8MUfFTcyJCBdCGF8XMETDCmgINnJ4TyBUJviwKoPw2TCk9TL2pa/A1w==
|
||||
dependencies:
|
||||
"@sentry/apm" "5.11.1"
|
||||
"@sentry/core" "5.11.1"
|
||||
"@sentry/hub" "5.11.1"
|
||||
"@sentry/types" "5.11.0"
|
||||
"@sentry/utils" "5.11.1"
|
||||
cookie "^0.3.1"
|
||||
https-proxy-agent "^4.0.0"
|
||||
lru_map "^0.3.3"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sentry/types@5.11.0":
|
||||
version "5.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.11.0.tgz#40f0f3174362928e033ddd9725d55e7c5cb7c5b6"
|
||||
integrity sha512-1Uhycpmeo1ZK2GLvrtwZhTwIodJHcyIS6bn+t4IMkN9MFoo6ktbAfhvexBDW/IDtdLlCGJbfm8nIZerxy0QUpg==
|
||||
|
||||
"@sentry/utils@5.11.1":
|
||||
version "5.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.11.1.tgz#aa19fcc234cf632257b2281261651d2fac967607"
|
||||
integrity sha512-O0Zl4R2JJh8cTkQ8ZL2cDqGCmQdpA5VeXpuBbEl1v78LQPkBDISi35wH4mKmLwMsLBtTVpx2UeUHBj0KO5aLlA==
|
||||
dependencies:
|
||||
"@sentry/types" "5.11.0"
|
||||
tslib "^1.9.3"
|
||||
|
||||
"@sindresorhus/is@^1.0.0":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-1.2.0.tgz#63ce3638cb85231f3704164c90a18ef816da3fb7"
|
||||
@@ -62,6 +141,11 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
agent-base@5:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c"
|
||||
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
|
||||
|
||||
binary@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79"
|
||||
@@ -121,6 +205,18 @@ clone-response@^1.0.2:
|
||||
dependencies:
|
||||
mimic-response "^1.0.0"
|
||||
|
||||
cookie@^0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
||||
integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=
|
||||
|
||||
debug@4:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
decompress-response@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-5.0.0.tgz#7849396e80e3d1eba8cb2f75ef4930f76461cb0f"
|
||||
@@ -182,6 +278,14 @@ http-cache-semantics@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5"
|
||||
integrity sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==
|
||||
|
||||
https-proxy-agent@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b"
|
||||
integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==
|
||||
dependencies:
|
||||
agent-base "5"
|
||||
debug "4"
|
||||
|
||||
inherits@^2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
@@ -204,6 +308,11 @@ lowercase-keys@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
|
||||
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
|
||||
|
||||
lru_map@^0.3.3:
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd"
|
||||
integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=
|
||||
|
||||
mimic-response@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
|
||||
@@ -226,6 +335,11 @@ mkdirp@^0.5.1:
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
node-fetch@2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
|
||||
@@ -320,6 +434,11 @@ to-readable-stream@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"
|
||||
integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=
|
||||
|
||||
tslib@^1.9.3:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
||||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
||||
|
||||
type-fest@^0.8.0:
|
||||
version "0.8.1"
|
||||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
|
||||
|
||||
42
changelog.js
42
changelog.js
@@ -1,42 +0,0 @@
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const commit = execSync('git log --pretty=format:"%s %H"')
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.find(line => line.startsWith('Publish Stable '))
|
||||
.split(' ')
|
||||
.pop();
|
||||
|
||||
if (!commit) {
|
||||
throw new Error('Unable to find last publish commit');
|
||||
}
|
||||
|
||||
const log =
|
||||
execSync(`git log --pretty=format:"- %s [%an]" ${commit}...HEAD`)
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(line => !line.startsWith('- Publish Canary '))
|
||||
.join('\n') || 'NO CHANGES DETECTED';
|
||||
|
||||
console.log(`Changes since the last Stable release (${commit.slice(0, 7)}):`);
|
||||
console.log(`\n${log}\n`);
|
||||
|
||||
const pkgs =
|
||||
Array.from(
|
||||
new Set(
|
||||
execSync(`git diff --name-only ${commit}...HEAD`)
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(line => line.startsWith('packages/'))
|
||||
.map(line => line.split('/')[1])
|
||||
.map(pkgName => require(`./packages/${pkgName}/package.json`).name)
|
||||
)
|
||||
).join(',') || 'now';
|
||||
|
||||
console.log('To publish a stable release, execute the following:');
|
||||
console.log(
|
||||
`\ngit pull && lerna version --message 'Publish Stable' --exact --force-publish=${pkgs}\n`
|
||||
);
|
||||
33
errors/invalid-route-source.md
Normal file
33
errors/invalid-route-source.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Invalid Custom Route `source`
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
When defining custom routes a route was added that causes an error during parsing. This can be due to trying to use normal `RegExp` syntax like negative lookaheads (`?!exclude`) without following `path-to-regexp`'s syntax for it.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Wrap the `RegExp` part of your `source` as an un-named parameter.
|
||||
|
||||
**Before**
|
||||
|
||||
```js
|
||||
{
|
||||
source: '/feedback/(?!general)',
|
||||
destination: '/feedback/general'
|
||||
}
|
||||
```
|
||||
|
||||
**After**
|
||||
|
||||
```js
|
||||
{
|
||||
source: '/feedback/((?!general).*)',
|
||||
destination: '/feedback/general'
|
||||
}
|
||||
```
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v6.1.0)
|
||||
- [named parameters](https://github.com/pillarjs/path-to-regexp/blob/v6.1.0/Readme.md#named-parameters)
|
||||
- [un-named paramters](https://github.com/pillarjs/path-to-regexp/blob/v6.1.0/Readme.md#unnamed-parameters)
|
||||
85
examples/README.md
Normal file
85
examples/README.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# ZEIT Now Examples
|
||||
|
||||
This is the public list of examples for **ZEIT Now**.
|
||||
|
||||
All of these ready to deploy examples feature a frontend framework or static site, created with zero configuration using the CLI tools they provide.
|
||||
|
||||
The `+functions` examples feature an `/api` directory as well, highlighting how to use serverless functions on top of a framework, again with zero configuration required.
|
||||
|
||||
## What is ZEIT Now?
|
||||
|
||||
ZEIT Now is a cloud platform for static frontends and serverless functions. It enables developers to host websites and web applications that deploy instantly, scale automatically, and require no supervision.
|
||||
|
||||
## What Does this Repository Contain?
|
||||
|
||||
This repository consists of multiple examples, created for use with the [ZEIT Now](https://zeit.co/now) platform. In addition to this, it also contains:
|
||||
|
||||
- [Code of Conduct](https://github.com/zeit/now/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
|
||||
- [Contributing Guidelines](https://github.com/zeit/now/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the Now Examples repository
|
||||
- [License](https://github.com/zeit/now/blob/master/LICENSE) - the standard MIT license under which these examples are published
|
||||
|
||||
We recommend familiarizing yourself with the above sections, particularly if you are looking to make a contribution.
|
||||
|
||||
## Deploying Examples
|
||||
|
||||
To get started using any of these examples as your own project, [install Now](https://zeit.co/download) and use either of the following commands in your terminal:
|
||||
|
||||
```sh
|
||||
now init # Pick an example in the CLI
|
||||
now init <example> # Create a new project from a specific <example>
|
||||
now init <example> <name> # Create a new project from a specific <example> with a different folder <name>
|
||||
```
|
||||
|
||||
Deploying your project takes seconds and can be done with **just a single command**:
|
||||
|
||||
```sh
|
||||
now # Deploys the project with Now
|
||||
```
|
||||
|
||||
With the `now` command, your project will be built and served by Now, providing you with a URL that can be shared immediately.
|
||||
|
||||
## New Examples
|
||||
|
||||
We are continuously improving our examples based on best practices and feedback from the community. As a result, it is possible that example names will change and on occasion deprecated in favor of an improved implementation.
|
||||
|
||||
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated now in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
|
||||
|
||||
| Previous Example | New Example |
|
||||
| ----------------- | ------------------------------------------------------------------------------------- |
|
||||
| **monorepo** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
|
||||
| **nodejs** | [svelte-functions](https://github.com/zeit/now/tree/master/examples/svelte) |
|
||||
| **nextjs-static** | [nextjs](https://github.com/zeit/now/tree/master/examples/nextjs) |
|
||||
| **vanilla-go** | [create-react-app](https://github.com/zeit/now/tree/master/examples/create-react-app) |
|
||||
| **typescript** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
|
||||
|
||||
## Migrating and Upgrading
|
||||
|
||||
If you have an existing project you would like to deploy with ZEIT Now, we recommend reading our guide on [migrating to Now and zero configuration](https://zeit.co/guides/migrate-to-zeit-now/). By combining the guide with this repository, you will quickly be able to understand how to deploy your application.
|
||||
|
||||
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://zeit.co/guides/upgrade-to-zero-configuration/) useful. The upgrade guide covers how to remove configuration from existing projects along with how to use the `/api` directory.
|
||||
|
||||
## How to Contribute
|
||||
|
||||
Contributing to Now Examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/zeit/docs/blob/master/CONTRIBUTING.md) to help you do so.
|
||||
|
||||
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
|
||||
|
||||
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [ZEIT Spectrum](https://spectrum.chat/zeit) where we will do our best to help you.
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
We actively encourage our community to raise issues and provide feedback on areas of Now Examples that could be improved.
|
||||
|
||||
An issue can be raised by clicking the 'Issues' tab at the top of the repository, followed by the Green 'New issue' button.
|
||||
|
||||
When submitting an issue, please thoroughly and concisely describe the problem you are experiencing so that we may easily understand and resolve the issue in a timely manner.
|
||||
|
||||
## License
|
||||
|
||||
Now Examples is an open source project released under the [MIT License](https://github.com/zeit/docs/blob/master/LICENSE.md).
|
||||
|
||||
## Get In Touch
|
||||
|
||||
If you have any questions that are not covered by raising an issue then please get in touch with us on the [ZEIT Spectrum](https://spectrum.chat/zeit). There you will find both members of the community and staff who are happy to help answer questions on anything ZEIT related.
|
||||
|
||||
[](https://spectrum.chat/zeit)
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of an [AMP](https://amp.dev/) site that can be
|
||||
|
||||
Deploy your own AMP project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/amp)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
||||
|
||||
_Live Example: https://amp.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Angular Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of an [Angular](https://angular.io/) app that
|
||||
|
||||
Deploy your own Angular project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/angular)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
||||
|
||||
_Live Example: https://angular.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Assemble](http://assemble.io/) app that
|
||||
|
||||
Deploy your own Assemble project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/assemble)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/assemble)
|
||||
|
||||
_Live Example: https://assemble.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of an [Aurelia](https://aurelia.io/) app that
|
||||
|
||||
Deploy your own Aurelia project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/aurelia)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/aurelia)
|
||||
|
||||
_Live Example: https://aurelia.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Brunch](https://brunch.io/) site that ca
|
||||
|
||||
Deploy your own Brunch project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/brunch)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
||||
|
||||
_Live Example: https://brunch.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Charge.js](https://charge.js.org/) site
|
||||
|
||||
Deploy your own Charge.js project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/charge)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/charge)
|
||||
|
||||
_Live Example: https://charge.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||

|
||||
|
||||
# React Example
|
||||
|
||||
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own React project, along with Serverless Functions, with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/create-react-app-functions)
|
||||
|
||||
_Live Example: https://create-react-app-functions.now-examples.now.sh/_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with React, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with ZEIT Now, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx create-react-app my-app
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new React project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "create-react-app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"react": "^16.6.1",
|
||||
"react-dom": "^16.6.1",
|
||||
"react-scripts": "2.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "BROWSER=none react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
]
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
main {
|
||||
align-content: center;
|
||||
box-sizing: border-box;
|
||||
display: grid;
|
||||
font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica',
|
||||
'Arial', sans-serif;
|
||||
hyphens: auto;
|
||||
line-height: 1.65;
|
||||
margin: 0 auto;
|
||||
max-width: 680px;
|
||||
min-height: 100vh;
|
||||
padding: 72px 0;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
font-size: 45px;
|
||||
}
|
||||
h2 {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
a {
|
||||
border-bottom: 1px solid white;
|
||||
color: #0076ff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
a:hover {
|
||||
border-bottom: 1px solid #0076ff;
|
||||
}
|
||||
code,
|
||||
pre {
|
||||
color: #d400ff;
|
||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono, Courier New, monospace, serif;
|
||||
font-size: 0.92em;
|
||||
}
|
||||
code:before,
|
||||
code:after {
|
||||
content: '\`';
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
import React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
const [date, setDate] = useState(null);
|
||||
useEffect(() => {
|
||||
async function getDate() {
|
||||
const res = await fetch('/api/date');
|
||||
const newDate = await res.text();
|
||||
setDate(newDate);
|
||||
}
|
||||
getDate();
|
||||
}, []);
|
||||
return (
|
||||
<main>
|
||||
<h1>Create React App + Go API</h1>
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
href="https://zeit.co/docs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
ZEIT Now
|
||||
</a>
|
||||
!
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now-examples/tree/master/create-react-app-functions"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
This project
|
||||
</a>{' '}
|
||||
was bootstrapped with{' '}
|
||||
<a href="https://facebook.github.io/create-react-app/">
|
||||
Create React App
|
||||
</a>{' '}
|
||||
and contains three directories, <code>/public</code> for static assets,{' '}
|
||||
<code>/src</code> for components and content, and <code>/api</code>{' '}
|
||||
which contains a serverless <a href="https://golang.org/">Go</a>{' '}
|
||||
function. See{' '}
|
||||
<a href="/api/date">
|
||||
<code>api/date</code> for the Date API with Go
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<br />
|
||||
<h2>The date according to Go is:</h2>
|
||||
<p>{date ? date : 'Loading date...'}</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
||||
@@ -1,14 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
||||
3
examples/create-react-app/.gitignore
vendored
3
examples/create-react-app/.gitignore
vendored
@@ -10,6 +10,7 @@
|
||||
|
||||
# production
|
||||
/build
|
||||
/dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@@ -24,4 +25,4 @@ yarn-error.log*
|
||||
|
||||
# Environment Variables
|
||||
.env
|
||||
.env.build
|
||||
.env.build
|
||||
@@ -1,20 +1,20 @@
|
||||

|
||||

|
||||
|
||||
# Create-React-App Example
|
||||
# React Example
|
||||
|
||||
This directory is a brief example of a [React](https://reactjs.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own React project with ZEIT Now.
|
||||
Deploy your own React project, along with Serverless Functions, with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/create-react-app)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
|
||||
|
||||
_Live Example: https://create-react-app.now-examples.now.sh_
|
||||
_Live Example: https://create-react-app.now-examples.now.sh/_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with React, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
|
||||
To get started with React, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with ZEIT Now, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx create-react-app my-app
|
||||
@@ -22,7 +22,7 @@ $ npx create-react-app my-app
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new React project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new React project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -3,27 +3,20 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.8.6",
|
||||
"react-scripts": "3.0.1"
|
||||
"react": "^16.6.1",
|
||||
"react-dom": "^16.6.1",
|
||||
"react-scripts": "2.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"dev": "react-scripts start",
|
||||
"dev": "BROWSER=none react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
manifest.json provides metadata used when your web app is added to the
|
||||
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
@@ -19,10 +22,12 @@
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<title>Create React App + Go API</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
|
||||
@@ -1,33 +1,44 @@
|
||||
.App {
|
||||
main {
|
||||
align-content: center;
|
||||
box-sizing: border-box;
|
||||
display: grid;
|
||||
font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica',
|
||||
'Arial', sans-serif;
|
||||
hyphens: auto;
|
||||
line-height: 1.65;
|
||||
margin: 0 auto;
|
||||
max-width: 680px;
|
||||
min-height: 100vh;
|
||||
padding: 72px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
h1 {
|
||||
font-size: 45px;
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
h2 {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
a {
|
||||
border-bottom: 1px solid white;
|
||||
color: #0076ff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
a:hover {
|
||||
border-bottom: 1px solid #0076ff;
|
||||
}
|
||||
code,
|
||||
pre {
|
||||
color: #d400ff;
|
||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||
Bitstream Vera Sans Mono, Courier New, monospace, serif;
|
||||
font-size: 0.92em;
|
||||
}
|
||||
code:before,
|
||||
code:after {
|
||||
content: '\`';
|
||||
}
|
||||
|
||||
@@ -1,25 +1,56 @@
|
||||
import React from 'react';
|
||||
import logo from './logo.svg';
|
||||
import { useEffect, useState } from 'react';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
const [date, setDate] = useState(null);
|
||||
useEffect(() => {
|
||||
async function getDate() {
|
||||
const res = await fetch('/api/date');
|
||||
const newDate = await res.text();
|
||||
setDate(newDate);
|
||||
}
|
||||
getDate();
|
||||
}, []);
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<p>
|
||||
Edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
<main>
|
||||
<h1>Create React App + Go API</h1>
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
href="https://zeit.co/docs"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
Learn React
|
||||
ZEIT Now
|
||||
</a>
|
||||
</header>
|
||||
</div>
|
||||
!
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now/tree/master/examples/create-react-app"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
This project
|
||||
</a>{' '}
|
||||
was bootstrapped with{' '}
|
||||
<a href="https://facebook.github.io/create-react-app/">
|
||||
Create React App
|
||||
</a>{' '}
|
||||
and contains three directories, <code>/public</code> for static assets,{' '}
|
||||
<code>/src</code> for components and content, and <code>/api</code>{' '}
|
||||
which contains a serverless <a href="https://golang.org/">Go</a>{' '}
|
||||
function. See{' '}
|
||||
<a href="/api/date">
|
||||
<code>api/date</code> for the Date API with Go
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<br />
|
||||
<h2>The date according to Go is:</h2>
|
||||
<p>{date ? date : 'Loading date...'}</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
sans-serif;
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
||||
<g fill="#61DAFB">
|
||||
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
||||
<circle cx="420.9" cy="296.5" r="45.7"/>
|
||||
<path d="M520.5 78.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -43,7 +43,7 @@ export function register(config) {
|
||||
navigator.serviceWorker.ready.then(() => {
|
||||
console.log(
|
||||
'This web app is being served cache-first by a service ' +
|
||||
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
||||
'worker. To learn more, visit http://bit.ly/CRA-PWA'
|
||||
);
|
||||
});
|
||||
} else {
|
||||
@@ -71,7 +71,7 @@ function registerValidSW(swUrl, config) {
|
||||
// content until all client tabs are closed.
|
||||
console.log(
|
||||
'New content is available and will be used when all ' +
|
||||
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
||||
'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
|
||||
);
|
||||
|
||||
// Execute callback
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of using a Custom Build script that can be dep
|
||||
|
||||
Deploy your own Custom Built project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/custom-build)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
|
||||
|
||||
_Live Example: https://custom-build.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Docusaurus Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site
|
||||
|
||||
Deploy your own Docusaurus project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/docusaurus)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
|
||||
|
||||
_Live Example: https://docusaurus.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Docz](https://www.docz.site/) site that
|
||||
|
||||
Deploy your own Docz project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/docz)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/docz)
|
||||
|
||||
_Live Example: https://docz.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -7,4 +7,4 @@ route: /
|
||||
|
||||
I'm a documentation page, using MDX, created using [docz](https://docz.site) and deployed with [ZEIT Now](https://zeit.co/now)!
|
||||
|
||||
You can learn how to deploy a docz project from [the now-examples GitHub repository](https://github.com/zeit/now-examples/tree/master/docz)!
|
||||
You can learn how to deploy a docz project from [the now-examples GitHub repository](https://github.com/zeit/now/tree/master/examples/docz)!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Eleventy Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Eleventy](https://www.11ty.io/) site tha
|
||||
|
||||
Deploy your own Eleventy project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/eleventy)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
|
||||
|
||||
_Live Example: https://eleventy.now-examples.now.sh_
|
||||
|
||||
|
||||
Submodule examples/ember deleted from bfeb5bb633
20
examples/ember/.editorconfig
Normal file
20
examples/ember/.editorconfig
Normal file
@@ -0,0 +1,20 @@
|
||||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.hbs]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
||||
9
examples/ember/.ember-cli
Normal file
9
examples/ember/.ember-cli
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
/**
|
||||
Ember CLI sends analytics information by default. The data is completely
|
||||
anonymous, but there are times when you might want to disable this behavior.
|
||||
|
||||
Setting `disableAnalytics` to true will prevent any data from being sent.
|
||||
*/
|
||||
"disableAnalytics": false
|
||||
}
|
||||
20
examples/ember/.eslintignore
Normal file
20
examples/ember/.eslintignore
Normal file
@@ -0,0 +1,20 @@
|
||||
# unconventional js
|
||||
/blueprints/*/files/
|
||||
/vendor/
|
||||
|
||||
# compiled output
|
||||
/dist/
|
||||
/tmp/
|
||||
|
||||
# dependencies
|
||||
/bower_components/
|
||||
/node_modules/
|
||||
|
||||
# misc
|
||||
/coverage/
|
||||
!.*
|
||||
|
||||
# ember-try
|
||||
/.node_modules.ember-try/
|
||||
/bower.json.ember-try
|
||||
/package.json.ember-try
|
||||
47
examples/ember/.eslintrc.js
Normal file
47
examples/ember/.eslintrc.js
Normal file
@@ -0,0 +1,47 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['ember'],
|
||||
extends: ['eslint:recommended', 'plugin:ember/recommended'],
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
rules: {},
|
||||
overrides: [
|
||||
// node files
|
||||
{
|
||||
files: [
|
||||
'.eslintrc.js',
|
||||
'.template-lintrc.js',
|
||||
'ember-cli-build.js',
|
||||
'testem.js',
|
||||
'blueprints/*/index.js',
|
||||
'config/**/*.js',
|
||||
'lib/*/index.js',
|
||||
'server/**/*.js',
|
||||
],
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
},
|
||||
env: {
|
||||
browser: false,
|
||||
node: true,
|
||||
},
|
||||
plugins: ['node'],
|
||||
rules: Object.assign(
|
||||
{},
|
||||
require('eslint-plugin-node').configs.recommended.rules,
|
||||
{
|
||||
// add your custom rules and overrides for node files here
|
||||
|
||||
// this can be removed once the following is fixed
|
||||
// https://github.com/mysticatea/eslint-plugin-node/issues/77
|
||||
'node/no-unpublished-require': 'off',
|
||||
}
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
29
examples/ember/.gitignore
vendored
Normal file
29
examples/ember/.gitignore
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist/
|
||||
/tmp/
|
||||
|
||||
# dependencies
|
||||
/bower_components/
|
||||
/node_modules/
|
||||
|
||||
# misc
|
||||
/.env*
|
||||
/.pnp*
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage/
|
||||
/libpeerconnection.log
|
||||
/npm-debug.log*
|
||||
/testem.log
|
||||
/yarn-error.log
|
||||
|
||||
# ember-try
|
||||
/.node_modules.ember-try/
|
||||
/bower.json.ember-try
|
||||
/package.json.ember-try
|
||||
|
||||
# Environment Variables
|
||||
.env
|
||||
.env.build
|
||||
5
examples/ember/.template-lintrc.js
Normal file
5
examples/ember/.template-lintrc.js
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
extends: 'recommended',
|
||||
};
|
||||
24
examples/ember/.travis.yml
Normal file
24
examples/ember/.travis.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.npm
|
||||
|
||||
env:
|
||||
global:
|
||||
# See https://git.io/vdao3 for details.
|
||||
- JOBS=1
|
||||
|
||||
script:
|
||||
- npm run lint:hbs
|
||||
- npm run lint:js
|
||||
- npm test
|
||||
3
examples/ember/.watchmanconfig
Normal file
3
examples/ember/.watchmanconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ignore_dirs": ["tmp", "dist"]
|
||||
}
|
||||
29
examples/ember/README.md
Normal file
29
examples/ember/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||

|
||||
|
||||
# Ember Example
|
||||
|
||||
This directory is a brief example of an [Ember](https://emberjs.com/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Ember project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
|
||||
|
||||
_Live Example: https://ember.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Ember for deployment with ZEIT Now, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx ember-cli new ember-project
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Ember project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
14
examples/ember/app/app.js
Normal file
14
examples/ember/app/app.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Application from '@ember/application';
|
||||
import Resolver from './resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
|
||||
const App = Application.extend({
|
||||
modulePrefix: config.modulePrefix,
|
||||
podModulePrefix: config.podModulePrefix,
|
||||
Resolver,
|
||||
});
|
||||
|
||||
loadInitializers(App, config.modulePrefix);
|
||||
|
||||
export default App;
|
||||
25
examples/ember/app/index.html
Normal file
25
examples/ember/app/index.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>HelloWorld</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{content-for "head"}}
|
||||
|
||||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
||||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/hello-world.css">
|
||||
|
||||
{{content-for "head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/hello-world.js"></script>
|
||||
|
||||
{{content-for "body-footer"}}
|
||||
</body>
|
||||
</html>
|
||||
0
examples/ember/app/models/.gitkeep
Normal file
0
examples/ember/app/models/.gitkeep
Normal file
3
examples/ember/app/resolver.js
Normal file
3
examples/ember/app/resolver.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import Resolver from 'ember-resolver';
|
||||
|
||||
export default Resolver;
|
||||
11
examples/ember/app/router.js
Normal file
11
examples/ember/app/router.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import EmberRouter from '@ember/routing/router';
|
||||
import config from './config/environment';
|
||||
|
||||
const Router = EmberRouter.extend({
|
||||
location: config.locationType,
|
||||
rootURL: config.rootURL,
|
||||
});
|
||||
|
||||
Router.map(function() {});
|
||||
|
||||
export default Router;
|
||||
0
examples/ember/app/routes/.gitkeep
Normal file
0
examples/ember/app/routes/.gitkeep
Normal file
0
examples/ember/app/styles/app.css
Normal file
0
examples/ember/app/styles/app.css
Normal file
5
examples/ember/app/templates/application.hbs
Normal file
5
examples/ember/app/templates/application.hbs
Normal file
@@ -0,0 +1,5 @@
|
||||
{{!-- The following component displays Ember's default welcome message. --}}
|
||||
<WelcomePage />
|
||||
{{!-- Feel free to remove this! --}}
|
||||
|
||||
{{outlet}}
|
||||
0
examples/ember/app/templates/components/.gitkeep
Normal file
0
examples/ember/app/templates/components/.gitkeep
Normal file
51
examples/ember/config/environment.js
Normal file
51
examples/ember/config/environment.js
Normal file
@@ -0,0 +1,51 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(environment) {
|
||||
let ENV = {
|
||||
modulePrefix: 'hello-world',
|
||||
environment,
|
||||
rootURL: '/',
|
||||
locationType: 'auto',
|
||||
EmberENV: {
|
||||
FEATURES: {
|
||||
// Here you can enable experimental features on an ember canary build
|
||||
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
|
||||
},
|
||||
EXTEND_PROTOTYPES: {
|
||||
// Prevent Ember Data from overriding Date.parse.
|
||||
Date: false,
|
||||
},
|
||||
},
|
||||
|
||||
APP: {
|
||||
// Here you can pass flags/options to your application instance
|
||||
// when it is created
|
||||
},
|
||||
};
|
||||
|
||||
if (environment === 'development') {
|
||||
// ENV.APP.LOG_RESOLVER = true;
|
||||
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
||||
// ENV.APP.LOG_TRANSITIONS = true;
|
||||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
// Testem prefers this...
|
||||
ENV.locationType = 'none';
|
||||
|
||||
// keep test console output quieter
|
||||
ENV.APP.LOG_ACTIVE_GENERATION = false;
|
||||
ENV.APP.LOG_VIEW_LOOKUPS = false;
|
||||
|
||||
ENV.APP.rootElement = '#ember-testing';
|
||||
ENV.APP.autoboot = false;
|
||||
}
|
||||
|
||||
if (environment === 'production') {
|
||||
// here you can enable a production-specific feature
|
||||
}
|
||||
|
||||
return ENV;
|
||||
};
|
||||
3
examples/ember/config/optional-features.json
Normal file
3
examples/ember/config/optional-features.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"jquery-integration": true
|
||||
}
|
||||
18
examples/ember/config/targets.js
Normal file
18
examples/ember/config/targets.js
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const browsers = [
|
||||
'last 1 Chrome versions',
|
||||
'last 1 Firefox versions',
|
||||
'last 1 Safari versions',
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
browsers.push('ie 11');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
browsers,
|
||||
};
|
||||
24
examples/ember/ember-cli-build.js
Normal file
24
examples/ember/ember-cli-build.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
|
||||
module.exports = function(defaults) {
|
||||
let app = new EmberApp(defaults, {
|
||||
// Add options here
|
||||
});
|
||||
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
//
|
||||
// If you need to use different assets in different
|
||||
// environments, specify an object as the first parameter. That
|
||||
// object's keys should be the environment name and the values
|
||||
// should be the asset to use in that environment.
|
||||
//
|
||||
// If the library that you are including contains AMD or ES6
|
||||
// modules that you would like to import into your application
|
||||
// please specify an object with the list of modules as keys
|
||||
// along with the exports of each module as its value.
|
||||
|
||||
return app.toTree();
|
||||
};
|
||||
53
examples/ember/package.json
Normal file
53
examples/ember/package.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "hello-world",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "Small description for hello-world goes here",
|
||||
"repository": "",
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ember build",
|
||||
"lint:hbs": "ember-template-lint .",
|
||||
"lint:js": "eslint .",
|
||||
"dev": "ember serve --port $PORT",
|
||||
"start": "ember serve",
|
||||
"test": "ember test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ember/jquery": "^0.6.0",
|
||||
"@ember/optional-features": "^0.7.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"ember-ajax": "^5.0.0",
|
||||
"ember-cli": "~3.11.0",
|
||||
"ember-cli-app-version": "^3.2.0",
|
||||
"ember-cli-babel": "^7.7.3",
|
||||
"ember-cli-dependency-checker": "^3.1.0",
|
||||
"ember-cli-eslint": "^5.1.0",
|
||||
"ember-cli-htmlbars": "^3.0.1",
|
||||
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
|
||||
"ember-cli-inject-live-reload": "^1.8.2",
|
||||
"ember-cli-sri": "^2.1.1",
|
||||
"ember-cli-template-lint": "^1.0.0-beta.1",
|
||||
"ember-cli-uglify": "^2.1.0",
|
||||
"ember-data": "~3.11.0",
|
||||
"ember-export-application-global": "^2.0.0",
|
||||
"ember-load-initializers": "^2.0.0",
|
||||
"ember-maybe-import-regenerator": "^0.1.6",
|
||||
"ember-qunit": "^4.4.1",
|
||||
"ember-resolver": "^5.0.1",
|
||||
"ember-source": "~3.11.1",
|
||||
"ember-welcome-page": "^4.0.0",
|
||||
"eslint-plugin-ember": "^6.2.0",
|
||||
"eslint-plugin-node": "^9.0.1",
|
||||
"loader.js": "^4.7.0",
|
||||
"qunit-dom": "^0.8.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "8.* || >= 10.*"
|
||||
}
|
||||
}
|
||||
21
examples/ember/testem.js
Normal file
21
examples/ember/testem.js
Normal file
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
test_page: 'tests/index.html?hidepassed',
|
||||
disable_watching: true,
|
||||
launch_in_ci: ['Chrome'],
|
||||
launch_in_dev: ['Chrome'],
|
||||
browser_args: {
|
||||
Chrome: {
|
||||
ci: [
|
||||
// --no-sandbox is needed when running Chrome inside a container
|
||||
process.env.CI ? '--no-sandbox' : null,
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-software-rasterizer',
|
||||
'--mute-audio',
|
||||
'--remote-debugging-port=0',
|
||||
'--window-size=1440,900',
|
||||
].filter(Boolean),
|
||||
},
|
||||
},
|
||||
};
|
||||
0
examples/ember/tests/helpers/.gitkeep
Normal file
0
examples/ember/tests/helpers/.gitkeep
Normal file
33
examples/ember/tests/index.html
Normal file
33
examples/ember/tests/index.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>HelloWorld Tests</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{content-for "head"}}
|
||||
{{content-for "test-head"}}
|
||||
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/hello-world.css">
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/test-support.css">
|
||||
|
||||
{{content-for "head-footer"}}
|
||||
{{content-for "test-head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
{{content-for "test-body"}}
|
||||
|
||||
<script src="/testem.js" integrity=""></script>
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/test-support.js"></script>
|
||||
<script src="{{rootURL}}assets/hello-world.js"></script>
|
||||
<script src="{{rootURL}}assets/tests.js"></script>
|
||||
|
||||
{{content-for "body-footer"}}
|
||||
{{content-for "test-body-footer"}}
|
||||
</body>
|
||||
</html>
|
||||
0
examples/ember/tests/integration/.gitkeep
Normal file
0
examples/ember/tests/integration/.gitkeep
Normal file
8
examples/ember/tests/test-helper.js
Normal file
8
examples/ember/tests/test-helper.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Application from '../app';
|
||||
import config from '../config/environment';
|
||||
import { setApplication } from '@ember/test-helpers';
|
||||
import { start } from 'ember-qunit';
|
||||
|
||||
setApplication(Application.create(config.APP));
|
||||
|
||||
start();
|
||||
0
examples/ember/tests/unit/.gitkeep
Normal file
0
examples/ember/tests/unit/.gitkeep
Normal file
0
examples/ember/vendor/.gitkeep
vendored
Normal file
0
examples/ember/vendor/.gitkeep
vendored
Normal file
@@ -6,7 +6,7 @@ This directory is a brief example of a [Foundation](https://foundation.zurb.com/
|
||||
|
||||
Deploy your own Foundation project with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/foundation)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/foundation)
|
||||
|
||||
_Live Example: https://foundation.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
yarn.lock
|
||||
README.md
|
||||
@@ -1,29 +0,0 @@
|
||||

|
||||
|
||||
# Gatsby Example
|
||||
|
||||
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Gatsby project, along with Serverless Functions, with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/gatsby-functions)
|
||||
|
||||
_Live Example: https://gatsby-functions.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Gatsby on Now, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ gatsby new gatsby-site
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Gatsby project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
```
|
||||
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: 'Gatsby + Node.js (TypeScript) API',
|
||||
},
|
||||
plugins: [
|
||||
`gatsby-plugin-react-helmet`,
|
||||
{
|
||||
resolve: `gatsby-plugin-manifest`,
|
||||
options: {
|
||||
name: 'Gatsby + Node.js (TypeScript) API',
|
||||
short_name: 'Gatbsy + Node.js (TypeScript)',
|
||||
start_url: '/',
|
||||
icon: 'src/images/gatsby-icon.png',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "gatsby-starter-default",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"gatsby": "^2.18.14",
|
||||
"gatsby-image": "^2.0.15",
|
||||
"gatsby-plugin-manifest": "^2.0.5",
|
||||
"gatsby-plugin-react-helmet": "^3.0.0",
|
||||
"react": "^16.5.1",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-helmet": "^5.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@now/node": "^1.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "gatsby develop",
|
||||
"build": "gatsby build"
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import '../styles/index.css';
|
||||
|
||||
function Index() {
|
||||
const [date, setDate] = useState(null);
|
||||
useEffect(() => {
|
||||
async function getDate() {
|
||||
const res = await fetch('/api/date');
|
||||
const newDate = await res.text();
|
||||
setDate(newDate);
|
||||
}
|
||||
getDate();
|
||||
}, []);
|
||||
return (
|
||||
<main>
|
||||
<Helmet>
|
||||
<title>Gatsby + Node.js (TypeScript) API</title>
|
||||
</Helmet>
|
||||
<h1>Gatsby + Node.js (TypeScript) API</h1>
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
href="https://zeit.co/docs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
ZEIT Now
|
||||
</a>
|
||||
!
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now-examples/blob/master/gatsby-functions"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
This project
|
||||
</a>{' '}
|
||||
is a <a href="https://www.gatsbyjs.org/">Gatsby</a> app with two
|
||||
directories, <code>/src</code> for static content and <code>/api</code>{' '}
|
||||
which contains a serverless{' '}
|
||||
<a href="https://nodejs.org/en/">Node.js (TypeScript)</a> function. See{' '}
|
||||
<a href="/api/date">
|
||||
<code>api/date</code> for the Date API with Node.js (TypeScript)
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<br />
|
||||
<h2>The date according to Node.js (TypeScript) is:</h2>
|
||||
<p>{date ? date : 'Loading date...'}</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default Index;
|
||||
2
examples/gatsby/.gitignore
vendored
2
examples/gatsby/.gitignore
vendored
@@ -67,4 +67,4 @@ yarn-error.log
|
||||
.pnp/
|
||||
.pnp.js
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
.yarn-integrity
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
README.md
|
||||
yarn.lock
|
||||
yarn.lock
|
||||
README.md
|
||||
@@ -1,20 +1,20 @@
|
||||

|
||||

|
||||
|
||||
# Gatsby Example
|
||||
|
||||
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Gatsby project with ZEIT Now.
|
||||
Deploy your own Gatsby project, along with Serverless Functions, with ZEIT Now.
|
||||
|
||||
[](https://zeit.co/new/project?template=https://github.com/zeit/now-examples/tree/master/gatsby)
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
|
||||
|
||||
_Live Example: https://gatsby.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Gatsby for deployment with ZEIT Now, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
|
||||
To get started with Gatsby on Now, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ gatsby new gatsby-site
|
||||
@@ -22,7 +22,7 @@ $ gatsby new gatsby-site
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Gatsby project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Gatsby project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user