Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gauntface/cli

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gauntface/cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

49

gauntface-aws-s3-deploy-static-site.js

@@ -40,31 +40,6 @@ const util = require('util');

// Add cache headers for assets that do not have a hash
`aws s3 cp \
${s3Bucket} ${s3Bucket} \
--exclude="*" \
--include="*.html" \
--include="*.xml" \
--include="*.json" \
--include="*.svg" \
--cache-control 'max-age=86400' \ # Set the cache control headers
--acl public-read \ # Make files publicly accessible
--recursive \ # Copy subdirectories and files
--metadata-directive="REPLACE" # Don't error if the metadata is identical`,
makeCopyCmd(s3Bucket, 86400, ['html', 'xml', 'json', 'svg']),
// Add cache headers for assets that do have a hash
`aws s3 cp \
${s3Bucket} ${s3Bucket} \
--exclude="*" \
--include="*.css" \
--include="*.js" \
--include="*.png" \
--include="*.jpg" \
--include="*.jpeg" \
--include="*.gif" \
--include="*.webp" \
--include="*.woff" \
--include="*.woff2" \
--cache-control 'max-age=31104000' \ # Set the cache control headers
--acl public-read \ # Make files publicly accessible
--recursive \ # Copy subdirectories and files
--metadata-directive="REPLACE" # Don't error if the metadata is identical`,
makeCopyCmd(s3Bucket, 31104000, ['css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'webp', 'woff', 'woff2']),
];

@@ -77,2 +52,22 @@

function makeCopyCmd(s3Bucket, maxAge, extensions) {
const parts = [
`aws s3 cp ${s3Bucket} ${s3Bucket}`,
'--exclude="*"',
]
for (const e of extensions) {
parts.push(`--include="*.${e}"`)
}
// --cache-control Set cache control headers
parts.push(`--cache-control 'max-age=${maxAge}'`);
// --acl public-read Makes files accessible via web browser
parts.push(`--acl public-read`);
// --recursive Copy subdirectories and files
parts.push(`--recursive`);
// --metadata-directive Don't error if the metadata is identical
parts.push(`--metadata-directive="REPLACE"`);
return parts.join(" ")
}
async function runCmd(cmd) {

@@ -79,0 +74,0 @@ console.log(`🤖 Running \`${cmd}\``);

@@ -6,3 +6,3 @@ {

},
"version": "0.0.2",
"version": "0.0.3",
"description": "A CLI tool to help with repetitive tasks.",

@@ -9,0 +9,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc