From aa4bfe915c63629c1ef772099913ff3991c9857f Mon Sep 17 00:00:00 2001 From: Stuart Rowlands Date: Mon, 25 Nov 2024 17:42:23 +1000 Subject: [PATCH] Updated README. Fixed linting. --- README.md | 32 ++++++++++++++++++++++++++++---- cli.js | 4 ++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19ce406..a20511d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ quant [options] ### Content Management - `quant deploy [dir]` - Deploy the output of a static generator ```bash - quant deploy [dir] [--attachments] [--skip-unpublish] [--chunk-size=10] [--force] + quant deploy [dir] [--attachments] [--skip-unpublish] [--skip-unpublish-regex=pattern] [--enable-index-html] [--chunk-size=10] [--force] ``` - `quant file ` - Deploy a single asset @@ -47,7 +47,7 @@ quant [options] - `quant page ` - Make a local page asset available ```bash - quant page path/to/page.html /about-us + quant page path/to/page.html /about-us [--enable-index-html] ``` ### Publishing Controls @@ -58,7 +58,7 @@ quant [options] - `quant unpublish ` - Unpublish an asset ```bash - quant unpublish /about-us [--force] + quant unpublish /about-us ``` - `quant delete ` - Delete a deployed path @@ -81,6 +81,25 @@ quant [options] quant redirect /old-page /new-page [--status=301] ``` +### Edge Functions +- `quant function [uuid]` - Deploy an edge function + ```bash + quant function handler.js "My edge function" # Deploy new function + quant function handler.js "Updated function" 019361ae-2516-788a-8f50-e803ff561c34 # Update existing + ``` + +- `quant filter [uuid]` - Deploy an edge filter function + ```bash + quant filter filter.js "My edge filter" # Deploy new filter + quant filter filter.js "Updated filter" 019361ae-2516-788a-8f50-e803ff561c34 # Update existing + ``` + +- `quant auth [uuid]` - Deploy an edge auth function + ```bash + quant auth auth.js "My auth function" # Deploy new auth function + quant auth auth.js "Updated auth" 019361ae-2516-788a-8f50-e803ff561c34 # Update existing + ``` + ### Search - `quant search ` - Perform search index operations ```bash @@ -148,7 +167,7 @@ These options can be used with any command: --clientid, -c Project customer id for QuantCDN --project, -p Project name for QuantCDN --token, -t Project token for QuantCDN ---endpoint, -e API endpoint for QuantCDN (default: "https://api.quantcdn.io") +--endpoint, -e API endpoint for QuantCDN (default: "https://api.quantcdn.io/v1") ``` ## Configuration @@ -187,6 +206,11 @@ quant purge "/*" # Purge all content quant purge --cache-keys="key1 key2" # Purge specific cache keys quant purge /about --soft-purge # Soft purge a path +# Deploy edge functions +quant function handler.js "My edge function" # Deploy a new function +quant auth auth.js "My auth function" # Deploy an auth function +quant filter filter.js "My edge filter" # Deploy a filter function + # Check deployment status quant scan --diff-only ``` diff --git a/cli.js b/cli.js index 18b4a13..21aa4a2 100755 --- a/cli.js +++ b/cli.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { intro, outro, select, confirm, isCancel, spinner } = require('@clack/prompts'); +const { intro, outro, select, confirm, isCancel } = require('@clack/prompts'); const color = require('picocolors'); const { getCommandOptions, getCommand, loadCommands } = require('./src/commandLoader'); const config = require('./src/config'); @@ -124,7 +124,7 @@ function cliMode() { // Add all commands to yargs const commands = loadCommands(); - Object.entries(commands).forEach(([name, command]) => { + Object.entries(commands).forEach(([_name, command]) => { yargsInstance = yargsInstance.command({ command: command.command, describe: command.describe,