Compare commits

..

397 Commits

Author SHA1 Message Date
Steven
8189fb2373 Publish Stable
- @vercel/build-utils@2.3.1
 - vercel@19.0.1
 - @vercel/client@8.0.1
 - @vercel/go@1.1.1
 - @vercel/next@2.6.1
 - @vercel/node@1.6.1
 - @vercel/python@1.2.1
 - @vercel/ruby@1.2.1
 - @vercel/static-build@0.17.1
2020-05-11 09:10:40 -04:00
Nathan Rajlich
76f544cbea Publish Canary
- @vercel/build-utils@2.3.1-canary.0
 - vercel@19.0.1-canary.0
 - @vercel/client@8.0.1-canary.0
 - @vercel/go@1.1.1-canary.0
 - @vercel/next@2.6.1-canary.0
 - @vercel/node@1.6.1-canary.0
 - @vercel/python@1.2.1-canary.0
 - @vercel/ruby@1.2.1-canary.0
 - @vercel/static-build@0.17.1-canary.0
2020-05-09 13:54:05 -07:00
Nathan Rajlich
e246d2ed71 [client] Throw an error if both .vercelignore and .nowignore exist (#4311)
* [client] Throw an error if both `.vercelignore` and `.nowignore` exist

* Remove `.`

* Add tests

* Update test

* [cli] Properly clear spinner if `createDeployment()` async generator throws an error

* Update packages/now-client/src/utils/index.ts

Co-authored-by: Steven <steven@ceriously.com>

* Update packages/now-client/tests/vercelignore.test.ts

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2020-05-09 03:02:16 -07:00
Steven
ed4c759c49 [all] Fix runtimes to work with old versions of CLI (#4317)
This PR fixes an issue where old versions of the CLI would update to the latest builder, but not have a copy of `@vercel/build-utils` because they only shipped with `@now/build-utils`. So in this case, we can fallback to the other package. We must be careful to only import types from `@vercel/build-utils` and anything needed at runtime must be imported from `./build-utils` wrapper.
2020-05-09 04:00:01 +00:00
Steven
2656647891 [cli] Fix error message to display correct config name (#4309)
This PR fixes an issue when the error message assumed the config was `vercel.json` even when the user had `now.json`.

### Before

```
Error! The property `foo` is not allowed in vercel.json – please remove it.
```

### After

```
 Error! The property `foo` is not allowed in now.json – please remove it.
```

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-05-08 19:45:53 -04:00
Steven
3b3c468f3a [cli] Fix deploying v1 with secrets (#4315)
This PR fixes a regression from PR #4084 where secrets were paginated so some v1 deployments that had more than 20 secrets were unable to deploy since CLI version 19.
2020-05-08 23:08:05 +00:00
Nathan Rajlich
4214de2ce0 [built-utils] Make getPlatformEnv() throw if both NOW_ and VERCEL_ are defined (#4313)
Also adds unit tests.
2020-05-08 15:17:29 -07:00
Nathan Rajlich
40b7af4349 [cli] Fix now dev infinite loop for yarn workspaces (#4310)
A couple quick fixes to `now dev` to land on stable, before #4254 gets merged for canary.
2020-05-08 20:37:20 +00:00
Steven
f4d86cb9df [now-cli] Update now env add to skip value if system var (#4306)
This PR updates the CLI to work the same as the dashboard and skip the env var value if the name indicates that it is a [System Environment Variables](https://vercel.com/docs/v2/build-step#system-environment-variables).

Co-authored-by: Luc <luc.leray@gmail.com>
2020-05-08 11:41:41 -04:00
Nathan Rajlich
0492fcb0fc [now-cli] Fix update Changelog URL (#4302)
Incorrect URL: https://github.com/zeit/now/releases/tag/now@19.0.0

Correct URL: https://github.com/zeit/now/releases/tag/vercel@19.0.0
2020-05-08 01:47:36 +00:00
Nathan Rajlich
3a217dc750 [now-build-utils] Use @vercel runtimes for zero-config (#4300)
This reverts commit 8a9b67a3f3 (#4284),
now that `@vercel` runtimes work in production.
2020-05-08 00:02:30 +00:00
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
Steven
8043e25d6d Publish Stable
- @now/frameworks@0.0.13
 - @now/build-utils@2.2.1
 - now@18.0.0
 - now-client@7.1.0
 - @now/go@1.0.7
 - @now/next@2.5.3
 - @now/node@1.5.1
 - @now/python@1.1.6
 - @now/routing-utils@1.8.1
 - @now/static-build@0.16.0
2020-04-13 20:19:14 -04:00
Steven
73b4e7aea4 Publish Canary
- now@17.1.2-canary.16
2020-04-13 19:56:50 -04:00
Steven
de7e063c9b [now-cli] Fix now env stdin detection and don't throw for known errors (#4060)
- Capitalize `Environment` in all outputs
- Fix stdin detection so there is no need for timeouts
- Dont throw if the error is bad user input, only throw for unexpected errors
- Fix tests so waiting for prompt will throw if expected output is never received
2020-04-13 19:56:22 -04:00
Steven
e7c30deee8 [now-cli] Change now env pull console output (#4059)
Change from `Created file .env` to `Create .env file` per @leo
2020-04-13 15:50:06 -04:00
Steven
7464fac792 Publish Canary
- now@17.1.2-canary.15
2020-04-13 14:26:03 -04:00
Steven
252363cce4 [now-cli] Prefer .env over .env.build during now dev (#4057)
The latest `now env` subcommand no longer makes the distinction between build time and runtime environment variables so this PR updates `now dev` to no longer make the distinction either.

The only exception is that some builders such as `@now/next` might still rely on the separation so we must preserve the distinction for legacy builders.
2020-04-13 18:22:21 +00:00
Steven
d7dceeb2a1 [now-cli] Update now env to support empty values (#4046)
This PR adds support for empty values when using `now env add|ls|rm|pull`.

This is necessary when using system environment variables such as `NOW_GITHUB_COMMIT_SHA` which will not receive a value from the user but will instead assign a value automatically during deployment.
2020-04-13 15:21:20 +00:00
Ana Trajkovska
6b5b9e8b2f Publish Canary
- @now/build-utils@2.2.1-canary.1
 - now@17.1.2-canary.14
2020-04-10 18:51:20 +02:00
Ana Trajkovska
addd036149 Improve pagination message (#4035) 2020-04-10 18:46:32 +02:00
Steven
7ca672a470 [now-build-utils] Exclude now.json from fallback build src (#4042)
https://github.com/zeit/now/discussions/4016
2020-04-10 16:06:02 +00:00
Ana Trajkovska
3af0e99689 Publish Canary
- now@17.1.2-canary.13
 - @now/python@1.1.6-canary.0
2020-04-10 17:21:15 +02:00
Ana Trajkovska
b14068de8a [now-cli] Fix removing a deployment (#4036)
* Fix removing a deployment

* Add test for removing a deployment

* Add logs

* Fix assertion
2020-04-10 17:19:48 +02:00
Nguyễn Hồng Quân
c9437e714a [now-python] Fix missing sys modules for relative module import (#4024)
Without this fix, Python app which uses [Pydantic](https://pydantic-docs.helpmanual.io/usage/postponed_annotations/) for data validation will crash with log like this:

```py
  File "pydantic/main.py", line 175, in pydantic.main.ModelMetaclass.__new__
    annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None))
  File "pydantic/typing.py", line 136, in pydantic.typing.resolve_annotations
    annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None))
  File "pydantic/typing.py", line 136, in pydantic.typing.resolve_annotations
    base_globals: Optional[Dict[str, Any]] = sys.modules[module_name].__dict__
KeyError: 'api.main'
```

The added code also follow Python official documentation: https://docs.python.org/3.6/library/importlib.html#importing-a-source-file-directly
2020-04-10 09:53:24 -04:00
Steven
c0aff5cf4a [now-cli] Clean up tests for now dev (#4038)
This PR does a few things:

- Change `dev.unref()` when possible and use `testFixtureStdio` instead
- Replace `fetch()` with `fetchWithRetry()` when possible
- Remove commented-out tests
2020-04-09 23:30:22 +00:00
Allen Hai
9110b14bb4 Publish Canary
- now@17.1.2-canary.12
2020-04-09 17:07:06 -05:00
Steven
40e4b69267 [now-cli] Fix now dev routing for continue: true (#4033)
There was a bug preventing `continue: true` from working between (null => filesystem) phases.

This PR fixes that bug and adds a test to ensure users can rewrite to dynamic path segments.
2020-04-09 21:35:13 +00:00
Ana Trajkovska
6c4934dcc4 Publish Canary
- @now/frameworks@0.0.13-canary.1
 - now@17.1.2-canary.11
 - @now/static-build@0.15.2-canary.4
2020-04-09 22:26:22 +02:00
Ana Trajkovska
d64e54d61a Implement pagination for now ls (#4027) 2020-04-09 22:24:25 +02:00
Allen Hai
0b75bf07f7 [examples][now-static-build] Add Ionic Angular framework (#3970)
This PR adds framework config for Ionic Angular and also updates a mistake found in the dev script of Ionic React, which mistakenly was using the same dev script as Stencil.
2020-04-09 18:44:46 +00:00
Ana Trajkovska
a861a8f3f7 Publish Canary
- now@17.1.2-canary.10
2020-04-09 16:45:12 +02:00
Ana Trajkovska
6407b17b7f Improve pagination message (#4026) 2020-04-09 16:43:26 +02:00
Steven
558463a988 Publish Canary
- now@17.1.2-canary.9
2020-04-08 08:34:50 -04:00
Steven
1a133995b8 [now-cli] Add now env command (#3999)
This PR adds a new command `now env` for managing environment variables for a given project. This will complement the changes in the Dashboard and will provide 3 possible environments: `production`, `preview`, and `development`.

- [x] Add `now env ls`
- [x] Add `now env add`
- [x] Add `now env rm`
- [x] Add `now env pull`
- [x] Add  test for `now env ls`
- [x] Add  test for `now env add`
- [x] Add  test for `now env rm -y`
- [x] Add  test for `now env pull -y`
- [x] Add  test for `now env add FOO preview < secret.txt`
- [x] Add test deployment to verify env var is assigned to both build and runtime
- [x] Test on Windows


```
  ▲ now env [options] <command>

  Commands:

    ls      [environment]              List all variables for the specified environment
    add     [name] [environment]       Add an environment variable (see examples below)
    rm      [name] [environment]       Remove an environment variable (see examples below)
    pull    [filename]                 Read development environment from the cloud and write to a file [.env]

  Options:

    -h, --help                     Output usage information
    -A FILE, --local-config=FILE   Path to the local `now.json` file
    -Q DIR, --global-config=DIR    Path to the global `.now` directory
    -d, --debug                    Debug mode [off]
    -t TOKEN, --token=TOKEN        Login token

  Examples:

  – Add a new variable to multiple environments

      $ now env add <name>
      $ now env add API_TOKEN

  – Add a new variable for a specific environment

      $ now env add <name> <production | preview | development>
      $ now env add DB_CONNECTION production

  – Add a new environment variable from stdin

      $ cat <file> | now env add <name> <production | preview | development>
      $ cat ~/.npmrc | now env add NPM_RC preview
      $ now env add DB_PASS production < secret.txt

  – Remove a variable from multiple environments

      $ now env rm <name>
      $ now env rm API_TOKEN

  – Remove a variable from a specific environment

      $ now env rm <name> <production | preview | development>
      $ now env rm NPM_RC preview
```
2020-04-07 22:49:48 +00:00
Steven
a83eecf674 Publish Canary
- @now/routing-utils@1.8.1-canary.1
2020-04-06 18:42:01 -04:00
Steven
a932ed65fa [now-routing-utils] Catch error from compile route (#4019)
Some inputs cause `compile()` to throw but its not clear which route caused it to fail.

> TypeError: Unexpected MODIFIER at 29, expected END [see source](https://sentry.io/organizations/zeithq/issues/1593291118/?project=1351065)

This PR adds logs so we can see the bad user input and correct accordingly.
2020-04-06 22:40:30 +00:00
JJ Kasper
e2ae497762 Publish Stable
- @now/next@2.5.2
2020-04-06 15:35:12 -05:00
JJ Kasper
89989719c2 Publish Canary
- @now/next@2.5.2-canary.0
 - @now/node@1.5.1-canary.0
 - @now/static-build@0.15.2-canary.3
2020-04-06 15:27:03 -05:00
Joe Haddad
8166b8e1e7 [now-next] Correctly Exclude API Routes from Pages (#4018)
This pull request correctly omits dependencies for API Routes from pages.
2020-04-06 20:19:08 +00:00
Logan McAnsh
1ceeac498c [now-node] Add NowApiHandler type (#4001)
* add NowApiHandler type

`now` equivalent of `NextApiHandler` introduced https://github.com/zeit/next.js/pull/10573

* chore: add fixture

Signed-off-by: Logan McAnsh <logan@mcan.sh>
2020-04-03 18:29:56 -04:00
Arunoda Susiripala
1c47d1360d [now-next] Fix some typos related to fixtures (#3995)
They should be `probes` I guess.
2020-04-03 13:43:22 +00:00
Leo Lamprecht
ddcd0918e9 Removed Environment Variables (#3997) 2020-04-03 01:52:02 +02:00
Steven
573b6b8110 [now-static-build] Fix 12-creact-react-app test fixture (#3990)
Since enabling `CI` environment variable for cloud builds, this test fails because it is meant to emit a warning however that warning has turned into an error.

```
05:40:53.148  Treating warnings as errors because process.env.CI = true.
05:40:53.148  Most CI servers set it automatically.
05:40:53.148  Failed to compile.
05:40:53.149  ./src/App.js
05:40:53.149    Line 1:  'useState' is defined but never used  no-unused-vars
05:40:53.172  error Command failed with exit code 1.
```

We can again treat lint errors as warnings by setting `CI=false`.
2020-04-01 14:27:11 +00:00
Steven
40039d7f9b Publish Canary
- @now/build-utils@2.2.1-canary.0
2020-03-31 17:18:32 -04:00
Steven
dcb37e92f5 [now-build-utils] Hide internal stack trace for errors (#3988)
Example build output given a user's build script named `shouldfail.js`:

## Before

```
/zeit/4af70cdc/shouldfail.js:3
throw new Error('This is my failure')
^
Error: This is my failure
    at Object.<anonymous> (/zeit/4af70cdc/shouldfail.js:3:7)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Exited with 1
    at ChildProcess.<anonymous> (/zeit/687b1c64/.build-utils/node_modules/@now/build-utils/dist/index.js:31350:24)
    at ChildProcess.emit (events.js:223:5)
    at ChildProcess.EventEmitter.emit (domain.js:475:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
worker exited with code 20 and signal null
Done with "package.json"
```

## After 

```
/zeit/255bfdd/shouldfail.js:3
throw new Error('This is my failure')
^
Error: This is my failure
    at Object.<anonymous> (/zeit/255bfdd/shouldfail.js:3:7)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
worker exited with code 20 and signal null
Done with "package.json"
```
2020-03-31 21:09:57 +00:00
Steven
fe7f875549 Publish Canary
- now@17.1.2-canary.8
2020-03-31 12:20:59 -04:00
Steven
a516ed6fb8 [now-cli] Fix error message link to build logs (#3986)
The current error message prints a link that is not clickable from the terminal.

This PR adds the missing `https://` protocol prefix, so that the link is clickable.
2020-03-31 12:09:11 -04:00
Steven
ca2c5f85ef [now-cli] Fix for adding secret with hyphen prefix (#3983)
Follow up to #3982 which didn't actually fix the secret value. Instead it was adding `true` as the value.
2020-03-31 13:06:46 +00:00
Tim Neutkens
adb5a01cc0 Upgrade Next.js (#3984) 2020-03-31 12:24:21 +02:00
Steven
6b4d39ab4d Publish Canary
- now@17.1.2-canary.7
2020-03-30 18:27:55 -04:00
Steven
07ce3d2e34 [now-cli] Bump mri to 1.1.5 (#3982)
This fixes the error when attempting to add a secret with a hyphen and underscore such as the following:

```
$ now secret add name '-foo_bar'
Error! argv._.slice is not a function
```
2020-03-30 22:13:00 +00:00
JJ Kasper
93ffcf487b Publish Canary
- @now/routing-utils@1.8.1-canary.0
2020-03-30 14:18:01 -05:00
JJ Kasper
3631f0f4cf [now-routing-utils] Update to not add path segments to redirect query automatically (#3981)
As discussed this removes automatically adding path segments to redirect's destination query and only adds them if manually specified

x-ref: https://github.com/zeit/next.js/pull/11497
2020-03-30 18:57:24 +00:00
Steven
b67b5be8a9 Publish Canary
- now@17.1.2-canary.6
 - now-client@7.0.2-canary.2
 - @now/static-build@0.15.2-canary.2
2020-03-30 14:06:57 -04:00
Steven
bf67b1a29e [now-static-build][now-client] Ignore known static outputs (#3980)
We already ignore specific files such as `node_modules` and `.env` during the upload phase so these never make it to the build. However, if those files are generated during the build, that are still emitted.

This PR will ignore these specific files even if they end up in the output directory (for example, when the user assigns `outputDirectory='.'` in project settings)
2020-03-30 17:53:47 +00:00
Max Rovensky
ed86473f74 Publish Canary
- now@17.1.2-canary.5
 - now-client@7.0.2-canary.1
2020-03-30 17:57:56 +08:00
Max
399a3cd114 [now-cli][now-client] Change forceNewWithCache to withCache (#3966)
Follow up to https://github.com/zeit/now/pull/3953 that makes the flag composable
2020-03-30 09:51:05 +00:00
Steven
d0fd09810a Publish Stable
- @now/go@1.0.6
2020-03-28 18:33:40 -04:00
Steven
f298f2e894 Publish Canary
- @now/go@1.0.6-canary.0
2020-03-28 18:21:06 -04:00
Steven
569200ae0e [now-go] Fix import for go-bridge (#3976)
Somehow, PR #3973 broke Go since the bridge is imported from this repo's master branch.

Go has very strict file name constraints and the file `[...path].js` is not compatible.


Here's what a `@now/go` deployment error message looks like:

```
Error: Command failed: go mod tidy
go: finding github.com/zeit/now latest
go: downloading github.com/zeit/now v0.0.0-20200326223129-c91495338d5e
go: extracting github.com/zeit/now v0.0.0-20200326223129-c91495338d5e
-> unzip /tmp/5a0676f5/pkg/mod/cache/download/github.com/zeit/now/@v/v0.0.0-20200326223129-c91495338d5e.zip: malformed file path "packages/now-next/test/fixtures/22-ssg-v2-catchall/pages/[...path].js": double dot
handler imports
github.com/zeit/now/utils/go/bridge: unzip /tmp/5a0676f5/pkg/mod/cache/download/github.com/zeit/now/@v/v0.0.0-20200326223129-c91495338d5e.zip: malformed file path "packages/now-next/test/fixtures/22-ssg-v2-catchall/pages/[...path].js": double dot
```

The solution is to move Go Bridge into a separate repository: https://github.com/zeit/now-go-bridge

This will also have the side effect of speeding up Go imports because the repo will be much smaller.
2020-03-28 22:16:42 +00:00
Nathan Rajlich
c91495338d Update signal-exit to v3.0.3 (#3974)
@tootallnate's bug fix for `SIGHUB` on Windows has been merged and
published as `signal-exit@3.0.3`, so no more need for the "resolutions"
field in `package.json`.

The `yarn.lock` file has been updated accordingly.
2020-03-26 22:31:29 +00:00
JJ Kasper
7eed5574e0 Publish Stable
- @now/next@2.5.1
2020-03-26 16:12:48 -05:00
JJ Kasper
91e6b85cec Publish Canary
- @now/next@2.5.1-canary.0
 - @now/static-build@0.15.2-canary.1
2020-03-26 16:01:00 -05:00
JJ Kasper
3ae83172ec [now-next] Fix dynamic routes and data routes order (#3973)
When using a catch-all route at the base of the project it would cause it to be prioritized over any GS(S)P `/_next/data` routes. This fixes the order putting `/_next/data` routes first as they have higher specificity and adds tests to ensure we don't regress on this
2020-03-26 20:08:51 +00:00
Steven
7c51446e5e [tests] Add additional env vars (#3968)
These are used for testing and health checks.
2020-03-25 22:42:37 +00:00
Steven
400a5c73e8 [examples][now-static-build] Bump ionic-react to latest typescript (#3967)
Fixes an issue with a dependency that was bumped but typescript was pinned in `ionic-react`.


```
$ react-scripts build
Creating an optimized production build...
Failed to compile.
/zeit/333ecfab/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts
TypeScript error in /zeit/333ecfab/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts(7,13):
'=' expected.  TS1005
     5 |  * LICENSE file in the root directory of this source tree.
     6 |  */
  >  7 | import type * as PrettyFormat from './types';
       |             ^
     8 | /**
     9 |  * Returns a presentation string of your `val` object
    10 |  * @param val any potential JavaScript object
error Command failed with exit code 1.
```
2020-03-25 19:20:59 +00:00
Steven
ec917ace69 Publish Canary
- @now/frameworks@0.0.13-canary.0
 - now@17.1.2-canary.4
 - @now/static-build@0.15.2-canary.0
2020-03-25 13:41:04 -04:00
Anthony Gubler
f5e0afdd7e [examples] Add Dojo Example (#3882)
Adds an example for Dojo applications with ZEIT Now.

Co-Authored-By: Steven <steven@ceriously.com>
Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>
2020-03-25 13:32:33 -04:00
Steven
c1b4c62714 [tests] Cancel previous workflows on push (#3965)
Follow up to #3961

Workflow IDs are found here: from https://api.github.com/repos/zeit/now/actions/workflows
2020-03-25 16:05:32 +00:00
Steven
5e4bdfbe11 [tests] Separate into workflows (#3961)
This PR does a few things:

- Separate tests into multiple workflows
- Rename a few package.json scripts to make naming consistent
- Rename workflows to be uppercase and jobs to be lowercase

The benefits here are:
- Restart a workflow if it fails, for example only restart `now dev` tests
- Easier to read when we need to understand a workflow or modify env vars

After merging, we'll need to modify the required checks in the repo settings.
We'll also need to update the cancel workflow (that will need to be a separate PR).
2020-03-25 11:40:11 -04:00
Andy Bitz
bd4a0cbd32 Publish Stable
- @now/frameworks@0.0.12
 - @now/static-build@0.15.1
2020-03-25 15:57:19 +01:00
Andy Bitz
7ff9adc90e Publish Canary
- @now/frameworks@0.0.12-canary.1
 - @now/static-build@0.15.1-canary.1
2020-03-25 15:56:44 +01:00
Andy
b279f1ffae [frameworks][now-static-build] Support Docusaurus v2 and v1 (#3964)
Support Docusaurus v2 and v1
2020-03-25 14:42:56 +00:00
Ana Trajkovska
344cc103ee Publish Canary
- now@17.1.2-canary.3
2020-03-25 14:11:11 +01:00
Ana Trajkovska
83249b3685 [now-cli] Add pagination for now alias ls (#3915)
* Implement pagination for `now alias ls`

* Fix issue retrieving aliases

* Add help text for pagiting aliases
2020-03-25 14:08:26 +01:00
Andy
79e7a9f477 [now-cli] Update docusaurus test (#3963) 2020-03-25 13:43:53 +01:00
Steven
b3dce70271 Publish Canary
- @now/frameworks@0.0.12-canary.0
 - now@17.1.2-canary.2
 - @now/static-build@0.15.1-canary.0
2020-03-24 19:24:57 -04:00
Steven
cff8d8b8a0 [tests] Fix test initialize existing directory --f -> -f (#3960)
Fixes test after PR #3958
2020-03-24 22:46:42 +00:00
Andy
da892100d9 [frameworks][now-static-build] Fix Docusaurus build command (#3959)
* [frameworks][now-static-build] Fix Docusaurus build command

* Update dev command
2020-03-24 23:03:31 +01:00
Max Leiter
72e87ee6e4 Fix slight spelling mistake: --f -> -f in now --force error (#3958) 2020-03-24 12:51:15 -07:00
Max Rovensky
3f9afad167 Publish Canary
- now@17.1.2-canary.1
 - now-client@7.0.2-canary.0
2020-03-25 03:12:23 +08:00
Max
1527447914 Add --force-with-cache flag support (#3953)
Adds support for an upcoming `forceNewWithCache` API flag
2020-03-24 19:09:10 +00:00
Steven
9ca35df5fb [tests] Fix coverage checks (#3957)
The CodeCov GitHub integration is confused about the monorepo and started reporting failures recently.

<img src="https://user-images.githubusercontent.com/229881/77462927-2983f280-6ddb-11ea-9ee2-38b660b2fd2f.png" height=120 />

We run `codecov` from the CLI so we can disable the integration. 

## References

- https://docs.codecov.io/docs/codecovyml-reference
- https://docs.codecov.io/docs/commit-status#section-disabling-a-status
2020-03-24 18:47:25 +00:00
Ana Trajkovska
05b2e2216c Publish Canary
- now@17.1.2-canary.0
2020-03-24 19:12:47 +01:00
Ana Trajkovska
167fd5750a [now-cli] Add pagination for now domains ls (#3922)
* Implement pagination for listing domains

* Add helpi list for paginating domains
2020-03-24 19:08:52 +01:00
Andy
4a3cd7ec72 [now-cli] Ignore 404 for aliases and certs when removing a domain (#3955) 2020-03-24 01:56:13 +01:00
Andy Bitz
9aef718917 Publish Stable
- now@17.1.1
2020-03-24 00:16:28 +01:00
Ana Trajkovska
3cdc261802 [now-cli] Fix broken message when a deployment is canceled (#3954)
* Fix broken message when a deployment is canceled

* Add \n in the message
2020-03-24 00:14:52 +01:00
Steven
5c71f672b3 Publish Stable
- @now/frameworks@0.0.11
 - @now/build-utils@2.2.0
 - @now/cgi@1.0.4
 - now@17.1.0
 - now-client@7.0.1
 - @now/go@1.0.5
 - @now/next@2.5.0
 - @now/node@1.5.0
 - @now/python@1.1.5
 - @now/routing-utils@1.8.0
 - @now/ruby@1.1.0
 - @now/static-build@0.15.0
2020-03-23 13:59:31 -04:00
Steven
dbc5f73984 Publish Canary
- now@17.0.5-canary.15
2020-03-23 11:03:05 -04:00
Steven
1d269fffc8 [now-cli] Fix ambiguous argument error (#3952)
This updates the error message to offer action items when an ambiguous argument is provided.

## Before

```
Error! The supplied argument "secrets" is ambiguous. Both a directory and a subcommand are known 
```

## After

```
Error! The supplied argument "secrets" is ambiguous.
If you wish to deploy the subdirectory "secrets", first run "cd secrets".
If you wish to use the subcommand "secrets", use "secret" instead.
```
2020-03-23 14:57:59 +00:00
Ana Trajkovska
cc146ba0f5 Publish Canary
- now@17.0.5-canary.14
2020-03-23 00:24:37 +01:00
Ana Trajkovska
f8a2519838 Add help text for paginating deployments for a project (#3948) 2020-03-23 00:21:47 +01:00
Steven
1781376d47 Publish Canary
- @now/build-utils@2.1.2-canary.3
 - @now/ruby@1.0.3-canary.4
 - @now/static-build@0.14.13-canary.6
2020-03-20 15:04:52 -04:00
Steven
d9fda14969 [now-ruby] Upgrade to Ruby 2.7 (#3872)
- Change default version to Ruby `2.7.x` to match our static builds such as jekyll
- Detect ruby version in `Gemfile` in case the user wishes to downgrade to Ruby `2.5.x`
- Print nicer error message in `now dev`

cc @nathancahill @m5o
2020-03-20 18:54:57 +00:00
Steven
a4de9272e7 [now-static-build] Add test for puppeteer during build (#3911)
We recently updated the build image to add the necessary dependencies so that `puppeteer` can run during the build step.

This PR adds a test that takes a screenshot and prints metrics during a static build.

This is necessary to support `react-snap` (along with a few flags in `package.json`).

```json
{
  "reactSnap": {
    "puppeteerArgs": [
      "--no-sandbox",
      "--disable-setuid-sandbox"
    ]
  }
}
```

- Fixes https://github.com/zeit/now-builders/issues/517
- Fixes #2357
2020-03-20 11:54:51 -04:00
Andy Bitz
9b9037de91 Publish Canary
- @now/build-utils@2.1.2-canary.2
 - @now/next@2.4.1-canary.4
 - @now/static-build@0.14.13-canary.5
2020-03-20 15:37:07 +01:00
Andy
8d18c65e3e [now-next][now-static-build][now-build-utils] Use util to get node .bin in path (#3946)
https://zeit.atlassian.net/browse/PRODUCT-1380

This makes `now-next` consider the `node_modules/.bin` path if a custom build command was specified, which makes it work like `now-static-build`.
2020-03-20 14:31:53 +00:00
Ana Trajkovska
e7d7de61b6 Publish Canary
- now@17.0.5-canary.13
 - @now/next@2.4.1-canary.3
2020-03-20 13:04:29 +01:00
Ana Trajkovska
11927883c3 Fix pagination on now ls project (#3945) 2020-03-20 13:03:03 +01:00
Andy
57d25b184b [now-next] Add support for the outputDirectory option (#3897)
* [now-next] Add support for the outputDirectory option

* Add test

* Remove build command

* Remove check

* Add build command

* Rename directory

* Rename

* Fix test and output directory
2020-03-20 11:42:54 +01:00
Steven
95f716fb3f Publish Canary
- now@17.0.5-canary.12
 - @now/next@2.4.1-canary.2
2020-03-19 16:55:36 -04:00
Steven
8dd52605be [now-cli] Print link to more details on error (#3944)
This PR updates API Errors to support the `error.link` property.

Unlike `error.slug` which is only a path to an error message, `error.link` contains the full URL.


### Example Output

```
$ now
Error! Serverless Functions.........etc
> More details: https://zeit.ink/...etc
```
2020-03-19 20:49:57 +00:00
JJ Kasper
4b9c6a2a2a [now-next] Make sure to set 404 status for /404 route itself (#3924)
As discussed this makes sure to set the `404` status on the `/404` path itself
2020-03-19 18:24:20 +00:00
Steven
17f92a5ad3 Publish Canary
- now@17.0.5-canary.11
2020-03-19 13:59:08 -04:00
Ana Trajkovska
0aab7cc509 Fix error on now ls (#3942)
Co-authored-by: Leo Lamprecht <leo@zeit.co>
2020-03-19 18:45:24 +01:00
Steven
b39622b271 [tests] Fix publish job environment variables (#3943) 2020-03-19 18:44:59 +01:00
Ana Trajkovska
1e9aeee8e9 Publish Canary
- now@17.0.5-canary.10
2020-03-19 17:37:56 +01:00
Ana Trajkovska
49fac0dfad Paginate listing deployments for a project (#3933) 2020-03-19 17:21:13 +01:00
Steven
a668df829f Publish Canary
- @now/build-utils@2.1.2-canary.1
 - now@17.0.5-canary.9
 - now-client@7.0.1-canary.4
 - @now/static-build@0.14.13-canary.4
2020-03-19 10:30:33 -04:00
Steven
3d4ef1f825 [now-cli][now-client] Revert major version per #3939 2020-03-19 10:30:07 -04:00
Steven
f986daa1cc [now-client] Fix lint error: forbidden non-null assertion (#3941)
Fixes the following lint error: `Forbidden non-null assertion`.

<img src="https://user-images.githubusercontent.com/229881/77072131-98b8ab80-69c3-11ea-84f5-e45be43951f9.png" height=200 />

I realized this logic was somewhat brittle because it relied on `/` path separators so I switched it to use the native file name function `basename()` to determine if a file begins with a dot.
2020-03-19 13:44:51 +00:00
Steven
549c8777ba [tests] Fix test retry and allow local token (#3940)
This PR updates the way we run integration tests (the ones that create test deployments) so that it will be less likely to fail. 

A couple side effects to this PR:

- To run the tests locally, you must set `NOW_TOKEN` env var (can be found in `~/.now/auth.json`).
- PRs from forked repos won't run tests because they now rely on a secret in GH Actions.
- A couple alias tests that require certs need to be disabled because they will fail.

[PRODUCT-2093]

[PRODUCT-2093]: https://zeit.atlassian.net/browse/PRODUCT-2093
2020-03-19 13:08:46 +00:00
Andy
51d7242fda Revert "[now-cli][now-client] (Major) Remove legacy code (#3840)" (#3939)
* Revert "[now-cli][now-client] (Major) Remove legacy code (#3840)"

* Remove get

* Add projectId to .now/project.json
2020-03-19 00:16:51 +01:00
Nathan Rajlich
36db0e5bab [now-cli] Catch process.kill() for dev process and mute "ESRCH" (#3927)
"ESRCH" error means that the process is no longer running, and thus
already shut down. No need to throw in that case so just ignore the
error.

Fixes: https://sentry.io/organizations/zeithq/issues/1568104652

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-18 13:49:22 -07:00
Steven
99368b4248 [all] Fix test fixture pkg names and increase retry (#3935)
Fixes test warnings from `jest-hast-map`:

```
[now-static-build] Running yarn test-integration-once
$ jest --env node --verbose --runInBand test/integration.test.js
jest-haste-map: Haste module naming collision: 12-create-react-app
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/12-create-react-app/package.json
    * <rootDir>/test/fixtures/26-ejected-cra/package.json

jest-haste-map: Haste module naming collision: gatsby-starter-default
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/10-gatsby/package.json
    * <rootDir>/test/fixtures/10-gatsby-without-build-script/package.json

jest-haste-map: Haste module naming collision: gohugo-default-theme
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/31-hugo/themes/ananke/package.json
    * <rootDir>/test/fixtures/46-hugo-with-framework/themes/ananke/package.json

jest-haste-map: Haste module naming collision: gohugo-default-styles
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/31-hugo/themes/ananke/src/package.json
    * <rootDir>/test/fixtures/46-hugo-with-framework/themes/ananke/src/package.json

jest-haste-map: Haste module naming collision: 47-nuxt-with-custom-output
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/47-nuxt-with-custom-output/package.json
    * <rootDir>/test/fixtures/48-nuxt-without-framework/package.json
```

Also increased test retry to 5.
2020-03-18 16:37:19 -04:00
Andy Bitz
95daf0e292 Publish Canary
- @now/frameworks@0.0.11-canary.2
 - now@18.0.0-canary.12
 - @now/static-build@0.14.13-canary.3
2020-03-18 12:53:21 +01:00
Andy
8bfa9c1a42 [now-cli] Fix ID check for orgs (#3934)
* [now-cli] Fix ID check for orgs

* Validate project settings

* Fix check
2020-03-18 12:51:52 +01:00
Shu Uesugi
4208dc0466 Add missing websites to frameworks (#3814) 2020-03-18 00:08:07 +01:00
Leo Lamprecht
00ae011b95 Use correct frameworks endpoint (#3932) 2020-03-17 23:02:30 +01:00
Andy
a770991a81 [now-cli] Restore now alias <domain> (#3910)
* [now-cli] Restore `now alias <domain>`

* Fix test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-17 22:57:02 +01:00
Leo Lamprecht
f80a6d6392 Add support for /api/v1/frameworks to the framework API (#3931)
* Add support for `/api/v1/frameworks` to the framework API

* Update now.json

* Add another rewrite

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2020-03-17 22:37:38 +01:00
Andy
30777384ec Revert "Rewrite all paths to frameworks API (#3929)" (#3930)
This reverts commit ff18788b20.
2020-03-17 22:13:06 +01:00
Yamagishi Kazutoshi
0c719b7f6a [now-static-build] Add defaultRoutes for docusaurus v2 (#3909)
Add a default router for Docusaurus v2 to add strong asset caching and 404 page fallback.
2020-03-17 17:12:06 -04:00
Leo Lamprecht
ff18788b20 Rewrite all paths to frameworks API (#3929) 2020-03-17 22:11:22 +01:00
Steven
752ab39787 Publish Canary
- @now/frameworks@0.0.11-canary.1
 - now@18.0.0-canary.11
 - @now/static-build@0.14.13-canary.2
2020-03-17 16:33:13 -04:00
Steven
c1df8c8bd1 [now-static-build] Update error message to mention project settings (#3926)
This PR improves the error message to make it actionable.

The docs will be updated in https://github.com/zeit/docs/pull/1661 with even more detail.
2020-03-17 16:29:43 -04:00
Andy
25fd1df35d [frameworks] Adjust placeholder for build command (#3928) 2020-03-17 20:31:19 +01:00
Steven
d32ab1e0d9 [examples] Update jekyll and middleman to use bundler 2.1.4 (#3923)
These examples were using an old version of Bundler which didn't match our tests and would fail with:

```
/ruby27/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.2) required by your /zeit/6f4b9e46/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.2`
	from /ruby27/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
	from /ruby27/bin/bundle:23:in `<main>'
```

I ran `bundle update --bundler` in each of these directories and it only updated the version in `Gemfile.lock` because 2.x is mostly backwards compatible.
2020-03-17 11:54:20 -04:00
Steven
a69c460760 [now-cli] Fix test for username (#3916)
We renamed the CI Bot so this will use the name from the context rather than hardcoding the name.
2020-03-17 11:23:21 -04:00
Andy
b985853f15 [frameworks] Remove quotes from placeholder (#3921) 2020-03-17 15:37:24 +01:00
Andy
94e607a93a [frameworks] Fix more placeholders (#3920)
* [frameworks] Fix order in build placeholder

* [frameworks] Adjust order for more frameworks
2020-03-17 15:31:01 +01:00
Andy
f97a81fa14 [frameworks] Fix order in build placeholder (#3918) 2020-03-17 15:20:47 +01:00
Andy
6e28438eb4 [frameworks] Change build placeholder (#3917) 2020-03-17 15:08:28 +01:00
Shu Ding
8fcdf3f458 improve brunch example (#3906) 2020-03-17 00:33:08 +08:00
dependabot[bot]
dbf0cc3562 Bump acorn from 5.7.3 to 5.7.4 (#3913)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-15 11:55:13 +01:00
Steven
27ccfa7e7a Publish Canary
- now@18.0.0-canary.10
2020-03-13 14:22:52 -04:00
Steven
f37edbc670 [now-cli] Fix invalid token error message during project link (#3907)
This PR improves the error message and prevents "An unexpected error occurred" when the token is invalid during a project link step.

I also added the `--token` option to `now dev --help` .

Lastly, I updated `now logout` to work correctly when the token is invalid.

- Fixes #3772 
- Fixes #3786
2020-03-13 00:10:11 +00:00
JJ Kasper
b7943e83d2 Publish Canary
- @now/next@2.4.1-canary.1
 - @now/routing-utils@1.7.1-canary.1
2020-03-12 11:45:18 -05:00
JJ Kasper
300ed5b952 [now-next] Implement new handles for custom routes (#3892)
This implements the new handles from https://github.com/zeit/now/pull/3876 to allow us to ensure the proper order for `rewrites`, `redirects`, and `headers` in Next.js. I also added in the tests from the Next.js [custom-routes test suite](https://github.com/zeit/next.js/tree/canary/test/integration/custom-routes) to ensure we're matching behavior. 

To help keep track of what each probe is testing I added support for parsing the `now.json` files in `testDeployment` as [JSON5](https://www.npmjs.com/package/json5) to allow adding comments before each probe. If this is undesired I can remove this specific change even though it makes managing the fixture tests much easier
2020-03-12 03:18:33 +00:00
Andy Bitz
9e6ebfb3ec Publish Canary
- now@18.0.0-canary.9
2020-03-11 23:02:30 +01:00
Andy
f49620790c [now-cli] Proper error message when now alias misses arguments (#3904)
We need to show a proper error message when `now alias` misses arguments.
2020-03-11 21:57:02 +00:00
Steven
84065688b5 Publish Canary
- now@18.0.0-canary.8
2020-03-11 16:15:11 -04:00
Steven
5a1012fb0f [now-cli] Prevent framework from clearing console in now dev (#3903)
When running a framework like Create React App or Gridsome, the console gets cleared. This prevented the user from seeing the message printed from `now dev` which is typically `http://localhost:3000`. Instead the user would see the framework's URL such as `http://localhost:54684`.

See #3497 for an example.

The solution is to change the child process to pipe stdout/stderr. Since most frameworks detect [`process.stdout.isTTY`](7e6d6cd05f/packages/react-scripts/scripts/start.js (L141-L143)) before clearing the console, this will solve the problem. I was also able to intercept stdout to replace the framework's port with the `now dev` port and I think this will also help prevent confusion.

I also had to set `FORCE_COLOR=1` to avoid losing ANSI colors.

- Related to https://github.com/facebook/create-react-app/issues/2495
- Fixes #3497
2020-03-11 16:11:51 -04:00
Nathan Rajlich
4b6143c293 [now-cli] Remove "Serving all files as static" message (#3901) 2020-03-11 13:03:16 +00:00
Mark Glagola
b6601b0d9a Publish Canary
- now@18.0.0-canary.7
2020-03-10 13:59:46 -05:00
Mark Glagola
2870a1dd49 Fix setup-domain to use aliasDomain for gets (#3871) 2020-03-10 13:35:50 -05:00
Steven
6249f7e293 [now-cli] Change suggestion for rootDirectory to ./ (#3899)
When we ask the question "In which directory is your code located?" we were displaying a prefix  of `cwd/` which is confusing because it seems like you are supposed to type in the current directory. It also doesn't match what is displayed in the Project Settings after it is deployed.

This changes the prefix to `./` so that `rootDirectory` is set to the current directory and the user can type in a subdirectory if they wish such as `./packages/web` for example.

### Before

```
? Set up and deploy “~/Code/app”? [Y/n] y
? Which scope do you want to deploy to? Testing
? Link to existing project? [y/N] n
? What’s your project’s name? app
? In which directory is your code located? app/
```

### After

```
? Set up and deploy “~/Code/app”? [Y/n] y
? Which scope do you want to deploy to? Testing
? Link to existing project? [y/N] n
? What’s your project’s name? app
? In which directory is your code located? ./
```
2020-03-10 10:50:50 -04:00
Steven
6f9545e097 Publish Canary
- @now/build-utils@2.1.2-canary.0
 - @now/next@2.4.1-canary.0
2020-03-09 16:45:24 -04:00
Steven
8095ba5cf9 [now-build-utils] Add env var NPM_ONLY_PRODUCTION (#3898)
In PR #3847 we fixed a bug that prevented installing `devDependencies` when `NODE_ENV=production` this is typically what users want, but there are some cases where a user may wish to skip installing `devDependencies`. For example, if you have more than 500 MB worth of dependencies.

This PR introduces `NPM_ONLY_PRODUCTION=1` which can be used to skip installing `devDependencies` in these rare cases. It is the equivalent of `npm install --production` or `yarn install --production`. There is also `npm install --only=production` for which this new env var gets its name.

#### References
- https://docs.npmjs.com/cli/install
- https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-production-true-false
2020-03-09 16:41:34 -04:00
Andy
e02128e5a3 [now-next] Consider buildCommand from config (#3895)
* [now-next] Use build command

* Update packages/now-next/src/index.ts

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-03-09 14:32:36 +01:00
Paco
2567b8c8b8 [examples] Add ZEIT logo to Next.js example (#3893) 2020-03-07 14:40:22 +01:00
Andy Bitz
5bfcdec471 Publish Canary
- now@18.0.0-canary.6
2020-03-07 01:28:48 +01:00
Andy
6609686a2b [now-cli] Fix undefined in error output (#3894)
* [now-cli] Fix undefined in error output

* Revert "[now-cli] Fix undefined in error output"

This reverts commit afee2eb43f92bac4057d69e3d5cfe6593288401d.

* Add now.url
2020-03-07 01:28:07 +01:00
Steven
709aaf2285 Publish Canary
- now@18.0.0-canary.5
2020-03-06 17:47:04 -05:00
Steven
6b3908d4dc [now-cli] Fix now dev env vars in Next.js APIs (#3891)
In Now CLI 17 when Next.js is detected, the `next dev` command is proxied from `now dev`.

This brings Next.js into alignment as other other frameworks such as Gatsby and CRA. But those other frameworks are building static websites, so we were only passing build time env vars. However, Next.js needs runtime env vars for APIs in `/pages/api`.

So the solution is to special case until Next.js can read these files directly. See https://github.com/zeit/next.js/pull/10525

Fixes #3758
2020-03-06 22:43:51 +00:00
m5o
9d19d02a0a [tests] Return an empty array if nowJson.builds is empty (#3886)
* return an empty array if nowJson.builds is empty
  * https://github.com/zeit/now/pull/3622#issuecomment-578995344
  * extracted from PR discussion
    * occur after following change a645d4ee88
  * kudos to @styfle

/cc @styfle
2020-03-06 20:12:44 +00:00
Steven
533b059947 Publish Canary
- now@18.0.0-canary.4
2020-03-06 13:57:53 -05:00
Steven
2a7c1dc4e4 [now-cli] Print error during install for unsupported Node version (#3869)
Fixes #3866 

### Output
```
> now@18.0.0 preinstall /usr/local/lib/node_modules/now
> node ./scripts/preinstall.js

> Error! Detected unsupported Node.js version.
Expected ">= 10" but found "8.10.0".
Please update to the latest Node.js LTS version to install Now CLI.
```
2020-03-06 13:22:24 -05:00
Ana Trajkovska
07a920ed18 Publish Canary
- @now/cgi@1.0.4-canary.0
 - now@18.0.0-canary.3
2020-03-06 13:31:34 +01:00
Ana Trajkovska
db36c874a0 Add period at the end of cancelation deployment message (#3884) 2020-03-06 13:17:29 +01:00
Tim Neutkens
cc58af74d6 Update Next.js example to latest create-next-app format (#3881)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-06 12:46:29 +01:00
kodiakhq[bot]
1bcb95a9f0 [now-cgi] Remove unused dependency (#3878)
Removes `@zeit/best` because it is unused and outdated.

We should considered deprecating `@now/cgi` since it only gets [4 downloads per week](https://user-images.githubusercontent.com/229881/75991128-004f0100-5ec4-11ea-9195-bf8019a5a965.png) and has no tests.

I also deleted the nested `yarn.lock` since we only need one at the root for yarn workspaces.
2020-03-05 18:20:11 +00:00
JJ Kasper
e6a0216faf Publish Canary
- @now/frameworks@0.0.11-canary.0
 - now@18.0.0-canary.2
 - now-client@8.0.0-canary.2
 - @now/node@1.4.2-canary.1
 - @now/routing-utils@1.7.1-canary.0
2020-03-05 11:26:21 -06:00
kodiakhq[bot]
283ef46ac5 [now-cli] Bump dot to 1.1.3 (#3877)
Bumps `dot` to the latest version [1.1.3](https://github.com/olado/doT/releases/tag/v1.1.3).
2020-03-05 14:31:14 +00:00
kodiakhq[bot]
b4b1857562 [now-routing-utils] Add support for new handle types (#3876)
This adds support for the new internal `handle` types `error` and `rewrite` and also updates the error messages to be more verbose since additional keys are allowed when using `handle: 'error'`. 

This is needed so that we can implement utilize the new handles in `@now/next` for the new custom-routes support
2020-03-04 23:05:14 +00:00
Matthew Sweeney
c46c56bbf9 Add Issue Templates (#3873)
This PR adds issue templates for common cases:

- Bug Report - to be submitted through the ZEIT Now support form.
- Feature Request - to be handled as a discussion between the community and ZEIT staff.
- Ask a Question - to be posted in Discussions for all to answer.

In addition to this, the PR also removes the Spectrum link from the README.
2020-03-04 11:50:50 -05:00
Nathan Rajlich
62ce2f6cac [now-node] Use url.parse() for req.query helper (#3863)
Given:

```js
module.exports = (req, res) => {
  res.json(req.query)
}
```

Fixes:

```
GET /api/helperparser?a=2&a=1
{"a":"1"}
```

To be:

```
GET /api/helperparser?a=2&a=1
{"a":["2","1"]}
```
2020-03-03 20:38:32 +00:00
Andy
631c7befad [examples] Remove hasDetectors from API (#3865)
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-03-03 14:27:13 +01:00
Andy
bc18c34d60 [examples] Remove examples without detectors (#3864) 2020-03-03 13:45:27 +01:00
Andy Bitz
6b6a1891c1 Publish Canary
- now@18.0.0-canary.1
 - now-client@8.0.0-canary.1
2020-03-02 22:01:51 +01:00
Andy Bitz
8879b115ef [now-cli][now-client] Bump version 2020-03-02 22:01:29 +01:00
Andy
99c4c32d6d [now-cli][now-client] (Major) Remove legacy code (#3840)
* [now-cli][now-client] Remove legacy code

* Adjust tests

* Adjust more tests

* Remove scale command and --no-scale option from help

* Update packages/now-cli/src/commands/inspect.js

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

* Remove isBuilds option

* Use Object.entries

* Remove rambda

* Adjust type and remove more unused code

* Use URL instead of url.parse

* Fix linting

* Simplify responseError function

* Remove GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin19.0.0)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                                                                             history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
 (( expression ))                                                                         if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] >
 . filename [arguments]                                                                   jobs [-lnprs] [jobspec ...] or jobs -x command [args]
 :                                                                                        kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
 [ arg... ]                                                                               let arg [arg ...]
 [[ expression ]]                                                                         local [option] name[=value] ...
 alias [-p] [name[=value] ... ]                                                           logout [n]
 bg [job_spec ...]                                                                        mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c q>
 bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:>  popd [-n] [+N | -N]
 break [n]                                                                                printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]                                                        pushd [-n] [+N | -N | dir]
 caller [expr]                                                                            pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac                               read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t t>
 cd [-L|[-P [-e]] [-@]] [dir]                                                             readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c>
 command [-pVv] command [arg ...]                                                         readonly [-aAf] [name[=value] ...] or readonly -p
 compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist]  [-F functi>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlis>  select NAME [in WORDS ... ;] do COMMANDS; done
 compopt [-o|+o option] [-DEI] [name ...]                                                 set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
 continue [n]                                                                             shift [n]
 coproc [NAME] command [redirections]                                                     shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilnrtux] [-p] [name[=value] ...]                                          source filename [arguments]
 dirs [-clpv] [+N] [-N]                                                                   suspend [-f]
 disown [-h] [-ar] [jobspec ... | pid ...]                                                test [expr]
 echo [-neE] [arg ...]                                                                    time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [name ...]                                             times
 eval [arg ...]                                                                           trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [arguments ...]] [redirection ...]                         true
 exit [n]                                                                                 type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or export -p                                             typeset [-aAfFgilnrtux] [-p] name[=value] ...
 false                                                                                    ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]                         umask [-p] [-S] [mode]
 fg [job_spec]                                                                            unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done                                             unset [-f] [-v] [-n] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done                                            until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMANDS ; }                                   variables - Names and meanings of some shell variables
 getopts optstring name [arg]                                                             wait [-fn] [id ...]
 hash [-lr] [-p pathname] [-dt] [name ...]                                                while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                                                                { COMMANDS ; } from subcommand list since it's a global command

* Log errors

Co-authored-by: Steven <steven@ceriously.com>
2020-03-02 21:59:45 +01:00
Steven
857da7774b Publish Stable
- @now/build-utils@2.1.1
2020-02-29 18:44:58 -05:00
Steven
3407e6bd1a Publish Canary
- @now/build-utils@2.1.1-canary.0
 - @now/ruby@1.0.3-canary.3
2020-02-29 18:40:49 -05:00
Steven
553ad240f0 [now-build-utils] Fix NODE_ENV assignment (#3862)
Fixes a regression in #3847 which was preventing the user from assigning `NODE_ENV`.

The root cause was that the spread operator (`...`) performs a shallow clone, not a deep clone. So we must perform another spread to clone the user-provided `env` object before deleting `NODE_ENV` during `npm install`.
2020-02-29 18:37:59 -05:00
m5o
964ce1bb5a [now-ruby] update bundler on ruby rack examples (#3856)
* update bundler on ruby rack examples
  * bundle with latest bundler `v2.1.4`
  * update rack to `v2.2.2`
  🔗 https://github.com/zeit/now/pull/3626
2020-02-28 23:45:54 +00:00
Steven
995aa6eddf Publish Canary
- now@17.0.5-canary.7
2020-02-28 17:39:42 -05:00
Steven
095805e3ad [tests] Fix missing await (#3860)
Follow up to #3858
2020-02-28 17:35:02 -05:00
Steven
b461ed238c [tests] Fix code coverage upload (#3859)
The code coverage report stopped uploading after we switched to GitHub Actions because its not a recognized CI provider.

This PR adds a secret with the code coverage token from [codecov.io](https://codecov.io/gh/zeit/now/settings).
2020-02-28 22:13:04 +00:00
Steven
01e7124189 Publish Canary
- now@17.0.5-canary.6
 - @now/ruby@1.0.3-canary.2
2020-02-28 16:21:56 -05:00
Steven
acd3ac2f98 [now-cli] Disable sentry during local development (#3858)
This PR changes the behavior of error reporting and metrics so that developers who build and run Now CLI locally won't accidentally report any metrics. It also prevents errors during CI tests from being reported.

The env vars are only assigned during the publishing step so that the official Now CLI hosted on npm is the only way to report metrics.
2020-02-28 21:20:36 +00:00
Steven
b50e4209e1 [now-cli] Fix "The specified token is not valid" (#3857)
Fixes https://sentry.io/organizations/zeithq/issues/1537743736/?project=1323225&referrer=slack
2020-02-28 19:59:51 +00:00
m5o
147b4e870c [now-ruby] Add test fixture for ActiveSupport gem (#3853)
* add ruby ActiveSupport test fixture
  > ActiveSupport is a Ruby module & a stand-alone component of Rails that includes additional functionality to core Ruby classes, like Array, String & Numeric.
  🔗 https://guides.rubyonrails.org/active_support_core_extensions.html

* add `Date.current + 10.years` calculation example
2020-02-28 12:56:06 -05:00
Steven
df8327d14c [docs] Update readme (#3855)
Updates the readme to mention the Git Integration and fixes some misinformation.
2020-02-28 12:53:40 -05:00
Joe Haddad
fb4d4b5953 Publish Stable
- @now/build-utils@2.1.0
 - @now/next@2.4.0
 - @now/routing-utils@1.7.0
2020-02-28 10:19:47 -05:00
Joe Haddad
de3701c045 Publish Canary
- @now/ruby@1.0.3-canary.1
2020-02-28 10:18:46 -05:00
m5o
9f9b7934cb [now-ruby] Fix ruby test indentation (#3854)
* fix ruby indentation example
  * 💅 indent with 2 spaces for consistency
2020-02-28 14:34:47 +00:00
Steven
bcded1dd17 Publish Canary
- @now/build-utils@2.0.1-canary.3
 - @now/next@2.3.19-canary.2
 - @now/python@1.1.5-canary.1
2020-02-28 08:57:36 -05:00
Steven
8503af75ba [now-python] Fix space encoding 2020-02-28 08:35:27 -05:00
Joe Haddad
158a50f1aa [now-next] Allow Immutable Fallback Artifact (#3850)
* [now-next] Allow Immutable Fallback Artifact

* trigger
2020-02-27 22:00:09 -05:00
Steven
61da552dd6 [now-build-utils] Add test for NODE_ENV behavior (#3852)
This PR adds a test for #3847.
2020-02-27 21:47:27 +00:00
Steven
fa838eecac Publish Canary
- @now/go@1.0.5-canary.0
 - @now/next@2.3.19-canary.1
 - @now/node@1.4.2-canary.0
 - @now/python@1.1.5-canary.0
 - @now/ruby@1.0.3-canary.0
 - @now/static-build@0.14.13-canary.1
2020-02-27 15:52:36 -05:00
Steven
71b6a58783 [all] Exclude @now/build-utils in bundled builder to fix tests (#3848)
This fixes a bug in our `@now/build-utils` tests that pair the current build-utils with a stable builder. Since ncc was bundling `@now/build-utils`, we weren't able to configure a different version and these tests were not actually testing the correct version of build-utils.

A nice side-effect is that each builder will be about 50% smaller (compared by measuring `dist`).
2020-02-27 15:48:03 -05:00
Joe Haddad
22dd78e286 Publish Canary
- @now/build-utils@2.0.1-canary.2
 - @now/next@2.3.19-canary.0
2020-02-27 12:35:52 -05:00
Joe Haddad
e63fcf2630 [now-next] Add Support for Prerender v2 (#3845)
* [now-next] Add Support for Prerender v2

* Copy test suite

* Test that fallback doesn't work for fallback: false

* record omitted lambdas

* Improve test case

* improve omitted routes logic

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-27 12:33:31 -05:00
Steven
98e1553c2e [now-build-utils] Install all deps regardless of NODE_ENV (#3847)
Some build utilities and SSG Frameworks instruct users to set `NODE_ENV=production` which typically means updating `now.json` to the following:

```json
{
  "build": {
    "env": {
      "NODE_ENV": "production"
    }
  }
}
```

The problem is that this environment variable is assigned during `npm install` or `yarn install` which is the equivalent of running install with the `--production` flag. This flag prevents `devDependencies` from installing. This is almost never what the user intends so they have to remove `now.json` and instead updating their build script to `NODE_ENV=production yarn build`.

This PR improves the experience by deleting `NODE_ENV` during the install step.
2020-02-27 12:14:06 -05:00
Steven
4dc506f17a Publish Canary
- @now/build-utils@2.0.1-canary.1
 - now@17.0.5-canary.5
 - @now/routing-utils@1.6.1-canary.1
2020-02-27 08:05:05 -05:00
Steven
3b396f29e9 [now-build-utils][now-routing-utils] Fix appendRoutesToPhase() when input is null (#3843)
This PR fixes `@now/routing-utils` when the input routes are null. It used to return the empty array but now it will still append.

I also added many more tests to `@now/build-utils` when `featureHandleMiss: true` and refactored the code a bit to make dynamic routes and api routes a little more clear.
2020-02-26 23:30:50 +00:00
JJ Kasper
1f128e69e6 Publish Stable
- @now/next@2.3.18
2020-02-26 15:56:41 -06:00
JJ Kasper
f1487c92cb Publish Canary
- now@17.0.5-canary.4
 - @now/next@2.3.18-canary.0
2020-02-26 15:51:27 -06:00
JJ Kasper
45066cdf44 [now-next] Add /_next/data routes for getServerProps pages (#3771)
This adds the `/_next/data` routes for `getServerProps` pages if they exist

x-ref: https://github.com/zeit/next.js/pull/10077
x-ref: https://github.com/zeit/next.js/pull/10622
2020-02-26 21:47:51 +00:00
Ana Trajkovska
7dde9c8207 Publish Canary
- now@17.0.5-canary.3
 - now-client@7.0.1-canary.1
2020-02-26 08:00:09 +01:00
Ana Trajkovska
fd964f825d Handle deployment cancellation (#3823)
Co-authored-by: Max <8418866+rdev@users.noreply.github.com>
2020-02-26 07:21:27 +01:00
Steven
1656c9874e Publish Canary
- @now/build-utils@2.0.1-canary.0
 - now@17.0.5-canary.2
 - @now/routing-utils@1.6.1-canary.0
2020-02-25 17:32:37 -05:00
Steven
d999a3b2ad [now-routing-utils][now-build-utils] Refactor zero-config rewrites (#3832)
This PR refactors the rewrites (the dynamic routes as well as the route that prevents directory listing for zero config deployments) so they are not in the `handle: miss` phase.

This is necessary because the behavior of `handle: miss` will change in an upcoming release.

The solution is to separate these into `rewriteRoutes` that can then be merged properly with the user's routes. They will be appended to the `handle: filesystem` phase (or add the phase if it doesn't exist).
2020-02-25 22:30:36 +00:00
Joe Haddad
cfb7c9e632 Publish Stable
- @now/next@2.3.17
2020-02-25 15:19:05 -05:00
Joe Haddad
06e8472cf7 Publish Canary
- now@17.0.5-canary.1
 - @now/next@2.3.17-canary.0
 - @now/static-build@0.14.13-canary.0
2020-02-25 14:57:42 -05:00
Joe Haddad
92404135d8 [now-next] Always Emit Prerenders (#3837)
This ensures we always emit Prerender objects for bypass tokens.
2020-02-25 19:51:07 +00:00
Nathan Rajlich
8b5cc23d7c [now-cli] Remove v1 "static build" integration tests (#3833)
* [now-cli] Remove v1 "static build" integration tests

These are the last remaining v1 static type deployments being created.

* Remove from `integration.js` as well

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-24 17:19:22 -08:00
Shu Uesugi
e10b42bfdc Rename zeit.co/new → zeit.co/import (#3834)
* zeit.co/new → zeit.co/import

* Update docs URL
2020-02-25 01:35:12 +01:00
M. Heide
36f7ec4836 [examples] Fix Go build if Windows Git is configured to checkout CRLF line endings (#3821)
Fixes #3820
2020-02-24 19:53:15 +00:00
Joe Haddad
f89d1c463e Remove Backticks from URL Output (#3830)
![image](https://user-images.githubusercontent.com/616428/75176976-44434880-5703-11ea-8ca5-cb49e4a921cf.png)

![image](https://user-images.githubusercontent.com/616428/75176982-473e3900-5703-11ea-90f6-b31844a486ce.png)
2020-02-24 19:22:58 +00:00
Steven
5dc652eba9 Publish Canary
- now@17.0.5-canary.0
 - now-client@7.0.1-canary.0
2020-02-24 12:53:13 -05:00
Steven
821b2bd50b [now-client] Fix root directory with trailing slash (#3827)
There was a bug in `now-client` when deploying a directory that ends with a slash, for example `/Users/styfle/Code/myapp/` instead of the usual `/Users/styfle/Code/myapp`.

This never affected `now-cli` until we added support for defining the `rootDirectory` which allows the user to type whatever they wish in the Project Settings.

The fix is to use `path.relative()` instead of substring.
2020-02-24 17:45:10 +00:00
Steven
8d5f6f1fa3 Publish Stable
- @now/frameworks@0.0.10
 - @now/build-utils@2.0.0
 - now@17.0.4
 - @now/go@1.0.4
 - @now/next@2.3.16
 - @now/python@1.1.4
 - @now/routing-utils@1.6.0
2020-02-21 18:09:20 -05:00
Steven
617f610c07 [tests] Update cancel workflow (#3817)
Update to latest version, [0.2.0](https://github.com/styfle/cancel-workflow-action/releases/tag/0.2.0), which will fix cancelling on push.

Also this action is available in the [marketplace](https://github.com/marketplace/actions/cancel-workflow-action).
2020-02-21 18:00:27 -05:00
Steven
3229ba0106 Publish Canary
- @now/go@1.0.4-canary.3
 - @now/python@1.1.4-canary.1
2020-02-21 17:27:20 -05:00
Steven
d16a6e4716 [now-go] Fix path segments in now dev (#3816)
The combination of file renaming and brackets doesn't work well for go build so we need to add the file extension back before building.

I also simplified the `.now/cache/folder` logic because it should be the same whether `builds` is defined or not (aka zero config).
2020-02-21 22:25:44 +00:00
Steven
4e5156fb0b [now-python] Fix path segments in now dev (#3815)
The combination of file renaming and brackets doesn't work well for python imports so we need too add the file extension back before importing the python module.

I also simplified the `.now/cache/folder` logic because it should be the same whether `builds` is defined or not (aka zero config).
2020-02-21 20:45:41 +00:00
Joe Haddad
3c013cc36b Publish Canary
- @now/build-utils@2.0.0-canary.2
 - @now/next@2.3.16-canary.1
2020-02-21 11:06:44 -05:00
Joe Haddad
1ed83135be Add Bypass Token to Next.js Builder (#3811)
This pull request adds the bypass token to returned `Prerender` output objects.

There's no tests as this doesn't exist in production yet.
2020-02-21 16:05:22 +00:00
Joe Haddad
0e71ff2df1 [now-build-utils] Add bypassToken to Prerender for iSSG (#3810)
This pull request adds a new `bypassToken` field to the `Prerender` output.

The field is required to be at least 128 bits for security reasons!
2020-02-20 01:59:45 +00:00
JJ Kasper
d8e98ee476 Publish Canary
- @now/next@2.3.16-canary.0
 - @now/routing-utils@1.5.4-canary.0
2020-02-19 16:23:25 -06:00
JJ Kasper
1bc1e8a9b1 [now-routing-utils] Update to not pass used segments in redirect query (#3809)
This updates to not pass segments already used in a redirect's destination query since these values are most likely unwanted and can still be manually added if desired. This change does not affect rewrites and we still pass through all segments in the query
2020-02-19 22:13:36 +00:00
JJ Kasper
274fdeb49a Publish Stable
- @now/next@2.3.15
2020-02-19 15:02:21 -06:00
JJ Kasper
d15c90b42f Publish Canary
- now@17.0.4-canary.3
 - @now/next@2.3.15-canary.0
2020-02-19 14:57:20 -06:00
JJ Kasper
5be2917c47 [now-next] Update 404 handling for pages/404 (#3697)
This adds handling for treating `pages/404.js` as the custom error page in Next.js to allow for more flexible auto static optimization on the 404 page. This makes sure we handle `pages/404.js` being a lambda due to `_app` having `getInitialProps` and also makes sure that visiting `/404` doesn't respond with a 200 status code

~We can add tests for this behavior after the below PR has been released in a canary of Next.js~

x-ref: https://github.com/zeit/next.js/pull/10329
x-ref: https://github.com/zeit/next.js/pull/10593
2020-02-19 20:55:26 +00:00
dependabot[bot]
5f08b24546 Bump codecov from 3.1.0 to 3.6.5 (#3807)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.1.0 to 3.6.5.
<details>
<summary>Release notes</summary>

*Sourced from [codecov's releases](https://github.com/codecov/codecov-node/releases).*

> ## v3.6.4
> Fix for Cirrus CI
> 
> ## v3.6.3
> AWS Codebuild fixes + package updates
> 
> ## v3.6.2
> command line args sanitised
> 
> ## v3.6.1
> Fix for Semaphore
> 
> ## v3.6.0
> AWS CodeBuild
> Semaphore v2
> 
> ## v3.3.0
> Added pipe `--pipe`, `-l`
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/codecov/codecov-node/commits)
</details>
<details>
<summary>Maintainer changes</summary>

This version was pushed to npm by [drazisil](https://www.npmjs.com/~drazisil), a new releaser for codecov since your current version.
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov&package-manager=npm_and_yarn&previous-version=3.1.0&new-version=3.6.5)](https://help.github.com/articles/configuring-automated-security-fixes)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/zeit/now/network/alerts).

</details>
2020-02-19 20:19:49 +00:00
Steven
cc3026ffcb [tests] Fix builder debug flag (#3805)
When testing, you can set `NOW_BUILDER_DEBUG=1` to print verbose logs from builders.

However, this was causing some tests to fail that depended on a build environment variable.

This PR fixes the assignment so that it preserves the environment variables from the tests by adding `NOW_BUILDER_DEBUG` instead of replacing.
2020-02-18 22:57:17 +00:00
JJ Kasper
8cb6e56679 Publish Stable
- @now/next@2.3.14
2020-02-17 14:28:07 -06:00
JJ Kasper
7da5ff4b1d Publish Canary
- now@17.0.4-canary.2
 - @now/next@2.3.14-canary.1
2020-02-17 11:45:53 -06:00
JJ Kasper
5d1069d464 [now-next] Make sure to 404 and clear cache header for invalid _next requests (#3801)
This handles an edge case where deeply nested dynamic routes were handling `_next` 404s that were cached forever since the immutable header we set isn't cleared after not matching on the filesystem.

I updated our cache-header fixture to check for this edge case also to make sure we don't regress on this
2020-02-17 17:42:51 +00:00
Andy
6e1a72f557 [examples] Use Full URL for Logos (#3800)
Use Full URL for Logos

[PRODUCT-1193]

[PRODUCT-1193]: https://zeit.atlassian.net/browse/PRODUCT-1193
2020-02-17 13:44:35 +00:00
dependabot[bot]
6f97a2cc7a Bump yarn from 1.17.3 to 1.22.0 (#3796)
Bumps [yarn](https://github.com/yarnpkg/yarn) from 1.17.3 to 1.22.0.
<details>
<summary>Changelog</summary>

*Sourced from [yarn's changelog](https://github.com/yarnpkg/yarn/blob/master/CHANGELOG.md).*

> # Changelog
> 
> Please add one entry in this file for each change in Yarn's behavior. Use the same format for all entries, including the third-person verb. Make sure you don't add more than one line of text to keep it clean. Thanks!
> 
> ## Master
> 
> - Passes arguments following `--` when running a workspace script (`yarn workspace pkg run command -- arg`)
> 
>   [#7776](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7776) - [**Jeff Valore**](https://twitter.com/rally25rs)
> 
> - Prints workspace names with `yarn workspaces` (silence with `-s`)
> 
>   [#7722](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7722) - [**Orta**](https://twitter.com/orta)
> 
> - Implements `yarn init --install <version>`
> 
>   [#7723](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7723) - [**Maël Nison**](https://twitter.com/arcanis)
>   
> - Implements `yarn init -2`
> 
>   [#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7862) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Implements `yarn set version <version>` as an alias for `policies set-version`
> 
>   [#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7862) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Fixes an issue where the archive paths were incorrectly sanitized
> 
>   [#7831](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7831) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Allows some dots in binary names again
> 
>   [#7811](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7811) - [**Valery Bugakov**](https://github.com/valerybugakov)
>   
> - Better error handling on `yarn set version`
> 
>   [#7848](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7848) - [**Nick Olinger**](https://github.com/olingern)
> 
> ## 1.19.2
> 
> - Folders like `.cache` won't be pruned from the `node_modules` after each install.
> 
>   [#7699](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7699) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Correctly installs workspace child dependencies when workspace child not symlinked to root.
> 
>   [#7289](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7289) - [**Daniel Tschinder**](https://github.com/danez)
> 
> - Makes running scripts with Plug'n Play possible on node 13.
> 
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`eee67d0`](eee67d02ed) v1.22.0
- [`6971622`](69716228e9) Update CHANGELOG.md
- [`0e7133c`](0e7133ca28) Fixes arbitrary file write on fetch ([#7831](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7831))
- [`fa613f3`](fa613f3a71) handle failed policy set-version ([#7848](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7848))
- [`f381c5f`](f381c5f0ce) Implements set version ([#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7862))
- [`d2c3a48`](d2c3a485e0) Configure bug report issue template ([#7844](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7844))
- [`af4c205`](af4c2056a3) Allow dots in bin names ([#7811](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7811))
- [`1b334e6`](1b334e687b) fix(workspaces): Pass args following "--" when running workspace scripts ([#7786](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7786))
- [`2c8e97e`](2c8e97eaf3) Fix suggestions for CLI ([#7808](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7808))
- [`039bafd`](039bafd74b) Fixes bin overwrites ([#7755](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7755))
- Additional commits viewable in [compare view](https://github.com/yarnpkg/yarn/compare/v1.17.3...v1.22.0)
</details>
<details>
<summary>Maintainer changes</summary>

This version was pushed to npm by [daniel15](https://www.npmjs.com/~daniel15), a new releaser for yarn since your current version.
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=yarn&package-manager=npm_and_yarn&previous-version=1.17.3&new-version=1.22.0)](https://help.github.com/articles/configuring-automated-security-fixes)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/zeit/now/network/alerts).

</details>
2020-02-15 01:56:34 +00:00
Steven
6e402bffc3 Publish Canary
- now@17.0.4-canary.1
 - @now/go@1.0.4-canary.2
 - @now/next@2.3.14-canary.0
2020-02-14 15:05:00 -05:00
Steven
e41d0f8e68 [now-go] Fix /api/go.sum detection (#3795)
Follow up to #3793 

The `go.mod` and `go.sum` file must both be moved.
2020-02-14 19:58:44 +00:00
Steven
1a046744f2 [now-go] Add support for root go.mod in api directory (#3793)
Some users wish to put all Go related code in the `/api` directory and the root is reserved for a frontend framework.

This PR adds support for `/api/go.mod` which will act the same as `/go.mod` by moving the file to the root.
2020-02-14 17:32:20 +00:00
Andy
a9bf011f2c [api] Add rewrite to frameworks API (#3794)
* [api] Add rewrite to frameworks API

* Adjust now.json

* Change output file
2020-02-14 00:30:58 +01:00
JJ Kasper
60c76b3290 [now-next] Add support for using the fallback file for dynamic SSG pages (#3752)
This adds support for using the fallback file for dynamic (lazy) SSG pages to allow showing a loading state while the cache is populated with data. We can add tests for this behavior once the below referenced PR is shipped on canary

x-ref: https://github.com/zeit/next.js/pull/10424

~Update: added tests now that fallback support has landed in Next.js although it appears `now-proxy` might need to be updated to revalidate the fallback correctly since the initial fallback is always being shown for lazy SSG pages with these changes~

Looks like this is working properly in `now-proxy` and we were overriding the prerender output with the static page output, thanks @juancampa for helping investigate! 🙏
2020-02-13 01:06:55 +00:00
Steven
c7ff1e7044 [now-cli] Update ZEIT Logo (#3790)
This PR updates the logo to match https://zeit.co/home
2020-02-12 10:17:54 -05:00
Andy Bitz
e2deaef54a Publish Canary
- @now/frameworks@0.0.10-canary.0
2020-02-12 14:46:11 +01:00
Andy
b2c7386c83 [frameworks] Adjust Next.js build command placeholder (#3788) 2020-02-12 14:34:09 +01:00
Steven
3dce84c3cf Publish Canary
- @now/go@1.0.4-canary.1
2020-02-11 16:46:21 -05:00
Steven
443b1ac158 [now-go] Fix path segments with square brackets (#3782)
Previously, `@now/go` would fail when using [Path Segments](https://zeit.co/docs/v2/serverless-functions/introduction#path-segments) since `go build` [doesn't support](https://stackoverflow.com/q/60140859/266535) files that begin with square bracket.

This PR changes the build logic so that the entrypoint file is renamed if if begins with a square bracket.

The output file is not renamed because v3 builders can't rename outputs which works great for this feature.
2020-02-11 21:41:57 +00:00
Andy Bitz
be3dca3d94 Publish Canary
- @now/build-utils@2.0.0-canary.1
 - now@17.0.4-canary.0
 - @now/go@1.0.4-canary.0
 - @now/python@1.1.4-canary.0
2020-02-11 16:50:13 +01:00
Andy Bitz
cb135e4329 [now-build-utils] Bump version 2020-02-11 16:50:01 +01:00
Andy
55c73b68bb [now-build-utils][now-cli] Refactor builds and routes detection (#3784)
* [now-build-utils] Refactor detect builds

* Refactor routes detection

* [now-cli] Adjust `now dev`

* Adjust tests

* Adjust integrations test

* Remove unused file

* Replace reducw with for-loop

* Add cache for absolute paths

* Filter while looping

* Add fallback for entrypoint with buildCommand
2020-02-11 16:47:39 +01:00
Steven
eb793ba139 [tests] Add windows to CI unit tests (#3727)
This adds initial support for Windows in GitHub Actions CI tests.

There is still work to be done to prevent certain tests from hanging in CI so those are skipped for now.
2020-02-11 01:16:14 +00:00
Steven
00908e8ebe [now-python] Fix path segments with square brackets (#3781)
Previously, python would fail when using [Path Segments](https://zeit.co/docs/v2/serverless-functions/introduction#path-segments) as seen in #3729.

This PR changes the import logic so that the entrypoint file is [imported as a relative file path](https://stackoverflow.com/a/67692/266535) instead of by module name.
2020-02-10 21:01:31 +00:00
Leo Lamprecht
5ce7ff86a4 Minor tweaks for CONTRIBUTING.md file (#3778)
* Minor tweaks for CONTRIBUTING.md file

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2020-02-10 18:34:00 +01:00
Steven
4b34ee2993 [examples] Remove outdated jekyll build section from README (#3780)
We used to require a `package.json` but we have since introduced [Advanced Project Settings](https://zeit.co/blog/advanced-project-settings) which will ask the user for a build command during the first deploy.
2020-02-10 15:31:52 +00:00
Andi
646bd288ba [now-go] Update go to version 1.13.7 (#3750)
Updates go to the latest version 1.13.7 (https://golang.org/doc/devel/release.html#go1.13). This allows users to use the new error functionality that was introduced in go 1.13 (https://blog.golang.org/go1.13-errors) and also includes a couple of security fixes.

Looking at the last PR that updated the version (https://github.com/zeit/now-builders/pull/247/files) this should be as simple as updating the version number.

P.S. I tried to follow the contribution guidelines, but `yarn lint` fails with `exit code 1`/`295 problems (33 errors, 262 warnings)` and `yarn test` returns `error Command "test" not found` on master. But `yarn test-unit` shows no errors.
2020-02-08 01:47:47 +00:00
Steven
8aba6f1ff8 Publish Stable
- now@17.0.3
2020-02-07 20:01:17 -05:00
Steven
35e5e328aa Publish Canary
- now@17.0.3-canary.1
2020-02-07 19:18:47 -05:00
Andy
bdd4953d62 [now-cli] Consider root directory for now.json (#3764)
* [now-cli] Consider root directory for now.json

* Adjust message check in test

* Fallback if config does not exist as well

* Assign localConfig later and add debug

* Prefere now.json from root directory

* Comment

* Adjust test and add warning
2020-02-08 01:04:34 +01:00
Steven
e938b298e2 [now-cli] Fix port assignment for now dev (#3769)
This fixes a regression from #3749 where the PORT env var was removed. This is necessary so frameworks like create-react-app and gatsby can proxy to `now dev`.

Fixes #3761
2020-02-07 19:03:56 -05:00
Andy
b67f324e10 [api] Add hasDetectors property (#3770) 2020-02-08 00:29:11 +01:00
Andy Bitz
1dfa286af5 Publish Canary
- now@17.0.3-canary.0
2020-02-07 21:14:50 +01:00
Andy
d4391bd4cc [now-cli] Fix chalk template for legacy (#3768)
* [now-cli] Fix chalk template for legacy

* Update packages/now-cli/src/commands/deploy/legacy.ts

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

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-02-07 21:14:11 +01:00
luc
53eb71f26d Publish Stable
- now@17.0.2
 - @now/routing-utils@1.5.3
2020-02-06 19:18:35 +01:00
luc
92ffd654b5 Publish Canary
- now@17.0.2-canary.1
2020-02-06 18:53:36 +01:00
Luc
36b83f1606 [now-cli] Use npx or yarn to execute dev command (#3760)
1. Use bundled yarn to run `yarn bin`
2. Skip `yarn bin` if `npx` is used
2020-02-06 17:47:39 +00:00
Steven
7a79f620c0 [tests] Fix changelog script (#3751)
Previously, the changelog script was looking for the last "Publish Stable" commit, but it should really be looking for the last Stable release of Now CLI.

This PR updates the changelog script so that it fetches the latest GH Release (which should be Now CLI) and then compares that to the HEAD.
2020-02-06 14:35:15 +00:00
Steven
f3b286ecf3 Publish Canary
- now@17.0.2-canary.0
 - @now/routing-utils@1.5.3-canary.0
2020-02-06 09:12:19 -05:00
Steven
adf31c3fcc [now-routing-utils] Change behavior of trailingSlash: true redirects (#3745)
This PR changes the behavior of `trailingSlash: true` after we received feedback that files should not be redirected with a trailing slash. This matches the behavior of `serve` and `serve-handler`.

### Examples 
* `/index.html` => serve
* `/assets/style.css` => serve
* `/assets` => redirect to `/assets/`
* `/assets/style` => redirect to `/assets/style/` 

### Additional

In order to avoid duplicate content, this PR also adds redirects to files without a trailing slash.

* `/about.html/` => redirect to `/about.html`
* `/assets/style.css/` => redirect to `/assets/style.css`


Fixes #3731
2020-02-06 09:07:46 -05:00
luc
deacdfc47c Publish Stable
- now@17.0.1
2020-02-06 01:07:15 +01:00
Luc
ac9badbe9e [now-cli] Always output deployment url in stdout (#3753) 2020-02-06 00:58:24 +01:00
luc
62beb0f78d Publish Stable
- @now/frameworks@0.0.9
 - @now/build-utils@1.3.9
 - @now/cgi@1.0.3
 - now@17.0.0
 - now-client@7.0.0
 - @now/go@1.0.3
 - @now/next@2.3.13
 - @now/node@1.4.1
 - @now/python@1.1.3
 - @now/routing-utils@1.5.2
 - @now/ruby@1.0.2
 - @now/static-build@0.14.12
2020-02-05 23:03:23 +01:00
luc
5f9777f4af Publish Canary
- now@17.0.0-canary.35
2020-02-05 22:38:39 +01:00
Luc
e00db4437a [now-cli] Use npx when available to run dev command (#3749)
* use npx when available

* add --no-install

* replace $PORT and %PORT% in devCommand

* remove PORT from env variables

* replace more than one $PORT or %PORT%

* fix regex
2020-02-05 22:37:06 +01:00
1353 changed files with 56922 additions and 19368 deletions

7
.gitattributes vendored
View File

@@ -1,3 +1,10 @@
# 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.
*.go text eol=lf
go.mod text eol=lf

1
.github/CODEOWNERS vendored
View File

@@ -8,6 +8,7 @@
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/env @styfle @lucleray
/packages/now-client @leo @rdev
/packages/now-build-utils @styfle @AndyBitz
/packages/now-node @styfle @tootallnate @lucleray

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

@@ -1,6 +1,6 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [GitHub Issue](https://github.com/zeit/now/issues/new) or [Spectrum](https://spectrum.chat/zeit) with the owners of this repository before submitting a Pull Request.
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/zeit/now/discussions/new) with the owners of this repository before submitting a Pull Request.
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
@@ -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,18 +92,14 @@ 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
You can add support for a new framework by creating a Pull Request for this repository by following the steps below.
You can add support for a new Framework by creating a Pull Request for this repository and following the steps below:
1. Add the framework to the `@now/frameworks` package.
The file is located in `packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the output directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
2. Add an example to the `examples/` directory.
The name of the directory should equal the slug of the framework used in `@now/frameworks`.
The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a README for the example.
3. Update the `@now/static-build` package
The files `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 PR has been merged and released other users can use `now init` to get the example and deploy it to ZEIT Now.
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 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/new/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

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://vercel.com/support/request
about: Report a bug using the Vercel support form
- name: Feature Request
url: https://github.com/zeit/now/discussions/new
about: Request a feature to be added to the platform
- name: Ask a Question
url: https://github.com/zeit/now/discussions/new
about: Ask questions and discuss with other community members

View File

@@ -1,17 +1,18 @@
name: Cancel
on:
push:
branches:
- '*'
branches:
- '**'
- '!master'
jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@master
- uses: styfle/cancel-workflow-action@0.3.1
with:
workflow_id: 435869
workflow_id: 849295, 849296, 849297, 849298
access_token: ${{ secrets.GITHUB_WORKFLOW_TOKEN }}

View File

@@ -1,101 +0,0 @@
name: CI
on:
push:
branches:
- master
tags:
- '!*'
pull_request:
jobs:
test-unit:
name: Unit Tests
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- uses: actions/setup-node@v1
- run: yarn install && yarn run build
- run: yarn run test-lint
- run: yarn run test-unit --clean false
- name: Upload Artifact
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run once
uses: actions/upload-artifact@v1
with:
name: test-unit-output
path: packages/now-cli/.nyc_output
test-integration:
name: Integration Tests
timeout-minutes: 120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- run: yarn install && yarn run build
- run: yarn test-integration-once --clean false
test-now-cli:
name: Now CLI Tests
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- 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 && yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration --clean false
test-now-dev:
name: "`now dev` Tests"
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- 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 && yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration-now-dev --clean false
coverage:
name: Coverage
timeout-minutes: 10
needs: [test-unit, test-now-cli, test-now-dev, test-integration]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- uses: actions/download-artifact@v1
with:
name: test-unit-output
path: packages/now-cli/.nyc_output
- run: yarn install
- run: yarn workspace now run coverage

View File

@@ -20,7 +20,12 @@ jobs:
run: yarn install --check-files --frozen-lockfile
- name: Build
run: yarn build
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Publish
run: yarn publish-from-github
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

View File

@@ -0,0 +1,33 @@
name: CLI
on:
push:
branches:
- master
tags:
- '!*'
pull_request:
jobs:
test:
name: CLI
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- run: yarn install
- run: yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration-cli --clean false
env:
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}

View File

@@ -0,0 +1,36 @@
name: Dev
on:
push:
branches:
- master
tags:
- '!*'
pull_request:
jobs:
test:
name: Dev
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- name: Install Hugo
if: matrix.os == 'macos-latest'
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
- run: yarn install
- run: yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration-dev --clean false
env:
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}

View File

@@ -0,0 +1,25 @@
name: E2E
on:
push:
branches:
- master
tags:
- '!*'
pull_request:
jobs:
test:
name: E2E
timeout-minutes: 120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- run: yarn install
- run: yarn run build
- run: yarn test-integration-once --clean false
env:
ZEIT_TEAM_TOKEN: ${{ secrets.ZEIT_TEAM_TOKEN }}
ZEIT_REGISTRATION_URL: ${{ secrets.ZEIT_REGISTRATION_URL }}

34
.github/workflows/test-unit.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Unit
on:
push:
branches:
- master
tags:
- '!*'
pull_request:
jobs:
test:
name: Unit
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: git fetch origin master --depth=10
- run: git fetch origin ${{ github.ref }} --depth=10
- uses: actions/setup-node@v1
- run: yarn install
- run: yarn run build
- run: yarn run lint
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run lint once
- run: yarn run test-unit --clean false
- run: yarn workspace vercel run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run coverage once
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

9
.gitignore vendored
View File

@@ -6,21 +6,26 @@ npm-debug.log
yarn-error.log
.nyc_output
coverage
coverage.lcov
*.swp
*.bak
*.tgz
packages/now-cli/.builders
packages/now-cli/assets
packages/now-cli/src/util/dev/templates/*.ts
packages/now-cli/src/util/constants.ts
packages/now-cli/test/**/yarn.lock
!packages/now-cli/test/dev/**/yarn.lock
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,35 +1,27 @@
![now](https://assets.zeit.co/image/upload/v1542240976/repositories/now-cli/now-cli-repo-banner-v3.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 Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
[![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
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command:
```
npm i -g now
```
To quickly start a new project, run the following commands:
```
now init # Pick an example project to clone
cd <PROJECT> # Change directory to the newly created project
now # Deploy to the cloud
```
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 Now CLI, 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?
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Install dependencies with `yarn install`
3. Compile the code: `yarn build`
4. Link the package to the global module directory: `yarn link`
5. You can now start using `now` anywhere inside the command line
4. Link the package to the global module directory: `cd ./packages/now-cli && yarn link`
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

@@ -2,21 +2,25 @@ import { NowRequest, NowResponse } from '@now/node';
import { withApiHandler } from './_lib/util/with-api-handler';
import frameworkList, { Framework } from '../packages/frameworks';
const frameworks: Framework[] = (frameworkList as Framework[]).map(
framework => {
delete framework.detectors;
const frameworks = (frameworkList as Framework[]).map(frameworkItem => {
const framework = {
...frameworkItem,
detectors: undefined,
};
if (framework.logo) {
framework.logo = `https://res.cloudinary.com/zeit-inc/image/fetch/${framework.logo}`;
}
return framework;
if (framework.logo) {
framework.logo = `https://res.cloudinary.com/zeit-inc/image/fetch/${framework.logo}`;
}
);
return framework;
});
export default withApiHandler(async function(
req: NowRequest,
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);
});

8
codecov.yml Normal file
View File

@@ -0,0 +1,8 @@
codecov:
require_ci_to_pass: yes
coverage:
status:
project: off
patch: off

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

22
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
@@ -64,7 +64,7 @@ Contributing to Now Examples should be an enjoyable experience, as such we have
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [ZEIT Spectrum](https://spectrum.chat/zeit) where we will do our best to help you.
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/zeit/now/discussions) where we will do our best to help you.
## Reporting Issues
@@ -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 the [ZEIT Spectrum](https://spectrum.chat/zeit). There you will find both members of the community and staff who are happy to help answer questions on anything ZEIT related.
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/zeit/now/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
[![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/new/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

@@ -1,14 +1,14 @@
![Angular Logo](../../packages/frameworks/logos/angular.svg)
![Angular Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/angular.svg)
# 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/new/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,14 +0,0 @@
# Enforce Unix newlines
*.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.less text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.jpg binary
*.gif binary
*.png binary
*.jpeg binary

View File

@@ -1,47 +0,0 @@
# Numerous always-ignore extensions
.ruby-version
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
# OS or Editor folders
*.esproj
*.sublime-project
*.sublime-workspace
._*
.cache
.DS_Store
.idea
.project
.settings
.tmproj
nbproject
Thumbs.db
# Komodo
*.komodoproject
.komodotools
# grunt-html-validation
validation-status.json
validation-report.json
# Folders to ignore
tmp
temp
TODO.md
vendor
node_modules
bower_components
_gh_pages
_site
_draft
.env
.env.build

View File

@@ -1 +0,0 @@
README.md

View File

@@ -1,30 +0,0 @@
/*
* assemble-examples <https://github.com/assemble/assemble-examples>
*
* Copyright (c) 2014 Jon Schlinkert, Brian Woodward, contributors.
* Licensed under the MIT license.
*/
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
assemble: {
options: {
flatten: true,
partials: ['templates/includes/*.hbs'],
layoutdir: 'templates/layouts',
layout: 'default.hbs',
},
site: {
files: { 'public/index.js': ['templates/*.hbs'] },
},
},
});
// Load the Assemble plugin.
grunt.loadNpmTasks('assemble');
// The default task to run with the `grunt` command.
grunt.registerTask('default', ['assemble']);
};

View File

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

View File

@@ -1,7 +0,0 @@
# Blog post
> This is an example blog post
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

View File

@@ -1,38 +0,0 @@
{
"name": "assemble-example",
"private": true,
"description": "Example Assemble project.",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/assemble-example",
"scripts": {
"build": "grunt assemble"
},
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"repository": {
"type": "git",
"url": "https://github.com/jonschlinkert/assemble-example.git"
},
"bugs": {
"url": "https://github.com/jonschlinkert/assemble-example/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jonschlinkert/assemble-example/blob/master/LICENSE-MIT"
}
],
"main": "index.js",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {},
"devDependencies": {
"assemble": "~0.4.37",
"grunt": "~0.4.3",
"grunt-cli": "^1.3.2"
},
"keywords": []
}

View File

@@ -1,7 +0,0 @@
---
title: About
description: This is the about page.
---
<h2>{{description}}</h2>
{{> button }}

View File

@@ -1,5 +0,0 @@
---
title: Blog
---
{{md 'content/blog-post.md'}}

View File

@@ -1,7 +0,0 @@
---
title: Home
description: This is the home page.
---
<h2>{{description}}</h2>
{{> button }}

View File

@@ -1 +0,0 @@
<a href="https://github.com/assemble/assemble" class="btn btn-default">Star Assemble on GitHub!</a>

View File

@@ -1,4 +0,0 @@
<meta charset="UTF-8">
<title>{{title}}</title>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="http://getbootstrap.com/assets/css/docs.min.css">

View File

@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{> head }}
</head>
<body>
<div class="container">
{{> body }}
</div>
</body>
</html>

View File

@@ -1,35 +0,0 @@
module.exports = api => {
api.cache.using(() => {
// cache based on the two env vars
return (
'babel:' +
process.env.BABEL_TARGET +
' protractor:' +
process.env.IN_PROTRACTOR
);
});
return {
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
],
presets: [
[
'@babel/preset-env',
{
targets:
process.env.BABEL_TARGET === 'node'
? {
node: process.env.IN_PROTRACTOR ? '6' : 'current',
}
: {
browsers: ['last 2 versions'],
},
loose: true,
modules: process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
},
],
],
};
};

View File

@@ -1,12 +0,0 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
indent_style = space
indent_size = 2

View File

@@ -1,41 +0,0 @@
# You may want to customise this file depending on your Operating System
# and the editor that you use.
#
# We recommend that you use a Global Gitignore for files that are not related
# to the project. (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore)
# OS
#
# Ref: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
.DS_STORE
Thumbs.db
# Editors
#
# Ref: https://github.com/github/gitignore/blob/master/Global
# Ref: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Ref: https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# Dependencies
node_modules
# Compiled files
/scripts
/src/environment.js
/src/environment.ts
/dist
/test/coverage-jest
/test/coverage-karma
# Environment Variables
.env
.env.build

View File

@@ -1,2 +0,0 @@
README.md
yarn.lock

View File

@@ -1,27 +0,0 @@
# Aurelia Example
This directory is a brief example of an [Aurelia](https://aurelia.io/) app that can be deployed with ZEIT Now and zero configuration.
## Deploy Your Own
Deploy your own Aurelia project with ZEIT Now.
[![Deploy with ZEIT Now](https://zeit.co/button)](https://zeit.co/new/project?template=https://github.com/zeit/now/tree/master/examples/aurelia)
_Live Example: https://aurelia.now-examples.now.sh_
### How We Created This Example
To get started deploying Aurelia with ZEIT Now, you can use the [Aurelia CLI](https://aurelia.io/docs/cli/basics/) to initialize the project:
```shell
$ au new
```
### Deploying From Your Terminal
You can deploy your new Aurelia project with a single command from your terminal using [Now CLI](https://zeit.co/download):
```shell
$ now
```

View File

@@ -1,30 +0,0 @@
{
"name": "aurelia",
"type": "project:application",
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors"
},
"transpiler": {
"id": "babel",
"fileExtension": ".js"
},
"build": {
"options": {
"server": "dev",
"extractCss": "prod",
"coverage": false
}
},
"platform": {
"hmr": false,
"open": false,
"port": 8080,
"output": "public"
},
"packageManager": "yarn"
}

View File

@@ -1,4 +0,0 @@
export default {
debug: true,
testing: true,
};

View File

@@ -1,4 +0,0 @@
export default {
debug: false,
testing: false,
};

View File

@@ -1,4 +0,0 @@
export default {
debug: true,
testing: false,
};

View File

@@ -1,44 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class AttributeGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the custom attribute?'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.attributes.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateSource(className) {
return `import {inject} from 'aurelia-framework';
@inject(Element)
export class ${className}CustomAttribute {
constructor(element) {
this.element = element;
}
valueChanged(newValue, oldValue) {
//
}
}
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "attribute",
"description": "Creates a custom attribute class and places it in the project resources."
}

View File

@@ -1,41 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class BindingBehaviorGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the binding behavior?'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.bindingBehaviors.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateSource(className) {
return `export class ${className}BindingBehavior {
bind(binding, source) {
//
}
unbind(binding, source) {
//
}
}
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "binding-behavior",
"description": "Creates a binding behavior class and places it in the project resources."
}

View File

@@ -1,64 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
var path = require('path');
@inject(Project, CLIOptions, UI)
export default class ElementGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the component?'
);
const subFolders = await this.ui.ensureAnswer(
this.options.args[1],
"What sub-folder would you like to add it to?\nIf it doesn't exist it will be created for you.\n\nDefault folder is the source folder (src).",
'.'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.root.add(
ProjectItem.text(
path.join(subFolders, fileName + '.js'),
this.generateJSSource(className)
),
ProjectItem.text(
path.join(subFolders, fileName + '.html'),
this.generateHTMLSource(className)
)
);
await this.project.commitChanges();
await this.ui.log(
`Created ${name} in the '${path.join(
this.project.root.name,
subFolders
)}' folder`
);
}
generateJSSource(className) {
return `export class ${className} {
constructor() {
this.message = 'Hello world';
}
}
`;
}
generateHTMLSource(className) {
return `<template>
<h1>\${message}</h1>
</template>
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "component",
"description": "Creates a custom component class and template (view model and view), placing them in the project source folder (or optionally in sub folders)."
}

View File

@@ -1,49 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class ElementGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the custom element?'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.elements.add(
ProjectItem.text(`${fileName}.js`, this.generateJSSource(className)),
ProjectItem.text(`${fileName}.html`, this.generateHTMLSource(className))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateJSSource(className) {
return `import {bindable} from 'aurelia-framework';
export class ${className} {
@bindable value;
valueChanged(newValue, oldValue) {
//
}
}
`;
}
generateHTMLSource(className) {
return `<template>
<h1>\${value}</h1>
</template>
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "element",
"description": "Creates a custom element class and template, placing them in the project resources."
}

View File

@@ -1,72 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class GeneratorGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the generator?'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.generators.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateSource(className) {
return `import {inject} from 'aurelia-dependency-injection';
import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class ${className}Generator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
execute() {
return this.ui
.ensureAnswer(this.options.args[0], 'What would you like to call the new item?')
.then(name => {
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.elements.add(
ProjectItem.text(\`\${fileName}.js\`, this.generateSource(className))
);
return this.project.commitChanges()
.then(() => this.ui.log(\`Created \${fileName}.\`));
});
}
generateSource(className) {
return \`import {bindable} from 'aurelia-framework';
export class \${className} {
@bindable value;
valueChanged(newValue, oldValue) {
//
}
}
\`
}
}
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "generator",
"description": "Creates a generator class and places it in the project generators folder."
}

View File

@@ -1,39 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class TaskGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the task?'
);
let fileName = this.project.makeFileName(name);
let functionName = this.project.makeFunctionName(name);
this.project.tasks.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(functionName))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateSource(functionName) {
return `import gulp from 'gulp';
import project from '../aurelia.json';
export default function ${functionName}() {
return gulp.src(project.paths.???)
.pipe(gulp.dest(project.paths.output));
}
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "task",
"description": "Creates a task and places it in the project tasks folder."
}

View File

@@ -1,41 +0,0 @@
import { inject } from 'aurelia-dependency-injection';
import { Project, ProjectItem, CLIOptions, UI } from 'aurelia-cli';
@inject(Project, CLIOptions, UI)
export default class ValueConverterGenerator {
constructor(project, options, ui) {
this.project = project;
this.options = options;
this.ui = ui;
}
async execute() {
const name = await this.ui.ensureAnswer(
this.options.args[0],
'What would you like to call the value converter?'
);
let fileName = this.project.makeFileName(name);
let className = this.project.makeClassName(name);
this.project.valueConverters.add(
ProjectItem.text(`${fileName}.js`, this.generateSource(className))
);
await this.project.commitChanges();
await this.ui.log(`Created ${fileName}.`);
}
generateSource(className) {
return `export class ${className}ValueConverter {
toView(value) {
//
}
fromView(value) {
//
}
}
`;
}
}

View File

@@ -1,4 +0,0 @@
{
"name": "value-converter",
"description": "Creates a value converter class and places it in the project resources."
}

View File

@@ -1,56 +0,0 @@
import webpackConfig from '../../webpack.config';
import webpack from 'webpack';
import project from '../aurelia.json';
import gulp from 'gulp';
import del from 'del';
import { CLIOptions, Configuration } from 'aurelia-cli';
import configureEnvironment from './environment';
const analyze = CLIOptions.hasFlag('analyze');
const buildOptions = new Configuration(project.build.options);
const production = CLIOptions.getEnvironment() === 'prod';
const server = buildOptions.isApplicable('server');
const extractCss = buildOptions.isApplicable('extractCss');
const coverage = buildOptions.isApplicable('coverage');
const config = webpackConfig({
production,
server,
extractCss,
coverage,
analyze,
});
const compiler = webpack(config);
function buildWebpack(done) {
if (CLIOptions.hasFlag('watch')) {
compiler.watch({}, onBuild);
} else {
compiler.run(onBuild);
compiler.hooks.done.tap('done', () => done());
}
}
function onBuild(err, stats) {
if (!CLIOptions.hasFlag('watch') && err) {
console.error(err.stack || err);
if (err.details) console.error(err.details);
process.exit(1);
} else {
process.stdout.write(
stats.toString({ colors: require('supports-color') }) + '\n'
);
if (!CLIOptions.hasFlag('watch') && stats.hasErrors()) {
process.exit(1);
}
}
}
function clearDist() {
return del([config.output.path]);
}
const build = gulp.series(clearDist, configureEnvironment, buildWebpack);
export { config, buildWebpack, build as default };

View File

@@ -1,21 +0,0 @@
{
"name": "build",
"description": "Builds and processes all application assets.",
"flags": [
{
"name": "analyze",
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
"type": "boolean"
},
{
"name": "env",
"description": "Sets the build environment.",
"type": "string"
},
{
"name": "watch",
"description": "Watches source files for changes and refreshes the bundles automatically.",
"type": "boolean"
}
]
}

View File

@@ -1,38 +0,0 @@
import project from '../aurelia.json';
import rename from 'gulp-rename';
import gulp from 'gulp';
import fs from 'fs';
import through from 'through2';
import { CLIOptions } from 'aurelia-cli';
function configureEnvironment() {
let env = CLIOptions.getEnvironment();
return gulp
.src(
`aurelia_project/environments/${env}${project.transpiler.fileExtension}`
)
.pipe(rename(`environment${project.transpiler.fileExtension}`))
.pipe(
through.obj(function(file, _, cb) {
// https://github.com/aurelia/cli/issues/1031
fs.unlink(`${project.paths.root}/${file.relative}`, function() {
cb(null, file);
});
})
)
.pipe(gulp.dest(project.paths.root))
.pipe(
through.obj(function(file, enc, cb) {
// https://github.com/webpack/watchpack/issues/25#issuecomment-287789288
const now = Date.now() / 1000;
const then = now - 10;
fs.utimes(file.path, then, then, function(err) {
if (err) throw err;
});
cb(null, file);
})
);
}
export default configureEnvironment;

View File

@@ -1 +0,0 @@
export { default } from './test';

View File

@@ -1,11 +0,0 @@
{
"name": "jest",
"description": "Runs Jest and reports the results.",
"flags": [
{
"name": "watch",
"description": "Watches test files for changes and re-runs the tests automatically.",
"type": "boolean"
}
]
}

View File

@@ -1,54 +0,0 @@
import webpack from 'webpack';
import Server from 'webpack-dev-server';
import project from '../aurelia.json';
import gulp from 'gulp';
import { config } from './build';
import configureEnvironment from './environment';
import { CLIOptions, reportWebpackReadiness } from 'aurelia-cli';
function runWebpack(done) {
// https://webpack.github.io/docs/webpack-dev-server.html
let opts = {
host: 'localhost',
publicPath: config.output.publicPath,
filename: config.output.filename,
hot: project.platform.hmr || CLIOptions.hasFlag('hmr'),
port: CLIOptions.getFlagValue('port') || project.platform.port,
contentBase: config.output.path,
historyApiFallback: true,
open: project.platform.open || CLIOptions.hasFlag('open'),
stats: {
colors: require('supports-color'),
},
...config.devServer,
};
// Add the webpack-dev-server client to the webpack entry point
// The path for the client to use such as `webpack-dev-server/client?http://${opts.host}:${opts.port}/` is not required
// The path used is derived from window.location in the browser and output.publicPath in the webpack.config.
if (project.platform.hmr || CLIOptions.hasFlag('hmr')) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.entry.app.unshift(
'webpack-dev-server/client',
'webpack/hot/dev-server'
);
} else {
// removed "<script src="/webpack-dev-server.js"></script>" from index.ejs in favour of this method
config.entry.app.unshift('webpack-dev-server/client');
}
const compiler = webpack(config);
let server = new Server(compiler, opts);
server.listen(opts.port, opts.host, function(err) {
if (err) throw err;
reportWebpackReadiness(opts);
done();
});
}
const run = gulp.series(configureEnvironment, runWebpack);
export { run as default };

View File

@@ -1,31 +0,0 @@
{
"name": "run",
"description": "Builds the application and serves up the assets via a local web server, watching files for changes as you work.",
"flags": [
{
"name": "analyze",
"description": "Enable Webpack Bundle Analyzer. Typically paired with --env prod",
"type": "boolean"
},
{
"name": "env",
"description": "Sets the build environment.",
"type": "string"
},
{
"name": "hmr",
"description": "Enable Hot Module Reload",
"type": "boolean"
},
{
"name": "port",
"description": "Set port number of the dev server",
"type": "string"
},
{
"name": "open",
"description": "Open the default browser at the application location.",
"type": "boolean"
}
]
}

View File

@@ -1,25 +0,0 @@
import jest from 'jest-cli';
import path from 'path';
import packageJson from '../../package.json';
import { CLIOptions } from 'aurelia-cli';
export default cb => {
let options = packageJson.jest;
if (CLIOptions.hasFlag('watch')) {
Object.assign(options, { watchAll: true });
}
process.env.BABEL_TARGET = 'node';
jest
.runCLI(options, [path.resolve(__dirname, '../../')])
.then(({ results }) => {
if (results.numFailedTests || results.numFailedTestSuites) {
cb('Tests Failed');
} else {
cb();
}
});
};

View File

@@ -1,11 +0,0 @@
{
"name": "test",
"description": "Runs Jest and reports the results.",
"flags": [
{
"name": "watch",
"description": "Watches test files for changes and re-runs the tests automatically.",
"type": "boolean"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,12 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%- htmlWebpackPlugin.options.metadata.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="<%- htmlWebpackPlugin.options.metadata.baseUrl %>">
<!-- imported CSS are concatenated and added automatically -->
</head>
<body aurelia-app="main">
</body>
</html>

View File

@@ -1,8 +0,0 @@
{
"compilerOptions": {
"target": "es2015",
"lib": ["es2017", "dom"],
"experimentalDecorators": true
},
"exclude": ["node_modules", "dist"]
}

View File

@@ -1,104 +0,0 @@
{
"name": "aurelia",
"description": "An Aurelia client application.",
"version": "0.1.0",
"repository": {
"type": "???",
"url": "???"
},
"license": "MIT",
"dependencies": {
"aurelia-bootstrapper": "^2.3.2",
"aurelia-animator-css": "^1.0.4"
},
"devDependencies": {
"aurelia-cli": "^1.0.2",
"aurelia-testing": "^1.0.0",
"aurelia-tools": "^2.0.0",
"gulp": "^4.0.0",
"minimatch": "^3.0.4",
"through2": "^3.0.0",
"vinyl-fs": "^3.0.3",
"promise-polyfill": "^8.1.0",
"regenerator-runtime": "0.13.2",
"babel-eslint": "^10.0.1",
"eslint": "latest",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.1.1",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/core": "^7.4.0",
"@babel/register": "^7.4.0",
"gulp-rename": "^1.4.0",
"html-webpack-plugin": "^3.2.0",
"copy-webpack-plugin": "^5.0.0",
"mini-css-extract-plugin": "^0.4.3",
"aurelia-webpack-plugin": "^3.0.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"webpack": "^4.27.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9",
"expose-loader": "^0.7.5",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"del": "^3.0.0",
"css-loader": "^1.0.0",
"file-loader": "^2.0.0",
"json-loader": "^0.5.7",
"html-loader": "^0.5.5",
"istanbul-instrumenter-loader": "^3.0.1",
"webpack-bundle-analyzer": "^3.0.4",
"jest": "^24.1.0",
"jest-cli": "^24.1.0",
"jest-transform-stub": "^2.0.0",
"aurelia-loader-nodejs": "^1.0.1",
"aurelia-pal-nodejs": "^1.2.0",
"babel-jest": "^24.5.0"
},
"scripts": {
"build": "au build",
"start": "au run",
"dev": "au run --port $PORT",
"test": "au test"
},
"engines": {
"node": ">=8.9.0"
},
"jest": {
"moduleNameMapper": {
"^aurelia-binding$": "<rootDir>/node_modules/aurelia-binding"
},
"modulePaths": [
"<rootDir>/src",
"<rootDir>/node_modules"
],
"moduleFileExtensions": [
"js",
"json"
],
"transform": {
"^.+\\.(css|less|sass|scss|styl|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "jest-transform-stub",
"^.+\\.js$": "babel-jest"
},
"testRegex": "\\.spec\\.js$",
"setupFiles": [
"<rootDir>/test/jest-pretest.js"
],
"testEnvironment": "node",
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.js",
"!**/*.spec.js",
"!**/node_modules/**",
"!**/test/**"
],
"coverageDirectory": "<rootDir>/test/coverage-jest",
"coverageReporters": [
"json",
"lcov",
"text",
"html"
]
}
}

View File

@@ -1,3 +0,0 @@
<template>
<h1>${message}</h1>
</template>

View File

@@ -1,3 +0,0 @@
export class App {
message = 'Hello World!';
}

View File

@@ -1,19 +0,0 @@
// regenerator-runtime is to support async/await syntax in ESNext.
// If you don't use async/await, you can remove regenerator-runtime.
import 'regenerator-runtime/runtime';
import environment from './environment';
import { PLATFORM } from 'aurelia-pal';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources/index'));
aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');
if (environment.testing) {
aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));
}
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}

View File

@@ -1,3 +0,0 @@
export function configure(config) {
//config.globalResources([]);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,6 +0,0 @@
import 'aurelia-polyfills';
import { Options } from 'aurelia-loader-nodejs';
import { globalize } from 'aurelia-pal-nodejs';
import path from 'path';
Options.relativeToDir = path.join(__dirname, 'unit');
globalize();

View File

@@ -1,5 +0,0 @@
{
"rules": {
"no-var": 0
}
}

View File

@@ -1,29 +0,0 @@
import { bootstrap } from 'aurelia-bootstrapper';
import { StageComponent } from 'aurelia-testing';
import { PLATFORM } from 'aurelia-pal';
describe('Stage App Component', () => {
let component;
beforeEach(() => {
component = StageComponent.withResources(PLATFORM.moduleName('app')).inView(
'<app></app>'
);
});
afterEach(() => component.dispose());
it('should render message', done => {
component
.create(bootstrap)
.then(() => {
const view = component.element;
expect(view.textContent.trim()).toBe('Hello World!');
done();
})
.catch(e => {
fail(e);
done();
});
});
});

View File

@@ -1,224 +0,0 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
const project = require('./aurelia_project/aurelia.json');
const {
AureliaPlugin,
ModuleDependenciesPlugin,
} = require('aurelia-webpack-plugin');
const { ProvidePlugin } = require('webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
// config helpers:
const ensureArray = config =>
(config && (Array.isArray(config) ? config : [config])) || [];
const when = (condition, config, negativeConfig) =>
condition ? ensureArray(config) : ensureArray(negativeConfig);
// primary config:
const title = 'Aurelia Navigation Skeleton';
const outDir = path.resolve(__dirname, project.platform.output);
const srcDir = path.resolve(__dirname, 'src');
const testDir = path.resolve(__dirname, 'test', 'unit');
const nodeModulesDir = path.resolve(__dirname, 'node_modules');
const baseUrl = '/';
const cssRules = [{ loader: 'css-loader' }];
module.exports = ({
production,
server,
extractCss,
coverage,
analyze,
karma,
} = {}) => ({
resolve: {
extensions: ['.js'],
modules: [srcDir, 'node_modules'],
// Enforce single aurelia-binding, to avoid v1/v2 duplication due to
// out-of-date dependencies on 3rd party aurelia plugins
alias: {
'aurelia-binding': path.resolve(
__dirname,
'node_modules/aurelia-binding'
),
},
},
entry: {
app: ['aurelia-bootstrapper'],
},
mode: production ? 'production' : 'development',
output: {
path: outDir,
publicPath: baseUrl,
filename: production
? '[name].[chunkhash].bundle.js'
: '[name].[hash].bundle.js',
sourceMapFilename: production
? '[name].[chunkhash].bundle.map'
: '[name].[hash].bundle.map',
chunkFilename: production
? '[name].[chunkhash].chunk.js'
: '[name].[hash].chunk.js',
},
optimization: {
runtimeChunk: true, // separates the runtime chunk, required for long term cacheability
// moduleIds is the replacement for HashedModuleIdsPlugin and NamedModulesPlugin deprecated in https://github.com/webpack/webpack/releases/tag/v4.16.0
// changes module id's to use hashes be based on the relative path of the module, required for long term cacheability
moduleIds: 'hashed',
// Use splitChunks to breakdown the App/Aurelia bundle down into smaller chunks
// https://webpack.js.org/plugins/split-chunks-plugin/
splitChunks: {
hidePathInfo: true, // prevents the path from being used in the filename when using maxSize
chunks: 'initial',
// sizes are compared against source before minification
maxSize: 200000, // splits chunks if bigger than 200k, adjust as required (maxSize added in webpack v4.15)
cacheGroups: {
default: false, // Disable the built-in groups default & vendors (vendors is redefined below)
// You can insert additional cacheGroup entries here if you want to split out specific modules
// This is required in order to split out vendor css from the app css when using --extractCss
// For example to separate font-awesome and bootstrap:
// fontawesome: { // separates font-awesome css from the app css (font-awesome is only css/fonts)
// name: 'vendor.font-awesome',
// test: /[\\/]node_modules[\\/]font-awesome[\\/]/,
// priority: 100,
// enforce: true
// },
// bootstrap: { // separates bootstrap js from vendors and also bootstrap css from app css
// name: 'vendor.font-awesome',
// test: /[\\/]node_modules[\\/]bootstrap[\\/]/,
// priority: 90,
// enforce: true
// },
// This is the HTTP/1.1 optimised cacheGroup configuration
vendors: {
// picks up everything from node_modules as long as the sum of node modules is larger than minSize
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
priority: 19,
enforce: true, // causes maxInitialRequests to be ignored, minSize still respected if specified in cacheGroup
minSize: 30000, // use the default minSize
},
vendorsAsync: {
// vendors async chunk, remaining asynchronously used node modules as single chunk file
test: /[\\/]node_modules[\\/]/,
name: 'vendors.async',
chunks: 'async',
priority: 9,
reuseExistingChunk: true,
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
},
commonsAsync: {
// commons async chunk, remaining asynchronously used modules as single chunk file
name: 'commons.async',
minChunks: 2, // Minimum number of chunks that must share a module before splitting
chunks: 'async',
priority: 0,
reuseExistingChunk: true,
minSize: 10000, // use smaller minSize to avoid too much potential bundle bloat due to module duplication.
},
},
},
},
performance: { hints: false },
devServer: {
contentBase: outDir,
// serve index.html for all 404 (required for push-state)
historyApiFallback: true,
},
devtool: production ? 'nosources-source-map' : 'cheap-module-eval-source-map',
module: {
rules: [
// CSS required in JS/TS files should use the style-loader that auto-injects it into the website
// only when the issuer is a .js/.ts file, so the loaders are not applied inside html templates
{
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: extractCss
? [
{
loader: MiniCssExtractPlugin.loader,
},
'css-loader',
]
: ['style-loader', ...cssRules],
},
{
test: /\.css$/i,
issuer: [{ test: /\.html$/i }],
// CSS required in templates cannot be extracted safely
// because Aurelia would try to require it again in runtime
use: cssRules,
},
{ test: /\.html$/i, loader: 'html-loader' },
{
test: /\.js$/i,
loader: 'babel-loader',
exclude: nodeModulesDir,
options: coverage ? { sourceMap: 'inline', plugins: ['istanbul'] } : {},
},
// embed small images and fonts as Data Urls and larger ones as files:
{
test: /\.(png|gif|jpg|cur)$/i,
loader: 'url-loader',
options: { limit: 8192 },
},
{
test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'url-loader',
options: { limit: 10000, mimetype: 'application/font-woff2' },
},
{
test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'url-loader',
options: { limit: 10000, mimetype: 'application/font-woff' },
},
// load these fonts normally, as files:
{
test: /\.(ttf|eot|svg|otf)(\?v=[0-9]\.[0-9]\.[0-9])?$/i,
loader: 'file-loader',
},
],
},
plugins: [
...when(!karma, new DuplicatePackageCheckerPlugin()),
new AureliaPlugin(),
new ProvidePlugin({
Promise: ['promise-polyfill', 'default'],
}),
new ModuleDependenciesPlugin({
'aurelia-testing': ['./compile-spy', './view-spy'],
}),
new HtmlWebpackPlugin({
template: 'index.ejs',
metadata: {
// available in index.ejs //
title,
server,
baseUrl,
},
}),
// ref: https://webpack.js.org/plugins/mini-css-extract-plugin/
...when(
extractCss,
new MiniCssExtractPlugin({
// updated to match the naming conventions for the js files
filename: production
? 'css/[name].[contenthash].bundle.css'
: 'css/[name].[hash].bundle.css',
chunkFilename: production
? 'css/[name].[contenthash].chunk.css'
: 'css/[name].[hash].chunk.css',
})
),
...when(
production || server,
new CopyWebpackPlugin([{ from: 'static', to: outDir, ignore: ['.*'] }])
), // ignore dot (hidden) files
...when(analyze, new BundleAnalyzerPlugin()),
],
});

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/new/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

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="256px" height="256px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<rect x="65" y="68" fill="#7C7C7C" width="127" height="124"/>
<rect x="83.392" y="22.163" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 266.9294 23.9747)" fill="#86AD8A" width="90.215" height="90.215"/>
<path fill="#FFFFFF" d="M117.601,167.637c3.788-11.191,5.795-45.647,4.728-62.795c-0.128-2.057-0.333-4.445-0.692-6.351
c-0.112-0.607-0.244-1.168-0.391-1.651c0-6.672,0-62.892,0-67.02c0-5.717,5.242-8.419,10.166,4.128
c4.925,12.547,3.495,57.175,3.495,60.348c0,0.673-0.611,1.469-1.57,2.25c-0.383,0.247-0.73,0.499-1.051,0.754
c-2.949,2.366-3.379,5.095-3.533,7.542c-1.067,17.148-1.554,51.604,2.234,62.795c4.438,13.112-4.004,14.759-6.691,14.759
C121.605,182.395,113.163,180.748,117.601,167.637z"/>
<path fill="#FFFFFF" d="M103.019,47.413c-0.472,0.049-1.062,9.387-1.257,16.131c-0.238,8.194-0.607,15.482-2.908,15.482
c-1.728,0-2.8-2.853-2.517-10.094c0.407-10.427,0.395-21.519-0.219-21.519c-0.774,0-4.358,22.999-4.358,31.09
c0,5.803,2.487,11.269,5.603,14.115c0.01,0.008,0.019,0.019,0.033,0.027c0.093,0.081,0.191,0.166,0.278,0.247
c0.005,0.004,0.01,0.004,0.01,0.008c2.252,2.053,2.819,4.283,2.971,6.32c1.286,17.143-1.128,59.614-5.678,70.804
c-5.33,13.108,4.811,14.759,8.042,14.759c3.227,0,13.368-1.651,8.037-14.759c-4.55-11.191-6.96-53.661-5.678-70.804
c0.153-2.037,0.719-4.267,2.971-6.32c0-0.004,0.005-0.004,0.01-0.008c0.088-0.081,0.185-0.166,0.278-0.247
c0.014-0.008,0.023-0.019,0.033-0.027c3.116-2.845,5.764-8.314,5.604-14.115c-0.635-23.017-3.263-31.09-4.037-31.09
c-0.614,0-0.613,12.286-0.438,21.024c0.143,7.158-0.471,10.383-2.49,10.383c-1.923,0-2.504-6.972-2.748-15.368
c-0.196-6.762-0.804-16.039-1.54-16.039"/>
<path fill="#FFFFFF" d="M154.075,179.591c-2.546,0-10.532-1.562-6.332-13.967c3.585-10.59,5.483-50.779,4.474-67.007
c-0.051-0.826-0.256-1.664-0.413-2.55c-0.443-2.504-3.543-4.555-5.338-6.356c-3.486-3.498-5.725-9.38-5.725-16.013
c0-10.77,5.97-24.4,13.334-24.4c7.364,0,13.334,13.63,13.334,24.4c0,6.633-2.24,12.515-5.725,16.013
c-1.795,1.801-4.895,3.852-5.338,6.356c-0.157,0.886-0.361,1.724-0.413,2.55c-1.01,16.227,0.889,56.416,4.474,67.007
C164.607,178.03,156.621,179.591,154.075,179.591z"/>
<polyline fill="#CECCAE" points="65,68 65,192 192,192 "/>
<polygon fill="#3F894A" points="65,191.835 65,253 192,253 192,191.835 192,66.938 "/>
<g>
<g>
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="191.658" y1="82.55" x2="190.946" y2="83.253"/>
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" stroke-dasharray="2.02,2.02" x1="189.509" y1="84.672" x2="66.629" y2="206.035"/>
<line fill="none" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" x1="65.91" y1="206.745" x2="65.199" y2="207.448"/>
</g>
</g>
<g>
<path fill="#FFFFFF" d="M85.353,211.117h6.328c0.827,0,1.665,0.067,2.513,0.201c0.848,0.135,1.608,0.414,2.28,0.838
c0.672,0.424,1.22,1.014,1.644,1.768c0.424,0.756,0.636,1.753,0.636,2.994c0,1.116-0.331,2.089-0.993,2.916
c-0.662,0.827-1.644,1.376-2.947,1.645v0.062c0.724,0.062,1.385,0.232,1.985,0.512c0.6,0.279,1.117,0.651,1.551,1.117
c0.434,0.465,0.77,1.019,1.008,1.659c0.238,0.642,0.357,1.345,0.357,2.109c0,1.262-0.243,2.291-0.729,3.087
c-0.486,0.797-1.097,1.422-1.83,1.877c-0.734,0.455-1.531,0.766-2.389,0.931c-0.858,0.166-1.66,0.248-2.404,0.248h-7.011V211.117z
M87.4,220.609h4.25c1.055,0,1.913-0.129,2.575-0.388c0.662-0.259,1.179-0.574,1.551-0.946c0.373-0.372,0.621-0.771,0.745-1.194
s0.186-0.812,0.186-1.163c0-0.765-0.129-1.401-0.388-1.908c-0.259-0.506-0.605-0.909-1.039-1.21
c-0.435-0.299-0.941-0.512-1.52-0.636c-0.579-0.124-1.189-0.186-1.831-0.186H87.4V220.609z M87.4,231.219h4.684
c1.199,0,2.166-0.145,2.9-0.435c0.734-0.289,1.298-0.651,1.691-1.085c0.393-0.435,0.656-0.895,0.791-1.381
c0.134-0.485,0.202-0.926,0.202-1.318c0-0.807-0.155-1.499-0.465-2.078s-0.713-1.05-1.21-1.412c-0.496-0.361-1.06-0.625-1.69-0.791
c-0.631-0.165-1.267-0.248-1.908-0.248H87.4V231.219z"/>
<path fill="#FFFFFF" d="M103.73,222.781c0-0.269-0.011-0.595-0.031-0.978c-0.021-0.383-0.036-0.771-0.046-1.163
c-0.011-0.393-0.026-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.021,0.538,0.036,1.055,0.046,1.551
c0.01,0.497,0.036,0.817,0.078,0.962c0.476-0.848,1.086-1.54,1.83-2.078c0.745-0.538,1.654-0.807,2.73-0.807
c0.186,0,0.367,0.016,0.543,0.047c0.175,0.03,0.357,0.067,0.543,0.108l-0.217,1.83c-0.248-0.082-0.486-0.124-0.713-0.124
c-0.807,0-1.504,0.129-2.094,0.388c-0.589,0.259-1.075,0.615-1.458,1.07s-0.667,0.987-0.853,1.598s-0.279,1.267-0.279,1.97v7.817
h-1.861V222.781z"/>
<path fill="#FFFFFF" d="M126,229.047c0,0.27,0.01,0.595,0.031,0.978c0.021,0.383,0.036,0.771,0.046,1.163
c0.01,0.394,0.026,0.761,0.047,1.102c0.02,0.341,0.031,0.604,0.031,0.791h-1.861c-0.021-0.537-0.036-1.055-0.046-1.551
c-0.011-0.497-0.036-0.817-0.078-0.962h-0.093c-0.373,0.786-0.993,1.463-1.861,2.032c-0.869,0.568-1.882,0.853-3.04,0.853
c-1.117,0-2.032-0.176-2.746-0.527s-1.272-0.812-1.675-1.38c-0.403-0.569-0.678-1.226-0.822-1.971
c-0.145-0.744-0.217-1.509-0.217-2.295v-8.531h1.861v8.438c0,0.58,0.051,1.144,0.155,1.691s0.284,1.039,0.543,1.474
c0.258,0.434,0.621,0.78,1.086,1.039s1.07,0.388,1.815,0.388c0.682,0,1.329-0.119,1.938-0.356c0.61-0.238,1.137-0.6,1.582-1.086
s0.796-1.097,1.055-1.83c0.258-0.734,0.388-1.598,0.388-2.591v-7.166H126V229.047z"/>
<path fill="#FFFFFF" d="M130.584,222.781c0-0.269-0.01-0.595-0.029-0.978c-0.021-0.383-0.037-0.771-0.047-1.163
c-0.012-0.393-0.027-0.76-0.047-1.102c-0.021-0.341-0.031-0.604-0.031-0.791h1.861c0.02,0.538,0.035,1.055,0.047,1.551
c0.01,0.497,0.035,0.817,0.076,0.962h0.094c0.373-0.785,0.992-1.463,1.861-2.032c0.869-0.568,1.883-0.853,3.041-0.853
c1.115,0,2.025,0.176,2.729,0.527s1.258,0.812,1.66,1.381c0.404,0.568,0.684,1.225,0.838,1.97c0.154,0.744,0.232,1.51,0.232,2.295
v8.531h-1.861v-8.438c0-0.579-0.051-1.143-0.154-1.691c-0.104-0.547-0.285-1.039-0.543-1.473c-0.26-0.435-0.621-0.781-1.086-1.04
c-0.465-0.258-1.07-0.388-1.814-0.388c-0.684,0-1.33,0.119-1.939,0.357c-0.609,0.237-1.137,0.6-1.582,1.085
c-0.445,0.486-0.797,1.097-1.055,1.831c-0.26,0.734-0.389,1.598-0.389,2.59v7.166h-1.861V222.781z"/>
<path fill="#FFFFFF" d="M159.28,230.971c-0.703,0.849-1.5,1.474-2.389,1.877c-0.89,0.403-1.852,0.604-2.885,0.604
c-1.097,0-2.11-0.186-3.041-0.559c-0.931-0.372-1.727-0.894-2.389-1.566c-0.662-0.672-1.179-1.468-1.551-2.389
c-0.372-0.92-0.559-1.928-0.559-3.024c0-1.096,0.187-2.104,0.559-3.024s0.889-1.717,1.551-2.389s1.458-1.194,2.389-1.566
c0.931-0.373,1.944-0.559,3.041-0.559c1.055,0,2.031,0.217,2.931,0.651c0.9,0.435,1.701,1.045,2.404,1.83l-1.489,1.117
c-0.537-0.6-1.127-1.07-1.768-1.412c-0.642-0.341-1.334-0.512-2.078-0.512c-0.869,0-1.655,0.155-2.358,0.466
c-0.703,0.31-1.303,0.729-1.799,1.256s-0.874,1.148-1.133,1.861c-0.259,0.714-0.388,1.474-0.388,2.28s0.129,1.566,0.388,2.28
c0.259,0.713,0.637,1.334,1.133,1.861s1.096,0.946,1.799,1.256c0.703,0.311,1.489,0.466,2.358,0.466
c0.785,0,1.504-0.181,2.155-0.543c0.651-0.361,1.215-0.843,1.69-1.442L159.28,230.971z"/>
<path fill="#FFFFFF" d="M161.925,209.628h1.861v11.633h0.062c0.372-0.785,0.992-1.463,1.861-2.032
c0.868-0.568,1.882-0.853,3.04-0.853c1.116,0,2.026,0.176,2.729,0.527s1.257,0.812,1.66,1.381c0.403,0.568,0.683,1.225,0.837,1.97
c0.155,0.744,0.233,1.51,0.233,2.295v8.531h-1.861v-8.438c0-0.579-0.052-1.143-0.155-1.691c-0.104-0.547-0.285-1.039-0.543-1.473
c-0.259-0.435-0.62-0.781-1.086-1.04c-0.465-0.258-1.07-0.388-1.814-0.388c-0.683,0-1.329,0.119-1.939,0.357
c-0.609,0.237-1.137,0.6-1.582,1.085c-0.444,0.486-0.796,1.097-1.055,1.831s-0.388,1.598-0.388,2.59v7.166h-1.861V209.628z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

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