@ziuchen/tencent-scf-utils
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

@ziuchen/tencent-scf-utils

A simple tool for deploying Tencent SCF

Install

npm i @ziuchen/tencent-scf-utils -D

Usage

tscf -h

Deploy Command

Deploy a directory to Tencent SCF:

tscf deploy ./dist -n my-function

Layer Command

Build and upload a layer.zip with production dependencies:

tscf layer -p package.json

You can pass additional npm install arguments using the --npm-args option:

# Pass --ignore-scripts to npm install
tscf layer --npm-args "--ignore-scripts"

# Pass multiple npm arguments
tscf layer --npm-args "--ignore-scripts --no-audit --no-fund"

# Combine with layer-specific options
tscf layer -p custom-package.json --npm-args "--ignore-scripts --verbose"

The --npm-args option accepts a space-separated string of arguments that will be passed directly to the npm install command.

Best Practice

tscf will load config from enviroment variables below:

TENCENTCLOUD_SCF_FUNCTION_NAME=xxxxxxxxxxxxxxxxxxxx
TENCENTCLOUD_SCF_SECRET_ID=xxxxxxxxxxxxxxxxxxxx
TENCENTCLOUD_SCF_SECRET_KEY=xxxxxxxxxxxxxxxxxxxx

Using with @dotenvx/dotenvx:

{
  "scripts": {
    "deploy:scf": "dotenvx run -- tscf deploy ./dist"
  }
}

dotenvx will load enviroment variables from .env file for tencent-scf-utils.

Development

This link tencent-scf-utils to global.

pnpm link -g

In other package, run this to link tencent-scf-utils locally.

pnpm link -g tencent-scf-utils

After modified code, you should rerun these command to make changes apply.

Publish

pnpm login --registry=https://registry.npmjs.org/
pnpm publish --access=public --no-git-checks

Package Sidebar

Install

npm i @ziuchen/tencent-scf-utils

Weekly Downloads

6

Version

1.1.4

License

MIT

Unpacked Size

726 kB

Total Files

9

Last publish

Collaborators

  • ziuchen