0.1.0 • Published 11 months ago

nx-vercel-utils v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

nx-vercel-utils

npm (nx-vercel-utils)

Features

  • Upload and replace all environment variables from your .env file to vercel

Install

pnpm i -D nx-vercel-utils

Description

This plugin adds a env executor that will deploy your environment variables to vercel.

Prerequisites

  • You will need to have the vercel cli installed. Either globally or locally in your project. If you install it globally you have to set packageManager option to global.
pnpm i -D vercel

You also need to cd into the project and run vercel link to link your project to your vercel account. That will create a .vercel folder.

Example

cd apps/frontend
vercel login # if you haven't logged in
vercel link

Executors

Env

See the example here

...
 "targets": {
  "deploy-vercel-env": {
   "executor": "../dist:env",
   "options": {
    "flavors": {
     "development": "development",
     "production": "production",
     "staging": "staging"
    },
    "vercelProjectName": "your-vercel-project-name"
   }
  },

You need to create .env.{flavor} files for each flavor you want to deploy. The flavor name will be the key in the flavors object.

Options

OptionDescriptionDefaultAlias
vercelProjectNameThe name of the vercel project.requiredproject
flavorsA object of the flavors to use, the key is the flavor name and value is either 'production', 'development', 'preview' or 'preview:{branch}'. Read more hererequired
flavorThe flavor to use, default will be the first key in the flavors object.
silentWhether to suppress all logs.falses
verboseWhether to run the command with verbose logging.falsev
packageManagerThe package manager to use for deploying with firebase-tools. Either: pnpm, npm, yarn or global.
concurrencyThe number of environments to deploy in parallel10c

Examples

pnpm nx deploy-vercel-env frontend

# will deploy the environment variables for the first flavor in the flavors object
pnpm nx deploy-vercel-env frontend --flavor staging
0.1.0

11 months ago

0.0.3

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago