Compare commits

..

126 Commits

Author SHA1 Message Date
Steven
b626f3fe57 Publish Stable
- @vercel/frameworks@0.0.14
 - @vercel/build-utils@2.3.0
 - @vercel/cgi@1.0.5
 - vercel@19.0.0
 - @vercel/client@8.0.0
 - @vercel/go@1.1.0
 - @vercel/next@2.6.0
 - @vercel/node-bridge@1.3.0
 - @vercel/node@1.6.0
 - @vercel/python@1.2.0
 - @vercel/routing-utils@1.8.2
 - @vercel/ruby@1.2.0
 - @vercel/static-build@0.17.0
2020-05-07 18:52:35 -04:00
Steven
96bc0c9bee Publish Canary
- vercel@18.0.1-canary.24
2020-05-07 17:56:40 -04:00
Steven
f4ff8c0268 [now-cli] Change precedence of auth directory (#4299) 2020-05-07 23:55:35 +02:00
Steven
1a5681f287 [now-cli] Add getTitleName() and update getCommandName() (#4296)
This PR adds two functions:

* `getTitleName()` - used to get the uppercase Vercel or Now package name, for example `vercel --version`
* `getCommandName()` - used to get the `vercel` command followed by subcommands, for example in error suggestions
2020-05-07 21:24:15 +00:00
Ana Trajkovska
88b66ae646 Publish Canary
- vercel@18.0.1-canary.23
2020-05-07 22:37:48 +02:00
Ana Trajkovska
db0124782a Implement pagination for vercel teams ls (#4294)
* Implement pagination for `now teams ls`

* Set default empty object

* Use output logger

* Trigger build
2020-05-07 22:36:54 +02:00
Nathan Rajlich
a7a5d4d169 [now-cli] Special case @vercel/static when updating builders (#4295) 2020-05-07 19:40:52 +00:00
Nathan Rajlich
4b39e96c28 Ensure the npm registry is used during "Publish" workflow (#4286)
Unset the `npm_config_registry` env var which yarn overwrites to the
yarn registry, which we don't want since the `.npmrc` file that gets
created is configured to the npm registry.
2020-05-07 19:00:16 +00:00
Steven
f459db9f83 [now-cli] Add e2e test for vercel.json and .vercelignore (#4292)
This PR adds a test for a deployment as well as `now dev` to ensure both `vercel.json` and `.vercelignore` are applied.

I also fixed the remaining test helpers to work with `vercel.json`.
2020-05-07 18:04:37 +00:00
Ana Trajkovska
ad19021969 Publish Canary
- vercel@18.0.1-canary.22
2020-05-07 18:54:37 +02:00
Ana Trajkovska
95e41874e4 Replace now with vercel in pagination message (#4290) 2020-05-07 18:49:15 +02:00
Ana Trajkovska
4d20a1d77b Publish Canary
- vercel@18.0.1-canary.21
2020-05-07 14:56:28 +02:00
Ana Trajkovska
325ee261cb Implement pagination for now dns ls (#4257) 2020-05-07 14:53:08 +02:00
Nathan Rajlich
2e0cee490d Publish Canary
- @vercel/build-utils@2.2.2-canary.8
 - vercel@18.0.1-canary.20
 - @vercel/client@7.1.1-canary.5
 - @vercel/go@1.0.8-canary.2
 - @vercel/next@2.5.5-canary.7
 - @vercel/node@1.5.2-canary.9
 - @vercel/python@1.1.7-canary.3
 - @vercel/ruby@1.1.1-canary.2
 - @vercel/static-build@0.16.1-canary.6
2020-05-06 22:16:10 -07:00
Nathan Rajlich
8a9b67a3f3 [now-build-utils] Use @now runtimes for zero-config (#4284)
* [now-build-utils] Use `@now` runtimes for zero-config

This is a temporary change until the `@vercel` runtimes work in
production.

* Temporary fix to E2E
2020-05-06 22:09:06 -07:00
Nathan Rajlich
f1d9a5da96 [now-build-utils][now-cli] Fix isOfficialRuntime() edge case bug (#4282)
Fixes a bug where `isOfficialRuntime('static', '@now/static-build')` was returning `true` when it should have been `false`.

And use the function from `@vercel/build-utils` in Vercel CLI.
2020-05-07 03:33:35 +00:00
Nathan Rajlich
8d9c463e1f [now-cli] Update references to Now CLI as Vercel CLI (#4279)
Update references to Now CLI as Vercel CLI 

Co-authored-by: Steven <steven@ceriously.com>
2020-05-06 21:15:20 -04:00
Steven
e07e8f841a [now-cli] Add special case for .vercel.app (#4281)
There are a few places the CLI needs to know about the special suffix `.now.sh` so we also need to include the upcoming `.vercel.app` suffix.
2020-05-07 01:09:21 +00:00
Steven
0b8a2c0dab [now-cli] Update README.md image (#4278)
This PR updates the name, logo, and tagline.

This will look correct in both light mode and dark mode and the text is no longer part of the image.
2020-05-06 19:44:24 -04:00
Shu Ding
9c2b7132fa add cors headers (#4280) 2020-05-07 07:40:29 +08:00
Steven
d4639a5108 [now-cli] Rename bin to support vercel and vc (#4277)
We want to make sure the bin matches the [installed package name](https://docs.npmjs.com/files/package.json#bin).

This means `npm i -g now` will remain `now` and `npm i -g vercel` will use `vercel` as the binary name.

This allows support for different versions on one machine such as `npm i -g now@17 vercel@19` for example.

In addition, we will also install a shorthand `vc` so you can do `vc env pull` for example.
2020-05-06 23:12:06 +00:00
Steven
ba25004ea8 [all] Check for VERCEL_ environment variables with getPlatformEnv() (#4274)
Added the following env vars, most are undocumented but its good to be consistent:

- `VERCEL_REGION`
- `VERCEL_DEBUG`
- `VERCEL_BUILDER_DEBUG`
- `VERCEL_TOKEN`
- `__VERCEL_SKIP_DEV_CMD`

I also updated the error code prefixes to remove `NOW_`.
There `code` isn't used anywhere, this is just to make it unique and a little shorter.
2020-05-06 22:13:12 +00:00
Steven
639a9b03d2 [now-cli][now-go][now-python] Use `<project>/.vercel/cache' dir during dev (#4273)
We renamed `.now` to `.vercel` in #4234 but still fallback to `.now` if it exists. This is because we don't want users to have to re-link all their existing projects. So we need to make sure that the Runtimes know which directory to use for caching. This PR introduces the `devCacheDir` for this purpose.
2020-05-06 19:23:39 +00:00
Nathan Rajlich
28ffdfbeef Add logging to debug failed npm publish for legacy package names in CI (#4266)
As you can see in https://github.com/zeit/now/runs/647945621,
the final step for publishing the legacy `@now` packages failed
with a 401 error from npm.

This additional logging an to attempt to debug why that is happening.
2020-05-06 18:22:09 +00:00
Steven
5e222d3c03 [tests] Fix cancel workflow pattern (#4264)
Sometimes, the "Cancel" workflow wouldn't run because it didn't match the branch name.
This PR will fix the glob to match any branch name.

- `*`: Matches zero or more characters, but does not match the `/` character.
- `**`: Matches zero or more of any character.

https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
2020-05-06 02:14:55 +00:00
Steven
94c8464728 [now-node][now-static-build] Add test for timezone utc (#4265)
This PR adds a couple tests to ensure that the timezone offset is `0` meaning [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
2020-05-06 01:14:35 +00:00
Nathan Rajlich
898478d1e1 Publish Canary
- @vercel/frameworks@0.0.14-canary.0
 - @vercel/build-utils@2.2.2-canary.7
 - @vercel/cgi@1.0.5-canary.1
 - vercel@18.0.1-canary.19
 - @vercel/client@7.1.1-canary.4
 - @vercel/go@1.0.8-canary.1
 - @vercel/next@2.5.5-canary.6
 - @vercel/node-bridge@1.2.7-canary.3
 - @vercel/node@1.5.2-canary.8
 - @vercel/python@1.1.7-canary.2
 - @vercel/routing-utils@1.8.2-canary.5
 - @vercel/ruby@1.1.1-canary.1
 - @vercel/static-build@0.16.1-canary.5
2020-05-05 17:11:39 -07:00
Nathan Rajlich
8a68211cad [all] Rename packages to vercel and add logic to publish legacy package names to npm (#4233)
https://vercel.com/blog/zeit-is-now-vercel

* Updates all org packages from `@now` to `@vercel`
* Updates Now CLI package name from `now` to `vercel`
  * Packages contains `"bin"` entries for _both_ `vercel` and `now` in the package.json
* Updates `now-client` package name to `@vercel/client` (org scoped, for authenticity)

There is also a new `publish-legacy.sh` script which ensures that all the legacy package names (i.e. `now`, `now-client`, `@now/node`, etc.) will still be published as well.

We will remove this legacy publishing logic on Jan 1, 2021.
2020-05-05 23:43:57 +00:00
Steven
2765207c93 Publish Canary
- @now/build-utils@2.2.2-canary.6
 - now@18.0.1-canary.18
 - now-client@7.1.1-canary.3
 - @now/routing-utils@1.8.2-canary.4
 - @now/static-build@0.16.1-canary.4
2020-05-05 15:06:47 -04:00
Steven
6b52cfdbc7 [now-cli][now-client] Add support for vercel config files (#4234)
This PR renames the CLI and config files to `vercel`.

https://vercel.com/blog/zeit-is-now-vercel

### Complete
- [x] Help menus and error messages should print cli name from `package.json`
- [x] `now.json` => `vercel.json`
- [x] `.nowignore` => `.vercelignore`
- [x] `~/.now` => `~/.vercel`
- [x] `<project>/.now/project.json` => `<project>/.vercel/project.json`

### TODO
I'm going to do the remaining work in a follow-up PR:
- [ ] `<project>/.now/cache` => `<project>/.vercel/cache` (Runtimes sometimes use this)
- [ ] `NOW_*` special cased environment variables
- [ ] `*.now.sh` special cased url suffix
2020-05-05 14:58:05 -04:00
Ana Trajkovska
f474fa1b8c Publish Canary
- now@18.0.1-canary.17
2020-05-05 01:48:14 +02:00
Ana Trajkovska
2cdee19804 [now-cli] Implement pagination for now env ls (#4200)
This PR implements pagination for listing environment variables for a project.
2020-05-04 23:47:05 +00:00
Steven
e9066a3ead Publish Canary
- @now/build-utils@2.2.2-canary.5
 - now@18.0.1-canary.16
 - @now/node@1.5.2-canary.7
2020-05-04 14:37:51 -04:00
Luc
1461fbe331 [tests] add "no only" and "no skip" eslint rules (#4229)
* add "no only" and "no skip" eslint rules

* ignore irrelevant eslint error

Co-authored-by: Steven <steven@ceriously.com>
2020-05-02 11:35:49 +02:00
Nathan Rajlich
099bc6dbf6 Temporarily revert @TooTallNate's now dev updates (#4231)
Needs more time for testing, and we are preparing a new stable release.

This will be un-reverted after the stable release is tagged.
2020-05-02 00:52:21 +00:00
Steven
fe0d762aca Revert "[now-routing-utils] Fix redirect // when cleanUrls and trailingSlash enabled" (#4232)
Reverts zeit/now#4227

This somehow got merged even though the tests didn't pass. Reverting until it can be merged cleanly.
2020-05-01 22:59:53 +00:00
Steven
07c9c0bb6e [now-routing-utils] Fix redirect // when cleanUrls and trailingSlash enabled (#4227)
This PR fixed a corner case when the user defined both `cleanUrls: true` and `trailingSlash: true` and then visited `/index.html` which would attempt to redirect to the invalid `//` path.
2020-05-01 20:44:39 +00:00
Steven
243018b736 [now-cli] Fix CORS headers in now dev (#4225)
This PR fixes a bug where the headers were not applied when exiting with a status code such as 204.

This is a common pattern for CORS where you want `OPTIONS` method respond with 204 status due to a preflight request.

I also updated the test suite to support the `method` property and ensured a body with empty string is asserted.
2020-05-01 14:29:36 -04:00
JJ Kasper
99436b986a Publish Canary
- @now/build-utils@2.2.2-canary.4
 - now@18.0.1-canary.15
 - now-client@7.1.1-canary.2
 - @now/next@2.5.5-canary.5
 - @now/node@1.5.2-canary.6
 - @now/static-build@0.16.1-canary.3
2020-05-01 13:23:17 -05:00
JJ Kasper
dfdef0f6fd [now-next] Update to pass dynamic page values in the query (#4196)
As discussed this updates to leverage the new named regexes and route keys output in the `routes-manifest.json` to pass the dyname page values in the query to ensure we're handling edge cases with the new custom routes support

Note: the `yarnPreferOffline` change is unrelated and was added to make debugging easier as the build can fail when using this option and the cache is invalid for some packages. 

x-ref: https://github.com/zeit/next.js/pull/12250
2020-05-01 18:08:09 +00:00
Steven
921327d878 [api] Update build script (#4224)
In PR #3514, we added a `/api` directory for functions and a `/public` directory which was created at build time.

This moves the build script to be `now-build` so we don't don't need to build everything in the repo and also no longer need to special case the git env vars.
2020-05-01 09:42:40 -04:00
Arunoda Susiripala
c48fd3e891 Update README.md 2020-05-01 12:18:51 +05:30
Nathan Rajlich
5142e32bed [now-cli] Update now dev HTML templates to use "Vercel" (#4216) 2020-05-01 00:25:01 +00:00
Steven
d360169b06 [now dev] Fix handle: miss override headers (#4217)
Fixes a bug with `now dev` where headers from the `miss` phase were overriding when they shouldn't be.

```json
{
  "version": 2,
  "routes": [
    {
      "handle": "filesystem"
    },
    {
      "src": "/([^/]+)",
      "headers": { "override": "one" },
      "dest": "/blog/$1",
      "check": true
    },
    {
      "handle": "miss"
    },
    {
      "src": "/(.*)",
      "dest": "/src/$1",
      "check": true
    },
    {
      "src": "/src/blog/([^/]+)",
      "headers": { "test": "1", "override": "two" },
      "dest": "/src/blog/$1.html",
      "check": true
    }
  ]
}
```
2020-04-30 23:51:02 +00:00
Nathan Rajlich
7b1893b9f7 [now-node] Use project env vars in startDevServer() and respect NODEJS_HELPERS env var (#4211)
Depends on #4210.
2020-04-30 15:12:46 -07:00
Steven
fb07360b71 [tests] Run now dev tests agains real deployments (#4183)
This PR makes sure that all the `now dev` tests have a corresponding deployment and each assert is also compared to the deployment.

If you want to opt-out of this behavior, for example a test that is meant for specific dev functionality, then there is an option `skipDeploy: true`.

This also fixes a bug where headers were not assigned during proxying to a dev server.
2020-04-30 17:36:32 -04:00
Nathan Rajlich
3a00aed989 [now-cli] Pass in env vars to startDevServer() in now dev (#4210)
The Runtime is expected to set up these env vars in the dev server
child processes that it spawns.
2020-04-30 14:32:29 -07:00
JJ Kasper
64944f8926 [now-cli] (Major) Upload .env files but ignore .local files (#4205)
As discussed this updates to no longer ignore all `.env` files by default and only ignores local env files which matches what we default the `.gitignore` to in our default `create-next-app` [template](20b62de8d7/packages/create-next-app/templates/default/gitignore (L26-L30))

A separate docs PR has been made here https://github.com/zeit/docs/pull/1808 which can be landed after this PR
2020-04-30 21:13:53 +00:00
Nathan Rajlich
5e4eee4db1 [now-cli] Only update build matches once per HTTP request (#4212)
Minor optimization since the "serve" function sometimes gets invoked
recursively.
2020-04-30 20:34:30 +00:00
Nathan Rajlich
a1a5e0ef0d [now-node] Make "without helpers" config option work as expected in startDevServer() (#4208) 2020-04-30 10:49:29 -07:00
Steven
91b9b7f880 Publish Canary
- now@18.0.1-canary.14
 - @now/node@1.5.2-canary.5
2020-04-30 09:20:16 -04:00
Nathan Rajlich
8e29924165 [now-node] Add TypeScript support to startDevServer() (#4185)
Using `ts-node`, with asynchronous type checking via `tsc --no-emit`.

This also removes `ncc` of `typescript` during the build in favor of
having typescript be a regular npm "dependency".
2020-04-30 09:19:30 -04:00
Luis Alvarez D
9083b558f0 Switch to Vercel in the command help for now domains (#4193)
Noticed that we still say `Zeit` while using the now cli.

The inspect command still points to zeit.co when I tested it some hours ago but that seems to be fixed already 😄
2020-04-29 18:19:16 +00:00
Ana Trajkovska
0bf8c3751b Publish Canary
- @now/cgi@1.0.5-canary.0
 - now@18.0.1-canary.13
 - now-client@7.1.1-canary.1
 - @now/next@2.5.5-canary.4
 - @now/node-bridge@1.2.7-canary.2
 - @now/node@1.5.2-canary.4
 - @now/python@1.1.7-canary.1
2020-04-29 12:52:06 +02:00
Ana Trajkovska
3ef832fdbe [now-cli] Implement pagination for now projects ls (#4186)
* Implement pagination for `now projects ls`

* Fix spacing
2020-04-29 12:50:05 +02:00
Nathan Rajlich
4bc6ebe286 [now-cli] Assert 200 status code in dev server unit tests (#4184) 2020-04-28 15:42:25 -07:00
Steven
5660474739 [tests] Remove test.only() so all tests will execute (#4180)
Fix a regression from #4160, specifically bab5794641acbf2ae3f419faf0b1d3565fbf1de3 that was preventing the CLI tests from running.
2020-04-28 19:52:38 +00:00
Nathan Rajlich
e85a62703c [now-cli] Use yarn for now dev integration tests (#4175)
This was switched to `npm` for debugging purposes in #4124, but at this
point we can switch it back to `yarn` so the tests don't take as long.

Co-authored-by: Leo Lamprecht <leo@zeit.co>
2020-04-28 21:09:49 +02:00
Steven
3a3cfd4d7b [tests] Fix remaining lint errors (#4179)
As a follow up to #4178, this fixes the final lint errors so we can run in CI.

Since lint is very quick, about 8 seconds, we can run it on the entire repo instead of only changed files.

I also disabled a couple rules that were leading to 500 warnings we would likely never change.
2020-04-28 11:37:10 -04:00
Nimish Gupta
9570d64b67 fix: removed linting errors on yarn lint (#4178) 2020-04-28 09:11:46 -04:00
Nathan Rajlich
e77ea00e9d Publish Canary
- now@18.0.1-canary.12
2020-04-27 18:22:41 -07:00
Nathan Rajlich
aebe77d222 [now-cli] Make nowCliPkg parameter non-optional (#4173)
To prevent bugs like https://github.com/zeit/now/pull/4163.
2020-04-27 18:21:05 -07:00
Nathan Rajlich
53cb2cc4c5 [now-cli] Don't print "Error starting dev server" message by default (#4172)
It's not useful information and distracts from whatever the actual error
message was from the dev server, which is what the user is actually
interested in.
2020-04-28 01:20:33 +00:00
Arunoda Susiripala
4d75ed5117 [now-cli] Allow to accept equal sign(=) as a value for meta (#4160)
Currently if the value is `=` it will throw an error from the API.
2020-04-28 00:18:51 +00:00
Nathan Rajlich
e6c84dd70b [now-cli] Add 1 minute timeout to now login integration tests (#4166) 2020-04-27 23:21:50 +00:00
Nathan Rajlich
d51f0d0f06 [now-cli] Remove "Stopping now dev server" message (#4165) 2020-04-27 15:01:23 -07:00
JJ Kasper
4cd35c48a2 Publish Canary
- now@18.0.1-canary.11
 - @now/next@2.5.5-canary.3
2020-04-27 16:48:43 -05:00
JJ Kasper
69ac4f3eb8 [now-next] Update error throwing to use NowBuildError (#4167)
Per https://github.com/zeit/now/pull/4161#discussion_r416042826 this updates to use `NowBuildError` for our errors instead of the standard `Error` instance
2020-04-27 20:40:32 +00:00
Nathan Rajlich
2c9cbe20f3 [now-cli] Fix logic to not install bundled runtimes into cache dir for now dev (#4163) 2020-04-27 12:21:29 -07:00
Ana Trajkovska
4ddd2f016c Publish Canary
- @now/build-utils@2.2.2-canary.3
 - now@18.0.1-canary.10
 - @now/next@2.5.5-canary.2
 - @now/routing-utils@1.8.2-canary.3
2020-04-27 20:56:36 +02:00
JJ Kasper
76f61cbbf0 [now-next] Provide a better error when failing to load routes-manifest (#4161)
This updates the error message shown when we fail to load the `routes-manifest` which appears to be happening most often when an incorrect output directory is configured for a Next.js application
2020-04-27 18:05:03 +00:00
YuLe
23fe8affec [now-cli] Use imported pkg instead of require("../package.json") (#4159) 2020-04-27 10:32:33 -07:00
Steven
5334caad54 [api] Use 405 method not allowed (#4148)
I was doing a diff and noticed this returns the wrong status code.

This PR changes the unknown method response to [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) status code.
2020-04-27 11:38:22 -04:00
Steven
103e4117c3 [now-routing-utils] Add support for permanent in redirects (#4150)
This adds `permanent` for `redirects` defined in Next.js RFC https://github.com/zeit/next.js/issues/9081

```json
{
  "redirects": [
    { "source": "/foo", "destination": "/api/foo", "permanent": true }
  ]
}
```
2020-04-27 11:37:15 -04:00
Ana Trajkovska
3e774d0531 Implement pagination for now dns ls <domain> (#4134)
Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-27 15:26:53 +02:00
Nathan Rajlich
5e2139f408 Publish Canary
- now@18.0.1-canary.9
2020-04-24 17:33:32 -07:00
Nathan Rajlich
55e4bffcd2 [now-cli] Add the core Runtimes as npm dependencies for now dev (#4117)
Rather than creating a `builders.tar.gz` file with the core Runtimes and
bundling that tarball with Now CLI, simply have them be regular npm
dependencies so that they are installed into Now CLI's `node_modules`
directory.

When one of the core runtimes is specified for a build, the runtime will be
required as a regular module dependency of Now CLI, and the builders cache
will never touched.

Bundled runtimes are also no longer updated, making the runtime versions
pinned to the version of Now CLI.

Logic for the builders cache directory still remains, but will now only be
used when using a Community Runtime (or development tarball URL).
2020-04-25 00:19:58 +00:00
Nathan Rajlich
de3a066934 [now-cli] Use npx to invoke ncc in build script (#4146)
The previous file path for ncc isn't always reliable during development,
depending on which directory `yarn` is invoked in inside the monorepo.

Using `npx` ensures the version specified in the now-cli `package.json`
is used even if it's installed at the root of the monorepo.
2020-04-24 20:05:25 +00:00
Steven
257b0ca5b6 Publish Canary
- now@18.0.1-canary.8
2020-04-24 14:09:01 -04:00
Nathan Rajlich
e826d48814 [now-cli] Remove yarn as a dev dependency (#4141)
Remove yarn dependency since it is no longer used.

Co-authored-by: Steven <steven@ceriously.com>
2020-04-24 12:06:00 -04:00
Nathan Rajlich
d4ecfb04bb [now-cli] Update chokidar to v3.3.1 (#4142)
For Node 14 support:

> npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+.
> Upgrade to chokidar 3 with 15x less dependencies.
2020-04-24 09:25:21 -04:00
Steven
cad10e1918 [now-cli] (Major) Change project settings inheritance (#4135)
When Now CLI 17 introduce the `.now` directory with project settings, it started assuming that the current project scope should be used for all commands. This made `now switch` do nothing unless you changed the current directory.

This PR is a _major_ semver change so that the only commands that inherit the project settings are:

- `now deploy`
- `now dev`
- `now env`

For example, `now ls` will not observe project settings and instead observe `now switch`.
2020-04-24 13:06:01 +00:00
Nathan Rajlich
1e221c48f9 [now-cli] Ensure the builders.tar.gz file is finished extracting (#4124)
`now dev` integration tests have been failing as of recently with failures to require Runtime builders from the builder cache. Upon investigation, it turns out that the `builders.tar.gz` file was not being completely extracted since the integration tests complete quickly and then kill the Now CLI process, which has not yet completed the extraction.

Fix is to ensure the tarball extraction promise is fully resolved before cleanly shutting down.

Also now applying the clean shutdown logic upon `SIGTERM` signal, which is what the integration tests send to shut down the Now CLI process.
2020-04-23 21:49:20 +00:00
Nathan Rajlich
15221bf19c [now-cli] Add the x-vercel-id and x-vercel-cache response headers to now dev (#4137)
Matches current production.
2020-04-23 12:58:25 -07:00
Paco
2513fecaf4 [examples] Update vercel.svg in Next.js example (#4128)
* Update vercel.svg in Next.js example

* Update to thinner variant
2020-04-23 12:42:08 -07:00
Nathan Rajlich
d723d985e3 [now-cli] Prevent infinite loop for Runtime "module not found" in now dev (#4126) 2020-04-23 12:41:47 -07:00
Steven
2d0a71946b Publish Canary
- now@18.0.1-canary.7
 - @now/static-build@0.16.1-canary.2
2020-04-22 17:55:24 -04:00
Steven
4b7af4d7d3 [now-cli] Fix flicker from file upload progress bar (#4125)
This PR fixes a bug where deploying a new project would flicker between two states: the upload progress bar and "Setting up Project" spinner.
2020-04-22 17:48:47 -04:00
Steven
8e3f4a1ca2 [now-static-build] Add tests for gem install of native deps (#4123)
These tests ensure we can install native dependencies with `gem install` such as:
- `rmagic`
- `ruby-vips`

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-22 16:25:44 -04:00
Nathan Rajlich
2a9e5798a8 Publish Canary
- @now/build-utils@2.2.2-canary.2
 - now@18.0.1-canary.6
 - now-client@7.1.1-canary.0
 - @now/go@1.0.8-canary.0
 - @now/next@2.5.5-canary.1
 - @now/node@1.5.2-canary.3
 - @now/python@1.1.7-canary.0
 - @now/routing-utils@1.8.2-canary.2
 - @now/ruby@1.1.1-canary.0
 - @now/static-build@0.16.1-canary.1
2020-04-22 11:17:47 -07:00
Nguyễn Hồng Quân
5b369b385d [now-python] Fix: Relative imported module not seen in sys.modules (#4097)
After #4024 was merged, I tested and still got the same error. I searched around and found that the lines of code are in wrong order (ref: https://bugs.python.org/issue37521). So this is the proper fix.

Co-authored-by: Steven <steven@ceriously.com>
2020-04-22 10:07:42 -04:00
Steven
28e01528c5 [all] Rename ZEIT Now to Vercel (#4112)
https://vercel.com/blog/zeit-is-now-vercel

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-21 19:11:12 -04:00
Nathan Rajlich
987ce6c26b [now-node] Fix dev server exit event handling (#4113)
Child process `exit` events have two arguments (`code` and `signal`)
so the `once.spread()` function needs to be used.
2020-04-21 14:31:56 -07:00
Leo Lamprecht
21e4d644cf [now-cli] Use vercel.com URL for inspecting deployments (#4111) 2020-04-21 14:12:15 -07:00
Nathan Rajlich
282127e3f9 [now-cli] Use npm instead of yarn for now dev Runtimes installation (#4107)
Stop downloading and caching `yarn` from GitHub Releases in `now dev`,
and instead simply rely on the user having `npm` installed. The user is
extremely likely to have `npm`, since Now CLI now requires `node` to be
installed (no longer using `pkg`) which comes with `npm` bundled by
default.
2020-04-21 19:20:32 +00:00
Nathan Rajlich
7748f50ca9 [now-cli] Clean up builder dev server shutdown logic (#4109)
DRY and removes the `pid` from the set immediately so there's no race
condition if the server is shut down shortly after an HTTP request
(like in the tests).
2020-04-21 15:25:50 +00:00
Steven
224757581d Publish Canary
- @now/build-utils@2.2.2-canary.1
2020-04-20 17:00:58 -04:00
Steven
40e99284c2 [now-build-utils] Prefer yarn over npm install when both detected (#4106)
Previously, when `package-lock.json` was detected, we would always use `npm install`.

This PR changes the behavior to the following:
- If only `package-lock.json` is detected, we use `npm install`.
- If both `package-lock.json` and `yarn.lock` are detected, use `yarn install`.

This will avoid npm bugs such as `npm ERR! Cannot read property 'match' of undefined`.
2020-04-20 20:54:09 +00:00
Steven
54bae977f0 Publish Canary
- @now/routing-utils@1.8.2-canary.1
2020-04-20 14:04:43 -04:00
Steven
867590a6ba [now-routing-utils] Fix validation for rewrite/redirect destination segments (#4105)
- Print an error instead of throwing when `destination` has segment not found in `source`
- Update docs to explain how to fix this error
- Add a couple tests
- Update uncaught `path-to-regexp` error message to print the full route that caused the error
2020-04-20 17:54:25 +00:00
Ana Trajkovska
c89cf6fd57 Publish Canary
- now@18.0.1-canary.5
 - @now/node@1.5.2-canary.2
2020-04-20 14:54:32 +02:00
Ana Trajkovska
b7ad18425f [now-cli] Implement pagination for listing secrets (#4084)
* Implement pagination for listing secrets

* Fix tests

* Improvements

* Fix removing a secret
2020-04-20 14:52:18 +02:00
Nathan Rajlich
5554b2d004 Publish Canary
- now@18.0.1-canary.4
2020-04-17 18:21:55 -07:00
Nathan Rajlich
e4ce0d6802 Publish Canary
- @now/node@1.5.2-canary.1
2020-04-17 18:16:17 -07:00
Nathan Rajlich
f477ee6e3b [now-node] Throw an error if "exit" event happens in dev server (#4095)
If the process exits before the "message" event is sent, then the dev
server crashed upon bootup. Often times caused by a missing dependency.
2020-04-18 01:15:43 +00:00
Nathan Rajlich
59b4029a0c [now-cli] Handle errors from startDevServer() in now dev (#4094) 2020-04-18 00:51:14 +00:00
Nathan Rajlich
8411b53fa3 [now-cli] Use entrypoint instead of src for startDevServer() (#4093)
Otherwise the `src` is modified to not have the file extension when used
with zero-config API routes.
2020-04-17 15:01:44 -07:00
Nathan Rajlich
7651bcf4a4 Publish Canary
- @now/build-utils@2.2.2-canary.0
 - now@18.0.1-canary.3
 - @now/next@2.5.5-canary.0
 - @now/node@1.5.2-canary.0
 - @now/static-build@0.16.1-canary.0
2020-04-17 13:59:52 -07:00
Nathan Rajlich
6fd1b50924 [now dev] Add support for proxying to builder-specific dev servers (#4089)
This is an extension to the Runtime API, where a runtime can optionally define a `startDevServer()` function which is responsible for spawning a single-serve dev server for an individual HTTP request (the dev server is booted up upon receiving an HTTP request, and gets shut down by `now dev` after the HTTP request is completed). For runtimes that define this function, the `build()` function will never be executed, which avoids a lot of unnecessary processing for a dev environment.

Some things this accomplishes:

 * Retains the proper stack trace for errors.
 * Ensures that if a source code file is changed, and then an HTTP request is sent, it's guaranteed to be using the latest code (no file watching, or re-compilations).
 * Avoids creating a Lambda zip file (just to immediately unpack it for dev).
 * Avoids `@zeit/fun` completely, which loses some "correctness" (i.e. function is not frozen in between requests).
 * Backwards compatible with older Now CLIs - versions that don't know about `startDevServer()` will just invoke `build()`, and there's no version change required in the Runtime.
2020-04-17 20:55:44 +00:00
Nathan Rajlich
a03b8689e9 [now dev] Remove "Installing dependencies..." message (#4090)
The `runNpmInstall()` function is already a no-op when invoked via `now dev` (#2926), however the "Installing" message was still being printed, leading to confusion about whether or not they actually are (they're not).
2020-04-17 02:49:33 +00:00
Andy
22c8ed15c7 [now-cli] Fix unhandled unauthorized error and improve getTeamById (#4082)
* [now-cli] Fix unhandled unauthorized error

* Make getTeamById more efficient

* Add cache

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Steven <steven@ceriously.com>

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2020-04-16 11:04:56 +02:00
Ana Trajkovska
e1f7b859b6 Publish Canary
- now@18.0.1-canary.2
 - @now/routing-utils@1.8.2-canary.0
2020-04-16 00:03:51 +02:00
Ana Trajkovska
c75cc99f1e [now-cli] Implement pagination for listing certs (#4075)
* Implement pagination for listing certs

* Remove --after option

* Fix tests
2020-04-16 00:02:46 +02:00
Steven
30ddd29889 [now-routing-utils] Fix error when hash contains question mark (#4080)
This PR fixes a [sentry error](https://sentry.io/organizations/zeithq/issues/1610773321/events/af1d6bee58c9413c81eb250ff0178917/) caused by route `destination` that contains a question mark in the hash.
2020-04-15 21:18:00 +00:00
JJ Kasper
21337de7cd Publish Stable
- @now/next@2.5.4
2020-04-15 15:57:17 -05:00
JJ Kasper
a6686f9ff5 Publish Canary
- now@18.0.1-canary.1
 - @now/next@2.5.4-canary.0
2020-04-15 15:52:16 -05:00
JJ Kasper
65c621bd55 [now-next] Fix static 404 not being used in mono-repo set-up (#4083)
This fixes the static 404 page not being used when deploying in a mono-repo structure. Before we weren't taking into account the `entryDirectory` where we needed to causing us to deploy `_error` when we didn't need to

x-ref: https://github.com/zeit/now/discussions/4077#discussioncomment-4625
2020-04-15 20:29:12 +00:00
Luc
0827d3514d [now-cli] Remove custom error when fetching frameworks fail (#4081)
Fix PRODUCT-2364.

Use `Client` instead of `node-fetch` to retrieve frameworks list.
2020-04-15 17:30:48 +00:00
Steven
7bc5d9fb5b Publish Canary
- now@18.0.1-canary.0
2020-04-15 12:30:24 -04:00
Steven
c53106ecee [now-cli] Fix for RangeError invalid count value (#4074)
This PR fixes a [sentry error](https://sentry.io/organizations/zeithq/issues/1611628097/events/75ed28bc6aef42868721a0912875fdbd/) where `repeat()` is passed a negative number and throws [`RangeError: invalid count value`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Resulting_string_too_large).

This PR ensures `repeat()` is always passed 0 or greater.
2020-04-15 15:22:30 +00:00
Andy
91e4d18ab8 [now-cli] Proxy everything except Lambdas to the dev server (#4079) 2020-04-15 16:29:59 +02:00
Steven
33cd78b93a [now-cli] Fix undefined teams and cache result (#4071)
- Fix [sentry error](https://sentry.io/organizations/zeithq/issues/1610513448/events/12bde04e921442a4aae8b7b10a759ecb/) where the `teams` might be undefined.
- Fix regression from #3740 which accidentally removed caching `teams`.
- Fix superflous `console.time()` calls for the same `GET /teams` API call. See below:

```sh
> [debug] [2020-04-14T18:31:00.220Z] GET https://api.zeit.co/www/user
> [debug] [2020-04-14T18:31:00.533Z] GET https://api.zeit.co/www/user : 313.078ms
> [debug] [2020-04-14T18:31:00.543Z] GET https://api.zeit.co/teams
> [debug] [2020-04-14T18:31:00.799Z] GET https://api.zeit.co/teams : 255.459ms
> [debug] #1 GET /teams: 260.198ms
```
2020-04-14 19:35:53 +00:00
Dávid Lévai
a765d27e5a [examples] Fix typo in Gatsby example (#4063)
Co-authored-by: Steven <steven@ceriously.com>
2020-04-14 15:06:18 -04:00
Steven
e65ff4bfd5 [examples] Fix ionic-react missing public directory (#4070)
The `public` directory was missing from the `ionic-react` example because we were ignoring all `public` directories.

This PR adds the public directory back (it is copied from now-static-build test fixtures). I also updated `.gitignore` and `.gitattributes` to be a little more friendly to our test fixtures so this doesn't happen again.
2020-04-14 16:31:49 +00:00
Steven
30a4787390 [now-cli] Fix encoding domain names (#4068)
Fixes [sentry error](https://sentry.io/organizations/zeithq/issues/1611174358/events/c3455f32ce1743b58cc248d548538b21/) so that domain name is always encoded because this input comes from the user.
2020-04-14 16:00:04 +00:00
Naoyuki Kanezawa
36f6f1db77 remove query and all options from log (#4066) 2020-04-15 00:31:57 +09:00
593 changed files with 24282 additions and 8860 deletions

3
.gitattributes vendored
View File

@@ -1,5 +1,8 @@
# Ignore test fixtures in GitHub Languages
# See https://github.com/github/linguist#vendored-code
examples/* linguist-vendored
utils/* linguist-vendored
test/* linguist-vendored
packages/*/test/* linguist-vendored
# Go build fails with Windows line endings.

View File

@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
### Enforcement
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
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.

View File

@@ -47,7 +47,7 @@ Unit tests are run locally with `jest` and execute quickly because they are test
### 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.
@@ -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
3. Run `npm pack` to create a tarball file
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
## 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.
2. Add an example to the `examples/` directory: The name of the directory should equal the slug of the framework used in `@now/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
3. Update the `@now/static-build` package: The file `packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
4. After your Pull Request has been merged and released, other users can select the example on the ZEIT Now dashboard and deploy it.
4. After your Pull Request has been merged and released, other users can select the example on the Vercel dashboard and deploy it.

View File

@@ -1,16 +1,16 @@
# [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 [Name] project with ZEIT Now.
Deploy your own [Name] project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
### How We Created This Example
To get started with [Name] on Now, you can use the [CLI Tool Used](CLI-link) to initialize the project:
To get started with [Name] on Vercel, you can use the [CLI Tool Used](CLI-link) to initialize the project:
```shell
$ now init charge

View File

@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://zeit.co/support/request
about: Report a bug using the ZEIT Now support form
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

View File

@@ -2,7 +2,7 @@ name: Cancel
on:
push:
branches:
- '*'
- '**'
- '!master'
jobs:

View File

@@ -22,9 +22,6 @@ jobs:
- 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

View File

@@ -11,7 +11,7 @@ on:
jobs:
test:
name: Dev
timeout-minutes: 30
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
@@ -31,3 +31,6 @@ jobs:
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 }}

View File

@@ -25,9 +25,10 @@ jobs:
- uses: actions/setup-node@v1
- run: yarn install
- run: yarn run build
- run: yarn run test-lint
- 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 now run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
- run: yarn workspace vercel run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run coverage once
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

8
.gitignore vendored
View File

@@ -6,6 +6,7 @@ npm-debug.log
yarn-error.log
.nyc_output
coverage
coverage.lcov
*.swp
*.bak
*.tgz
@@ -19,9 +20,12 @@ packages/now-cli/test/**/node_modules
packages/now-cli/test/dev/fixtures/08-hugo/hugo
packages/now-cli/test/dev/fixtures/**/dist
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
test/lib/deployment/failed-page.txt
.DS_Store
.next
.env
public
/.env
/public
__pycache__

View File

@@ -3,10 +3,10 @@
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.
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.
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
@@ -18,7 +18,7 @@ The latest and suggested version is `3`.
### `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
export analyze({
@@ -43,7 +43,7 @@ export analyze(options: AnalyzeOptions) {
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
build({
@@ -109,7 +109,7 @@ export prepareCache(options: PrepareCacheOptions) {
### `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
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.
- `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`.
- `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
@@ -153,7 +153,7 @@ Check out our [Node.js Runtime](https://github.com/zeit/now/tree/master/packages
### 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.
@@ -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`.
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
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.

View File

@@ -1,15 +1,19 @@
![now](https://assets.zeit.co/image/upload/v1581518533/repositories/now-cli/v4.png)
<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>
[![CI Status](https://badgen.net/github/checks/zeit/now?label=CI)](https://github.com/zeit/now/actions?workflow=CI)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/zeit/now/discussions)
## Usage
Get started by [Importing a Git Project](https://zeit.co/import) and use `git push` to deploy. Alternatively, you can [install Now CLI](https://zeit.co/download).
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).
## Documentation
For details on how to use ZEIT Now, check out our [documentation](https://zeit.co/docs).
For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
## Caught a Bug?
@@ -17,7 +21,7 @@ For details on how to use ZEIT Now, check out our [documentation](https://zeit.c
2. Install dependencies with `yarn install`
3. Compile the code: `yarn build`
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.

View File

@@ -17,9 +17,9 @@ export function withApiHandler(handler: Handler): Handler {
}
if (req.method !== 'GET') {
return res.status(404).json({
return res.status(405).json({
error: {
code: 'not_found',
code: 'method_not_allowed',
message: 'Only GET requests are supported for this endpoint.',
},
});

View File

@@ -19,5 +19,8 @@ export default withApiHandler(async function(
req: NowRequest,
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);
});

View File

@@ -8,7 +8,7 @@ the provider couldnt solve the requested challenges.
## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error,
If your domain is pointing to Vercel DNS and youre getting this error,
it could be that:
- 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,
it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this
If your domain is _not_ pointing to Vercel DNS and youre getting this
error, the following methods could help:
- 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.
- 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.
- 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.

View File

@@ -7,9 +7,9 @@ used an unknown or invalid dc identifier.
#### 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
and DCs have to be in *lowercase*.
and DCs have to be in _lowercase_.
**Valid region identifiers**:
@@ -19,7 +19,7 @@ and DCs have to be in *lowercase*.
- `gru`
- `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.
**Valid DC identifiers**:

View File

@@ -4,12 +4,12 @@
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
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.
## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error,
If your domain is pointing to Vercel DNS and youre getting this error,
it could be that:
- 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,
it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this
If your domain is _not_ pointing to Vercel DNS and youre getting this
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.

View File

@@ -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.
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>`.
#### 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)

View File

@@ -13,7 +13,7 @@ Wrap the `RegExp` part of your `source` as an un-named parameter.
```js
{
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
{
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'
}
```

View File

@@ -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.
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).

View File

@@ -1,7 +1,8 @@
# Missing Environment Variables While Developing
#### 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.
@@ -23,4 +24,4 @@ TEST=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).

View File

@@ -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.
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`.

View File

@@ -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.
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).

View File

@@ -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
- 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).
- Ensure that both `~/now/auth.json` and `~/now/config.json` exist
- 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 `~/vercel/auth.json` and `~/vercel/config.json` exist

View File

@@ -8,4 +8,4 @@ In turn, they would have to take the value of the `--token` flag into considerat
#### 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.

View File

@@ -27,7 +27,7 @@ Serverless:
- 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.
- 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

View 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.

View File

@@ -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`
(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
the command line flag to bind to a specific port is (in many cases, it is one of:
`-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)

View File

@@ -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.
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).

View File

@@ -3,18 +3,18 @@
## Why This Error Occurred
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,
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.
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
point to Vercel DNS, we cannot create the records to solve the challenge.
## How to Fix It
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.
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
`--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.

View File

@@ -7,11 +7,10 @@ setting. This isn't supported yet.
#### 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
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
```

View File

@@ -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
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.
If you think your code is taking too long to instantiate, this can be due

18
examples/README.md vendored
View File

@@ -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.
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?
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)
- [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
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
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
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
@@ -80,6 +80,6 @@ Now Examples is an open source project released under the [MIT License](https://
## Get In Touch
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 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.
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/zeit/now/discussions)

View File

@@ -1,18 +1,18 @@
# 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 AMP project with ZEIT Now.
Deploy your own AMP project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
_Live Example: https://amp.now-examples.now.sh_
### 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
$ now init amp

View File

@@ -2,13 +2,13 @@
# 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 Angular project with ZEIT Now.
Deploy your own Angular project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
_Live Example: https://angular.now-examples.now.sh_
@@ -22,7 +22,7 @@ $ ng new
### 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
$ now

View File

@@ -1,18 +1,18 @@
# 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 Brunch project with ZEIT Now.
Deploy your own Brunch project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
_Live Example: https://brunch.now-examples.now.sh_
### 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
$ brunch new project-name -s es6
@@ -20,7 +20,7 @@ $ brunch new project-name -s es6
### 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
$ now

View File

@@ -12,6 +12,6 @@
<div class="brunch">
<img src="/brunch-napkin.svg" alt="Brunch">
<h4>Bon Appétit.</h4>
<h6>A <a href="http://brunch.io" target="_blank">Brunch</a> website deployed on <a href="https://zeit.co" target="_blank">ZEIT Now</a></h6>
<h6>A <a href="http://brunch.io" target="_blank">Brunch</a> website deployed on <a href="https://vercel.com" target="_blank">Vercel</a></h6>
</div>
</body>

View File

@@ -2,19 +2,19 @@
# React Example
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own React project, along with Serverless Functions, with ZEIT Now.
Deploy your own React project, along with Serverless Functions, with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
_Live Example: https://create-react-app.now-examples.now.sh/_
### How We Created This Example
To get started with React, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with ZEIT Now, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
To get started with React, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with Vercel, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
```shell
$ npx create-react-app my-app
@@ -22,7 +22,7 @@ $ npx create-react-app my-app
### Deploying From Your Terminal
You can deploy your new React project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new React project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -18,11 +18,11 @@ function App() {
<h2>
Deployed with{' '}
<a
href="https://zeit.co/docs"
href="https://vercel.com/docs"
target="_blank"
rel="noreferrer noopener"
>
ZEIT Now
Vercel
</a>
!
</h2>

View File

@@ -1,18 +1,18 @@
# Custom Build Example
This directory is a brief example of using a Custom Build script that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of using a Custom Build script that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Custom Built project with ZEIT Now.
Deploy your own Custom Built project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
_Live Example: https://custom-build.now-examples.now.sh_
### How We Created This Example
To get started deploying a Custom Built project with ZEIT Now, you can use the [Now CLI](https://zeit.co/download) to initialize the project:
To get started deploying a Custom Built project with Vercel, you can use the [Now CLI](https://vercel.com/download) to initialize the project:
```shell
$ now init custom-build
@@ -20,7 +20,7 @@ $ now init custom-build
### Deploying From Your Terminal
You can deploy your new Custom Built project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Custom Built project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Docusaurus Example
This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Docusaurus project with ZEIT Now.
Deploy your own Docusaurus project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
_Live Example: https://docusaurus.now-examples.now.sh_
### How We Created This Example
To get started with Docusaurus for deployment with ZEIT Now, you can use the [Docusaurus CLI](https://docusaurus.io/docs/en/installation) to initialize the project:
To get started with Docusaurus for deployment with Vercel, you can use the [Docusaurus CLI](https://docusaurus.io/docs/en/installation) to initialize the project:
```shell
$ docusaurus-init
@@ -22,7 +22,7 @@ $ docusaurus-init
### Deploying From Your Terminal
You can deploy your new Docusaurus project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Docusaurus project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,16 +1,16 @@
# Dojo Example
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Dojo project with ZEIT Now.
Deploy your own Dojo project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
### How We Created This Example
To get started with Dojo on Now, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
To get started with Dojo on Vercel, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
```shell
$ now init dojo

View File

@@ -2,19 +2,19 @@
# Eleventy Example
This directory is a brief example of a [Eleventy](https://www.11ty.io/) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Eleventy](https://www.11ty.io/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Eleventy project with ZEIT Now.
Deploy your own Eleventy project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
_Live Example: https://eleventy.now-examples.now.sh_
### How We Created This Example
To get started with Eleventy for deployment with ZEIT Now, you can use [npx](https://www.npmjs.com/package/npx) to initialize the project:
To get started with Eleventy for deployment with Vercel, you can use [npx](https://www.npmjs.com/package/npx) to initialize the project:
```shell
$ npx degit 11ty/eleventy-base-blog my-11ty-project
@@ -22,7 +22,7 @@ $ npx degit 11ty/eleventy-base-blog my-11ty-project
### Deploying From Your Terminal
You can deploy your new Eleventy project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Eleventy project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Ember Example
This directory is a brief example of an [Ember](https://emberjs.com/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of an [Ember](https://emberjs.com/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Ember project with ZEIT Now.
Deploy your own Ember project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
_Live Example: https://ember.now-examples.now.sh_
### How We Created This Example
To get started with Ember for deployment with ZEIT Now, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
To get started with Ember for deployment with Vercel, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
```shell
$ npx ember-cli new ember-project
@@ -22,7 +22,7 @@ $ npx ember-cli new ember-project
### Deploying From Your Terminal
You can deploy your new Ember project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Ember project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Gatsby Example
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Gatsby project, along with Serverless Functions, with ZEIT Now.
Deploy your own Gatsby project, along with Serverless Functions, with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
_Live Example: https://gatsby.now-examples.now.sh_
### How We Created This Example
To get started with Gatsby on Now, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
To get started with Gatsby on Vercel, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
```shell
$ gatsby new gatsby-site
@@ -22,7 +22,7 @@ $ gatsby new gatsby-site
### Deploying From Your Terminal
You can deploy your new Gatsby project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Gatsby project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -8,7 +8,7 @@ module.exports = {
resolve: `gatsby-plugin-manifest`,
options: {
name: 'Gatsby + Node.js (TypeScript) API',
short_name: 'Gatbsy + Node.js (TypeScript)',
short_name: 'Gatsby + Node.js (TypeScript)',
start_url: '/',
icon: 'src/images/gatsby-icon.png',
},

View File

@@ -21,11 +21,11 @@ function Index() {
<h2>
Deployed with{' '}
<a
href="https://zeit.co/docs"
href="https://vercel.com/docs"
target="_blank"
rel="noreferrer noopener"
>
ZEIT Now
Vercel
</a>
!
</h2>

View File

@@ -2,19 +2,19 @@
# Gridsome Example
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Gridsome project with ZEIT Now.
Deploy your own Gridsome project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/gridsome)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gridsome)
_Live Example: https://gridsome.now-examples.now.sh_
### How We Created This Example
To get started with Gridsome for deployment with ZEIT Now, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
To get started with Gridsome for deployment with Vercel, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
```shell
$ gridsome create my-website
@@ -22,7 +22,7 @@ $ gridsome create my-website
### Deploying From Your Terminal
You can deploy your new Gridsome project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Gridsome project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Hexo Example
This directory is a brief example of a [Hexo](https://hexo.io/) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Hexo](https://hexo.io/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Hexo project with ZEIT Now.
Deploy your own Hexo project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
_Live Example: https://hexo.now-examples.now.sh_
### How We Created This Example
To get started with Hexo for deployment with ZEIT Now, you can use the [Hexo CLI](https://hexo.io/docs/index.html#Installation) to initialize the project:
To get started with Hexo for deployment with Vercel, you can use the [Hexo CLI](https://hexo.io/docs/index.html#Installation) to initialize the project:
```shell
$ hexo init project-name
@@ -22,7 +22,7 @@ $ hexo init project-name
### Deploying From Your Terminal
You can deploy your new Hexo project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Hexo project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,18 +1,18 @@
# Hugo Example
This directory is a brief example of a [Hugo](https://gohugo.io/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Hugo](https://gohugo.io/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Hugo project with ZEIT Now.
Deploy your own Hugo project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
_Live Example: https://hugo.now-examples.now.sh_
### How We Created This Example
To get started with Hugo for deployment with ZEIT Now, you can use the [Hugo CLI](https://gohugo.io/commands/) to initialize the project:
To get started with Hugo for deployment with Vercel, you can use the [Hugo CLI](https://gohugo.io/commands/) to initialize the project:
```shell
$ hugo new site project-name
@@ -20,7 +20,7 @@ $ hugo new site project-name
### Deploying From Your Terminal
You can deploy your new Hugo project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Hugo project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -4,4 +4,4 @@ date: 2019-07-18T17:18:05+01:00
draft: false
---
# Hugo on ZEIT Now
# Hugo on Vercel

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1 @@
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta
name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" type="image/png" href="%PUBLIC_URL%/assets/icon/favicon.png" />
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Ionic App" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@@ -0,0 +1,21 @@
{
"short_name": "Ionic App",
"name": "My Ionic App",
"icons": [
{
"src": "assets/icon/favicon.png",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "assets/icon/icon.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#ffffff",
"background_color": "#ffffff"
}

View File

@@ -1,18 +1,18 @@
# Ionic React Example
This directory is a brief example of an [Ionic React](https://ionicframework.com/docs/react/overview) app that can be deployed with ZEIT Now and zero configuration
This directory is a brief example of an [Ionic React](https://ionicframework.com/docs/react/overview) app that can be deployed with Vercel and zero configuration
## Deploy Your Own
Deploy your own Ionic React project with ZEIT Now.
Deploy your own Ionic React project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
_Live Example: https://ionic-react.now-examples.now.sh_
### How We Created This Example
To get started with Ionic React deployed with ZEIT Now, you can use the [Ionic CLI](https://ionicframework.com/docs/cli) to initialize the project:
To get started with Ionic React deployed with Vercel, you can use the [Ionic CLI](https://ionicframework.com/docs/cli) to initialize the project:
```shell
$ npx ionic start [project-name] conference --type react && cd [project-name]
@@ -20,7 +20,7 @@ $ npx ionic start [project-name] conference --type react && cd [project-name]
### Deploying From Your Terminal
You can deploy your new Ionic React project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Ionic React project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,18 +1,18 @@
# Jekyll Example
This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Jekyll project with ZEIT Now.
Deploy your own Jekyll project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
_Live Example: https://jekyll.now-examples.now.sh_
### How We Created This Example
To get started with Jekyll for deployment with ZEIT Now, you can use the [Jekyll CLI](https://jekyllrb.com/docs/usage/) to initialize the project:
To get started with Jekyll for deployment with Vercel, you can use the [Jekyll CLI](https://jekyllrb.com/docs/usage/) to initialize the project:
```shell
$ jekyll new my-blog
@@ -20,7 +20,7 @@ $ jekyll new my-blog
### Deploying From Your Terminal
You can deploy your new Jekyll project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Jekyll project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,18 +1,18 @@
# Middleman Example
This directory is a brief example of a [Middleman](https://middlemanapp.com/) site that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Middleman](https://middlemanapp.com/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Middleman project with ZEIT Now.
Deploy your own Middleman project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
_Live Example: https://middleman.now-examples.now.sh_
### How We Created This Example
To get started with Middleman for deployment with ZEIT Now, you can use the [Middleman CLI](https://middlemanapp.com/basics/start-new-site/) to initialize the project:
To get started with Middleman for deployment with Vercel, you can use the [Middleman CLI](https://middlemanapp.com/basics/start-new-site/) to initialize the project:
```shell
$ middleman init project-name
@@ -20,7 +20,7 @@ $ middleman init project-name
### Deploying From Your Terminal
You can deploy your new Middleman project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Middleman project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -21,10 +21,10 @@ To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js/) - your feedback and contributions are welcome!
You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js) - your feedback and contributions are welcome!
## Deploy on ZEIT Now
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [ZEIT Now Platform](https://zeit.co/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

View File

@@ -36,12 +36,12 @@ const Home = () => (
</a>
<a
href="https://zeit.co/new?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
href="https://vercel.com/new?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="card"
>
<h3>Deploy &rarr;</h3>
<p>
Instantly deploy your Next.js site to a public URL with ZEIT Now.
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
@@ -49,11 +49,11 @@ const Home = () => (
<footer>
<a
href="https://zeit.co?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by <img src="/zeit.svg" alt="ZEIT Logo" />
Powered by <img src="/vercel.svg" alt="Vercel Logo" />
</a>
</footer>

View File

@@ -0,0 +1,3 @@
<svg width="70" height="16" viewBox="0 0 70 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.255.05l9.108 15.753H.148L9.255.05zM39.434 8.418c0-2.535-1.87-4.307-4.554-4.307-2.683 0-4.554 1.772-4.554 4.307 0 2.487 2.019 4.308 4.8 4.308 1.526 0 2.905-.566 3.79-1.6l-1.673-.96c-.517.517-1.28.837-2.117.837-1.23 0-2.29-.665-2.658-1.674l-.074-.172h6.966a3.76 3.76 0 00.074-.739zm-7.065-.738l.05-.148c.32-1.058 1.255-1.698 2.436-1.698 1.207 0 2.117.64 2.437 1.698l.05.148h-4.973zM65.945 8.418c0-2.535-1.871-4.307-4.554-4.307-2.683 0-4.554 1.772-4.554 4.307 0 2.487 2.018 4.308 4.8 4.308 1.526 0 2.904-.566 3.79-1.6l-1.673-.96c-.517.517-1.28.837-2.117.837-1.23 0-2.29-.665-2.659-1.674l-.073-.172h6.966a3.76 3.76 0 00.074-.739zM58.88 7.68l.05-.148c.32-1.058 1.255-1.698 2.436-1.698 1.206 0 2.117.64 2.437 1.698l.05.148H58.88zM54.13 7.015l1.673-.96c-.788-1.23-2.19-1.92-3.89-1.92-2.682 0-4.553 1.773-4.553 4.308 0 2.536 1.87 4.308 4.554 4.308 1.698 0 3.101-.69 3.89-1.92l-1.675-.96c-.443.738-1.23 1.157-2.215 1.157-1.55 0-2.585-1.034-2.585-2.585 0-1.55 1.034-2.585 2.585-2.585.96 0 1.772.419 2.215 1.157zM69.637 1.428h-1.97v11.077h1.97V1.428zM31.779 1.428h-2.265L25.182 8.91l-4.333-7.483H18.56l6.622 11.421 6.597-11.421zM45.71 6.4c.222 0 .444.025.665.074V4.382c-1.673.049-3.249.984-3.249 2.141V4.382h-1.97v8.123h1.97v-3.52c0-1.527 1.059-2.585 2.585-2.585z" fill="#000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,10 +0,0 @@
<svg width="82" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="url(#prefix__paint0_linear)" d="M9.018 0l9.019 16H0L9.018 0z"/>
<path fill="#333" fill-rule="evenodd" d="M51.634 12.028h-6.492V2.052h6.492v1.256H46.61v3.007h4.37V7.57h-4.37v3.202h5.024v1.255zm-14.063 0h-7.235v-1.096l5.342-7.624h-5.253V2.052h7.058v1.097l-5.342 7.623h5.43v1.256zm21.88 0h6.333v-1.256h-2.423V3.308h2.423V2.052h-6.332v1.256h2.441v7.465h-2.441v1.255zm18.22 0h-1.468v-8.72h-3.36V2.052h8.225v1.256H77.67v8.72z" clip-rule="evenodd"/>
<defs>
<linearGradient id="prefix__paint0_linear" x1="28.022" x2="16.189" y1="22.991" y2="8.569" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff"/>
<stop offset="1"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 794 B

View File

@@ -1,18 +1,18 @@
# Nuxt.js Example
This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Nuxt.js project with ZEIT Now.
Deploy your own Nuxt.js project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
_Live Example: https://nuxtjs.now-examples.now.sh_
### How We Created This Example
To get started with Nuxt.js deployed with ZEIT Now, you can use the [Create-Nuxt-App CLI](https://www.npmjs.com/package/create-nuxt-app) to initialize the project:
To get started with Nuxt.js deployed with Vercel, you can use the [Create-Nuxt-App CLI](https://www.npmjs.com/package/create-nuxt-app) to initialize the project:
```shell
$ npx create-nuxt-app my-app
@@ -22,7 +22,7 @@ $ npx create-nuxt-app my-app
### Deploying From Your Terminal
You can deploy your new Nuxt.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Nuxt.js project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Polymer Example
This directory is a brief example of a [Polymer](https://www.polymer-project.org/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Polymer](https://www.polymer-project.org/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Polymer project with ZEIT Now.
Deploy your own Polymer project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/polymer)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/polymer)
_Live Example: https://polymer.now-examples.now.sh_
### How We Created This Example
To get started with Polymer deployed with ZEIT Now, you can use the [Polymer CLI](https://polymer-library.polymer-project.org/3.0/docs/tools/polymer-cli) to initialize the project:
To get started with Polymer deployed with Vercel, you can use the [Polymer CLI](https://polymer-library.polymer-project.org/3.0/docs/tools/polymer-cli) to initialize the project:
```shell
$ polymer init
@@ -22,7 +22,7 @@ $ polymer init
### Deploying From Your Terminal
You can deploy your new Polymer project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Polymer project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Preact Example
This directory is a brief example of a [Preact](https://preactjs.com/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Preact](https://preactjs.com/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Preact project with ZEIT Now.
Deploy your own Preact project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/preact)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/preact)
_Live Example: https://preact.now-examples.now.sh_
### How We Created This Example
To get started with Preact for deployment with ZEIT Now, you can use the [Preact CLI](https://github.com/preactjs/preact-cli) to initialize the project:
To get started with Preact for deployment with Vercel, you can use the [Preact CLI](https://github.com/preactjs/preact-cli) to initialize the project:
```shell
$ preact create default my-project
@@ -22,7 +22,7 @@ $ preact create default my-project
### Deploying From Your Terminal
You can deploy your new Preact project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Preact project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -2,19 +2,19 @@
# Saber Example
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to ZEIT Now with zero configuration.
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to Vercel with zero configuration.
## Deploy Your Own
Deploy your own Saber project with ZEIT Now.
Deploy your own Saber project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
_Live Example: https://saber.now-examples.now.sh_
### How We Created This Example
To get started with Saber on Now, you can use [`npm init`](https://docs.npmjs.com/cli/init) to initialize the project:
To get started with Saber on Vercel, you can use [`npm init`](https://docs.npmjs.com/cli/init) to initialize the project:
```shell
$ npm init site my-saber-site

View File

@@ -1,18 +1,18 @@
# Sapper Example
This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Sapper project with ZEIT Now.
Deploy your own Sapper project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
_Live Example: https://sapper.now-examples.now.sh_
### How We Created This Example
To get started with Sapper deployed with ZEIT Now, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
To get started with Sapper deployed with Vercel, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
```shell
$ npx degit "sveltejs/sapper-template#webpack" my-sapper-app
@@ -22,7 +22,7 @@ $ npx degit "sveltejs/sapper-template#webpack" my-sapper-app
### Deploying From Your Terminal
You can deploy your new Sapper project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Sapper project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -65,7 +65,7 @@ const posts = [
title: 'How is Sapper different from Next.js?',
slug: 'how-is-sapper-different-from-next',
html: `
<p><a href='https://github.com/zeit/next.js'>Next.js</a> is a React framework from <a href='https://zeit.co'>Zeit</a>, and is the inspiration for Sapper. There are a few notable differences, however:</p>
<p><a href='https://github.com/zeit/next.js'>Next.js</a> is a React framework from <a href='https://vercel.com'>Zeit</a>, and is the inspiration for Sapper. There are a few notable differences, however:</p>
<ul>
<li>It's powered by <a href='https://svelte.dev'>Svelte</a> instead of React, so it's faster and your apps are smaller</li>

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Scully on ZEIT Now</title>
<title>Scully on Vercel</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">

View File

@@ -1,18 +1,18 @@
# Stencil Example
This directory is a brief example of a [Stencil](https://stenciljs.com/) app that can be deployed with ZEIT Now and zero configuration
This directory is a brief example of a [Stencil](https://stenciljs.com/) app that can be deployed with Vercel and zero configuration
## Deploy Your Own
Deploy your own Stencil project with ZEIT Now.
Deploy your own Stencil project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
_Live Example: https://stencil.now-examples.now.sh_
### How We Created This Example
To get started with Stencil deployed with ZEIT Now, you can use the [Stencil project initializer](https://stenciljs.com/docs/getting-started#starting-a-new-project) to initialize the project:
To get started with Stencil deployed with Vercel, you can use the [Stencil project initializer](https://stenciljs.com/docs/getting-started#starting-a-new-project) to initialize the project:
```shell
$ npm init stencil
@@ -20,7 +20,7 @@ $ npm init stencil
### Deploying From Your Terminal
You can deploy your new Stencil project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Stencil project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,18 +1,18 @@
# Svelte Example
This directory is a brief example of a [Svelte](https://svelte.dev/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Svelte](https://svelte.dev/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Svelte project, along with Serverless Functions, with ZEIT Now.
Deploy your own Svelte project, along with Serverless Functions, with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
_Live Example: https://svelte.now-examples.now.sh_
### How We Created This Example
To get started with Svelte, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), deployed with ZEIT Now, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
To get started with Svelte, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), deployed with Vercel, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
```shell
$ npx degit sveltejs/template my-svelte-project
@@ -20,7 +20,7 @@ $ npx degit sveltejs/template my-svelte-project
### Deploying From Your Terminal
You can deploy your new Svelte project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Svelte project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -13,8 +13,8 @@
<h1>Svelte + Node.js API</h1>
<h2>
Deployed with
<a href="https://zeit.co/docs" target="_blank" rel="noreferrer noopener">
ZEIT Now
<a href="https://vercel.com/docs" target="_blank" rel="noreferrer noopener">
Vercel
</a>
!
</h2>

View File

@@ -2,19 +2,19 @@
# UmiJS Example
This directory is a brief example of a [UmiJS](https://umijs.org/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [UmiJS](https://umijs.org/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own UmiJS project with ZEIT Now.
Deploy your own UmiJS project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/umijs)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/umijs)
_Live Example: https://umijs.now-examples.now.sh_
### How We Created This Example
To get started with UmiJS deployed with ZEIT Now, you can use the [Umi CLI](https://github.com/umijs/create-umi) to initialize the project:
To get started with UmiJS deployed with Vercel, you can use the [Umi CLI](https://github.com/umijs/create-umi) to initialize the project:
```shell
$ yarn create umi app-name
@@ -22,7 +22,7 @@ $ yarn create umi app-name
### Deploying From Your Terminal
You can deploy your new UmiJS project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new UmiJS project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -4,7 +4,7 @@ This directory is a realtime serverless whiteboard powered by Pusher. The fronte
## Creating This Example
To get started with a realtime whiteboard on Now, you can use [Now CLI](https://zeit.co/download) to initialize the project:
To get started with a realtime whiteboard on Vercel, you can use [Now CLI](https://vercel.com/download) to initialize the project:
```shell
$ now init vanilla-pusher-functions

View File

@@ -2,19 +2,19 @@
# Vue.js Example
This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can be deployed with ZEIT Now and zero configuration.
This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Vue.js project with ZEIT Now.
Deploy your own Vue.js project with Vercel.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
_Live Example: https://vue.now-examples.now.sh_
### How We Created This Example
To get started with Vue.js deployed with ZEIT Now, you can use the [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html#vue-create) to initialize the project:
To get started with Vue.js deployed with Vercel, you can use the [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html#vue-create) to initialize the project:
```shell
$ vue create
@@ -22,7 +22,7 @@ $ vue create
### Deploying From Your Terminal
You can deploy your new Vue.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
You can deploy your new Vue.js project with a single command from your terminal using [Now CLI](https://vercel.com/download):
```shell
$ now

View File

@@ -1,14 +1,13 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
"npmClient": "npm",
"allowBranch": ["master", "canary"],
"registry": "https://registry.npmjs.org/"
}
},
"version": "independent"
}
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
"npmClient": "npm",
"allowBranch": ["master"],
"registry": "https://registry.npmjs.org/"
}
},
"version": "independent"
}

View File

@@ -1,5 +1,5 @@
{
"name": "now-builders",
"name": "vercel-monorepo",
"version": "0.0.0",
"private": true,
"license": "MIT",
@@ -22,10 +22,12 @@
"buffer-replace": "1.0.0",
"eslint": "6.2.2",
"eslint-config-prettier": "6.1.0",
"eslint-plugin-jest": "23.8.2",
"husky": "3.0.4",
"json5": "2.1.1",
"lint-staged": "9.2.5",
"node-fetch": "2.6.0",
"npm-package-arg": "6.1.0",
"prettier": "1.18.2"
},
"scripts": {
@@ -36,7 +38,7 @@
"publish-from-github": "./utils/publish.sh",
"changelog": "node utils/changelog.js",
"build": "node utils/run.js build all",
"test-lint": "node utils/run.js test-lint",
"now-build": "mkdir -p public && echo '<a href=\"https://vercel.com/import\">Import</a>' > public/output.html",
"test-unit": "node utils/run.js test-unit",
"test-integration-cli": "node utils/run.js test-integration-cli",
"test-integration-once": "node utils/run.js test-integration-once",
@@ -71,6 +73,9 @@
"sourceType": "module",
"modules": true
},
"plugins": [
"jest"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
@@ -89,8 +94,12 @@
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-use-before-define": 0
"@typescript-eslint/no-use-before-define": 0,
"jest/no-disabled-tests": 2,
"jest/no-focused-tests": 2
},
"overrides": [
{

View File

@@ -1,6 +1,6 @@
{
"name": "@now/frameworks",
"version": "0.0.13",
"name": "@vercel/frameworks",
"version": "0.0.14",
"main": "frameworks.json",
"license": "UNLICENSED"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@now/build-utils",
"version": "2.2.1",
"name": "@vercel/build-utils",
"version": "2.3.0",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -12,8 +12,8 @@
},
"scripts": {
"build": "./build.sh",
"test-unit": "jest --env node --verbose --runInBand test/unit.*test.*",
"test-integration-once": "jest --env node --verbose --runInBand test/integration.test.js",
"test-unit": "jest --env node --verbose --runInBand --bail test/unit.*test.*",
"test-integration-once": "jest --env node --verbose --runInBand --bail test/integration.test.js",
"prepublishOnly": "./build.sh"
},
"devDependencies": {

View File

@@ -1,5 +1,7 @@
import { getPlatformEnv } from './';
export default function debug(message: string, ...additional: any[]) {
if (process.env.NOW_BUILDER_DEBUG) {
if (getPlatformEnv('BUILDER_DEBUG')) {
console.log(message, ...additional);
}
}

View File

@@ -1,8 +1,9 @@
import minimatch from 'minimatch';
import { valid as validSemver } from 'semver';
import { parse as parsePath, extname } from 'path';
import { Route, Source } from '@now/routing-utils';
import { Route, Source } from '@vercel/routing-utils';
import { PackageJson, Builder, Config, BuilderFunctions } from './types';
import { isOfficialRuntime } from './';
interface ErrorResponse {
code: string;
@@ -55,7 +56,7 @@ export function detectApiDirectory(builders: Builder[]): string | null {
function getPublicBuilder(builders: Builder[]): Builder | null {
const builder = builders.find(
builder =>
builder.use === '@now/static' &&
isOfficialRuntime('static', builder.use) &&
/^.*\/\*\*\/\*$/.test(builder.src) &&
builder.config &&
builder.config.zeroConfig === true
@@ -194,7 +195,8 @@ export async function detectBuilders(
!fallbackEntrypoint &&
buildCommand &&
!fileName.includes('/') &&
fileName !== 'now.json'
fileName !== 'now.json' &&
fileName !== 'vercel.json'
) {
fallbackEntrypoint = fileName;
}
@@ -488,7 +490,7 @@ function getMissingBuildScriptError() {
code: 'missing_build_script',
message:
'Your `package.json` file is missing a `build` property inside the `scripts` property.' +
'\nMore details: https://zeit.co/docs/v2/platform/frequently-asked-questions#missing-build-script',
'\nMore details: https://vercel.com/docs/v2/platform/frequently-asked-questions#missing-build-script',
};
}
@@ -593,7 +595,7 @@ function checkUnusedFunctions(
}
// Next.js can use functions only for `src/pages` or `pages`
if (frontendBuilder && frontendBuilder.use.startsWith('@now/next')) {
if (frontendBuilder && isOfficialRuntime('next', frontendBuilder.use)) {
for (const fnKey of unusedFunctions.values()) {
if (fnKey.startsWith('pages/') || fnKey.startsWith('src/pages')) {
unusedFunctions.delete(fnKey);
@@ -958,7 +960,7 @@ function getRouteResult(
outputDirectory &&
frontendBuilder &&
!options.featHandleMiss &&
frontendBuilder.use === '@now/static'
isOfficialRuntime('static', frontendBuilder.use)
) {
defaultRoutes.push({
src: '/(.*)',

View File

@@ -1,4 +1,4 @@
import { Framework, FrameworkDetectionItem } from '@now/frameworks';
import { Framework, FrameworkDetectionItem } from '@vercel/frameworks';
import { DetectorFilesystem } from './detectors/filesystem';
export interface DetectFrameworkOptions {

View File

@@ -23,11 +23,11 @@ interface Props {
message: string;
/**
* A unique error code for this particular error.
* Should start with the builder name such as `NOW_NODE_`.
* Should start with the builder name such as `NODE_`.
*/
code: string;
/**
* Optional hyperlink starting with https://zeit.co to
* Optional hyperlink starting with https://vercel.com to
* link to more information about this error.
*/
link?: string;

View File

@@ -54,9 +54,9 @@ export async function getSupportedNodeVersion(
engineRange +
'".';
throw new NowBuildError({
code: 'NOW_BUILD_UTILS_NODE_VERSION_INVALID',
code: 'BUILD_UTILS_NODE_VERSION_INVALID',
link:
'https://zeit.co/docs/runtimes#official-runtimes/node-js/node-js-version',
'https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version',
message: intro + '\n' + pleaseSet,
});
}
@@ -72,9 +72,9 @@ export async function getSupportedNodeVersion(
engineRange +
'".';
throw new NowBuildError({
code: 'NOW_BUILD_UTILS_NODE_VERSION_DISCONTINUED',
code: 'BUILD_UTILS_NODE_VERSION_DISCONTINUED',
link:
'https://zeit.co/docs/runtimes#official-runtimes/node-js/node-js-version',
'https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version',
message: intro + '\n' + pleaseSet + '\n' + upstreamProvider,
});
}

View File

@@ -39,7 +39,7 @@ export function spawnAsync(
: 'Command';
reject(
new NowBuildError({
code: `NOW_BUILD_UTILS_SPAWN_${code || signal}`,
code: `BUILD_UTILS_SPAWN_${code || signal}`,
message:
opts.stdio === 'inherit'
? `${cmd} exited with ${code || signal}`
@@ -81,7 +81,7 @@ export function execAsync(
return reject(
new NowBuildError({
code: `NOW_BUILD_UTILS_EXEC_${code || signal}`,
code: `BUILD_UTILS_EXEC_${code || signal}`,
message: `${cmd} exited with ${code || signal}`,
})
);
@@ -186,7 +186,8 @@ export async function getNodeVersion(
async function scanParentDirs(destPath: string, readPackageJson = false) {
assert(path.isAbsolute(destPath));
let hasPackageLockJson = false;
type CliType = 'yarn' | 'npm';
let cliType: CliType = 'yarn';
let packageJson: PackageJson | undefined;
let currentDestPath = destPath;
@@ -200,9 +201,13 @@ async function scanParentDirs(destPath: string, readPackageJson = false) {
packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
}
// eslint-disable-next-line no-await-in-loop
hasPackageLockJson = await fs.pathExists(
path.join(currentDestPath, 'package-lock.json')
);
const [hasPackageLockJson, hasYarnLock] = await Promise.all([
fs.pathExists(path.join(currentDestPath, 'package-lock.json')),
fs.pathExists(path.join(currentDestPath, 'yarn.lock')),
]);
if (hasPackageLockJson && !hasYarnLock) {
cliType = 'npm';
}
break;
}
@@ -211,7 +216,7 @@ async function scanParentDirs(destPath: string, readPackageJson = false) {
currentDestPath = newDestPath;
}
return { hasPackageLockJson, packageJson };
return { cliType, packageJson };
}
interface WalkParentDirsProps {
@@ -268,7 +273,7 @@ export async function runNpmInstall(
assert(path.isAbsolute(destPath));
debug(`Installing to ${destPath}`);
const { hasPackageLockJson } = await scanParentDirs(destPath);
const { cliType } = await scanParentDirs(destPath);
const opts: SpawnOptionsExtended = { cwd: destPath, ...spawnOpts };
const env = opts.env ? { ...opts.env } : { ...process.env };
delete env.NODE_ENV;
@@ -277,7 +282,7 @@ export async function runNpmInstall(
let command: 'npm' | 'yarn';
let commandArgs: string[];
if (hasPackageLockJson) {
if (cliType === 'npm') {
opts.prettyCommand = 'npm install';
command = 'npm';
commandArgs = args
@@ -350,10 +355,7 @@ export async function runPackageJsonScript(
spawnOpts?: SpawnOptions
) {
assert(path.isAbsolute(destPath));
const { packageJson, hasPackageLockJson } = await scanParentDirs(
destPath,
true
);
const { packageJson, cliType } = await scanParentDirs(destPath, true);
const hasScript = Boolean(
packageJson &&
packageJson.scripts &&
@@ -362,7 +364,7 @@ export async function runPackageJsonScript(
);
if (!hasScript) return false;
if (hasPackageLockJson) {
if (cliType === 'npm') {
const prettyCommand = `npm run ${scriptName}`;
console.log(`Running "${prettyCommand}"`);
await spawnAsync('npm', ['run', scriptName], {

View File

@@ -80,3 +80,29 @@ export { readConfigFile } from './fs/read-config-file';
export * from './schemas';
export * from './types';
export * from './errors';
/**
* Helper function to support both `@vercel` and legacy `@now` official Runtimes.
*/
export const isOfficialRuntime = (desired: string, name?: string): boolean => {
if (typeof name !== 'string') {
return false;
}
return (
name === `@vercel/${desired}` ||
name === `@now/${desired}` ||
name.startsWith(`@vercel/${desired}@`) ||
name.startsWith(`@now/${desired}@`)
);
};
export const isStaticRuntime = (name?: string): boolean => {
return isOfficialRuntime('static', name);
};
/**
* Helper function to support both `VERCEL_` and legacy `NOW_` env vars.
*/
export const getPlatformEnv = (name: string): string | undefined => {
return process.env[`VERCEL_${name}`] || process.env[`NOW_${name}`];
};

View File

@@ -49,8 +49,9 @@ export interface Config {
export interface Meta {
isDev?: boolean;
devCacheDir?: string;
skipDownload?: boolean;
requestPath?: string;
requestPath?: string | null;
filesChanged?: string[];
filesRemoved?: string[];
env?: Env;
@@ -81,7 +82,7 @@ export interface AnalyzeOptions {
/**
* An arbitrary object passed by the user in the build definition defined
* in `now.json`.
* in `vercel.json`.
*/
config: Config;
}
@@ -108,7 +109,7 @@ export interface BuildOptions {
/**
* An arbitrary object passed by the user in the build definition defined
* in `now.json`.
* in `vercel.json`.
*/
config: Config;
@@ -148,7 +149,7 @@ export interface PrepareCacheOptions {
/**
* An arbitrary object passed by the user in the build definition defined
* in `now.json`.
* in `vercel.json`.
*/
config: Config;
}
@@ -182,11 +183,31 @@ export interface ShouldServeOptions {
/**
* An arbitrary object passed by the user in the build definition defined
* in `now.json`.
* in `vercel.json`.
*/
config: Config;
}
export interface StartDevServerSuccess {
/**
* Port number where the dev server can be connected to, assumed to be running
* on `localhost`.
*/
port: number;
/**
* Process ID number of the dev server. Useful for the `now dev` server to
* shut down the dev server once an HTTP request has been fulfilled.
*/
pid: number;
}
/**
* `startDevServer()` may return `null` to opt-out of spawning a dev server for
* a given `entrypoint`.
*/
export type StartDevServerResult = StartDevServerSuccess | null;
/**
* Credit to Iain Reid, MIT license.
* Source: https://gist.github.com/iainreid820/5c1cc527fe6b5b7dba41fec7fe54bf6e
@@ -315,24 +336,3 @@ export interface BuilderFunctions {
excludeFiles?: string;
};
}
export interface NowRewrite {
source: string;
destination: string;
}
export interface NowRedirect {
source: string;
destination: string;
statusCode?: number;
}
export interface NowHeader {
source: string;
headers: NowHeaderKeyValue[];
}
export interface NowHeaderKeyValue {
key: string;
value: string;
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "api/index.js", "use": "@now/node" }],
"builds": [{ "src": "api/index.js", "use": "@vercel/node" }],
"probes": [
{
"path": "/api/index.js",

View File

@@ -1,11 +1,16 @@
{
"version": 2,
"builds": [
{ "src": "with-npm/index.js", "use": "@now/node" },
{ "src": "with-yarn/index.js", "use": "@now/node" }
{ "src": "with-npm/index.js", "use": "@vercel/node" },
{ "src": "with-yarn/index.js", "use": "@vercel/node" },
{ "src": "with-yarn-and-npm/index.js", "use": "@vercel/node" }
],
"probes": [
{ "path": "/with-npm", "mustContain": "npm:RANDOMNESS_PLACEHOLDER" },
{ "path": "/with-yarn", "mustContain": "yarn:RANDOMNESS_PLACEHOLDER" }
{ "path": "/with-yarn", "mustContain": "yarn:RANDOMNESS_PLACEHOLDER" },
{
"path": "/with-yarn-and-npm",
"mustContain": "yarn:RANDOMNESS_PLACEHOLDER"
}
]
}

View File

@@ -0,0 +1,14 @@
const fs = require('fs');
const path = require('path');
const execpath = path.basename(process.env.npm_execpath);
console.log('execpath', execpath);
if (execpath === 'yarn.js' || execpath === 'yarn') {
fs.writeFileSync(
'index.js',
'module.exports = (_, resp) => resp.end("yarn:RANDOMNESS_PLACEHOLDER");'
);
} else {
throw new Error('yarn is expected');
}

View File

@@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}

View File

@@ -0,0 +1,5 @@
{
"scripts": {
"now-build": "node must-be-yarn.js"
}
}

View File

@@ -0,0 +1,3 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

View File

@@ -3,7 +3,7 @@
"builds": [
{
"src": "index.js",
"use": "@now/node"
"use": "@vercel/node"
}
],
"probes": [{ "path": "/", "mustContain": "found:RANDOMNESS_PLACEHOLDER" }]

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
"build": { "env": { "NODE_ENV": "production" } },
"probes": [{ "path": "/", "mustContain": "node-env:RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -1,6 +1,6 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
"build": { "env": { "NODE_ENV": "custom-value:RANDOMNESS_PLACEHOLDER" } },
"probes": [
{ "path": "/", "mustContain": "custom-value:RANDOMNESS_PLACEHOLDER" }

View File

@@ -2,8 +2,8 @@
"version": 2,
"build": { "env": { "NPM_ONLY_PRODUCTION": "1" } },
"builds": [
{ "src": "npm/package.json", "use": "@now/static-build" },
{ "src": "yarn/package.json", "use": "@now/static-build" }
{ "src": "npm/package.json", "use": "@vercel/static-build" },
{ "src": "yarn/package.json", "use": "@vercel/static-build" }
],
"probes": [
{ "path": "/npm", "mustContain": "npm-prod:RANDOMNESS_PLACEHOLDER" },

View File

@@ -27,7 +27,7 @@ for (const fixture of fs.readdirSync(fixturesPath)) {
}
// eslint-disable-next-line no-loop-func
it(`should build ${fixture}`, async () => {
it(`Should build "${fixture}"`, async () => {
await expect(
testDeployment(
{ builderUrl, buildUtilsUrl },
@@ -53,7 +53,7 @@ for (const builder of buildersToTestWith) {
// don't run all foreign fixtures, just some
if (['01-cowsay', '01-cache-headers', '03-env-vars'].includes(fixture)) {
// eslint-disable-next-line no-loop-func
it(`should build ${builder}/${fixture}`, async () => {
it(`Should build "${builder}/${fixture}"`, async () => {
await expect(
testDeployment(
{ builderUrl, buildUtilsUrl },
@@ -113,15 +113,13 @@ it('Test `detectBuilders` and `detectRoutes`', async () => {
const { builders, defaultRoutes } = await detectBuilders(files, pkg);
const nowConfig = { builds: builders, routes: defaultRoutes, probes };
await fs.writeFile(
path.join(fixture, 'now.json'),
JSON.stringify(nowConfig, null, 2)
);
const deployment = await testDeployment(
{ builderUrl, buildUtilsUrl },
fixture
);
const deployment = await testDeployment({ builderUrl }, fixture);
expect(deployment).toBeDefined();
});
@@ -199,9 +197,6 @@ it('Test `detectBuilders` with `index` files', async () => {
JSON.stringify(nowConfig, null, 2)
);
const deployment = await testDeployment(
{ builderUrl, buildUtilsUrl },
fixture
);
const deployment = await testDeployment({ builderUrl }, fixture);
expect(deployment).toBeDefined();
});

Some files were not shown because too many files have changed in this diff Show More