Skip to content

Commit b300139

Browse files
committed
build: add @types/cacache
1 parent 78acf11 commit b300139

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"@types/babel__core": "7.1.10",
9494
"@types/babel__template": "7.0.3",
9595
"@types/browserslist": "^4.4.0",
96+
"@types/cacache": "^12.0.1",
9697
"@types/caniuse-lite": "^1.0.0",
9798
"@types/copy-webpack-plugin": "^6.0.0",
9899
"@types/cssnano": "^4.0.0",

packages/angular_devkit/build_angular/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ ts_library(
114114
"@npm//@types/babel__core",
115115
"@npm//@types/babel__template",
116116
"@npm//@types/browserslist",
117+
"@npm//@types/cacache",
117118
"@npm//@types/caniuse-lite",
118119
"@npm//@types/copy-webpack-plugin",
119120
"@npm//@types/cssnano",

packages/angular_devkit/build_angular/src/utils/action-cache.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
import * as cacache from 'cacache';
89
import { createHash } from 'crypto';
910
import * as fs from 'fs';
1011
import { copyFile } from './copy-file';
1112
import { allowMangle } from './environment-options';
1213
import { CacheKey, ProcessBundleOptions, ProcessBundleResult } from './process-bundle';
1314

14-
const cacache = require('cacache');
1515
const packageVersion = require('../../package.json').version;
1616

1717
export interface CacheEntry {
@@ -98,7 +98,8 @@ export class BundleActionCache {
9898
}
9999
cacheEntries.push({
100100
path: entry.path,
101-
size: entry.size,
101+
// tslint:disable-next-line: no-any
102+
size: (entry as any).size,
102103
integrity: entry.metadata && entry.metadata.integrity,
103104
});
104105
} else {

packages/angular_devkit/build_angular/src/utils/process-bundle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
types,
1717
} from '@babel/core';
1818
import templateBuilder from '@babel/template';
19+
import * as cacache from 'cacache';
1920
import { createHash } from 'crypto';
2021
import * as fs from 'fs';
2122
import * as path from 'path';
@@ -35,7 +36,6 @@ import { isWebpackFiveOrHigher } from './webpack-version';
3536

3637
type LocalizeUtilities = typeof import('@angular/localize/src/tools/src/source_file_utils');
3738

38-
const cacache = require('cacache');
3939
const deserialize = ((v8 as unknown) as { deserialize(buffer: Buffer): unknown }).deserialize;
4040

4141
// If code size is larger than 500KB, consider lower fidelity but faster sourcemap merge
@@ -97,7 +97,7 @@ export function setup(data: number[] | { cachePath: string; i18n: I18nOptions })
9797

9898
async function cachePut(content: string, key: string | undefined, integrity?: string): Promise<void> {
9999
if (cachePath && key) {
100-
await cacache.put(cachePath, key || null, content, {
100+
await cacache.put(cachePath, key, content, {
101101
metadata: { integrity },
102102
});
103103
}

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,13 @@
14871487
resolved "https://registry.yarnpkg.com/@types/browserslist/-/browserslist-4.8.0.tgz#60489aefdf0fcb56c2d8eb65267ff08dad7a526d"
14881488
integrity sha512-4PyO9OM08APvxxo1NmQyQKlJdowPCOQIy5D/NLO3aO0vGC57wsMptvGp3b8IbYnupFZr92l1dlVief1JvS6STQ==
14891489

1490+
"@types/cacache@^12.0.1":
1491+
version "12.0.1"
1492+
resolved "https://registry.yarnpkg.com/@types/cacache/-/cacache-12.0.1.tgz#1067140256647139fcbb06f6167dcb99e1e6d143"
1493+
integrity sha512-w7xjwtvB8X8wItoZo16oTDDJy1ub03CbKUM/A8SORv2igg/L6AxAtnNIlV/2STbuj5PFKwb3ySV7zR/g1nqldw==
1494+
dependencies:
1495+
"@types/node" "*"
1496+
14901497
"@types/cacheable-request@^6.0.1":
14911498
version "6.0.1"
14921499
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976"

0 commit comments

Comments
 (0)