@fastly/compute-js-static-publish 8.0.0-beta.10 → 8.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"publish-content.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/manage/publish-content.ts"],"names":[],"mappings":"AAuGA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAkgBhD"}
1
+ {"version":3,"file":"publish-content.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/manage/publish-content.ts"],"names":[],"mappings":"AA2GA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAghBhD"}
@@ -50,6 +50,10 @@ Optional:
50
50
 
51
51
  --overwrite-existing Always overwrite existing entries in storage, even if unchanged.
52
52
 
53
+ --brotli-quality=<0-11> Brotli quality for the 'br' variants. Overrides
54
+ brotliQuality in the config file.
55
+ Default: brotliQuality from publish-content.config.js, or 11
56
+
53
57
  Expiration:
54
58
  --expires-in=<duration> Expiration duration from now.
55
59
  Examples: 3d, 12h, 15m, 1w
@@ -92,6 +96,7 @@ export async function action(actionArgs) {
92
96
  { name: 'collection-name', type: String, },
93
97
  { name: 'root-dir', type: String, },
94
98
  { name: 'overwrite-existing', type: Boolean },
99
+ { name: 'brotli-quality', type: String },
95
100
  { name: 'expires-in', type: String },
96
101
  { name: 'expires-at', type: String },
97
102
  { name: 'expires-never', type: Boolean },
@@ -111,7 +116,7 @@ export async function action(actionArgs) {
111
116
  help();
112
117
  return;
113
118
  }
114
- const { verbose, config: configFilePathValue, ['collection-name']: collectionNameValue, ['root-dir']: rootDir, ['overwrite-existing']: _overwriteExisting, ['expires-in']: expiresIn, ['expires-at']: expiresAt, ['expires-never']: expiresNever, local: localMode, ['fastly-api-token']: fastlyApiToken, ['kv-overwrite']: _kvOverwrite, ['s3-access-key-id']: s3AccessKeyId, ['s3-secret-access-key']: s3SecretAccessKey, } = parsed.commandLineOptions;
119
+ const { verbose, config: configFilePathValue, ['collection-name']: collectionNameValue, ['root-dir']: rootDir, ['overwrite-existing']: _overwriteExisting, ['brotli-quality']: brotliQualityValue, ['expires-in']: expiresIn, ['expires-at']: expiresAt, ['expires-never']: expiresNever, local: localMode, ['fastly-api-token']: fastlyApiToken, ['kv-overwrite']: _kvOverwrite, ['s3-access-key-id']: s3AccessKeyId, ['s3-secret-access-key']: s3SecretAccessKey, } = parsed.commandLineOptions;
115
120
  const overwriteExisting = _overwriteExisting ?? _kvOverwrite;
116
121
  // compute-js-static-publisher cli is always run from the Compute application directory
117
122
  // in other words, the directory that contains `fastly.toml`.
@@ -148,6 +153,17 @@ export async function action(actionArgs) {
148
153
  process.exitCode = 1;
149
154
  return;
150
155
  }
156
+ // --brotli-quality overrides brotliQuality in the config file.
157
+ let brotliQualitySource = 'config';
158
+ if (brotliQualityValue !== undefined) {
159
+ if (typeof brotliQualityValue !== 'string' || !/^\d+$/.test(brotliQualityValue) || Number(brotliQualityValue) > 11) {
160
+ console.error(`❌ --brotli-quality must be an integer from 0 to 11.`);
161
+ process.exitCode = 1;
162
+ return;
163
+ }
164
+ publishContentConfig.brotliQuality = Number(brotliQualityValue);
165
+ brotliQualitySource = '--brotli-quality';
166
+ }
151
167
  const publicDirRoot = path.resolve(rootDir != null ? rootDir : publishContentConfig.rootDir);
152
168
  if ((computeAppDir + '/').startsWith(publicDirRoot + '/')) {
153
169
  if (verbose) {
@@ -168,7 +184,7 @@ export async function action(actionArgs) {
168
184
  }
169
185
  console.log(`✔️ Public directory '${rootRelative(publicDirRoot)}'.`);
170
186
  if (publishContentConfig.brotliQuality != null) {
171
- console.log(`✔️ Brotli quality: ${publishContentConfig.brotliQuality}`);
187
+ console.log(`✔️ Brotli quality: ${publishContentConfig.brotliQuality} (from ${brotliQualitySource})`);
172
188
  }
173
189
  const publishId = staticPublisherRc.publishId;
174
190
  console.log(` | Publish ID: ${publishId}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fastly/compute-js-static-publish",
3
3
  "type": "module",
4
- "version": "8.0.0-beta.10",
4
+ "version": "8.0.0-beta.11",
5
5
  "description": "Static Publisher for Fastly Compute JavaScript",
6
6
  "main": "build/index.js",
7
7
  "exports": {