@intlayer/engine 9.5.10 → 9.5.12
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/dist/assets/installSkills/skills/bundle-optimization.md +123 -0
- package/dist/assets/installSkills/skills/compat.md +0 -4
- package/dist/assets/installSkills/skills/content.md +8 -2
- package/dist/assets/installSkills/skills/next-js.md +2 -2
- package/dist/assets/installSkills/skills/usage.md +1 -1
- package/dist/cjs/build.cjs +5 -0
- package/dist/cjs/cli.cjs +1 -0
- package/dist/cjs/docReview/alignBlocks.cjs +53 -36
- package/dist/cjs/docReview/alignBlocks.cjs.map +1 -1
- package/dist/cjs/docReview/rebuildDocument.cjs +3 -1
- package/dist/cjs/docReview/rebuildDocument.cjs.map +1 -1
- package/dist/cjs/docReview/segmentDocument.cjs +8 -5
- package/dist/cjs/docReview/segmentDocument.cjs.map +1 -1
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs +4 -1
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs.map +1 -1
- package/dist/cjs/init/index.cjs +2 -12
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/backendPackages.cjs +15 -0
- package/dist/cjs/init/utils/backendPackages.cjs.map +1 -0
- package/dist/cjs/init/utils/index.cjs +2 -3
- package/dist/cjs/installMCP/installMCP.cjs +1 -1
- package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
- package/dist/cjs/installSkills/index.cjs +2 -0
- package/dist/cjs/installSkills/index.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +9 -8
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +3 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +4 -6
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +1 -1
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +19 -12
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/remoteDictionaryClient.cjs +18 -0
- package/dist/cjs/loadDictionaries/remoteDictionaryClient.cjs.map +1 -0
- package/dist/cjs/prepareIntlayerServer.cjs +132 -0
- package/dist/cjs/prepareIntlayerServer.cjs.map +1 -0
- package/dist/cjs/scan/analyzeBundleContent.cjs +26 -12
- package/dist/cjs/scan/analyzeBundleContent.cjs.map +1 -1
- package/dist/cjs/scan/calculateScore.cjs +4 -1
- package/dist/cjs/scan/calculateScore.cjs.map +1 -1
- package/dist/cjs/scan/checks.cjs +394 -221
- package/dist/cjs/scan/checks.cjs.map +1 -1
- package/dist/cjs/scan/detection/checkDetails.cjs +56 -0
- package/dist/cjs/scan/detection/checkDetails.cjs.map +1 -0
- package/dist/cjs/scan/detection/classifyInternalLinks.cjs +47 -0
- package/dist/cjs/scan/detection/classifyInternalLinks.cjs.map +1 -0
- package/dist/cjs/scan/detection/detectRoutingStrategy.cjs +143 -0
- package/dist/cjs/scan/detection/detectRoutingStrategy.cjs.map +1 -0
- package/dist/cjs/scan/detection/detectTechnologies.cjs +89 -0
- package/dist/cjs/scan/detection/detectTechnologies.cjs.map +1 -0
- package/dist/cjs/scan/detection/index.cjs +36 -0
- package/dist/cjs/scan/detection/localeCode.cjs +118 -0
- package/dist/cjs/scan/detection/localeCode.cjs.map +1 -0
- package/dist/cjs/scan/detection/localizedPages.cjs +48 -0
- package/dist/cjs/scan/detection/localizedPages.cjs.map +1 -0
- package/dist/cjs/scan/detection/technologySignatures.cjs +564 -0
- package/dist/cjs/scan/detection/technologySignatures.cjs.map +1 -0
- package/dist/cjs/scan/detection/url.cjs +53 -0
- package/dist/cjs/scan/detection/url.cjs.map +1 -0
- package/dist/cjs/scan/fetchText.cjs +56 -0
- package/dist/cjs/scan/fetchText.cjs.map +1 -0
- package/dist/cjs/scan/index.cjs +59 -3
- package/dist/cjs/scan/parseHtml.cjs +55 -10
- package/dist/cjs/scan/parseHtml.cjs.map +1 -1
- package/dist/cjs/scan/robots.cjs +65 -0
- package/dist/cjs/scan/robots.cjs.map +1 -0
- package/dist/cjs/scan/runScanChecks.cjs +89 -0
- package/dist/cjs/scan/runScanChecks.cjs.map +1 -0
- package/dist/cjs/scan/scanWebsite.cjs +58 -52
- package/dist/cjs/scan/scanWebsite.cjs.map +1 -1
- package/dist/cjs/scan/sitemap.cjs +109 -0
- package/dist/cjs/scan/sitemap.cjs.map +1 -0
- package/dist/cjs/utils/chunkJSON.cjs +24 -9
- package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
- package/dist/cjs/utils/getChunk.cjs +2 -2
- package/dist/cjs/utils/getChunk.cjs.map +1 -1
- package/dist/cjs/utils/getProcessChainCommands.cjs +117 -0
- package/dist/cjs/utils/getProcessChainCommands.cjs.map +1 -0
- package/dist/cjs/utils/index.cjs +2 -0
- package/dist/cjs/utils/runParallel/index.cjs +1 -1
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/pidTree.cjs +23 -11
- package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/ps.cjs +8 -3
- package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/runTask.cjs +2 -1
- package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/wmic.cjs +8 -3
- package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
- package/dist/cjs/utils/startContentWatcher.cjs +99 -0
- package/dist/cjs/utils/startContentWatcher.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +2 -2
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +7 -4
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs +2 -2
- package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs.map +1 -1
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
- package/dist/esm/build.mjs +2 -1
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/docReview/alignBlocks.mjs +53 -36
- package/dist/esm/docReview/alignBlocks.mjs.map +1 -1
- package/dist/esm/docReview/rebuildDocument.mjs +3 -1
- package/dist/esm/docReview/rebuildDocument.mjs.map +1 -1
- package/dist/esm/docReview/segmentDocument.mjs +8 -5
- package/dist/esm/docReview/segmentDocument.mjs.map +1 -1
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs +4 -1
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs.map +1 -1
- package/dist/esm/init/index.mjs +1 -11
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/backendPackages.mjs +14 -0
- package/dist/esm/init/utils/backendPackages.mjs.map +1 -0
- package/dist/esm/init/utils/index.mjs +2 -2
- package/dist/esm/installMCP/installMCP.mjs +1 -1
- package/dist/esm/installMCP/installMCP.mjs.map +1 -1
- package/dist/esm/installSkills/index.mjs +2 -0
- package/dist/esm/installSkills/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +9 -8
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +3 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +3 -5
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/log.mjs +1 -1
- package/dist/esm/loadDictionaries/log.mjs.map +1 -1
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +19 -12
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
- package/dist/esm/loadDictionaries/remoteDictionaryClient.mjs +16 -0
- package/dist/esm/loadDictionaries/remoteDictionaryClient.mjs.map +1 -0
- package/dist/esm/prepareIntlayerServer.mjs +128 -0
- package/dist/esm/prepareIntlayerServer.mjs.map +1 -0
- package/dist/esm/scan/analyzeBundleContent.mjs +26 -12
- package/dist/esm/scan/analyzeBundleContent.mjs.map +1 -1
- package/dist/esm/scan/calculateScore.mjs +4 -1
- package/dist/esm/scan/calculateScore.mjs.map +1 -1
- package/dist/esm/scan/checks.mjs +387 -220
- package/dist/esm/scan/checks.mjs.map +1 -1
- package/dist/esm/scan/detection/checkDetails.mjs +54 -0
- package/dist/esm/scan/detection/checkDetails.mjs.map +1 -0
- package/dist/esm/scan/detection/classifyInternalLinks.mjs +46 -0
- package/dist/esm/scan/detection/classifyInternalLinks.mjs.map +1 -0
- package/dist/esm/scan/detection/detectRoutingStrategy.mjs +141 -0
- package/dist/esm/scan/detection/detectRoutingStrategy.mjs.map +1 -0
- package/dist/esm/scan/detection/detectTechnologies.mjs +87 -0
- package/dist/esm/scan/detection/detectTechnologies.mjs.map +1 -0
- package/dist/esm/scan/detection/index.mjs +10 -0
- package/dist/esm/scan/detection/localeCode.mjs +108 -0
- package/dist/esm/scan/detection/localeCode.mjs.map +1 -0
- package/dist/esm/scan/detection/localizedPages.mjs +46 -0
- package/dist/esm/scan/detection/localizedPages.mjs.map +1 -0
- package/dist/esm/scan/detection/technologySignatures.mjs +563 -0
- package/dist/esm/scan/detection/technologySignatures.mjs.map +1 -0
- package/dist/esm/scan/detection/url.mjs +47 -0
- package/dist/esm/scan/detection/url.mjs.map +1 -0
- package/dist/esm/scan/fetchText.mjs +55 -0
- package/dist/esm/scan/fetchText.mjs.map +1 -0
- package/dist/esm/scan/index.mjs +15 -3
- package/dist/esm/scan/parseHtml.mjs +52 -11
- package/dist/esm/scan/parseHtml.mjs.map +1 -1
- package/dist/esm/scan/robots.mjs +63 -0
- package/dist/esm/scan/robots.mjs.map +1 -0
- package/dist/esm/scan/runScanChecks.mjs +88 -0
- package/dist/esm/scan/runScanChecks.mjs.map +1 -0
- package/dist/esm/scan/scanWebsite.mjs +59 -53
- package/dist/esm/scan/scanWebsite.mjs.map +1 -1
- package/dist/esm/scan/sitemap.mjs +105 -0
- package/dist/esm/scan/sitemap.mjs.map +1 -0
- package/dist/esm/utils/chunkJSON.mjs +24 -9
- package/dist/esm/utils/chunkJSON.mjs.map +1 -1
- package/dist/esm/utils/getChunk.mjs +2 -2
- package/dist/esm/utils/getChunk.mjs.map +1 -1
- package/dist/esm/utils/getProcessChainCommands.mjs +115 -0
- package/dist/esm/utils/getProcessChainCommands.mjs.map +1 -0
- package/dist/esm/utils/index.mjs +2 -1
- package/dist/esm/utils/runParallel/index.mjs +1 -1
- package/dist/esm/utils/runParallel/index.mjs.map +1 -1
- package/dist/esm/utils/runParallel/pidTree.mjs +23 -11
- package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
- package/dist/esm/utils/runParallel/ps.mjs +8 -3
- package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
- package/dist/esm/utils/runParallel/runTask.mjs +2 -1
- package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
- package/dist/esm/utils/runParallel/wmic.mjs +8 -3
- package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
- package/dist/esm/utils/startContentWatcher.mjs +98 -0
- package/dist/esm/utils/startContentWatcher.mjs.map +1 -0
- package/dist/esm/watcher.mjs +1 -1
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +7 -4
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs +2 -2
- package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs.map +1 -1
- package/dist/esm/writeJsonIfChanged.mjs +1 -1
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
- package/dist/types/build.d.ts +2 -1
- package/dist/types/cli.d.ts +2 -2
- package/dist/types/docReview/rebuildDocument.d.ts.map +1 -1
- package/dist/types/docReview/segmentDocument.d.ts.map +1 -1
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts.map +1 -1
- package/dist/types/init/index.d.ts +1 -1
- package/dist/types/init/index.d.ts.map +1 -1
- package/dist/types/init/utils/backendPackages.d.ts +5 -0
- package/dist/types/init/utils/backendPackages.d.ts.map +1 -0
- package/dist/types/init/utils/index.d.ts +2 -2
- package/dist/types/installSkills/index.d.ts +1 -0
- package/dist/types/installSkills/index.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts.map +1 -1
- package/dist/types/loadDictionaries/remoteDictionaryClient.d.ts +14 -0
- package/dist/types/loadDictionaries/remoteDictionaryClient.d.ts.map +1 -0
- package/dist/types/prepareIntlayerServer.d.ts +67 -0
- package/dist/types/prepareIntlayerServer.d.ts.map +1 -0
- package/dist/types/scan/analyzeBundleContent.d.ts.map +1 -1
- package/dist/types/scan/calculateScore.d.ts +4 -1
- package/dist/types/scan/calculateScore.d.ts.map +1 -1
- package/dist/types/scan/checks.d.ts +114 -21
- package/dist/types/scan/checks.d.ts.map +1 -1
- package/dist/types/scan/detection/checkDetails.d.ts +29 -0
- package/dist/types/scan/detection/checkDetails.d.ts.map +1 -0
- package/dist/types/scan/detection/classifyInternalLinks.d.ts +44 -0
- package/dist/types/scan/detection/classifyInternalLinks.d.ts.map +1 -0
- package/dist/types/scan/detection/detectRoutingStrategy.d.ts +60 -0
- package/dist/types/scan/detection/detectRoutingStrategy.d.ts.map +1 -0
- package/dist/types/scan/detection/detectTechnologies.d.ts +60 -0
- package/dist/types/scan/detection/detectTechnologies.d.ts.map +1 -0
- package/dist/types/scan/detection/index.d.ts +9 -0
- package/dist/types/scan/detection/localeCode.d.ts +49 -0
- package/dist/types/scan/detection/localeCode.d.ts.map +1 -0
- package/dist/types/scan/detection/localizedPages.d.ts +40 -0
- package/dist/types/scan/detection/localizedPages.d.ts.map +1 -0
- package/dist/types/scan/detection/technologySignatures.d.ts +48 -0
- package/dist/types/scan/detection/technologySignatures.d.ts.map +1 -0
- package/dist/types/scan/detection/url.d.ts +27 -0
- package/dist/types/scan/detection/url.d.ts.map +1 -0
- package/dist/types/scan/fetchText.d.ts +30 -0
- package/dist/types/scan/fetchText.d.ts.map +1 -0
- package/dist/types/scan/index.d.ts +16 -4
- package/dist/types/scan/parseHtml.d.ts +17 -0
- package/dist/types/scan/parseHtml.d.ts.map +1 -1
- package/dist/types/scan/robots.d.ts +23 -0
- package/dist/types/scan/robots.d.ts.map +1 -0
- package/dist/types/scan/runScanChecks.d.ts +43 -0
- package/dist/types/scan/runScanChecks.d.ts.map +1 -0
- package/dist/types/scan/scanWebsite.d.ts.map +1 -1
- package/dist/types/scan/sitemap.d.ts +49 -0
- package/dist/types/scan/sitemap.d.ts.map +1 -0
- package/dist/types/scan/types.d.ts +15 -0
- package/dist/types/scan/types.d.ts.map +1 -1
- package/dist/types/utils/chunkJSON.d.ts.map +1 -1
- package/dist/types/utils/getProcessChainCommands.d.ts +35 -0
- package/dist/types/utils/getProcessChainCommands.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/runParallel/pidTree.d.ts.map +1 -1
- package/dist/types/utils/startContentWatcher.d.ts +40 -0
- package/dist/types/utils/startContentWatcher.d.ts.map +1 -0
- package/dist/types/watcher.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeMarkdownFile.d.ts.map +1 -1
- package/package.json +15 -7
- package/dist/cjs/init/utils/devScript.cjs +0 -57
- package/dist/cjs/init/utils/devScript.cjs.map +0 -1
- package/dist/esm/init/utils/devScript.mjs +0 -55
- package/dist/esm/init/utils/devScript.mjs.map +0 -1
- package/dist/types/init/utils/devScript.d.ts +0 -48
- package/dist/types/init/utils/devScript.d.ts.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/scan/detection/localeCode.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Locale-code helpers shared by the scan checks and the routing detection.
|
|
4
|
+
*
|
|
5
|
+
* Dependency-free and browser-safe: consumed by the CLI, the backend audit and
|
|
6
|
+
* the Chrome extension popup.
|
|
7
|
+
*/
|
|
8
|
+
/** Lower-case a locale code and use `-` as separator (`pt_BR` → `pt-br`). */
|
|
9
|
+
export declare const normalizeLocaleCode: (localeCode: string) => string;
|
|
10
|
+
/** Primary language subtag of a locale code (`en-US` → `en`). */
|
|
11
|
+
export declare const getLanguageCode: (localeCode: string) => string;
|
|
12
|
+
/** Whether two locale codes designate the same locale, ignoring case/separator. */
|
|
13
|
+
export declare const isSameLocale: (firstLocale: string | undefined, secondLocale: string | undefined) => boolean;
|
|
14
|
+
/** Whether two locale codes share the same language (`fr` vs `fr-CA`). */
|
|
15
|
+
export declare const isSameLanguage: (firstLocale: string | undefined, secondLocale: string | undefined) => boolean;
|
|
16
|
+
/** Whether a string looks like a locale code (used on URL segments). */
|
|
17
|
+
export declare const looksLikeLocaleCode: (value: string) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a locale code is a valid BCP 47 tag (`en_US` and `english` are not).
|
|
20
|
+
* `x-default` is accepted since it is a valid hreflang value.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isValidLocaleCode: (localeCode: string) => boolean;
|
|
23
|
+
/** Whether the locale is written right-to-left (`ar`, `he-IL`, `fa`…). */
|
|
24
|
+
export declare const isRightToLeftLocale: (localeCode: string) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Find, among `candidateLocales`, the one matching `value` (a URL segment, a
|
|
27
|
+
* subdomain label or a query-string value). Falls back to a language-only match
|
|
28
|
+
* when no exact match exists (`/fr/` for hreflang `fr-FR`).
|
|
29
|
+
*/
|
|
30
|
+
export declare const findMatchingLocale: (value: string | undefined | null, candidateLocales: readonly string[]) => string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a value is a valid `og:locale` (`en_GB`). Open Graph does not accept
|
|
33
|
+
* a bare language (`en`) nor BCP 47 separators (`en-GB`): crawlers then fall
|
|
34
|
+
* back to `en_US`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const isValidOpenGraphLocale: (localeCode: string) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Suggest the `og:locale` value for a locale code. The region comes from the
|
|
39
|
+
* locale itself, then from `regionHint` (typically `<html lang>`) when it
|
|
40
|
+
* shares the language, then from the language's most likely region.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* toOpenGraphLocale('en', 'en-GB'); // 'en_GB'
|
|
44
|
+
* toOpenGraphLocale('pt-br'); // 'pt_BR'
|
|
45
|
+
* toOpenGraphLocale('fr'); // 'fr_FR'
|
|
46
|
+
*/
|
|
47
|
+
export declare const toOpenGraphLocale: (localeCode: string, regionHint?: string) => string | undefined;
|
|
48
|
+
//#endregion
|
|
49
|
+
//# sourceMappingURL=localeCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeCode.d.ts","names":[],"sources":["../../../../src/scan/detection/localeCode.ts"],"mappings":";;;;;;;;qBA8Ba,sBAAmB;;qBAInB,kBAAe;;qBAIf,eAAY,iCACQ;;qBASpB,iBAAc,iCACM;;qBAQpB,sBAAmB;;;;;qBAOnB,oBAAiB;;qBAajB,sBAAmB;;;;;;qBAQnB,qBAAkB,kCACG;;;;;;qBAyBrB,yBAAsB;;;;;;;;;;;qBA+BtB,oBAAiB,oBACV"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RoutingDetection } from "./detectRoutingStrategy.js";
|
|
2
|
+
//#region src/scan/detection/localizedPages.d.ts
|
|
3
|
+
/** A localized version of a page, read from its hreflang tags. */
|
|
4
|
+
export type LocalizedPage = {
|
|
5
|
+
hreflang: string;
|
|
6
|
+
/** Absolute URL of the localized version. */
|
|
7
|
+
url: string;
|
|
8
|
+
/** True when this alternate points to the page currently inspected. */
|
|
9
|
+
isCurrent: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Turns the hreflang alternates of a page into a navigable list: absolute,
|
|
13
|
+
* deduped by URL (a real locale wins over `x-default`), flagging the current
|
|
14
|
+
* page, `x-default` last.
|
|
15
|
+
*
|
|
16
|
+
* @param hreflangs - `<link rel="alternate" hreflang>` entries of the page.
|
|
17
|
+
* @param currentUrl - Absolute URL of the page, used to resolve relative hrefs.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getLocalizedPages: (hreflangs: {
|
|
20
|
+
hreflang: string;
|
|
21
|
+
href: string;
|
|
22
|
+
}[], currentUrl: string) => LocalizedPage[];
|
|
23
|
+
/** Input of {@link isBaseLocalePage}. */
|
|
24
|
+
export type BaseLocalePageInput = {
|
|
25
|
+
pageUrl: string;
|
|
26
|
+
hreflangs: {
|
|
27
|
+
hreflang: string;
|
|
28
|
+
href: string;
|
|
29
|
+
}[];
|
|
30
|
+
routing: Pick<RoutingDetection, 'strategy' | 'locales' | 'urlLocale' | 'defaultLocale'>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Whether the page is the base (unlocalized / default-locale entry) version of
|
|
34
|
+
* a multilingual page: the `x-default` target, the root of a `prefix-all`
|
|
35
|
+
* site, or the unmarked default-locale URL. i18n issues tend to hide on the
|
|
36
|
+
* localized versions rather than on this one.
|
|
37
|
+
*/
|
|
38
|
+
export declare const isBaseLocalePage: ({ pageUrl, hreflangs, routing }: BaseLocalePageInput) => boolean;
|
|
39
|
+
//#endregion
|
|
40
|
+
//# sourceMappingURL=localizedPages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localizedPages.d.ts","names":[],"sources":["../../../../src/scan/detection/localizedPages.ts"],"mappings":";;;YAKY;EACV;;EAEA;;EAEA;;;;;;;;;;qBAaW,oBAAiB;EACf;EAAkB;KAAgB,uBAE9C;;YA4BS;EACV;EACA;IAAa;IAAkB;;EAC/B,SAAS,KACP;;;;;;;;qBAWS,qBAAgB,SAAA,WAAA,WAI1B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/scan/detection/technologySignatures.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Category of a technology detected on a scanned page.
|
|
4
|
+
*
|
|
5
|
+
* - `framework`: rendering framework (Next.js, Nuxt, Angular…)
|
|
6
|
+
* - `i18n-library`: code-level i18n library (Intlayer, i18next, vue-i18n…)
|
|
7
|
+
* - `tms`: translation management system (Crowdin, Phrase, Lokalise…)
|
|
8
|
+
* - `translation-proxy`: hosted website translation layer (Weglot, Localize…)
|
|
9
|
+
* - `cms`: content management system / site builder
|
|
10
|
+
*/
|
|
11
|
+
export type TechnologyCategory = 'framework' | 'i18n-library' | 'tms' | 'translation-proxy' | 'cms';
|
|
12
|
+
/**
|
|
13
|
+
* Fingerprint of a technology. Every signal is optional; a technology is
|
|
14
|
+
* detected as soon as one of them matches. Regexes with a first capture group
|
|
15
|
+
* provide the detected version.
|
|
16
|
+
*/
|
|
17
|
+
export type TechnologySignature = {
|
|
18
|
+
/** Stable identifier, e.g. `nextjs`, `crowdin`. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Human-readable name. */
|
|
21
|
+
name: string;
|
|
22
|
+
category: TechnologyCategory;
|
|
23
|
+
/** Matched against script / stylesheet / iframe / request URLs. */
|
|
24
|
+
resourceUrls?: RegExp[];
|
|
25
|
+
/** Matched against the HTML document, inline scripts included. */
|
|
26
|
+
html?: RegExp[];
|
|
27
|
+
/** Matched against the content of same-origin JavaScript chunks. */
|
|
28
|
+
bundle?: RegExp[];
|
|
29
|
+
/** Window globals, only available when inspecting a live page. */
|
|
30
|
+
globals?: string[];
|
|
31
|
+
/** Cookie / localStorage / sessionStorage keys (case-insensitive). */
|
|
32
|
+
storageKeys?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Markers only a live DOM exposes, reported by the collector (e.g.
|
|
35
|
+
* `react-fiber` for the `__reactFiber$…` keys React sets on elements).
|
|
36
|
+
*/
|
|
37
|
+
domMarkers?: string[];
|
|
38
|
+
/** Dotted window path holding the version, e.g. `next.version`. */
|
|
39
|
+
versionGlobal?: string;
|
|
40
|
+
/** Only reported when every one of these ids is detected too. */
|
|
41
|
+
requires?: string[];
|
|
42
|
+
/** Hidden when any of these ids is detected (e.g. Vue under Nuxt). */
|
|
43
|
+
hiddenBy?: string[];
|
|
44
|
+
};
|
|
45
|
+
/** Every known technology fingerprint, in display order. */
|
|
46
|
+
export declare const technologySignatures: readonly TechnologySignature[];
|
|
47
|
+
//#endregion
|
|
48
|
+
//# sourceMappingURL=technologySignatures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"technologySignatures.d.ts","names":[],"sources":["../../../../src/scan/detection/technologySignatures.ts"],"mappings":";;;;;;;;;;YASY;;;;;;YAYA;;EAEV;;EAEA;EACA,UAAU;;EAEV,eAAe;;EAEf,OAAO;;EAEP,SAAS;;EAET;;EAEA;;;;;EAKA;;EAEA;;EAEA;;EAEA;;;qBAwkBW,+BAA+B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/scan/detection/url.d.ts
|
|
2
|
+
/** URL helpers shared by the scan checks (browser-safe). */
|
|
3
|
+
/** Parse a possibly relative URL, returning `undefined` when it is invalid. */
|
|
4
|
+
export declare const parseUrl: (url: string, baseUrl?: string) => URL | undefined;
|
|
5
|
+
/** Strip a leading `www.` so `www.example.com` and `example.com` compare equal. */
|
|
6
|
+
export declare const normalizeHostname: (hostname: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Canonical comparable form of a URL: no hash, no trailing slash (except the
|
|
9
|
+
* root), `www.` stripped. Returns the input unchanged when it cannot be parsed.
|
|
10
|
+
*/
|
|
11
|
+
export declare const normalizeUrl: (url: string, baseUrl?: string) => string;
|
|
12
|
+
/** First non-empty segment of a URL path (`/fr/about` → `fr`). */
|
|
13
|
+
export declare const getFirstPathSegment: (pathname: string) => string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the URL is fully qualified (`https://host/…`), as hreflang requires.
|
|
16
|
+
* Relative (`/fr`), protocol-relative (`//host/fr`) and non-HTTP URLs are not.
|
|
17
|
+
*/
|
|
18
|
+
export declare const isAbsoluteUrl: (url: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Approximate registrable domain of a hostname (`gtm.crowdin.com` →
|
|
21
|
+
* `crowdin.com`, `www.airbnb.co.uk` → `airbnb.co.uk`), without a public
|
|
22
|
+
* suffix list: a short second-level label under a country code is treated as
|
|
23
|
+
* part of the suffix.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getSiteDomain: (hostname: string) => string;
|
|
26
|
+
//#endregion
|
|
27
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","names":[],"sources":["../../../../src/scan/detection/url.ts"],"mappings":";;;qBAGa,WAAQ,aAAe,qBAAqB;;qBAS5C,oBAAiB;;;;;qBAOjB,eAAY,aAAe;;qBAa3B,sBAAmB;;;;;qBAOnB,gBAAa;;;;;;;qBASb,gBAAa"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/scan/fetchText.d.ts
|
|
2
|
+
/** Options shared by every network request issued during a scan. */
|
|
3
|
+
export type ScanFetchOptions = {
|
|
4
|
+
userAgent: string;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
/**
|
|
7
|
+
* Guard called before fetching any URL discovered on the scanned site
|
|
8
|
+
* (hreflang alternates, sitemap children…). The hosted audit uses it to
|
|
9
|
+
* block private / reserved addresses (SSRF). Defaults to allowing all.
|
|
10
|
+
*/
|
|
11
|
+
shouldFetchUrl?: (url: string) => boolean | Promise<boolean>;
|
|
12
|
+
};
|
|
13
|
+
/** Response of {@link fetchText}. */
|
|
14
|
+
export type FetchTextResult = {
|
|
15
|
+
status: number;
|
|
16
|
+
ok: boolean;
|
|
17
|
+
text: string;
|
|
18
|
+
/** URL after redirects. */
|
|
19
|
+
finalUrl: string;
|
|
20
|
+
/** Whether at least one redirect was followed. */
|
|
21
|
+
redirected: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* GET a URL as text with a timeout, returning `undefined` when the request is
|
|
25
|
+
* blocked by {@link ScanFetchOptions.shouldFetchUrl} or fails at network level.
|
|
26
|
+
* Redirects are followed manually so every hop goes through the guard.
|
|
27
|
+
*/
|
|
28
|
+
export declare const fetchText: (url: string, { userAgent, timeoutMs, shouldFetchUrl }: ScanFetchOptions) => Promise<FetchTextResult | undefined>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//# sourceMappingURL=fetchText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchText.d.ts","names":[],"sources":["../../../src/scan/fetchText.ts"],"mappings":";;YACY;EACV;EACA;;;;;;EAMA,kBAAkB,0BAA0B;;;YAIlC;EACV;EACA;EACA;;EAEA;;EAEA;;;;;;;qBAyBW,YAAS,eACT,WAAA,WAAA,kBAC+B,qBACzC,QAAQ"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { ScorableEvent, Score, ScoreCheckType, mutateScore, scoreRecord, toScorePercent } from "./calculateScore.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RoutingDetection, RoutingDetectionInput, RoutingStrategy, detectRoutingStrategy, getUrlLocale } from "./detection/detectRoutingStrategy.js";
|
|
3
|
+
import { TechnologyCategory, TechnologySignature, technologySignatures } from "./detection/technologySignatures.js";
|
|
4
|
+
import { DetectedTechnology, TechnologyDetectionInput, detectTechnologies, getTechnologyGlobalNames } from "./detection/detectTechnologies.js";
|
|
5
|
+
import { BundleChunkInput, BundleContentAnalysis, ChunkAnalysis, PageMetadata, ScanCheckStatus, ScanEvent, ScanEventDetails, ScanMode, ScanOptions, ScanResult } from "./types.js";
|
|
3
6
|
import { analyzeBundleContent } from "./analyzeBundleContent.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
7
|
+
import { FetchTextResult, ScanFetchOptions, fetchText } from "./fetchText.js";
|
|
8
|
+
import { Anchor, HreflangLink, byteLength, extractAnchors, extractCanonicalHref, extractHreflangs, extractHtmlDir, extractHtmlLang, extractMetaDescription, extractOgImage, extractOgLocale, extractOgLocaleAlternates, extractResourceUrls, extractScriptUrls, extractTitle, extractVisibleTextStrings, hasCanonical } from "./parseHtml.js";
|
|
9
|
+
import { EmitScanEvent, PageSignals, checkBundleContent, checkCanonical, checkHreflang, checkHreflangReciprocity, checkHtmlDir, checkHtmlLang, checkInternalLinks, checkLocaleConsistency, checkOgLocale, checkRobots, checkSitemap, checkXDefault, formatBundleAnalysis, formatSize } from "./checks.js";
|
|
10
|
+
import { CheckDetailParts, getCheckDetailLines, splitCheckDetails } from "./detection/checkDetails.js";
|
|
11
|
+
import { LinkAnchor, LinkClassification, LinkClassificationInput, classifyInternalLinks } from "./detection/classifyInternalLinks.js";
|
|
12
|
+
import { findMatchingLocale, getLanguageCode, isRightToLeftLocale, isSameLanguage, isSameLocale, isValidLocaleCode, isValidOpenGraphLocale, looksLikeLocaleCode, normalizeLocaleCode, toOpenGraphLocale } from "./detection/localeCode.js";
|
|
13
|
+
import { BaseLocalePageInput, LocalizedPage, getLocalizedPages, isBaseLocalePage } from "./detection/localizedPages.js";
|
|
14
|
+
import { getFirstPathSegment, getSiteDomain, isAbsoluteUrl, normalizeHostname, normalizeUrl, parseUrl } from "./detection/url.js";
|
|
15
|
+
import { ParsedRobots, isPathAllowedByRobots, parseRobots } from "./robots.js";
|
|
16
|
+
import { RunScanChecksOptions, ScanChecksResult, ScanPageInfo, ScanPageInput, runScanChecks } from "./runScanChecks.js";
|
|
6
17
|
import { scanWebsite } from "./scanWebsite.js";
|
|
7
|
-
|
|
18
|
+
import { CollectedSitemaps, ParsedSitemap, SitemapEntry, collectSitemapEntries, discoverSitemapUrls, getDefaultSitemapUrls, parseSitemap } from "./sitemap.js";
|
|
19
|
+
export { Anchor, BaseLocalePageInput, BundleChunkInput, BundleContentAnalysis, CheckDetailParts, ChunkAnalysis, CollectedSitemaps, DetectedTechnology, EmitScanEvent, FetchTextResult, HreflangLink, LinkAnchor, LinkClassification, LinkClassificationInput, LocalizedPage, PageMetadata, PageSignals, ParsedRobots, ParsedSitemap, RoutingDetection, RoutingDetectionInput, RoutingStrategy, RunScanChecksOptions, ScanCheckStatus, ScanChecksResult, ScanEvent, ScanEventDetails, ScanFetchOptions, ScanMode, ScanOptions, ScanPageInfo, ScanPageInput, ScanResult, ScorableEvent, Score, ScoreCheckType, SitemapEntry, TechnologyCategory, TechnologyDetectionInput, TechnologySignature, analyzeBundleContent, byteLength, checkBundleContent, checkCanonical, checkHreflang, checkHreflangReciprocity, checkHtmlDir, checkHtmlLang, checkInternalLinks, checkLocaleConsistency, checkOgLocale, checkRobots, checkSitemap, checkXDefault, classifyInternalLinks, collectSitemapEntries, detectRoutingStrategy, detectTechnologies, discoverSitemapUrls, extractAnchors, extractCanonicalHref, extractHreflangs, extractHtmlDir, extractHtmlLang, extractMetaDescription, extractOgImage, extractOgLocale, extractOgLocaleAlternates, extractResourceUrls, extractScriptUrls, extractTitle, extractVisibleTextStrings, fetchText, findMatchingLocale, formatBundleAnalysis, formatSize, getCheckDetailLines, getDefaultSitemapUrls, getFirstPathSegment, getLanguageCode, getLocalizedPages, getSiteDomain, getTechnologyGlobalNames, getUrlLocale, hasCanonical, isAbsoluteUrl, isBaseLocalePage, isPathAllowedByRobots, isRightToLeftLocale, isSameLanguage, isSameLocale, isValidLocaleCode, isValidOpenGraphLocale, looksLikeLocaleCode, mutateScore, normalizeHostname, normalizeLocaleCode, normalizeUrl, parseRobots, parseSitemap, parseUrl, runScanChecks, scanWebsite, scoreRecord, splitCheckDetails, technologySignatures, toOpenGraphLocale, toScorePercent };
|
|
@@ -19,6 +19,12 @@ export declare const extractTitle: (html: string) => string;
|
|
|
19
19
|
export declare const extractMetaDescription: (html: string) => string;
|
|
20
20
|
/** Extract the `<meta property="og:image">` content. */
|
|
21
21
|
export declare const extractOgImage: (html: string) => string | undefined;
|
|
22
|
+
/** Extract the `<meta property="og:locale">` content. */
|
|
23
|
+
export declare const extractOgLocale: (html: string) => string | undefined;
|
|
24
|
+
/** Extract every `<meta property="og:locale:alternate">` content. */
|
|
25
|
+
export declare const extractOgLocaleAlternates: (html: string) => string[];
|
|
26
|
+
/** Extract the `href` of the `<link rel="canonical">` element, if present. */
|
|
27
|
+
export declare const extractCanonicalHref: (html: string) => string | undefined;
|
|
22
28
|
/** Whether a `<link rel="canonical">` element is present. */
|
|
23
29
|
export declare const hasCanonical: (html: string) => boolean;
|
|
24
30
|
/** A parsed `<link rel="alternate" hreflang>` element. */
|
|
@@ -41,9 +47,20 @@ export declare const extractScriptUrls: (html: string, baseUrl: string) => strin
|
|
|
41
47
|
export type Anchor = {
|
|
42
48
|
href: string;
|
|
43
49
|
text: string;
|
|
50
|
+
/** `hreflang` attribute, set on language-switcher links. */
|
|
51
|
+
hreflang?: string;
|
|
44
52
|
};
|
|
45
53
|
/** Extract every `<a href="…">text</a>` anchor from the document. */
|
|
46
54
|
export declare const extractAnchors: (html: string) => Anchor[];
|
|
55
|
+
/**
|
|
56
|
+
* Extract every resource URL referenced by the document (`<script src>`,
|
|
57
|
+
* `<link href>`, `<iframe src>`), used to fingerprint third-party services.
|
|
58
|
+
*
|
|
59
|
+
* @param html - The raw HTML document.
|
|
60
|
+
* @param baseUrl - Base URL used to resolve relative URLs.
|
|
61
|
+
* @returns Absolute, de-duplicated URLs.
|
|
62
|
+
*/
|
|
63
|
+
export declare const extractResourceUrls: (html: string, baseUrl: string) => string[];
|
|
47
64
|
/**
|
|
48
65
|
* Extract visible text snippets from an HTML document (scripts, styles and
|
|
49
66
|
* tags stripped). Used to approximate the rendered content size without a DOM.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseHtml.d.ts","names":[],"sources":["../../../src/scan/parseHtml.ts"],"mappings":";;;;;;;;;;qBAUa,aAAU;;qBAkBV,kBAAe;;qBAMf,iBAAc;;qBAMd,eAAY;;qBAMZ,yBAAsB;;qBAWtB,iBAAc;;qBAWd,eAAY;;
|
|
1
|
+
{"version":3,"file":"parseHtml.d.ts","names":[],"sources":["../../../src/scan/parseHtml.ts"],"mappings":";;;;;;;;;;qBAUa,aAAU;;qBAkBV,kBAAe;;qBAMf,iBAAc;;qBAMd,eAAY;;qBAMZ,yBAAsB;;qBAWtB,iBAAc;;qBAWd,kBAAe;;qBAWf,4BAAyB;;qBAYzB,uBAAoB;;qBAWpB,eAAY;;YAIb;EAAiB;EAAkB;;;qBAGlC,mBAAgB,iBAAmB;;;;;;;;;qBAoBnC,oBAAiB,cAAgB;;YA4BlC;EACV;EACA;;EAEA;;;qBAIW,iBAAc,iBAAmB;;;;;;;;;qBAgCjC,sBAAmB,cAClB;;;;;qBAyBD,4BAAyB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/scan/robots.d.ts
|
|
2
|
+
/** Rules of a `robots.txt` that apply to Google's crawler. */
|
|
3
|
+
export type ParsedRobots = {
|
|
4
|
+
/** `Disallow` paths of the group applying to Googlebot (or `*`). */
|
|
5
|
+
disallowedPaths: string[];
|
|
6
|
+
/** `Allow` paths of the same group. */
|
|
7
|
+
allowedPaths: string[];
|
|
8
|
+
/** Absolute URLs declared with `Sitemap:` directives. */
|
|
9
|
+
sitemapUrls: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Parse a `robots.txt`, keeping the rules Googlebot would follow: the
|
|
13
|
+
* `googlebot` group when one exists, the `*` group otherwise.
|
|
14
|
+
*/
|
|
15
|
+
export declare const parseRobots: (content: string) => ParsedRobots;
|
|
16
|
+
/**
|
|
17
|
+
* Whether Googlebot may crawl `pathWithSearch` (path + query string) under the
|
|
18
|
+
* parsed rules. Follows Google's precedence: the longest matching rule wins,
|
|
19
|
+
* `Allow` wins ties.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isPathAllowedByRobots: (pathWithSearch: string, robots: Pick<ParsedRobots, 'disallowedPaths' | 'allowedPaths'>) => boolean;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=robots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"robots.d.ts","names":[],"sources":["../../../src/scan/robots.ts"],"mappings":";;YACY;;EAEV;;EAEA;;EAEA;;;;;;qBAaW,cAAW,oBAAsB;;;;;;qBAsEjC,wBAAqB,wBACV,QACd,KAAK"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TechnologyDetectionInput } from "./detection/detectTechnologies.js";
|
|
2
|
+
import { BundleChunkInput, ScanResult } from "./types.js";
|
|
3
|
+
import { ScanFetchOptions } from "./fetchText.js";
|
|
4
|
+
import { EmitScanEvent } from "./checks.js";
|
|
5
|
+
//#region src/scan/runScanChecks.d.ts
|
|
6
|
+
/** Page material gathered by the caller (fetch, puppeteer, browser…). */
|
|
7
|
+
export type ScanPageInput = {
|
|
8
|
+
/** Absolute URL of the scanned page. */
|
|
9
|
+
targetUrl: string;
|
|
10
|
+
/** HTML of the page, rendered when possible. */
|
|
11
|
+
html: string;
|
|
12
|
+
/** Fetched JavaScript chunks. */
|
|
13
|
+
chunks: BundleChunkInput[];
|
|
14
|
+
/** Total transferred bytes measured for the page. */
|
|
15
|
+
totalPageSize: number;
|
|
16
|
+
/** Network request URLs observed while loading the page. */
|
|
17
|
+
requestUrls?: string[];
|
|
18
|
+
/** Live-page signals (globals, storage keys) for technology detection. */
|
|
19
|
+
runtimeSignals?: Pick<TechnologyDetectionInput, 'globals' | 'storageKeys' | 'globalVersions'>;
|
|
20
|
+
};
|
|
21
|
+
/** Page-level information available before the network-bound checks. */
|
|
22
|
+
export type ScanPageInfo = Pick<ScanResult, 'metadata' | 'routing' | 'technologies' | 'locales'>;
|
|
23
|
+
/** Options of {@link runScanChecks}. */
|
|
24
|
+
export type RunScanChecksOptions = ScanFetchOptions & {
|
|
25
|
+
/** Called before each step, e.g. to stream a progress bar. */
|
|
26
|
+
onProgress?: (progress: number, message: string) => void;
|
|
27
|
+
/** Called once the page itself is analyzed (metadata, routing, stack). */
|
|
28
|
+
onPageInfo?: (pageInfo: ScanPageInfo) => void;
|
|
29
|
+
};
|
|
30
|
+
/** Output of {@link runScanChecks}. */
|
|
31
|
+
export type ScanChecksResult = Pick<ScanResult, 'metadata' | 'routing' | 'technologies' | 'locales' | 'bundle'>;
|
|
32
|
+
/**
|
|
33
|
+
* Run every i18n/SEO check on an already loaded page. Single implementation
|
|
34
|
+
* shared by the `intlayer scan` CLI and the hosted audit (`/api/scan`), which
|
|
35
|
+
* only differ in how they load the page.
|
|
36
|
+
*
|
|
37
|
+
* @param input - The loaded page (HTML, chunks, size, runtime signals).
|
|
38
|
+
* @param emit - Receives every check result as soon as it is produced.
|
|
39
|
+
* @param options - Network options and progress callbacks.
|
|
40
|
+
*/
|
|
41
|
+
export declare const runScanChecks: ({ targetUrl, html, chunks, totalPageSize, requestUrls, runtimeSignals }: ScanPageInput, emit: EmitScanEvent, { onProgress, onPageInfo, ...fetchOptions }: RunScanChecksOptions) => Promise<ScanChecksResult>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//# sourceMappingURL=runScanChecks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runScanChecks.d.ts","names":[],"sources":["../../../src/scan/runScanChecks.ts"],"mappings":";;;;;;YAuCY;;EAEV;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA,iBAAiB,KACf;;;YAMQ,eAAe,KACzB;;YAKU,uBAAuB;;EAEjC,cAAc,kBAAkB;;EAEhC,cAAc,UAAU;;;YAId,mBAAmB,KAC7B;;;;;;;;;;qBAuBW,kBAAa,WAAA,MAAA,QAAA,eAAA,aAAA,kBAQrB,eAAa,MACV,iBAAa,YAAA,eAAA,gBAC0B,yBAC5C,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanWebsite.d.ts","names":[],"sources":["../../../src/scan/scanWebsite.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"scanWebsite.d.ts","names":[],"sources":["../../../src/scan/scanWebsite.ts"],"mappings":";;;;;;;;;;;;;qBAmOa,cAAW,mBACL,UACR,gBACR,QAAQ"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ScanFetchOptions } from "./fetchText.js";
|
|
2
|
+
//#region src/scan/sitemap.d.ts
|
|
3
|
+
/** A `<url>` entry of a sitemap with its hreflang alternates. */
|
|
4
|
+
export type SitemapEntry = {
|
|
5
|
+
loc: string;
|
|
6
|
+
alternates: {
|
|
7
|
+
hreflang: string;
|
|
8
|
+
href: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
/** Result of {@link parseSitemap}. */
|
|
12
|
+
export type ParsedSitemap = {
|
|
13
|
+
/** `<url>` entries (empty for a sitemap index). */
|
|
14
|
+
entries: SitemapEntry[];
|
|
15
|
+
/** Child sitemap URLs, when the document is a `<sitemapindex>`. */
|
|
16
|
+
childSitemapUrls: string[];
|
|
17
|
+
};
|
|
18
|
+
/** Result of {@link collectSitemapEntries}. */
|
|
19
|
+
export type CollectedSitemaps = {
|
|
20
|
+
/** Sitemap URLs that answered with a valid document. */
|
|
21
|
+
fetchedSitemapUrls: string[];
|
|
22
|
+
entries: SitemapEntry[];
|
|
23
|
+
/** Whether the entry limit was reached before reading every sitemap. */
|
|
24
|
+
isTruncated: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Parse a sitemap or sitemap index (regex based, no XML dependency). Handles
|
|
28
|
+
* `<xhtml:link rel="alternate" hreflang>` alternates in any namespace prefix.
|
|
29
|
+
*/
|
|
30
|
+
export declare const parseSitemap: (xml: string) => ParsedSitemap;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the given sitemaps, following sitemap indexes one level deep, and
|
|
33
|
+
* gather their `<url>` entries.
|
|
34
|
+
*
|
|
35
|
+
* @param sitemapUrls - Sitemaps to read (from `robots.txt`, else defaults).
|
|
36
|
+
* @param fetchOptions - Network options, including the SSRF guard.
|
|
37
|
+
*/
|
|
38
|
+
export declare const collectSitemapEntries: (sitemapUrls: string[], fetchOptions: ScanFetchOptions) => Promise<CollectedSitemaps>;
|
|
39
|
+
/** Default sitemap locations tried when `robots.txt` declares none. */
|
|
40
|
+
export declare const getDefaultSitemapUrls: (origin: string) => string[];
|
|
41
|
+
/**
|
|
42
|
+
* List the page URLs of a site from its sitemaps (primary `<loc>` and every
|
|
43
|
+
* hreflang alternate), used to seed a multi-page audit.
|
|
44
|
+
*
|
|
45
|
+
* @returns De-duplicated URLs, or `[targetUrl]` when no sitemap is found.
|
|
46
|
+
*/
|
|
47
|
+
export declare const discoverSitemapUrls: (targetUrl: string, fetchOptions: ScanFetchOptions) => Promise<string[]>;
|
|
48
|
+
//#endregion
|
|
49
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","names":[],"sources":["../../../src/scan/sitemap.ts"],"mappings":";;;YAIY;EACV;EACA;IAAc;IAAkB;;;;YAItB;;EAEV,SAAS;;EAET;;;YAIU;;EAEV;EACA,SAAS;;EAET;;;;;;qBAiCW,eAAY,gBAAkB;;;;;;;;qBA6B9B,wBAAqB,uBACX,cACP,qBACb,QAAQ;;qBAoCE,wBAAqB;;;;;;;qBAWrB,sBAAmB,mBACb,cACH,qBACb"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Score } from "./calculateScore.js";
|
|
2
|
+
import { RoutingDetection } from "./detection/detectRoutingStrategy.js";
|
|
3
|
+
import { DetectedTechnology } from "./detection/detectTechnologies.js";
|
|
2
4
|
//#region src/scan/types.d.ts
|
|
3
5
|
/** Status of an individual scan check. */
|
|
4
6
|
export type ScanCheckStatus = 'success' | 'warning' | 'error';
|
|
@@ -66,6 +68,13 @@ export type ScanOptions = {
|
|
|
66
68
|
/** Override the User-Agent used for every request. */
|
|
67
69
|
userAgent?: string;
|
|
68
70
|
};
|
|
71
|
+
/** Title, description and preview image of the scanned page. */
|
|
72
|
+
export type PageMetadata = {
|
|
73
|
+
title: string;
|
|
74
|
+
description: string;
|
|
75
|
+
/** Absolute `og:image` URL, `''` when absent. */
|
|
76
|
+
image: string;
|
|
77
|
+
};
|
|
69
78
|
/** Result of scanning a single page. */
|
|
70
79
|
export type ScanResult = {
|
|
71
80
|
url: string;
|
|
@@ -85,6 +94,12 @@ export type ScanResult = {
|
|
|
85
94
|
locales: string[];
|
|
86
95
|
/** Locale-weight breakdown of the bundles, when computable. */
|
|
87
96
|
bundle?: BundleContentAnalysis;
|
|
97
|
+
/** How the site encodes the locale in its URLs. */
|
|
98
|
+
routing: RoutingDetection;
|
|
99
|
+
/** Frameworks, i18n libraries, TMS and translation proxies detected. */
|
|
100
|
+
technologies: DetectedTechnology[];
|
|
101
|
+
/** Title, description and preview image of the page. */
|
|
102
|
+
metadata: PageMetadata;
|
|
88
103
|
};
|
|
89
104
|
//#endregion
|
|
90
105
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/scan/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/scan/types.ts"],"mappings":";;;;;YAKY;;YAGA;EACV;EACA;EACA;;;;;;YAOU;EACV;EACA,QAAQ;EACR,UAAU;;;YAIA;;YAGA;EACV;;EAEA;EACA;;;YAIU;EACV;EACA;EACA;EACA;EACA;EACA;;EAEA;;;YAIU;EACV;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,kBAAkB;EAClB,kBAAkB;;;YAIR;;;;;;EAMV;;EAEA;;EAEA;;;YAIU;EACV;EACA;;EAEA;;;YAIU;EACV;;EAEA,MAAM;;EAEN;;EAEA;;EAEA;;EAEA,UAAU;;EAEV,QAAQ;;EAER;;EAEA,SAAS;;EAET,SAAS;;EAET,cAAc;;EAEd,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunkJSON.d.ts","names":[],"sources":["../../../src/utils/chunkJSON.ts"],"mappings":";;;;;;;;KAUK;KACA,YAAY,gBAAgB,aAAa;YAElC;GACT,YAAY;;KAGV,YAAY;KAEZ,OAAO;KAEP;EAAa;EAAW,MAAM;EAAM,OAAO;;KAC3C;EACH;EACA,MAAM;EACN;EACA;EACA;;KAEG,QAAQ,WAAW;KAEnB;YAEO;EACV;EACA;EACA;EACA,UAAU;EACV;EACA,SAAS;;;;;
|
|
1
|
+
{"version":3,"file":"chunkJSON.d.ts","names":[],"sources":["../../../src/utils/chunkJSON.ts"],"mappings":";;;;;;;;KAUK;KACA,YAAY,gBAAgB,aAAa;YAElC;GACT,YAAY;;KAGV,YAAY;KAEZ,OAAO;KAEP;EAAa;EAAW,MAAM;EAAM,OAAO;;KAC3C;EACH;EACA,MAAM;EACN;EACA;EACA;;KAEG,QAAQ,WAAW;KAEnB;YAEO;EACV;EACA;EACA;EACA,UAAU;EACV;EACA,SAAS;;;;;qBA+ME,YAAS,OACb,aAAa,WAAS,qBAE5B;;;;;;;;;;;qBAsHU,6BAA0B,OAC9B,cACN,aAAa;qBAiGH,eAAY,QAAY,gBAAc,aAAa"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/utils/getProcessChainCommands.d.ts
|
|
2
|
+
/** Process as listed by the OS: its parent and the command line it runs. */
|
|
3
|
+
export type ProcessEntry = {
|
|
4
|
+
parentPid: number;
|
|
5
|
+
command: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Parses the output of `ps -A -o pid=,ppid=,command=`.
|
|
9
|
+
*
|
|
10
|
+
* @param output - One `<pid> <ppid> <command>` row per line.
|
|
11
|
+
* @returns The processes, keyed by PID.
|
|
12
|
+
*/
|
|
13
|
+
export declare const parseProcessTable: (output: string) => Map<number, ProcessEntry>;
|
|
14
|
+
/**
|
|
15
|
+
* Command lines of this process and of the processes above it, closest first.
|
|
16
|
+
*
|
|
17
|
+
* This process is included because some runtimes restart the script inside
|
|
18
|
+
* the same process, leaving their watch flag only on their own command line
|
|
19
|
+
* (`deno run --watch`).
|
|
20
|
+
*
|
|
21
|
+
* Best effort: resolves to an empty list on Windows, or when the process list
|
|
22
|
+
* cannot be read (sandbox, missing `ps`, Deno without the permission), and
|
|
23
|
+
* never throws.
|
|
24
|
+
*
|
|
25
|
+
* @param maxDepth - How many processes to read at most, this one included.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* await getProcessChainCommands();
|
|
30
|
+
* // → ['node src/index.js', 'node …/nodemon src/index.js', 'npm run dev']
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const getProcessChainCommands: (maxDepth?: number) => Promise<string[]>;
|
|
34
|
+
//#endregion
|
|
35
|
+
//# sourceMappingURL=getProcessChainCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProcessChainCommands.d.ts","names":[],"sources":["../../../src/utils/getProcessChainCommands.ts"],"mappings":";;YAKY;EACV;EACA;;;;;;;;qBAYW,oBAAiB,mBAE3B,YAAY;;;;;;;;;;;;;;;;;;;;qBA2GF,0BAAuB,sBAEjC"}
|
|
@@ -20,6 +20,7 @@ import { RunOnceContext, runOnce } from "./runOnce.js";
|
|
|
20
20
|
import { ParallelHandle, runParallel } from "./runParallel/index.js";
|
|
21
21
|
import { sortAlphabetically } from "./sortAlphabetically.js";
|
|
22
22
|
import { splitTextByLines } from "./splitTextByLine.js";
|
|
23
|
+
import { StartContentWatcherOptions, startContentWatcher } from "./startContentWatcher.js";
|
|
23
24
|
import { verifyIdenticObjectFormat } from "./verifyIdenticObjectFormat.js";
|
|
24
25
|
import { withFileLock } from "./withFileLock.js";
|
|
25
|
-
export { CLI_CONTENT_WATCHER_ENV_VAR, ContentDeclarationFileName, ContentWatcherOwner, ContentWatcherSource, Extension, Format, JSONObject, JsonChunk, ParallelHandle, Primitive, Queue, Recursive, RunOnceContext, acquireContentWatcherLock, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkArray, chunkJSON, claimCliContentWatcher, excludeObjectFormat, formatLocale, formatPath, getChunk, getCliContentWatcherLabel, getContentExtension, getContentWatcherLockFilePath, getContentWatcherOwner, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, parseContentDeclarationFileName, reconstructFromSingleChunk, reduceObjectFormat, reportRedundantContentWatcher, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat, withFileLock };
|
|
26
|
+
export { CLI_CONTENT_WATCHER_ENV_VAR, ContentDeclarationFileName, ContentWatcherOwner, ContentWatcherSource, Extension, Format, JSONObject, JsonChunk, ParallelHandle, Primitive, Queue, Recursive, RunOnceContext, StartContentWatcherOptions, acquireContentWatcherLock, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkArray, chunkJSON, claimCliContentWatcher, excludeObjectFormat, formatLocale, formatPath, getChunk, getCliContentWatcherLabel, getContentExtension, getContentWatcherLockFilePath, getContentWatcherOwner, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, parseContentDeclarationFileName, reconstructFromSingleChunk, reduceObjectFormat, reportRedundantContentWatcher, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, startContentWatcher, verifyIdenticObjectFormat, withFileLock };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pidTree.d.ts","names":[],"sources":["../../../../src/utils/runParallel/pidTree.ts"],"mappings":";UAgBU;EACR;EACA;;KAGG;EAAgB;EAAa;;KAC7B,WAAW,UAAU,2BAA2B;EACnD;IAEE;KAIC,aAAa,UAAU,4BAC1B,KAAK,cACL,OAAO,WAAW;;;;;;;;
|
|
1
|
+
{"version":3,"file":"pidTree.d.ts","names":[],"sources":["../../../../src/utils/runParallel/pidTree.ts"],"mappings":";UAgBU;EACR;EACA;;KAGG;EAAgB;EAAa;;KAC7B,WAAW,UAAU,2BAA2B;EACnD;IAEE;KAIC,aAAa,UAAU,4BAC1B,KAAK,cACL,OAAO,WAAW;;;;;;;;qBA+MP,OAAQ,UAAU,yBAAuB,sBAChC,UACV,IAAI,aAAa,IAAE,WAClB,aAAa,OACvB,QAAQ,WAAW"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
|
+
//#region src/utils/startContentWatcher.d.ts
|
|
3
|
+
export type StartContentWatcherOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* How the integration names itself in the lock and in messages, e.g.
|
|
6
|
+
* `vite-intlayer`.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether this process must never own the watcher, re-checked on every
|
|
11
|
+
* attempt (e.g. a helper process that outlives the dev server).
|
|
12
|
+
*/
|
|
13
|
+
getShouldSkip?: () => boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Starts the content declaration watcher from an integration (bundler plugin or
|
|
17
|
+
* server middleware), making sure only one watcher rebuilds a project's
|
|
18
|
+
* dictionaries.
|
|
19
|
+
*
|
|
20
|
+
* - Idempotent within a process, across module copies and hot reloads.
|
|
21
|
+
* - Stands down, with an explanation, when `intlayer watch` already covers the
|
|
22
|
+
* project, whether it spawned this process (`--with`) or runs elsewhere.
|
|
23
|
+
* - Otherwise the first process to take the project lock watches; the others
|
|
24
|
+
* retry in the background to take over once it stops.
|
|
25
|
+
*
|
|
26
|
+
* Not awaitable on purpose: a dev server must not wait on the watcher to serve.
|
|
27
|
+
*
|
|
28
|
+
* @param configuration - The resolved Intlayer configuration.
|
|
29
|
+
* @param options - How the integration identifies itself.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* configureServer() {
|
|
34
|
+
* startContentWatcher(configuration, { label: 'vite-intlayer' });
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare const startContentWatcher: (configuration: IntlayerConfig, options: StartContentWatcherOptions) => void;
|
|
39
|
+
//#endregion
|
|
40
|
+
//# sourceMappingURL=startContentWatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startContentWatcher.d.ts","names":[],"sources":["../../../src/utils/startContentWatcher.ts"],"mappings":";;YAgBY;;;;;EAKV;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;qBA6GW,sBAAmB,eACf,gBAAc,SACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;KA0DK;EACH,gBAAgB;EAChB,gBAAgB;EAChB;EACA;;qBAsBW,QAAK,UAAoB,iBAAY;EAkDZ,mBAAM;;qBAgR/B,wBAAqB,UAAoB,iBAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeMarkdownFile.d.ts","names":[],"sources":["../../../src/writeContentDeclaration/writeMarkdownFile.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"writeMarkdownFile.d.ts","names":[],"sources":["../../../src/writeContentDeclaration/writeMarkdownFile.ts"],"mappings":";;;qBA+Da,oBAAiB,0BACJ,YACZ,YAAU,eACP,mBACd"}
|