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

@turnkeyid/deploys3

v1.1.0

Published

Fast frontend static website deployer to S3

Downloads

31

Readme

Welcome to DeployS3 👋

License: CC BY 4.0

Deploy your static website with single command!

Install

npm install -D @turnkeyid/deploys3 
#or
yarn add -D @turnkeyid/deploys3

Usage

  1. First you should define configuration file, example:
$ nano deployer.json
{
  "configs":[
   {
       "appId": "YOUR_ID",
       "deployer": {
          "accessKey": "ABCABACS", # see How to get AWS Key bellow
          "secretKey": "ABCDEFG",
          "staticWeb": "true", # to make your bucket as static hosting
          "indexPath": "index.html", # your html root file
          "errorPath": "index.html", # your error html, use "index.html" if you are using REACT
          "source": "/path/to/build", # your source file(s)
          "uploadFolder": "", # where you want to put your files in S3
          "region": "ap-southeast-1",
          "bucket": "domain.com", # target bucket, if not exist it will create new one
          "concurentUploadLimit": 3 # limit upload at the same time, default 3
       },
       "autoGenerateCertificate": "false",
       "cloudfront": {
          "accessKey": "ABCABACS",
          "secretKey": "ABCDEFG",
          "s3BucketName": "domain.com", # your s3 bucket name
          "s3Region": "ap-southeast-1", # your s3 region
          "region": "us-east-1", # your cloudfront, default us-east-1(global)
          "cnames": "domain.com", # your domain name
          "id": "AXZXX", # if cloudfront already exist, put the id here to update, instead of creating new one
          "https": {
             "enabled": "true", # if you want SSL
             "ACMCertArn": "", # Aws Certificate Manager ARN
          },
          "rootDocument": "index.html", # the root document of s3
          "errorDocument": "index.html", # the error root document of s3, if not defined will use rootDocument instead
          "errorResponses": [
           {
             "ErrorCachingMinTTL": 10, # Error cache minimum time to live
             "ErrorCode": 302, # Source error code
             "ResponseCode": "302", # Target error code
             "ResponsePagePath": "redirect.html" # Error path for handling this errors
           }
          ],
       }
    },
    {...} # repeat the format for the rest configs
  ]
}

Another trick if you want your configs more simpler for more apps:

$ nano deployer.json
{
  "configs":[
     # make default value for reference
    {
      "appId": "DEFAULT", # the value should be "DEFAULT"
      "deployer": {
        # the same config as above
      }
    },
    # make specific config
    {
      "appId": "YOUR_ID",
      "deployer": {
        "bucket": "MY_BUCKET",
        "staticWeb": "false",
        "concurentUploadLimit": 5
      }
    },
    {...} # repeat the format for the rest configs
  ]
}
  1. Skip this step if your config path is already on <root_project>/deployer.json . Set DEPLOYER_CONF_PATH=CUSTOM_CONFIG_PATH.json environtment to your command, or on your .env file, add this line:
DEPLOYER_CONF_PATH = CUSTOM_CONFIG_PATH.json
  1. Check your configs, run $ npx deploys3 -c, it should show you your config file content.
  2. Run :
$ npx deploys3 -d # Deploy all apps
# 
$ npx deploys3 -do YOUR_ID # Deploy specific config by ID
#
$ npx deploys3 -p my-deployer.json -do YOUR_ID # Deploy specific config by ID with specific deployer.json
#

Change npx to yarn if you are using yarn

See all the commands:

npx deploys3 -h

Key Features

Current:

  • Sync folder to S3
  • Set S3 bucket as static web
  • Create or Update Cloudfront Distribution, then link it to S3 bucket
  • Set Cloudfront HTTPS with given ACM (AWS Certificate Manager) ARN
  • Create Invalidation

Future Dev:

  • Generate AWS Certificate then link it to cloudfront
  • Validate AWS Certificate with Route53 CNames
  • Route Cloudfront to Route53

How to Get AWS Access Key and Secret Key

official doc : https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html

Author

👤 TurnkeyID Developers - FatihAziz

Show your support

Give a ⭐️ if this project helped you! Currently the repo still in private. We will open in soon! Send issues or just messages to my email [email protected]


This README was generated with ❤️ by readme-md-generator