astro-indexnow 2.3.0 โ†’ 2.3.2

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/README.MD CHANGED
@@ -6,8 +6,8 @@ to **IndexNow** after each build.
6
6
  This package is designed for **modern CI/CD pipelines**, **Docker-based deployments**, and
7
7
  **large static sites**, while remaining fully deterministic and explicit.
8
8
 
9
- > **Current release:** v2.3.0
10
- > **Stateful by design. Changed-only submissions. Batch-safe. CI-aware.**
9
+ > **Current release:** v2.3.2
10
+ > **Stateful by design. `changed` by default, `all` available. Batch-safe. CI-aware.**
11
11
 
12
12
  ---
13
13
 
@@ -27,6 +27,8 @@ Instead of waiting for crawlers, your site tells search engines exactly which UR
27
27
  - ๐Ÿ” **Detects changed pages automatically** using HTML hashing
28
28
  - ๐Ÿง  Stores a small on-disk cache to avoid re-submitting unchanged URLs
29
29
  - ๐Ÿ“ฆ **Batches submissions** safely (IndexNow 10,000 URL limit)
30
+ - ๐Ÿ”€ Optional `submissionMode` lets you choose `changed` or `all`
31
+ - ๐Ÿงช Optional `dryRun` plans submissions without sending requests
30
32
  - ๐Ÿงช Fully **CI/CD and Docker safe**
31
33
  - ๐Ÿ”’ No secrets prompted, stored, or mutated
32
34
  - ๐Ÿงฉ No client-side or runtime code added
@@ -117,6 +119,9 @@ export default defineConfig({
117
119
 
118
120
  Using environment variables is **strongly recommended** for CI/CD.
119
121
 
122
+ This release is backwards compatible with earlier supported package versions.
123
+ Older npm versions are not deprecated by default; they remain supported until a future major release introduces a breaking change.
124
+
120
125
  ---
121
126
 
122
127
  ## How It Works
@@ -217,6 +222,22 @@ indexnow({ enabled: false })
217
222
 
218
223
  ---
219
224
 
225
+ ### `dryRun` (optional)
226
+
227
+ Type: `boolean`
228
+ Default: `false`
229
+
230
+ When `true`, the integration performs discovery, diffing, and batching, then logs the plan without sending any IndexNow requests.
231
+ Dry runs do not mutate the cache file.
232
+
233
+ ```js
234
+ indexnow({
235
+ dryRun: true,
236
+ })
237
+ ```
238
+
239
+ ---
240
+
220
241
  ### `cacheDir` (optional)
221
242
 
222
243
  Type: `string`
@@ -228,6 +249,24 @@ Example: `./node_modules/.astro`
228
249
 
229
250
  ---
230
251
 
252
+ ### `submissionMode` (optional)
253
+
254
+ Type: `"changed" | "all"`
255
+ Default: `"changed"`
256
+
257
+ Controls which URLs are submitted after a build:
258
+
259
+ - `changed` submits only new or modified pages
260
+ - `all` submits every generated page in the current build output
261
+
262
+ ```js
263
+ indexnow({
264
+ submissionMode: "all",
265
+ })
266
+ ```
267
+
268
+ ---
269
+
231
270
  ## IndexNow Limits & Batching
232
271
 
233
272
  - IndexNow allows **up to 10,000 URLs per request**
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface IndexNowOptions {
4
4
  siteUrl?: string;
5
5
  enabled?: boolean;
6
6
  cacheDir?: string;
7
+ dryRun?: boolean;
7
8
  submissionMode?: "changed" | "all";
8
9
  }
9
10
  export default function indexNow(options?: IndexNowOptions): AstroIntegration;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CA8MlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAmNlB"}
package/dist/index.js CHANGED
@@ -126,6 +126,10 @@ export default function indexNow(options = {}) {
126
126
  }
127
127
  const batches = chunk(urlsToSubmit, INDEXNOW_BATCH_SIZE);
128
128
  logger.info(`[astro-indexnow] submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}]`);
129
+ if (options.dryRun) {
130
+ logger.info("[astro-indexnow] dry run enabled, skipping submission");
131
+ return;
132
+ }
129
133
  for (let i = 0; i < batches.length; i++) {
130
134
  const batch = batches[i];
131
135
  logger.debug(`[astro-indexnow] submitting batch ${i + 1}/${batches.length} (${batch.length} URLs)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-indexnow",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Astro integration to submit pages to IndexNow automatically after build",
5
5
  "type": "module",
6
6
  "exports": {