Commit Graph

26 Commits

Author SHA1 Message Date
careworry
0b05981673 chore: fix some typos in comments (#11459)
Signed-off-by: careworry <worrycare@outlook.com>
Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2024-04-18 09:41:03 -05:00
Steven
bada86b8d6 [tests] Add prettier check (#9664)
This PR fixes the formatting on several files that were never run through `prettier`.

It also makes sure to run `prettier` in CI to to [fail fast](https://github.com/vercel/vercel/actions/runs/4408442998/jobs/7723453978) when the incorrect formatting is attempted.
2023-03-13 19:55:59 +00:00
Steven
f1ab5704f1 [cli] Fix example list api to exclude node_modules (#9626)
<img width="219" alt="image"
src="https://user-images.githubusercontent.com/229881/223744886-e4bf430d-078c-49c4-81c3-0c30dce08f2e.png">
2023-03-08 10:04:33 -05:00
Ethan Arrowood
9c768b98b7 [tests] Migrate from yarn to pnpm (#9198)
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> 

yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. 

This PR migrates us to pnpm.
2023-01-11 23:35:13 +00:00
chloetedder
05c5b3a80d [fs-detectors] Add setting placeholders for monorepos (#8688)
### Related Issues

Add in placeholder settings for monorepos

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-10-05 21:34:00 +00:00
Steven
0bafea6d51 [tests] Fix tarball lookup with sha contains 0 (#8552)
This PR fixes an issue when the sha begins with `0` and causes [an error](https://vercel.com/vercel/vercel/EP7fVcXKsoodzWRy3fwG8AoeQcs6) when looking up the tarball:

> Error: ENOENT: no such file or directory, 
> copyfile '/vercel/path0/packages/build-utils/vercel-build-utils-v5.4.2-0251253.tgz' 
>  -> '/vercel/path0/public/tarballs/@vercel/build-utils.tgz'

The fix is to no longer rely on the exact tarball name because we can't guarantee the name from `yarn pack` and instead rely on a pattern for the tarball name.
2022-09-13 18:08:45 +00:00
Steven
23d7eaccab [frameworks] Update framework logos to be file paths (#8546)
This removes the reliance on raw github hosting and instead relies on the Vercel deployment hosting the logo images.

Since we already have static files in each deployment (tarballs), it makes sense to start adding static images too.
2022-09-12 23:07:46 +00:00
Nathan Rajlich
8167233c56 [tests] Create tarballs of all packages in Vercel deployment (#7967)
For the Vercel deployment, run `yarn pack` in each of the packages in the monorepo and place them in the "public/tarballs" directory so that we can have npm-installable URLs of each package for every commit. The `package.json` of each package is also updated to reference the tarball when a package depends on other packages within the monorepo.

Try it out like:

```
$ npm i -g https://vercel-biww73ffq.vercel.sh/tarballs/vercel.tgz

# Notice how the package.json has the monorepo dependencies
# updated to point to the related tarballs from the same deployment:

$ cat /usr/local/lib/node_modules/vercel/package.json | grep biww
    "@vercel/build-utils": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/build-utils.tgz",
    "@vercel/go": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/go.tgz",
    "@vercel/next": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/next.tgz",
    "@vercel/node": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/node.tgz",
    "@vercel/python": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/python.tgz",
    "@vercel/redwood": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/redwood.tgz",
    "@vercel/remix": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/remix.tgz",
    "@vercel/ruby": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/ruby.tgz",
    "@vercel/static-build": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/static-build.tgz",
    "@vercel/client": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/client.tgz",
    "@vercel/frameworks": "https://vercel-biww73ffq.vercel.sh/tarballs/@vercel/frameworks.tgz",

# Also notice that the "version" in `package.json` gets updated to include the commit
# SHA so that we can easily identify which commit a given tarball was generated from:

$ vercel --version
25.1.1-canary.1-727b290
```
2022-06-15 17:44:23 +00:00
Steven
26abb0a85a [api] Update /api/examples/list to be static for vc init (#7596)
Previously, this API would download the entire git repository for each request. Instead, we can defer downloading to the `/download` API only and change the list API to be statically generated at build time.

This will improve the time to render the results from `vc init`.


## Before
- `https://vercel-lu6z5kf4s.vercel.sh/api/examples/list` responds in 6200 ms
- `https://vercel-lu6z5kf4s.vercel.sh/api/examples/list-all` responds in 800ms

## After
- `https://vercel-ctsxcwzgc.vercel.sh/api/examples/list` responds in 60 ms 
- `https://vercel-ctsxcwzgc.vercel.sh/api/examples/list-all` responds in 60 ms
2022-03-22 11:26:19 -04:00
Nathan Rajlich
f1009a80cd [api] Fix GET /api/examples/list output (#6574)
A regression from #6554 caused the return value to contain a nested
object with a `name` property for the `name` key of the response in the
list.
2021-08-09 22:24:17 -07:00
Steven
2756d1e323 [client][frameworks][api] Update readdir() call with withFileTypes (#6554)
Avoids running unnecessary code such as `stat().isDirectory()`.
2021-08-09 14:27:50 -07:00
Steven
f5f07c5d15 [all] Remove more "now" references (#5944)
Follow up to #5928 to remove a few more "now" references and replace with "vercel" where appropriate.
2021-03-08 10:08:09 -05:00
Steven
e5cc1d643a [frameworks][api] Add sort order (#4829)
This PR adds an optional property called `sort` to each framework so that we can change the order returned in the API. 
The reason this is necessary is because the order of the original array determines the precedence of framework detection. So we need another way to indicate the order of templates/examples returned from the API.

In particular, we need "Next.js" to be first and "Other" to be last.

I also updated the deprecated `@now/node` usage to `@vercel/node` in the API.
2020-07-10 18:09:14 +00:00
Steven
56c8af51b2 [all] Rename GitHub repo to vercel/vercel (#4506)
We renamed the GitHub repository from `zeit/now` to `vercel/vercel` so this PR updates all references to the repo URL.

There were also a few remaining references to Now CLI that have been updated to Vercel CLI.
2020-05-28 12:06:42 -04:00
Leo Lamprecht
719d1ffba9 Adjusted old company names (#4507) 2020-05-27 20:54:58 +02: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
Andy
f70ed94c8c [api] Add Sentry (#3597)
* [api] Add Sentry

* Use function name

* Add test error

* Revert "Add test error"

This reverts commit 39cf8a61dad9fcdcb616e418a0deb6ffe9e04ea9.

* Revert "Revert "Add test error""

This reverts commit c718f201da9d80743319ac87e0d4560e718fff53.

* Add logging

* Revert "Add logging"

This reverts commit 39cd46c8bbeef9024e71fe70478068480a51545b.

* Revert "Revert "Revert "Add test error"""

This reverts commit e6f63ee21fabb4ac8fc065b74281dbcdf5811216.

* Ignore .env

* Use init function for Sentry inline
2020-01-15 23:21:03 +01:00
Andy
0b659326d9 [frameworks] Revert rename (#3571)
* Revert "[frameworks] Fix import in test (#3570)"

This reverts commit 9ee86df69d.

* Revert "[frameworks] Rename frameworks to now-frameworks (#3569)"

This reverts commit daa5cbdd4b.
2020-01-10 20:36:17 +01:00
Andy
daa5cbdd4b [frameworks] Rename frameworks to now-frameworks (#3569)
* [frameworks] Rename frameworks to now-frameworks

* Adjust .nowignore
2020-01-10 19:13:27 +01:00
Andy
bcbe0d8060 [examples] Fix subdirectory (#3564) 2020-01-10 17:15:22 +01:00
Andy
4625f66ebd [examples] Adjust readmes and info endpoint (#3542)
* Adjust README links

* Change example info

* Fix id check
2020-01-10 13:37:33 +01:00
Andy
2db627b79d Adds manifest.json to examples folder (#3536)
* Revert "Revert "[examples] Add manifest.json""

This reverts commit c65336e63b.

* Revert "Revert "Do not use now-examples anymore""

This reverts commit ac72e944a7.

* Update nowignore

* Fix join

* Fix JSON

* Fix header

* Replace manifest.json with @now/frameworks

* Adjust readmes

* Adjust .nowignore

* Update scully

* Fix description

* Update examples/create-react-app/src/App.js

Co-Authored-By: Shu Ding <ds303077135@gmail.com>

* Update readme

* Add websites

* Use https

* Adjust example URL

* Change order

Co-authored-by: Shu Ding <ds303077135@gmail.com>
2020-01-10 00:14:51 +01:00
Andy Bitz
c65336e63b Revert "[examples] Add manifest.json"
This reverts commit b7eca1d069.
2020-01-09 17:28:53 +01:00
Andy Bitz
b7eca1d069 [examples] Add manifest.json 2020-01-09 17:24:54 +01:00
Shu Ding
7e584be2cd add back authorization header for github api (#3529) 2020-01-09 22:58:33 +08:00
Andy
890de6a625 Add API for frameworks and examples (#3514)
* Add API for frameworks and examples

* Adjust headers

* Update frameworks list

* Always use latest

* Add types

* Use now repo for downloading and listing

* Use .existsSync

* Remove unused packages

* Use 307 for redirect

* Add examples

* Update tsconfig.json

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

* Make examples unique

* Remove detectors from frameworks API

* Use /api instead of Next.js

* Install dependencies

* Rename project

* Change name

* Empty

* Change name

* Update api/tsconfig.json

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

* Update examples

Co-authored-by: Steven <steven@ceriously.com>
2020-01-07 23:55:39 +01:00