astro-indexnow 2.3.5 → 2.3.6
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 +33 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -6,7 +6,7 @@ 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.
|
|
9
|
+
> **Current release:** v2.3.6
|
|
10
10
|
> **Stateful by design. `changed` by default, `all` available. Batch-safe. CI-aware.**
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -137,6 +137,20 @@ Using environment variables is **strongly recommended** for CI/CD.
|
|
|
137
137
|
This release is backwards compatible with earlier supported package versions.
|
|
138
138
|
Older npm versions are not deprecated by default; they remain supported until a future major release introduces a breaking change.
|
|
139
139
|
|
|
140
|
+
## Migration Notes
|
|
141
|
+
|
|
142
|
+
### From v1
|
|
143
|
+
|
|
144
|
+
- v1 submitted all generated pages after each build
|
|
145
|
+
- v2 and later add cache-based changed-only submissions
|
|
146
|
+
- if you upgrade from v1, the first build may submit more URLs because the cache starts empty
|
|
147
|
+
|
|
148
|
+
### From v2
|
|
149
|
+
|
|
150
|
+
- v2.1 added `cacheDir`
|
|
151
|
+
- v2.3 added `submissionMode`, `dryRun`, `logMode`, `batchSize`, and retry controls
|
|
152
|
+
- the current build-time behavior remains compatible with static and hybrid builds
|
|
153
|
+
|
|
140
154
|
---
|
|
141
155
|
|
|
142
156
|
## How It Works
|
|
@@ -155,6 +169,23 @@ This ensures:
|
|
|
155
169
|
- No unnecessary API calls
|
|
156
170
|
- Accurate change detection based on real output
|
|
157
171
|
|
|
172
|
+
## What Gets Submitted
|
|
173
|
+
|
|
174
|
+
Only generated HTML pages are scanned and considered for submission.
|
|
175
|
+
|
|
176
|
+
Included:
|
|
177
|
+
- generated `index.html` pages
|
|
178
|
+
- static pages emitted into the final build output
|
|
179
|
+
|
|
180
|
+
Ignored:
|
|
181
|
+
- assets
|
|
182
|
+
- RSS or XML feeds
|
|
183
|
+
- JavaScript bundles
|
|
184
|
+
- images
|
|
185
|
+
- any other non-HTML outputs
|
|
186
|
+
|
|
187
|
+
This integration does not inspect source files directly. It only works from final build output.
|
|
188
|
+
|
|
158
189
|
---
|
|
159
190
|
|
|
160
191
|
## State & Cache File (Important)
|
|
@@ -362,6 +393,7 @@ Controls the maximum backoff delay between retries.
|
|
|
362
393
|
- No reliance on Git history
|
|
363
394
|
- Deterministic output-based change detection
|
|
364
395
|
- Intended for static and hybrid builds, not SSR request-time submission
|
|
396
|
+
- Build-time only; use a webhook or server-side flow for SSR updates
|
|
365
397
|
|
|
366
398
|
---
|
|
367
399
|
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,
|
|
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,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAmUlB"}
|
package/dist/index.js
CHANGED
|
@@ -169,12 +169,15 @@ export default function indexNow(options = {}) {
|
|
|
169
169
|
if (entry.isDirectory())
|
|
170
170
|
walk(fullPath);
|
|
171
171
|
if (entry.isFile() && entry.name === "index.html") {
|
|
172
|
+
// Astro emits one index.html per generated route, so this is the
|
|
173
|
+
// canonical build artifact to hash and submit.
|
|
172
174
|
const relativePath = path
|
|
173
175
|
.relative(outDir, fullPath)
|
|
174
176
|
.replace(/index\.html$/, "")
|
|
175
177
|
.replace(/\\/g, "/");
|
|
176
178
|
const url = site + "/" + relativePath.replace(/^\/+/, "");
|
|
177
179
|
const hash = hashFile(fullPath);
|
|
180
|
+
// Cache by URL because IndexNow submits URLs, not filesystem paths.
|
|
178
181
|
nextCache[url] = hash;
|
|
179
182
|
if (previousCache[url] !== hash) {
|
|
180
183
|
changedUrls.push(url);
|
|
@@ -183,6 +186,8 @@ export default function indexNow(options = {}) {
|
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
walk(outDir);
|
|
189
|
+
const scannedCount = Object.keys(nextCache).length;
|
|
190
|
+
const changedCount = changedUrls.length;
|
|
186
191
|
logVerbose(logger, "page diff:");
|
|
187
192
|
for (const url of Object.keys(nextCache)) {
|
|
188
193
|
const state = previousCache[url] === nextCache[url]
|
|
@@ -201,7 +206,9 @@ export default function indexNow(options = {}) {
|
|
|
201
206
|
return;
|
|
202
207
|
}
|
|
203
208
|
const batches = chunk(urlsToSubmit, batchSize);
|
|
209
|
+
const batchCount = batches.length;
|
|
204
210
|
logInfo(logger, `submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}, batchSize=${batchSize}]`);
|
|
211
|
+
logInfo(logger, `summary: scanned=${scannedCount}, changed=${changedCount}, batched=${batchCount}, submitted=${urlsToSubmit.length}`);
|
|
205
212
|
if (isVerbose()) {
|
|
206
213
|
logVerbose(logger, "planned URL list:");
|
|
207
214
|
for (const url of urlsToSubmit) {
|