npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cloudbase/framework-plugin-deno

v1.9.6

Published

云开发 Tencent CloudBase Framework Deno Server Plugin 插件,将项目下的 Deno 应用一键部署云开发环境,提供自动弹性伸缩的高性能 Deno 服务

Downloads

249

Readme

Tencent CloudBase Framework Deno Plugin

Tencent CloudBase Framework Deno Plugin

Github License Npm version issue PRs Welcome star

云开发 CloudBase Framework 框架「Deno」插件: 通过云开发 CloudBase Framework 框架将 Deno 应用一键部署到云开发环境,提供生产环境可用的自动弹性伸缩的高性能 Deno 应用服务。

功能特性

  • 无须关心底层架构: 只需要开发业务服务,不用适配底层架构
  • 节约成本: 资源伸缩,弹性扩缩容,灵活计费,极大节约资源成本
  • 框架支持: 无缝支持 Deno 应用

使用方法

步骤一. 准备工作

具体步骤请参照 准备云开发环境和 CloudBase CLI 命令工具

步骤二. 进入项目目录进行初始化

执行以下命令来初始化一个全新的 deno 项目

cloudbase init --template deno

步骤三. 一键部署

cloudbase framework deploy

配置

默认情况下不需要任何配置即可使用,以下配置参数针对有特殊需求的场景

配置示例

cloudbase init 之后会创建云开发的配置文件 cloudbaserc.json,可在配置文件的 plugins 里修改和写入插件配置

{
  "envId": "{{envId}}",
  "framework": {
    "plugins": {
      "client": {
        "use": "@cloudbase/framework-plugin-deno",
        "inputs": {
          "serviceName": "deno-app",
          "projectPath": "/deno-app"
        }
      }
    }
  }
}

配置参数说明

serviceName

必填,服务名,字符串格式,如 'deno-app'

servicePath

必填,服务路径配置,字符串格式,如 '/deno-app'

projectPath

选填,本地代码文件夹相对于项目根目录的路径,字符串格式,默认值 './'

dockerImage

选填,Dockerfile 源镜像,字符串格式,默认值 'debian:buster-slim'

runtime

选填,Deno 运行时版本,字符串格式,如 'v1.3.0',默认值 'latest'

denonVersion

选填,Denon 版本,字符串格式,如 '@2.4.0',默认值 ''

entry

选填,入口文件,字符串格式,默认值 ''

配置入口文件为 entry.ts 后,docker 编译时,会执行 deno install entry.ts

但不推荐如此管理项目,推荐使用 denon 配置文件,并在部署前进行本地编译。

autoBuild

选填,是否云端自动构建,布尔值格式,默认值 true

关于 denon

docker 使用 denon 来管理 deno 进程,以便于管理 deno 启动参数。

denon 配置示例:

# denon.yml
scripts:
  build:
    cmd:
      - mkdir dist
      - deno bundle src/entry.ts dist/entry.js
    watch: false
  start:
    cmd: deno run dist/entry.js
    allow:
      - net
      - env
      - read
  dev:
    cmd: deno run src/entry.ts
    env:
      PORT: '3000'
    allow:
      - net
      - env
      - read

直接在 docker 编译 deno 应用,由于部分依赖文件所处网络环境原因容易导致镜像编译失败。推荐在本地安装 denon ,通过 denon.yml 提供的 denon build 命令进行本地编译,然后再发布应用到云端。

cloudbase init 之后会自动提供一个默认的 denon.yml,请根据应用需求来修改。

默认 docker 镜像会执行 denon start 命令来启动应用。

更多插件

请访问 CloudBase Framework 插件列表 搭配使用其他插件

文档资料