@speedkit/cli 4.25.2 → 4.26.0

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [4.26.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.25.2...v4.26.0) (2026-09-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * **revalidate:** default to REFRESH, and gate only a dropping job ([c280261](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/c2802614138163b1e2474a8dce552535468fd854))
7
+
1
8
  ## [4.25.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v4.25.1...v4.25.2) (2026-09-09)
2
9
 
3
10
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/4.25.2 linux-x64 node-v22.23.2
24
+ @speedkit/cli/4.26.0 linux-x64 node-v22.23.2
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -770,11 +770,13 @@ FLAGS
770
770
  state it only to override that, or to purge a whole path without a pattern.
771
771
  --query=<value> Raw MongoDB query on the asset fields, as JSON. An escape hatch for a rule --pattern cannot
772
772
  express, such as a condition on another field. It replaces the query --pattern would build.
773
- --type=<option> [default: PURGE] PURGE drops the entries and does not rebuild them, which is what an
774
- out-of-scope URL needs.
773
+ --type=<option> [default: REFRESH] REFRESH revalidates against origin and keeps serving the cached copy
774
+ meanwhile. A URL that went out of scope needs PURGE instead: it drops the entries and does
775
+ not rebuild them, which is the only type that stops serving for good.
775
776
  <options: REFRESH|INSTANT|DEPLOYMENT|PURGE>
776
777
  --wait Poll the job until it finishes.
777
- --yes Skip the confirmation a job above 100 assets asks for. Required in a non-interactive shell.
778
+ --yes Skip the confirmation a dropping job above 100 assets asks for. Required in a
779
+ non-interactive shell.
778
780
 
779
781
  DESCRIPTION
780
782
  Purge or refresh cached assets by prefix and query. Run it after a config that narrows scope goes live, so returning
@@ -785,7 +787,7 @@ EXAMPLES
785
787
 
786
788
  $ sk revalidate example-shop --pattern '^https://www\.example\.com/en/.*-c(?:1234|5678)(?:/|\?|$)' --dryRun
787
789
 
788
- $ sk revalidate example-shop --pattern '^https://www\.example\.com/en/.*-c1234(?:/|\?|$)' --wait
790
+ $ sk revalidate example-shop --pattern '^https://www\.example\.com/en/.*-c1234(?:/|\?|$)' --type PURGE --wait
789
791
 
790
792
  $ sk revalidate example-shop --prefix https://www.example.com/en/ --dryRun
791
793
  ```
@@ -1,7 +1,7 @@
1
1
  import { Args, Command, Flags } from "@oclif/core";
2
2
  import { CLIParameters, CLIParametersChar } from "../models/cli-parameters.js";
3
3
  import { isNonInteractive } from "../helpers/environment.js";
4
- import { CONFIRMATION_THRESHOLD, REVALIDATE_TYPES, RevalidateContext, RevalidateFactory, } from "../services/revalidate/index.js";
4
+ import { CONFIRMATION_THRESHOLD, DROPPING_TYPES, REVALIDATE_TYPES, RevalidateContext, RevalidateFactory, } from "../services/revalidate/index.js";
5
5
  const SAMPLE_SIZE = 10;
6
6
  export default class Revalidate extends Command {
7
7
  static description = "Purge or refresh cached assets by prefix and query. Run it after a config that narrows scope goes live, so returning visitors stop receiving the cached HTML.";
@@ -26,8 +26,8 @@ export default class Revalidate extends Command {
26
26
  }),
27
27
  ["type"]: Flags.string({
28
28
  options: [...REVALIDATE_TYPES],
29
- default: "PURGE",
30
- description: "PURGE drops the entries and does not rebuild them, which is what an out-of-scope URL needs.",
29
+ default: "REFRESH",
30
+ description: "REFRESH revalidates against origin and keeps serving the cached copy meanwhile. A URL that went out of scope needs PURGE instead: it drops the entries and does not rebuild them, which is the only type that stops serving for good.",
31
31
  }),
32
32
  [CLIParameters.DryRun]: Flags.boolean({
33
33
  char: CLIParametersChar.DryRun,
@@ -40,7 +40,7 @@ export default class Revalidate extends Command {
40
40
  }),
41
41
  ["yes"]: Flags.boolean({
42
42
  default: false,
43
- description: `Skip the confirmation a job above ${CONFIRMATION_THRESHOLD} assets asks for. Required in a non-interactive shell.`,
43
+ description: `Skip the confirmation a dropping job above ${CONFIRMATION_THRESHOLD} assets asks for. Required in a non-interactive shell.`,
44
44
  }),
45
45
  [CLIParameters.Quiet]: Flags.boolean({
46
46
  char: CLIParametersChar.Quiet,
@@ -51,7 +51,7 @@ export default class Revalidate extends Command {
51
51
  static examples = [
52
52
  `$ sk revalidate <${CLIParameters.AppName}> --pattern <regex> [--pattern <regex>] [--${CLIParameters.DryRun}] [--wait]`,
53
53
  `$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c(?:1234|5678)(?:/|\\?|$)' --${CLIParameters.DryRun}`,
54
- `$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c1234(?:/|\\?|$)' --wait`,
54
+ `$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c1234(?:/|\\?|$)' --type PURGE --wait`,
55
55
  `$ sk revalidate example-shop --prefix https://www.example.com/en/ --${CLIParameters.DryRun}`,
56
56
  ];
57
57
  async run() {
@@ -88,7 +88,9 @@ export default class Revalidate extends Command {
88
88
  return;
89
89
  }
90
90
  const type = flags["type"];
91
- if (preview.count > CONFIRMATION_THRESHOLD && !flags["yes"]) {
91
+ if (DROPPING_TYPES.has(type) &&
92
+ preview.count > CONFIRMATION_THRESHOLD &&
93
+ !flags["yes"]) {
92
94
  if (isNonInteractive()) {
93
95
  this.error(`${preview.count} assets exceed the ${CONFIRMATION_THRESHOLD}-asset threshold, and this shell cannot ask`, {
94
96
  exit: 1,
@@ -6,11 +6,17 @@ export type RevalidateType = (typeof REVALIDATE_TYPES)[number];
6
6
  */
7
7
  export declare const ASSET_TABLE = "speedKit.Asset";
8
8
  /**
9
- * Above this many assets the command asks before it purges. A filter that takes
10
- * more than a page of assets is usually a filter mistake, and a purge cannot be
11
- * undone — the entries are gone until traffic caches them again.
9
+ * Above this many assets the command asks before it runs a job that drops
10
+ * entries. Such a job cannot be undone: the entries are gone until traffic
11
+ * caches them again.
12
12
  */
13
13
  export declare const CONFIRMATION_THRESHOLD = 100;
14
+ /**
15
+ * The job types that stop serving the cached entry straight away, so a large one
16
+ * needs the confirmation. `REFRESH` and `INSTANT` keep serving while they
17
+ * revalidate, so they need none.
18
+ */
19
+ export declare const DROPPING_TYPES: ReadonlySet<RevalidateType>;
14
20
  /**
15
21
  * Scope of a revalidation job.
16
22
  *
@@ -10,11 +10,20 @@ export const REVALIDATE_TYPES = [
10
10
  */
11
11
  export const ASSET_TABLE = "speedKit.Asset";
12
12
  /**
13
- * Above this many assets the command asks before it purges. A filter that takes
14
- * more than a page of assets is usually a filter mistake, and a purge cannot be
15
- * undone — the entries are gone until traffic caches them again.
13
+ * Above this many assets the command asks before it runs a job that drops
14
+ * entries. Such a job cannot be undone: the entries are gone until traffic
15
+ * caches them again.
16
16
  */
17
17
  export const CONFIRMATION_THRESHOLD = 100;
18
+ /**
19
+ * The job types that stop serving the cached entry straight away, so a large one
20
+ * needs the confirmation. `REFRESH` and `INSTANT` keep serving while they
21
+ * revalidate, so they need none.
22
+ */
23
+ export const DROPPING_TYPES = new Set([
24
+ "PURGE",
25
+ "DEPLOYMENT",
26
+ ]);
18
27
  export class RevalidateContext {
19
28
  app;
20
29
  quiet;
@@ -884,7 +884,7 @@
884
884
  "examples": [
885
885
  "$ sk revalidate <app> --pattern <regex> [--pattern <regex>] [--dryRun] [--wait]",
886
886
  "$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c(?:1234|5678)(?:/|\\?|$)' --dryRun",
887
- "$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c1234(?:/|\\?|$)' --wait",
887
+ "$ sk revalidate example-shop --pattern '^https://www\\.example\\.com/en/.*-c1234(?:/|\\?|$)' --type PURGE --wait",
888
888
  "$ sk revalidate example-shop --prefix https://www.example.com/en/ --dryRun"
889
889
  ],
890
890
  "flags": {
@@ -910,9 +910,9 @@
910
910
  "type": "option"
911
911
  },
912
912
  "type": {
913
- "description": "PURGE drops the entries and does not rebuild them, which is what an out-of-scope URL needs.",
913
+ "description": "REFRESH revalidates against origin and keeps serving the cached copy meanwhile. A URL that went out of scope needs PURGE instead: it drops the entries and does not rebuild them, which is the only type that stops serving for good.",
914
914
  "name": "type",
915
- "default": "PURGE",
915
+ "default": "REFRESH",
916
916
  "hasDynamicHelp": false,
917
917
  "multiple": false,
918
918
  "options": [
@@ -937,7 +937,7 @@
937
937
  "type": "boolean"
938
938
  },
939
939
  "yes": {
940
- "description": "Skip the confirmation a job above 100 assets asks for. Required in a non-interactive shell.",
940
+ "description": "Skip the confirmation a dropping job above 100 assets asks for. Required in a non-interactive shell.",
941
941
  "name": "yes",
942
942
  "allowNo": false,
943
943
  "type": "boolean"
@@ -1314,5 +1314,5 @@
1314
1314
  ]
1315
1315
  }
1316
1316
  },
1317
- "version": "4.25.2"
1317
+ "version": "4.26.0"
1318
1318
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "4.25.2",
4
+ "version": "4.26.0",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"