Files
vercel/packages/cli
Chris Barber 0dd3711f63 [go] Go builder improvements (#9576)
This PR fixes a handful of Go builder issues all related to the selected Golang version being used to build the function:

- `go.mod` version ignored for `vc build` and `vc dev`, uses system `PATH` version only
- `vc dev` fails if `go.mod` does not exist
- If the analyze bin doesn’t exist, downloads golang into `.vercel/cache/golang` instead of a global shared dir
- When running `vc dev`, doesn’t reuse go build code/common settings
- go tidy fails when `go.mod` set to 1.19 or 1.20, but 1.18 or older is installed
- `vc build` builds wrong arch on Apple Silicon/arm64
- `vc build` on Windows doesn't properly resolve "builds" in `vercel.json` due to posix separator issue
- `vc build` on Windows fails with `package <pkg/name> is not in GOROOT` due to posix separator issue
- Removed `actions/setup-go` from all test workflows

I added a test that tests the `go tidy` issue.
2023-03-16 19:05:09 +00:00
..
2023-03-16 19:05:09 +00:00

Vercel

Develop. Preview. Ship.

Join the community on GitHub Discussions

Usage

Vercel is the platform for frontend developers, providing the speed and reliability innovators need to create at the moment of inspiration.

We enable teams to iterate quickly and develop, preview, and ship delightful user experiences. Vercel has zero-configuration support for 35+ frontend frameworks and integrates with your headless content, commerce, or database of choice.

To install the latest version of Vercel CLI, run this command:

npm i -g vercel

To quickly start a new project, run the following commands:

vercel init     # Pick an example project
cd <PROJECT>    # Change directory to the new project
vercel          # Deploy to the cloud

Finally, connect your Git repository to Vercel and deploy with git push.

Documentation

For details on how to use Vercel CLI, check out our documentation.

Local Development

To develop Vercel CLI, first check out the source code, install dependencies, and build all packages:

git clone https://github.com/vercel/vercel.git
cd vercel
pnpm install
pnpm build

At this point you can make modifications to the CLI source code and test them out locally. The CLI source code is located in the packages/cli directory.

cd packages/cli

pnpm dev <cli-commands...>

From within the packages/cli directory, you can use the "dev" script to quickly execute Vercel CLI from its TypeScript source code directly (without having to manually compile first). For example:

pnpm dev deploy
pnpm dev whoami
pnpm dev login
pnpm dev switch --debug

When you are satisfied with your changes, make a commit and create a pull request!