UNPKG

@angular/service-worker

Version:

Angular - service worker tooling!

1 lines • 18.7 kB
{"version":3,"file":"config.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/service-worker/config/src/duration.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/service-worker/config/src/glob.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/service-worker/config/src/generator.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst PARSE_TO_PAIRS = /([0-9]+[^0-9]+)/g;\nconst PAIR_SPLIT = /^([0-9]+)([dhmsu]+)$/;\n\nexport function parseDurationToMs(duration: string): number {\n const matches: string[] = [];\n\n let array: RegExpExecArray | null;\n while ((array = PARSE_TO_PAIRS.exec(duration)) !== null) {\n matches.push(array[0]);\n }\n return matches\n .map((match) => {\n const res = PAIR_SPLIT.exec(match);\n if (res === null) {\n throw new Error(`Not a valid duration: ${match}`);\n }\n let factor: number = 0;\n switch (res[2]) {\n case 'd':\n factor = 86400000;\n break;\n case 'h':\n factor = 3600000;\n break;\n case 'm':\n factor = 60000;\n break;\n case 's':\n factor = 1000;\n break;\n case 'u':\n factor = 1;\n break;\n default:\n throw new Error(`Not a valid duration unit: ${res[2]}`);\n }\n return parseInt(res[1]) * factor;\n })\n .reduce((total, value) => total + value, 0);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nconst QUESTION_MARK = '[^/]';\nconst WILD_SINGLE = '[^/]*';\nconst WILD_OPEN = '(?:.+\\\\/)?';\n\nconst TO_ESCAPE_BASE = [\n {replace: /\\./g, with: '\\\\.'},\n {replace: /\\+/g, with: '\\\\+'},\n {replace: /\\*/g, with: WILD_SINGLE},\n];\nconst TO_ESCAPE_WILDCARD_QM = [...TO_ESCAPE_BASE, {replace: /\\?/g, with: QUESTION_MARK}];\nconst TO_ESCAPE_LITERAL_QM = [...TO_ESCAPE_BASE, {replace: /\\?/g, with: '\\\\?'}];\n\nexport function globToRegex(glob: string, literalQuestionMark = false): string {\n const toEscape = literalQuestionMark ? TO_ESCAPE_LITERAL_QM : TO_ESCAPE_WILDCARD_QM;\n const segments = glob.split('/').reverse();\n let regex: string = '';\n while (segments.length > 0) {\n const segment = segments.pop()!;\n if (segment === '**') {\n if (segments.length > 0) {\n regex += WILD_OPEN;\n } else {\n regex += '.*';\n }\n } else {\n const processed = toEscape.reduce(\n (segment, escape) => segment.replace(escape.replace, escape.with),\n segment,\n );\n regex += processed;\n if (segments.length > 0) {\n regex += '\\\\/';\n }\n }\n }\n return regex;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {parseDurationToMs} from './duration';\nimport {Filesystem} from './filesystem';\nimport {globToRegex} from './glob';\nimport {AssetGroup, Config} from './in';\n\nconst DEFAULT_NAVIGATION_URLS = [\n '/**', // Include all URLs.\n '!/**/*.*', // Exclude URLs to files (containing a file extension in the last segment).\n '!/**/*__*', // Exclude URLs containing `__` in the last segment.\n '!/**/*__*/**', // Exclude URLs containing `__` in any other segment.\n];\n\n/**\n * Consumes service worker configuration files and processes them into control files.\n *\n * @publicApi\n */\nexport class Generator {\n constructor(\n readonly fs: Filesystem,\n private baseHref: string,\n ) {}\n\n async process(config: Config): Promise<Object> {\n const unorderedHashTable = {};\n const assetGroups = await this.processAssetGroups(config, unorderedHashTable);\n\n return {\n configVersion: 1,\n timestamp: Date.now(),\n appData: config.appData,\n index: joinUrls(this.baseHref, config.index),\n assetGroups,\n dataGroups: this.processDataGroups(config),\n hashTable: withOrderedKeys(unorderedHashTable),\n navigationUrls: processNavigationUrls(this.baseHref, config.navigationUrls),\n navigationRequestStrategy: config.navigationRequestStrategy ?? 'performance',\n applicationMaxAge: config.applicationMaxAge\n ? parseDurationToMs(config.applicationMaxAge)\n : undefined,\n };\n }\n\n private async processAssetGroups(\n config: Config,\n hashTable: {[file: string]: string | undefined},\n ): Promise<Object[]> {\n // Retrieve all files of the build.\n const allFiles = await this.fs.list('/');\n const seenMap = new Set<string>();\n const filesPerGroup = new Map<AssetGroup, string[]>();\n\n // Computed which files belong to each asset-group.\n for (const group of config.assetGroups || []) {\n if ((group.resources as any).versionedFiles) {\n throw new Error(\n `Asset-group '${group.name}' in 'ngsw-config.json' uses the 'versionedFiles' option, ` +\n \"which is no longer supported. Use 'files' instead.\",\n );\n }\n\n const fileMatcher = globListToMatcher(group.resources.files || []);\n const matchedFiles = allFiles\n .filter(fileMatcher)\n .filter((file) => !seenMap.has(file))\n .sort();\n\n matchedFiles.forEach((file) => seenMap.add(file));\n filesPerGroup.set(group, matchedFiles);\n }\n\n // Compute hashes for all matched files and add them to the hash-table.\n const allMatchedFiles = ([] as string[]).concat(...Array.from(filesPerGroup.values())).sort();\n const allMatchedHashes = await processInBatches(allMatchedFiles, 500, (file) =>\n this.fs.hash(file),\n );\n allMatchedFiles.forEach((file, idx) => {\n hashTable[joinUrls(this.baseHref, file)] = allMatchedHashes[idx];\n });\n\n // Generate and return the processed asset-groups.\n return Array.from(filesPerGroup.entries()).map(([group, matchedFiles]) => ({\n name: group.name,\n installMode: group.installMode || 'prefetch',\n updateMode: group.updateMode || group.installMode || 'prefetch',\n cacheQueryOptions: buildCacheQueryOptions(group.cacheQueryOptions),\n urls: matchedFiles.map((url) => joinUrls(this.baseHref, url)),\n patterns: (group.resources.urls || []).map((url) => urlToRegex(url, this.baseHref, true)),\n }));\n }\n\n private processDataGroups(config: Config): Object[] {\n return (config.dataGroups || []).map((group) => {\n return {\n name: group.name,\n patterns: group.urls.map((url) => urlToRegex(url, this.baseHref, true)),\n strategy: group.cacheConfig.strategy || 'performance',\n maxSize: group.cacheConfig.maxSize,\n maxAge: parseDurationToMs(group.cacheConfig.maxAge),\n timeoutMs: group.cacheConfig.timeout && parseDurationToMs(group.cacheConfig.timeout),\n refreshAheadMs:\n group.cacheConfig.refreshAhead && parseDurationToMs(group.cacheConfig.refreshAhead),\n cacheOpaqueResponses: group.cacheConfig.cacheOpaqueResponses,\n cacheQueryOptions: buildCacheQueryOptions(group.cacheQueryOptions),\n version: group.version !== undefined ? group.version : 1,\n };\n });\n }\n}\n\nexport function processNavigationUrls(\n baseHref: string,\n urls = DEFAULT_NAVIGATION_URLS,\n): {positive: boolean; regex: string}[] {\n return urls.map((url) => {\n const positive = !url.startsWith('!');\n url = positive ? url : url.slice(1);\n return {positive, regex: `^${urlToRegex(url, baseHref)}$`};\n });\n}\n\nasync function processInBatches<I, O>(\n items: I[],\n batchSize: number,\n processFn: (item: I) => O | Promise<O>,\n): Promise<O[]> {\n const batches = [];\n\n for (let i = 0; i < items.length; i += batchSize) {\n batches.push(items.slice(i, i + batchSize));\n }\n\n return batches.reduce(\n async (prev, batch) =>\n (await prev).concat(await Promise.all(batch.map((item) => processFn(item)))),\n Promise.resolve<O[]>([]),\n );\n}\n\nfunction globListToMatcher(globs: string[]): (file: string) => boolean {\n const patterns = globs.map((pattern) => {\n if (pattern.startsWith('!')) {\n return {\n positive: false,\n regex: new RegExp('^' + globToRegex(pattern.slice(1)) + '$'),\n };\n } else {\n return {\n positive: true,\n regex: new RegExp('^' + globToRegex(pattern) + '$'),\n };\n }\n });\n return (file: string) => matches(file, patterns);\n}\n\nfunction matches(file: string, patterns: {positive: boolean; regex: RegExp}[]): boolean {\n return patterns.reduce((isMatch, pattern) => {\n if (pattern.positive) {\n return isMatch || pattern.regex.test(file);\n } else {\n return isMatch && !pattern.regex.test(file);\n }\n }, false);\n}\n\nfunction urlToRegex(url: string, baseHref: string, literalQuestionMark?: boolean): string {\n if (!url.startsWith('/') && url.indexOf('://') === -1) {\n // Prefix relative URLs with `baseHref`.\n // Strip a leading `.` from a relative `baseHref` (e.g. `./foo/`), since it would result in an\n // incorrect regex (matching a literal `.`).\n url = joinUrls(baseHref.replace(/^\\.(?=\\/)/, ''), url);\n }\n\n return globToRegex(url, literalQuestionMark);\n}\n\nfunction joinUrls(a: string, b: string): string {\n if (a.endsWith('/') && b.startsWith('/')) {\n return a + b.slice(1);\n } else if (!a.endsWith('/') && !b.startsWith('/')) {\n return a + '/' + b;\n }\n return a + b;\n}\n\nfunction withOrderedKeys<T extends {[key: string]: any}>(unorderedObj: T): T {\n const orderedObj = {} as {[key: string]: any};\n Object.keys(unorderedObj)\n .sort()\n .forEach((key) => (orderedObj[key] = unorderedObj[key]));\n return orderedObj as T;\n}\n\nfunction buildCacheQueryOptions(\n inOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>,\n): CacheQueryOptions {\n return {\n ignoreVary: true,\n ...inOptions,\n };\n}\n"],"names":[],"mappings":";;;;;;AAQA,MAAM,cAAc,GAAG,kBAAkB;AACzC,MAAM,UAAU,GAAG,sBAAsB;AAEnC,SAAU,iBAAiB,CAAC,QAAgB,EAAA;EAChD,MAAM,OAAO,GAAa,EAAE;AAE5B,EAAA,IAAI,KAA6B;EACjC,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE;AACvD,IAAA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxB,EAAA;AACA,EAAA,OAAO,OAAA,CACJ,GAAG,CAAE,KAAK,IAAI;AACb,IAAA,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;IAClC,IAAI,GAAG,KAAK,IAAI,EAAE;AAChB,MAAA,MAAM,IAAI,KAAK,CAAC,CAAA,sBAAA,EAAyB,KAAK,EAAE,CAAC;AACnD,IAAA;IACA,IAAI,MAAM,GAAW,CAAC;IACtB,QAAQ,GAAG,CAAC,CAAC,CAAC;AACZ,MAAA,KAAK,GAAG;AACN,QAAA,MAAM,GAAG,QAAQ;AACjB,QAAA;AACF,MAAA,KAAK,GAAG;AAC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