mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-23 09:59:12 +00:00
Compare commits
307 Commits
@now/pytho
...
@vercel/st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b626f3fe57 | ||
|
|
96bc0c9bee | ||
|
|
f4ff8c0268 | ||
|
|
1a5681f287 | ||
|
|
88b66ae646 | ||
|
|
db0124782a | ||
|
|
a7a5d4d169 | ||
|
|
4b39e96c28 | ||
|
|
f459db9f83 | ||
|
|
ad19021969 | ||
|
|
95e41874e4 | ||
|
|
4d20a1d77b | ||
|
|
325ee261cb | ||
|
|
2e0cee490d | ||
|
|
8a9b67a3f3 | ||
|
|
f1d9a5da96 | ||
|
|
8d9c463e1f | ||
|
|
e07e8f841a | ||
|
|
0b8a2c0dab | ||
|
|
9c2b7132fa | ||
|
|
d4639a5108 | ||
|
|
ba25004ea8 | ||
|
|
639a9b03d2 | ||
|
|
28ffdfbeef | ||
|
|
5e222d3c03 | ||
|
|
94c8464728 | ||
|
|
898478d1e1 | ||
|
|
8a68211cad | ||
|
|
2765207c93 | ||
|
|
6b52cfdbc7 | ||
|
|
f474fa1b8c | ||
|
|
2cdee19804 | ||
|
|
e9066a3ead | ||
|
|
1461fbe331 | ||
|
|
099bc6dbf6 | ||
|
|
fe0d762aca | ||
|
|
07c9c0bb6e | ||
|
|
243018b736 | ||
|
|
99436b986a | ||
|
|
dfdef0f6fd | ||
|
|
921327d878 | ||
|
|
c48fd3e891 | ||
|
|
5142e32bed | ||
|
|
d360169b06 | ||
|
|
7b1893b9f7 | ||
|
|
fb07360b71 | ||
|
|
3a00aed989 | ||
|
|
64944f8926 | ||
|
|
5e4eee4db1 | ||
|
|
a1a5e0ef0d | ||
|
|
91b9b7f880 | ||
|
|
8e29924165 | ||
|
|
9083b558f0 | ||
|
|
0bf8c3751b | ||
|
|
3ef832fdbe | ||
|
|
4bc6ebe286 | ||
|
|
5660474739 | ||
|
|
e85a62703c | ||
|
|
3a3cfd4d7b | ||
|
|
9570d64b67 | ||
|
|
e77ea00e9d | ||
|
|
aebe77d222 | ||
|
|
53cb2cc4c5 | ||
|
|
4d75ed5117 | ||
|
|
e6c84dd70b | ||
|
|
d51f0d0f06 | ||
|
|
4cd35c48a2 | ||
|
|
69ac4f3eb8 | ||
|
|
2c9cbe20f3 | ||
|
|
4ddd2f016c | ||
|
|
76f61cbbf0 | ||
|
|
23fe8affec | ||
|
|
5334caad54 | ||
|
|
103e4117c3 | ||
|
|
3e774d0531 | ||
|
|
5e2139f408 | ||
|
|
55e4bffcd2 | ||
|
|
de3a066934 | ||
|
|
257b0ca5b6 | ||
|
|
e826d48814 | ||
|
|
d4ecfb04bb | ||
|
|
cad10e1918 | ||
|
|
1e221c48f9 | ||
|
|
15221bf19c | ||
|
|
2513fecaf4 | ||
|
|
d723d985e3 | ||
|
|
2d0a71946b | ||
|
|
4b7af4d7d3 | ||
|
|
8e3f4a1ca2 | ||
|
|
2a9e5798a8 | ||
|
|
5b369b385d | ||
|
|
28e01528c5 | ||
|
|
987ce6c26b | ||
|
|
21e4d644cf | ||
|
|
282127e3f9 | ||
|
|
7748f50ca9 | ||
|
|
224757581d | ||
|
|
40e99284c2 | ||
|
|
54bae977f0 | ||
|
|
867590a6ba | ||
|
|
c89cf6fd57 | ||
|
|
b7ad18425f | ||
|
|
5554b2d004 | ||
|
|
e4ce0d6802 | ||
|
|
f477ee6e3b | ||
|
|
59b4029a0c | ||
|
|
8411b53fa3 | ||
|
|
7651bcf4a4 | ||
|
|
6fd1b50924 | ||
|
|
a03b8689e9 | ||
|
|
22c8ed15c7 | ||
|
|
e1f7b859b6 | ||
|
|
c75cc99f1e | ||
|
|
30ddd29889 | ||
|
|
21337de7cd | ||
|
|
a6686f9ff5 | ||
|
|
65c621bd55 | ||
|
|
0827d3514d | ||
|
|
7bc5d9fb5b | ||
|
|
c53106ecee | ||
|
|
91e4d18ab8 | ||
|
|
33cd78b93a | ||
|
|
a765d27e5a | ||
|
|
e65ff4bfd5 | ||
|
|
30a4787390 | ||
|
|
36f6f1db77 | ||
|
|
8043e25d6d | ||
|
|
73b4e7aea4 | ||
|
|
de7e063c9b | ||
|
|
e7c30deee8 | ||
|
|
7464fac792 | ||
|
|
252363cce4 | ||
|
|
d7dceeb2a1 | ||
|
|
6b5b9e8b2f | ||
|
|
addd036149 | ||
|
|
7ca672a470 | ||
|
|
3af0e99689 | ||
|
|
b14068de8a | ||
|
|
c9437e714a | ||
|
|
c0aff5cf4a | ||
|
|
9110b14bb4 | ||
|
|
40e4b69267 | ||
|
|
6c4934dcc4 | ||
|
|
d64e54d61a | ||
|
|
0b75bf07f7 | ||
|
|
a861a8f3f7 | ||
|
|
6407b17b7f | ||
|
|
558463a988 | ||
|
|
1a133995b8 | ||
|
|
a83eecf674 | ||
|
|
a932ed65fa | ||
|
|
e2ae497762 | ||
|
|
89989719c2 | ||
|
|
8166b8e1e7 | ||
|
|
1ceeac498c | ||
|
|
1c47d1360d | ||
|
|
ddcd0918e9 | ||
|
|
573b6b8110 | ||
|
|
40039d7f9b | ||
|
|
dcb37e92f5 | ||
|
|
fe7f875549 | ||
|
|
a516ed6fb8 | ||
|
|
ca2c5f85ef | ||
|
|
adb5a01cc0 | ||
|
|
6b4d39ab4d | ||
|
|
07ce3d2e34 | ||
|
|
93ffcf487b | ||
|
|
3631f0f4cf | ||
|
|
b67b5be8a9 | ||
|
|
bf67b1a29e | ||
|
|
ed86473f74 | ||
|
|
399a3cd114 | ||
|
|
d0fd09810a | ||
|
|
f298f2e894 | ||
|
|
569200ae0e | ||
|
|
c91495338d | ||
|
|
7eed5574e0 | ||
|
|
91e6b85cec | ||
|
|
3ae83172ec | ||
|
|
7c51446e5e | ||
|
|
400a5c73e8 | ||
|
|
ec917ace69 | ||
|
|
f5e0afdd7e | ||
|
|
c1b4c62714 | ||
|
|
5e4bdfbe11 | ||
|
|
bd4a0cbd32 | ||
|
|
7ff9adc90e | ||
|
|
b279f1ffae | ||
|
|
344cc103ee | ||
|
|
83249b3685 | ||
|
|
79e7a9f477 | ||
|
|
b3dce70271 | ||
|
|
cff8d8b8a0 | ||
|
|
da892100d9 | ||
|
|
72e87ee6e4 | ||
|
|
3f9afad167 | ||
|
|
1527447914 | ||
|
|
9ca35df5fb | ||
|
|
05b2e2216c | ||
|
|
167fd5750a | ||
|
|
4a3cd7ec72 | ||
|
|
9aef718917 | ||
|
|
3cdc261802 | ||
|
|
5c71f672b3 | ||
|
|
dbc5f73984 | ||
|
|
1d269fffc8 | ||
|
|
cc146ba0f5 | ||
|
|
f8a2519838 | ||
|
|
1781376d47 | ||
|
|
d9fda14969 | ||
|
|
a4de9272e7 | ||
|
|
9b9037de91 | ||
|
|
8d18c65e3e | ||
|
|
e7d7de61b6 | ||
|
|
11927883c3 | ||
|
|
57d25b184b | ||
|
|
95f716fb3f | ||
|
|
8dd52605be | ||
|
|
4b9c6a2a2a | ||
|
|
17f92a5ad3 | ||
|
|
0aab7cc509 | ||
|
|
b39622b271 | ||
|
|
1e9aeee8e9 | ||
|
|
49fac0dfad | ||
|
|
a668df829f | ||
|
|
3d4ef1f825 | ||
|
|
f986daa1cc | ||
|
|
549c8777ba | ||
|
|
51d7242fda | ||
|
|
36db0e5bab | ||
|
|
99368b4248 | ||
|
|
95daf0e292 | ||
|
|
8bfa9c1a42 | ||
|
|
4208dc0466 | ||
|
|
00ae011b95 | ||
|
|
a770991a81 | ||
|
|
f80a6d6392 | ||
|
|
30777384ec | ||
|
|
0c719b7f6a | ||
|
|
ff18788b20 | ||
|
|
752ab39787 | ||
|
|
c1df8c8bd1 | ||
|
|
25fd1df35d | ||
|
|
d32ab1e0d9 | ||
|
|
a69c460760 | ||
|
|
b985853f15 | ||
|
|
94e607a93a | ||
|
|
f97a81fa14 | ||
|
|
6e28438eb4 | ||
|
|
8fcdf3f458 | ||
|
|
dbf0cc3562 | ||
|
|
27ccfa7e7a | ||
|
|
f37edbc670 | ||
|
|
b7943e83d2 | ||
|
|
300ed5b952 | ||
|
|
9e6ebfb3ec | ||
|
|
f49620790c | ||
|
|
84065688b5 | ||
|
|
5a1012fb0f | ||
|
|
4b6143c293 | ||
|
|
b6601b0d9a | ||
|
|
2870a1dd49 | ||
|
|
6249f7e293 | ||
|
|
6f9545e097 | ||
|
|
8095ba5cf9 | ||
|
|
e02128e5a3 | ||
|
|
2567b8c8b8 | ||
|
|
5bfcdec471 | ||
|
|
6609686a2b | ||
|
|
709aaf2285 | ||
|
|
6b3908d4dc | ||
|
|
9d19d02a0a | ||
|
|
533b059947 | ||
|
|
2a7c1dc4e4 | ||
|
|
07a920ed18 | ||
|
|
db36c874a0 | ||
|
|
cc58af74d6 | ||
|
|
1bcb95a9f0 | ||
|
|
e6a0216faf | ||
|
|
283ef46ac5 | ||
|
|
b4b1857562 | ||
|
|
c46c56bbf9 | ||
|
|
62ce2f6cac | ||
|
|
631c7befad | ||
|
|
bc18c34d60 | ||
|
|
6b6a1891c1 | ||
|
|
8879b115ef | ||
|
|
99c4c32d6d | ||
|
|
857da7774b | ||
|
|
3407e6bd1a | ||
|
|
553ad240f0 | ||
|
|
964ce1bb5a | ||
|
|
995aa6eddf | ||
|
|
095805e3ad | ||
|
|
b461ed238c | ||
|
|
01e7124189 | ||
|
|
acd3ac2f98 | ||
|
|
b50e4209e1 | ||
|
|
147b4e870c | ||
|
|
df8327d14c | ||
|
|
fb4d4b5953 | ||
|
|
de3701c045 | ||
|
|
9f9b7934cb | ||
|
|
bcded1dd17 | ||
|
|
8503af75ba | ||
|
|
158a50f1aa | ||
|
|
61da552dd6 |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,5 +1,8 @@
|
|||||||
# Ignore test fixtures in GitHub Languages
|
# Ignore test fixtures in GitHub Languages
|
||||||
# See https://github.com/github/linguist#vendored-code
|
# See https://github.com/github/linguist#vendored-code
|
||||||
|
examples/* linguist-vendored
|
||||||
|
utils/* linguist-vendored
|
||||||
|
test/* linguist-vendored
|
||||||
packages/*/test/* linguist-vendored
|
packages/*/test/* linguist-vendored
|
||||||
|
|
||||||
# Go build fails with Windows line endings.
|
# Go build fails with Windows line endings.
|
||||||
|
|||||||
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -8,6 +8,7 @@
|
|||||||
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
|
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
|
||||||
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
|
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
|
||||||
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
|
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
|
||||||
|
/packages/now-cli/src/commands/env @styfle @lucleray
|
||||||
/packages/now-client @leo @rdev
|
/packages/now-client @leo @rdev
|
||||||
/packages/now-build-utils @styfle @AndyBitz
|
/packages/now-build-utils @styfle @AndyBitz
|
||||||
/packages/now-node @styfle @tootallnate @lucleray
|
/packages/now-node @styfle @tootallnate @lucleray
|
||||||
|
|||||||
2
.github/CODE_OF_CONDUCT.md
vendored
2
.github/CODE_OF_CONDUCT.md
vendored
@@ -55,7 +55,7 @@ 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
|
reported by contacting the project team at [coc@vercel.com](mailto:coc@vercel.com). All
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
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
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
|||||||
8
.github/CONTRIBUTING.md
vendored
8
.github/CONTRIBUTING.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Issue](https://github.com/zeit/now/issues/new) or [Spectrum](https://spectrum.chat/zeit) with the owners of this repository before submitting a Pull Request.
|
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/zeit/now/discussions/new) with the owners of this repository before submitting a Pull Request.
|
||||||
|
|
||||||
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Unit tests are run locally with `jest` and execute quickly because they are test
|
|||||||
|
|
||||||
### Integration tests
|
### Integration tests
|
||||||
|
|
||||||
Integration tests create deployments to your ZEIT account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
|
Integration tests create deployments to your Vercel account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
|
||||||
|
|
||||||
```
|
```
|
||||||
[Error: Fetched page https://test-8ashcdlew.now.sh/root.js does not contain hello Root!. Instead it contains An error occurred with this application.
|
[Error: Fetched page https://test-8ashcdlew.now.sh/root.js does not contain hello Root!. Instead it contains An error occurred with this application.
|
||||||
@@ -92,7 +92,7 @@ Sometimes you want to test changes to a Builder against an existing project, may
|
|||||||
2. Run `yarn build` to compile typescript and other build steps
|
2. Run `yarn build` to compile typescript and other build steps
|
||||||
3. Run `npm pack` to create a tarball file
|
3. Run `npm pack` to create a tarball file
|
||||||
4. Run `now *.tgz` to upload the tarball file and get a URL
|
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
|
5. Edit any existing `vercel.json` project and replace `use` with the URL
|
||||||
6. Run `now` or `now dev` to deploy with the experimental Builder
|
6. Run `now` or `now dev` to deploy with the experimental Builder
|
||||||
|
|
||||||
## Add a New Framework
|
## Add a New Framework
|
||||||
@@ -102,4 +102,4 @@ You can add support for a new Framework by creating a Pull Request for this repo
|
|||||||
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.
|
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.
|
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.
|
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.
|
4. After your Pull Request has been merged and released, other users can select the example on the Vercel dashboard and deploy it.
|
||||||
|
|||||||
8
.github/EXAMPLE_README_TEMPLATE.md
vendored
8
.github/EXAMPLE_README_TEMPLATE.md
vendored
@@ -1,16 +1,16 @@
|
|||||||
# [Name] Example
|
# [Name] Example
|
||||||
|
|
||||||
This directory is a brief example of a [Name](site-link) site that can be deployed with ZEIT Now and zero configuration.
|
This directory is a brief example of a [Name](site-link) site that can be deployed with Vercel and zero configuration.
|
||||||
|
|
||||||
## Deploy Your Own
|
## Deploy Your Own
|
||||||
|
|
||||||
Deploy your own [Name] project with ZEIT Now.
|
Deploy your own [Name] project with Vercel.
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
||||||
|
|
||||||
### How We Created This Example
|
### 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:
|
To get started with [Name] on Vercel, you can use the [CLI Tool Used](CLI-link) to initialize the project:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ now init charge
|
$ now init charge
|
||||||
|
|||||||
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
11
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: Bug Report
|
||||||
|
url: https://vercel.com/support/request
|
||||||
|
about: Report a bug using the Vercel support form
|
||||||
|
- name: Feature Request
|
||||||
|
url: https://github.com/zeit/now/discussions/new
|
||||||
|
about: Request a feature to be added to the platform
|
||||||
|
- name: Ask a Question
|
||||||
|
url: https://github.com/zeit/now/discussions/new
|
||||||
|
about: Ask questions and discuss with other community members
|
||||||
8
.github/workflows/cancel.yml
vendored
8
.github/workflows/cancel.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: Cancel
|
name: Cancel
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '*'
|
- '**'
|
||||||
- '!master'
|
- '!master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,8 +11,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 3
|
timeout-minutes: 3
|
||||||
steps:
|
steps:
|
||||||
- uses: styfle/cancel-workflow-action@0.2.0
|
- uses: styfle/cancel-workflow-action@0.3.1
|
||||||
with:
|
with:
|
||||||
workflow_id: 435869
|
workflow_id: 849295, 849296, 849297, 849298
|
||||||
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}
|
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
109
.github/workflows/continuous-integration.yml
vendored
109
.github/workflows/continuous-integration.yml
vendored
@@ -1,109 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- '!*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-unit:
|
|
||||||
name: Unit Tests
|
|
||||||
timeout-minutes: 15
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
node: [10, 12]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- run: git fetch origin master --depth=10
|
|
||||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
- run: yarn install
|
|
||||||
- run: yarn run build
|
|
||||||
- run: yarn run test-lint
|
|
||||||
- run: yarn run test-unit --clean false
|
|
||||||
- name: Upload Artifact
|
|
||||||
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
|
|
||||||
uses: actions/upload-artifact@v1
|
|
||||||
with:
|
|
||||||
name: test-unit-output
|
|
||||||
path: packages/now-cli/.nyc_output
|
|
||||||
|
|
||||||
test-integration:
|
|
||||||
name: Integration Tests
|
|
||||||
timeout-minutes: 120
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- run: git fetch origin master --depth=10
|
|
||||||
- run: git fetch origin ${{ github.ref }} --depth=10
|
|
||||||
- run: yarn install
|
|
||||||
- run: yarn run build
|
|
||||||
- run: yarn test-integration-once --clean false
|
|
||||||
|
|
||||||
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
|
|
||||||
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -20,7 +20,12 @@ jobs:
|
|||||||
run: yarn install --check-files --frozen-lockfile
|
run: yarn install --check-files --frozen-lockfile
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build
|
run: yarn build
|
||||||
|
env:
|
||||||
|
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||||
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: yarn publish-from-github
|
run: yarn publish-from-github
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
|
||||||
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
|
|||||||
33
.github/workflows/test-integration-cli.yml
vendored
Normal file
33
.github/workflows/test-integration-cli.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: CLI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '!*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: CLI
|
||||||
|
timeout-minutes: 30
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
node: [10, 12]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git fetch origin master --depth=10
|
||||||
|
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn run build
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
- run: yarn test-integration-cli --clean false
|
||||||
|
env:
|
||||||
|
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||||
|
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||||
36
.github/workflows/test-integration-dev.yml
vendored
Normal file
36
.github/workflows/test-integration-dev.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name: Dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '!*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Dev
|
||||||
|
timeout-minutes: 45
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
node: [10, 12]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git fetch origin master --depth=10
|
||||||
|
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||||
|
- name: Install Hugo
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn run build
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
- run: yarn test-integration-dev --clean false
|
||||||
|
env:
|
||||||
|
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||||
|
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||||
25
.github/workflows/test-integration-once.yml
vendored
Normal file
25
.github/workflows/test-integration-once.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: E2E
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '!*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: E2E
|
||||||
|
timeout-minutes: 120
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git fetch origin master --depth=10
|
||||||
|
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn run build
|
||||||
|
- run: yarn test-integration-once --clean false
|
||||||
|
env:
|
||||||
|
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
|
||||||
|
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}
|
||||||
34
.github/workflows/test-unit.yml
vendored
Normal file
34
.github/workflows/test-unit.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Unit
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '!*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Unit
|
||||||
|
timeout-minutes: 15
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
node: [10, 12]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git fetch origin master --depth=10
|
||||||
|
- run: git fetch origin ${{ github.ref }} --depth=10
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
- run: yarn install
|
||||||
|
- run: yarn run build
|
||||||
|
- run: yarn run lint
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run lint once
|
||||||
|
- run: yarn run test-unit --clean false
|
||||||
|
- run: yarn workspace vercel run coverage
|
||||||
|
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run coverage once
|
||||||
|
env:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -6,21 +6,26 @@ npm-debug.log
|
|||||||
yarn-error.log
|
yarn-error.log
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
|
coverage.lcov
|
||||||
*.swp
|
*.swp
|
||||||
*.bak
|
*.bak
|
||||||
*.tgz
|
*.tgz
|
||||||
packages/now-cli/.builders
|
packages/now-cli/.builders
|
||||||
packages/now-cli/assets
|
packages/now-cli/assets
|
||||||
packages/now-cli/src/util/dev/templates/*.ts
|
packages/now-cli/src/util/dev/templates/*.ts
|
||||||
|
packages/now-cli/src/util/constants.ts
|
||||||
packages/now-cli/test/**/yarn.lock
|
packages/now-cli/test/**/yarn.lock
|
||||||
!packages/now-cli/test/dev/**/yarn.lock
|
!packages/now-cli/test/dev/**/yarn.lock
|
||||||
packages/now-cli/test/**/node_modules
|
packages/now-cli/test/**/node_modules
|
||||||
packages/now-cli/test/dev/fixtures/08-hugo/hugo
|
packages/now-cli/test/dev/fixtures/08-hugo/hugo
|
||||||
packages/now-cli/test/dev/fixtures/**/dist
|
packages/now-cli/test/dev/fixtures/**/dist
|
||||||
packages/now-cli/test/dev/fixtures/**/public
|
packages/now-cli/test/dev/fixtures/**/public
|
||||||
|
packages/now-cli/test/dev/fixtures/**/.now
|
||||||
|
packages/now-cli/test/dev/fixtures/**/.vercel
|
||||||
packages/now-cli/test/fixtures/integration
|
packages/now-cli/test/fixtures/integration
|
||||||
test/lib/deployment/failed-page.txt
|
test/lib/deployment/failed-page.txt
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.next
|
.next
|
||||||
.env
|
/.env
|
||||||
public
|
/public
|
||||||
|
__pycache__
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
The following page is a reference for how to create a Runtime using the available Runtime API.
|
The following page is a reference for how to create a Runtime using the available Runtime API.
|
||||||
|
|
||||||
A Runtime is an npm module that exposes a `build` function and optionally an `analyze` function and `prepareCache` function.
|
A Runtime is an npm module that exposes a `build` function and optionally an `analyze` function and `prepareCache` function.
|
||||||
Official Runtimes are published to [npmjs.com](https://npmjs.com) as a package and referenced in the `use` property of the `now.json` configuration file.
|
Official Runtimes are published to [npmjs.com](https://npmjs.com) as a package and referenced in the `use` property of the `vercel.json` configuration file.
|
||||||
However, the `use` property will work with any [npm install argument](https://docs.npmjs.com/cli/install) such as a git repo url which is useful for testing your Runtime.
|
However, the `use` property will work with any [npm install argument](https://docs.npmjs.com/cli/install) such as a git repo url which is useful for testing your Runtime.
|
||||||
|
|
||||||
See the [Runtimes Documentation](https://zeit.co/docs/runtimes) to view example usage.
|
See the [Runtimes Documentation](https://vercel.com/docs/runtimes) to view example usage.
|
||||||
|
|
||||||
## Runtime Exports
|
## Runtime Exports
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ The latest and suggested version is `3`.
|
|||||||
|
|
||||||
### `analyze`
|
### `analyze`
|
||||||
|
|
||||||
An **optional** exported function that returns a unique fingerprint used for the purpose of [build de-duplication](https://zeit.co/docs/v2/advanced/concepts/immutability#deduplication-algorithm). If the `analyze` function is not supplied, a random fingerprint is assigned to each build.
|
An **optional** exported function that returns a unique fingerprint used for the purpose of [build de-duplication](https://vercel.com/docs/v2/platform/deployments#deduplication). If the `analyze` function is not supplied, a random fingerprint is assigned to each build.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
export analyze({
|
export analyze({
|
||||||
@@ -43,7 +43,7 @@ export analyze(options: AnalyzeOptions) {
|
|||||||
|
|
||||||
A **required** exported function that returns a [Serverless Function](#serverless-function).
|
A **required** exported function that returns a [Serverless Function](#serverless-function).
|
||||||
|
|
||||||
What's a Serverless Function? Read about [Serverless Function concepts](https://zeit.co/docs/v2/deployments/concepts/lambdas) to learn more.
|
What's a Serverless Function? Read about [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) to learn more.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
build({
|
build({
|
||||||
@@ -109,7 +109,7 @@ export prepareCache(options: PrepareCacheOptions) {
|
|||||||
|
|
||||||
### `shouldServe`
|
### `shouldServe`
|
||||||
|
|
||||||
An **optional** exported function that is only used by `now dev` in [Now CLI](https:///download) and indicates whether a [Runtime](https://zeit.co/docs/v2/advanced/runtimes) wants to be responsible for building a certain request path.
|
An **optional** exported function that is only used by `now dev` in [Now CLI](https:///download) and indicates whether a [Runtime](https://vercel.com/docs/runtimes) wants to be responsible for building a certain request path.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
shouldServe({
|
shouldServe({
|
||||||
@@ -143,7 +143,7 @@ The exported functions [`analyze`](#analyze), [`build`](#build), and [`prepareCa
|
|||||||
- `entrypoint`: Name of entrypoint file for this particular build job. Value `files[entrypoint]` is guaranteed to exist and be a valid [File](#files) reference. `entrypoint` is always a discrete file and never a glob, since globs are expanded into separate builds at deployment time.
|
- `entrypoint`: Name of entrypoint file for this particular build job. Value `files[entrypoint]` is guaranteed to exist and be a valid [File](#files) reference. `entrypoint` is always a discrete file and never a glob, since globs are expanded into separate builds at deployment time.
|
||||||
- `workPath`: A writable temporary directory where you are encouraged to perform your build process. This directory will be populated with the restored cache from the previous run (if any) for [`analyze`](#analyze) and [`build`](#build).
|
- `workPath`: A writable temporary directory where you are encouraged to perform your build process. This directory will be populated with the restored cache from the previous run (if any) for [`analyze`](#analyze) and [`build`](#build).
|
||||||
- `cachePath`: A writable temporary directory where you can build a cache for the next run. This is only passed to `prepareCache`.
|
- `cachePath`: A writable temporary directory where you can build a cache for the next run. This is only passed to `prepareCache`.
|
||||||
- `config`: An arbitrary object passed from by the user in the [Build definition](#defining-the-build-step) in `now.json`.
|
- `config`: An arbitrary object passed from by the user in the [Build definition](#defining-the-build-step) in `vercel.json`.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ Check out our [Node.js Runtime](https://github.com/zeit/now/tree/master/packages
|
|||||||
|
|
||||||
### Execution Context
|
### Execution Context
|
||||||
|
|
||||||
A [Serverless Function](https://zeit.co/docs/v2/advanced/concepts/lambdas) is created where the Runtime logic is executed. The lambda is run using the Node.js 8 runtime. A brand new sandbox is created for each deployment, for security reasons. The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
|
A [Serverless Function](https://vercel.com/docs/v2/serverless-functions/introduction) is created where the Runtime logic is executed. The lambda is run using the Node.js 8 runtime. A brand new sandbox is created for each deployment, for security reasons. The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
|
||||||
|
|
||||||
All the APIs you export ([`analyze`](#analyze), [`build`](#build) and [`prepareCache`](#preparecache)) are not guaranteed to be run in the same process, but the filesystem we expose (e.g.: `workPath` and the results of calling [`getWriteableDirectory`](#getWriteableDirectory) ) is retained.
|
All the APIs you export ([`analyze`](#analyze), [`build`](#build) and [`prepareCache`](#preparecache)) are not guaranteed to be run in the same process, but the filesystem we expose (e.g.: `workPath` and the results of calling [`getWriteableDirectory`](#getWriteableDirectory) ) is retained.
|
||||||
|
|
||||||
@@ -165,8 +165,6 @@ When a new build is created, we pre-populate the `workPath` supplied to `analyze
|
|||||||
|
|
||||||
The `analyze` step can modify that directory, and it will not be re-created when it's supplied to `build` and `prepareCache`.
|
The `analyze` step can modify that directory, and it will not be re-created when it's supplied to `build` and `prepareCache`.
|
||||||
|
|
||||||
To learn how the cache key is computed and invalidated, refer to the [overview](https://zeit.co/docs/v2/advanced/runtimes#technical-details).
|
|
||||||
|
|
||||||
### Accessing Environment and Secrets
|
### Accessing Environment and Secrets
|
||||||
|
|
||||||
The env and secrets specified by the user as `build.env` are passed to the Runtime process. This means you can access user env via `process.env` in Node.js.
|
The env and secrets specified by the user as `build.env` are passed to the Runtime process. This means you can access user env via `process.env` in Node.js.
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -1,35 +1,27 @@
|
|||||||

|
<p align="center">
|
||||||
|
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
|
||||||
|
<h3 align="center">Vercel</h3>
|
||||||
|
<p align="center">Develop. Preview. Ship.</p>
|
||||||
|
</p>
|
||||||
|
|
||||||
[](https://github.com/zeit/now/actions?workflow=CI)
|
[](https://github.com/zeit/now/actions?workflow=CI)
|
||||||
[](https://spectrum.chat/zeit)
|
[](https://github.com/zeit/now/discussions)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command:
|
Get started by [Importing a Git Project](https://vercel.com/import) and use `git push` to deploy. Alternatively, you can [install Vercel CLI](https://vercel.com/download).
|
||||||
|
|
||||||
```
|
|
||||||
npm i -g now
|
|
||||||
```
|
|
||||||
|
|
||||||
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 # Deploy to the cloud
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs/now-cli).
|
For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
|
||||||
|
|
||||||
## Caught a Bug?
|
## Caught a Bug?
|
||||||
|
|
||||||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
||||||
2. Install dependencies with `yarn install`
|
2. Install dependencies with `yarn install`
|
||||||
3. Compile the code: `yarn build`
|
3. Compile the code: `yarn build`
|
||||||
4. Link the package to the global module directory: `yarn link`
|
4. Link the package to the global module directory: `cd ./packages/now-cli && yarn link`
|
||||||
5. You can now start using `now` anywhere inside the command line
|
5. You can start using `vercel` anywhere inside the command line
|
||||||
|
|
||||||
As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.
|
As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ export function withApiHandler(handler: Handler): Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req.method !== 'GET') {
|
if (req.method !== 'GET') {
|
||||||
return res.status(404).json({
|
return res.status(405).json({
|
||||||
error: {
|
error: {
|
||||||
code: 'not_found',
|
code: 'method_not_allowed',
|
||||||
message: 'Only GET requests are supported for this endpoint.',
|
message: 'Only GET requests are supported for this endpoint.',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import frameworkList, { Framework } from '../packages/frameworks';
|
|||||||
const frameworks = (frameworkList as Framework[]).map(frameworkItem => {
|
const frameworks = (frameworkList as Framework[]).map(frameworkItem => {
|
||||||
const framework = {
|
const framework = {
|
||||||
...frameworkItem,
|
...frameworkItem,
|
||||||
hasDetectors: Boolean(frameworkItem.detectors),
|
|
||||||
detectors: undefined,
|
detectors: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -20,5 +19,8 @@ export default withApiHandler(async function(
|
|||||||
req: NowRequest,
|
req: NowRequest,
|
||||||
res: NowResponse
|
res: NowResponse
|
||||||
) {
|
) {
|
||||||
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||||
|
res.setHeader('Access-Control-Allow-Methods', 'GET');
|
||||||
|
res.setHeader('Access-Control-Allow-Headers', 'Authorization, Accept, Content-Type');
|
||||||
return res.status(200).json(frameworks);
|
return res.status(200).json(frameworks);
|
||||||
});
|
});
|
||||||
|
|||||||
8
codecov.yml
Normal file
8
codecov.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
codecov:
|
||||||
|
require_ci_to_pass: yes
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
status:
|
||||||
|
project: off
|
||||||
|
patch: off
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ the provider couldn’t solve the requested challenges.
|
|||||||
|
|
||||||
## How to Fix It
|
## How to Fix It
|
||||||
|
|
||||||
If your domain is pointing to ZEIT World DNS and you’re getting this error,
|
If your domain is pointing to Vercel DNS and you’re getting this error,
|
||||||
it could be that:
|
it could be that:
|
||||||
|
|
||||||
- The domain was acquired recently, and it might not be ready for use yet.
|
- The domain was acquired recently, and it might not be ready for use yet.
|
||||||
@@ -17,11 +17,11 @@ it could be that:
|
|||||||
When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient,
|
When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient,
|
||||||
it might take a while for these to be ready.
|
it might take a while for these to be ready.
|
||||||
|
|
||||||
If your domain is _not_ pointing to ZEIT World DNS and you’re getting this
|
If your domain is _not_ pointing to Vercel DNS and you’re getting this
|
||||||
error, the following methods could help:
|
error, the following methods could help:
|
||||||
|
|
||||||
- When solving challenges *manually*, ensure that the TXT
|
- When solving challenges _manually_, ensure that the TXT
|
||||||
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
|
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
|
||||||
|
|
||||||
- If you are not solving the challenges manually you must ensure that you have an
|
- If you are not solving the challenges manually you must ensure that you have an
|
||||||
`ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
`ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ used an unknown or invalid dc identifier.
|
|||||||
|
|
||||||
#### Possible Ways to Fix It
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
Check your `now.json` or `--regions` flag and
|
Check your `vercel.json` or `--regions` flag and
|
||||||
make sure you are using a valid string. Regions
|
make sure you are using a valid string. Regions
|
||||||
and DCs have to be in *lowercase*.
|
and DCs have to be in _lowercase_.
|
||||||
|
|
||||||
**Valid region identifiers**:
|
**Valid region identifiers**:
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ and DCs have to be in *lowercase*.
|
|||||||
- `gru`
|
- `gru`
|
||||||
- `iad`
|
- `iad`
|
||||||
|
|
||||||
In `now-cli`, they currently are transformed to
|
In `now-cli`, they currently are transformed to
|
||||||
DC identifiers before being sent to our APIs.
|
DC identifiers before being sent to our APIs.
|
||||||
|
|
||||||
**Valid DC identifiers**:
|
**Valid DC identifiers**:
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
When generating a certificate, we have to prove ownership over the domain
|
When generating a certificate, we have to prove ownership over the domain
|
||||||
for the Certificate Authority (CA) that issues it. We also run some pretests
|
for the Certificate Authority (CA) that issues it. We also run some pretests
|
||||||
to make sure the DNS is properly configured before submitting the request to
|
to make sure the DNS is properly configured before submitting the request to
|
||||||
the CA. This error means that these pretests did not succeed.
|
the CA. This error means that these pretests did not succeed.
|
||||||
|
|
||||||
## How to Fix It
|
## How to Fix It
|
||||||
|
|
||||||
If your domain is pointing to ZEIT World DNS and you’re getting this error,
|
If your domain is pointing to Vercel DNS and you’re getting this error,
|
||||||
it could be that:
|
it could be that:
|
||||||
|
|
||||||
- The domain was acquired recently, and it might not be ready for use yet.
|
- The domain was acquired recently, and it might not be ready for use yet.
|
||||||
@@ -18,6 +18,6 @@ it could be that:
|
|||||||
When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient,
|
When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient,
|
||||||
it might take a while for these to be ready.
|
it might take a while for these to be ready.
|
||||||
|
|
||||||
If your domain is _not_ pointing to ZEIT World DNS and you’re getting this
|
If your domain is _not_ pointing to Vercel DNS and you’re getting this
|
||||||
error, you must ensure that you have an `ALIAS` and `CNAME` records in place.
|
error, you must ensure that you have an `ALIAS` and `CNAME` records in place.
|
||||||
Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ You can retrieve both the intended nameservers and TXT verification record for t
|
|||||||
|
|
||||||
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
|
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
|
||||||
|
|
||||||
ZEIT will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
|
Vercel will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
|
||||||
|
|
||||||
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
|
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
|
||||||
|
|
||||||
#### Resources
|
#### Resources
|
||||||
- [ZEIT Domains Documentation](https://zeit.co/docs/v2/domains-and-aliases/adding-a-domain/)
|
|
||||||
- [Zero-Downtime Domain Migration Guide](https://zeit.co/docs/v2/domains-and-aliases/zero-downtime-domain-migration/)
|
- [Vercel Custom Domains Documentation](https://vercel.com/docs/v2/custom-domains)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Wrap the `RegExp` part of your `source` as an un-named parameter.
|
|||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
source: '/feedback/(?!general)',
|
source: '/feedback/(?!general)',
|
||||||
destination: '/feedback/general'
|
destination: '/api/feedback/general'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -22,7 +22,27 @@ Wrap the `RegExp` part of your `source` as an un-named parameter.
|
|||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
source: '/feedback/((?!general).*)',
|
source: '/feedback/((?!general).*)',
|
||||||
destination: '/feedback/general'
|
destination: '/api/feedback/general'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Ensure any segments used in the `destination` property are also used in the `source` property.
|
||||||
|
|
||||||
|
**Before**
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
source: '/feedback/:type',
|
||||||
|
destination: '/api/feedback/:id'
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**After**
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
source: '/feedback/:id',
|
||||||
|
destination: '/api/feedback/:id'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ The `--token` flag was specified, but its contents are invalid.
|
|||||||
|
|
||||||
The `--token` flag must only contain numbers (0-9) and letters from the alphabet (a-z and A-Z). This needs to be the token of the user account as which you'd like to act.
|
The `--token` flag must only contain numbers (0-9) and letters from the alphabet (a-z and A-Z). This needs to be the token of the user account as which you'd like to act.
|
||||||
|
|
||||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# Missing Environment Variables While Developing
|
# Missing Environment Variables While Developing
|
||||||
|
|
||||||
#### Why This Error Occurred
|
#### Why This Error Occurred
|
||||||
You ran `now dev` inside a project that contains a `now.json` file with `env` or `build.env` properties that use [Now Secrets](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets).
|
|
||||||
|
You ran `now dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Now Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
|
||||||
|
|
||||||
In order to use environment variables in your project locally that have values defined using the Now Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env` or `.env.build` file.
|
In order to use environment variables in your project locally that have values defined using the Now Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env` or `.env.build` file.
|
||||||
|
|
||||||
@@ -23,4 +24,4 @@ TEST=value
|
|||||||
|
|
||||||
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
||||||
|
|
||||||
For more information on Environment Variables in development, [see the documentation](https://zeit.co/docs/v2/development/environment-variables/).
|
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/v2/build-step#environment-variables).
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ The `--scope` flag was specified, but there's no value for it available.
|
|||||||
|
|
||||||
In order to make it work, you need to specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act or the username or ID of a user you'd like to act as.
|
In order to make it work, you need to specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act or the username or ID of a user you'd like to act as.
|
||||||
|
|
||||||
As an example, if your team URL is `https://zeit.co/teams/zeit`, you would set `--scope` to `zeit`.
|
As an example, if your team URL is `https://vercel.com/teams/zeit`, you would set `--scope` to `zeit`.
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ The `--token` flag was specified, but there's no value for it available.
|
|||||||
|
|
||||||
In order to make it work, you need to specify a value for the `--token` flag. This needs to be the token of the user account as which you'd like to act.
|
In order to make it work, you need to specify a value for the `--token` flag. This needs to be the token of the user account as which you'd like to act.
|
||||||
|
|
||||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ You're running Now CLI in a non-terminal context and there are no credentials av
|
|||||||
|
|
||||||
#### Possible Ways to Fix It
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||||
- Ensure that both `~/now/auth.json` and `~/now/config.json` exist
|
- Ensure that both `~/vercel/auth.json` and `~/vercel/config.json` exist
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ In turn, they would have to take the value of the `--token` flag into considerat
|
|||||||
|
|
||||||
#### Possible Ways to Fix It
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://zeit.co/teams/zeit`, the value can be `zeit`) or the username or ID of a user you'd like to act as.
|
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://vercel.com/teams/zeit`, the value can be `zeit`) or the username or ID of a user you'd like to act as.
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Serverless:
|
|||||||
- Runs `npm run now-build`
|
- Runs `npm run now-build`
|
||||||
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
|
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
|
||||||
- No runtime dependencies, meaning smaller lambda functions
|
- No runtime dependencies, meaning smaller lambda functions
|
||||||
- Optimized for fast [cold start](https://zeit.co/blog/serverless-ssr#cold-start)
|
- Optimized for fast [cold start](https://vercel.com/blog/serverless-ssr#cold-start)
|
||||||
|
|
||||||
#### Possible Ways to Fix It
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
|
|||||||
11
errors/now-next-routes-manifest.md
Normal file
11
errors/now-next-routes-manifest.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Routes Manifest Could Not Be Found
|
||||||
|
|
||||||
|
#### Why This Error Occurred
|
||||||
|
|
||||||
|
This could be caused by a failure during the build or an incorrect output directory being configured for your Next.js project.
|
||||||
|
|
||||||
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
|
Check for any build errors in the logs and ensure that the output directory setting is either not changed or is pointing to the location of the `.next` output folder (`distDir`).
|
||||||
|
|
||||||
|
If you are running `next export` you should **not** need to customize the output directory to `out` since the builder automatically detects `next export` being run and uses the output from it.
|
||||||
@@ -19,7 +19,7 @@ the provided `$PORT` that the builder expects the server to bind to.
|
|||||||
For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
||||||
(port) option to bind to the `$PORT` specified from the builder:
|
(port) option to bind to the `$PORT` specified from the builder:
|
||||||
|
|
||||||
> *In Windows environments, reference the `PORT` environment variable with `%PORT%`*
|
> _In Windows environments, reference the `PORT` environment variable with `%PORT%`_
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
@@ -34,7 +34,3 @@ For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
|||||||
Consult your static builder program's `--help` or documentation to figure out what
|
Consult your static builder program's `--help` or documentation to figure out what
|
||||||
the command line flag to bind to a specific port is (in many cases, it is one of:
|
the command line flag to bind to a specific port is (in many cases, it is one of:
|
||||||
`-p` / `-P` / `--port`).
|
`-p` / `-P` / `--port`).
|
||||||
|
|
||||||
### Useful Links
|
|
||||||
|
|
||||||
- [`@now/static-build` Local Development Documentation](https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build#local-development)
|
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ You tried to use `now scale` on a path alias (`now alias -r rules.json`).
|
|||||||
Path aliases are routes to instances. Instances can be scaled independent from each other.
|
Path aliases are routes to instances. Instances can be scaled independent from each other.
|
||||||
You can view path aliases by running `now alias ls <id>`.
|
You can view path aliases by running `now alias ls <id>`.
|
||||||
|
|
||||||
Documentation for Path Aliases can be found [here](https://zeit.co/docs/features/path-aliases).
|
Documentation for Path Aliases can be found [here](https://vercel.com/docs/features/path-aliases).
|
||||||
|
|||||||
@@ -3,18 +3,18 @@
|
|||||||
## Why This Error Occurred
|
## Why This Error Occurred
|
||||||
|
|
||||||
When generating a certificate, we have to prove ownership over the domain
|
When generating a certificate, we have to prove ownership over the domain
|
||||||
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
|
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
|
||||||
the requested challenge consists of adding TXT DNS records so, when the domain does not
|
the requested challenge consists of adding TXT DNS records so, when the domain does not
|
||||||
point to ZEIT World DNS, we cannot create the records to solve the challenge.
|
point to Vercel DNS, we cannot create the records to solve the challenge.
|
||||||
|
|
||||||
## How to Fix It
|
## How to Fix It
|
||||||
|
|
||||||
To generate a certificate solving challenges manually, you must add the given `TXT` records with
|
To generate a certificate solving challenges manually, you must add the given `TXT` records with
|
||||||
the appropriate name to your DNS. Then, after verifying that the CA can read the records,
|
the appropriate name to your DNS. Then, after verifying that the CA can read the records,
|
||||||
you can rerun the issuance command.
|
you can rerun the issuance command.
|
||||||
|
|
||||||
In case you want to start issuing a certificate to get the records you have to add or to
|
In case you want to start issuing a certificate to get the records you have to add or to
|
||||||
get those records again in the console, You can run the issuance command including the
|
get those records again in the console, You can run the issuance command including the
|
||||||
`--challenge-only` option. This way the CLI will output the challenges information and,
|
`--challenge-only` option. This way the CLI will output the challenges information and,
|
||||||
after adding those records, you can rerun the command without `--challenge-only` to finish
|
after adding those records, you can rerun the command without `--challenge-only` to finish
|
||||||
issuance.
|
issuance.
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ setting. This isn't supported yet.
|
|||||||
|
|
||||||
#### Possible Ways to Fix It
|
#### Possible Ways to Fix It
|
||||||
|
|
||||||
Ensure your scale settings (in `now.json`, the command you're running
|
Ensure your scale settings (in `vercel.json`, the command you're running
|
||||||
or from a previous deployment who's alias you're trying to overwrite) has
|
or from a previous deployment who's alias you're trying to overwrite) has
|
||||||
the `min` scale setting set to `0`. You can do this by running
|
the `min` scale setting set to `0`. You can do this by running
|
||||||
|
|
||||||
```
|
```
|
||||||
now scale <deployment> 0 10
|
now scale <deployment> 0 10
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ but it couldn't do so within the allotted time (defaults to 2 minutes).
|
|||||||
Instance verification is the process of ensuring that after
|
Instance verification is the process of ensuring that after
|
||||||
your deployment is ready, we can actually run (instantiate) your code.
|
your deployment is ready, we can actually run (instantiate) your code.
|
||||||
|
|
||||||
If you configured [regions or scale](https://zeit.co/docs/features/scaling),
|
If you configured [regions or scale](https://vercel.com/docs/features/scaling),
|
||||||
we ensure the minimums and maximums are met for the regions you enabled.
|
we ensure the minimums and maximums are met for the regions you enabled.
|
||||||
|
|
||||||
If you think your code is taking too long to instantiate, this can be due
|
If you think your code is taking too long to instantiate, this can be due
|
||||||
|
|||||||
22
examples/README.md
vendored
22
examples/README.md
vendored
@@ -1,18 +1,18 @@
|
|||||||
# ZEIT Now Examples
|
# Vercel Examples
|
||||||
|
|
||||||
This is the public list of examples for **ZEIT Now**.
|
This is the public list of examples for **Vercel**.
|
||||||
|
|
||||||
All of these ready to deploy examples feature a frontend framework or static site, created with zero configuration using the CLI tools they provide.
|
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.
|
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?
|
## What is Vercel?
|
||||||
|
|
||||||
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.
|
Vercel 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?
|
## 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:
|
This repository consists of multiple examples, created for use with the [Vercel](https://vercel.com) 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)
|
- [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
|
- [Contributing Guidelines](https://github.com/zeit/now/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the Now Examples repository
|
||||||
@@ -22,7 +22,7 @@ We recommend familiarizing yourself with the above sections, particularly if you
|
|||||||
|
|
||||||
## Deploying Examples
|
## 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:
|
To get started using any of these examples as your own project, [install Now](https://vercel.com/download) and use either of the following commands in your terminal:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
now init # Pick an example in the CLI
|
now init # Pick an example in the CLI
|
||||||
@@ -54,9 +54,9 @@ For example, the previous `nodejs` example showed a static frontend with a Node.
|
|||||||
|
|
||||||
## Migrating and Upgrading
|
## 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 have an existing project you would like to deploy with Vercel, we recommend reading our guide on [migrating to Vercel and zero configuration](https://vercel.com/guides/migrate-to-vercel). 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.
|
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://vercel.com/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
|
## How to Contribute
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ Contributing to Now Examples should be an enjoyable experience, as such we have
|
|||||||
|
|
||||||
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
|
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.
|
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 [GitHub Discussions](https://github.com/zeit/now/discussions) where we will do our best to help you.
|
||||||
|
|
||||||
## Reporting Issues
|
## Reporting Issues
|
||||||
|
|
||||||
@@ -80,6 +80,6 @@ Now Examples is an open source project released under the [MIT License](https://
|
|||||||
|
|
||||||
## Get In Touch
|
## 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.
|
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/zeit/now/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
|
||||||
|
|
||||||
[](https://spectrum.chat/zeit)
|
[](https://github.com/zeit/now/discussions)
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# AMP Example
|
# AMP Example
|
||||||
|
|
||||||
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed with ZEIT Now and zero configuration.
|
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed with Vercel and zero configuration.
|
||||||
|
|
||||||
## Deploy Your Own
|
## Deploy Your Own
|
||||||
|
|
||||||
Deploy your own AMP project with ZEIT Now.
|
Deploy your own AMP project with Vercel.
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
||||||
|
|
||||||
_Live Example: https://amp.now-examples.now.sh_
|
_Live Example: https://amp.now-examples.now.sh_
|
||||||
|
|
||||||
### How We Created This Example
|
### How We Created This Example
|
||||||
|
|
||||||
To get started deploying AMP with ZEIT Now, you can use the [Now CLI](https://zeit.co/download) to initialize the project:
|
To get started deploying AMP with Vercel, you can use the [Now CLI](https://vercel.com/download) to initialize the project:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ now init amp
|
$ now init amp
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
# Angular Example
|
# Angular Example
|
||||||
|
|
||||||
This directory is a brief example of an [Angular](https://angular.io/) app that can be deployed with ZEIT Now and zero configuration.
|
This directory is a brief example of an [Angular](https://angular.io/) app that can be deployed with Vercel and zero configuration.
|
||||||
|
|
||||||
## Deploy Your Own
|
## Deploy Your Own
|
||||||
|
|
||||||
Deploy your own Angular project with ZEIT Now.
|
Deploy your own Angular project with Vercel.
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
||||||
|
|
||||||
_Live Example: https://angular.now-examples.now.sh_
|
_Live Example: https://angular.now-examples.now.sh_
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ $ ng new
|
|||||||
|
|
||||||
### Deploying From Your Terminal
|
### Deploying From Your Terminal
|
||||||
|
|
||||||
You can deploy your new Angular project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
You can deploy your new Angular project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ now
|
$ now
|
||||||
|
|||||||
14
examples/assemble/.gitattributes
vendored
14
examples/assemble/.gitattributes
vendored
@@ -1,14 +0,0 @@
|
|||||||
# Enforce Unix newlines
|
|
||||||
*.* text eol=lf
|
|
||||||
*.css text eol=lf
|
|
||||||
*.html text eol=lf
|
|
||||||
*.js text eol=lf
|
|
||||||
*.json text eol=lf
|
|
||||||
*.less text eol=lf
|
|
||||||
*.md text eol=lf
|
|
||||||
*.yml text eol=lf
|
|
||||||
|
|
||||||
*.jpg binary
|
|
||||||
*.gif binary
|
|
||||||
*.png binary
|
|
||||||
*.jpeg binary
|
|
||||||
47
examples/assemble/.gitignore
vendored
47
examples/assemble/.gitignore
vendored
@@ -1,47 +0,0 @@
|
|||||||
# Numerous always-ignore extensions
|
|
||||||
.ruby-version
|
|
||||||
*.diff
|
|
||||||
*.err
|
|
||||||
*.orig
|
|
||||||
*.log
|
|
||||||
*.rej
|
|
||||||
*.swo
|
|
||||||
*.swp
|
|
||||||
*.zip
|
|
||||||
*.vi
|
|
||||||
*~
|
|
||||||
|
|
||||||
# OS or Editor folders
|
|
||||||
*.esproj
|
|
||||||
*.sublime-project
|
|
||||||
*.sublime-workspace
|
|
||||||
._*
|
|
||||||
.cache
|
|
||||||
.DS_Store
|
|
||||||
.idea
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.tmproj
|
|
||||||
nbproject
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Komodo
|
|
||||||
*.komodoproject
|
|
||||||
.komodotools
|
|
||||||
|
|
||||||
# grunt-html-validation
|
|
||||||
validation-status.json
|
|
||||||
validation-report.json
|
|
||||||
|
|
||||||
# Folders to ignore
|
|
||||||
tmp
|
|
||||||
temp
|
|
||||||
TODO.md
|
|
||||||
vendor
|
|
||||||
node_modules
|
|
||||||
bower_components
|
|
||||||
_gh_pages
|
|
||||||
_site
|
|
||||||
_draft
|
|
||||||
.env
|
|
||||||
.env.build
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
README.md
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* assemble-examples <https://github.com/assemble/assemble-examples>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
|
|
||||||
* Licensed under the MIT license.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
grunt.initConfig({
|
|
||||||
assemble: {
|
|
||||||
options: {
|
|
||||||
flatten: true,
|
|
||||||
partials: ['templates/includes/*.hbs'],
|
|
||||||
layoutdir: 'templates/layouts',
|
|
||||||
layout: 'default.hbs',
|
|
||||||
},
|
|
||||||
site: {
|
|
||||||
files: { 'public/index.js': ['templates/*.hbs'] },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Load the Assemble plugin.
|
|
||||||
grunt.loadNpmTasks('assemble');
|
|
||||||
|
|
||||||
// The default task to run with the `grunt` command.
|
|
||||||
grunt.registerTask('default', ['assemble']);
|
|
||||||
};
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# Assemble Example
|
|
||||||
|
|
||||||
This directory is a brief example of a [Assemble](http://assemble.io/) app that can be deployed with ZEIT Now and zero configuration.
|
|
||||||
|
|
||||||
## Deploy Your Own
|
|
||||||
|
|
||||||
Deploy your own Assemble project with ZEIT Now.
|
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/assemble)
|
|
||||||
|
|
||||||
_Live Example: https://assemble.now-examples.now.sh_
|
|
||||||
|
|
||||||
### How We Created This Example
|
|
||||||
|
|
||||||
To get started with Assemble deployed with ZEIT Now, you can use [Now CLI](https://zeit.co/download) to initialize the project:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ now init assemble
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deploying From Your Terminal
|
|
||||||
|
|
||||||
You can deploy your new Assemble project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ now
|
|
||||||
```
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# Blog post
|
|
||||||
|
|
||||||
> This is an example blog post
|
|
||||||
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
||||||
|
|
||||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "assemble-example",
|
|
||||||
"private": true,
|
|
||||||
"description": "Example Assemble project.",
|
|
||||||
"version": "0.1.1",
|
|
||||||
"homepage": "https://github.com/jonschlinkert/assemble-example",
|
|
||||||
"scripts": {
|
|
||||||
"build": "grunt assemble"
|
|
||||||
},
|
|
||||||
"author": {
|
|
||||||
"name": "Jon Schlinkert",
|
|
||||||
"url": "https://github.com/jonschlinkert"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/jonschlinkert/assemble-example.git"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/jonschlinkert/assemble-example/issues"
|
|
||||||
},
|
|
||||||
"licenses": [
|
|
||||||
{
|
|
||||||
"type": "MIT",
|
|
||||||
"url": "https://github.com/jonschlinkert/assemble-example/blob/master/LICENSE-MIT"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"main": "index.js",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.8.0"
|
|
||||||
},
|
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
|
||||||
"assemble": "~0.4.37",
|
|
||||||
"grunt": "~0.4.3",
|
|
||||||
"grunt-cli": "^1.3.2"
|
|
||||||
},
|
|
||||||
"keywords": []
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
title: About
|
|
||||||
description: This is the about page.
|
|
||||||
---
|
|
||||||
<h2>{{description}}</h2>
|
|
||||||
|
|
||||||
{{> button }}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
title: Blog
|
|
||||||
---
|
|
||||||
|
|
||||||
{{md 'content/blog-post.md'}}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
title: Home
|
|
||||||
description: This is the home page.
|
|
||||||
---
|
|
||||||
<h2>{{description}}</h2>
|
|
||||||
|
|
||||||
{{> button }}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
<a href="https://github.com/assemble/assemble" class="btn btn-default">Star Assemble on GitHub!</a>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<meta charset="UTF-8">
|
|
||||||
<title>{{title}}</title>
|
|
||||||
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
|
|
||||||
<link rel="stylesheet" href="http://getbootstrap.com/assets/css/docs.min.css">
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
{{> head }}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
{{> body }}
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
module.exports = api => {
|
|
||||||
api.cache.using(() => {
|
|
||||||
// cache based on the two env vars
|
|
||||||
return (
|
|
||||||
'babel:' +
|
|
||||||
process.env.BABEL_TARGET +
|
|
||||||
' protractor:' +
|
|
||||||
process.env.IN_PROTRACTOR
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
plugins: [
|
|
||||||
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
||||||
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
||||||
],
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@babel/preset-env',
|
|
||||||
{
|
|
||||||
targets:
|
|
||||||
process.env.BABEL_TARGET === 'node'
|
|
||||||
? {
|
|
||||||
node: process.env.IN_PROTRACTOR ? '6' : 'current',
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
browsers: ['last 2 versions'],
|
|
||||||
},
|
|
||||||
loose: true,
|
|
||||||
modules: process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# EditorConfig is awesome: http://EditorConfig.org
|
|
||||||
|
|
||||||
# top-most EditorConfig file
|
|
||||||
root = true
|
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file
|
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
# 2 space indentation
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
41
examples/aurelia/.gitignore
vendored
41
examples/aurelia/.gitignore
vendored
@@ -1,41 +0,0 @@
|
|||||||
|
|
||||||
# You may want to customise this file depending on your Operating System
|
|
||||||
# and the editor that you use.
|
|
||||||
#
|
|
||||||
# We recommend that you use a Global Gitignore for files that are not related
|
|
||||||
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)
|
|
||||||
|
|
||||||
# OS
|
|
||||||
#
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
|
|
||||||
.DS_STORE
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Editors
|
|
||||||
#
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
|
|
||||||
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
|
|
||||||
.idea
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
|
|
||||||
# Dependencies
|
|
||||||
node_modules
|
|
||||||
|
|
||||||
# Compiled files
|
|
||||||
/scripts
|
|
||||||
/src/environment.js
|
|
||||||
/src/environment.ts
|
|
||||||
/dist
|
|
||||||
/test/coverage-jest
|
|
||||||
/test/coverage-karma
|
|
||||||
|
|
||||||
# Environment Variables
|
|
||||||
.env
|
|
||||||
.env.build
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
README.md
|
|
||||||
yarn.lock
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# Aurelia Example
|
|
||||||
|
|
||||||
This directory is a brief example of an [Aurelia](https://aurelia.io/) app that can be deployed with ZEIT Now and zero configuration.
|
|
||||||
|
|
||||||
## Deploy Your Own
|
|
||||||
|
|
||||||
Deploy your own Aurelia project with ZEIT Now.
|
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/aurelia)
|
|
||||||
|
|
||||||
_Live Example: https://aurelia.now-examples.now.sh_
|
|
||||||
|
|
||||||
### How We Created This Example
|
|
||||||
|
|
||||||
To get started deploying Aurelia with ZEIT Now, you can use the [Aurelia CLI](https://aurelia.io/docs/cli/basics/) to initialize the project:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ au new
|
|
||||||
```
|
|
||||||
|
|
||||||
### Deploying From Your Terminal
|
|
||||||
|
|
||||||
You can deploy your new Aurelia project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ now
|
|
||||||
```
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "aurelia",
|
|
||||||
"type": "project:application",
|
|
||||||
"paths": {
|
|
||||||
"root": "src",
|
|
||||||
"resources": "resources",
|
|
||||||
"elements": "resources/elements",
|
|
||||||
"attributes": "resources/attributes",
|
|
||||||
"valueConverters": "resources/value-converters",
|
|
||||||
"bindingBehaviors": "resources/binding-behaviors"
|
|
||||||
},
|
|
||||||
"transpiler": {
|
|
||||||
"id": "babel",
|
|
||||||
"fileExtension": ".js"
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"options": {
|
|
||||||
"server": "dev",
|
|
||||||
"extractCss": "prod",
|
|
||||||
"coverage": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"platform": {
|
|
||||||
"hmr": false,
|
|
||||||
"open": false,
|
|
||||||
"port": 8080,
|
|
||||||
"output": "public"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: true,
|
|
||||||
testing: true,
|
|
||||||
};
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: false,
|
|
||||||
testing: false,
|
|
||||||
};
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export default {
|
|
||||||
debug: true,
|
|
||||||
testing: false,
|
|
||||||
};
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class AttributeGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the custom attribute?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.attributes.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `import {inject} from 'aurelia-framework';
|
|
||||||
|
|
||||||
@inject(Element)
|
|
||||||
export class ${className}CustomAttribute {
|
|
||||||
constructor(element) {
|
|
||||||
this.element = element;
|
|
||||||
}
|
|
||||||
|
|
||||||
valueChanged(newValue, oldValue) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "attribute",
|
|
||||||
"description": "Creates a custom attribute class and places it in the project resources."
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class BindingBehaviorGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the binding behavior?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.bindingBehaviors.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `export class ${className}BindingBehavior {
|
|
||||||
bind(binding, source) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
unbind(binding, source) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "binding-behavior",
|
|
||||||
"description": "Creates a binding behavior class and places it in the project resources."
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
var path = require('path');
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ElementGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the component?'
|
|
||||||
);
|
|
||||||
|
|
||||||
const subFolders = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[1],
|
|
||||||
"What sub-folder would you like to add it to?\nIf it doesn't exist it will be created for you.\n\nDefault folder is the source folder (src).",
|
|
||||||
'.'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.root.add(
|
|
||||||
ProjectItem.text(
|
|
||||||
path.join(subFolders, fileName + '.js'),
|
|
||||||
this.generateJSSource(className)
|
|
||||||
),
|
|
||||||
ProjectItem.text(
|
|
||||||
path.join(subFolders, fileName + '.html'),
|
|
||||||
this.generateHTMLSource(className)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(
|
|
||||||
`Created ${name} in the '${path.join(
|
|
||||||
this.project.root.name,
|
|
||||||
subFolders
|
|
||||||
)}' folder`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateJSSource(className) {
|
|
||||||
return `export class ${className} {
|
|
||||||
constructor() {
|
|
||||||
this.message = 'Hello world';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
generateHTMLSource(className) {
|
|
||||||
return `<template>
|
|
||||||
<h1>\${message}</h1>
|
|
||||||
</template>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "component",
|
|
||||||
"description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)."
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ElementGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the custom element?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.elements.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateJSSource(className)),
|
|
||||||
ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateJSSource(className) {
|
|
||||||
return `import {bindable} from 'aurelia-framework';
|
|
||||||
|
|
||||||
export class ${className} {
|
|
||||||
@bindable value;
|
|
||||||
|
|
||||||
valueChanged(newValue, oldValue) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
generateHTMLSource(className) {
|
|
||||||
return `<template>
|
|
||||||
<h1>\${value}</h1>
|
|
||||||
</template>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "element",
|
|
||||||
"description": "Creates a custom element class and template, placing them in the project resources."
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class GeneratorGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the generator?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.generators.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `import {inject} from 'aurelia-dependency-injection';
|
|
||||||
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ${className}Generator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
execute() {
|
|
||||||
return this.ui
|
|
||||||
.ensureAnswer(this.options.args[0], 'What would you like to call the new item?')
|
|
||||||
.then(name => {
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.elements.add(
|
|
||||||
ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.project.commitChanges()
|
|
||||||
.then(() => this.ui.log(\`Created \${fileName}.\`));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return \`import {bindable} from 'aurelia-framework';
|
|
||||||
|
|
||||||
export class \${className} {
|
|
||||||
@bindable value;
|
|
||||||
|
|
||||||
valueChanged(newValue, oldValue) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
\`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "generator",
|
|
||||||
"description": "Creates a generator class and places it in the project generators folder."
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class TaskGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the task?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let functionName = this.project.makeFunctionName(name);
|
|
||||||
|
|
||||||
this.project.tasks.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateSource(functionName))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(functionName) {
|
|
||||||
return `import gulp from 'gulp';
|
|
||||||
import project from '../aurelia.json';
|
|
||||||
|
|
||||||
export default function ${functionName}() {
|
|
||||||
return gulp.src(project.paths.???)
|
|
||||||
.pipe(gulp.dest(project.paths.output));
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "task",
|
|
||||||
"description": "Creates a task and places it in the project tasks folder."
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { inject } from 'aurelia-dependency-injection';
|
|
||||||
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
|
|
||||||
|
|
||||||
@inject(Project, CLIOptions, UI)
|
|
||||||
export default class ValueConverterGenerator {
|
|
||||||
constructor(project, options, ui) {
|
|
||||||
this.project = project;
|
|
||||||
this.options = options;
|
|
||||||
this.ui = ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
async execute() {
|
|
||||||
const name = await this.ui.ensureAnswer(
|
|
||||||
this.options.args[0],
|
|
||||||
'What would you like to call the value converter?'
|
|
||||||
);
|
|
||||||
|
|
||||||
let fileName = this.project.makeFileName(name);
|
|
||||||
let className = this.project.makeClassName(name);
|
|
||||||
|
|
||||||
this.project.valueConverters.add(
|
|
||||||
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
|
|
||||||
);
|
|
||||||
|
|
||||||
await this.project.commitChanges();
|
|
||||||
await this.ui.log(`Created ${fileName}.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSource(className) {
|
|
||||||
return `export class ${className}ValueConverter {
|
|
||||||
toView(value) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
fromView(value) {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "value-converter",
|
|
||||||
"description": "Creates a value converter class and places it in the project resources."
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import webpackConfig from '../../webpack.config';
|
|
||||||
import webpack from 'webpack';
|
|
||||||
import project from '../aurelia.json';
|
|
||||||
import gulp from 'gulp';
|
|
||||||
import del from 'del';
|
|
||||||
import { CLIOptions, Configuration } from 'aurelia-cli';
|
|
||||||
import configureEnvironment from './environment';
|
|
||||||
|
|
||||||
const analyze = CLIOptions.hasFlag('analyze');
|
|
||||||
const buildOptions = new Configuration(project.build.options);
|
|
||||||
const production = CLIOptions.getEnvironment() === 'prod';
|
|
||||||
const server = buildOptions.isApplicable('server');
|
|
||||||
const extractCss = buildOptions.isApplicable('extractCss');
|
|
||||||
const coverage = buildOptions.isApplicable('coverage');
|
|
||||||
|
|
||||||
const config = webpackConfig({
|
|
||||||
production,
|
|
||||||
server,
|
|
||||||
extractCss,
|
|
||||||
coverage,
|
|
||||||
analyze,
|
|
||||||
});
|
|
||||||
const compiler = webpack(config);
|
|
||||||
|
|
||||||
function buildWebpack(done) {
|
|
||||||
if (CLIOptions.hasFlag('watch')) {
|
|
||||||
compiler.watch({}, onBuild);
|
|
||||||
} else {
|
|
||||||
compiler.run(onBuild);
|
|
||||||
compiler.hooks.done.tap('done', () => done());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onBuild(err, stats) {
|
|
||||||
if (!CLIOptions.hasFlag('watch') && err) {
|
|
||||||
console.error(err.stack || err);
|
|
||||||
if (err.details) console.error(err.details);
|
|
||||||
process.exit(1);
|
|
||||||
} else {
|
|
||||||
process.stdout.write(
|
|
||||||
stats.toString({ colors: require('supports-color') }) + '\n'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!CLIOptions.hasFlag('watch') && stats.hasErrors()) {
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearDist() {
|
|
||||||
return del([config.output.path]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const build = gulp.series(clearDist, configureEnvironment, buildWebpack);
|
|
||||||
|
|
||||||
export { config, buildWebpack, build as default };
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "build",
|
|
||||||
"description": "Builds and processes all application assets.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "analyze",
|
|
||||||
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "env",
|
|
||||||
"description": "Sets the build environment.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "watch",
|
|
||||||
"description": "Watches source files for changes and refreshes the bundles automatically.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import project from '../aurelia.json';
|
|
||||||
import rename from 'gulp-rename';
|
|
||||||
import gulp from 'gulp';
|
|
||||||
import fs from 'fs';
|
|
||||||
import through from 'through2';
|
|
||||||
import { CLIOptions } from 'aurelia-cli';
|
|
||||||
|
|
||||||
function configureEnvironment() {
|
|
||||||
let env = CLIOptions.getEnvironment();
|
|
||||||
|
|
||||||
return gulp
|
|
||||||
.src(
|
|
||||||
`aurelia_project/environments/${env}${project.transpiler.fileExtension}`
|
|
||||||
)
|
|
||||||
.pipe(rename(`environment${project.transpiler.fileExtension}`))
|
|
||||||
.pipe(
|
|
||||||
through.obj(function(file, _, cb) {
|
|
||||||
// https://github.com/aurelia/cli/issues/1031
|
|
||||||
fs.unlink(`${project.paths.root}/${file.relative}`, function() {
|
|
||||||
cb(null, file);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.pipe(gulp.dest(project.paths.root))
|
|
||||||
.pipe(
|
|
||||||
through.obj(function(file, enc, cb) {
|
|
||||||
// https://github.com/webpack/watchpack/issues/25#issuecomment-287789288
|
|
||||||
const now = Date.now() / 1000;
|
|
||||||
const then = now - 10;
|
|
||||||
fs.utimes(file.path, then, then, function(err) {
|
|
||||||
if (err) throw err;
|
|
||||||
});
|
|
||||||
cb(null, file);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default configureEnvironment;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './test';
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "jest",
|
|
||||||
"description": "Runs Jest and reports the results.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "watch",
|
|
||||||
"description": "Watches test files for changes and re-runs the tests automatically.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
import webpack from 'webpack';
|
|
||||||
import Server from 'webpack-dev-server';
|
|
||||||
import project from '../aurelia.json';
|
|
||||||
import gulp from 'gulp';
|
|
||||||
|
|
||||||
import { config } from './build';
|
|
||||||
import configureEnvironment from './environment';
|
|
||||||
import { CLIOptions, reportWebpackReadiness } from 'aurelia-cli';
|
|
||||||
|
|
||||||
function runWebpack(done) {
|
|
||||||
// https://webpack.github.io/docs/webpack-dev-server.html
|
|
||||||
let opts = {
|
|
||||||
host: 'localhost',
|
|
||||||
publicPath: config.output.publicPath,
|
|
||||||
filename: config.output.filename,
|
|
||||||
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
|
|
||||||
port: CLIOptions.getFlagValue('port') || project.platform.port,
|
|
||||||
contentBase: config.output.path,
|
|
||||||
historyApiFallback: true,
|
|
||||||
open: project.platform.open || CLIOptions.hasFlag('open'),
|
|
||||||
stats: {
|
|
||||||
colors: require('supports-color'),
|
|
||||||
},
|
|
||||||
...config.devServer,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Add the webpack-dev-server client to the webpack entry point
|
|
||||||
// The path for the client to use such as `webpack-dev-server/client?http://${opts.host}:${opts.port}/` is not required
|
|
||||||
// The path used is derived from window.location in the browser and output.publicPath in the webpack.config.
|
|
||||||
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
|
|
||||||
config.plugins.push(new webpack.HotModuleReplacementPlugin());
|
|
||||||
config.entry.app.unshift(
|
|
||||||
'webpack-dev-server/client',
|
|
||||||
'webpack/hot/dev-server'
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// removed "<script src="/webpack-dev-server.js"></script>" from index.ejs in favour of this method
|
|
||||||
config.entry.app.unshift('webpack-dev-server/client');
|
|
||||||
}
|
|
||||||
|
|
||||||
const compiler = webpack(config);
|
|
||||||
let server = new Server(compiler, opts);
|
|
||||||
|
|
||||||
server.listen(opts.port, opts.host, function(err) {
|
|
||||||
if (err) throw err;
|
|
||||||
|
|
||||||
reportWebpackReadiness(opts);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const run = gulp.series(configureEnvironment, runWebpack);
|
|
||||||
|
|
||||||
export { run as default };
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "run",
|
|
||||||
"description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "analyze",
|
|
||||||
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "env",
|
|
||||||
"description": "Sets the build environment.",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hmr",
|
|
||||||
"description": "Enable Hot Module Reload",
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "port",
|
|
||||||
"description": "Set port number of the dev server",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "open",
|
|
||||||
"description": "Open the default browser at the application location.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import jest from 'jest-cli';
|
|
||||||
import path from 'path';
|
|
||||||
import packageJson from '../../package.json';
|
|
||||||
|
|
||||||
import { CLIOptions } from 'aurelia-cli';
|
|
||||||
|
|
||||||
export default cb => {
|
|
||||||
let options = packageJson.jest;
|
|
||||||
|
|
||||||
if (CLIOptions.hasFlag('watch')) {
|
|
||||||
Object.assign(options, { watchAll: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
process.env.BABEL_TARGET = 'node';
|
|
||||||
|
|
||||||
jest
|
|
||||||
.runCLI(options, [path.resolve(__dirname, '../../')])
|
|
||||||
.then(({ results }) => {
|
|
||||||
if (results.numFailedTests || results.numFailedTestSuites) {
|
|
||||||
cb('Tests Failed');
|
|
||||||
} else {
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"description": "Runs Jest and reports the results.",
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "watch",
|
|
||||||
"description": "Watches test files for changes and re-runs the tests automatically.",
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title><%- htmlWebpackPlugin.options.metadata.title %></title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<base href="<%- htmlWebpackPlugin.options.metadata.baseUrl %>">
|
|
||||||
<!-- imported CSS are concatenated and added automatically -->
|
|
||||||
</head>
|
|
||||||
<body aurelia-app="main">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es2015",
|
|
||||||
"lib": ["es2017", "dom"],
|
|
||||||
"experimentalDecorators": true
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "dist"]
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "aurelia",
|
|
||||||
"description": "An Aurelia client application.",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"repository": {
|
|
||||||
"type": "???",
|
|
||||||
"url": "???"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"aurelia-bootstrapper": "^2.3.2",
|
|
||||||
"aurelia-animator-css": "^1.0.4"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"aurelia-cli": "^1.0.2",
|
|
||||||
"aurelia-testing": "^1.0.0",
|
|
||||||
"aurelia-tools": "^2.0.0",
|
|
||||||
"gulp": "^4.0.0",
|
|
||||||
"minimatch": "^3.0.4",
|
|
||||||
"through2": "^3.0.0",
|
|
||||||
"vinyl-fs": "^3.0.3",
|
|
||||||
"promise-polyfill": "^8.1.0",
|
|
||||||
"regenerator-runtime": "0.13.2",
|
|
||||||
"babel-eslint": "^10.0.1",
|
|
||||||
"eslint": "latest",
|
|
||||||
"babel-loader": "^8.0.5",
|
|
||||||
"babel-plugin-istanbul": "^5.1.1",
|
|
||||||
"@babel/plugin-proposal-decorators": "^7.4.0",
|
|
||||||
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
|
||||||
"@babel/preset-env": "^7.4.2",
|
|
||||||
"@babel/core": "^7.4.0",
|
|
||||||
"@babel/register": "^7.4.0",
|
|
||||||
"gulp-rename": "^1.4.0",
|
|
||||||
"html-webpack-plugin": "^3.2.0",
|
|
||||||
"copy-webpack-plugin": "^5.0.0",
|
|
||||||
"mini-css-extract-plugin": "^0.4.3",
|
|
||||||
"aurelia-webpack-plugin": "^3.0.0",
|
|
||||||
"duplicate-package-checker-webpack-plugin": "^3.0.0",
|
|
||||||
"webpack": "^4.27.0",
|
|
||||||
"webpack-cli": "^3.1.2",
|
|
||||||
"webpack-dev-server": "^3.1.9",
|
|
||||||
"expose-loader": "^0.7.5",
|
|
||||||
"style-loader": "^0.23.1",
|
|
||||||
"url-loader": "^1.1.2",
|
|
||||||
"del": "^3.0.0",
|
|
||||||
"css-loader": "^1.0.0",
|
|
||||||
"file-loader": "^2.0.0",
|
|
||||||
"json-loader": "^0.5.7",
|
|
||||||
"html-loader": "^0.5.5",
|
|
||||||
"istanbul-instrumenter-loader": "^3.0.1",
|
|
||||||
"webpack-bundle-analyzer": "^3.0.4",
|
|
||||||
"jest": "^24.1.0",
|
|
||||||
"jest-cli": "^24.1.0",
|
|
||||||
"jest-transform-stub": "^2.0.0",
|
|
||||||
"aurelia-loader-nodejs": "^1.0.1",
|
|
||||||
"aurelia-pal-nodejs": "^1.2.0",
|
|
||||||
"babel-jest": "^24.5.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "au build",
|
|
||||||
"start": "au run",
|
|
||||||
"dev": "au run --port $PORT",
|
|
||||||
"test": "au test"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.9.0"
|
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"moduleNameMapper": {
|
|
||||||
"^aurelia-binding$": "<rootDir>/node_modules/aurelia-binding"
|
|
||||||
},
|
|
||||||
"modulePaths": [
|
|
||||||
"<rootDir>/src",
|
|
||||||
"<rootDir>/node_modules"
|
|
||||||
],
|
|
||||||
"moduleFileExtensions": [
|
|
||||||
"js",
|
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"transform": {
|
|
||||||
"^.+\\.(css|less|sass|scss|styl|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "jest-transform-stub",
|
|
||||||
"^.+\\.js$": "babel-jest"
|
|
||||||
},
|
|
||||||
"testRegex": "\\.spec\\.js$",
|
|
||||||
"setupFiles": [
|
|
||||||
"<rootDir>/test/jest-pretest.js"
|
|
||||||
],
|
|
||||||
"testEnvironment": "node",
|
|
||||||
"collectCoverage": true,
|
|
||||||
"collectCoverageFrom": [
|
|
||||||
"src/**/*.js",
|
|
||||||
"!**/*.spec.js",
|
|
||||||
"!**/node_modules/**",
|
|
||||||
"!**/test/**"
|
|
||||||
],
|
|
||||||
"coverageDirectory": "<rootDir>/test/coverage-jest",
|
|
||||||
"coverageReporters": [
|
|
||||||
"json",
|
|
||||||
"lcov",
|
|
||||||
"text",
|
|
||||||
"html"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<template>
|
|
||||||
<h1>${message}</h1>
|
|
||||||
</template>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export class App {
|
|
||||||
message = 'Hello World!';
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
// regenerator-runtime is to support async/await syntax in ESNext.
|
|
||||||
// If you don't use async/await, you can remove regenerator-runtime.
|
|
||||||
import 'regenerator-runtime/runtime';
|
|
||||||
import environment from './environment';
|
|
||||||
import { PLATFORM } from 'aurelia-pal';
|
|
||||||
|
|
||||||
export function configure(aurelia) {
|
|
||||||
aurelia.use
|
|
||||||
.standardConfiguration()
|
|
||||||
.feature(PLATFORM.moduleName('resources/index'));
|
|
||||||
|
|
||||||
aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');
|
|
||||||
|
|
||||||
if (environment.testing) {
|
|
||||||
aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));
|
|
||||||
}
|
|
||||||
|
|
||||||
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export function configure(config) {
|
|
||||||
//config.globalResources([]);
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,6 +0,0 @@
|
|||||||
import 'aurelia-polyfills';
|
|
||||||
import { Options } from 'aurelia-loader-nodejs';
|
|
||||||
import { globalize } from 'aurelia-pal-nodejs';
|
|
||||||
import path from 'path';
|
|
||||||
Options.relativeToDir = path.join(__dirname, 'unit');
|
|
||||||
globalize();
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"rules": {
|
|
||||||
"no-var": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import { bootstrap } from 'aurelia-bootstrapper';
|
|
||||||
import { StageComponent } from 'aurelia-testing';
|
|
||||||
import { PLATFORM } from 'aurelia-pal';
|
|
||||||
|
|
||||||
describe('Stage App Component', () => {
|
|
||||||
let component;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
component = StageComponent.withResources(PLATFORM.moduleName('app')).inView(
|
|
||||||
'<app></app>'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => component.dispose());
|
|
||||||
|
|
||||||
it('should render message', done => {
|
|
||||||
component
|
|
||||||
.create(bootstrap)
|
|
||||||
.then(() => {
|
|
||||||
const view = component.element;
|
|
||||||
expect(view.textContent.trim()).toBe('Hello World!');
|
|
||||||
done();
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
fail(e);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
||||||
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
|
||||||
const project = require('./aurelia_project/aurelia.json');
|
|
||||||
const {
|
|
||||||
AureliaPlugin,
|
|
||||||
ModuleDependenciesPlugin,
|
|
||||||
} = require('aurelia-webpack-plugin');
|
|
||||||
const { ProvidePlugin } = require('webpack');
|
|
||||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
||||||
|
|
||||||
// config helpers:
|
|
||||||
const ensureArray = config =>
|
|
||||||
(config && (Array.isArray(config) ? config : [config])) || [];
|
|
||||||
const when = (condition, config, negativeConfig) =>
|
|
||||||
condition ? ensureArray(config) : ensureArray(negativeConfig);
|
|
||||||
|
|
||||||
// primary config:
|
|
||||||
const title = 'Aurelia Navigation Skeleton';
|
|
||||||
const outDir = path.resolve(__dirname, project.platform.output);
|
|
||||||
const srcDir = path.resolve(__dirname, 'src');
|
|
||||||
const testDir = path.resolve(__dirname, 'test', 'unit');
|
|
||||||
const nodeModulesDir = path.resolve(__dirname, 'node_modules');
|
|
||||||
const baseUrl = '/';
|
|
||||||
|
|
||||||
const cssRules = [{ loader: 'css-loader' }];
|
|
||||||
|
|
||||||
module.exports = ({
|
|
||||||
production,
|
|
||||||
server,
|
|
||||||
extractCss,
|
|
||||||
coverage,
|
|
||||||
analyze,
|
|
||||||
karma,
|
|
||||||
} = {}) => ({
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.js'],
|
|
||||||
modules: [srcDir, 'node_modules'],
|
|
||||||
// Enforce single aurelia-binding, to avoid v1/v2 duplication due to
|
|
||||||
// out-of-date dependencies on 3rd party aurelia plugins
|
|
||||||
alias: {
|
|
||||||
'aurelia-binding': path.resolve(
|
|
||||||
__dirname,
|
|
||||||
'node_modules/aurelia-binding'
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
entry: {
|
|
||||||
app: ['aurelia-bootstrapper'],
|
|
||||||
},
|
|
||||||
mode: production ? 'production' : 'development',
|
|
||||||
output: {
|
|
||||||
path: outDir,
|
|
||||||
publicPath: baseUrl,
|
|
||||||
filename: production
|
|
||||||
? '[name].[chunkhash].bundle.js'
|
|
||||||
: '[name].[hash].bundle.js',
|
|
||||||
sourceMapFilename: production
|
|
||||||
? '[name].[chunkhash].bundle.map'
|
|
||||||
: '[name].[hash].bundle.map',
|
|
||||||
chunkFilename: production
|
|
||||||
? '[name].[chunkhash].chunk.js'
|
|
||||||
: '[name].[hash].chunk.js',
|
|
||||||
},
|
|
||||||
optimization: {
|
|
||||||
runtimeChunk: true, // separates the runtime chunk, required for long term cacheability
|
|
||||||
// moduleIds is the replacement for HashedModuleIdsPlugin and NamedModulesPlugin deprecated in https://github.com/webpack/webpack/releases/tag/v4.16.0
|
|
||||||
// changes module id's to use hashes be based on the relative path of the module, required for long term cacheability
|
|
||||||
moduleIds: 'hashed',
|
|
||||||
// Use splitChunks to breakdown the App/Aurelia bundle down into smaller chunks
|
|
||||||
// https://webpack.js.org/plugins/split-chunks-plugin/
|
|
||||||
splitChunks: {
|
|
||||||
hidePathInfo: true, // prevents the path from being used in the filename when using maxSize
|
|
||||||
chunks: 'initial',
|
|
||||||
// sizes are compared against source before minification
|
|
||||||
maxSize: 200000, // splits chunks if bigger than 200k, adjust as required (maxSize added in webpack v4.15)
|
|
||||||
cacheGroups: {
|
|
||||||
default: false, // Disable the built-in groups default & vendors (vendors is redefined below)
|
|
||||||
// You can insert additional cacheGroup entries here if you want to split out specific modules
|
|
||||||
// This is required in order to split out vendor css from the app css when using --extractCss
|
|
||||||
// For example to separate font-awesome and bootstrap:
|
|
||||||
// fontawesome: { // separates font-awesome css from the app css (font-awesome is only css/fonts)
|
|
||||||
// name: 'vendor.font-awesome',
|
|
||||||
// test: /[\\/]node_modules[\\/]font-awesome[\\/]/,
|
|
||||||
// priority: 100,
|
|
||||||
// enforce: true
|
|
||||||
// },
|
|
||||||
// bootstrap: { // separates bootstrap js from vendors and also bootstrap css from app css
|
|
||||||
// name: 'vendor.font-awesome',
|
|
||||||
// test: /[\\/]node_modules[\\/]bootstrap[\\/]/,
|
|
||||||
// priority: 90,
|
|
||||||
// enforce: true
|
|
||||||
// },
|
|
||||||
|
|
||||||
// This is the HTTP/1.1 optimised cacheGroup configuration
|
|
||||||
vendors: {
|
|
||||||
// picks up everything from node_modules as long as the sum of node modules is larger than minSize
|
|
||||||
test: /[\\/]node_modules[\\/]/,
|
|
||||||
name: 'vendors',
|
|
||||||
priority: 19,
|
|
||||||
enforce: true, // causes maxInitialRequests to be ignored, minSize still respected if specified in cacheGroup
|
|
||||||
minSize: 30000, // use the default minSize
|
|
||||||
},
|
|
||||||
vendorsAsync: {
|
|
||||||
// vendors async chunk, remaining asynchronously used node modules as single chunk file
|
|
||||||
test: /[\\/]node_modules[\\/]/,
|
|
||||||
name: 'vendors.async',
|
|
||||||
chunks: 'async',
|
|
||||||
priority: 9,
|
|
||||||
reuseExistingChunk: true,
|
|
||||||
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
|
|
||||||
},
|
|
||||||
commonsAsync: {
|
|
||||||
// commons async chunk, remaining asynchronously used modules as single chunk file
|
|
||||||
name: 'commons.async',
|
|
||||||
minChunks: 2, // Minimum number of chunks that must share a module before splitting
|
|
||||||
chunks: 'async',
|
|
||||||
priority: 0,
|
|
||||||
reuseExistingChunk: true,
|
|
||||||
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
performance: { hints: false },
|
|
||||||
devServer: {
|
|
||||||
contentBase: outDir,
|
|
||||||
// serve index.html for all 404 (required for push-state)
|
|
||||||
historyApiFallback: true,
|
|
||||||
},
|
|
||||||
devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map',
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
// CSS required in JS/TS files should use the style-loader that auto-injects it into the website
|
|
||||||
// only when the issuer is a .js/.ts file, so the loaders are not applied inside html templates
|
|
||||||
{
|
|
||||||
test: /\.css$/i,
|
|
||||||
issuer: [{ not: [{ test: /\.html$/i }] }],
|
|
||||||
use: extractCss
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
loader: MiniCssExtractPlugin.loader,
|
|
||||||
},
|
|
||||||
'css-loader',
|
|
||||||
]
|
|
||||||
: ['style-loader', ...cssRules],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.css$/i,
|
|
||||||
issuer: [{ test: /\.html$/i }],
|
|
||||||
// CSS required in templates cannot be extracted safely
|
|
||||||
// because Aurelia would try to require it again in runtime
|
|
||||||
use: cssRules,
|
|
||||||
},
|
|
||||||
{ test: /\.html$/i, loader: 'html-loader' },
|
|
||||||
{
|
|
||||||
test: /\.js$/i,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: nodeModulesDir,
|
|
||||||
options: coverage ? { sourceMap: 'inline', plugins: ['istanbul'] } : {},
|
|
||||||
},
|
|
||||||
// embed small images and fonts as Data Urls and larger ones as files:
|
|
||||||
{
|
|
||||||
test: /\.(png|gif|jpg|cur)$/i,
|
|
||||||
loader: 'url-loader',
|
|
||||||
options: { limit: 8192 },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
|
||||||
loader: 'url-loader',
|
|
||||||
options: { limit: 10000, mimetype: 'application/font-woff2' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
|
||||||
loader: 'url-loader',
|
|
||||||
options: { limit: 10000, mimetype: 'application/font-woff' },
|
|
||||||
},
|
|
||||||
// load these fonts normally, as files:
|
|
||||||
{
|
|
||||||
test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
|
|
||||||
loader: 'file-loader',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
...when(!karma, new DuplicatePackageCheckerPlugin()),
|
|
||||||
new AureliaPlugin(),
|
|
||||||
new ProvidePlugin({
|
|
||||||
Promise: ['promise-polyfill', 'default'],
|
|
||||||
}),
|
|
||||||
new ModuleDependenciesPlugin({
|
|
||||||
'aurelia-testing': ['./compile-spy', './view-spy'],
|
|
||||||
}),
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
template: 'index.ejs',
|
|
||||||
metadata: {
|
|
||||||
// available in index.ejs //
|
|
||||||
title,
|
|
||||||
server,
|
|
||||||
baseUrl,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// ref: https://webpack.js.org/plugins/mini-css-extract-plugin/
|
|
||||||
...when(
|
|
||||||
extractCss,
|
|
||||||
new MiniCssExtractPlugin({
|
|
||||||
// updated to match the naming conventions for the js files
|
|
||||||
filename: production
|
|
||||||
? 'css/[name].[contenthash].bundle.css'
|
|
||||||
: 'css/[name].[hash].bundle.css',
|
|
||||||
chunkFilename: production
|
|
||||||
? 'css/[name].[contenthash].chunk.css'
|
|
||||||
: 'css/[name].[hash].chunk.css',
|
|
||||||
})
|
|
||||||
),
|
|
||||||
...when(
|
|
||||||
production || server,
|
|
||||||
new CopyWebpackPlugin([{ from: 'static', to: outDir, ignore: ['.*'] }])
|
|
||||||
), // ignore dot (hidden) files
|
|
||||||
...when(analyze, new BundleAnalyzerPlugin()),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
# Brunch Example
|
# Brunch Example
|
||||||
|
|
||||||
This directory is a brief example of a [Brunch](https://brunch.io/) site that can be deployed with ZEIT Now and zero configuration.
|
This directory is a brief example of a [Brunch](https://brunch.io/) site that can be deployed with Vercel and zero configuration.
|
||||||
|
|
||||||
## Deploy Your Own
|
## Deploy Your Own
|
||||||
|
|
||||||
Deploy your own Brunch project with ZEIT Now.
|
Deploy your own Brunch project with Vercel.
|
||||||
|
|
||||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
||||||
|
|
||||||
_Live Example: https://brunch.now-examples.now.sh_
|
_Live Example: https://brunch.now-examples.now.sh_
|
||||||
|
|
||||||
### How We Created This Example
|
### How We Created This Example
|
||||||
|
|
||||||
To get started deploying Brunch with ZEIT Now, you can use the [Brunch CLI](https://brunch.io/docs/commands) to initialize the project:
|
To get started deploying Brunch with Vercel, you can use the [Brunch CLI](https://brunch.io/docs/commands) to initialize the project:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ brunch new project-name -s es6
|
$ brunch new project-name -s es6
|
||||||
@@ -20,7 +20,7 @@ $ brunch new project-name -s es6
|
|||||||
|
|
||||||
### Deploying From Your Terminal
|
### Deploying From Your Terminal
|
||||||
|
|
||||||
You can deploy your new Brunch project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
You can deploy your new Brunch project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ now
|
$ now
|
||||||
|
|||||||
115
examples/brunch/app/assets/brunch-napkin.svg
Normal file
115
examples/brunch/app/assets/brunch-napkin.svg
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
|
||||||
|
<rect x="65" y="68" fill="#7C7C7C" width="127" height="124"/>
|
||||||
|
<rect x="83.392" y="22.163" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 266.9294 23.9747)" fill="#86AD8A" width="90.215" height="90.215"/>
|
||||||
|
<path fill="#FFFFFF" d="M117.601,167.637c3.788-11.191,5.795-45.647,4.728-62.795c-0.128-2.057-0.333-4.445-0.692-6.351
|
||||||
|
c-0.112-0.607-0.244-1.168-0.391-1.651c0-6.672,0-62.892,0-67.02c0-5.717,5.242-8.419,10.166,4.128
|
||||||
|
c4.925,12.547,3.495,57.175,3.495,60.348c0,0.673-0.611,1.469-1.57,2.25c-0.383,0.247-0.73,0.499-1.051,0.754
|
||||||
|
c-2.949,2.366-3.379,5.095-3.533,7.542c-1.067,17.148-1.554,51.604,2.234,62.795c4.438,13.112-4.004,14.759-6.691,14.759
|
||||||
|
C121.605,182.395,113.163,180.748,117.601,167.637z"/>
|
||||||
|
<path fill="#FFFFFF" d="M103.019,47.413c-0.472,0.049-1.062,9.387-1.257,16.131c-0.238,8.194-0.607,15.482-2.908,15.482
|
||||||
|
c-1.728,0-2.8-2.853-2.517-10.094c0.407-10.427,0.395-21.519-0.219-21.519c-0.774,0-4.358,22.999-4.358,31.09
|
||||||
|
c0,5.803,2.487,11.269,5.603,14.115c0.01,0.008,0.019,0.019,0.033,0.027c0.093,0.081,0.191,0.166,0.278,0.247
|
||||||
|
c0.005,0.004,0.01,0.004,0.01,0.008c2.252,2.053,2.819,4.283,2.971,6.32c1.286,17.143-1.128,59.614-5.678,70.804
|
||||||
|
c-5.33,13.108,4.811,14.759,8.042,14.759c3.227,0,13.368-1.651,8.037-14.759c-4.55-11.191-6.96-53.661-5.678-70.804
|
||||||
|
c0.153-2.037,0.719-4.267,2.971-6.32c0-0.004,0.005-0.004,0.01-0.008c0.088-0.081,0.185-0.166,0.278-0.247
|
||||||
|
c0.014-0.008,0.023-0.019,0.033-0.027c3.116-2.845,5.764-8.314,5.604-14.115c-0.635-23.017-3.263-31.09-4.037-31.09
|
||||||
|
c-0.614,0-0.613,12.286-0.438,21.024c0.143,7.158-0.471,10.383-2.49,10.383c-1.923,0-2.504-6.972-2.748-15.368
|
||||||
|
c-0.196-6.762-0.804-16.039-1.54-16.039"/>
|
||||||
|
<path fill="#FFFFFF" d="M154.075,179.591c-2.546,0-10.532-1.562-6.332-13.967c3.585-10.59,5.483-50.779,4.474-67.007
|
||||||
|
c-0.051-0.826-0.256-1.664-0.413-2.55c-0.443-2.504-3.543-4.555-5.338-6.356c-3.486-3.498-5.725-9.38-5.725-16.013
|
||||||
|
c0-10.77,5.97-24.4,13.334-24.4c7.364,0,13.334,13.63,13.334,24.4c0,6.633-2.24,12.515-5.725,16.013
|
||||||
|
c-1.795,1.801-4.895,3.852-5.338,6.356c-0.157,0.886-0.361,1.724-0.413,2.55c-1.01,16.227,0.889,56.416,4.474,67.007
|
||||||
|
C164.607,178.03,156.621,179.591,154.075,179.591z"/>
|
||||||
|
<polyline fill="#CECCAE" points="65,68 65,192 192,192 "/>
|
||||||
|
<polygon fill="#3F894A" points="65,191.835 65,253 192,253 192,191.835 192,66.938 "/>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
|
||||||
|
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="191.658" y1="82.55" x2="190.946" y2="83.253"/>
|
||||||
|
|
||||||
|
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" stroke-dasharray="2.02,2.02" x1="189.509" y1="84.672" x2="66.629" y2="206.035"/>
|
||||||
|
|
||||||
|
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="65.91" y1="206.745" x2="65.199" y2="207.448"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#FFFFFF" d="M85.353,211.117h6.328c0.827,0,1.665,0.067,2.513,0.201c0.848,0.135,1.608,0.414,2.28,0.838
|
||||||
|
c0.672,0.424,1.22,1.014,1.644,1.768c0.424,0.756,0.636,1.753,0.636,2.994c0,1.116-0.331,2.089-0.993,2.916
|
||||||
|
c-0.662,0.827-1.644,1.376-2.947,1.645v0.062c0.724,0.062,1.385,0.232,1.985,0.512c0.6,0.279,1.117,0.651,1.551,1.117
|
||||||
|
c0.434,0.465,0.77,1.019,1.008,1.659c0.238,0.642,0.357,1.345,0.357,2.109c0,1.262-0.243,2.291-0.729,3.087
|
||||||
|
c-0.486,0.797-1.097,1.422-1.83,1.877c-0.734,0.455-1.531,0.766-2.389,0.931c-0.858,0.166-1.66,0.248-2.404,0.248h-7.011V211.117z
|
||||||
|
M87.4,220.609h4.25c1.055,0,1.913-0.129,2.575-0.388c0.662-0.259,1.179-0.574,1.551-0.946c0.373-0.372,0.621-0.771,0.745-1.194
|
||||||
|
s0.186-0.812,0.186-1.163c0-0.765-0.129-1.401-0.388-1.908c-0.259-0.506-0.605-0.909-1.039-1.21
|
||||||
|
c-0.435-0.299-0.941-0.512-1.52-0.636c-0.579-0.124-1.189-0.186-1.831-0.186H87.4V220.609z M87.4,231.219h4.684
|
||||||
|
c1.199,0,2.166-0.145,2.9-0.435c0.734-0.289,1.298-0.651,1.691-1.085c0.393-0.435,0.656-0.895,0.791-1.381
|
||||||
|
c0.134-0.485,0.202-0.926,0.202-1.318c0-0.807-0.155-1.499-0.465-2.078s-0.713-1.05-1.21-1.412c-0.496-0.361-1.06-0.625-1.69-0.791
|
||||||
|
c-0.631-0.165-1.267-0.248-1.908-0.248H87.4V231.219z"/>
|
||||||
|
<path fill="#FFFFFF" d="M103.73,222.781c0-0.269-0.011-0.595-0.031-0.978c-0.021-0.383-0.036-0.771-0.046-1.163
|
||||||
|
c-0.011-0.393-0.026-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.021,0.538,0.036,1.055,0.046,1.551
|
||||||
|
c0.01,0.497,0.036,0.817,0.078,0.962c0.476-0.848,1.086-1.54,1.83-2.078c0.745-0.538,1.654-0.807,2.73-0.807
|
||||||
|
c0.186,0,0.367,0.016,0.543,0.047c0.175,0.03,0.357,0.067,0.543,0.108l-0.217,1.83c-0.248-0.082-0.486-0.124-0.713-0.124
|
||||||
|
c-0.807,0-1.504,0.129-2.094,0.388c-0.589,0.259-1.075,0.615-1.458,1.07s-0.667,0.987-0.853,1.598s-0.279,1.267-0.279,1.97v7.817
|
||||||
|
h-1.861V222.781z"/>
|
||||||
|
<path fill="#FFFFFF" d="M126,229.047c0,0.27,0.01,0.595,0.031,0.978c0.021,0.383,0.036,0.771,0.046,1.163
|
||||||
|
c0.01,0.394,0.026,0.761,0.047,1.102c0.02,0.341,0.031,0.604,0.031,0.791h-1.861c-0.021-0.537-0.036-1.055-0.046-1.551
|
||||||
|
c-0.011-0.497-0.036-0.817-0.078-0.962h-0.093c-0.373,0.786-0.993,1.463-1.861,2.032c-0.869,0.568-1.882,0.853-3.04,0.853
|
||||||
|
c-1.117,0-2.032-0.176-2.746-0.527s-1.272-0.812-1.675-1.38c-0.403-0.569-0.678-1.226-0.822-1.971
|
||||||
|
c-0.145-0.744-0.217-1.509-0.217-2.295v-8.531h1.861v8.438c0,0.58,0.051,1.144,0.155,1.691s0.284,1.039,0.543,1.474
|
||||||
|
c0.258,0.434,0.621,0.78,1.086,1.039s1.07,0.388,1.815,0.388c0.682,0,1.329-0.119,1.938-0.356c0.61-0.238,1.137-0.6,1.582-1.086
|
||||||
|
s0.796-1.097,1.055-1.83c0.258-0.734,0.388-1.598,0.388-2.591v-7.166H126V229.047z"/>
|
||||||
|
<path fill="#FFFFFF" d="M130.584,222.781c0-0.269-0.01-0.595-0.029-0.978c-0.021-0.383-0.037-0.771-0.047-1.163
|
||||||
|
c-0.012-0.393-0.027-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.02,0.538,0.035,1.055,0.047,1.551
|
||||||
|
c0.01,0.497,0.035,0.817,0.076,0.962h0.094c0.373-0.785,0.992-1.463,1.861-2.032c0.869-0.568,1.883-0.853,3.041-0.853
|
||||||
|
c1.115,0,2.025,0.176,2.729,0.527s1.258,0.812,1.66,1.381c0.404,0.568,0.684,1.225,0.838,1.97c0.154,0.744,0.232,1.51,0.232,2.295
|
||||||
|
v8.531h-1.861v-8.438c0-0.579-0.051-1.143-0.154-1.691c-0.104-0.547-0.285-1.039-0.543-1.473c-0.26-0.435-0.621-0.781-1.086-1.04
|
||||||
|
c-0.465-0.258-1.07-0.388-1.814-0.388c-0.684,0-1.33,0.119-1.939,0.357c-0.609,0.237-1.137,0.6-1.582,1.085
|
||||||
|
c-0.445,0.486-0.797,1.097-1.055,1.831c-0.26,0.734-0.389,1.598-0.389,2.59v7.166h-1.861V222.781z"/>
|
||||||
|
<path fill="#FFFFFF" d="M159.28,230.971c-0.703,0.849-1.5,1.474-2.389,1.877c-0.89,0.403-1.852,0.604-2.885,0.604
|
||||||
|
c-1.097,0-2.11-0.186-3.041-0.559c-0.931-0.372-1.727-0.894-2.389-1.566c-0.662-0.672-1.179-1.468-1.551-2.389
|
||||||
|
c-0.372-0.92-0.559-1.928-0.559-3.024c0-1.096,0.187-2.104,0.559-3.024s0.889-1.717,1.551-2.389s1.458-1.194,2.389-1.566
|
||||||
|
c0.931-0.373,1.944-0.559,3.041-0.559c1.055,0,2.031,0.217,2.931,0.651c0.9,0.435,1.701,1.045,2.404,1.83l-1.489,1.117
|
||||||
|
c-0.537-0.6-1.127-1.07-1.768-1.412c-0.642-0.341-1.334-0.512-2.078-0.512c-0.869,0-1.655,0.155-2.358,0.466
|
||||||
|
c-0.703,0.31-1.303,0.729-1.799,1.256s-0.874,1.148-1.133,1.861c-0.259,0.714-0.388,1.474-0.388,2.28s0.129,1.566,0.388,2.28
|
||||||
|
c0.259,0.713,0.637,1.334,1.133,1.861s1.096,0.946,1.799,1.256c0.703,0.311,1.489,0.466,2.358,0.466
|
||||||
|
c0.785,0,1.504-0.181,2.155-0.543c0.651-0.361,1.215-0.843,1.69-1.442L159.28,230.971z"/>
|
||||||
|
<path fill="#FFFFFF" d="M161.925,209.628h1.861v11.633h0.062c0.372-0.785,0.992-1.463,1.861-2.032
|
||||||
|
c0.868-0.568,1.882-0.853,3.04-0.853c1.116,0,2.026,0.176,2.729,0.527s1.257,0.812,1.66,1.381c0.403,0.568,0.683,1.225,0.837,1.97
|
||||||
|
c0.155,0.744,0.233,1.51,0.233,2.295v8.531h-1.861v-8.438c0-0.579-0.052-1.143-0.155-1.691c-0.104-0.547-0.285-1.039-0.543-1.473
|
||||||
|
c-0.259-0.435-0.62-0.781-1.086-1.04c-0.465-0.258-1.07-0.388-1.814-0.388c-0.683,0-1.329,0.119-1.939,0.357
|
||||||
|
c-0.609,0.237-1.137,0.6-1.582,1.085c-0.444,0.486-0.796,1.097-1.055,1.831s-0.388,1.598-0.388,2.59v7.166h-1.861V209.628z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 8.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user