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

koot-serverless

v3.1.5

Published

koot-serverless

Downloads

18

Readme

entryFile 需要暴露 Koa 实例

Serverless迁移步骤

确认安装[email protected]以上版本

可以使用koot-cli进行升级

npx koot-cli

版本跨度较大时,需要进行迁移测试。

下载koot-serverless模板里的serverless文件夹

下载serverless文件夹,复制到项目根目录下 https://github.com/cmux/koot-serverless/tree/master/packages/koot-serverless

Tips: 可以使用chrome插件GitZip进行github文件夹打包下载

安装koot-serverless

yarn add koot-serverless

确认编译和发布脚本

确保同一个环境的npm scripts中打包和发布的环境变量target。 prod对应生产环境,qa对应测试环境。

// package.json
{
    ...
    "scripts": {
        ...
        "build:qa": "koot-build --config ./serverless/koot.config.js -- target=qa",
        "build:prod": "koot-build --config ./serverless/koot.config.js -- target=prod",
        "deploy:qa": "./serverless/deploy.js qa",
        "deploy:prod": "./serverless/deploy.js prod"
    }
    ...
}

整理依赖

package.json里,dependencies里的依赖移到devDependencies里,服务端依赖除外。

与运维对接创建发布流程

配置 publicPath

需要运维提供cos绑定的域名或者腾讯提供的免费域名,写入serverless/config.jspublicPath

需要运维配置

  1. 选择serverless专用的docker
  2. 确定触发的tag前缀
  3. 需要在项目根目录生成.env文件
TENCENT_SECRET_ID=aaa
TENCENT_SECRET_KEY=bbb
  1. 需要在项目根目录生成serverless.yml文件,$开头的值需要运维修改
name: $name
koot-csr:
    component: 'koot-tencent-website'
    inputs:
        code:
            root: ./public
        region: $region
        bucketName: $bucketName
koot-ssr:
    component: 'koot-tencent-koa'
    inputs:
        code: ./server
        region: $region
        functionName: $functionName
        serviceId: $serviceId
        tags:
            $tagkey: $tagvalue
  1. 执行发布脚本
npm run deploy:prod #发布环境对应的脚本

打包发布

打包和发布步骤:

npm run build:prod # 打包
git add serverless
git commit -m "build:prod" # 提交
git push
git tag release-xxxxxxxx # 打tag
git push --tag
# 审批流程